12/3 已完成单据-码校验

20240912_adapter
wangwei 4 months ago
parent 2a0e6010b9
commit ace2c6622c

@ -683,3 +683,11 @@ export function batchUpdateCode(query) {
}); });
} }
export function checkCode(query) {
return axios({
url: "/warehouse/inout/checkCode",
method: "post",
data: query
});
}

@ -32,47 +32,48 @@
<el-col :span="12" class="el-col"> <el-col :span="12" class="el-col">
<div class="text item"> <div class="text item">
<div class="itemTag"> <div class="itemTag">
<span>药品名称:&nbsp;</span> <span>药品标识:&nbsp;</span>
</div> </div>
<el-input <el-input
style="width: 65%" style="width: 65%"
:disabled="true"
size="small" size="small"
splaceholder="请输入内容" splaceholder="请输入内容"
:disabled="true" v-model="detailQuery.nameCode"
v-model="detailQuery.cpmctymc"
></el-input> ></el-input>
</div> </div>
</el-col> </el-col>
<el-col :span="12" class="el-col"> <el-col :span="12" class="el-col">
<div class="text item"> <div class="text item">
<div class="itemTag"> <div class="itemTag">
<span>药品标识:&nbsp;</span> <span>药品名称:&nbsp;</span>
</div> </div>
<el-input <el-input
style="width: 65%" style="width: 65%"
:disabled="true"
size="small" size="small"
splaceholder="请输入内容" splaceholder="请输入内容"
v-model="detailQuery.nameCode" :disabled="true"
v-model="detailQuery.cpmctymc"
></el-input> ></el-input>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20" class="el-row" type="flex"> <el-row :gutter="20" class="el-row" type="flex">
<el-col :span="12" class="el-col"> <el-col :span="12" class="el-col">
<div class="text item"> <div class="text item">
<div class="itemTag"> <div class="itemTag">
<span>规格型号:&nbsp;</span> <span>制剂单位:&nbsp;</span>
</div> </div>
<el-input <el-input
style="width: 65%" style="width: 65%"
:disabled="true" :disabled="true"
size="small" size="small"
splaceholder="请输入内容" splaceholder="请输入内容"
v-model="detailQuery.ggxh" v-model="detailQuery.packUnit"
></el-input> ></el-input>
</div> </div>
</el-col> </el-col>
@ -111,7 +112,7 @@
<el-col :span="12" class="el-col"> <el-col :span="12" class="el-col">
<div class="text item"> <div class="text item">
<div class="itemTag"> <div class="itemTag">
<span>制剂单位:&nbsp;</span> <span>剂型:&nbsp;</span>
</div> </div>
<el-input <el-input
style="width: 65%" style="width: 65%"

