Browse Source

物品出库物品信息展示页面删除按钮隐藏

duckweed 6 years ago
parent
commit
2c5085ba25

+ 53 - 0
WebService/src/main/resources/components/itemOutPackage/edit-resourceStore/editItemNumberStore.html

@@ -0,0 +1,53 @@
+<div id="editItemNumberStoreModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
+     aria-hidden="true">
+    <div class="modal-dialog modal-lg">
+        <div class="modal-content">
+            <div class="modal-body">
+                <h3 class="m-t-none m-b ">修改物品管理</h3>
+                <div class="ibox-content">
+                    <div>
+                        <div>
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">物品名称</label>
+                                <div class="col-sm-10">
+                                    <input v-model="editResourceStoreInfo.resName" type="text" placeholder="必填,请填写物品名称"
+                                           class="form-control">
+                                </div>
+                            </div>
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">物品编码</label>
+                                <div class="col-sm-10">
+                                    <input v-model="editResourceStoreInfo.resCode" type="text" placeholder="选填,请填写物品编码,如终端串码"
+                                           class="form-control">
+                                </div>
+                            </div>
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">物品价格</label>
+                                <div class="col-sm-10">
+                                    <input v-model="editResourceStoreInfo.price" type="text" placeholder="必填,请填写物品价格"
+                                           class="form-control">
+                                </div>
+                            </div>
+
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">描述</label>
+                                <div class="col-sm-10">
+                                    <textarea placeholder="选填,请填写描述" class="form-control"
+                                              v-model="editResourceStoreInfo.description"></textarea></div>
+                            </div>
+
+                            <div class="ibox-content">
+                                <button class="btn btn-primary float-right" type="button"
+                                        v-on:click="editResourceStore()"><i class="fa fa-check"></i>&nbsp;保存
+                                </button>
+                                <button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
+                                        data-dismiss="modal">取消
+                                </button>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>

+ 120 - 0
WebService/src/main/resources/components/itemOutPackage/edit-resourceStore/editItemNumberStore.js

@@ -0,0 +1,120 @@
+(function(vc,vm){
+
+    vc.extends({
+        data:{
+            editResourceStoreInfo:{
+                resId:'',
+                resName:'',
+                resCode:'',
+                price:'',
+                description:'',
+
+            }
+        },
+         _initMethod:function(){
+
+         },
+         _initEvent:function(){
+             vc.on('editItemNumberStore','openEditItemNumberStoreModal',function(_params){
+                vc.component.refreshEditResourceStoreInfo();
+                $('#editItemNumberStoreModel').modal('show');
+                vc.copyObject(_params, vc.component.editResourceStoreInfo );
+                vc.component.editResourceStoreInfo.communityId = vc.getCurrentCommunity().communityId;
+            });
+        },
+        methods:{
+            editResourceStoreValidate:function(){
+                        return vc.validate.validate({
+                            editResourceStoreInfo:vc.component.editResourceStoreInfo
+                        },{
+                            'editResourceStoreInfo.resName':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"物品名称不能为空"
+                        },
+ {
+                            limit:"maxin",
+                            param:"2,100",
+                            errInfo:"物品名称长度为2至100"
+                        },
+                    ],
+'editResourceStoreInfo.resCode':[
+ {
+                            limit:"maxLength",
+                            param:"50",
+                            errInfo:"物品编码不能超过50位"
+                        },
+                    ],
+'editResourceStoreInfo.price':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"物品价格不能为空"
+                        },
+ {
+                            limit:"money",
+                            param:"",
+                            errInfo:"物品价格格式错误"
+                        },
+                    ],
+
+'editResourceStoreInfo.description':[
+ {
+                            limit:"maxLength",
+                            param:"200",
+                            errInfo:"描述不能为空"
+                        },
+                    ],
+'editResourceStoreInfo.resId':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"物品ID不能为空"
+                        }]
+
+                        });
+             },
+            editResourceStore:function(){
+                if(!vc.component.editResourceStoreValidate()){
+                    vc.message(vc.validate.errInfo);
+                    return ;
+                }
+
+                vc.http.post(
+                    'editResourceStore',
+                    'update',
+                    JSON.stringify(vc.component.editResourceStoreInfo),
+                    {
+                        emulateJSON:true
+                     },
+                     function(json,res){
+                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
+                        if(res.status == 200){
+                            //关闭model
+                            $('#editResourceStoreModel').modal('hide');
+                             vc.emit('resourceStoreManage','listResourceStore',{});
+                            return ;
+                        }
+                        vc.message(json);
+                     },
+                     function(errInfo,error){
+                        console.log('请求失败处理');
+
+                        vc.message(errInfo);
+                     });
+            },
+            refreshEditResourceStoreInfo:function(){
+                vc.component.editResourceStoreInfo= {
+                  resId:'',
+                    resName:'',
+                    resCode:'',
+                    price:'',
+                    description:'',
+
+                }
+            }
+        }
+    });
+
+})(window.vc,window.vc.component);

+ 11 - 11
WebService/src/main/resources/components/itemOutPackage/itemOut-manage/itemOutManage.html

@@ -83,11 +83,11 @@
                                             v-on:click="_openEditResourceStoreModel(resourceStore)">修改
                                     </button>
                                 </div>
-                                <div class="btn-group">
-                                    <button class="btn-white btn btn-xs"
-                                            v-on:click="_openDeleteResourceStoreModel(resourceStore)">删除
-                                    </button>
-                                </div>
+<!--                                <div class="btn-group">-->
+<!--                                    <button class="btn-white btn btn-xs"-->
+<!--                                            v-on:click="_openDeleteResourceStoreModel(resourceStore)">删除-->
+<!--                                    </button>-->
+<!--                                </div>-->
                             </td>
 
                         </tr>
@@ -108,11 +108,11 @@
     </div>
 
 
-    <vc:create name="addResourceStore"
-               callBackListener=""
-               callBackFunction=""
-    ></vc:create>
-    <vc:create name="editResourceStore"></vc:create>
-    <vc:create name="deleteResourceStore"></vc:create>
+<!--    <vc:create name="addResourceStore"-->
+<!--               callBackListener=""-->
+<!--               callBackFunction=""-->
+<!--    ></vc:create>-->
+    <vc:create name="editItemNumberStore"></vc:create>
+<!--    <vc:create name="deleteResourceStore"></vc:create>-->
 
 </div>

+ 1 - 1
WebService/src/main/resources/components/itemOutPackage/itemOut-manage/itemOutManage.js

@@ -63,7 +63,7 @@
                 vc.emit('addResourceStore', 'openAddResourceStoreModal', {});
             },
             _openEditResourceStoreModel: function (_resourceStore) {
-                vc.emit('editResourceStore', 'openEditResourceStoreModal', _resourceStore);
+                vc.emit('editItemNumberStore', 'openEditItemNumberStoreModal', _resourceStore);
             },
             _openDeleteResourceStoreModel: function (_resourceStore) {
                 vc.emit('deleteResourceStore', 'openDeleteResourceStoreModal', _resourceStore);