From ea6248ae2fea249c4f62b952aee4a96f248c59ef Mon Sep 17 00:00:00 2001 From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU> Date: 星期二, 16 九月 2025 08:56:59 +0800 Subject: [PATCH] 采购退料:列表选择、列表明细更改为存储过程,添加组织隔离,添加库位列表,添加隐藏完结单号功能 --- H5/Js/PurchaseReturn.js | 107 ++++++++++++++++++++++++++--------- H5/PurchaseReturn.aspx | 40 +++++++++++- 2 files changed, 115 insertions(+), 32 deletions(-) diff --git a/H5/Js/PurchaseReturn.js b/H5/Js/PurchaseReturn.js index cf35b11..578e9a7 100644 --- a/H5/Js/PurchaseReturn.js +++ b/H5/Js/PurchaseReturn.js @@ -26,13 +26,21 @@ messageCenter: {}, messageId: 0, - show: false, - scanInfo: { barcodeNum: "", splitNum: "", barcode: "" }, ip: "", port: "", oldBarInfo: [], cfBarInfo: [], + + selectKey: "",//鏌ヨ鍏抽敭瀛� + actions: [],//鍒楄〃鐨勫�� + show: false,//鍒楄〃灞曠ず + // 褰撳墠閫変腑琛岀殑绱㈠紩 + currentIndex: -1, + // 瀛樺偍閫変腑琛屾暟鎹璞� + selItem: {}, + ItemBarKw: [],//褰撳ぉ琛岀浉鍏虫潯鐮佸簱浣嶄俊鎭� + DaaInfo: {}, } }, mounted() { @@ -45,20 +53,76 @@ //that.show = false; }, methods: { - getItemOutNo() { - var that = this; + /** + * 澶勭悊琛岀偣鍑讳簨浠讹紙鍗曢�夐�昏緫锛� + * @param {Object} item 褰撳墠琛屾暟鎹� + * @param {Number} index 褰撳墠琛岀储寮� + */ + handleRowClick(item, index) { + if (this.isLoading) { + return; + } + // 閲嶇疆鎵�鏈夎鐨勯�変腑鐘舵�� + this.currentIndex = -1; + + // 璁剧疆褰撳墠閫変腑琛� + this.currentIndex = index; + this.selItem = { + itemid: item.itemId,//椹煎嘲鍛藉悕娉曪紒锛侊紒 + index: index + }; + + console.log('褰撳墠閫変腑椤�:', this.selItem); // 璋冭瘯鐢� + + this.GetBarKwByItem(); + }, + //鑾峰彇搴撲綅淇℃伅 + GetBarKwByItem() { + //Womdaa + //WwGd + var that = this; that.isLoading = true; - that.AxiosHttp("post", 'MesCgthSq/GetMesCgthSq', { + that.AxiosHttp("post", 'Womdaa/GetBarKwByItem', { + itemId: that.selItem.itemid, + userName: that.userInfo.loginAccount }, false) .then(function (res) { var json = res; if (json.status == 0) { + that.ItemBarKw = json.data.tbBillList; + } + else { + that.$toast.fail(json.message); + that.$playSound('error'); + that.ItemBarKw = []; + } + that.isLoading = false; + }) + .catch(function (error) { + that.isLoading = false; + that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); + that.$playSound('error'); + console.log(error); + that.ItemBarKw = []; + }); + }, + getItemOutNo() { + var that = this; + that.isLoading = true; + that.AxiosHttp("post", 'MesCgthSq/GetMesCgthSq', {}, false) + .then(function (res) { + var json = res; + if (json.status == 0) { that.itemOutNoList = json.data.tbBillList; - that.itemOutNoStr = that.itemOutNoList.map(s => { - return { name: s.billNo } - }); - that.show = true; + if (!Array.isArray(that.itemOutNoList) || that.itemOutNoList.length === 0) { + that.$toast.fail("娌℃湁鍙敤鐨勬暟鎹�"); + that.show = false; + } + else { + that.itemOutNoStr = that.itemOutNoList.map(s => ({ name: s })); + that.show = true; + } } else { that.$playSound('error'); @@ -100,38 +164,27 @@ }, onSelect(item) { - // 榛樿鎯呭喌涓嬬偣鍑婚�夐」鏃朵笉浼氳嚜鍔ㄦ敹璧� - // 鍙互閫氳繃 close-on-click-action 灞炴�у紑鍚嚜鍔ㄦ敹璧� this.show = false; - - //let staf = this.stafList.filter(it => it.staffName === item.name); - this.scanFormData.itemOutNo = item.name; - - let itemOut = this.itemOutNoList.filter(it => it.billNo == item.name); - - this.invItemOutId = itemOut[0].id; - + this.invItemOutId = item.name; + this.ItemBarKw = []; // 閫夋嫨鐢宠鍗曞彿鍚庢竻绌哄簱浣嶅垪琛� this.getItem(); - }, getItem() { var that = this; that.isLoading = true; - - let itemOut = this.itemOutNoList.filter(it => it.billNo == that.scanFormData.itemOutNo); - - //this.invItemOutId = itemOut[0].id; - that.AxiosHttp("post", 'MesCgthSq/GetSumItem', { - //id: that.invItemOutId, billNo: that.scanFormData.itemOutNo, barcode: that.scanFormData.barcode, }, false) .then(function (res) { var json = res; if (json.status == 0) { - that.ItemDetail = json.data.tbBillList; + that.ItemDetail = { + items: json.data.tbBillList.items, + ysitems: json.data.tbBillList.ysitems, + allList: json.data.tbBillList.allList + }; that.$refs.barcode.focus(); } else { diff --git a/H5/PurchaseReturn.aspx b/H5/PurchaseReturn.aspx index c82f946..92dbe7d 100644 --- a/H5/PurchaseReturn.aspx +++ b/H5/PurchaseReturn.aspx @@ -8,6 +8,12 @@ </style> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server"> + <van-notice-bar + :scrollable="false" + :text="'褰撳墠缁勭粐锛�' + (Cookies.get('orgName') || '鏆傛棤缁勭粐淇℃伅')" + class="org-info" +/></van-notice-bar> + <div class="content-wrapper"> <van-nav-bar title="閲囪喘閫�鏂�" @@ -41,7 +47,7 @@ <%--@change="SaveBarCodes"--%> ></van-field> <van-field - v-model="scanFormData.itemNo" + v-model="scanFormData.itemid" label="鐗╂枡缂栫爜" placeholder="鐗╂枡缂栫爜" disabled @@ -70,7 +76,7 @@ </van-field> </van-cell-group> </div> - <van-tabs color="#000" title-active-color="#0283EF"> + <van-tabs color="#000" title-active-color="#0283EF"> <van-tab title="寰呮壂鐗╂枡" class="mySolid font"> <van-row> <van-col span="8" class="text-left padding-left">鐗╂枡</van-col> @@ -78,7 +84,12 @@ <van-col span="3">寰呮壂</van-col> <van-col span="5">鎺ㄨ崘搴撲綅</van-col> </van-row> - <van-row v-for="(itm,index) in ItemDetail.items" :key="index"> + <!-- 澧炲姞琛岀偣鍑讳笌閫変腑楂樹寒 --> + <van-row + v-for="(itm,index) in ItemDetail.items" + :key="index" + :style="{ background: currentIndex === index ? '#87CEEB' : '' }" + @click.native="handleRowClick(itm, index)"> <van-col span="8" class="text-left padding-left"> <div class="blue-text">{{itm.itemNo}}</div> <div>{{itm.itemName}}</div> @@ -91,6 +102,25 @@ </van-row> </van-tab> + <van-tab title="搴撲綅鍒楄〃" class="mySolid font"> + <van-row> + <van-col span="10" class="text-left padding-left">鏉$爜缂栧彿</van-col> + <van-col span="5" class="text-left padding-left">搴撲綅</van-col> + <van-col span="4">鏁伴噺</van-col> + <van-col span="5">浠撳簱</van-col> + </van-row> + <van-row v-for="(itm,index) in ItemBarKw" :key="index"> + <van-col span="10" class="text-left padding-left"> + <div class="blue-text">{{itm.iteM_BARCODE}}</div> + </van-col> + <van-col span="5" class="text-left padding-left"> + <div>{{itm.depoT_SECTIONS_CODE}}</div> + </van-col> + <van-col span="4" class="blue-text">{{itm.quantity}}</van-col> + <van-col span="5" >{{itm.depot_name}}</van-col> + </van-row> + </van-tab> + <van-tab title="宸叉壂鐗╂枡" class="mySolid font"> <van-row> <van-col span="8" class="text-left padding-left">鐗╂枡</van-col> @@ -100,7 +130,7 @@ </van-row> <van-row v-for="(itm,index) in ItemDetail.ysitems" :key="index"> <van-col span="8" class="text-left padding-left"> - <div class="blue-text">{{itm.itemNo}}</div> + <div class="blue-text">{{itm.itemid}}</div> <div>{{itm.itemName}}</div> </van-col> <van-col span="8" class="text-left padding-left"> @@ -123,5 +153,5 @@ <%--<comback ></comback>--%> </asp:Content> <asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder4" Runat="Server"> - <script src="Js/PurchaseReturn.js?<%=1281111111 %>"></script> + <script src="Js/PurchaseReturn.js?<%=1281111233 %>"></script> </asp:Content> -- Gitblit v1.9.3