daiqisheng %!s(int64=3) %!d(string=hai) anos
pai
achega
d8012f884f

+ 96 - 24
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-21 19:27:55
+ * @LastEditTime: 2022-01-23 19:05:08
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\sheet.vue
 -->
 
@@ -27,11 +27,24 @@
         >
           <el-button type="primary">上传</el-button>
         </el-upload>
-
+        <el-button
+          v-if="!status || status === '2'"
+          type="primary"
+          @click="handleSave('2')"
+          :disabled="handleForbid()"
+          >暂存</el-button
+        >
+        <el-button
+          v-if="status === '2'"
+          type="primary"
+          @click="handleResave"
+          :disabled="handleForbid()"
+          >保存</el-button
+        >
         <el-button
           v-if="addFlag === '0'"
           type="primary"
-          @click="handleSave"
+          @click="handleSave('0')"
           :disabled="handleForbid()"
           ><span>{{ id ? "提交" : "新增" }}</span
           ><span>{{
@@ -220,7 +233,7 @@
                     </div>
                 </el-form-item> -->
       </el-form>
-      <template v-if="id" v-slot:footer><div></div></template>
+      <template v-if="id && status !== '2'" v-slot:footer><div></div></template>
     </simple-dialog>
     <simpleDialog
       title="提交"
@@ -228,16 +241,15 @@
       :modal="false"
       @cancel="handleApprove"
     >
-      <el-form
-        :model="approveForm"
-        label-width="120px"
-        :rules="{
-          required: true,
-          message: '请选择审批意见',
-          trigger: 'change',
-        }"
-      >
-        <el-form-item label="审批意见:">
+      <el-form :model="approveForm" label-width="120px">
+        <el-form-item
+          label="审批意见:"
+          :rules="{
+            required: true,
+            message: '请选择审批意见',
+            trigger: 'change',
+          }"
+        >
           <el-select v-model="approveForm.type">
             <el-option
               v-for="item in approveForm.list"
