外部环境滴码

20240912_adapter_z
zane 7 months ago
parent 2729a1783e
commit 28c34d9a4b

@ -614,4 +614,21 @@ export function submitCheckResult(query) {
});
}
export function batchVailCode(query) {
return axios({
url: "warehouse/inout/batchVailCode",
method: "post",
data: query
});
}
export function batchAddCode(query) {
return axios({
url: "warehouse/inout/batchAddCode",
method: "post",
data: query
});
}

@ -53,4 +53,11 @@ export function findInvRemindByBillNo(query) {
}
export function orderbatchAddCode(query) {
return axios({
url: "/udiwms/ioSplit/collect/order/batchAddCode",
method: "post",
data: query
});
}

@ -69,6 +69,7 @@ import deptSelect from "@/views/components/deptSelect/index.vue";
import planChooseDevice from "@/views/components/planChooseDevice/index.vue";
import _ from "loadsh"
import winExtend from "@/winExtend.js";
// 全局方法挂载
Vue.prototype.getDicts = getDicts;
@ -114,6 +115,7 @@ Vue.use(plugins);
Vue.use(VueMeta);
Vue.use(allTools);
Vue.use(ShowMsgBox)
Vue.use(winExtend);
DictData.install();
/**

@ -156,6 +156,7 @@
type="tel"
placeholder="请点击输入框进行扫码设置或者扫码录入"
v-model="scanCode"
:disabled="scanDisabled"
></el-input>
</el-form-item>
</el-col>
@ -347,14 +348,14 @@ import prescribeOriginPanel from "./PannelOrderBiz";
import prescribeCodePanel from "./PanelOrderTagCode";
import PannelOrderBiz from "./PannelOrderBiz";
import {listPage} from "@/api/basic/workPlace/sysWorkplaceManage";
import {enterCodeWeb} from "@/api/inout/order";
import {enterCodeWeb,batchVailCode} from "@/api/inout/order";
import {draftOrder, finishOrder, startSplit, tagCode, updateOrder} from "@/api/collect/splitCreateOrder";
import {selectCorpList} from "@/api/basic/basicUnitMaintain";
import {getCurOrder, getNextOrder, findByBill, findFromCorp} from "@/api/collect/collectOrder";
import PanelOrderAllDetail from "@/views/collect/PanelOrderAllDetail";
import {getWorkBindBusTypes, removeBusTypeById} from '@/api/basic/workPlace/sysWorkplaceDocuments'
import {getInvListByUser} from "@/api/system/invWarehouse";
import {orderbatchAddCode} from "@/api/inout/splitCode";
export default {
/**
* 处理处方
@ -445,7 +446,9 @@ export default {
busTypeTotal: 0,
invList: [],
viewType: 1
viewType: 1,
scanDisabled: false,
valiCodes: []
}
},
@ -996,9 +999,54 @@ export default {
let corp = this.fromInvOptions.find(item => item.erpId === this.formData.fromCorp);
this.formData.fromCorpName = corp.name
},
//
handleRecCodesEvent(event) {
console.log('接收 recCodes event:',event.detail.recCodes);
let params = {
codeList: event.detail.recCodes,
};
//
batchVailCode(params).then((res) => {
if (res.code === 20000) {
this.valiCodes = [];
console.log("==滴码接收==",res.data);
let list = res.data;
list.forEach(item => {
if (item.status === 1) {
this.valiCodes.push(item.code);
}
});
}else{
this.$message.error(res.message)
}
});
if(this.valiCodes != null && this.valiCodes.length > 0){
//
let params2 = {
workPlaceCode:this.formData.workPlaceCode,
codeList:this.valiCodes
}
orderbatchAddCode(params2).then((res) => {
if (res.code === 20000) {
this.$message.success("添加成功")
}else{
this.$message.error(res.message)
}
});
this.scanCode = this.valiCodes.join(";");
}
}
},
mounted() {
this.$refs.inputRef.focus();
//
if(window.navigator.userAgent.indexOf("GLXP_PC") != -1){
this.scanDisabled = true;
window.addEventListener('recCodes', this.handleRecCodesEvent);
}
},
unmounted() {
window.removeEventListener('recCodes', this.handleRecCodesEvent);
},
created() {
getHead("prescribeTagCodeDeal", "1").then((re) => {

@ -204,6 +204,7 @@
type="tel"
placeholder="请点击输入框进行扫码设置或者扫码录入"
v-model="scanCode"
:disabled="scanDisabled"
></el-input>
</el-form-item>
</el-col>
@ -315,6 +316,7 @@ import {
submitOrderWeb,
saveOrderWeb,
enterCodeWeb, submitAllocateBiz, rollbackWaitcheck, submitCodeResult, submitCheckResult, delmitBiz,
batchVailCode,batchAddCode
} from "@/api/inout/order";
import {filterSubAll, findByFrom, findInvByUser} from "@/api/system/invSubWarehouse";
import {parseTime} from "@/utils/coTools";
@ -570,6 +572,8 @@ export default {
rowData: {},
curWorkPlace: null,
fifoSplitEnable: false,
scanDisabled: false,//
valiCodes:[]
};
},
components: {
@ -1846,7 +1850,41 @@ export default {
this.showSearch = true
}
},
//
handleRecCodesEvent(event) {
console.log('接收 recCodes event:',event.detail.recCodes);
let params = {
codeList: event.detail.recCodes,
};
//
batchVailCode(params).then((response) => {
if (response.code === 20000) {
console.log("==滴码接收==",response.data);
this.valiCodes = [];
let list = response.data;
list.forEach(item => {
if (item.status === 1) {
valiCodes.push(item.code);
}
});
}
this.scanCode = this.valiCodes.join(";");
});
//
if(this.valiCodes !=null && this.valiCodes.length > 0){
let params2 = {
workPlaceCode:this.orderFormData.workPlaceCode,
codeList:this.valiCodes
}
batchAddCode(params2).then((res) => {
if (res.code === 20000) {
this.$message.success("添加成功")
}else{
this.$message.error(res.message)
}
});
}
}
},
filters: {},
mounted() {
@ -1875,6 +1913,14 @@ export default {
};
inputer.focus();
this.$refs.inputRef.focus();
//
if(window.navigator.userAgent.indexOf("GLXP_PC") != -1){
this.scanDisabled = true;
window.addEventListener('recCodes', this.handleRecCodesEvent);
}
},
unmounted() {
window.removeEventListener('recCodes', this.handleRecCodesEvent);
},
created() {
// this.splitType = this.$route.query.splitType;

@ -0,0 +1,17 @@
//扩展window函数
window.recCodes = function recCodes(codes) {
if(codes){
if (!Array.isArray(codes) || codes.some(item => typeof item!== 'string')) {
throw new Error('codes 参数必须是一个字符串数组');
}
// 触发自定义事件
window.dispatchEvent(new CustomEvent('recCodes', {
detail: {
recCodes: codes
}
}));
}else{
alert("收到空数据");
}
}
Loading…
Cancel
Save