Browse Source

Merge branch 'dev_info' into 'test-new'

Dev info

See merge request spfm-group/spfm-market-front!19
韩兵 3 years ago
parent
commit
473689b66a

File diff suppressed because it is too large
+ 1581 - 1020
src/pages/main/demandDevelop/index.vue


+ 176 - 0
src/pages/main/performance/components/deptTreeOnly.vue

@@ -0,0 +1,176 @@
+<template>
+  <div class="treebox" v-loading="loading">
+    <el-tree
+      :highlight-current="true"
+      :check-strictly="true"
+      ref="tree"
+      :data="treeList"
+      node-key="o"
+      :default-checked-keys="defaultListc"
+      :default-expanded-keys="defaultListc"
+      @node-click="handleNodeClick"
+    >
+      <span class="custom-tree-node" slot-scope="{ node }">
+        <em
+          style="display: inline-block; width: 20px"
+          v-if="node.data.haveUserFlag == 'N' && node.data.children.length == 0"
+        ></em>
+        <i
+          class="el-icon-caret-right"
+          v-if="node.data.haveUserFlag == 'Y' && node.data.children.length == 0"
+        ></i>
+        <el-checkbox
+          @change="handleCheckChange(node)"
+          style="margin-right: 10px"
+          v-model="node.checked"
+          v-if="node.data.type == 1"
+        ></el-checkbox>
+        <span>{{ node.label }}</span>
+      </span>
+    </el-tree>
+  </div>
+</template>
+
+<script>
+export default {
+  props: ["defaultList", "type", "closeList", "resetList"],
+  data() {
+    return {
+      treeList: [],
+      opt: [],
+      defaultProps: {
+        children: "children",
+        label: "label",
+      },
+      defaultListc: [],
+      loading: false,
+    };
+  },
+  methods: {
+    getTree() {
+      this.loading = true;
+      this.$http({
+        url: "/sysmgr/csysdept/queryAllList",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        data: {},
+      }).then((res) => {
+        this.treeList = res.data;
+        this.loading = false;
+      });
+      // const info = JSON.parse(sessionStorage.userInfo);
+      // console.log(info, "JSON.parse(sessionStorage.userInfo)");
+      // this.treeList = [
+      //   {
+      //     children: [],
+      //     o: info.groupId,
+      //     label: `${info.groupName}`,
+      //     haveUserFlag: "Y",
+      //     ou: `${info.groupName}`,
+      //   },
+      // ];
+    },
+    handleNodeClick(v) {
+      let s = false;
+      if (v.children && v.children.length == 0) {
+        s = true;
+      }
+      if (v.type) {
+        return;
+      }
+      if (
+        v.children &&
+        v.children.length > 0 &&
+        v.children[v.children.length - 1].type == 1
+      ) {
+        return;
+      }
+      this.loading = true;
+      console.log(v);
+      this.$http({
+        url: "/sysmgr/sysuserinfo/queryList",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        data: {
+          groupId: v.o,
+        },
+      }).then((res) => {
+        v.children = v.children ? v.children : [];
+        res.data.forEach((item) => {
+          v.children.push({
+            id: item.groupId,
+            label: item.loginNameStr,
+            type: 1,
+            displayname: v.displayname,
+            loginNoStr: item.loginNoStr,
+            o: item.id,
+          });
+        });
+        this.loading = false;
+      });
+      for (let i = 0; i < this.$refs.tree.store._getAllNodes().length; i++) {
+        if (s && v.o == this.$refs.tree.store._getAllNodes()[i].data.o) {
+          this.$refs.tree.store._getAllNodes()[i].expanded = true;
+        }
+      }
+    },
+    handleCheckChange() {
+      const nodeList = this.$refs.tree.store.getCheckedNodes();
+      // let opt = {
+      //   loginNameStr: v.data.loginNoStr,
+      //   leaderAuditName: v.data.label,
+      //   displayname: v.data.displayname,
+      //   groupId: v.data.o,
+      // };
+      this.$emit("treeCheck", nodeList);
+      // for (let i = 0; i < this.$refs.tree.store._getAllNodes().length; i++) {
+      //   if (v.data.o == this.$refs.tree.store._getAllNodes()[i].data.o) {
+      //     this.$refs.tree.store._getAllNodes()[i].checked = !this.$refs.tree.store._getAllNodes()[i].checked;
+      //   }
+      //   //  else {
+      //   //   this.$refs.tree.store._getAllNodes()[i].checked = false;
+      //   // }
+      // }
+      // this.$forceUpdate();
+    },
+  },
+  created() {
+    this.getTree();
+    this.defaultListc = this.defaultList;
+  },
+  watch: {
+    type() {
+      console.log("aaa");
+      this.defaultListc = this.defaultList;
+      this.$forceUpdate();
+    },
+    defaultList() {
+      this.$forceUpdate();
+    },
+    closeList() {
+       this.$refs.tree.setCheckedKeys([]);
+      if ([...this.resetList] && [...this.resetList].length > 0) {
+        [...this.resetList].forEach((el) => {
+          this.$nextTick(() => {
+            this.$refs.tree.setChecked(el, true);
+          });
+        });
+      }
+    },
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.el-icon-caret-right {
+  color: #ccc;
+  margin: 0 5px;
+}
+.treebox {
+  border: 1px solid #ddd;
+}
+</style>

+ 56 - 4
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-18 20:44:14
+ * @LastEditTime: 2022-01-21 18:55:09
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\sheet.vue
 -->
 
@@ -223,11 +223,42 @@
       <template v-if="id" v-slot:footer><div></div></template>
     </simple-dialog>
     <simpleDialog
-      title="审批"
+      title="提交"
       :visible="manager_approve"
       :modal="false"
       @cancel="handleApprove"
     >
+      <el-form
+        :model="approveForm"
+        label-width="120px"
+        :rules="{
+          required: true,
+          message: '请选择审批意见',
+          trigger: 'change',
+        }"
+      >
+        <el-form-item label="审批意见:">
+          <el-select v-model="approveForm.type">
+            <el-option
+              v-for="item in approveForm.list"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item
+          v-if="approveForm.type === '3'"
+          label="其它审批意见:"
+          :rules="{
+            required: true,
+            message: '请输入审批意见',
+            trigger: 'blur',
+          }"
+          ><el-input v-model="approveForm.comments"
+        /></el-form-item>
+      </el-form>
       <template v-slot:footer>
         <div>
           <el-button @click.prevent="handleApprove('1')">结束</el-button>
