订单扫码,耗材字段维护

master
anthonyywj2 3 years ago
parent 8685e33b88
commit 7b901da987

@ -0,0 +1,9 @@
import axios from "@/utils/axios";
export function saveCode(query) {
return axios({
url: "/warehouse/inout/saveTempCode",
method: "post",
data: query
});
}

@ -700,7 +700,13 @@
>是否寄售 >是否寄售
</el-checkbox> </el-checkbox>
<el-checkbox v-model="editQuery.allowNoBatch" class="" <el-checkbox v-model="editQuery.allowNoBatch" class=""
>是否允许无批次号扫码 >允许无批次号
</el-checkbox>
<el-checkbox v-model="editQuery.allowNoExpire" class=""
>允许无失效日期
</el-checkbox>
<el-checkbox v-model="editQuery.allowNoProduct" class=""
>允许无生产日期
</el-checkbox> </el-checkbox>
</div> </div>
</el-col> </el-col>
@ -834,6 +840,8 @@ export default {
isLock: null, isLock: null,
isAdavence: null, isAdavence: null,
allowNoBatch: null, allowNoBatch: null,
allowNoExpire:null,
allowNoProduct:null,
}, },
defaultSys: null, defaultSys: null,
isImport: false, isImport: false,

@ -643,8 +643,14 @@
<el-checkbox v-model="editQuery.isAdavence" disabled <el-checkbox v-model="editQuery.isAdavence" disabled
>是否寄售 >是否寄售
</el-checkbox> </el-checkbox>
<el-checkbox v-model="editQuery.allowNoBatch" disabled <el-checkbox v-model="editQuery.allowNoBatch" class=""
>是否允许无批次号扫码 >允许无批次号
</el-checkbox>
<el-checkbox v-model="editQuery.allowNoExpire" class=""
>允许无失效日期
</el-checkbox>
<el-checkbox v-model="editQuery.allowNoProduct" class=""
>允许无生产日期
</el-checkbox> </el-checkbox>
</div> </div>
</el-col> </el-col>

@ -463,7 +463,13 @@
>是否寄售 >是否寄售
</el-checkbox> </el-checkbox>
<el-checkbox v-model="editQuery.allowNoBatch" <el-checkbox v-model="editQuery.allowNoBatch"
>是否允许无批次号扫码 >允许无批次号
</el-checkbox>
<el-checkbox v-model="editQuery.allowNoExpire"
>允许无失效日期
</el-checkbox>
<el-checkbox v-model="editQuery.allowNoProduct"
>允许无生产日期
</el-checkbox> </el-checkbox>
</div> </div>
</el-col> </el-col>

