fix: 焦点获取

20240912_adapter_z
chenhc 7 months ago
parent 7cab8c36dc
commit cbb58dcbf6

@ -68,47 +68,10 @@
:name="item.name" :name="item.name"
> >
<component :is="item.component" v-bind="item.componentProps"/> <component :is="item.component" v-bind="item.componentProps" :reset-key="resetKeys[item.name]"/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<!-- <el-tabs :tab-position="tabPosition" style="height: 100%">-->
<!-- <el-tab-pane label="处理单据" style="height: 100%" @click="addTab('DealOrderBlank')">-->
<!-- <DealOrderBlank>-->
<!-- </DealOrderBlank>-->
<!-- </el-tab-pane>-->
<!-- <el-tab-pane label="工位上货"style="height: 100%" @click="addTab('IoCreateOrderBlankReturn')">-->
<!-- <IoCreateOrderBlankReturn-->
<!-- :splitType="'return'"-->
<!-- >-->
<!-- </IoCreateOrderBlankReturn>-->
<!-- </el-tab-pane>-->
<!-- <el-tab-pane label="工位退货" style="height: 100%" @click="addTab('IoCreateOrderBlankOut')">-->
<!-- <IoCreateOrderBlankOut-->
<!-- :splitType="'out'"-->
<!-- >-->
<!-- </IoCreateOrderBlankOut>-->
<!-- </el-tab-pane>-->
<!-- <el-tab-pane label="工位存量" style="height: 100%" @click="addTab('ioSplitFifoCodeBlank')">-->
<!-- <ioSplitFifoCodeBlank>-->
<!-- </ioSplitFifoCodeBlank>-->
<!-- </el-tab-pane>-->
<!-- <el-tab-pane label="待处理单" style="height: 100%" @click="addTab('CollectOrderAllotBlank')">-->
<!-- <CollectOrderAllotBlank>-->
<!-- </CollectOrderAllotBlank>-->
<!-- </el-tab-pane>-->
<!-- <el-tab-pane label="已完成单" style="height: 100%" @click="addTab('CollectOrderEndBlank')">-->
<!-- <CollectOrderEndBlank>-->
<!-- </CollectOrderEndBlank>-->
<!-- </el-tab-pane>-->
<!-- </el-tabs>-->
</el-col> </el-col>
</el-row> </el-row>
@ -213,7 +176,8 @@ export default {
} }
], ],
tabIndex: 0, tabIndex: 0,
menuActive: 0 menuActive: 0,
resetKeys:{}
} }
}, },
methods: { methods: {
@ -222,6 +186,7 @@ export default {
if (foundTab) { if (foundTab) {
// //
this.menuActive = foundTab.number this.menuActive = foundTab.number
this.$set(this.resetKeys, foundTab.name, Date.now());
} }
}, },
clickMenuItem(val) { clickMenuItem(val) {
@ -231,6 +196,7 @@ export default {
if (foundTab) { if (foundTab) {
// //
this.editableTabsValue = foundTab.name this.editableTabsValue = foundTab.name
this.$set(this.resetKeys, foundTab.name, Date.now());
} else { } else {
// //
this.addTab(item) this.addTab(item)

@ -306,12 +306,19 @@ import {delDrugLevel} from "@/api/basic/product/drugUdiinfos";
import {getCurOrder, getNextOrder, findByBill} from "@/api/collect/collectOrder"; import {getCurOrder, getNextOrder, findByBill} from "@/api/collect/collectOrder";
import PanelOrderAllDetail from "@/views/collect/PanelOrderAllDetail"; import PanelOrderAllDetail from "@/views/collect/PanelOrderAllDetail";
import {getWorkBindBusTypes, removeBusTypeById} from '@/api/basic/workPlace/sysWorkplaceDocuments' import {getWorkBindBusTypes, removeBusTypeById} from '@/api/basic/workPlace/sysWorkplaceDocuments'
import A from '../../plugins/KeyScaner'
export default { export default {
/** /**
* 处理处方 * 处理处方
*/ */
name: "prescribeTagCodeDeal", name: "prescribeTagCodeDeal",
props: {
resetKey: {
type: Function,
required: true
},
},
data() { data() {
return { return {
fromInvOptions: [], fromInvOptions: [],
@ -394,8 +401,12 @@ export default {
PannelOrderBiz, PannelOrderBiz,
PanelOrderAllDetail PanelOrderAllDetail
}, },
watch: {
resetKey(newVal, oldVal) {
this.$refs.inputRef.focus();
}
},
methods: { methods: {
getBillNo(billNo) { getBillNo(billNo) {
let post = { let post = {
billNo: billNo, billNo: billNo,
@ -440,6 +451,7 @@ export default {
this.findCurOrder(); this.findCurOrder();
} else { } else {
this.formData.busType = null this.formData.busType = null
this.$refs.inputRef.focus();
} }
} }
@ -797,13 +809,13 @@ export default {
}, },
startDeal() { startDeal() {
debugger
this.$message.error("开始处理单据")
this.curRow = this.formData; this.curRow = this.formData;
this.dealSplitOrder() this.dealSplitOrder()
this.formData.tagStatus = 2; this.formData.tagStatus = 2;
this.updateOrder(); this.updateOrder();
this.refreshCodesPanel(this); this.refreshCodesPanel(this);
this.$refs.inputRef.focus();
}, },
// //
@ -871,8 +883,9 @@ export default {
this.formData.confirmFinish = false; this.formData.confirmFinish = false;
this.refreshCodesPanel(this) this.refreshCodesPanel(this)
}, },
},
mounted() {
this.$refs.inputRef.focus();
}, },
created() { created() {
getHead("prescribeTagCodeDeal", "1").then((re) => { getHead("prescribeTagCodeDeal", "1").then((re) => {

@ -1,26 +1,8 @@
<template> <template>
<div> <div>
<!-- <div style="display: flex; justify-content: space-between; align-items: center;" v-if="isLinkDisabled">-->
<!-- <div style="margin-left: auto;">-->
<!-- <span-->
<!-- style="margin: 10px;color: #2d8cf0;font-size: 14px;"-->
<!-- >部门&nbsp:&nbsp{{ this.userInfo.deptName }}</span>-->
<!-- <span-->
<!-- style="font-weight: 500;color:rgb(51 48 48); font-size: 14px; margin-right: 20px"-->
<!-- >&nbsp&nbsp&nbsp&nbsp用户&nbsp:&nbsp({{-->
<!-- this.userInfo.userName-->
<!-- }})</span>-->
<!-- </div>-->
<!-- </div>-->
<el-form :model="formData" class="order-el-form" ref="formData" label-width="120px"> <el-form :model="formData" class="order-el-form" ref="formData" label-width="120px">
<el-card> <el-card>
<!--<el-row :gutter="0">-->
<!-- <el-col :span="24" align="right">-->
<!-- </el-col>-->
<!--</el-row>-->
<!-- <el-alert--> <!-- <el-alert-->
<!-- style="margin-top: 15px"--> <!-- style="margin-top: 15px"-->
<!-- :title="msgTip"--> <!-- :title="msgTip"-->
@ -100,17 +82,13 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item prop="busType" class="query-form-item" label="当前业务类型:"> <el-form-item prop="busType" class="query-form-item" label="业务类型:">
<el-select v-model="formData.busType" <el-select v-model="formData.busType"
ref="selectHeadEmpId"
filterable filterable
remote remote
disabled
@focus="handleFocus"
@change="busTypeChange" @change="busTypeChange"
reserve-keyword reserve-keyword
placeholder="请选择业务类型" clearable style="width: 60%" placeholder="请选择业务类型" clearable style="width: 90%">
>
<el-option <el-option
v-for="item in busTypeList" v-for="item in busTypeList"
:key="item.documentTypeCode" :key="item.documentTypeCode"
@ -121,7 +99,6 @@
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.documentTypeCode }}</span> <span style="float: right; color: #8492a6; font-size: 13px">{{ item.documentTypeCode }}</span>
</el-option> </el-option>
</el-select> </el-select>
<el-button type="primary" @click="toggleBusType"></el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -131,8 +108,7 @@
filterable filterable
remote remote
reserve-keyword reserve-keyword
placeholder="请选择往来单位" clearable style="width: 90%" placeholder="请选择往来单位" clearable style="width: 90%">
>
<el-option <el-option
v-for="item in fromInvOptions" v-for="item in fromInvOptions"
:key="item.erpId" :key="item.erpId"
@ -189,8 +165,7 @@
:type="scanResultType" :type="scanResultType"
:closable="false" :closable="false"
:dangerouslyUseHTMLString="true" :dangerouslyUseHTMLString="true"
:description="result" :description="result">
>
</el-alert> </el-alert>
</div> </div>
@ -331,12 +306,19 @@ import {delDrugLevel} from "@/api/basic/product/drugUdiinfos";
import {getCurOrder, getNextOrder, findByBill} from "@/api/collect/collectOrder"; import {getCurOrder, getNextOrder, findByBill} from "@/api/collect/collectOrder";
import PanelOrderAllDetail from "@/views/collect/PanelOrderAllDetail"; import PanelOrderAllDetail from "@/views/collect/PanelOrderAllDetail";
import {getWorkBindBusTypes, removeBusTypeById} from '@/api/basic/workPlace/sysWorkplaceDocuments' import {getWorkBindBusTypes, removeBusTypeById} from '@/api/basic/workPlace/sysWorkplaceDocuments'
import A from '../../plugins/KeyScaner'
export default { export default {
/** /**
* 处理处方 * 处理处方
*/ */
name: "prescribeTagCodeDeal", name: "prescribeTagCodeDeal",
props: {
resetKey: {
type: Function,
required: true
},
},
data() { data() {
return { return {
fromInvOptions: [], fromInvOptions: [],
@ -419,8 +401,12 @@ export default {
PannelOrderBiz, PannelOrderBiz,
PanelOrderAllDetail PanelOrderAllDetail
}, },
watch: {
resetKey(newVal, oldVal) {
this.$refs.inputRef.focus();
}
},
methods: { methods: {
getBillNo(billNo) { getBillNo(billNo) {
let post = { let post = {
billNo: billNo, billNo: billNo,
@ -465,6 +451,7 @@ export default {
this.findCurOrder(); this.findCurOrder();
} else { } else {
this.formData.busType = null this.formData.busType = null
this.$refs.inputRef.focus();
} }
} }
@ -499,11 +486,6 @@ export default {
} }
this.findCurOrder(); this.findCurOrder();
}, },
toggleBusType(){
//
this.$refs.selectHeadEmpId.blur();
this.selectBusTypeDisabled = true
},
handleClick(blankName) { handleClick(blankName) {
// let url = window.location.origin+`#/tagCodeBlank?workplaceId=`+ this.stationList[index].workplaceId // let url = window.location.origin+`#/tagCodeBlank?workplaceId=`+ this.stationList[index].workplaceId
@ -827,11 +809,13 @@ export default {
}, },
startDeal() { startDeal() {
this.curRow = this.formData; this.curRow = this.formData;
this.dealSplitOrder() this.dealSplitOrder()
this.formData.tagStatus = 2; this.formData.tagStatus = 2;
this.updateOrder(); this.updateOrder();
this.refreshCodesPanel(this); this.refreshCodesPanel(this);
this.$refs.inputRef.focus();
}, },
// //
@ -899,10 +883,9 @@ export default {
this.formData.confirmFinish = false; this.formData.confirmFinish = false;
this.refreshCodesPanel(this) this.refreshCodesPanel(this)
}, },
focusInput() { },
mounted() {
this.$refs.inputRef.focus(); this.$refs.inputRef.focus();
}
}, },
created() { created() {
getHead("prescribeTagCodeDeal", "1").then((re) => { getHead("prescribeTagCodeDeal", "1").then((re) => {
@ -928,11 +911,7 @@ export default {
this.getWorkBindBusTypes(this.formData.workPlaceCode); this.getWorkBindBusTypes(this.formData.workPlaceCode);
} }
},
mounted() {
this.$nextTick(() => {
this.focusInput();
});
} }
} }

@ -366,9 +366,17 @@ export default {
type: Object, type: Object,
required: true, required: true,
}, },
resetKey: {
type: Function,
required: true
},
}, },
watch: {
resetKey(newVal, oldVal) {
this.$refs.inputRef.focus();
}
},
data() { data() {
return { return {
isLinkDisabled: false, isLinkDisabled: false,
@ -1833,6 +1841,7 @@ export default {
} }
}; };
inputer.focus(); inputer.focus();
this.$refs.inputRef.focus();
}, },
created() { created() {
this.splitType = this.$route.query.splitType; this.splitType = this.$route.query.splitType;

@ -15,7 +15,10 @@
<!-- style="margin: 10px;color: #2d8cf0;font-size: 14px;"--> <!-- style="margin: 10px;color: #2d8cf0;font-size: 14px;"-->
<!-- >部门&nbsp:&nbsp{{ this.userInfo.deptName }}</span>--> <!-- >部门&nbsp:&nbsp{{ this.userInfo.deptName }}</span>-->
<!-- <span style="font-weight: 500;color:rgb(51 48 48); font-size: 14px;">用户--> <!-- <span style="font-weight: 500;color:rgb(51 48 48); font-size: 14px;">用户&nbsp:&nbsp-->
<!-- &lt;!&ndash; {{&ndash;&gt;-->
<!-- &lt;!&ndash; this.userInfo.companyName&ndash;&gt;-->
<!-- &lt;!&ndash; }}&ndash;&gt;-->
<!-- </span>--> <!-- </span>-->
<!-- <span--> <!-- <span-->
<!-- style="font-weight: 500;color:rgb(51 48 48); font-size: 14px; margin-right: 20px"--> <!-- style="font-weight: 500;color:rgb(51 48 48); font-size: 14px; margin-right: 20px"-->
@ -363,8 +366,16 @@ export default {
type: Object, type: Object,
required: true, required: true,
}, },
resetKey: {
type: Function,
required: true
},
},
watch: {
resetKey(newVal, oldVal) {
this.$refs.inputRef.focus();
}
}, },
data() { data() {
return { return {
@ -590,8 +601,8 @@ export default {
this.orderFormData.deptCode = tempData.deptCode this.orderFormData.deptCode = tempData.deptCode
this.orderFormData.invCode = tempData.invCode this.orderFormData.invCode = tempData.invCode
this.scanCode = ""; this.scanCode = "";
this.result = "" this.corpOrderIdDisabled = false;
// this.corpOrderIdDisabled = false;
this.refreshCodesPanel() this.refreshCodesPanel()
}, },
// //
@ -1479,7 +1490,6 @@ export default {
} }
}); });
} }
this.focusInput()
}, },
//稿 //稿
chooseDraftOrder() { chooseDraftOrder() {
@ -1718,7 +1728,7 @@ export default {
this.loading = false; this.loading = false;
}); });
// this.clearOrder() this.clearOrder()
}, },
/** /**
* 上货完成后清空数据 * 上货完成后清空数据
@ -1745,14 +1755,14 @@ export default {
preSpaceCode: null, preSpaceCode: null,
preCurSpaceCode: null, // preCurSpaceCode: null, //
sickerAdNum: null, sickerAdNum: null,
workPlaceCode: Number(this.$route.query.workplaceId), workPlaceCode: null,
fifoSplit: 1, fifoSplit: 1,
} }
this.scanCode = ""; this.scanCode = "";
this.result = ""; this.result = "";
this.refreshCodesPanel() this.refreshCodesPanel()
this.init(); this.init();
this.corpOrderIdDisabled = true
}, },
@ -1803,9 +1813,6 @@ export default {
this.showSearch = true this.showSearch = true
} }
},
focusInput() {
this.$refs.inputRef.focus();
} }
}, },
filters: {}, filters: {},
@ -1834,9 +1841,7 @@ export default {
} }
}; };
inputer.focus(); inputer.focus();
this.$nextTick(() => { this.$refs.inputRef.focus();
this.focusInput();
})
}, },
created() { created() {
this.splitType = this.$route.query.splitType; this.splitType = this.$route.query.splitType;

Loading…
Cancel
Save