@ -0,0 +1,337 @@
<template>
<div>
<el-card>
<el-form :model="orderData" class="demo-form-inline" style="margin-top: 30px">
<!--<div style="border: 1px solid #ebeef5;border-radius: 2px;margin-top: 15px;padding: 15px">-->
<el-row :gutter="0" style="margin-top: 5px">
<el-col :span="20">
<el-form-item prop="code" label="扫码校验" label-width="80px">
<el-input
id="inputer"
@keypress.enter.native="enterKey($event)"
ref="inputRef"
@focus="getInputFocus($event)"
style="ime-mode: disabled"
type="tel"
:placeholder="this.placeholder"
v-model="scanCode"
></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-button-group style="display: flex;">
<el-button
type="primary"
size="mini"
icon="el-icon-plus"
style="margin-left: 15px"
>添加
</el-button>
</el-button-group>
</el-col>
</el-row>
<el-alert
v-if="successVisible"
:title="scanTitle"
:type="scanResultType"
:closable="false"
:dangerouslyUseHTMLString="true"
:description="result"
>
</el-alert>
<!--<el-alert-->
<!-- v-if="warnVisible"-->
<!-- title="警告信息:"-->
<!-- type="warning"-->
<!-- :closable="true"-->
<!-- :dangerouslyUseHTMLString="true"-->
<!-- :description="warnResult">-->
<!--</el-alert>-->
<el-alert
v-if="errVisible"
title="错误信息:"
type="error"
:closable="false"
:dangerouslyUseHTMLString="true"
:description="errResult"
>
</el-alert>
<!--</div>-->
<el-descriptions title="单据信息" :column="4" border style="margin-top: 15px">
<el-descriptions-item label="单据编号">{{ orderData.billNo }}</el-descriptions-item>
<el-descriptions-item label="发货方">{{ orderData.fromCorp }}</el-descriptions-item>
<el-descriptions-item label="收货方">{{ orderData.fromCorpName }}</el-descriptions-item>
<el-descriptions-item label="单据时间">{{ orderData.billTime }}</el-descriptions-item>
<el-descriptions-item label="来源系统">{{ orderData.fromType }}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{ orderData.createTime }}</el-descriptions-item>
<el-descriptions-item label="完成时间">{{ orderData.updateTime }}</el-descriptions-item>
<el-descriptions-item label="单据备注">{{ orderData.remark }}</el-descriptions-item>
</el-descriptions>
</el-form>
</el-card>
<el-tabs type="border-card" style="margin: 15px">
<!--单据业务详情-->
<el-tab-pane>
<span slot="label">单据 {{ orderData.billNo }}-追溯码详情</span>
<el-table :data="detailList" style="width: 100%;" highlight-current-row="true" border ref="multipleTable">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="追溯码" prop="code"></el-table-column>
<el-table-column label="药品编码" prop="nameCode"></el-table-column>
<el-table-column label="药品通用名称" prop="productName" width="110"></el-table-column>
<el-table-column label="批次号" prop="batchNo"></el-table-column>
<el-table-column label="生产日期" prop="produceDate"></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="count"></el-table-column>
<el-table-column label="实际数量" prop="reCount"></el-table-column>
<el-table-column label="供应商" prop="supName"></el-table-column>
<el-table-column label="批准文号" prop="zczbhhzbapzbh"></el-table-column>
</el-table>
<pagination
v-show="resultTotal>0"
:total="resultTotal"
:limit.sync="codeQuery.limit"
:page.sync="codeQuery.page"
@pagination="getResultDetailList"
></pagination>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import { getCodeList } from '@/api/inout/code'
import { isBlank } from '@/utils/strUtil'
import { checkCode, batchVailCode } from '@/api/inout/order'
import { orderbatchAddCode } from '@/api/inout/splitCode'
export default {
name: 'DialogCheckCode',
props: {
orderData: {
type: Object,
default: null,
required: true
}
},
data() {
return {
detailList: [],
resultTotal:0,
scanTip: '扫码校验:',
placeholder: '请点击输入框进行扫码校验',
scanTitle: '扫码结果:',
scanResultType: 'success',
result: '\n',
errVisible: false,
successVisible: true,
errResult: '',
scanCode: '',
codeQuery: {
orderId: null,
code: null,
page: 1,
limit: 10
},
filterQuery: {
code: '',
billNo: null,
codeList: [],
orderId: null
}
}
},
methods: {
enterKey() {
this.errResult = ''
this.filterQuery.code = this.scanCode.trim()
if (this.filterQuery.code.includes(';')) {
const codeArray = this.filterQuery.code.split(';')
this.filterQuery.codeList = codeArray
this.filterQuery.code = ''
this.filterQuery.orderId = this.orderData.billNo
//
this.batchVailCode(this.filterQuery)
return
}
if (this.filterQuery.code) {
if (!this.parseString(this.filterQuery.code)) {
this.$refs.inputRef.focus()
this.$refs.inputRef.select()
this.$message.error('非法产品编码')
return
}
}
//
this.filterQuery.orderId = this.orderData.billNo
this.verifyCode(this.filterQuery)
// this.getInputFocus()
},
verifyCode(query) {
checkCode(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.$message.success('校验成功')
}
} else {
if (Array.isArray(res.data)) {
} else {
this.verifyFinish(2, res.data, res.message)
this.$message.error(res.message)
}
}
})
},
verifyFinish(val, data, message) {
if (val == 1) {
this.errVisible = false
this.successVisible = true
this.printCodeResult(data, message)
} else {
this.errVisible = true
this.successVisible = false
this.errResult = data + '追溯码不存在'
}
this.scanCode = ''
this.getInputFocus()
},
getInputFocus(event) {
// event.currentTarget.select();
this.$nextTick(() => {
this.$refs.inputRef.focus()
this.$refs.inputRef.select()
})
},
printCodeResult(data, message) {
const resultParts = []
if (data.udi) {
resultParts.push('层级标识: ' + data.udi)
}
if (data.batchNo) {
resultParts.push('批次号: ' + data.batchNo)
}
if (data.produceDate) {
resultParts.push('生产日期: ' + data.produceDate)
}
if (data.expireDate) {
resultParts.push('失效日期: ' + data.expireDate)
}
if (data.serialNo) {
resultParts.push('序列号: ' + data.serialNo)
}
this.scanTitle = '扫码结果:' + data.code
this.result = resultParts.join(' , ')
if (message == 'success') {
this.scanResultType = 'success'
}
},
async printCodeResultList(vailCodeResultResponses) {
this.errResult = ''
this.result = ''
this.successVisible = false
this.errVisible = false
this.scanTitle = '扫码结果:'
for (let i = 0; i < vailCodeResultResponses.length; i++) {
let data = vailCodeResultResponses[i]
if (data.status == 1) {
this.result = this.result + (isBlank(this.result) ? '' : ';') + vailCodeResultResponses[i].code + ':' + vailCodeResultResponses[i].sucMsg
} else if (data.status == 2) {
this.errResult = this.errResult + '\n' + vailCodeResultResponses[i].code + ':' + vailCodeResultResponses[i].errMsg
}
}
if (!isBlank(this.result)) {
this.successVisible = true
}
if (!isBlank(this.errResult)) {
this.errVisible = true
}
},
parseString(str) {
// 1. "MA"
if (str.startsWith('MA')) {
return true
}
// 2. "01" 18
if (str.startsWith('01') && str.length >= 18) {
return true
}
// 3. "#" "#" 4
if (str.startsWith('#') && (str.match(/#/g) || []).length >= 4) {
return true
}
// 4. "8" 20
if (str.startsWith('8') && str.length === 20) {
return true
}
// 5. "11", "17", "21", "10"
const prefixes = ['11', '17', '21', '10']
if (prefixes.some(prefix => str.startsWith(prefix))) {
return true
}
// false
return false
},
getResultDetailList() {
this.codeQuery.orderId = this.orderData.billNo
getCodeList(this.codeQuery).then((res) => {
if (res.code === 20000) {
this.detailList = res.data.list || []
this.resultTotal = res.data.total || 0;
} else {
this.$message.error(res.message)
this.detailList = []
this.resultTotal = 0;
}
}).catch((error) => {
this.$message.error(error.message)
this.detailList = []
// this.resultTotal = 0;
})
},
batchVailCode(params) {
// batchVailCode(params).then((res) => {
// if (res.code === 20000) {
this.$refs.inputRef.focus()
this.$refs.inputRef.select()
this.verifyCode(params)
// } else {
// this.$message.error(res.message)
// }
// })
},
init() {
this.codeQuery = {
orderId: null,
code: null,
page: 1,
limit: 10
}
this.errVisible = false
this.successVisible = true
}
},
created() {
this.getResultDetailList()
this.init()
},
mounted() {
this.getInputFocus()
}
}
</script>
<style scoped>
</style>

