daiqisheng vor 3 Jahren
Ursprung
Commit
9d7cd2c465

+ 20 - 23
src/pages/main/gridDivision/approvalExamination.vue

@@ -91,7 +91,7 @@ export default {
       opinion_visible: false,
       track_visible: false,
       opinion_form: {},
-      status: "",
+      status:'',
       isAgree: false,
       // 单条审批id
       ids: "",
@@ -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: "createTimeStr",
         },
         {
           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: "返回",
@@ -319,22 +319,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,
         }));
@@ -403,15 +401,14 @@ export default {
           },
         }).then((res) => {
           console.log(res);
-          this.status = 1;
           this.handleInit();
         });
       }
 
       this.handleVisible("opinion");
     },
-    handleReturn() {
-      this.$router.go(-1);
+    handleReturn(){
+      this.$router.go(-1)
     },
     // 审批轨迹--确定关闭模态框
     handleConsent() {

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

@@ -57,12 +57,27 @@
           ></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"
+            :http-request="uploadBack"
+            action="http://192.168.1.228:9600/spfm"
+            multiple
+            :file-list="fileInfo.fileList"
+          >
+            <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
@@ -148,7 +163,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 +173,7 @@ export default {
   components: {
     simpleForm,
     simpleDialog,
-    myUpload,
+    // myUpload,
     simpleTable,
     simplePagination,
   },
@@ -206,6 +221,10 @@ export default {
           },
         ],
       },
+      file:[],
+      file1: '',
+      file2:'',
+      file3:'',
       // 当前用户标识
       loginNoStr: "",
       fileInfo: {
@@ -324,23 +343,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 +394,16 @@ 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 === '1'
                   ? "1"
                   : "0",
               No: index + 1,
             }))
           : [];
-        console.log(this.table_list);
+        // console.log(this.table_list);
       });
     },
     // 搜索事件
@@ -431,26 +451,48 @@ 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);
-      });
-      console.log(v);
-      this.add_form.fileNames = fileName.join(",");
-      this.add_form.fileIds = fileIds.join(",");
+    uploadBack({ file }) {
+      // const fileName = [];
+      // const fileIds = [];
+      // v.forEach((element) => {
+      //   fileName.push(element.fileName);
+      //   fileIds.push(element.fileCode);
+      // });
+      // 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,'file');
+      // let params = new FormData();
+      // params.append('file',file)
+      // console.log(file);
+      this.file.push(file);
+      console.log(this.file);
+      this.file1 = this.file[0]
+      this.file2 = this.file[1]
+      this.file3 = this.file[2]
+      // this.$http({
+      //   url: "/market/mkWangge/upload",
+      //   method: "post",
+      //   headers: {
+      //     "Content-Type": "application/json",
+      //   },
+      //   data:file
+      // }).then((res)=>{
+      //   console.log(res);
+      // })
+      // let params = new FormData()
+      // params.append('file',file)
+      // console.log(params,'params');
     },
     // 获取模态框信息
     getDialogData(row) {
-      let id = row.id;
+      let id = row.wanggeId;
       let type = row.parentId === null ? "1" : "0";
       this.$http({
         url: "/market/mkWangge/getMkWanggeById",
@@ -473,17 +515,15 @@ export default {
           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.fileInfo.fileList = body.attList
+          ? body.attList.map((item) => ({
+              ...item,
             }))
           : [];
       });
@@ -494,7 +534,7 @@ export default {
         this.$router.push({
           path: "/approvalExamination",
           query: {
-            parentId: row.id.toString(),
+            parentId: row.wanggeId.toString(),
             status: row.sts.toString(),
           },
         });
@@ -514,7 +554,7 @@ export default {
         this.$router.push({
           path: "/approvalExamination",
           query: {
-            parentId: row.id.toString(),
+            parentId: row.wanggeId.toString(),
             status: row.sts.toString(),
           },
         });
@@ -540,23 +580,33 @@ 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();
+          // this.file ? formData.append("file", this.file) : [] ;
+          this.file1 ? formData.append('file1',this.file1) : ''
+          this.file2 ? formData.append('file2',this.file2) : ''
+          this.file3 ? formData.append('file3',this.file3) : ''
+
+          let reqdata = {
+            ...this.add_form,
+            procId: "729294602773110788",
+            draft: draft,
+            num: "1",
+          };
+          for(let key in reqdata) {
+            formData.append(key,reqdata[key])
+          }
+          
+          console.log(formData);
+
           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();
@@ -636,8 +686,8 @@ export default {
       }
     },
     // 附件下载
-    handleDownload({fileCode,fileName}) {
-      console.log(fileCode,fileName);
+    handleDownload({ fileCode, fileName }) {
+      console.log(fileCode, fileName);
       this.$http({
         url: "/market/compatt/downfile",
         method: "post",

+ 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 =

+ 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()