diff --git a/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue b/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue index edd5f50..f558905 100644 --- a/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue +++ b/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue @@ -85,31 +85,11 @@ import { session } from '@/store/modules/session'; import { headers } from './config'; @Component export default class stoOutboundDom extends BasePage { - /** - * 表单引用 - */ @Ref('form') readonly $form!: VForm; - /** - * 表格引用 - */ @Ref('table') readonly $table: any; - - /** - * 页面Module - */ model = model; - /** - * search焦点获取 - */ firstFocus = false; - /** - * 表头 - */ headers = headers; - - /** - * 表单数据 - */ form = { dockCode: null, // 月台类型code dockName: null, // 月台类型name @@ -123,6 +103,7 @@ export default class stoOutboundDom extends BasePage { row: '', barCode: '', }; + rowItemIndex: any = null; materialList: any = []; //物料列表 //被选中的表格数据 selectMaterielList: any = []; @@ -193,12 +174,38 @@ export default class stoOutboundDom extends BasePage { duration: 2000, image: '/static/icons/icon-51.png', }); - this.form.productCode = this.model.materielList[0].materialCode; - this.form.productDescZh = this.model.materielList[0].materialDesc; - this.form.rowItem = this.model.materielList[0].materialCode; - this.form.row = this.model.materielList[0].rowItem; - this.form.orderAmount = this.model.materielList[0].orderAmount; - this.form.scanAmount = parseFloat(this.model.materielList[0].outAmount); + if (this.rowItemIndex == null) { + this.form.productCode = this.model.materielList[0].materialCode; + this.form.productDescZh = this.model.materielList[0].materialDesc; + this.form.rowItem = this.model.materielList[0].materialCode; + this.form.row = this.model.materielList[0].rowItem; + this.form.orderAmount = this.model.materielList[0].orderAmount; + this.form.scanAmount = parseFloat(this.model.materielList[0].outAmount); + this.rowItemIndex = this.model.materielList[0].rowItem; + } else { + let rowIndex: any = null; + this.model.materielList.forEach((item: any, index) => { + if (item.rowItem == this.rowItemIndex) { + rowIndex == index; + } + }); + if (rowIndex == null) { + this.form.productCode = this.model.materielList[0].materialCode; + this.form.productDescZh = this.model.materielList[0].materialDesc; + this.form.rowItem = this.model.materielList[0].materialCode; + this.form.row = this.model.materielList[0].rowItem; + this.form.orderAmount = this.model.materielList[0].orderAmount; + this.form.scanAmount = parseFloat(this.model.materielList[0].outAmount); + this.rowItemIndex = this.model.materielList[0].rowItem; + } else { + this.form.productCode = this.model.materielList[rowIndex].materialCode; + this.form.productDescZh = this.model.materielList[rowIndex].materialDesc; + this.form.rowItem = this.model.materielList[rowIndex].materialCode; + this.form.row = this.model.materielList[rowIndex].rowItem; + this.form.orderAmount = this.model.materielList[rowIndex].orderAmount; + this.form.scanAmount = parseFloat(this.model.materielList[rowIndex].outAmount); + } + } } } //选择成品编码 @@ -211,6 +218,7 @@ export default class stoOutboundDom extends BasePage { this.form.productDescZh = item.materialDesc; this.form.rowItem = item.materialCode; this.form.row = item.rowItem; + this.rowItemIndex = item.rowItem; this.form.orderAmount = item.orderAmount; this.form.scanAmount = parseFloat(item.outAmount); return; @@ -277,6 +285,7 @@ export default class stoOutboundDom extends BasePage { this.form.rowItem = ''; this.form.row = ''; this.form.barCode = ''; + this.rowItemIndex = null; this.model.empty(); } onOk() { diff --git a/src/pages/raw/handover/feeding/Location.vue b/src/pages/raw/handover/feeding/Location.vue index ca569ca..373b6d4 100644 --- a/src/pages/raw/handover/feeding/Location.vue +++ b/src/pages/raw/handover/feeding/Location.vue @@ -3,7 +3,7 @@ - + {{ $t('message.FillingMaterials') }} @@ -165,6 +165,7 @@ export default class RawReceiptDetail extends BasePage { amount: [{ required: true, message: this.$t('message.Pi_tip1') as string }], }; detailHeader = detailHeader; + sapSupplyIdList: any = []; empty() { this.some = {}; this.someIndex = 0; @@ -183,10 +184,23 @@ export default class RawReceiptDetail extends BasePage { this.model.blDetailList.length = 0; this.LocationList = []; } + async back() { + if (this.sapSupplyIdList.length != 0) { + await this.lock(); + } + uni.navigateBack({ delta: 1 }); + } + async lock() { + await this.model.lock(this.sapSupplyIdList); + } async query() { if (this.form.documentNo == '') { this.customToast(this.$t('message.Commission_tips1') as string); } + if (this.sapSupplyIdList.length != 0) { + await this.lock(); + this.sapSupplyIdList = []; + } this.LocEmpty(); this.wlCode = this.Location[0]; let inPrdOrderList = this.form.documentNo.split(','); @@ -202,7 +216,9 @@ export default class RawReceiptDetail extends BasePage { }; this.materialList.push(arr); item.wlList = []; + this.sapSupplyIdList.push(item.sapSupplyId); }); + console.log('this.sapSupplyIdList', this.sapSupplyIdList); this.some = this.model.blDetailList[0]; this.someIndex = 0; }); @@ -435,6 +451,7 @@ export default class RawReceiptDetail extends BasePage { await this.model.saveBlDetailUpload(params).then(() => { this.qty = ''; this.LocationList = []; + this.sapSupplyIdList = []; this.query(); }); } diff --git a/src/pages/raw/handover/feeding/model.ts b/src/pages/raw/handover/feeding/model.ts index 896b8b7..3032c8d 100644 --- a/src/pages/raw/handover/feeding/model.ts +++ b/src/pages/raw/handover/feeding/model.ts @@ -196,6 +196,17 @@ export class FeedingModule extends VuexModule { const submitListCode = res.code; return { submitListCode }; } + //补料解锁 + @MutationAction + async lock(sapSupplyIdList: any) { + const res: any = await http.post(url.auth.query.lock, { + factoryCode: session.factoryCode, + loginName: session.loginName, + sapSupplyIdList, + }); + console.log(res); + return {}; + } @Action({ commit: 'updateCheckedOrderInInfoListKw' }) async queryByFactoryCodeAndWorkAreaCode(content: any) { const res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content); diff --git a/src/utils/url.ts b/src/utils/url.ts index 52b290d..70af5ed 100644 --- a/src/utils/url.ts +++ b/src/utils/url.ts @@ -27,6 +27,7 @@ export const url = { location1: '/wmspda/material/orderin/receiveloc', queryAppendDetail: '/wmspda/bl/queryAppendDetail', createAppendList: '/wmspda/bl/createAppendList', + lock: '/wmspda/bl/unlock', }, systime: '/wmspda/auth/systime', userInfo: '/wmspda/auth/userinfo',