12/12 代码备份 扫码校验

20240912_adapter
wangwei 4 months ago
parent c422463523
commit 43ace68aaa

@ -81,4 +81,26 @@ export function checkCollectOrderManCode(query) {
});
}
export function scanCheckCodeOrder(query) {
return axios({
url: "/udiwms/basic/collect/IoCollectCodeBackup/scanCheckCode",
method: "post",
data: query
});
}
export function scanCheckCodeReplace(query) {
return axios({
url: "/udiwms/basic/collect/IoCollectCodeBackup/scanCheckCodeReplace",
method: "post",
data: query
});
}
export function commitCheckCodeOrder(query) {
return axios({
url: "/udiwms/basic/collect/IoCollectCodeBackup/commitCheckCodeOrder",
method: "post",
data: query
});
}

@ -1,6 +1,13 @@
<template>
<div>
<el-card>
<el-button-group style="display: flex; justify-content: flex-end;">
<el-button
type="primary"
@click.native="confirmCheckOrder()"
>校验完成
</el-button>
</el-button-group>
<el-form :model="orderData" class="demo-form-inline" style="margin-top: 30px" @submit.native.prevent>
<!--<div style="border: 1px solid #ebeef5;border-radius: 2px;margin-top: 15px;padding: 15px">-->
@ -86,7 +93,7 @@
<el-table-column label="生产日期" prop="productDate"></el-table-column>
<el-table-column label="失效日期" prop="expireDate"></el-table-column>
<el-table-column label="序列号" prop="serialNo"></el-table-column>
<el-table-column label="扫码数量" prop="scanActCount"></el-table-column>
<!--<el-table-column label="扫码数量" prop="scanActCount"></el-table-column>-->
<el-table-column label="批准文号" prop="zczbhhzbapzbh"></el-table-column>
</el-table>
@ -104,7 +111,8 @@
<script>
import { isBlank } from '@/utils/strUtil'
import { getCodeEndList,checkCode } from '@/api/collect/IoCollectCodeSelect'
import { getCodeEndList } from '@/api/collect/IoCollectCodeSelect'
import { commitCheckCodeOrder, scanCheckCodeOrder, scanCheckCodeReplace } from '@/api/collect/splitCreateOrder'
export default {
name: 'DialogCheckCode',
@ -113,7 +121,11 @@ export default {
type: Object,
default: null,
required: true
}
},
closeCodeCheckDialog: {
type: Function,
required: true
},
},
data() {
return {
@ -138,7 +150,9 @@ export default {
code: '',
billNo: null,
codeList: [],
}
},
checkCodeList:[],
checkCodeEndList:[],
}
},
methods: {
@ -168,14 +182,38 @@ export default {
// this.getInputFocus()
},
verifyCode(query) {
checkCode(query).then(res => {
scanCheckCodeOrder(query).then(res => {
if (res.code == 20000) {
if (Array.isArray(res.data)) {
this.printCodeResultList(res.data)
} else {
this.verifyFinish(1, res.data, res.message)
this.checkCodeEndList.push(query.code)
//
this.$message.success('校验成功')
}
}else if (res.code == 503){
//
this.$confirm('该追溯码不存在是否继续添加', '提示', {
confirmButtonText: '添加',
cancelButtonText: '取消',
type: 'warning',
center: true,
closeOnPressEscape: false,// ESC
closeOnClickModal: false,//
distinguishCancelAndClose: true,//
}).then(() => {
scanCheckCodeReplace(query).then(res => {
if (res.code == 20000){
this.scanCode = ''
this.orderData.checkCodeConfirm = res.data.checkCodeConfirm
this.getInputFocus()
this.$message.success("添加成功")
}else {
this.$message.error("添加失败")
}
})
})
}else {
if (Array.isArray(res.data)) {
@ -305,6 +343,7 @@ export default {
getCodeEndList(this.codeQuery).then((res) => {
if (res.code === 20000) {
this.detailList = res.data.list || []
this.checkCodeList = this.detailList.map(item => item.code)
this.resultTotal = res.data.total || 0;
} else {
this.$message.error(res.message)
@ -328,6 +367,52 @@ export default {
// }
// })
},
confirmCheckOrder(){
if (this.orderData.checkCodeConfirm == 1){
//
this.$confirm('当前单据存在可替换追溯码是否替换完成校验', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
center: true,
closeOnPressEscape: false,// ESC
closeOnClickModal: false,//
distinguishCancelAndClose: true,//
}).then(() => {
this.commit()
}).catch(() => {
})
}else {
this.commit()
}
// // 绿
// let allGreen = this.detailList.every(row => {
// return this.checkCodeEndList.includes(row.code);
// });
//
// if (allGreen) {
// // 绿
// // this.doSubmit();
// this.$message.success('绿');
// } else {
// // 绿
// this.$message.error('绿');
// }
},
commit(){
commitCheckCodeOrder(this.filterQuery).then(res => {
if (res.code == 20000){
this.closeCodeCheckDialog()
this.$message.success("校验完成")
}else {
this.$message.error(res.message)
}
}).catch(() => {
})
},
init() {
this.codeQuery = {
billNo: null,
@ -337,9 +422,26 @@ export default {
}
this.errVisible = false
this.successVisible = true
},
rowStyle({ row, rowIndex }) {
let rowBackground = {}
if (this.checkCodeEndList.length == 0) {
rowBackground.color = '#F56C6C'
rowBackground.height = '38px'
return rowBackground
}
if (this.checkCodeEndList.includes(row.code)) {
rowBackground.color = '#56a717'
}
if (!this.checkCodeEndList.includes(row.code)) {
rowBackground.color = '#F56C6C'
}
rowBackground.height = '38px'
return rowBackground
}
},
created() {
this.filterQuery.billNo = this.orderData.billNo
this.getResultDetailList()
this.init()
},

@ -130,7 +130,7 @@
<el-tabs type="border-card" style="margin: 15px">
<!--单据业务详情-->
<el-tab-pane>
<span slot="label">单据 {{ filterQuery.billNo }}-追溯码详情</span>
<span slot="label">单据 {{ orderData.billNo }}-追溯码详情</span>
<el-table :data="detailList" style="width: 100%;" highlight-current-row="true" border ref="multipleTable"
:row-style="rowStyle"
>
@ -414,6 +414,7 @@ export default {
async printCodeResultList(vailCodeResultResponses) {
this.errResult = ''
this.result = ''
this.scanCode = ''
this.successVisible = false
this.errVisible = false
this.scanTitle = '扫码结果:'
@ -536,6 +537,7 @@ export default {
type: 'warning'
}).then(() => {
this.init()
this.$message.success("放弃成功")
}).catch(() => {
});
},

@ -280,9 +280,11 @@
v-if="codeCheckVisible"
width="60%"
append-to-body
@close="closeCodeCheckDialog"
>
<DialogCheckCode
:orderData="curRow"
:closeCodeCheckDialog="closeCodeCheckDialog"
>
</DialogCheckCode>
@ -563,6 +565,10 @@ export default {
_this.curRow = row
_this.codeCheckVisible = true
},
closeCodeCheckDialog(){
this.codeCheckVisible = false
this.getList()
}
},
created() {

Loading…
Cancel
Save