@ -272,6 +272,22 @@
</el-tabs> </el-tabs>
<el-dialog
title="扫码校验"
:visible.sync="codeCheckVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="codeCheckVisible"
width="60%"
append-to-body
>
<DialogCheckCode
:orderData="curRow"
>
</DialogCheckCode>
</el-dialog>
</div> </div>
</template> </template>
@ -286,6 +302,7 @@ import PanelOrderManuTagCode from './PanelOrderManuTagCode'
import prescribeOriginPanel from '@/views/collect/PannelOrderBiz' import prescribeOriginPanel from '@/views/collect/PannelOrderBiz'
import CollectFinishOrderDetail from '@/views/collect/CollectFinishOrderDetail' import CollectFinishOrderDetail from '@/views/collect/CollectFinishOrderDetail'
import CollectFinishOrderBackupDetail from "./CollectFinishOrderBackupDetail" import CollectFinishOrderBackupDetail from "./CollectFinishOrderBackupDetail"
import DialogCheckCode from "./DialogCheckCode"
import {orderFinish, orderPage} from '@/api/collect/collectOrder' import {orderFinish, orderPage} from '@/api/collect/collectOrder'
import {filterWorkOptimize} from '@/api/basic/workPlace/sysWorkplaceManage' import {filterWorkOptimize} from '@/api/basic/workPlace/sysWorkplaceManage'
@ -391,6 +408,9 @@ export default {
}, },
showType: 1, showType: 1,
isLinkDisabled: false, isLinkDisabled: false,
codeCheckVisible: false,
//
} }
}, },
@ -402,7 +422,8 @@ export default {
prescribeOriginPanel, prescribeOriginPanel,
PanelOrderManuTagCode, PanelOrderManuTagCode,
CollectFinishOrderDetail, CollectFinishOrderDetail,
CollectFinishOrderBackupDetail CollectFinishOrderBackupDetail,
DialogCheckCode
}, },
methods: { methods: {
changePlace(_this, query) { changePlace(_this, query) {
@ -535,7 +556,13 @@ export default {
_this.loading = false _this.loading = false
_this.options.findWorkPlace = [] _this.options.findWorkPlace = []
}) })
} },
//
codeCheckClick(_this,row){
_this.curRow = row
_this.codeCheckVisible = true
},
}, },
created() { created() {

@ -203,6 +203,13 @@ export default {
// //
this.noPassLoading = true this.noPassLoading = true
} }
//
const loading = this.$loading({
lock: true,
text: '审核中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
getAudit(data).then((res => { getAudit(data).then((res => {
if (val == '3'){ if (val == '3'){
this.passLoading = false this.passLoading = false
@ -210,11 +217,14 @@ export default {
this.noPassLoading = false this.noPassLoading = false
} }
if (res.code == 20000) { if (res.code == 20000) {
loading.close();
this.closeDialog(); this.closeDialog();
} else { } else {
loading.close();
this.$message.error(res.message); this.$message.error(res.message);
} }
})) }))
loading.close();
this.closeDialog() this.closeDialog()
} }
}, },

@ -203,6 +203,12 @@ export default {
// //
this.noPassLoading = true this.noPassLoading = true
} }
const loading = this.$loading({
lock: true,
text: '审核中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
getAudit(data).then((res => { getAudit(data).then((res => {
if (val == '3'){ if (val == '3'){
this.passLoading = false this.passLoading = false
@ -211,10 +217,13 @@ export default {
} }
if (res.code == 20000) { if (res.code == 20000) {
this.closeDialog(); this.closeDialog();
loading.close();
} else { } else {
loading.close();
this.$message.error(res.message); this.$message.error(res.message);
} }
})) }))
loading.close();
this.closeDialog() this.closeDialog()
} }
}, },

Loading…
Cancel
Save