xiaodai2022 vor 2 Jahren
Ursprung
Commit
bc551954a0

+ 1 - 1
src/apis/service/serviceParam/setActionProcess/index.js

@@ -15,6 +15,6 @@ export default {
   // 修改状态
   status: (data, params) => http(api + 'action_process_update', data, 'post', params),
   // 获取全部账户列表getuserall
-  accountall: (data, params) => http(api + 'userall', data, 'post', params)
+  processList: (data, params) => http(api + 'process_get_list', data, 'post', params)
 
 }

+ 44 - 27
src/views/serviceParam/setActionProcess/index.vue

@@ -14,10 +14,10 @@
           :key="'role' + index"
           class="role-list__item"
           :class="{ active: item.id == activeId }"
+          @click="!isBtnDisabled && switchRoleHandle(index)"
         >
-          <!-- @click="!isBtnDisabled && switchRoleHandle(item)" -->
           {{ item.role_name }}
-          <i v-if="isBtnDisabled && item.id == roleActive.id" class="el-icon-loading" />
+          <i v-if="isBtnDisabled && item.id == activeId" class="el-icon-loading" />
         </li>
       </ul>
 
@@ -180,6 +180,11 @@ export default {
         { id: 0, label: "禁用" },
         { id: 1, label: "启用" },
       ],
+      parmValue: {
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        order_type: "",
+      },
       // 表格 - 数据
       tableData: [],
       // 表格 - 参数
@@ -206,12 +211,21 @@ export default {
   methods: {
     // 初始化流程列表
     async initprocessList() {
-      const { code, message } = await asyncRequest.getRole({});
+      const model = {
+        status: "",
+        process_name: "",
+        creater: "",
+        addtime_start: "",
+        addtime_end: "",
+        page: 1,
+        size: 10000,
+      };
+      const { code, data, message } = await asyncRequest.processList(model);
       if (code === 0) {
         const { list } = data ?? [];
-        this.processList = [].concat(list);
+        this.processList = list ?? [];
         if (this.processList.length > 0) {
-          await this.switchRoleHandle(this.processList[0].id);
+          await this.switchRoleHandle(0);
         } else if (code >= 100 && code <= 104) {
           await this.logout();
         } else {
@@ -220,27 +234,28 @@ export default {
       }
     },
     // 切换流程
-    switchRoleHandle(id) {
+    switchRoleHandle(index) {
+      this.activeId = this.processList[index].process_type;
       this.$nextTick(async () => {
-        await this.refreshRoleDetail(id);
-      });
-    },
-    // 刷新流程详情
-    async refreshRoleDetail(roleid) {
-      if (this.isBtnDisabled) return;
-      this.isBtnDisabled = true;
-      const { code, data, message } = await asyncRequest.detail({ roleid });
-      if (code === 0) {
-        const { action_data } = data ?? {};
-        this.action_data = action_data ?? [];
         await this.searchList();
-      } else if (code >= 100 && code <= 104) {
-        await this.logout();
-      } else {
-        this.$message.warning(message);
-      }
-      this.isBtnDisabled = false;
+      });
     },
+    // // 刷新流程详情
+    // async refreshRoleDetail(order_type) {
+    //   if (this.isBtnDisabled) return;
+    //   this.isBtnDisabled = true;
+    //   const { code, data, message } = await asyncRequest.detail({ order_type });
+    //   if (code === 0) {
+    //     const { action_data } = data ?? {};
+    //     this.action_data = action_data ?? [];
+    //     await this.searchList();
+    //   } else if (code >= 100 && code <= 104) {
+    //     await this.logout();
+    //   } else {
+    //     this.$message.warning(message);
+    //   }
+    //   this.isBtnDisabled = false;
+    // },
     // 刷新选择状态
     refreshRoleCheckAllStatus() {
       let list = JSON.parse(JSON.stringify(this.action_data));
@@ -335,15 +350,17 @@ export default {
     // 刷新表格
     async searchList() {
       this.loading = true;
-      const { code, data, message } = await asyncRequest.list({});
+      this.parmValue.order_type = this.activeId;
+      const { code, data, message } = await asyncRequest.list(this.parmValue);
       if (code === 0) {
-        const { child } = data ?? [];
-        this.tableData = child ?? [];
-        // this.refreshRoleCheckAllStatus();
+        const { list, count } = data ?? [];
+        this.tableData = list ?? [];
+        this.pageInfo.total = Number(count);
       } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {
         this.tableData = [];
+        this.pageInfo.total = 0;
       }
       this.loading = false;
     },