Procházet zdrojové kódy

转执行 转质保 转运营 初稿

XuZinan před 2 roky
rodič
revize
8420861729
5 změnil soubory, kde provedl 95 přidání a 7 odebrání
  1. 2 2
      manifest.json
  2. 50 3
      pages/Project/detail.vue
  3. 9 2
      pages/Project/list.vue
  4. 4 0
      services/project.js
  5. 30 0
      store/index.js

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "workload",
     "appid" : "__UNI__2F0D80E",
     "description" : "",
-    "versionName" : "2.0.4",
-    "versionCode" : 204,
+    "versionName" : "2.0.5",
+    "versionCode" : 205,
     "transformPx" : false,
     "app-plus" : {
         /* 5+App特有相关 */

+ 50 - 3
pages/Project/detail.vue

@@ -131,6 +131,37 @@
         审核通过
       </button>
     </view>
+
+    <uni-popup ref="exePopup" type="dialog">
+      <uni-popup-dialog title="转执行" type="info">
+        <uni-data-picker
+          class="depSelect"
+          placeholder="请选择执行经理"
+          :localdata="depUserTree"
+          @change="changeManager"
+        />
+      </uni-popup-dialog>
+    </uni-popup>
+    <uni-popup ref="wtyPopup" type="dialog">
+      <uni-popup-dialog title="转质保" type="info" @confirm="submitWarranty">
+        <uni-data-picker
+          class="depSelect"
+          placeholder="请选择质保经理"
+          :localdata="depUserTree"
+          @change="changeManager"
+        />
+      </uni-popup-dialog>
+    </uni-popup>
+    <uni-popup ref="optPopup" type="dialog">
+      <uni-popup-dialog title="转运营" type="info" @confirm="submitOperate">
+        <uni-data-picker
+          class="depSelect"
+          placeholder="请选择运营经理"
+          :localdata="depUserTree"
+          @change="changeManager"
+        />
+      </uni-popup-dialog>
+    </uni-popup>
   </view>
 </template>
 
@@ -151,10 +182,11 @@ export default {
       flowList: [],
       depRole: [],
       user: {},
+      manager: "",
     };
   },
   computed: {
-    ...mapState(["currentProject"]),
+    ...mapState(["currentProject", "depUserTree"]),
     nodeList() {
       if (!this.flowList) return [];
       let flowInfo = this.flowList.find(
@@ -237,7 +269,6 @@ export default {
             }
           },
         });
-        // } else console.log("审核拒绝");
       } else {
         uni.showModal({
           title: "是否确认拒绝",
@@ -382,7 +413,6 @@ export default {
               flow_id: this.currentProject.flow_id,
               node_id: this.currentProject.node_id,
             };
-            console.log(payload);
             await submitAudit(payload);
             uni.showToast({
               title: "提审成功",
@@ -402,13 +432,26 @@ export default {
         url: "./member",
       });
     },
+    changeManager(e) {
+      this.manager = e.detail.value[e.detail.value.length - 1].value;
+      console.log(this.manager);
+    },
     onExecute() {
+      this.$refs.exePopup.open();
       return;
     },
     onWarranty() {
+      this.$refs.wtyPopup.open();
+      return;
+    },
+    submitWarranty(value) {
       return;
     },
     onOperate() {
+      this.$refs.optPopup.open();
+      return;
+    },
+    submitOperate(value) {
       return;
     },
   },
@@ -483,4 +526,8 @@ export default {
     margin: inherit;
   }
 }
+
+.depSelect {
+  width: 200px;
+}
 </style>

+ 9 - 2
pages/Project/list.vue

@@ -79,7 +79,7 @@ const statusList = [
 export default {
   mixins: [mixin],
   computed: {
-    ...mapState(["currentProject"]),
+    ...mapState(["currentProject", "depUserTree"]),
   },
   data() {
     return {
@@ -94,10 +94,16 @@ export default {
       self: [{ text: "只看自己", value: 0 }],
     };
   },
+  onLoad() {
+    this.init();
+  },
   onShow() {
     this.initData();
   },
   methods: {
+    async init() {
+      await this.$store.dispatch("getDep");
+    },
     async getProject(params) {
       let res = {};
       res = await queryProject(params);
@@ -129,7 +135,8 @@ export default {
       this.projectFilter.project_status = item.value;
     },
     async search() {
-      this.projectFilter.project_code = this.projectFilter.project_code.toUpperCase();
+      this.projectFilter.project_code =
+        this.projectFilter.project_code.toUpperCase();
       this.pagination.currentPage = 1;
       await this.initData();
       this.$refs.searchDrawer.closeDrawer();

+ 4 - 0
services/project.js

@@ -54,3 +54,7 @@ export async function createApproval(data) {
 export async function updateApproval(data) {
   return request(`v2/approval/record`, "PUT", data);
 }
+
+export async function queryDep(data) {
+  return request(`v2/dep`, "GET", data);
+}

+ 30 - 0
store/index.js

@@ -1,6 +1,7 @@
 import Vue from "vue";
 import Vuex from "vuex";
 import { queryAllWorkType } from "@/services/workload";
+import { queryDep } from "@/services/project";
 
 Vue.use(Vuex);
 const store = new Vuex.Store({
@@ -8,6 +9,7 @@ const store = new Vuex.Store({
     typeList: [],
     allType: {},
     currentProject: {},
+    depUserTree: [],
   },
   mutations: {
     setType(state, values) {
@@ -17,12 +19,40 @@ const store = new Vuex.Store({
     setCurrentProject(state, project) {
       state.currentProject = project;
     },
+    setDep(state, dep) {
+      const getDepUserTree = (data) => {
+        let ret = {};
+        ret.text = data.Name;
+        ret.value = `${data.ID}-0`;
+        if (data.children) {
+          if (!ret.children) ret.children = [];
+          data.children.forEach((item) => {
+            ret.children.push(getDepUserTree(item));
+          });
+        }
+        if (data.Users && data.Users.length !== 0) {
+          if (!ret.children) ret.children = [];
+          data.Users.forEach((item) => {
+            let user = {};
+            user.text = item.CName;
+            user.value = `${data.ID}-${item.ID}`;
+            ret.children.push(user);
+          });
+        }
+        return ret;
+      };
+      state.depUserTree = dep.data.list.map((item) => getDepUserTree(item));
+    },
   },
   actions: {
     getType: async function ({ commit, state }, value) {
       if (state.typeList.length > 0) return;
       commit("setType", await queryAllWorkType());
     },
+    getDep: async function ({ commit, state }, value) {
+      if (state.depUserTree.length > 0) return;
+      commit("setDep", await queryDep());
+    },
   },
 });
 export default store;