From 3ecb58acf886095bb7c34cd09e7ddf0e6275a142 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Tue, 7 Jun 2022 19:10:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resourceEnterManage.html | 4 +++ .../resourceEnterManage.js | 28 ++++++++++++++++++- .../printPurchaseApply.html | 8 ++++-- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/public/pages/common/resourceEnterManage/resourceEnterManage.html b/public/pages/common/resourceEnterManage/resourceEnterManage.html index e425d9bc8..b8208a786 100755 --- a/public/pages/common/resourceEnterManage/resourceEnterManage.html +++ b/public/pages/common/resourceEnterManage/resourceEnterManage.html @@ -9,6 +9,7 @@
| + + | {{resourceEnter.rstName ? resourceEnter.rstName : '-'}} | {{resourceEnter.resName}} | {{resourceEnter.specName ? resourceEnter.specName : '-'}} | diff --git a/public/pages/common/resourceEnterManage/resourceEnterManage.js b/public/pages/common/resourceEnterManage/resourceEnterManage.js index 6230bfa70..b2d7a981b 100755 --- a/public/pages/common/resourceEnterManage/resourceEnterManage.js +++ b/public/pages/common/resourceEnterManage/resourceEnterManage.js @@ -13,6 +13,7 @@ resOrderType: '', purchaseApplyDetailVo: [], resourceSuppliers: [], + selectResIds: [], } }, _initMethod: function() { @@ -92,7 +93,19 @@ _submit: function() { //校验 是否填写正确 let msg = ''; + let _tmpPurchaseApplyDetailVo = []; $that.resourceEnterManageInfo.purchaseApplyDetailVo.forEach(function(item) { + $that.resourceEnterManageInfo.selectResIds.forEach(selectItem => { + if (item.resId == selectItem) { + _tmpPurchaseApplyDetailVo.push(item); + } + }) + }); + if (_tmpPurchaseApplyDetailVo.length < 1) { + vc.toast('请选择入库物品') + return; + } + _tmpPurchaseApplyDetailVo.forEach(function(item) { console.log(item); if (!item.hasOwnProperty("purchaseQuantity") || !item.purchaseQuantity || parseInt(item.purchaseQuantity) < 0) { msg = '采购数量未填写'; @@ -109,6 +122,7 @@ vc.toast(msg); return; } + $that.resourceEnterManageInfo.purchaseApplyDetailVo = _tmpPurchaseApplyDetailVo; vc.http.apiPost( '/purchase/resourceEnter', JSON.stringify($that.resourceEnterManageInfo), { @@ -152,7 +166,19 @@ vc.toast("处理失败:" + errInfo); } ); - } + }, + checkAll: function(e) { + var checkObj = document.querySelectorAll('.checkItem'); // 获取所有checkbox项 + if (e.target.checked) { // 判定全选checkbox的勾选状态 + for (var i = 0; i < checkObj.length; i++) { + if (!checkObj[i].checked) { // 将未勾选的checkbox选项push到绑定数组中 + vc.component.resourceEnterManageInfo.selectResIds.push(checkObj[i].value); + } + } + } else { // 如果是去掉全选则清空checkbox选项绑定数组 + vc.component.resourceEnterManageInfo.selectResIds = []; + } + }, } }); })(window.vc); \ No newline at end of file diff --git a/public/pages/property/printPurchaseApply/printPurchaseApply.html b/public/pages/property/printPurchaseApply/printPurchaseApply.html index b8530aa04..40cd633e5 100755 --- a/public/pages/property/printPurchaseApply/printPurchaseApply.html +++ b/public/pages/property/printPurchaseApply/printPurchaseApply.html @@ -18,6 +18,7 @@{{index +1}} | {{item.resName}} | {{item.resCode}} | +{{item.price}} | {{item.quantity}} | {{item.purchaseQuantity? item.purchaseQuantity : '-'}} | {{item.remark}} | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{printPurchaseApplyInfo.description}} | +{{printPurchaseApplyInfo.description}} | +参考总价格 | +{{printPurchaseApplyInfo.totalPrice}} | ||||||||||||||