@ -63,7 +63,6 @@
<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>
@ -80,9 +79,6 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="locStorageCode"> <el-form-item prop="locStorageCode">
<!--<el-select v-model="formData.billType" style="width: 100%" placeholder="业务类型" :disabled="true">-->
<!--<el-option label="送货单" value="deliveryNote"></el-option>-->
<!--</el-select>-->
<el-select v-model="formData.locStorageCode" placeholder="当前仓库信息" @change="locCHange" <el-select v-model="formData.locStorageCode" placeholder="当前仓库信息" @change="locCHange"
:disabled="corpOrderIdDisabled"> :disabled="corpOrderIdDisabled">
<el-option <el-option
@ -169,12 +165,11 @@
</el-col> </el-col>
<el-col :span="12" class="el-col"> <el-col :span="12" class="el-col">
<div class="text item" style="margin-top: 6px"> <div class="text item" style="margin-top: 6px">
<el-checkbox v-model="formData.outChangeEnable" <el-checkbox v-model="formData.outChangeEnable"
:disabled="!curAction.changeEnable">允许出库自动缺量补单 :disabled="!curAction.changeEnable || corpOrderIdDisabled">允许出库自动缺量补单
</el-checkbox> </el-checkbox>
<el-checkbox v-model="formData.preCheck" <el-checkbox v-model="formData.preCheck"
:disabled="!curAction.changeEnable ||corpOrderIdDisabled" :disabled="!curAction.changeEnable ||corpOrderIdDisabled"
>是否预验收产品 >是否预验收产品
@ -218,17 +213,9 @@
</el-row> </el-row>
<!-- <div>-->
<!-- <input type="text" id="inputer" ime-mode="disabled" tabindex="0" >-->
<!-- </div>-->
<!-- <div id="inputer" tabindex="0"></div>-->
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="14" style="margin-left: 40px"> <el-col :span="14" style="margin-left: 40px">
</el-col>
<el-col :span="2">
<el-checkbox v-model="sitcomScan"></el-checkbox>
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
<div class="text item" style="margin-left: 30px"> 条码数量{{ total }} <div class="text item" style="margin-left: 30px"> 条码数量{{ total }}
@ -248,7 +235,26 @@
prop="code" prop="code"
show-overflow-tooltip show-overflow-tooltip
></el-table-column> ></el-table-column>
<el-table-column
label="生产日期"
prop="produceDate"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="失效日期"
prop="expireDate"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="批次号"
prop="batchNo"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="序列号"
prop="serialNo"
show-overflow-tooltip
></el-table-column>
<el-table-column <el-table-column
label="供应商" label="供应商"
prop="supName" prop="supName"
@ -258,7 +264,6 @@
<el-table-column <el-table-column
label="扫码数量" label="扫码数量"
prop="count" prop="count"
width="200"
show-overflow-tooltip show-overflow-tooltip
></el-table-column> ></el-table-column>
@ -274,21 +279,24 @@
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.native.stop="bindRl(scope.row)" @click.native.stop="bindRl(scope.row)"
>选择产品 >选择产品
</el-button </el-button
> >
<!-- :disabled="scope.row.relId != null "-->
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.native.stop="handleUnitClick(scope.row)" @click.native.stop="handleUnitClick(scope.row)"
>选择供应商 >选择供应商
</el-button </el-button
> >
<!-- :disabled=" scope.row.supId !=null"--> <el-button
type="text"
size="small"
@click.native.stop="editCode(scope.row)"
>编辑
</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -329,6 +337,33 @@
v-on:closeBindDialog="closeBindDialog" v-on:closeBindDialog="closeBindDialog"
></selectRlDialog> ></selectRlDialog>
</el-dialog> </el-dialog>
<el-dialog
:title="editTitle"
:visible.sync="editCodeVisible"
append-to-body width="70%"
v-if="editCodeVisible"
>
<editCodeDialog
editTye="2"
:closeCodeDialog="closeCodeDialog"
:codeDetail="codeDetail">
</editCodeDialog>
</el-dialog>
<el-dialog
:title="editTitle"
:visible.sync="editOriginCodeVisible"
append-to-body width="70%"
v-if="editOriginCodeVisible">
<editCodeDialog
:closeCodeDialog="closeCodeDialog"
:repeatAddCode="repeatAddCode"
:codeDetail="formData"
editTye="1">
</editCodeDialog>
</el-dialog>
</div> </div>
@ -337,17 +372,16 @@
<script> <script>
import { import {
errorCodeList, addOrderWeb, deleteCodesTempById, submitOrderWeb, saveOrderWeb, errorCodeList, addOrderWeb, deleteCodesTempById, submitOrderWeb, saveOrderWeb,
updateCodeBindSup, expireTimeCheck updateCodeBindSup, enterCodeWeb
} from "../../api/inout/order"; } from "../../api/inout/order";
import {getBussinessType} from "../../api/basic/bussinessType";
import draggable from "vuedraggable"; import draggable from "vuedraggable";
import {parseTime} from "../../filtres/index"; import {parseTime} from "../../filtres/index";
import store from "../../store";
import {getBasicUnitMaintains} from "../../api/basic/basicUnitMaintain" import {getBasicUnitMaintains} from "../../api/basic/basicUnitMaintain"
import {filterAll, filterAllByLoc, filterAllByUser} from "@/api/basic/invWarehouse"; import {deleteWarehouse, filterAllByLoc, filterAllByUser} from "@/api/basic/invWarehouse";
import {getLocalBusType, getLocalJoinBusType, getLocalJoinByUser} from "../../api/basic/busLocalType"; import {getLocalBusType, getLocalJoinBusType, getLocalJoinByUser} from "../../api/basic/busLocalType";
import DialogSelectUnit from "./DialogSelectUnit"; import DialogSelectUnit from "./DialogSelectUnit";
import selectRlDialog from "./DialogSelectRl"; import selectRlDialog from "./DialogSelectRl";
import editCodeDialog from "./editCode";
import A from "../../plugin/KeyScaner" import A from "../../plugin/KeyScaner"
@ -374,6 +408,7 @@ export default {
page: 1, page: 1,
limit: 10, limit: 10,
}, },
editCodeVisible: false,
busTypes: [], busTypes: [],
billAction: null, billAction: null,
actionEnable: false, actionEnable: false,
@ -389,7 +424,13 @@ export default {
locStorageCode: null, locStorageCode: null,
outChangeEnable: false, outChangeEnable: false,
preCheck: false, preCheck: false,
batchNo: null,
produceDate: null,
expireDate: null,
serialNo: null,
}, },
editOriginCodeVisible: false,
curId: null, curId: null,
storageList: [], storageList: [],
formRules: { formRules: {
@ -421,11 +462,15 @@ export default {
selectRlTitle: "绑定产品", selectRlTitle: "绑定产品",
selectUnitTitle: "绑定供应商", selectUnitTitle: "绑定供应商",
sictomText: "", sictomText: "",
codeDetail: null,
originCode: "",
checkSuccess: false,
editTitle: "编辑条码",
}; };
}, },
components: { components: {
draggable, draggable,
DialogSelectUnit, selectRlDialog DialogSelectUnit, selectRlDialog, editCodeDialog
}, },
methods: { methods: {
submit(formName) { submit(formName) {
@ -476,6 +521,14 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
closeCodeDialog() {
this.editCodeVisible = false;
this.editOriginCodeVisible = false;
},
editCode(row) {
this.codeDetail = row;
this.editCodeVisible = true;
},
// //
resetForm() { resetForm() {
if (this.$refs["dataForm"]) { if (this.$refs["dataForm"]) {
@ -487,17 +540,64 @@ export default {
} }
}, },
enterKey(event) { enterKey(event) {
if (this.sitcomScan) { this.checkSuccess = true;
return; let tQuery = {
} else { originCode: this.originCode,
this.addCode(event); code: this.formData.code.trim(),
} }
enterCodeWeb(tQuery).then((response) => {
if (response.code === 20000) {
this.$refs.inputRef.focus();
this.$refs.inputRef.select();
this.formData.code = response.data;
this.addCode();
} else {
if (response.code == 502) {
this.checkSuccess = false;
this.formData.code = response.data;
this.originCode = this.formData.code;
} else if (response.code == 501) {
this.checkSuccess = false;
this.formData.code = response.data;
this.originCode = this.formData.code;
} else if (response.code == 503) {
this.checkSuccess = false;
this.formData.code = response.data;
this.$confirm(response.message, "提示", {
type: "warning",
})
.then(() => {
this.formData.code = response.data;
this.addCode();
})
.catch(() => {
this.formData.code = this.originCode;
});
} else {
this.$alert(response.message, '提示', {
confirmButtonText: '确定',
type: 'warning',
closeOnClickModal: true,
callback: action => {
this.$refs.inputRef.focus();
this.$refs.inputRef.select();
}
});
}
}
this.loading = false;
});
}, },
addCode(event) { addCode(event) {
this.originCode = "";
this.sictomText = "";
this.formData.corpOrderId = this.formData.corpOrderId.trim(); this.formData.corpOrderId = this.formData.corpOrderId.trim();
this.formData.batchNo = "";
this.formData.produceDate = "";
this.formData.expireDate = "";
this.formData.serialNo = "";
this.actionEnable = true; this.actionEnable = true;
this.sictomText = "";
if (event == null) { if (event == null) {
} else event.target.select(); } else event.target.select();
this.$refs.inputRef.select(); this.$refs.inputRef.select();
@ -526,15 +626,21 @@ export default {
tQuery.orderId = this.idQuery.id; tQuery.orderId = this.idQuery.id;
tQuery.actDate = parseTime(this.formData.actDate, '{y}-{m}-{d} {h}:{i}:{s}'); tQuery.actDate = parseTime(this.formData.actDate, '{y}-{m}-{d} {h}:{i}:{s}');
tQuery.action = this.formData.action; tQuery.action = this.formData.action;
console.log(tQuery.action);
this.addCodeSubmit(tQuery); this.addCodeSubmit(tQuery);
this.$refs.inputRef.select(); this.$refs.inputRef.select();
}, },
repeatAddCode() {
let tQuery = Object.assign(JSON.parse(JSON.stringify(this.formData)));
tQuery.orderId = this.idQuery.id;
tQuery.actDate = parseTime(this.formData.actDate, '{y}-{m}-{d} {h}:{i}:{s}');
tQuery.action = this.formData.action;
this.closeCodeDialog();
this.addCodeSubmit(tQuery);
},
addCodeSubmit(tQuery) { addCodeSubmit(tQuery) {
addOrderWeb(tQuery).then((response) => { addOrderWeb(tQuery).then((response) => {
if (response.code === 20000) { if (response.code === 20000) {
this.idQuery.id = response.data.orderId; this.idQuery.id = response.data.orderId;
if (response.data.errMsg != null) { if (response.data.errMsg != null) {
@ -547,8 +653,9 @@ export default {
}); });
} }
this.corpOrderIdDisabled = true; this.corpOrderIdDisabled = true;
this.$refs.inputRef.focus();
this.getCodeList(); this.getCodeList();
this.$refs.inputRef.focus();
this.$refs.inputRef.select();
} else { } else {
if (response.code == 502) { if (response.code == 502) {
this.curRow = response.data; this.curRow = response.data;
@ -574,9 +681,7 @@ export default {
}).catch(() => { }).catch(() => {
}); });
} else if (response.code == 505) { } else if (response.code == 505) {
this.$confirm(response.message, "提示", { this.$confirm(response.message, "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "忽略", cancelButtonText: "忽略",
@ -587,7 +692,13 @@ export default {
}).catch(() => { }).catch(() => {
}); });
} else if (response.code == 507) {
this.editTitle = response.message;
this.editOriginCodeVisible = true;
this.formData.produceDate = response.data.produceDate;
this.formData.expireDate = response.data.expireDate;
this.formData.batchNo = response.data.batchNo;
this.formData.serialNo = response.data.serialNo;
} else { } else {
this.$alert(response.message, '提示', { this.$alert(response.message, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -595,25 +706,15 @@ export default {
closeOnClickModal: true, closeOnClickModal: true,
callback: action => { callback: action => {
this.$refs.inputRef.focus(); this.$refs.inputRef.focus();
this.$refs.inputRef.select();
} }
}); });
} }
} }
this.loading = false; this.loading = false;
}); });
}, },
scanChange(event) {
this.isScan = !this.isScan;
if (this.isScan) {
this.scanText = "扫码录入:";
} else {
this.scanText = "手动录入:";
}
},
unitChange(row) { unitChange(row) {
console.log(row); console.log(row);
this.formData.fromCorpId = row.erpId; this.formData.fromCorpId = row.erpId;
@ -693,21 +794,12 @@ export default {
let query = { let query = {
enabled: true, enabled: true,
}; };
// console.log("---------1------" + this.curAction.action)
getLocalJoinByUser(query) getLocalJoinByUser(query)
.then((response) => { .then((response) => {
console.log("--------3--------" + this.formData.action)
this.busTypes = response.data.list || []; this.busTypes = response.data.list || [];
// this.filterQuery.billAction = this.busTypes[0].action;
if (this.formData.action != null) { if (this.formData.action != null) {
this.curAction = this.getActionItem(this.formData.action); this.curAction = this.getActionItem(this.formData.action);
} }
// this.curAction = this.getActionItem(this.formData.action);
// if(this.curAction == null){
// this.curAction
// }
// console.log("----------4------" + this.curAction.action + "---" + this.curAction.corpType)
}) })
.catch(() => { .catch(() => {
}); });
@ -777,11 +869,7 @@ export default {
}); });
}, },
getStorage(event) { getStorage(event) {
// let query = {
// advanceType: this.getActionName(event),
// };
this.storageList = []; this.storageList = [];
// this.formData.locStorageCode = null;
filterAllByUser() filterAllByUser()
.then((response) => { .then((response) => {
this.storageList = response.data || []; this.storageList = response.data || [];
@ -807,7 +895,6 @@ export default {
}, },
actionChange(item) { actionChange(item) {
this.curAction = this.getActionItem(item); this.curAction = this.getActionItem(item);
// this.formData.locStorageCode = this.curAction.storageCode;
this.findMethod(); this.findMethod();
}, },
@ -894,36 +981,31 @@ export default {
event.stopPropagation(); event.stopPropagation();
}; };
var that = this; var that = this;
var inputer = document.getElementById("inputer"); var inputer = document.getElementById("inputer");
window.sc = new A.KeyScaner(inputer);//DOM window.sc = new A.KeyScaner(inputer);//DOM
sc.onInput = function (text) { sc.onInput = function (text) {
console.log("监听掃碼:" + text);
//onInput500ms
if (text.includes("delete")) { if (text.includes("delete")) {
that.formData.code = ""; that.formData.code = "";
that.sictomText = ""; that.sictomText = "";
this.originCode = "";
return; return;
} }
if (that.sitcomScan) { if (that.sitcomScan) {
let tempTxt = text; let tempTxt = text;
let str= tempTxt.replace(/[\r]/g, ""); let str = tempTxt.replace(/[\r]/g, "");
that.sictomText = that.sictomText + str; that.sictomText = that.sictomText + str;
that.formData.code = that.sictomText; that.formData.code = that.sictomText;
} else { } else {
that.formData.code = text; that.formData.code = text;
} }
}; };
inputer.focus();//divtabindexdocumentBody inputer.focus();
}, },
created() { created() {
this.formData.code = ''; this.formData.code = '';
this.formData.actDate = new Date(); this.formData.actDate = new Date();
this.codeArray = []; this.codeArray = [];
// this.formData.fromCorp = store.getters.customerId === 110 ? '' : store.getters.companyName;
// this.formData.customerId = store.getters.customerId;
this.getBusType(); this.getBusType();
this.getStorage(this.formData.action); this.getStorage(this.formData.action);
if (this.$isNotBlank(this.idQuery.id)) { if (this.$isNotBlank(this.idQuery.id)) {
@ -941,15 +1023,20 @@ export default {
} else { } else {
this.corpOrderIdDisabled = false; this.corpOrderIdDisabled = false;
if (JSON.stringify(this.$route.query) === '{}') { if (JSON.stringify(this.$route.query) === '{}') {
// this.formData.corpOrderId = new Date().getTime() + (Math.ceil(Math.random() * 10 + 10) + '');
let date = new Date(); let date = new Date();
this.formData.corpOrderId = parseTime(date, '{y}{m}{d}{h}{i}{s}') + Math.ceil(Math.random() * 89 + 10); this.formData.corpOrderId = parseTime(date, '{y}{m}{d}{h}{i}{s}') + Math.ceil(Math.random() * 89 + 10);
} else { } else {
// //
let query = this.$route.query; let query = this.$route.query;
this.orderNo = query.id; 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();
} }
} }

@ -0,0 +1,139 @@
<template>
<div>
<el-form :model="codeDetail" :rules="formRules" ref="dataForm">
<el-row :gutter="20">
<el-col :span="3">
<div class="ao-text">
<span>条码</span>
</div>
</el-col>
<el-col :span="16">
<el-form-item prop="code">
<el-input
v-model="codeDetail.code"
clearable
disabled
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="3">
<div class="ao-text">
<span>生产日期</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item prop="productDate">
<el-input v-model="codeDetail.produceDate" auto-complete="off"
oninput="if(value.length>6)value=value.slice(0,6)"
type="number"
:disabled="false"></el-input>
</el-form-item>
</el-col>
<el-col :span="3">
<div class="ao-text">
<span>失效日期</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item prop="expireDate">
<el-input v-model="codeDetail.expireDate" auto-complete="off"
oninput="if(value.length>6)value=value.slice(0,6)"
type="number"
:disabled="false"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="3">
<div class="ao-text">
<span>批次号</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item prop="batchNo">
<el-input v-model="codeDetail.batchNo" auto-complete="off" :disabled="false"></el-input>
</el-form-item>
</el-col>
<el-col :span="3">
<div class="ao-text">
<span>序列号</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item prop="price">
<el-input v-model="codeDetail.serialNo" auto-complete="off"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="17">
</el-col>
<el-col :span="7">
<el-button @click="cancelDialog"> </el-button>
<el-button type="primary" @click="saveCode()"> </el-button>
</el-col>
</el-row>
</el-form>
</div>
</template>
<script>
import {
saveCode
} from "../../api/inout/code";
export default {
name: "editCode",
props: {
editTye: {
type: Object,
required: true,
},
closeCodeDialog: {
type: Function,
required: true,
},
repeatAddCode: {
type: Function,
required: false,
},
codeDetail: {
type: Object,
required: true,
},
},
methods: {
saveCode() {
if (this.editTye == 1) {
this.repeatAddCode();
} else {
saveCode(this.codeDetail)
.then((response) => {
console.log(response)
if (response.code === 20000) {
this.$message.success("提交成功");
this.closeCodeDialog();
} else {
this.$message.error(response.message);
}
this.loading = false;
});
}
},
cancelDialog() {
this.closeCodeDialog();
}
}
}
</script>
<style scoped>
</style>

@ -298,6 +298,8 @@ export default {
this.testLoading = false; this.testLoading = false;
if (response.code == 20000) { if (response.code == 20000) {
this.$message.success("连接成功"); this.$message.success("连接成功");
} else {
this.$message.error("连接失败!");
} }
}) })
.catch(() => { .catch(() => {

Loading…
Cancel
Save