订单扫码,耗材字段维护

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 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>
</div>
</el-col>
@ -834,6 +840,8 @@ export default {
isLock: null,
isAdavence: null,
allowNoBatch: null,
allowNoExpire:null,
allowNoProduct:null,
},
defaultSys: null,
isImport: false,

@ -643,8 +643,14 @@
<el-checkbox v-model="editQuery.isAdavence" disabled
>是否寄售
</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>
</div>
</el-col>

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

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

Loading…
Cancel
Save