@@ -294,6 +306,11 @@ export default {
     id: {
       default: null,
     },
+    receiver: {
+      type: String,
+      default: "",
+    },
+    status: { type: String, default: "" },
   },
   data() {
     return {
@@ -371,24 +388,32 @@ export default {
     handleAllow({ row, column }) {
       return (
         (!this.form.permission_type && this.type === "edit") ||
-        (this.row_list.includes(row) && this.column_list.includes(column))
+        (this.row_list.includes(row) && this.column_list.includes(column)) ||
+        (!(this.status === "2" && this.type === "edit"))
       );
     },
     async handleQuery() {
       let url = "";
-      let key = "";
+      let params = {};
       switch (this.attribute) {
         case "template":
           url = "/market/CMKFileTemplate/QueryCMKFileTemplateById";
-          key = "templateId";
+          params = {
+            templateId: this.id,
+          };
           break;
         case "order":
           url = "/market/CMKIssued/CMKQueryIssuedById";
-          key = "id";
+          params = {
+            id: this.id,
+          };
           break;
         case "file":
           url = "/market/CMKIssued/CMKIssuedProcessByUser";
-          key = "id";
+          params = {
+            id: this.id,
+            receiverId: this.receiver,
+          };
           break;
       }
       const {
@@ -406,9 +431,7 @@ export default {
         headers: {
           "Content-Type": "application/json",
         },
-        data: {
-          [key]: this.id,
-        },
+        data: params,
       });
       this.template_id = templateId;
       this.issued_id = issuedId;
@@ -660,7 +683,7 @@ export default {
       });
       this.$message.success("操作成功");
     },
-    async handleSave() {
+    async handleSave(type) {
       let edit_url = "";
       switch (this.attribute) {
         case "template":
@@ -691,6 +714,7 @@ export default {
             templateContent: JSON.stringify(data),
             templateName: workbook_name,
             issuedId: this.issued_id,
+            status: type,
           },
         });
         this.handleAddAuth({ id: body });
@@ -702,6 +726,24 @@ export default {
           this.manager_approve = true;
         } else {
           // 员工提交
+          if (type === "2") {
+            // 暂存
+            await this.$http({
+              url: "/CMKFileTemplate/UptateCMKFileTemplateById", // 新增
+              method: "post",
+              headers: {
+                "Content-Type": "application/json",
+              },
+              data: {
+                id: this.template_id,
+                templateContent: JSON.stringify(data),
+                templateName: workbook_name,
+                status: type,
+              },
+            });
+            this.$emit("save");
+            return;
+          }
           await this.$http({
             url: edit_url, // 新增
             method: "post",
@@ -766,6 +808,15 @@ export default {
       this.visible = !this.visible;
     },
     async handleApprove(type) {
+      if (this.approveForm.type) {
+        if (this.approveForm.type === "3" && !this.approveForm.comments) {
+          this.$message.error("请输入其他审批意见");
+          return;
+        }
+      } else {
+        this.$message.error("请选择审批意见");
+        return;
+      }
       if (type) {
         const sheet_name = window.luckysheet.getSheet().name;
         const data = window.luckysheet.getSheet(sheet_name);
@@ -786,7 +837,9 @@ export default {
         let params = {
           id: this.issued_id,
           reviewOpinion:
-            this.approveForm.type === "3" ? this.approveForm.comments : this.approveForm.type,
+            this.approveForm.type === "3"
+              ? this.approveForm.comments
+              : this.approveForm.type,
         };
         switch (type) {
           case "1":
@@ -853,6 +906,24 @@ export default {
           : "";
       }
     },
+    handleResave() {
+      const sheet_name = window.luckysheet.getSheet().name;
+      const data = window.luckysheet.getSheet(sheet_name);
+      const workbook_name = window.luckysheet.getWorkbookName();
+      this.$http({
+        url: "/market/CMKFileTemplate/QueryCMKFileTemplateById",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        data: {
+          template_id: this.id,
+          templateContent: JSON.stringify(data),
+          templateName: workbook_name,
+          status: "0",
+        },
+      });
+    },
     handleChargeList() {
       this.$http({
         url: "/market/techcentergj/queryLeaderList",
@@ -870,6 +941,7 @@ export default {
     },
   },
   mounted() {
+    console.log(this.status, "s");
     this.handleInit();
     this.handleChargeList();
   },

+ 10 - 5
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-18 14:47:12
+ * @LastEditTime: 2022-01-23 16:54:13
  * @FilePath     : /spfm-market-front/src/pages/main/performance/components/table.vue
 -->
 <template>
@@ -53,11 +53,16 @@
         </div>
         <div v-else-if="type === 'click'">
           <div
-            v-if="control && Number(scope.row[control]) < 1"
-            class="simple-table-click cursor-pointer"
-            @click="handleClick(props, scope.row)"
+            v-if="control && Number(scope.row[control]) < 1 && scope.row[props]"
           >
-            {{ scope.row[props] }}
+            <span
+              v-for="(item, index) in scope.row[props].split(',')"
+              :key="index"
+              class="simple-table-click cursor-pointer"
+              @click="handleClick(props, { ...scope.row,index })"
+            >
+              {{ scope.row[props].split(",")[index] }}
+            </span>
           </div>
           <div
             v-else-if="!control"

+ 67 - 16
src/pages/main/performance/department.vue

@@ -78,6 +78,7 @@
         <simple-sheet
           v-if="visible"
           :id="edit_form.id"
+          :receiver="receiverId"
           :type="
             edit_visible &&
             (((edit_form.status === '1' ||
@@ -105,8 +106,15 @@
       class="approve"
       @cancel="handleCancel('approve_visible')"
     >
-      <el-form :model="approveForm" ref="approveForm"   label-width="120px">
-        <el-form-item label="审批意见:">
+      <el-form :model="approveForm" ref="approveForm" label-width="120px">
+        <el-form-item
+          label="审批意见:"
+          :rules="{
+            required: true,
+            message: '请选择审批意见',
+            trigger: 'change',
+          }"
+        >
           <el-select v-model="approveForm.type">
             <el-option
               v-for="item in approveForm.list"
@@ -258,6 +266,26 @@
         :config="receiver_table_config"
       ></simple-table>
     </simple-dialog>
+    <simple-dialog
+      title="选择科室经理"
+      :visible="menager_visible"
+      @confirm="confirmManger"
+      @cancel="handleCancel('menager_visible')"
+    >
+      <el-form>
+        <el-form-item label="科室经理">
+          <el-select v-model="receiverId">
+            <el-option
+              v-for="(item, index) in receiverList"
+              :key="index"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+    </simple-dialog>
     <!-- <simple-dialog
       title="流程跟踪"
       :visible="track_visible"
@@ -327,7 +355,12 @@ export default {
       track_visible: false,
       // 回复详情
       principal_visible: false,
+      // 查看经理
+      menager_visible: false,
       edit_form: {},
+      // 接收人id
+      receiverId: "",
+      receiverList: [],
       // 回复详情
       receiver_table_list: [],
       receiver_table_config: [
@@ -542,15 +575,11 @@ export default {
       ],
     };
   },
-  // watch: {
-  //   duty() {
-  //     if (this.duty === "9") {
-  //       this.table_config = this.table_config.filter(
-  //         (el) => el.props !== "receiverName"
-  //       );
-  //     }
-  //   },
-  // },
+  watch: {
+    "approveForm.type"() {
+      this.approveForm.comments = "";
+    },
+  },
   mounted() {
     this.handleInit({
       ...this.table_search,
@@ -657,9 +686,19 @@ export default {
     // 查看按钮
     handleCheck(row) {
       console.log(row, "row");
+      this.edit_form = row;
+      this.menager_visible = true;
+      this.receiverList = row.receiverName
+        ? row.receiverId.split(",").map((el, index) => ({
+            label: row.receiverName.split(",")[index],
+            value: el,
+          }))
+        : [];
+    },
+    confirmManger() {
       this.visible = true;
       this.edit_visible = false;
-      this.edit_form = row;
+      this.menager_visible = false;
     },
     // 原下发管理的撤回
     handleDelete({ id }) {
@@ -840,6 +879,15 @@ export default {
       this.transfer_visible = true;
     },
     handleTurn(type) {
+      if (this.approveForm.type) {
+        if (this.approveForm.type === "3" && !this.approveForm.comments) {
+          this.$message.error("请输入其他审批意见");
+          return;
+        }
+      } else {
+        this.$message.error("请选择审批意见");
+        return;
+      }
       // finish 结束 transfer 转派 back //打回 // agree 同意  // transfermanger 转总经理审批
       let request = 0;
       let reqdata = {
@@ -997,18 +1045,17 @@ export default {
       });
       this.handleCancel("visible");
     },
-    handleReceiver({ id }) {
+    handleReceiver({ index, receiverId, id }) {
       // 回复详情
-      console.log(id);
-      this.principal_visible = true;
       this.$http({
         url: "/market/CMKIssued/replyDetails",
         method: "post",
         headers: {
           "Content-Type": "application/json",
         },
-        data: { issuedId: id },
+        data: { issuedId: id, receiverId: receiverId.split(",")[index] },
       }).then(({ data }) => {
+        this.principal_visible = true;
         this.receiver_table_list = data;
       });
     },
@@ -1017,6 +1064,7 @@ export default {
       switch (data) {
         case "visible":
           this.visible = false;
+          this.receiverId = "";
           break;
         case "approve_visible":
           this.approveForm.comments = "";
@@ -1031,6 +1079,9 @@ export default {
         case "principal_visible":
           this.principal_visible = false;
           break;
+        case "menager_visible":
+          this.menager_visible = false;
+          break;
       }
     },
   },

+ 48 - 6
src/pages/main/performance/mould.vue

@@ -14,6 +14,7 @@
         :handle-row="table_handle_row"
         @issue="(params) => handleVisible('issue', params)"
         @detail="(params) => handleVisible('template', params)"
+        @redit="(params) => handleVisible('edit', params)"
         @delete="handleDelete"
       ></simple-table>
       <simple-pagination
@@ -79,7 +80,25 @@
       @cancel="handleVisible('add')"
     >
       <el-form inline :model="form" label-width="100px"> </el-form>
-      <simple-sheet v-if="add_visible" @save="handleSave" type="edit" />
+      <simple-sheet v-if="add_visible" @save="handleSave('add')" type="edit" />
+      <template v-slot:footer><div></div></template>
+    </simple-dialog>
+    <simple-dialog
+      fullscreen
+      title="编辑模板"
+      :visible="edit_visible"
+      width="1200px"
+      @confirm="handleVisible('edit')"
+      @cancel="handleVisible('edit')"
+    >
+      <el-form inline :model="form" label-width="100px"> </el-form>
+      <simple-sheet
+        v-if="edit_visible"
+        :id="template_id"
+        @save="handleSave('edit')"
+        :status="status"
+        type="edit"
+      />
       <template v-slot:footer><div></div></template>
     </simple-dialog>
     <simple-dialog
@@ -115,7 +134,9 @@ export default {
       rows: 10,
       total: 0,
       form: {},
+      status: "",
       add_visible: false,
+      edit_visible: false,
       // template
       template_visible: false,
       template_id: null,
@@ -149,7 +170,14 @@ export default {
           label: "下发",
           props: "issue",
           visible: {
-            issuedFlag: [0],
+            status: ["0"],
+          },
+        },
+        {
+          label: "编辑",
+          props: "redit",
+          visible: {
+            status: ["2"],
           },
         },
         {
@@ -184,8 +212,9 @@ export default {
           props: "status",
           type: "dictionary",
           dictionary: {
-            0: "在用",
-            1: "停用",
+            0: "已创建",
+            2: "起草中",
+            3: "已下发",
           },
         },
       ],
@@ -226,6 +255,11 @@ export default {
         case "add":
           this.add_visible = !this.add_visible;
           break;
+        case "edit":
+          this.edit_visible = !this.edit_visible;
+          this.template_id = params ? params.id : null;
+          this.status = params ? params.status : "";
+          break;
         case "template":
           this.template_visible = !this.template_visible;
           // this.template_id = params?.id;
@@ -287,8 +321,16 @@ export default {
         }
       });
     },
-    handleSave() {
-      this.handleVisible("add");
+    handleSave(type) {
+      switch (type) {
+        case "add":
+          this.handleVisible("add");
+          break;
+        case "edit":
+          this.handleVisible("edit");
+          break;
+      }
+
       this.handleInit();
     },
   },