diff --git a/public/components/common/addResourceStore/addResourceStore.html b/public/components/common/addResourceStore/addResourceStore.html index 35204c718..afc423deb 100644 --- a/public/components/common/addResourceStore/addResourceStore.html +++ b/public/components/common/addResourceStore/addResourceStore.html @@ -21,6 +21,18 @@ class="form-control"> +
+ +
+ +
+
@@ -69,7 +81,7 @@
- +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ + +
+ + + + + + + \ No newline at end of file diff --git a/public/components/common/allocationStorehouse/allocationStorehouse.js b/public/components/common/allocationStorehouse/allocationStorehouse.js new file mode 100644 index 000000000..f77abfef3 --- /dev/null +++ b/public/components/common/allocationStorehouse/allocationStorehouse.js @@ -0,0 +1,201 @@ +(function (vc) { + vc.extends({ + data: { + allocationStorehouseInfo: { + resId: '', + resName: '', + resCode: '', + remark: '', + stock:0, + curStock:0, + shId: '', + curShId:'', + shName:'', + storehouses: [] + } + }, + _initMethod: function () { + + }, + _initEvent: function () { + vc.on('allocationStorehouse', 'openAllocationStorehouseModal', function (_param) { + $that._listAllocationStorehouse(); + let _that = $that.allocationStorehouseInfo; + _that.resId = _param.resId; + _that.resName = _param.resName; + _that.curStock = _param.stock; + _that.shName = _param.shName; + _that.curShId = _param.shId; + $('#allocationStorehouseModel').modal('show'); + }); + }, + methods: { + allocationStorehouseValidate() { + return vc.validate.validate({ + allocationStorehouseInfo: vc.component.allocationStorehouseInfo + }, { + 'allocationStorehouseInfo.resName': [ + { + limit: "required", + param: "", + errInfo: "物品名称不能为空" + }, + { + limit: "maxin", + param: "2,100", + errInfo: "物品名称长度为2至100" + }, + ], + 'allocationStorehouseInfo.resCode': [ + { + limit: "maxLength", + param: "50", + errInfo: "物品编码不能超过50位" + }, + ], + 'allocationStorehouseInfo.price': [ + { + limit: "required", + param: "", + errInfo: "物品价格不能为空" + }, + { + limit: "money", + param: "", + errInfo: "物品价格格式错误" + }, + ], + 'allocationStorehouseInfo.description': [ + { + limit: "maxLength", + param: "200", + errInfo: "描述不能为空" + }, + ], + 'allocationStorehouseInfo.showMobile': [ + { + limit: "required", + param: "", + errInfo: "手机端显示不能为空" + }, + ], + 'allocationStorehouseInfo.outLowPrice': [ + { + limit: "required", + param: "", + errInfo: "最低收费标准不能为空" + }, + { + limit: "money", + param: "", + errInfo: "收费标准格式错误" + }, + ], + 'allocationStorehouseInfo.outHighPrice': [ + { + limit: "required", + param: "", + errInfo: "最高收费标准不能为空" + }, + { + limit: "money", + param: "", + errInfo: "收费标准格式错误" + }, + ], + 'allocationStorehouseInfo.unitCode': [ + { + limit: "required", + param: "", + errInfo: "单位不能为空" + }, + ], + 'allocationStorehouseInfo.goodsType': [ + { + limit: "required", + param: "", + errInfo: "物品类型不能为空" + }, + ], + 'allocationStorehouseInfo.shId': [ + { + limit: "required", + param: "", + errInfo: "仓库不能为空" + }, + ], + }); + }, + saveResourceStoreInfo: function () { + if (!vc.component.allocationStorehouseValidate()) { + vc.toast(vc.validate.errInfo); + return; + } + vc.component.allocationStorehouseInfo.communityId = vc.getCurrentCommunity().communityId; + + vc.http.post( + 'allocationStorehouse', + 'save', + JSON.stringify(vc.component.allocationStorehouseInfo), + { + emulateJSON: true + }, + function (json, res) { + //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); + if (res.status == 200) { + //关闭model + $('#allocationStorehouseModel').modal('hide'); + vc.component.clearAllocationStorehouseInfo(); + vc.emit('resourceStoreManage', 'listResourceStore', {}); + return; + } + vc.toast(json); + }, + function (errInfo, error) { + console.log('请求失败处理'); + vc.toast(errInfo); + }); + }, + clearAllocationStorehouseInfo: function () { + vc.component.allocationStorehouseInfo = { + resName: '', + resCode: '', + price: '', + description: '', + outLowPrice: '', + outHighPrice: '', + showMobile: '', + remark: '', + goodsType: '', + goodsTypes: [], + unitCode: '', + shId: '', + unitCodes: [], + storehouses: [] + }; + }, + _listAllocationStorehouse: function (_page, _rows) { + + var param = { + params: { + page: 1, + row: 100, + communityId: vc.getCurrentCommunity().communityId + } + }; + + //发送get请求 + vc.http.apiGet('resourceStore.listStorehouses', + param, + function (json, res) { + let _storehouseManageInfo = JSON.parse(json); + vc.component.allocationStorehouseInfo.storehouses = _storehouseManageInfo.data; + + }, function (errInfo, error) { + console.log('请求失败处理'); + } + ); + }, + } + }); +})(window.vc); diff --git a/public/components/common/chooseResourceStore2/chooseResourceStore2.html b/public/components/common/chooseResourceStore2/chooseResourceStore2.html index 101e99211..a22623b38 100644 --- a/public/components/common/chooseResourceStore2/chooseResourceStore2.html +++ b/public/components/common/chooseResourceStore2/chooseResourceStore2.html @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/public/components/common/chooseResourceStore2/chooseResourceStore2.js b/public/components/common/chooseResourceStore2/chooseResourceStore2.js index 875a3a901..6275b5732 100644 --- a/public/components/common/chooseResourceStore2/chooseResourceStore2.js +++ b/public/components/common/chooseResourceStore2/chooseResourceStore2.js @@ -36,7 +36,8 @@ page:_page, row:_row, communityId:vc.getCurrentCommunity().communityId, - resOrderType:vc.component.chooseResourceStoreInfo2.resOrderType + resOrderType:vc.component.chooseResourceStoreInfo2.resOrderType, + shType:'2806' } }; diff --git a/public/pages/common/resourceStoreManage/resourceStoreManage.html b/public/pages/common/resourceStoreManage/resourceStoreManage.html index 976164de1..fa078a806 100644 --- a/public/pages/common/resourceStoreManage/resourceStoreManage.html +++ b/public/pages/common/resourceStoreManage/resourceStoreManage.html @@ -11,29 +11,34 @@
- +
+ v-model="resourceStoreManageInfo.conditions.resName" class=" form-control">
+ v-model="resourceStoreManageInfo.conditions.resCode" class=" form-control">
@@ -54,49 +59,55 @@
- +
- - - - - - - - - - + + + + + + + + + + + - - - - - - - - - + + + + + + + + - + + + + - - - + + +
物品ID物品名称物品类型物品编码物品价格收费标准物品库存操作
物品ID仓库名称物品名称物品类型物品编码物品价格收费标准物品库存操作
{{resourceStore.resId}}{{resourceStore.resName}}{{resourceStore.goodsTypeName}}{{resourceStore.resCode}}{{resourceStore.price}}元{{resourceStore.outPrice}}{{resourceStore.stock}} -
-
{{resourceStore.resId}}{{resourceStore.shName}}{{resourceStore.resName}}{{resourceStore.goodsTypeName}}{{resourceStore.resCode}}{{resourceStore.price}}元{{resourceStore.outPrice}}{{resourceStore.stock}} +
+ +
+
+ -
-
-
+
+ -
-
-
    -
    +
      +
      @@ -107,5 +118,8 @@
      + + + - + \ No newline at end of file diff --git a/public/pages/common/resourceStoreManage/resourceStoreManage.js b/public/pages/common/resourceStoreManage/resourceStoreManage.js index a8d5c27e0..fc6cd08c8 100644 --- a/public/pages/common/resourceStoreManage/resourceStoreManage.js +++ b/public/pages/common/resourceStoreManage/resourceStoreManage.js @@ -15,12 +15,15 @@ conditions: { resId: '', resName: '', - resCode: '' - } + resCode: '', + shId: '' + }, + storehouses: [] } }, _initMethod: function () { vc.component._listResourceStores(DEFAULT_PAGE, DEFAULT_ROWS); + $that._listStorehouses(); }, _initEvent: function () { vc.on('resourceStoreManage', 'listResourceStore', function (_param) { @@ -92,6 +95,9 @@ _openEditResourceStoreModel: function (_resourceStore) { vc.emit('editResourceStore', 'openEditResourceStoreModal', _resourceStore); }, + _openAllocationStorehouseModel: function (_resourceStore) { + vc.emit('allocationStorehouse', 'openAllocationStorehouseModal', _resourceStore); + }, _openDeleteResourceStoreModel: function (_resourceStore) { vc.emit('deleteResourceStore', 'openDeleteResourceStoreModal', _resourceStore); }, @@ -109,7 +115,27 @@ } else { vc.component.resourceStoreManageInfo.moreCondition = true; } - } + }, + _listStorehouses: function (_page, _rows) { + + var param = { + params: { + page: 1, + row: 100 + } + }; + + //发送get请求 + vc.http.apiGet('resourceStore.listStorehouses', + param, + function (json, res) { + var _storehouseManageInfo = JSON.parse(json); + vc.component.resourceStoreManageInfo.storehouses = _storehouseManageInfo.data; + }, function (errInfo, error) { + console.log('请求失败处理'); + } + ); + }, } }); })(window.vc);