bug修改

purchase
anthonyywj2 3 years ago
parent 3b3699c521
commit 52c94993d5

@ -1,357 +1,360 @@
<template> <template>
<div> <div>
<el-card> <el-card>
<el-form :inline="true" :model="filterQuery" class="query-form" size="mini"> <el-form :inline="true" :model="filterQuery" class="query-form" size="mini">
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input <el-input
v-model="filterQuery.name" v-model="filterQuery.name"
style="width: 250px" style="width: 250px"
placeholder="单据类型名称" placeholder="单据类型名称"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button-group style="margin-left: 10px;display:flex;"> <el-button-group style="margin-left: 10px;display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button> <el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="search" @click="search"></el-button> <el-button type="primary" icon="search" @click="search"></el-button>
<el-button type="primary" icon="search" @click="handleAddClick" <el-button type="primary" icon="search" @click="handleAddClick"
:disabled="!configParms.entrustAction" :disabled="!configParms.entrustAction"
>新增 >新增
</el-button </el-button
> >
</el-button-group> </el-button-group>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="loading" :data="list" style="width: 100%"> <el-table v-loading="loading" :data="list" style="width: 100%">
<el-table-column label="序号" type="index" width="60" fixed></el-table-column> <el-table-column label="序号" type="index" width="60" fixed></el-table-column>
<el-table-column label="扫码单据类型" prop="curName" fixed></el-table-column> <el-table-column label="扫码单据类型" prop="curName" fixed></el-table-column>
<el-table-column label="当前仓库" prop="curInvName" fixed></el-table-column> <el-table-column label="当前仓库" prop="curInvName" fixed></el-table-column>
<el-table-column label="当前分库" prop="invWarehouseName" fixed></el-table-column> <el-table-column label="当前分库" prop="invWarehouseName" fixed></el-table-column>
<el-table-column label="委托验收仓库" prop="entrustInvName" fixed></el-table-column> <el-table-column label="委托验收仓库" prop="entrustInvName" fixed></el-table-column>
<el-table-column label="委托验收分库" prop="entrustSubInvName" fixed></el-table-column> <el-table-column label="委托验收分库" prop="entrustSubInvName" fixed></el-table-column>
<el-table-column label="委托验收人" prop="employeeName" fixed> <el-table-column label="委托验收人" prop="employeeName" fixed>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right"> <el-table-column label="操作" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.native.stop="handleModifyClick(scope.row)" @click.native.stop="handleModifyClick(scope.row)"
:disabled="!configParms.entrustAction" :disabled="!configParms.entrustAction"
>编辑 >编辑
</el-button </el-button
> >
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.native.stop="deleteDialog(scope.row)" @click.native.stop="deleteDialog(scope.row)"
:disabled="!configParms.entrustAction" :disabled="!configParms.entrustAction"
>删除 >删除
</el-button </el-button
> >
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-dialog <el-dialog
title="新增委托验收" title="新增委托验收"
:visible.sync="addDialogVisible" :visible.sync="addDialogVisible"
width="70%" width="70%"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
v-if="addDialogVisible" v-if="addDialogVisible"
> >
<modifyDialog :inputQuery="inputQuery"></modifyDialog> <modifyDialog :inputQuery="inputQuery"></modifyDialog>
<div style="text-align: center"> <div style="text-align: center">
<el-button type="primary" size="small" icon="search" @click="onAddSubmit" <el-button type="primary" size="small" icon="search" @click="onAddSubmit"
>提交 >提交
</el-button </el-button
> >
<el-button type="primary" size="small" icon="search" @click="cancelDialog" <el-button type="primary" size="small" icon="search" @click="cancelDialog"
>取消 >取消
</el-button </el-button
> >
</div> </div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
title="编辑委托验收" title="编辑委托验收"
:visible.sync="modifyDialogVisible" :visible.sync="modifyDialogVisible"
width="70%" width="70%"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
v-if="modifyDialogVisible" v-if="modifyDialogVisible"
> >
<modifyDialog :inputQuery="inputQuery"></modifyDialog> <modifyDialog :inputQuery="inputQuery"></modifyDialog>
<div style="text-align: center"> <div style="text-align: center">
<el-button type="primary" size="small" icon="search" @click="onModifySubmit" <el-button type="primary" size="small" icon="search" @click="onModifySubmit"
>提交 >提交
</el-button </el-button
> >
<el-button type="primary" size="small" icon="search" @click="cancelDialog" <el-button type="primary" size="small" icon="search" @click="cancelDialog"
>取消 >取消
</el-button </el-button
> >
</div> </div>
</el-dialog> </el-dialog>
<el-pagination <el-pagination
:page-size="filterQuery.limit" :page-size="filterQuery.limit"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
layout="prev, pager, next" layout="prev, pager, next"
:total="total" :total="total"
:current-page="filterQuery.page" :current-page="filterQuery.page"
></el-pagination> ></el-pagination>
</el-card> </el-card>
</div> </div>
</template> </template>
<script> <script>
import { import {
getEntrustRece, getEntrustRece,
deleteEntrustRece, deleteEntrustRece,
updateEntrustRece, updateEntrustRece,
insertEntrustRece, insertEntrustRece,
} from "../../api/basic/EntrustRece"; } from "../../api/basic/EntrustRece";
import modifyDialog from "./BasicEntrutsReceModify"; import modifyDialog from "./BasicEntrutsReceModify";
import {findConfig} from "@/api/thrsys/spsSyncStatus"; import {findConfig} from "@/api/thrsys/spsSyncStatus";
export default { export default {
data() { data() {
return { return {
filterQuery: { filterQuery: {
name: "", name: "",
page: 1, page: 1,
limit: 20, limit: 20,
}, },
loading: false, loading: false,
addDialogVisible: false, addDialogVisible: false,
modifyDialogVisible: false, modifyDialogVisible: false,
list: [], list: [],
inputQuery: { inputQuery: {
action: "", action: "",
name: "", name: "",
entrustInv: "", entrustInv: "",
entrustUser: "", entrustUser: "",
entrustAction: null, entrustAction: null,
finishRece: false, finishRece: false,
curInv: "", curInv: "",
entrustSubInv: "", entrustSubInv: "",
invWarehouseCode: "", invWarehouseCode: "",
}, },
enableMap: { enableMap: {
true: "是", true: "是",
false: "否", false: "否",
}, },
mainActionMap: { mainActionMap: {
WareHouseIn: "入库", WareHouseIn: "入库",
WareHouseOut: "出库" WareHouseOut: "出库"
}, },
fileList: [], fileList: [],
total: 0, total: 0,
multipleSelection: [], multipleSelection: [],
uploadFileUrl: null, uploadFileUrl: null,
headers: {}, headers: {},
configParms: {}, configParms: {},
}; };
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
name: "",
page: 1,
limit: 20,
};
this.getList();
},
cancelDialog() {
this.modifyDialogVisible = false;
this.addDialogVisible = false;
},
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
},
search() {
this.filterQuery.page = 1;
this.getList();
},
getList() {
this.loading = true;
getEntrustRece(this.filterQuery)
.then((response) => {
this.loading = false;
this.list = response.data.list || [];
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
}, },
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
name: "",
page: 1,
limit: 20,
};
this.getList();
},
cancelDialog() {
this.modifyDialogVisible = false;
this.addDialogVisible = false;
},
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
},
search() {
this.filterQuery.page = 1;
this.getList();
},
getList() {
this.loading = true;
getEntrustRece(this.filterQuery)
.then((response) => {
this.loading = false;
this.list = response.data.list || [];
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
onAddSubmit() {
onAddSubmit() { if (this.$isBlank(this.inputQuery.action)) {
this.$message.error("单据类型不能为空!");
return;
}
if (this.$isBlank(this.inputQuery.curInv)) {
this.$message.error("请输入委托仓库!");
return;
}
if (this.$isBlank(this.inputQuery.entrustInv)) {
this.$message.error("请输入接受委托仓库!");
return;
}
if (this.$isBlank(this.inputQuery.entrustUser)) {
this.$message.error("请输入接受委托人!");
return;
}
if (this.$isBlank(this.inputQuery.action)) { if (this.$isBlank(this.inputQuery.invWarehouseCode)) {
this.$message.error("单据类型不能为空!"); this.$message.error("当前分库不能为空!");
return; return;
} }
if (this.$isBlank(this.inputQuery.curInv)) { if (this.$isBlank(this.inputQuery.entrustSubInv)) {
this.$message.error("请输入委托仓库!"); this.$message.error("请输入接受委托分库!");
return; return;
} }
if (this.$isBlank(this.inputQuery.entrustInv)) {
this.$message.error("请输入接受委托仓库!");
return;
}
if (this.$isBlank(this.inputQuery.entrustUser)) {
this.$message.error("请输入接受委托人!");
return;
}
if (this.$isBlank(this.inputQuery.invWarehouseCode)) { if (this.$isBlank(this.inputQuery.entrustAction)) {
this.$message.error("当前分库不能为空!"); this.$message.error("请输入生成单据类型!");
return; return;
} }
if (this.$isBlank(this.inputQuery.entrustSubInv)) {
this.$message.error("请输入接受委托分库!");
return;
}
if (this.$isBlank(this.inputQuery.entrustAction)) { insertEntrustRece(this.inputQuery)
this.$message.error("请输入生成单据类型!"); .then((response) => {
return; if (response.code == 20000) {
this.loading = false;
this.cancelDialog();
this.getList();
} else {
this.$message.error(response.message);
} }
})
.catch(() => {
this.loading = false;
this.cancelDialog();
});
},
insertEntrustRece(this.inputQuery) onModifySubmit() {
.then((response) => { if (this.$isBlank(this.inputQuery.action)) {
if (response.code == 20000) { this.$message.error("单据类型不能为空!");
this.loading = false; return;
this.cancelDialog(); }
this.getList(); if (this.$isBlank(this.inputQuery.curInv)) {
} else { this.$message.error("请输入委托仓库!");
this.$message.error(response.message); return;
} }
}) if (this.$isBlank(this.inputQuery.entrustInv)) {
.catch(() => { this.$message.error("请输入接受委托仓库!");
this.loading = false; return;
this.cancelDialog(); }
}); if (this.$isBlank(this.inputQuery.entrustUser)) {
}, this.$message.error("请输入接受委托人!");
return;
onModifySubmit() { }
if (this.$isBlank(this.inputQuery.action)) {
this.$message.error("单据类型不能为空!");
return;
}
if (this.$isBlank(this.inputQuery.curInv)) {
this.$message.error("请输入委托仓库!");
return;
}
if (this.$isBlank(this.inputQuery.entrustInv)) {
this.$message.error("请输入接受委托仓库!");
return;
}
if (this.$isBlank(this.inputQuery.entrustUser)) {
this.$message.error("请输入接受委托人!");
return;
}
if (this.$isBlank(this.inputQuery.invWarehouseCode)) { if (this.$isBlank(this.inputQuery.invWarehouseCode)) {
this.$message.error("当前分库不能为空!"); this.$message.error("当前分库不能为空!");
return; return;
} }
if (this.$isBlank(this.inputQuery.entrustSubInv)) { if (this.$isBlank(this.inputQuery.entrustSubInv)) {
this.$message.error("请输入接受委托分库!"); this.$message.error("请输入接受委托分库!");
return; return;
} }
if (this.$isBlank(this.inputQuery.entrustAction)) { if (this.$isBlank(this.inputQuery.entrustAction)) {
this.$message.error("请输入生成单据类型!"); this.$message.error("请输入生成单据类型!");
return; return;
} }
updateEntrustRece(this.inputQuery) updateEntrustRece(this.inputQuery)
.then((response) => { .then((response) => {
this.loading = false; this.loading = false;
this.cancelDialog(); this.cancelDialog();
this.getList(); this.getList();
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false;
this.cancelDialog(); this.cancelDialog();
}); });
}, },
handleAddClick() { handleAddClick() {
this.inputQuery = {enable: true, expireTip: true}; this.inputQuery = {enable: true, expireTip: true};
this.addDialogVisible = true; this.addDialogVisible = true;
}, },
handleModifyClick(row) { handleModifyClick(row) {
this.inputQuery = row; this.inputQuery = row;
this.modifyDialogVisible = true; this.modifyDialogVisible = true;
}, },
deleteDialog(rowId) { deleteDialog(rowId) {
this.$confirm("此操作将永久删除该委托验收信息, 是否继续?", "提示", { this.$confirm("此操作将永久删除该委托验收信息, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
this.deleteOrders(rowId); this.deleteOrders(rowId);
}) })
.catch(() => { .catch(() => {
}); });
}, },
deleteOrders(data) { deleteOrders(data) {
this.loading = true; this.loading = true;
let tquery = { let tquery = {
id: data.id + "", id: data.id + "",
}; };
deleteEntrustRece(tquery) deleteEntrustRece(tquery)
.then((response) => { .then((response) => {
this.getList(); this.getList();
if (response.code == 20000) { if (response.code == 20000) {
this.$message({ this.$message({
type: "success", type: "success",
message: "删除成功!", message: "删除成功!",
}); });
} else { } else {
this.$message.error(response.message); this.$message.error(response.message);
} }
}) })
.catch(() => { .catch(() => {
}); });
},
getSyncConfig() {
findConfig()
.then((response) => {
if (response.code == 20000) {
this.configParms = response.data;
}
})
.catch(() => {
});
},
}, },
components: { getSyncConfig() {
modifyDialog, findConfig()
}, .then((response) => {
mounted() { if (response.code == 20000) {
}, this.configParms = response.data;
created() { }
this.getList(); })
.catch(() => {
});
}, },
},
components: {
modifyDialog,
},
mounted() {
},
created() {
this.getList();
this.getSyncConfig();
},
}; };
</script> </script>

