Tang %!s(int64=2) %!d(string=hai) anos
pai
achega
cfeb6962b4

+ 3 - 2
src/components/tableList.vue

@@ -1935,8 +1935,9 @@ export default {
     selectAll(value) {
       this.allCheckData = value;
     },
-    select(value) {
-      this.allCheckData = value;
+    select(selection, row) {
+      this.allCheckData = selection;
+      this.$emit("select", selection,row);
     },
     load(tree, treeNode, resolve) {
       this.$emit("load", tree, treeNode, resolve);

+ 2 - 2
src/utils/request.js

@@ -7,9 +7,9 @@ import { paramMate } from "@/utils/common";
 
 axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8";
 // 创建axios实例
-// export const baseURL = process.env.VUE_APP_BASE_API
+export const baseURL = process.env.VUE_APP_BASE_API
 // export const baseURL = 'https://ptapi.gdzzkj.net/'
-export const baseURL = "http://192.168.1.7:7077/";
+// export const baseURL = "http://192.168.1.222:7077/";
 export const BASE_IMG_URL = process.env.VUE_APP_IMG_API;
 const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分

+ 89 - 12
src/views/financed/arap/index.vue

@@ -32,6 +32,7 @@
       :loading="loading"
       :setIndex="setIndex"
       @load="load"
+      @select="selectRow"
     >
       <template slot="customize">
         <el-button v-if="type !== 0" @click="exportSH" type="success">
@@ -308,15 +309,21 @@ export default {
         },
         selectableStatus: true,
         selectableFunc: (row, rowIndex) => {
-          if (
-            row.roleId &&
-            (this.$store.state.user.rolesId.includes(row.roleId) ||
-              this.$store.state.user.rolesId.includes(1)) &&
-            row.checkStatus === 0
-          ) {
-            return true;
+          if (row.oId) {
+            if (
+              row.roleId &&
+              (this.$store.state.user.rolesId.includes(row.roleId) ||
+                this.$store.state.user.rolesId.includes(1)) &&
+              row.checkStatus === 0
+            ) {
+              row.disabled = false;
+              return true;
+            } else {
+              row.disabled = true;
+              return false;
+            }
           } else {
-            return false;
+            return true;
           }
         },
       },
@@ -690,6 +697,7 @@ export default {
       countInfo: {},
       spanData: {},
       maps: new Map(),
+      activeList: [],
     };
   },
   created() {
@@ -697,8 +705,9 @@ export default {
   },
   methods: {
     getRoles(roleId) {
-      if (this.$store.state.user.rolesId?.length > 0 &&
-        this.$store.state.user.rolesId.includes(roleId) ||
+      if (
+        (this.$store.state.user.rolesId?.length > 0 &&
+          this.$store.state.user.rolesId.includes(roleId)) ||
         this.$store.state.user.rolesId.includes(1)
       ) {
         return false;
@@ -752,11 +761,11 @@ export default {
       return a;
     },
     exportSH() {
-      if (this.$refs.tableList.allCheckData.length === 0) {
+      if (this.activeList.length === 0) {
         this.$message.error("请勾选数据");
         return;
       }
-      this.openDialog(this.$refs.tableList.allCheckData, 1);
+      this.openDialog(this.activeList, 1);
     },
     openDialog(data, type) {
       if (type === 1) {
@@ -839,6 +848,8 @@ export default {
                 this.type == 2 ? e.divideSellerMoney : e.brokerage;
             }
           });
+          tree.active = true;
+          tree.children = res.data;
           resolve(res.data);
         })
         .catch(() => {
@@ -857,6 +868,67 @@ export default {
         this.load(tree, treeNode, resolve);
       }
     },
+
+    setChildren(children, type) {
+      // 编辑多个子层级
+      children.map((j) => {
+        this.toggleSelection(j, type);
+        if (j.children) {
+          this.setChildren(j.children, type);
+        }
+      });
+    },
+    // 选中父节点时,子节点一起选中取消
+    async selectRow(selection, row) {
+      if (!row.oId && row.active !== true) {
+        row.active = true;
+        const index = this.tableData.findIndex((e) => e.id == row.id);
+        const box = document.querySelectorAll(".el-table__row--level-0")[index];
+        const btn = box.querySelector(".el-table__expand-icon");
+        btn.onclick = () => {
+          //
+        };
+        const event = new MouseEvent("click", {
+          view: window,
+          bubbles: true,
+          cancelable: true,
+        });
+        btn.dispatchEvent(event);
+      }
+
+      const hasSelect = selection.some((el) => {
+        return row.id === el.id;
+      });
+      if (hasSelect) {
+        if (row.children) {
+          // 解决子组件没有被勾选到
+          this.setChildren(row.children, true);
+        } else {
+          this.toggleSelection(row, true);
+        }
+      } else {
+        if (row.children) {
+          this.setChildren(row.children, false);
+        } else {
+          this.toggleSelection(row, false);
+        }
+      }
+    },
+    toggleSelection(row, select) {
+      const table = this.$refs.tableList.$refs.pagerset;
+      if (row && row.disabled === false) {
+        this.$nextTick(() => {
+          if (select) {
+            if (this.activeList.findIndex((i) => i.id === row.id) === -1) {
+              this.activeList.push(row);
+            }
+          } else {
+            this.activeList = this.activeList.filter((i) => i.id !== row.id);
+          }
+          table.toggleRowSelection(row, select);
+        });
+      }
+    },
     // 切换已付待付
     backStatus({ row, column }) {
       let { payStatus, oId } = row;
@@ -901,6 +973,7 @@ export default {
         };
       }
       this.$nextTick(() => {
+        this.activeList = [];
         this.$refs.tableList.clearMoreActive();
       });
       this.maps.forEach((value, id) => {
@@ -1018,6 +1091,10 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+/deep/ .el-table__header .el-table__cell > .cell > .el-checkbox {
+  //找到表头那一行,然后把里面的复选框隐藏掉
+  display: none;
+}
 .tip4,
 .tip3 {
   white-space: normal;

+ 4 - 0
src/views/financed/components/dislogOrderDetails.vue

@@ -106,6 +106,7 @@
         :orderFrom="orderFrom"
         :ShowStatus="ShowStatus"
         :checkStatus="detailInfo.checkStatus"
+        @parentsSearch="parentsSearch"
       ></student-details>
     </BaseDialog>
   </div>
@@ -259,6 +260,9 @@ export default {
       this.isShow = false;
       this.$emit("search");
     },
+    parentsSearch() {
+      this.$emit("search");
+    },
     success() {
       this.$confirm("确定审核通过吗?", "提示", {
         confirmButtonText: "确定",

+ 1 - 0
src/views/financed/components/studentDetails.vue

@@ -391,6 +391,7 @@ export default {
             .then((res) => {
               this.search("init");
               this.$message.success("操作成功");
+              this.$emit('parentsSearch')
             });
         })
         .catch(() => {});

+ 45 - 21
src/views/financed/orderManageList/index.vue

@@ -11,9 +11,12 @@
       <el-button type="primary" size="small" @click="editCost"
         >成本设置</el-button
       >
-      <el-button type="primary" size="small" @click="completeOrder(false)"
+      <el-button type="primary" size="small" @click="completeOrder(false, 1)"
         >完单确认</el-button
       >
+      <el-button type="primary" size="small" @click="completeOrder(false, 0)"
+        >完单取消</el-button
+      >
       <el-button type="primary" size="small" @click="editRemarks(1)"
         >修改备注</el-button
       >
@@ -189,13 +192,22 @@
           type="text"
           :disabled="
             !(
-              props.scope.row.finishSign === 1 &&
+              // props.scope.row.finishSign === 1 &&
               props.scope.row.finishStatus === 0
             ) || disabledStatus(props.scope.row.commercialTenant)
           "
-          @click="completeOrder(props.scope.row.orderSn)"
+          @click="completeOrder(props.scope.row.orderSn, 1)"
           >完单确认</el-button
         >
+        <el-button
+          type="text"
+          :disabled="
+            props.scope.row.finishStatus !== 1 ||
+            disabledStatus(props.scope.row.commercialTenant)
+          "
+          @click="completeOrder(props.scope.row.orderSn, 0)"
+          >完单取消</el-button
+        >
       </template>
     </table-list>
     <pagination
@@ -691,7 +703,7 @@ export default {
         .map((i) => i.orderSn)
         .toString();
     },
-    completeOrder(orderSn) {
+    completeOrder(orderSn, type) {
       let A = (status) => {
         this.$api
           .systemtoporderfinish({
@@ -705,6 +717,7 @@ export default {
               type: "success",
               message: "操作成功!",
             });
+            this.search(3)
           });
       };
       if (!orderSn && this.$refs.tableList.allCheckData.length === 0) {
@@ -712,27 +725,33 @@ export default {
         return;
       }
       if (
-        !this.$refs.tableList.allCheckData.every(
-          (i) => i.finishSign === 1 && i.finishStatus === 0
-        )
+        this.$refs.tableList.allCheckData.every((i) => {
+          if (type === 1) {
+            return i.finishSign === 1 && i.finishStatus === 0;
+          }
+          if (type === 0) {
+            return i.finishStatus === 1;
+          }
+        })
       ) {
+        this.$confirm(type === 1 ? "确认" : "取消" + "完单状态?", "提示", {
+          confirmButtonText: `${type === 1 ? "确认" : "取消"}完单`,
+          cancelButtonText: "关闭",
+          type: "warning",
+          distinguishCancelAndClose: true,
+        })
+          .then(() => {
+            A(type);
+          })
+          .catch((err) => {
+            // if (err === "cancel") {
+            //   A(0);
+            // }
+          });
+      } else {
         this.$message.error("批量数据存在不允许操作数据,请联系管理员修复");
         return;
       }
-      this.$confirm("确定已完单吗?", "提示", {
-        confirmButtonText: "确定完单",
-        cancelButtonText: "取消完单",
-        type: "warning",
-        distinguishCancelAndClose: true,
-      })
-        .then(() => {
-          A(1);
-        })
-        .catch((err) => {
-          if (err === "cancel") {
-            A(0);
-          }
-        });
     },
     handelClickCost(item) {
       this.dialogVisiblecost = true;
@@ -828,6 +847,11 @@ export default {
           this.$refs.tableList.clearMoreActive();
         });
       }
+      if (v === 3) {
+        this.$nextTick(() => {
+          this.$refs.tableList.clearMoreActive();
+        });
+      }
       var data = JSON.parse(JSON.stringify(this.formData));
       if (data.roleId === 0 || data.roleId === 1) {
         data.refundStatusList = "0,3,4";