Explorar o código

校园报修后台管理 v1.0.3

%!s(int64=4) %!d(string=hai) anos
pai
achega
c43be4784b

+ 2 - 1
build/webpack.dev.conf.js

@@ -42,7 +42,8 @@ const devWebpackConfig = merge(baseWebpackConfig, {
     quiet: true, // necessary for FriendlyErrorsPlugin
     watchOptions: {
       poll: config.dev.poll,
-    }
+    },
+    disableHostCheck: true
   },
   plugins: [
     new webpack.DefinePlugin({

+ 2 - 2
config/index.js

@@ -19,8 +19,8 @@ module.exports = {
       }
     },
     // Various Dev Server settings
-    host: 'localhost', // can be overwritten by process.env.HOST
-    port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
+    host: '127.0.0.1', // can be overwritten by process.env.HOST
+    port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: false,
     errorOverlay: true,
     notifyOnErrors: true,

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
dist/index.html


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 2 - 2
dist/static/css/app.e99ca772302ce9c2d21907c365678d97.css


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
dist/static/css/app.e99ca772302ce9c2d21907c365678d97.css.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 2
dist/static/js/app.73f143bb621d0815ccb2.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 1
dist/static/js/app.73f143bb621d0815ccb2.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 2 - 0
dist/static/js/app.dc4c226fc7d1da131532.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 0
dist/static/js/app.dc4c226fc7d1da131532.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
dist/static/js/manifest.15fc3d274cf3e70124f6.js.map


+ 12 - 12
src/components/complaint/complaint.vue

@@ -2,7 +2,7 @@
   <div id="container">
     <!-- 数据筛选按钮(时间筛选、条件筛选) -->
     <div class="block">
-      <el-button round @click="rest()">全部订单</el-button>
+      <el-button round @click="getAllComplaintList(null)">全部订单</el-button>
       <el-date-picker
         v-model="sear_data"
         type="date"
@@ -216,6 +216,7 @@ export default {
     },
     //获取订单列表
     getAllComplaintList(sear_data) {
+      this.tableData = [];
       const loading = this.$loading({
         lock: true,
         text: "Loading",
@@ -232,7 +233,6 @@ export default {
         })
           .then(({ data }) => {
             // console.log(data.data);
-            this.tableData = [];
             this.tableData = data.data.list;
             loading.close();
           })
@@ -253,7 +253,6 @@ export default {
         })
           .then(({ data }) => {
             // console.log(data.data.list);
-            this.tableData = [];
             this.tableData = data.data.list;
             loading.close();
           })
@@ -267,11 +266,9 @@ export default {
       }
     },
     //重置列表
-    rest() {
-      this.sear_data = null;
-      this.searchWork = null;
-      this.getAllComplaintList(null);
-    },
+    // rest() {
+    //   this.getAllComplaintList(null);
+    // },
     //查询指定维修人员列表
     getIdComplaintList() {
       const loading = this.$loading({
@@ -315,12 +312,15 @@ export default {
       })
         .then(({ data }) => {
           // console.log(data.data);
+          this.imgArr = null;
           this.detailObj = data.data;
           this.$set(this.detailObj, "detailVisible", true);
-          this.imgArr = this.detailObj.orderImages.match(/[^\;]+/g);
-          this.imgArr = this.imgArr.map(ite => {
-            return { innerVisible: false, img: ite };
-          });
+          if (this.detailObj.orderImages) {
+            this.imgArr = this.detailObj.orderImages.match(/[^\;]+/g);
+            this.imgArr = this.imgArr.map(ite => {
+              return { innerVisible: false, img: ite };
+            });
+          }
           // console.log(this.imgArr);
           if (data.status != 200) {
             this.$message({

+ 8 - 5
src/components/order/BackOrder/BackOrder.vue

@@ -267,19 +267,22 @@ export default {
     getOrderDetail(order_id) {
       this.$axios({
         method: "post",
-        url: `/baoxiu/repairApi/order/queryByOrderId?orderId=${order_id}`,
+        url: `/baoxiu/repairApi/order/queryByOrderIdNotWork?orderId=${order_id}`,
         headers: {
           token: this.token
         }
       })
         .then(({ data }) => {
           // console.log(data.data);
+          this.imgArr = null;
           this.detailObj = data.data;
           this.$set(this.detailObj, "detailVisible", true);
-          this.imgArr = this.detailObj.orderImages.match(/[^\;]+/g);
-          this.imgArr = this.imgArr.map(ite => {
-            return { innerVisible: false, img: ite };
-          });
+          if (this.detailObj.orderImages) {
+            this.imgArr = this.detailObj.orderImages.match(/[^\;]+/g);
+            this.imgArr = this.imgArr.map(ite => {
+              return { innerVisible: false, img: ite };
+            });
+          }
           // console.log(this.imgArr);
           if (data.status != 200) {
             this.$message({

+ 30 - 16
src/components/order/DeliOrder/DeliOrder.vue

@@ -115,7 +115,7 @@
             type="text"
             size="small"
             @click="
-              deliveryVisible = true;
+              scope.row.deliveryVisible = true;
               workId = 0;
             "
           >
@@ -125,7 +125,7 @@
           <template v-if="workers != null">
             <el-dialog
               title="指定维修人员"
-              :visible.sync="deliveryVisible"
+              :visible.sync="scope.row.deliveryVisible"
               width="30%"
               append-to-body
             >
@@ -138,7 +138,9 @@
                 >
               </el-radio-group>
               <span slot="footer" class="dialog-footer">
-                <el-button @click="deliveryVisible = false">取 消</el-button>
+                <el-button @click="scope.row.deliveryVisible = false"
+                  >取 消</el-button
+                >
                 <el-button
                   type="primary"
                   @click="deliverOrder(scope.row.orderId, workId)"
@@ -152,7 +154,7 @@
             type="text"
             size="small"
             @click="
-              backVisible = true;
+              scope.row.backVisible = true;
               orderBack = '';
             "
             >退回</el-button
@@ -160,7 +162,7 @@
           <!-- 退单弹窗 -->
           <el-dialog
             title="退回声明"
-            :visible.sync="backVisible"
+            :visible.sync="scope.row.backVisible"
             width="30%"
             append-to-body
           >
@@ -172,7 +174,9 @@
             >
             </el-input>
             <span slot="footer" class="dialog-footer">
-              <el-button @click="backVisible = false">取 消</el-button>
+              <el-button @click="scope.row.backVisible = false"
+                >取 消</el-button
+              >
               <el-button type="primary" @click="backOrder(scope.row.orderId)"
                 >确 定</el-button
               >
@@ -276,9 +280,13 @@ export default {
           }
         })
           .then(({ data }) => {
-            // console.log(data.data);
             this.tableData = [];
             this.tableData = data.data.list;
+            this.tableData.forEach(ite => {
+              this.$set(ite, "deliveryVisible", false);
+              this.$set(ite, "backVisible", false);
+            });
+            // console.log(this.tableData);
             loading.close();
           })
           .catch(err => {
@@ -301,6 +309,11 @@ export default {
             // console.log(data.data.list);
             this.tableData = [];
             this.tableData = data.data.list;
+            this.tableData.forEach(ite => {
+              this.$set(ite, "deliveryVisible", false);
+              this.$set(ite, "backVisible", false);
+            });
+            // console.log(this.tableData);
             loading.close();
           })
           .catch(err => {
@@ -335,14 +348,15 @@ export default {
             });
           } else {
             // console.log(data.data);
-            // this.detailObj = {};
+            this.imgArr = null;
             this.detailObj = data.data;
             this.$set(this.detailObj, "detailVisible", true);
-            this.imgArr = this.detailObj.orderImages.match(/[^\;]+/g);
-            this.imgArr = this.imgArr.map(ite => {
-              return { innerVisible: false, img: ite };
-            });
-            // console.log(this.imgArr);
+            if (this.detailObj.orderImages) {
+              this.imgArr = this.detailObj.orderImages.match(/[^\;]+/g);
+              this.imgArr = this.imgArr.map(ite => {
+                return { innerVisible: false, img: ite };
+              });
+            }
           }
         })
         .catch(err => {
@@ -384,12 +398,12 @@ export default {
           }
         });
         if (data.status == 200) {
-          // console.log(data.data);
+          console.log(order_id);
           this.$message({
             message: "派送成功",
             type: "success"
           });
-          this.getDeliOrderList();
+          this.getAllOrderList(this.sear_data, this.orderList);
         }
       }
     },
@@ -409,7 +423,7 @@ export default {
           message: "已退回",
           type: "success"
         });
-        this.getDeliOrderList();
+        this.getAllOrderList(this.sear_data, this.orderList);
       }
     },
     //导出表格

+ 7 - 4
src/components/order/SearOrder/SearOrder.vue

@@ -287,12 +287,15 @@ export default {
       })
         .then(({ data }) => {
           // console.log(data.data);
+          this.imgArr = null;
           this.detailObj = data.data;
           this.$set(this.detailObj, "detailVisible", true);
-          this.imgArr = this.detailObj.orderImages.match(/[^\;]+/g);
-          this.imgArr = this.imgArr.map(ite => {
-            return { innerVisible: false, img: ite };
-          });
+          if (this.detailObj.orderImages) {
+            this.imgArr = this.detailObj.orderImages.match(/[^\;]+/g);
+            this.imgArr = this.imgArr.map(ite => {
+              return { innerVisible: false, img: ite };
+            });
+          }
           // console.log(this.imgArr);
           if (data.status != 200) {
             this.$message({

+ 51 - 35
src/components/people/RepairPeo.vue

@@ -87,43 +87,55 @@ export default {
     //自定义验证方法
     var telPass = (rule, value, callback) => {
       if (this.registerForm.workPhone == "") {
+        this.registerForm_submit = 1;
         callback(new Error("手机号不能为空"));
       } else {
-        let phoneCodeVerification = /^[1][3,4,5,7,8][0-9]{9}$/;
+        let phoneCodeVerification = /^[1][3,4,5,7,8][0-9]{9}$/g;
         let boo = phoneCodeVerification.test(this.registerForm.workPhone);
         // console.log(boo);
         if (boo) {
           callback();
         } else {
-          callback(new Error("请输入正确手机号"));
+          this.registerForm_submit = 1;
+          callback(new Error("请输入11位手机号"));
         }
       }
     };
     var pwdPass = (rule, value, callback) => {
       if (this.registerForm.workPassword == "") {
+        this.registerForm_submit = 1;
         callback(new Error("密码不能为空"));
       } else {
-        let phoneCodeVerification = /^\d{4}[A-Z]$/;
+        let phoneCodeVerification = /^\d{4}[A-Z]$/g;
         let boo = phoneCodeVerification.test(this.registerForm.workPassword);
 
         if (boo) {
           callback();
         } else {
-          callback(new Error("请输入正确密码格式"));
+          this.registerForm_submit = 1;
+          callback(new Error("请输入手机号尾号4位与一位字母"));
         }
       }
     };
     var namePass = (rule, value, callback) => {
       if (this.registerForm.workName == "") {
+        this.registerForm_submit = 1;
         callback(new Error("姓名不能为空"));
       } else {
-        callback();
+        let phoneCodeVerification = /[\u4e00-\u9fa5]/;
+        let boo = phoneCodeVerification.test(this.registerForm.workName);
+        if (boo) {
+          callback();
+        } else {
+          this.registerForm_submit = 1;
+          callback(new Error("请输入中文名字"));
+        }
       }
     };
     return {
       tableData: [], //员工列表信息
       addPeoVisible: false, //添加员工弹窗
-      dialogVisible: false, //
+      registerForm_submit: 0,
       registerForm: {
         workPhone: "", //号码
         workCampus: "", //校区
@@ -224,39 +236,43 @@ export default {
     },
     //维修人员注册
     registerWork() {
-      this.$axios({
-        method: "post",
-        url: `/baoxiu/repairApi/work/insertWork?workPhone=${this.registerForm.workPhone}&workCampus=${this.registerForm.workCampus}&workPassword=${this.registerForm.workPassword}&workName=${this.registerForm.workName}`,
-        headers: {
-          token: this.token
-        }
-      })
-        .then(({ data }) => {
-          // console.log(data);
-          if (data.status != 200) {
+      if (this.registerForm_submit != 0) {
+        this.$message({
+          message: "无法注册,请规范注册",
+          type: "warning"
+        });
+      } else {
+        this.$axios({
+          method: "post",
+          url: `/baoxiu/repairApi/work/insertWork?workPhone=${this.registerForm.workPhone}&workCampus=${this.registerForm.workCampus}&workPassword=${this.registerForm.workPassword}&workName=${this.registerForm.workName}`,
+          headers: {
+            token: this.token
+          }
+        })
+          .then(({ data }) => {
+            // console.log(data);
+            if (data.status != 200) {
+              this.$message({
+                message: data.message,
+                type: "warning"
+              });
+            } else {
+              this.addPeoVisible = false;
+              this.$message({
+                message: data.message,
+                type: "success"
+              });
+              //清空
+              this.clearValidate();
+            }
+          })
+          .catch(err => {
             this.$message({
-              message: data.message,
+              message: err,
               type: "warning"
             });
-          } else {
-            this.addPeoVisible = false;
-            this.$message({
-              message: data.message,
-              type: "success"
-            });
-            //清空
-            this.registerForm.workPhone = "";
-            this.registerForm.workName = "";
-            this.registerForm.workCampus = "";
-            this.registerForm.workPassword = "";
-          }
-        })
-        .catch(err => {
-          this.$message({
-            message: err,
-            type: "warning"
           });
-        });
+      }
     },
     //移除人员
     deleteRow(index, rows, work_id) {