Просмотр исходного кода

Merge branch 'dev_info' into 'master'

Dev info

See merge request spfm-group/spfm-market-front!10
侯利飞 3 лет назад
Родитель
Сommit
579fa613cf

+ 76 - 9
src/pages/main/gridDivision/approvalExamination.vue

@@ -245,8 +245,14 @@ export default {
           "Content-Type": "application/json",
         },
         data: reqdata,
-      }).then(({ data: { count, data } }) => {
+      }).then(({ data: body }) => {
         this.table_loading = false;
+        console.log(body.body);
+
+        // 列表数据回显
+        let data = body.body.page.data;
+        let count = body.body.page.count;
+
         this.total = count;
         this.table_list = data
           ? data.map((element, index) => ({
@@ -255,7 +261,7 @@ export default {
               sts: this.status + "",
             }))
           : [];
-        this.table_list && this.table_list[0].sts === "0"
+        this.table_list.length && this.table_list[0].sts === "0"
           ? (this.table_handle = [
               {
                 label: "返回",
@@ -300,8 +306,47 @@ export default {
       this.page = page;
       this.handleInit();
     },
-    handleDownload(data) {
-      console.log(data, "data");
+    handleDownload({ index, rows }) {
+      let fileName = "";
+      let fileCode = "";
+      rows.attList.forEach((el, no) => {
+        if (no === index) {
+          fileName = el.fileName;
+          fileCode = el.fileCode;
+        }
+      });
+      console.log(index, rows);
+      console.log(fileName, fileCode);
+      this.$http({
+        url: "/market/compatt/downfile",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        responseType: "blob",
+        data: { id: fileCode, fileName: fileName },
+      }).then((response) => {
+        if (window.navigator && window.navigator.msSaveOrOpenBlob) {
+          let blob = new Blob([response.data], {
+            type: "application/vnd.ms-excel",
+          });
+          window.navigator.msSaveOrOpenBlob(blob, fileName);
+        } else {
+          /* 火狐谷歌的文件下载方式 */
+          var blob = new Blob([response.data]);
+          var downloadElement = document.createElement("a");
+          var href = window.URL.createObjectURL(blob);
+          downloadElement.href = href;
+          downloadElement.download = fileName;
+          document.body.appendChild(downloadElement);
+          downloadElement.click();
+          document.body.removeChild(downloadElement);
+          window.URL.revokeObjectURL(href);
+        }
+      });
+
+      // // /market/compatt/downfile
+      // console.log(item);
     },
     handleVisible(props) {
       switch (props) {
@@ -375,8 +420,19 @@ export default {
           data: {
             ...reqdata,
           },
-        }).then((res) => {
-          console.log(res);
+        }).then(({ data }) => {
+          console.log(data);
+          if (data.desc === "操作成功") {
+            this.$message({
+              message: "操作成功!",
+              type: "success",
+            });
+          } else if (data.desc === "操作失败") {
+            this.$message({
+              message: "操作失败!",
+              type: "error",
+            });
+          }
           this.handleInit();
         });
       } else {
@@ -397,9 +453,20 @@ export default {
           data: {
             ...reqdata,
           },
-        }).then((res) => {
-          console.log(res);
-          this.status = '1'
+        }).then(({ data }) => {
+          console.log(data);
+          this.status = "1";
+          if (data.desc === "操作成功") {
+            this.$message({
+              message: "操作成功!",
+              type: "success",
+            });
+          } else if (data.desc === "操作失败") {
+            this.$message({
+              message: "操作失败!",
+              type: "error",
+            });
+          }
           this.handleInit();
         });
       }

+ 44 - 2
src/pages/main/gridDivision/workersList.vue

@@ -144,6 +144,9 @@
           <el-button @click="handleSubmit('failed')" type="default"
             >退回修改</el-button
           >
+          <el-button @click="handleVisible('add')" type="default"
+            >取消</el-button
+          >
         </div>
       </template>
     </simple-dialog>
@@ -394,8 +397,47 @@ export default {
           "Content-Type": "application/json",
         },
         data: reqdata,
-      }).then(({ data: { count, data } }) => {
+      }).then(({ data: body }) => {
         this.table_loading = false;
+        console.log(body.body);
+
+        // 汇总或新建权限判断是否显示按钮
+        let huiZongButton = body.body.huiZongButton;
+        let insertButton = body.body.insertButton;
+
+        if (huiZongButton && insertButton) {
+          this.table_handle = [
+            {
+              label: "工单汇总",
+              props: "summary",
+            },
+            {
+              label: "新建",
+              props: "add",
+            },
+          ];
+        }else if(huiZongButton && !insertButton){
+          this.table_handle = [
+            {
+              label: "工单汇总",
+              props: "summary",
+            },
+          ];
+        }else if(!huiZongButton && insertButton){
+          this.table_handle = [
+            {
+              label: "新建",
+              props: "add",
+            },
+          ];
+        }else{
+          this.table_handle = []
+        }
+
+        // 列表数据回显
+        let data = body.body.page.data;
+        let count = body.body.page.count;
+
         this.total = count;
         this.table_list = data
           ? data.map((element, index) => ({
@@ -516,7 +558,7 @@ export default {
           type,
         },
       }).then(({ data: { body } }) => {
-        console.log(body, "body");
+        // console.log(body, "body");
         this.ids = [body.wanggeId.toString()];
         this.add_form = {
           id: body.wanggeId,

+ 7 - 7
src/pages/main/performance/components/sheet.vue

@@ -2,7 +2,7 @@
  * @Author       : yuanrunwei
  * @Date         : 2021-12-04 14:23:58
  * @LastEditors: Please set LastEditors
- * @LastEditTime: 2022-01-14 16:12:41
+ * @LastEditTime: 2022-01-18 20:44:14
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\sheet.vue
 -->
 
@@ -110,15 +110,15 @@
                 </el-select>
                 <div class="form-select">
                   <span class="form-content">可编辑行:从</span>
-                  <el-input v-model="item.col_start" />
+                  <el-input v-model="item.row_start" />
                   <span class="form-content">到</span>
-                  <el-input v-model="item.col_end" />
+                  <el-input v-model="item.row_end" />
                 </div>
                 <div class="form-select">
                   <span class="form-content">可编辑列:从</span>
-                  <el-input v-model="item.row_start" />
+                  <el-input v-model="item.col_start" />
                   <span class="form-content">到</span>
-                  <el-input v-model="item.row_end" />
+                  <el-input v-model="item.col_end" />
                 </div>
               </div>
             </el-form-item>
@@ -593,8 +593,8 @@ export default {
         //  特殊权限
         reqdata.specialAuth = charge.map((el) =>
           JSON.stringify({
-            allowEditingColumns: this.paramsArr(el.col_start, el.col_end),
-            rowNum: this.paramsArr(el.row_start, el.row_end),
+            allowEditingColumns: `${el.col_start},${el.col_end}`,
+            rowNum: `${el.row_start},${el.row_end}`,
             principalId: el.person.split(",")[0],
             principalName: el.person.split(",")[1],
           })

+ 19 - 8
src/pages/main/performance/components/table.vue

@@ -2,7 +2,7 @@
  * @Author       : yuanrunwei
  * @Date         : 2021-11-01 18:02:58
  * @LastEditors: Please set LastEditors
- * @LastEditTime: 2022-01-14 11:31:39
+ * @LastEditTime: 2022-01-18 14:47:12
  * @FilePath     : /spfm-market-front/src/pages/main/performance/components/table.vue
 -->
 <template>
@@ -20,7 +20,7 @@
     />
     <el-table-column
       v-for="(
-        { props, label, type, width, align, children, dictionary, variable },
+        { props, label, type, width, align, children, dictionary, control },
         index
       ) in config"
       :key="index"
@@ -53,11 +53,22 @@
         </div>
         <div v-else-if="type === 'click'">
           <div
-            class="simple-table-click cursor-pointer flex"
+            v-if="control && Number(scope.row[control]) < 1"
+            class="simple-table-click cursor-pointer"
             @click="handleClick(props, scope.row)"
           >
             {{ scope.row[props] }}
           </div>
+          <div
+            v-else-if="!control"
+            class="simple-table-click cursor-pointer"
+            @click="handleClick(props, scope.row)"
+          >
+            {{ scope.row[props] }}
+          </div>
+          <div v-else class="cursor-pointer">
+            {{ scope.row[props] }}
+          </div>
         </div>
         <div v-else-if="type === 'dictionary'">
           {{ dictionary[scope.row[props]] }}
@@ -67,8 +78,8 @@
             <div
               v-for="({ fileName }, index) in scope.row[props]"
               :key="index"
-              @click="downloadFile({index,rows:scope.row})"
-               class="simple-table-click cursor-pointer margin-left-10"
+              @click="downloadFile({ index, rows: scope.row })"
+              class="simple-table-click cursor-pointer margin-left-10"
             >
               {{ fileName }}
             </div>
@@ -97,9 +108,9 @@
             </div>
             <div v-else>{{ scope.row[props] }}</div>
           </template>
-          <template v-if="variable">
+          <!-- <template v-if="variable">
             <div>{{ scope.row[props] }}</div>
-          </template>
+          </template> -->
         </el-table-column>
       </template>
     </el-table-column>
@@ -119,7 +130,7 @@
             <el-popconfirm
               v-if="popconfirm"
               :title="`确定要${label}吗?`"
-              @onConfirm="handleClick(props, scope.row)"
+              @confirm="handleClick(props, scope.row)"
               @cancel="handleCancel"
             >
               <el-button slot="reference" type="text" size="small">{{

+ 17 - 87
src/pages/main/performance/department.vue

@@ -403,6 +403,10 @@ export default {
           // 0.待处理  1.待汇总 2.待审批  3.已完成
           dictionary: [
             {
+              label: "已撤回",
+              value: "-1",
+            },
+            {
               label: "待处理",
               value: "0",
             },
@@ -474,28 +478,29 @@ export default {
           props: "loginNameStr",
         },
         {
-          label: "接人",
+          label: "接人",
           props: "receiverName",
           type: "click",
+          control: "viewFlag",
         },
         {
           label: "状态",
           props: "status",
           type: "dictionary",
-          dictionary: { 0: "待处理", 1: "待汇总", 2: "待审批", 3: "已完成" },
+          dictionary: { '-1':'已撤回', 0: "待处理", 1: "待汇总", 2: "待审批", 3: "已完成" },
         },
       ],
     };
   },
-  watch: {
-    duty() {
-      if (this.duty === "9") {
-        this.table_config = this.table_config.filter(
-          (el) => el.props !== "receiverName"
-        );
-      }
-    },
-  },
+  // watch: {
+  //   duty() {
+  //     if (this.duty === "9") {
+  //       this.table_config = this.table_config.filter(
+  //         (el) => el.props !== "receiverName"
+  //       );
+  //     }
+  //   },
+  // },
   mounted() {
     this.handleInit({
       ...this.table_search,
@@ -619,7 +624,7 @@ export default {
           id,
         },
       }).then(() => {
-        this.$message.success("撤回成功");
+        this.$message.success("撤回成功, 请重新创建模版");
         this.handleInit({
           ...this.table_search,
           page: this.page,
@@ -917,21 +922,6 @@ export default {
           }
         });
       }
-      // this.$http({
-      //   url: "/market/CMKIssued/CMKIssuedCheck",
-      //   method: "post",
-      //   headers: {
-      //     "Content-Type": "application/json",
-      //   },
-      //   data: {
-      //     groupId,
-      //   },
-      // }).then((res) => {
-      //   console.log(res, "res");
-      //  this.handleInit()
-      // this.handleCancel("visible");
-      // this.handleCancel("approve_visible");
-      // });
     },
     // 通用方法用于转化全局
     paramsArr(start, end) {
@@ -990,66 +980,6 @@ export default {
           break;
       }
     },
-    // handleBack() {
-    //   const object = {
-    //     ...JSON.parse(sessionStorage.global_data)[0],
-    //     department_status: "待处理",
-    //   };
-    //   sessionStorage.setItem("global_data", JSON.stringify([object]));
-    //   const process_array = JSON.parse(sessionStorage.global_process);
-    //   process_array.push({
-    //     link: "审批驳回",
-    //     creatperson: `ADMIN ${this.$formatDate(new Date(), "YYYY-MM-DD")}`,
-    //     explain: this.approveForm.comments,
-    //   });
-    //   sessionStorage.setItem("global_process", JSON.stringify(process_array));
-
-    //   // this.handleInit();
-    //   // this.$message.success("打回成功");
-    //   // this.handleCancel("visible");
-    //   // this.handleCancel("approve_visible");
-    // },
-    // handleAgree() {
-    //   const object = {
-    //     ...JSON.parse(sessionStorage.global_data)[0],
-    //     department_status: "已完成",
-    //   };
-    //   sessionStorage.setItem("global_data", JSON.stringify([object]));
-    //   const process_array = JSON.parse(sessionStorage.global_process);
-    //   process_array.push({
-    //     link: "审批通过",
-    //     creatperson: `ADMIN ${this.$formatDate(new Date(), "YYYY-MM-DD")}`,
-    //     explain: this.approveForm.comments,
-    //   });
-    //   sessionStorage.setItem("global_process", JSON.stringify(process_array));
-    //   this.handleInit();
-    //   this.$message.success("审批成功");
-    //   this.handleCancel("visible");
-    //   this.handleCancel("approve_visible");
-    // },
-    // handleSubmit() {
-    //   // 提交好了
-    //   let reqdata = {
-    //     id: this.edit_form.id,
-    //     templateContent: "asdad",
-    //   };
-    //   this.$http({
-    //     url: "/CMKIssued/CMKIssuedSubmit",
-    //     method: "post",
-    //     headers: {
-    //       "Content-Type": "application/json",
-    //     },
-    //     data: reqdata,
-    //   }).then(({ data }) => {
-    //     console.log(data, "data");
-    //     if (data) {
-    //       this.$message.success("提交成功");
-    //       this.handleCancel("visible");
-    //     } else {
-    //       this.$message.error("提交失败");
-    //     }
-    //   });
-    // },
   },
 };
 </script>

+ 24 - 3
src/pages/main/performance/mould.vue

@@ -61,7 +61,11 @@
             trigger: 'change',
           }"
         >
-          <el-date-picker v-model="issue_form.endTime" type="datetime" format="yyyy-MM-dd HH:00:00">
+          <el-date-picker
+            v-model="issue_form.endTime"
+            type="datetime"
+            format="yyyy-MM-dd HH:00:00"
+          >
           </el-date-picker>
         </el-form-item>
       </el-form>
@@ -117,7 +121,11 @@ export default {
       template_id: null,
       // issue
       issue_visible: false,
-      issue_form: {},
+      issue_form: {
+        reason: "",
+        precautions: "",
+        endTime: "",
+      },
       issue_id: null,
       // table
       table_loading: false,
@@ -140,6 +148,9 @@ export default {
         {
           label: "下发",
           props: "issue",
+          visible: {
+            issuedFlag: [0],
+          },
         },
         {
           label: "查看",
@@ -223,6 +234,13 @@ export default {
         case "issue":
           this.issue_visible = !this.issue_visible;
           this.issue_id = params ? params.id : null;
+          if (this.issue_visible) {
+            this.issue_form.reason = params.reason ? params.reason : "";
+            this.issue_form.precautions = params.precautions
+              ? params.precautions
+              : "";
+            this.issue_form.endTime = params.endTime ? params.endTime : "";
+          }
           break;
       }
     },
@@ -255,7 +273,10 @@ export default {
             },
             data: {
               ...this.issue_form,
-              endTime: this.$formatDate(this.issue_form.endTime, "YYYY-MM-DD HH:00:00"),
+              endTime: this.$formatDate(
+                this.issue_form.endTime,
+                "YYYY-MM-DD HH:00:00"
+              ),
               templateId: this.issue_id,
             },
           }).then(() => {