فهرست منبع

Merge branch 'dev_info' into 'master'

Dev info

See merge request spfm-group/spfm-market-front!8
侯利飞 3 سال پیش
والد
کامیت
bd8b0b66eb

+ 27 - 31
src/pages/main/gridDivision/approvalExamination.vue

@@ -164,7 +164,7 @@ export default {
         },
         {
           label: "附件",
-          props: "fileNames",
+          props: "attList",
           type: "file",
         },
         {
@@ -179,7 +179,7 @@ export default {
         {
           label: "不通过",
           props: "back",
-          visible: { sts: [0] },
+          visible: { sts: ["0"] },
         },
         {},
         {},
@@ -195,23 +195,23 @@ export default {
         },
         {
           label: "流程环节",
-          props: "taskName",
+          props: "liuchengName",
         },
         {
           label: "处理人",
-          props: "opName",
+          props: "createId",
         },
         {
           label: "处理工号",
-          props: "opNo",
+          props: "createName",
         },
         {
           label: "处理时间",
-          props: "opTime",
+          props: "createTime",
         },
         {
           label: "审批意见",
-          props: "remark",
+          props: "desc",
           // type: "dictionary",
           // dictionary: { 0: "同意", 1: "不同意" },
         },
@@ -220,12 +220,12 @@ export default {
   },
   watch: {
     parentId() {
-      this.status = this.$route.query.status;
       this.handleInit();
     },
   },
-  created() {
+  mounted() {
     this.parentId = this.$route.query.parentId;
+    this.status = this.$route.query.status;
   },
   methods: {
     // 表格数据初始化
@@ -252,10 +252,10 @@ export default {
           ? data.map((element, index) => ({
               ...element,
               No: index + 1,
-              sts: Number(this.status),
+              sts: this.status + "",
             }))
           : [];
-        this.table_list && this.table_list[0].sts === 0
+        this.table_list && this.table_list[0].sts === "0"
           ? (this.table_handle = [
               {
                 label: "返回",
@@ -280,9 +280,11 @@ export default {
                 props: "track",
               },
             ]);
-        data.forEach((item) => {
-          this.adoptIds.push(item.id.toString());
-        });
+        if (data.length) {
+          data.forEach((item) => {
+            this.adoptIds.push(item.wanggeId.toString());
+          });
+        }
         // console.log(this.table_list,'table_list');
         // console.log(this.adoptIds);
       });
@@ -319,22 +321,20 @@ export default {
     },
     // 查询审批轨迹
     handleQueryTrack() {
-      // let type = this.parentId === null ? "1" : "0";
+      // let reqdata = {
+      //   id: Number(this.parentId),
+      // }
       this.$http({
-        url: "/market/mkWangge/getMkWanggeById",
-        method: "get",
+        url: "/market/mkWanggeLog/selectList",
+        method: "post",
         headers: {
           "Content-Type": "application/json",
         },
-        params: {
-          id: this.parentId,
-          type: 0,
-        },
+        data: this.parentId + "",
       }).then(({ data }) => {
         let body = data.body;
         console.log(body, "body");
-        // this.ids = [body.id.toString()];
-        this.table_list_track = body.bpmTaskList.map((item, index) => ({
+        this.table_list_track = body.map((item, index) => ({
           ...item,
           No: index + 1,
         }));
@@ -351,7 +351,7 @@ export default {
     // 审批不通过
     handleBack(row) {
       // console.log(row);
-      this.ids = row.id.toString();
+      this.ids = row.wanggeId.toString();
       this.handleVisible("opinion");
       this.isAgree = false;
     },
@@ -362,12 +362,8 @@ export default {
         // 批量退回
         reqdata = {
           parentId: this.parentId,
-          mkWanggeList: [
-            {
-              id: this.ids,
-              remark: this.opinion_form.opinion,
-            },
-          ],
+          remark: this.opinion_form.opinion,
+          wanggeId: this.ids,
         };
         console.log(reqdata);
         this.$http({
@@ -403,7 +399,7 @@ export default {
           },
         }).then((res) => {
           console.log(res);
-          this.status = 1;
+          this.status = '1'
           this.handleInit();
         });
       }

+ 123 - 53
src/pages/main/gridDivision/workersList.vue

@@ -57,16 +57,33 @@
           ></el-input>
         </el-form-item>
         <el-form-item label="附件上传" prop="file">
-          <myUpload
+          <!-- <myUpload
             v-if="title === '新建' || title === '发起人处理'"
             @uploadBack="uploadBack"
             :fileInfo="fileInfo"
             :fileList="fileInfo.fileList"
-          ></myUpload>
+          ></myUpload> -->
+          <el-upload
+            v-if="title === '新建' || title === '发起人处理'"
+            class="upload-demo"
+            drag
+            :limit="3"
+            :on-exceed="uploadExceed"
+            :on-remove="uploadRemove"
+            :http-request="uploadBack"
+            action="http://192.168.1.228:9600/spfm"
+            multiple
+            :file-list="file"
+          >
+            <i class="el-icon-upload"></i>
+            <div class="el-upload__text">
+              将文件拖到此处,或<em>点击上传</em>
+            </div>
+          </el-upload>
           <div v-else>
-            <div v-if="fileInfo.fileList.length === 0">暂无附件</div>
+            <div v-if="file.length === 0">暂无附件</div>
             <div
-              v-for="(item, index) in fileInfo.fileList"
+              v-for="(item, index) in file"
               :key="index"
               class="simple-table-click cursor-pointer margin-left-10"
               @click="handleDownload(item)"
@@ -148,7 +165,7 @@
 </template>
 
 <script>
-import myUpload from "../../../components/upload";
+// import myUpload from "../../../components/upload";
 import simpleForm from "../performance/components/form.vue";
 import simpleTable from "../performance/components/table.vue";
 import simpleDialog from "../performance/components/dialog.vue";
@@ -158,7 +175,7 @@ export default {
   components: {
     simpleForm,
     simpleDialog,
-    myUpload,
+    // myUpload,
     simpleTable,
     simplePagination,
   },
@@ -206,6 +223,14 @@ export default {
           },
         ],
       },
+      file: [],
+      file1: "",
+      file2: "",
+      file3: "",
+      // 删除的文件
+      delFile: "",
+      // 暂存删除文件
+      tmpDeleteFile: [],
       // 当前用户标识
       loginNoStr: "",
       fileInfo: {
@@ -324,23 +349,23 @@ export default {
         },
         {
           label: "流程环节",
-          props: "taskName",
+          props: "liuchengName",
         },
         {
           label: "处理人",
-          props: "opName",
+          props: "createId",
         },
         {
           label: "处理工号",
-          props: "opNo",
+          props: "createName",
         },
         {
           label: "处理时间",
-          props: "opTime",
+          props: "createTime",
         },
         {
           label: "审批意见",
-          props: "remark",
+          props: "desc",
           // type: "dictionary",
           // dictionary: { 0: "同意", 1: "不同意" },
         },
@@ -375,15 +400,18 @@ export default {
         this.table_list = data
           ? data.map((element, index) => ({
               ...element,
+              id: element.id + "",
               deal: element.draft === "1" && element.sts === "0" ? "1" : "0",
               isEdit:
-                element.draft === "0" && element.createId === this.loginNoStr
+                element.draft === "0" &&
+                element.createId === this.loginNoStr &&
+                element.parentLevel === "0"
                   ? "1"
                   : "0",
               No: index + 1,
             }))
           : [];
-        console.log(this.table_list);
+        // console.log(this.table_list);
       });
     },
     // 搜索事件
@@ -402,7 +430,7 @@ export default {
           this.title = "新建";
           this.isCheck = false;
           this.add_form = {};
-          this.fileInfo.fileList = [];
+          this.file = [];
           break;
         case "summary":
           this.summary_visible = !this.summary_visible;
@@ -431,26 +459,51 @@ export default {
     },
     handleSelect(val) {
       this.summaryIds = val.map((item) => {
-        return item.id.toString();
+        return item.wanggeId + "";
       });
       // console.log(this.summaryIds);
     },
     //文件返回值
-    uploadBack(v) {
-      const fileName = [];
-      const fileIds = [];
-      v.forEach((element) => {
-        fileName.push(element.fileName);
-        fileIds.push(element.fileCode);
+    uploadBack({ file }) {
+      console.log({}.constructor.name, "obj");
+      console.log(file.constructor.name, "file");
+      // console.log( file instanceof Object,'sasdas');
+      this.file.push(file);
+      console.log(this.file);
+      this.file1 = this.file[0];
+      this.file2 = this.file[1];
+      this.file3 = this.file[2];
+    },
+    // 删除文件
+    uploadRemove(file) {
+      // console.log(file);
+      this.file.forEach((item, index) => {
+        console.log(item, "rsr");
+        if (item.uid === file.uid) {
+          this.file.splice(index, 1);
+          if (item.id) {
+            this.tmpDeleteFile.push(item.id);
+            // this.delFile = this.delFile + item.id + ','
+            this.delFile = this.tmpDeleteFile.join(",");
+          }
+        }
+      });
+      console.log(this.file, this.delFile);
+      this.file1 = this.file[0];
+      this.file2 = this.file[1];
+      this.file3 = this.file[2];
+    },
+    // 超出文件上传限制
+    uploadExceed(file) {
+      this.$message({
+        message: "附件最多可上传3个!",
+        type: "error",
       });
-      console.log(v);
-      this.add_form.fileNames = fileName.join(",");
-      this.add_form.fileIds = fileIds.join(",");
-      // console.log(this.add_form,'this.add_form')
+      console.log(file);
     },
     // 获取模态框信息
     getDialogData(row) {
-      let id = row.id;
+      let id = row.wanggeId;
       let type = row.parentId === null ? "1" : "0";
       this.$http({
         url: "/market/mkWangge/getMkWanggeById",
@@ -464,26 +517,25 @@ export default {
         },
       }).then(({ data: { body } }) => {
         console.log(body, "body");
-        this.ids = [body.id.toString()];
+        this.ids = [body.wanggeId.toString()];
         this.add_form = {
-          id: body.id,
+          id: body.wanggeId,
           proposer: body.proposer,
           telephone: body.telephone,
           wanggeText: body.wanggeText,
           fileNames: body.fileNames,
           fileIds: body.fileIds,
         };
-        this.table_list_approve = body.bpmTaskList
-          ? body.bpmTaskList.map((item, index) => ({
+        this.table_list_approve = body.mkWanggeLogList
+          ? body.mkWanggeLogList.map((item, index) => ({
               ...item,
               No: index + 1,
             }))
           : [];
-        this.fileInfo.fileList = body.fileNames
-          ? body.fileNames.split(",").map((el, index) => ({
-              fileName: el,
-              name: el,
-              fileCode: body.fileIds.split(",")[index],
+        this.file = body.attList
+          ? body.attList.map((item) => ({
+              ...item,
+              name: item.fileName,
             }))
           : [];
       });
@@ -494,7 +546,7 @@ export default {
         this.$router.push({
           path: "/approvalExamination",
           query: {
-            parentId: row.id.toString(),
+            parentId: row.wanggeId.toString(),
             status: row.sts.toString(),
           },
         });
@@ -514,7 +566,7 @@ export default {
         this.$router.push({
           path: "/approvalExamination",
           query: {
-            parentId: row.id.toString(),
+            parentId: row.wanggeId.toString(),
             status: row.sts.toString(),
           },
         });
@@ -540,26 +592,43 @@ export default {
       }
       this.$refs.add_ref.validate((valid) => {
         if (valid) {
-          let reqdata = [
-            {
-              ...this.add_form,
-              procId: "729294602773110788",
-              draft: draft,
-              num: "1",
-            },
-          ];
+          let formData = new FormData();
+          // console.log(this.file1,'adasdsa')
+          let reqdata = {
+            ...this.add_form,
+            procId: "729294602773110788",
+            draft: draft,
+            num: "1",
+            delFileId: this.delFile ? this.delFile : "",
+          };
+          // 这是处理文件的参数
+          this.file.forEach((el, index) => {
+            if (el.constructor.name === "File") {
+              formData.append(`file${index + 1}`, el);
+            }
+          });
+          // 表单的其他参数
+          for (let key in reqdata) {
+            formData.append(key, reqdata[key]);
+          }
+          // this.file1 ? formData.append("file1", this.file1) : "";
+          // this.file2 ? formData.append("file2", this.file2) : "";
+          // this.file3 ? formData.append("file3", this.file3) : "";
+          // this.file ? formData.append("file", this.file) : [] ;
+          // ;
           if (!this.approve_visible) {
             // 编辑/新增
             this.$http({
               url: "/market/mkWangge/saveOrUpdateList",
               method: "post",
               headers: {
-                "Content-Type": "application/json",
+                "Content-Type": "multipart/form-data",
               },
-              data: reqdata,
+              data: formData,
             }).then((res) => {
               console.log(res);
               this.handleInit();
+              this.handleVisible("add");
             });
           } else {
             // 审批
@@ -581,11 +650,12 @@ export default {
             }).then((res) => {
               console.log(res);
               this.handleInit();
+              this.handleVisible("add");
             });
           }
-          this.edit_visible = false;
-          this.add_visible = false;
-          this.fileInfo.fileList = [];
+          // this.edit_visible = false;
+          // this.add_visible = false;
+          this.file = [];
         }
       });
     },
@@ -636,10 +706,10 @@ export default {
       }
     },
     // 附件下载
-    handleDownload({fileCode,fileName}) {
-      console.log(fileCode,fileName);
+    handleDownload({ fileCode, fileName }) {
+      console.log(fileCode, fileName);
       this.$http({
-        url: "/market/compatt/downfile",
+        url: "/bpm/api/download",
         method: "post",
         headers: {
           "Content-Type": "application/json",

+ 120 - 22
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-11 09:07:08
+ * @LastEditTime: 2022-01-14 16:12:41
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\sheet.vue
 -->
 
@@ -222,6 +222,24 @@
       </el-form>
       <template v-if="id" v-slot:footer><div></div></template>
     </simple-dialog>
+    <simpleDialog
+      title="审批"
+      :visible="manager_approve"
+      :modal="false"
+      @cancel="handleApprove"
+    >
+      <template v-slot:footer>
+        <div>
+          <el-button @click.prevent="handleApprove('1')">结束</el-button>
+          <el-button @click.prevent="handleApprove('4')" type="primary"
+            >转副总审批</el-button
+          >
+          <el-button @click.prevent="handleApprove('3')" type="primary"
+            >转总经理审批</el-button
+          >
+        </div>
+      </template>
+    </simpleDialog>
   </div>
 </template>
 
@@ -261,6 +279,7 @@ export default {
 
         array: [],
         type: null,
+
         permission_type: null,
         col_start: "",
         col_end: "",
@@ -268,11 +287,12 @@ export default {
         row_end: "",
       },
       // 可提交标志
-      addFlag: '0',
+      addFlag: "0",
       isDisable: true,
       issued_id: null,
       template_id: null,
       visible: false,
+      manager_approve: false,
       row_list: [],
       column_list: [],
       charge_list: [],
@@ -608,30 +628,48 @@ export default {
       const sheet_name = window.luckysheet.getSheet().name;
       const data = window.luckysheet.getSheet(sheet_name);
       const workbook_name = window.luckysheet.getWorkbookName();
-      const {
-        data: { body },
-      } = await this.$http({
-        url: this.id
-          ? edit_url // 编辑
-          : "/market/CMKFileTemplate/CMKFileTemplateAdd", // 新增
-        method: "post",
-        headers: {
-          "Content-Type": "application/json",
-        },
-        data: {
-          id: this.template_id,
-          templateContent: JSON.stringify(data),
-          templateName: workbook_name,
-          issuedId: this.issued_id,
-        },
-      });
-      // 新增时添加权限
       if (!this.id) {
+        // 新增时添加权限
+        const {
+          data: { body },
+        } = await this.$http({
+          url: "/market/CMKFileTemplate/CMKFileTemplateAdd", // 新增
+          method: "post",
+          headers: {
+            "Content-Type": "application/json",
+          },
+          data: {
+            id: this.template_id,
+            templateContent: JSON.stringify(data),
+            templateName: workbook_name,
+            issuedId: this.issued_id,
+          },
+        });
         this.handleAddAuth({ id: body });
+        this.$emit("save");
       } else {
-        this.$message.success("提交成功");
+        // 职位
+        let duty = JSON.parse(sessionStorage.userInfo).duty;
+        if (duty === "7") {
+          this.manager_approve = true;
+        } else {
+          // 员工提交
+          await this.$http({
+            url: edit_url, // 新增
+            method: "post",
+            headers: {
+              "Content-Type": "application/json",
+            },
+            data: {
+              id: this.template_id,
+              templateContent: JSON.stringify(data),
+              templateName: workbook_name,
+              issuedId: this.issued_id,
+            },
+          });
+          this.$emit("save");
+        }
       }
-      this.$emit("save");
     },
     handleAuth() {
       this.$refs["form"].validate((valid) => {
@@ -679,6 +717,66 @@ export default {
       console.log(this.form, "aada");
       this.visible = !this.visible;
     },
+    async handleApprove(type) {
+      if (type) {
+        const sheet_name = window.luckysheet.getSheet().name;
+        const data = window.luckysheet.getSheet(sheet_name);
+        const workbook_name = window.luckysheet.getWorkbookName();
+        await this.$http({
+          url: "/market/CMKIssued/CMKIssuedSubmit", // 新增
+          method: "post",
+          headers: {
+            "Content-Type": "application/json",
+          },
+          data: {
+            id: this.template_id,
+            templateContent: JSON.stringify(data),
+            templateName: workbook_name,
+            issuedId: this.issued_id,
+          },
+        });
+        let params = { id: this.issued_id };
+        switch (type) {
+          case "1":
+            params = {
+              ...params,
+              operateName: "结束",
+              status: 3,
+            };
+            break;
+          case "4":
+            params = {
+              ...params,
+              operateName: "转副总审批",
+              reviewType: 2,
+            };
+            break;
+          case "3":
+            params = {
+              ...params,
+              operateName: "转总经理审批",
+              reviewType: 3,
+            };
+            break;
+        }
+        await this.$http({
+          url: "/market/CMKIssued/CMKIssuedCheck", // 新增
+          method: "post",
+          headers: {
+            "Content-Type": "application/json",
+          },
+          data: params,
+        });
+        this.$message({
+          type: "success",
+          message: "审批成功",
+        });
+        this.manager_approve = false;
+        this.$emit("save");
+      } else {
+        this.manager_approve = false;
+      }
+    },
     handleFullscreen() {
       const element = document.body;
       const is_fullscreen =

+ 6 - 6
src/pages/main/performance/components/table.vue

@@ -63,17 +63,17 @@
           {{ dictionary[scope.row[props]] }}
         </div>
         <div v-else-if="type === 'file'">
-          <div v-if="scope.row[props] && scope.row[props].length" class="flex-justify-center">
-            <span
-              v-for="(item, index) in scope.row[props].split(',')"
+          <div v-if="scope.row[props] && scope.row[props].length">
+            <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"
             >
-              {{ item }}
-            </span>
+              {{ fileName }}
+            </div>
           </div>
-          <div v-else>{{ scope.row[props] }}</div>
+          <div v-else></div>
         </div>
         <div v-else>{{ scope.row[props] }}</div>
       </template>

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

@@ -41,7 +41,7 @@
                 type="primary"
                 v-if="
                   edit_form.status === '0' &&
-                  (duty === '7' || duty === '2' || duty === '1')
+                  (duty === '7' || duty === '3' || duty === '4')
                 "
                 @click="handleTransfer"
                 >转派</el-button
@@ -58,7 +58,7 @@
                 type="primary"
                 v-if="
                   edit_form.status === '2' &&
-                  (duty === '7' || duty === '2' || duty === '1') &&
+                  (duty === '7' || duty === '3' || duty === '4') &&
                   reviewType === duty
                 "
                 @click="handleApprove"
@@ -487,12 +487,14 @@ export default {
       ],
     };
   },
-  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({
@@ -502,7 +504,7 @@ export default {
     });
     // 职位
     this.duty = JSON.parse(sessionStorage.userInfo).duty;
-    // 根据职位判定  科室经理7、分管副总 2 、总经理 1 、职员 9
+    // 根据职位判定  科室经理7、分管副总 4 、总经理 3 、职员 9
     console.log(this.duty, "duty");
     switch (this.duty) {
       // 科室经理
@@ -510,11 +512,11 @@ export default {
         this.type = "1";
         break;
       // 分管副总
-      case "2":
+      case "4":
         this.type = "2";
         break;
       // 总经理
-      case "1":
+      case "3":
         this.type = "3";
         break;
     }
@@ -586,10 +588,10 @@ export default {
             this.reviewType = "7";
             break;
           case "2":
-            this.reviewType = "2";
+            this.reviewType = "4";
             break;
           case "3":
-            this.reviewType = "1";
+            this.reviewType = "3";
             break;
         }
         // if (reviewType) {
@@ -802,7 +804,7 @@ export default {
             reqdata.reviewType = 2;
             reqdata.operateName = "转副总审批";
             request = 1;
-          } else if (this.duty === "2") {
+          } else if (this.duty === "4") {
             reqdata.reviewType = 3;
             request = 1;
             reqdata.operateName = "转总经理审批";
@@ -823,9 +825,9 @@ export default {
         case "return":
           reqdata.status = "0";
           reqdata.operateName = "退回";
-          if (this.duty === "2") {
+          if (this.duty === "4") {
             reqdata.reviewType = 1;
-          } else if (this.duty === "1") {
+          } else if (this.duty === "3") {
             reqdata.reviewType = 2;
           }
           console.log(reqdata, "reqdata");

+ 2 - 2
src/router/index.js

@@ -1695,8 +1695,8 @@ router.beforeEach((to, from, next) => {
     } else {
         // if (window.location.href.indexOf('?agileauthtoken=') == -1) {
         if (window.sessionStorage.agileauthtoken == undefined) {
-            window.location.href = "http://10.230.26.15:8000/spfm/sysmgr/ssLogin?sysFlag=0";
-            // next()
+            // window.location.href = "http://10.230.26.15:8000/spfm/sysmgr/ssLogin?sysFlag=0";
+            next()
             //window.location.href = "http://cas.hl.cmcc/cas/login?service=?service=http%3A%2F%2F10.230.26.15%3A8000%2Fspfm%2Fsysmgr%2FssLogin%3FsysFlag%3D0"
         } else {
             next()