@@ -276,7 +307,6 @@ export default {
             row_end: "",
           },
         ],
-
         array: [],
         type: null,
 
@@ -286,6 +316,24 @@ export default {
         row_start: "",
         row_end: "",
       },
+      approveForm: {
+        type: "",
+        comments: "",
+        list: [
+          {
+            label: "同意",
+            value: "1",
+          },
+          {
+            label: "不同意",
+            value: "2",
+          },
+          {
+            label: "其他",
+            value: "3",
+          },
+        ],
+      },
       // 可提交标志
       addFlag: "0",
       isDisable: true,
@@ -735,7 +783,11 @@ export default {
             issuedId: this.issued_id,
           },
         });
-        let params = { id: this.issued_id };
+        let params = {
+          id: this.issued_id,
+          reviewOpinion:
+            this.approveForm.type === "3" ? this.approveForm.comments : this.approveForm.type,
+        };
         switch (type) {
           case "1":
             params = {

+ 65 - 12
src/pages/main/performance/department.vue

@@ -28,7 +28,7 @@
       title="文件收集"
       :visible="visible"
       :reload="reload"
-      width="1200px"
+      width="1300px"
       @cancel="handleCancel('visible')"
     >
       <template>
@@ -80,7 +80,9 @@
           :id="edit_form.id"
           :type="
             edit_visible &&
-            (((edit_form.status === '1' || edit_form.status === '2') &&
+            (((edit_form.status === '1' ||
+              edit_form.status === '2' ||
+              edit_form.status === '5') &&
               duty === '9') ||
               edit_form.status === '0')
               ? 'edit'
@@ -103,12 +105,27 @@
       class="approve"
       @cancel="handleCancel('approve_visible')"
     >
-      <el-form :model="approveForm" ref="approveForm"
-        ><el-form-item label="审批意见" prop="comments" label-width="80px"
-          ><el-input
-            type="textarea"
-            v-model="approveForm.comments"
-            autosize /></el-form-item
+      <el-form :model="approveForm" ref="approveForm">
+        <el-form-item label="审批意见:">
+          <el-select v-model="approveForm.type">
+            <el-option
+              v-for="item in approveForm.list"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item
+          v-if="approveForm.type === '3'"
+          label="其它审批意见:"
+          :rules="{
+            required: true,
+            message: '请输入审批意见',
+            trigger: 'blur',
+          }"
+          ><el-input v-model="approveForm.comments" /></el-form-item
       ></el-form>
       <template v-slot:footer
         ><div>
@@ -143,7 +160,7 @@
       title="转派"
       :visible="transfer_visible"
       :reload="reload"
-      width="1000px"
+      width="1200px"
       @confirm="transferConfirm"
       @cancel="handleCancel('transfer_visible')"
     >
@@ -382,7 +399,24 @@ export default {
         ],
       },
       // 审批意见
-      approveForm: { comments: "" },
+      approveForm: {
+        type: "",
+        comments: "",
+        list: [
+          {
+            label: "同意",
+            value: "1",
+          },
+          {
+            label: "不同意",
+            value: "2",
+          },
+          {
+            label: "其他",
+            value: "3",
+          },
+        ],
+      },
       trackList: [],
       //   顶部form
       table_form: [
@@ -484,10 +518,26 @@ export default {
           control: "viewFlag",
         },
         {
+          label: "当前处理人",
+          props: "currentReceiverName",
+        },
+        {
+          label: "发起时间",
+          props: "createTime",
+        },
+        {
           label: "状态",
           props: "status",
           type: "dictionary",
-          dictionary: { '-1':'已撤回', 0: "待处理", 1: "待汇总", 2: "待审批", 3: "已完成" },
+          dictionary: {
+            "-1": "已撤回",
+            0: "待处理",
+            1: "待汇总",
+            2: "待审批",
+            3: "已完成",
+            4: "已提交",
+            5: "未提交",
+          },
         },
       ],
     };
@@ -794,7 +844,10 @@ export default {
       let request = 0;
       let reqdata = {
         id: this.edit_form.id,
-        reviewOpinion: this.approveForm.comments,
+        reviewOpinion:
+          this.approveForm.type === "3"
+            ? this.approveForm.comments
+            : this.approveForm.type,
       };
       switch (type) {
         case "finish":