@ -1,176 +1,176 @@
<template> <template>
<div> <div>
<el-form :model="formData" :rules="formRules" ref="dataForm"> <el-form :model="formData" :rules="formRules" ref="dataForm">
<el-button-group style="display: flex;margin: -50px 0 10px 80%; height: 35px"> <el-button-group style="display: flex;margin: -50px 0 10px 80%; height: 35px">
<!-- <el-button--> <!-- <el-button-->
<!-- type="primary"--> <!-- type="primary"-->
<!-- @click.native="submit('1')"--> <!-- @click.native="submit('1')"-->
<!-- style="margin: -50px 0 10px auto; height: 35px"--> <!-- style="margin: -50px 0 10px auto; height: 35px"-->
<!-- >保存订单--> <!-- >保存订单-->
<!-- </el-button--> <!-- </el-button-->
<!-- >--> <!-- >-->
<el-button <el-button
type="primary" type="primary"
@click.native="closeDialog()" @click.native="closeDialog()"
>草稿保存 >草稿保存
</el-button </el-button
> >
<el-button <el-button
type="primary" type="primary"
@click.native="submit('0')" @click.native="submit('0')"
>提交订单 >提交订单
</el-button </el-button
> >
</el-button-group> </el-button-group>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="2"> <el-col :span="2">
<div class="ao-text"> <div class="ao-text">
<span>入库单号</span> <span>入库单号</span>
</div> </div>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="corpOrderId"> <el-form-item prop="corpOrderId">
<el-input v-model="formData.corpOrderId" auto-complete="off" <el-input v-model="formData.corpOrderId" auto-complete="off"
:disabled="corpOrderIdDisabled"></el-input> :disabled="corpOrderIdDisabled"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<div class="ao-text"> <div class="ao-text">
<span>日期</span> <span>日期</span>
</div> </div>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="actDate"> <el-form-item prop="actDate">
<el-date-picker <el-date-picker
v-model="formData.actDate" v-model="formData.actDate"
type="datetime" type="datetime"
placeholder="日期" placeholder="日期"
:disabled="true" :disabled="true"
style="width: 100%; " style="width: 100%; "
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="2"> <el-col :span="2">
<div class="ao-text"> <div class="ao-text">
<span>往来单位</span> <span>往来单位</span>
</div> </div>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="fromCorp"> <el-form-item prop="fromCorp">
<el-input v-model="formData.fromCorp" auto-complete="off" :disabled="true"></el-input> <el-input v-model="formData.fromCorp" auto-complete="off" :disabled="true"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<div class="ao-text"> <div class="ao-text">
<span>单据类型</span> <span>单据类型</span>
</div> </div>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-select v-model="formData.billType" placeholder="请选择业务类型"> <el-select v-model="formData.billType" placeholder="请选择业务类型">
<el-option <el-option
v-for="item in busTypes" v-for="item in busTypes"
:key="item.name" :key="item.name"
:label="item.name" :label="item.name"
:value="item.action"> :value="item.action">
<span style="float: left">{{ item.name }}</span> <span style="float: left">{{ item.name }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="2"> <el-col :span="2">
<div class="ao-text"> <div class="ao-text">
<span>条码</span> <span>条码</span>
</div> </div>
</el-col> </el-col>
<el-col :span="16"> <el-col :span="16">
<el-form-item prop="code"> <el-form-item prop="code">
<el-input <el-input
@keyup.enter.native="addCode($event)" @keyup.enter.native="addCode($event)"
v-model="formData.code" v-model="formData.code"
ref='inputRef' ref='inputRef'
@focus="getInputFocus($event)" @focus="getInputFocus($event)"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<el-button <el-button
type="primary" type="primary"
size="small" size="small"
@click.native.stop="addCode()" @click.native.stop="addCode()"
style="height: 31px; margin-left: 20px" style="height: 31px; margin-left: 20px"
>添加 >添加
</el-button </el-button
> >
</el-col> </el-col>
<div class="text item" style="margin-left: 30px"> 已扫码条码{{ total }} <div class="text item" style="margin-left: 30px"> 已扫码条码{{ total }}
</div> </div>
</el-row> </el-row>
<el-table v-loading="loading" :data="codeArray" style="width: 100%;" max-height="350" height="350" <el-table v-loading="loading" :data="codeArray" style="width: 100%;" max-height="350" height="350"
ref="multipleTable"> ref="multipleTable">
<el-table-column <el-table-column
type="selection" type="selection"
width="55"> width="55">
</el-table-column> </el-table-column>
<el-table-column label="序号" type="index" width="100"></el-table-column> <el-table-column label="序号" type="index" width="100"></el-table-column>
<el-table-column <el-table-column
label="条码" label="条码"
prop="code" prop="code"
show-overflow-tooltip show-overflow-tooltip
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="扫码数量" label="扫码数量"
prop="count" prop="count"
width="200" width="200"
show-overflow-tooltip show-overflow-tooltip
></el-table-column> ></el-table-column>
<el-table-column label="操作" fixed="right" width="250"> <el-table-column label="操作" fixed="right" width="250">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.native.stop="deleteCode(scope.$index, scope.row)" @click.native.stop="deleteCode(scope.$index, scope.row)"
>删除 >删除
</el-button </el-button
> >
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="block"> <div class="block">
<el-pagination <el-pagination
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
layout="prev, pager, next" layout="prev, pager, next"
:page-size="query.limit" :page-size="query.limit"
:total="total" :total="total"
:current-page="query.page" :current-page="query.page"
> >
</el-pagination> </el-pagination>
</div> </div>
</el-form> </el-form>
</div> </div>
</template> </template>
<script> <script>
import { import {
orderGetUdi, orderList, codeList, orderListError, orderGetUdi, orderList, codeList, orderListError,
mergeOrder, postOrdersWeb, errorCodeList, addOrderWeb, deleteCodesTempById, submitOrderWeb mergeOrder, postOrdersWeb, errorCodeList, addOrderWeb, deleteCodesTempById, submitOrderWeb
} from "../../api/inout/order"; } from "../../api/inout/order";
import draggable from "vuedraggable"; import draggable from "vuedraggable";
import {saveAs} from "file-saver"; import {saveAs} from "file-saver";
@ -179,328 +179,331 @@ import {parseTime} from "../../filtres/index";
import store from "../../store"; import store from "../../store";
const formJson = { const formJson = {
corpOrderId: "", corpOrderId: "",
code: "", code: "",
actor: "", actor: "",
fromCorpId: "", fromCorpId: "",
fromCorp: "医院", fromCorp: "医院",
fromType: "网页端", fromType: "网页端",
actDate: new Date(), actDate: new Date(),
billType: null, billType: null,
}; };
export default { export default {
name: "idQuery", name: "idQuery",
props: { props: {
closeDialog: { closeDialog: {
type: Function, type: Function,
required: true, required: true,
},
idQuery: {
type: Object,
required: true,
},
}, },
idQuery: { data() {
type: Object, return {
required: true, codeQuery: {
code: "",
},
query: {
code: "",
corpOrderId: "",
page: 1,
limit: 10,
},
actionMap: {
1: "ProduceWareHouseIn",
2: "PurchaseWareHouseIn",
3: "ReturnWareHouseIn",
4: "AllocateWareHouseIn",
5: "SalesWareHouseOut",
6: "ReturnWareHouseOut",
7: "AllocateWareHouseOut",
8: "DestoryWareHouseOut",
9: "DirectAllocateWareHouseOut",
10: "ReworkWareHouseOut",
11: "CheckWareHouseOut",
12: "CodeReplace",
13: "CodeDestory",
14: "StockCheck",
15: "deliveryNote",
},
mainActionMap: {
1: "WareHouseIn",
2: "WareHouseIn",
3: "WareHouseIn",
4: "WareHouseIn",
5: "WareHouseOut",
6: "WareHouseOut",
7: "WareHouseOut",
8: "WareHouseOut",
9: "WareHouseOut",
10: "WareHouseOut",
11: "WareHouseOut",
12: "none",
13: "none",
14: "none",
15: "none",
},
formData: formJson,
formRules: {
temp: [
{required: true, message: "请输入条码", trigger: "blur"}
],
},
corpOrderIdDisabled: false,
codeArray: [],
total: 0,
loading: false,
index: null,
formLoading: false,
formVisible: false,
deleteLoading: false,
orderNo: null,
busTypes: [],
};
}, },
}, components: {
data() { draggable,
return {
codeQuery: {
code: "",
},
query: {
code: "",
corpOrderId: "",
page: 1,
limit: 10,
},
actionMap: {
1: "ProduceWareHouseIn",
2: "PurchaseWareHouseIn",
3: "ReturnWareHouseIn",
4: "AllocateWareHouseIn",
5: "SalesWareHouseOut",
6: "ReturnWareHouseOut",
7: "AllocateWareHouseOut",
8: "DestoryWareHouseOut",
9: "DirectAllocateWareHouseOut",
10: "ReworkWareHouseOut",
11: "CheckWareHouseOut",
12: "CodeReplace",
13: "CodeDestory",
14: "StockCheck",
15: "deliveryNote",
},
mainActionMap: {
1: "WareHouseIn",
2: "WareHouseIn",
3: "WareHouseIn",
4: "WareHouseIn",
5: "WareHouseOut",
6: "WareHouseOut",
7: "WareHouseOut",
8: "WareHouseOut",
9: "WareHouseOut",
10: "WareHouseOut",
11: "WareHouseOut",
12: "none",
13: "none",
14: "none",
15: "none",
},
formData: formJson,
formRules: {
temp: [
{required: true, message: "请输入条码", trigger: "blur"}
],
},
corpOrderIdDisabled: false,
codeArray: [],
total: 0,
loading: false,
index: null,
formLoading: false,
formVisible: false,
deleteLoading: false,
orderNo: null,
busTypes: [],
};
},
components: {
draggable,
},
methods: {
submit(formName) {
if (this.total < 1) {
this.$message.error('未添加条码');
return;
}
let tQuery = {
orderId: this.idQuery.id
}
submitOrderWeb(tQuery)
.then((response) => {
console.log(response)
if (response.code === 20000) {
this.$message.success("提交成功");
this.closeDialog();
} else {
this.$message.error(response.message);
}
this.loading = false;
});
// if (this.$refs.multipleTable.selection.length < 1) {
// this.$message.error('');
// return;
// }
// this.formData.corpOrderId = this.formData.corpOrderId.trim();
// if (this.formData.corpOrderId === null || this.formData.corpOrderId === '') {
// let date = new Date();
// this.formData.corpOrderId = parseTime(date, '{y}{m}{d}{h}{i}{s}') + Math.ceil(Math.random() * 89 + 10);
// }
// for (let i = 0; i < this.codeArray.length; i++) {
// this.codeArray[i].corpOrderId = this.formData.corpOrderId;
// }
// let postOrder = {
// billType: this.formData.billType,
// codes: this.$refs.multipleTable.selection
// }
// let postOrderList = [];
// postOrderList.push(postOrder);
// let tQuery = {
// postOrders: postOrderList,
// submitType: formName,
// oldOrderId: this.idQuery.id !== null && this.idQuery.id !== '' ? this.idQuery.id : '',
// }
// let message = formName === '0' ? "" : "";
// this.$confirm("" + message + "?", "", {
// confirmButtonText: "",
// cancelButtonText: "",
// type: "warning",
// }).then(() => {
// postOrdersWeb(tQuery).then((response) => {
// if (response.code === 20000) {
// this.$message.success(message + "")
// this.closeDialog();
// } else {
// this.$message.error(response.message);
// }
// });
// }).catch(() => {
// });
}, },
// methods: {
resetForm() { submit(formName) {
if (this.$refs["dataForm"]) { if (this.total < 1) {
// this.$message.error('未添加条码');
this.$refs["dataForm"].clearValidate(); return;
}
let tQuery = {
orderId: this.idQuery.id
}
submitOrderWeb(tQuery)
.then((response) => {
console.log(response)
if (response.code === 20000) {
this.$message.success("提交成功");
this.closeDialog();
} else {
this.$message.error(response.message);
}
this.loading = false;
});
// if (this.$refs.multipleTable.selection.length < 1) {
// this.$message.error('');
// return;
// }
// this.formData.corpOrderId = this.formData.corpOrderId.trim();
// if (this.formData.corpOrderId === null || this.formData.corpOrderId === '') {
// let date = new Date();
// this.formData.corpOrderId = parseTime(date, '{y}{m}{d}{h}{i}{s}') + Math.ceil(Math.random() * 89 + 10);
// }
// for (let i = 0; i < this.codeArray.length; i++) {
// this.codeArray[i].corpOrderId = this.formData.corpOrderId;
// }
// let postOrder = {
// billType: this.formData.billType,
// codes: this.$refs.multipleTable.selection
// }
// let postOrderList = [];
// postOrderList.push(postOrder);
// let tQuery = {
// postOrders: postOrderList,
// submitType: formName,
// oldOrderId: this.idQuery.id !== null && this.idQuery.id !== '' ? this.idQuery.id : '',
// }
// let message = formName === '0' ? "" : "";
// this.$confirm("" + message + "?", "", {
// confirmButtonText: "",
// cancelButtonText: "",
// type: "warning",
// }).then(() => {
// postOrdersWeb(tQuery).then((response) => {
// if (response.code === 20000) {
// this.$message.success(message + "")
// this.closeDialog();
// } else {
// this.$message.error(response.message);
// }
// });
// }).catch(() => {
// });
},
// //
this.$refs["dataForm"].resetFields(); resetForm() {
this.getList(); if (this.$refs["dataForm"]) {
} //
}, this.$refs["dataForm"].clearValidate();
addCode(event) { //
this.$refs["dataForm"].resetFields();
if (event == null) { this.getList();
this.$refs.inputRef.focus(); }
} else event.target.select(); },
this.formData.corpOrderId = this.formData.corpOrderId.trim(); addCode(event) {
if (this.$isBlank(this.formData.corpOrderId)) {
let date = new Date();
this.formData.corpOrderId = parseTime(date, '{y}{m}{d}{h}{i}{s}') + Math.ceil(Math.random() * 89 + 10);
}
this.formData.code = this.formData.code.trim();
if (this.$isBlank(this.formData.code)) return;
this.loading = true;
let tQuery = Object.assign(JSON.parse(JSON.stringify(this.formData))); if (event == null) {
tQuery.orderId = this.idQuery.id; this.$refs.inputRef.focus();
tQuery.actDate = parseTime(this.formData.actDate, '{y}-{m}-{d} {h}:{i}:{s}'); } else event.target.select();
tQuery.mainAction = this.mainActionMap[tQuery.billType]; this.formData.corpOrderId = this.formData.corpOrderId.trim();
tQuery.action = this.actionMap[tQuery.billType]; if (this.$isBlank(this.formData.corpOrderId)) {
addOrderWeb(tQuery).then((response) => { let date = new Date();
if (response.code === 20000) { this.formData.corpOrderId = parseTime(date, '{y}{m}{d}{h}{i}{s}') + Math.ceil(Math.random() * 89 + 10);
this.idQuery.id = response.data;
this.corpOrderIdDisabled = true;
this.getCodeList();
} else {
this.$alert(response.message, '提示', {
confirmButtonText: '确定',
type: 'warning',
closeOnClickModal: true,
callback: action => {
this.$refs.inputRef.focus();
} }
}); this.formData.code = this.formData.code.trim();
// this.$message.error(response.message); if (this.$isBlank(this.formData.code)) return;
} this.loading = true;
this.loading = false;
});
}, let tQuery = Object.assign(JSON.parse(JSON.stringify(this.formData)));
deleteCode(index, row) { tQuery.orderId = this.idQuery.id;
console.log(row.id) tQuery.actDate = parseTime(this.formData.actDate, '{y}-{m}-{d} {h}:{i}:{s}');
this.$confirm("是否删除?", "提示", { tQuery.mainAction = this.mainActionMap[tQuery.billType];
confirmButtonText: "确定", tQuery.action = this.actionMap[tQuery.billType];
cancelButtonText: "取消", addOrderWeb(tQuery).then((response) => {
type: "warning", if (response.code === 20000) {
}).then(() => { this.idQuery.id = response.data;
this.loading = true; this.corpOrderIdDisabled = true;
let tQuery = { this.getCodeList();
id: row.id } else {
} this.$alert(response.message, '提示', {
deleteCodesTempById(tQuery) confirmButtonText: '确定',
.then((response) => { type: 'warning',
if (response.code === 20000) { closeOnClickModal: true,
this.getCodeList(); callback: action => {
} else { this.$refs.inputRef.focus();
this.$message.error(response.message); }
} });
this.loading = false; // this.$message.error(response.message);
}
this.loading = false;
}); });
}).catch(() => {
}); },
}, deleteCode(index, row) {
getInputFocus(event) { console.log(row.id)
event.currentTarget.select(); this.$confirm("是否删除?", "提示", {
}, confirmButtonText: "确定",
tableSelection() { cancelButtonText: "取消",
this.$refs.multipleTable.clearSelection(); type: "warning",
this.$refs.multipleTable.toggleAllSelection(); }).then(() => {
}, this.loading = true;
handleSizeChange(val) { let tQuery = {
this.query.limit = val; id: row.id
this.getCodeList(); }
}, deleteCodesTempById(tQuery)
handleCurrentChange(val) { .then((response) => {
this.query.page = val; if (response.code === 20000) {
this.getCodeList(); this.getCodeList();
}, } else {
getCodeList() { this.$message.error(response.message);
this.loading = true; }
this.query.orderId = this.idQuery.id; this.loading = false;
errorCodeList(this.query) // });
.then((response) => { }).catch(() => {
this.codeArray = response.data.list || []; });
this.total = response.data.total || 0; },
for (let i = 0; i < this.codeArray.length; i++) { getInputFocus(event) {
this.codeArray[i].fromType = this.formData.fromType; event.currentTarget.select();
this.codeArray[i].billType = this.formData.billType; },
} tableSelection() {
this.tableSelection(); this.$refs.multipleTable.clearSelection();
this.loading = false; this.$refs.multipleTable.toggleAllSelection();
}) },
.catch(() => { handleSizeChange(val) {
this.loading = false; this.query.limit = val;
this.list = []; this.getCodeList();
this.total = 0; },
}); handleCurrentChange(val) {
}, this.query.page = val;
getBusType() { this.getCodeList();
let query = { },
enabled: true, getCodeList() {
}; this.loading = true;
getBussinessType(query) this.query.orderId = this.idQuery.id;
.then((response) => { errorCodeList(this.query) //
this.busTypes = response.data.list || []; .then((response) => {
this.billType = this.busTypes[0].action; this.codeArray = response.data.list || [];
// this.getList(); this.total = response.data.total || 0;
}) for (let i = 0; i < this.codeArray.length; i++) {
.catch(() => { this.codeArray[i].fromType = this.formData.fromType;
}); this.codeArray[i].billType = this.formData.billType;
}
this.tableSelection();
this.loading = false;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
getBusType() {
let query = {
enabled: true,
};
getBussinessType(query)
.then((response) => {
this.busTypes = response.data.list || [];
this.billType = this.busTypes[0].action;
// this.getList();
})
.catch(() => {
});
},
intentBack() {
this.$router.go(-1);
},
}, },
intentBack() { filters: {},
this.$router.go(-1); mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
}, },
}, created() {
filters: {}, this.formData.code = '';
mounted() { this.formData.actDate = new Date();
document.body.ondrop = function (event) { this.codeArray = [];
event.preventDefault(); this.formData.fromCorp = store.getters.companyName;// store.getters.customerId === 110 ? '' : store.getters.companyName;
event.stopPropagation(); this.formData.customerId = store.getters.customerId;
}; this.getBusType();
}, if (this.$isNotBlank(this.idQuery.id)) {
created() { this.formData.actDate = new Date(this.idQuery.actDate);
this.formData.code = ''; this.formData.corpOrderId = this.idQuery.corpOrderId;
this.formData.actDate = new Date(); this.corpOrderIdDisabled = true;
this.codeArray = []; this.getCodeList();
this.formData.fromCorp = store.getters.companyName;// store.getters.customerId === 110 ? '' : store.getters.companyName; } else {
this.formData.customerId = store.getters.customerId; this.corpOrderIdDisabled = false;
this.getBusType(); if (JSON.stringify(this.$route.query) === '{}') {
if (this.$isNotBlank(this.idQuery.id)) { // this.formData.corpOrderId = new Date().getTime() + (Math.ceil(Math.random() * 10 + 10) + '');
this.formData.actDate = new Date(this.idQuery.actDate); let date = new Date();
this.formData.corpOrderId = this.idQuery.corpOrderId; this.formData.corpOrderId = parseTime(date, '{y}{m}{d}{h}{i}{s}') + Math.ceil(Math.random() * 89 + 10);
this.corpOrderIdDisabled = true; } else {
this.getCodeList(); //
} else { let query = this.$route.query;
this.corpOrderIdDisabled = false; this.orderNo = query.id;
if (JSON.stringify(this.$route.query) === '{}') {
// this.formData.corpOrderId = new Date().getTime() + (Math.ceil(Math.random() * 10 + 10) + '');
let date = new Date();
this.formData.corpOrderId = parseTime(date, '{y}{m}{d}{h}{i}{s}') + Math.ceil(Math.random() * 89 + 10);
} else {
//
let query = this.$route.query;
this.orderNo = query.id;
this.query = Object.assign(this.query, query); this.query = Object.assign(this.query, query);
this.query.limit = parseInt(this.query.limit); this.query.limit = parseInt(this.query.limit);
this.query.corpOrderId = query.id; this.query.corpOrderId = query.id;
// //
// this.getCodeList(); // this.getCodeList();
} }
} }
}, },
}; };
</script> </script>
<style> <style>
.messageIndex {
z-index: 9999 !important;
}
.ao-text { .ao-text {
width: 100%; width: 100%;
font-size: 13px; font-size: 13px;
font-family: "Microsoft YaHei"; font-family: "Microsoft YaHei";
float: right; float: right;
text-align: right; text-align: right;
margin-top: 10px; margin-top: 10px;
} }
</style> </style>

@ -567,18 +567,18 @@ export default {
}, },
distributionVisible: false, distributionVisible: false,
detailFormRules: { detailFormRules: {
batchNo: [ // batchNo: [
{required: true, message: "请输入批次号", trigger: "blur"} // {required: true, message: "", trigger: "blur"}
], // ],
productDate: [ // productDate: [
{required: true, message: "请输入生产日期", trigger: "blur"} // {required: true, message: "", trigger: "blur"}
], // ],
expireDate: [ // expireDate: [
{required: true, message: "请输入失效日期", trigger: "blur"} // {required: true, message: "", trigger: "blur"}
], // ],
sweepCount: [ // sweepCount: [
{required: true, message: "请输入扫码数量", trigger: "blur"} // {required: true, message: "", trigger: "blur"}
] // ]
}, },
detailFormVisible: false, detailFormVisible: false,
detailFormData: {}, detailFormData: {},

@ -819,6 +819,14 @@ export default {
this.formData.expireDate = response.data.expireDate; this.formData.expireDate = response.data.expireDate;
this.formData.batchNo = response.data.batchNo; this.formData.batchNo = response.data.batchNo;
this.formData.serialNo = response.data.serialNo; this.formData.serialNo = response.data.serialNo;
this.$message({
type: 'error',
message: "提交失败!" + this.editTitle,
customClass: 'messageIndex'
});
} else { } else {
this.$alert(response.message, '提示', { this.$alert(response.message, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',

Loading…
Cancel
Save