From a38bbbcca119f6dfc1d065834ab4ad9bd23d6c63 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Thu, 29 Apr 2021 19:40:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=87=87=E8=B4=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../expirationContractManage.html | 1 - .../expirationContractManage.js | 3 +- .../allocationStorehouseApplyManage.html | 36 +++++++++++- .../allocationStorehouseApplyManage.js | 55 ++++++++++++++++++- 4 files changed, 88 insertions(+), 7 deletions(-) diff --git a/public/pages/admin/expirationContractManage/expirationContractManage.html b/public/pages/admin/expirationContractManage/expirationContractManage.html index 5b770ce93..08b124e4e 100644 --- a/public/pages/admin/expirationContractManage/expirationContractManage.html +++ b/public/pages/admin/expirationContractManage/expirationContractManage.html @@ -106,7 +106,6 @@ - \ No newline at end of file diff --git a/public/pages/admin/expirationContractManage/expirationContractManage.js b/public/pages/admin/expirationContractManage/expirationContractManage.js index 2b858576d..3bb5c8414 100644 --- a/public/pages/admin/expirationContractManage/expirationContractManage.js +++ b/public/pages/admin/expirationContractManage/expirationContractManage.js @@ -60,7 +60,8 @@ ); }, _openAddContractModel: function (_contract) { - vc.emit('addContract', 'openAddContractModal', _contract); + //vc.emit('addContract', 'openAddContractModal', _contract); + vc.jumpToPage('/admin.html#/pages/admin/addContract?contractId='+_contract.contractId) }, _stopContractModel: function (_contract) { diff --git a/public/pages/common/allocationStorehouseApplyManage/allocationStorehouseApplyManage.html b/public/pages/common/allocationStorehouseApplyManage/allocationStorehouseApplyManage.html index bb0c7f42b..c6cb8fd73 100644 --- a/public/pages/common/allocationStorehouseApplyManage/allocationStorehouseApplyManage.html +++ b/public/pages/common/allocationStorehouseApplyManage/allocationStorehouseApplyManage.html @@ -5,6 +5,9 @@
调拨物品
+
+
+
+
+
+
调拨说明
+
+ +
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+ +
+
diff --git a/public/pages/common/allocationStorehouseApplyManage/allocationStorehouseApplyManage.js b/public/pages/common/allocationStorehouseApplyManage/allocationStorehouseApplyManage.js index 4cc9e596f..c4f091624 100644 --- a/public/pages/common/allocationStorehouseApplyManage/allocationStorehouseApplyManage.js +++ b/public/pages/common/allocationStorehouseApplyManage/allocationStorehouseApplyManage.js @@ -12,7 +12,8 @@ records: 1, moreCondition: false, resName: '', - storehouses: [] + storehouses: [], + remark: '' } }, _initMethod: function () { @@ -28,8 +29,8 @@ return; } }); - if(!_addFlag){ - return ; + if (!_addFlag) { + return; } _param.shaName = _param.shName; _param.shzId = ''; @@ -78,6 +79,54 @@ } ); }, + _goBack: function () { + vc.goBack(); + }, + _submitApply: function () { + //校验数据 + if ($that.allocationStorehouseManageInfo.remark == '') { + vc.toast('申请说明不能为空'); + return; + } + + let _saveFlag = true; + + if ($that.allocationStorehouseManageInfo.resourceStores.length < 1) { + vc.toast('请选择物品'); + return; + } + + $that.allocationStorehouseManageInfo.resourceStores.forEach(item => { + if (parseInt(item.curStock) > parseInt(item.stock)) { + vc.toast(item.name + "库存不足"); + _saveFlag = false; + return; + } + }); + + if (!_saveFlag) { + return; + } + vc.http.apiPost( + 'resourceStore.saveAllocationStorehouse', + JSON.stringify($that.allocationStorehouseManageInfo), + { + emulateJSON: true + }, + function (json, res) { + if (res.status == 200) { + //关闭model + vc.goBack(); + return; + } + vc.toast(json); + }, + function (errInfo, error) { + console.log('请求失败处理'); + vc.toast(errInfo); + }); + + } } }); })(window.vc);