Browse Source

优化页面显示

wuxw 6 years ago
parent
commit
4ffc33c8c9

+ 1 - 1
WebService/src/main/resources/components/complaintPackage/add-complaint/addComplaint.html

@@ -3,7 +3,7 @@
     <div class="modal-dialog modal-lg">
         <div class="modal-content">
             <div class="modal-body">
-                <h3 class="m-t-none m-b ">登记投诉</h3>
+                <h3 class="m-t-none m-b ">登记投诉建议</h3>
                 <div class="ibox-content">
                     <div>
                         <div>

+ 6 - 1
WebService/src/main/resources/components/complaintPackage/complaint-manage/complaintManage.html

@@ -101,6 +101,11 @@
                             <td class="text-center">{{complaint.tel}}</td>
                             <td class="text-center">{{complaint.state}}</td>
                             <td class="text-center">
+                                <div class="btn-group">
+                                    <button class="btn-white btn btn-xs"
+                                            v-on:click="_openEditComplaintModel(complaint)">修改
+                                    </button>
+                                </div>
                                 <div class="btn-group">
                                     <button class="btn-white btn btn-xs"
                                             v-on:click="_openDeleteComplaintModel(complaint)">删除
@@ -130,7 +135,7 @@
                callBackListener=""
                callBackFunction=""
     ></vc:create>
-    <!--<vc:create name="editComplaint"></vc:create>-->
+    <vc:create name="editComplaint"></vc:create>
     <vc:create name="deleteComplaint"></vc:create>
 
 </div>

+ 75 - 0
WebService/src/main/resources/components/complaintPackage/edit-complaint/editComplaint.html

@@ -0,0 +1,75 @@
+<div id="editComplaintModel" 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">商户ID</label>
+                                <div class="col-sm-10">
+                                    <input v-model="editComplaintInfo.storeId" type="text" placeholder="必填,请填写商户ID"
+                                           class="form-control">
+                                </div>
+                            </div>
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">投诉类型</label>
+                                <div class="col-sm-10">
+                                    <select class="custom-select" v-model="editComplaintInfo.typeCd">
+                                        <option selected disabled value="">必填,请选择投诉类型</option>
+                                        <option value="809001">投诉</option>
+                                        <option value="809002">建议</option>
+                                    </select></div>
+                            </div>
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">房屋编号</label>
+                                <div class="col-sm-10">
+                                    <input v-model="editComplaintInfo.roomId" 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="editComplaintInfo.complaintName" 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="editComplaintInfo.tel" 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="editComplaintInfo.state" 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="editComplaintInfo.context"></textarea></div>
+                            </div>
+
+                            <div class="ibox-content">
+                                <button class="btn btn-primary float-right" type="button" v-on:click="editComplaint()">
+                                    <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>

+ 171 - 0
WebService/src/main/resources/components/complaintPackage/edit-complaint/editComplaint.js

@@ -0,0 +1,171 @@
+(function(vc,vm){
+
+    vc.extends({
+        data:{
+            editComplaintInfo:{
+                complaintId:'',
+storeId:'',
+typeCd:'',
+roomId:'',
+complaintName:'',
+tel:'',
+state:'',
+context:'',
+
+            }
+        },
+         _initMethod:function(){
+
+         },
+         _initEvent:function(){
+             vc.on('editComplaint','openEditComplaintModal',function(_params){
+                vc.component.refreshEditComplaintInfo();
+                $('#editComplaintModel').modal('show');
+                vc.copyObject(_params, vc.component.editComplaintInfo );
+                vc.component.editComplaintInfo.communityId = vc.getCurrentCommunity().communityId;
+            });
+        },
+        methods:{
+            editComplaintValidate:function(){
+                        return vc.validate.validate({
+                            editComplaintInfo:vc.component.editComplaintInfo
+                        },{
+                            'editComplaintInfo.storeId':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"商户ID不能为空"
+                        },
+ {
+                            limit:"num",
+                            param:"",
+                            errInfo:"商户ID必须为数字"
+                        },
+                    ],
+'editComplaintInfo.typeCd':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"投诉类型不能为空"
+                        },
+ {
+                            limit:"num",
+                            param:"",
+                            errInfo:"投诉类型格式错误"
+                        },
+                    ],
+'editComplaintInfo.roomId':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"房屋编号不能为空"
+                        },
+ {
+                            limit:"num",
+                            param:"",
+                            errInfo:"房屋编号格式错误"
+                        },
+                    ],
+'editComplaintInfo.complaintName':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"投诉人不能为空"
+                        },
+ {
+                            limit:"maxLength",
+                            param:"200",
+                            errInfo:"投诉人不能大于200位"
+                        },
+                    ],
+'editComplaintInfo.tel':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"投诉电话不能为空"
+                        },
+ {
+                            limit:"phone",
+                            param:"",
+                            errInfo:"投诉电话格式错误"
+                        },
+                    ],
+'editComplaintInfo.state':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"投诉状态不能为空"
+                        },
+ {
+                            limit:"num",
+                            param:"",
+                            errInfo:"投诉状态格式错误"
+                        },
+                    ],
+'editComplaintInfo.context':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"投诉内容不能为空"
+                        },
+ {
+                            limit:"maxLength",
+                            param:"4000",
+                            errInfo:"投诉状态超过4000位"
+                        },
+                    ],
+'editComplaintInfo.complaintId':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"投诉ID不能为空"
+                        }]
+
+                        });
+             },
+            editComplaint:function(){
+                if(!vc.component.editComplaintValidate()){
+                    vc.message(vc.validate.errInfo);
+                    return ;
+                }
+
+                vc.http.post(
+                    'editComplaint',
+                    'update',
+                    JSON.stringify(vc.component.editComplaintInfo),
+                    {
+                        emulateJSON:true
+                     },
+                     function(json,res){
+                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
+                        if(res.status == 200){
+                            //关闭model
+                            $('#editComplaintModel').modal('hide');
+                             vc.emit('complaintManage','listComplaint',{});
+                            return ;
+                        }
+                        vc.message(json);
+                     },
+                     function(errInfo,error){
+                        console.log('请求失败处理');
+
+                        vc.message(errInfo);
+                     });
+            },
+            refreshEditComplaintInfo:function(){
+                vc.component.editComplaintInfo= {
+                  complaintId:'',
+storeId:'',
+typeCd:'',
+roomId:'',
+complaintName:'',
+tel:'',
+state:'',
+context:'',
+
+                }
+            }
+        }
+    });
+
+})(window.vc,window.vc.component);