谢杰标 2 tahun lalu
induk
melakukan
af2d502a45

+ 19 - 0
src/views/financed/accountsPayable/businessCommission/index.vue

@@ -0,0 +1,19 @@
+<template>
+  <div>123</div>
+</template>
+
+<script>
+export default {
+  name: "SaasMasterPlatformIndex",
+
+  data() {
+    return {};
+  },
+
+  mounted() {},
+
+  methods: {},
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 19 - 0
src/views/financed/accountsPayable/commissionSettlement/index.vue

@@ -0,0 +1,19 @@
+<template>
+  <div>123</div>
+</template>
+
+<script>
+export default {
+  name: "SaasMasterPlatformIndex",
+
+  data() {
+    return {};
+  },
+
+  mounted() {},
+
+  methods: {},
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 78 - 0
src/views/financed/accountsPayable/components/arapRemarks.vue

@@ -0,0 +1,78 @@
+<template>
+  <div>
+    <BaseDialog
+      width="600px"
+      :isShow.sync="isShow"
+      title="修改备注"
+      @submit="submitForm"
+    >
+      <el-input
+        :rows="6"
+        type="textarea"
+        placeholder="请输入备注"
+        v-model="value"
+      ></el-input>
+    </BaseDialog>
+  </div>
+</template>
+
+<script>
+import { updateRemark, updateMonthRemark } from "@/api/financed/index";
+export default {
+  name: "remarks",
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false,
+    },
+    info: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+  },
+  data() {
+    return {
+      value: "",
+    };
+  },
+
+  mounted() {},
+
+  methods: {
+    init() {
+      this.value = this.info.remark;
+    },
+    submitForm() {
+      let { orderSn, id } = this.info;
+      let fn = orderSn ? updateRemark : updateMonthRemark;
+      fn({
+        orderSn: orderSn,
+        remark: this.value,
+        id: id,
+      }).then((res) => {
+        this.$message.success("修改备注成功");
+        this.isShow = false;
+        this.info.remark = this.value;
+        // this.$emit("search");
+      });
+    },
+  },
+  computed: {
+    isShow: {
+      get() {
+        if (this.dialogVisible) {
+          this.init();
+        }
+        return this.dialogVisible;
+      },
+      set(val) {
+        this.$emit("update:dialogVisible", false);
+      },
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 195 - 0
src/views/financed/accountsPayable/components/dislogBadBill.vue

@@ -0,0 +1,195 @@
+<template>
+  <div>
+    <BaseDialog
+      width="700px"
+      :isShow.sync="isShow"
+      title="坏账设置"
+      @submit="submitForm"
+      @close="close"
+    >
+      <el-form
+        inline
+        hide-required-asterisk
+        :model="form"
+        :rules="rules"
+        ref="form"
+      >
+        <div v-for="(item, index) in form.data" :key="index">
+          <el-form-item
+            label="账龄:"
+            :prop="'data.' + index + '.yearType'"
+            :rules="rules['yearType']"
+          >
+            <el-select v-model="item.yearType" placeholder="请选择账龄">
+              <el-option
+                v-for="(item, idx) in typeList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+                :disabled="disabled(idx, item.value)"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item
+            label="扣押比例:"
+            class="range"
+            label-width="90px"
+            :rules="rules['detainRate']"
+            :prop="'data.' + index + '.detainRate'"
+          >
+            <el-input
+              v-model="item.detainRate"
+              v-int="{ max: 100 }"
+              placeholder="请输入扣押比例"
+            >
+              <template slot="append"> % </template>
+            </el-input>
+          </el-form-item>
+          <el-form-item label-width="0" label=" ">
+            <div class="btns">
+              <i
+                @click="add(index)"
+                v-if="!yearType.includes(1) && form.data.length < 5"
+                class="el-icon-circle-plus-outline"
+              ></i>
+              <i
+                v-if="index != 0"
+                @click="del(index)"
+                class="el-icon-remove-outline"
+              ></i>
+            </div>
+          </el-form-item>
+        </div>
+      </el-form>
+    </BaseDialog>
+  </div>
+</template>
+
+<script>
+import { setBadBill, badBillDetail } from "@/api/financed/index";
+export default {
+  name: "badBill",
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false,
+    },
+  },
+  data() {
+    return {
+      form: { data: [] },
+      rules: {
+        detainRate: [
+          { required: true, message: "请输入扣押比例", trigger: "blur" },
+        ],
+        yearType: [
+          { required: true, message: "请选择账龄", trigger: "change" },
+        ],
+      },
+      typeList: [
+        { label: "1年以上", value: 1 },
+        { label: "1-2年", value: 2 },
+        { label: "2-3年", value: 3 },
+        { label: "3-4年", value: 4 },
+        { label: "4-5年", value: 5 },
+        { label: "5年以上", value: 6 },
+      ],
+    };
+  },
+
+  mounted() {},
+
+  methods: {
+    init() {
+      this.resetForm();
+      this.badBillDetail();
+    },
+    resetForm() {
+      this.form = {
+        data: [
+          {
+            detainRate: undefined,
+            yearType: undefined,
+          },
+        ],
+      };
+    },
+    badBillDetail() {
+      badBillDetail().then((res) => {
+        if (res.data) {
+          this.form.data = JSON.parse(res.data);
+        }
+      });
+    },
+    submitForm() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          setBadBill(this.form.data).then((res) => {
+            this.$message.success("坏账设置成功");
+            this.isShow = false;
+          });
+        } else {
+          return false;
+        }
+      });
+    },
+    close() {
+      this.$nextTick(() => {
+        this.$refs["form"].resetFields();
+      });
+    },
+    disabled(idx, value) {
+      if (this.form.data.length <= 1) {
+        return false;
+      }
+      return this.yearType.some((e) => (idx == 0 ? e != 1 : e == value));
+    },
+    add(index) {
+      this.form.data.splice(index + 1, 0, {
+        detainRate: undefined,
+        yearType: undefined,
+      });
+    },
+    del(index) {
+      this.form.data.splice(index, 1);
+    },
+  },
+  computed: {
+    isShow: {
+      get() {
+        if (this.dialogVisible) {
+          this.init();
+        }
+        return this.dialogVisible;
+      },
+      set(val) {
+        this.$emit("update:dialogVisible", false);
+      },
+    },
+    yearType() {
+      console.log(this.form.data);
+      return this.form.data.map((e) => e.yearType).filter((e) => e);
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+/deep/ .range {
+  .el-form-item__content {
+    width: 200px;
+  }
+}
+.btns {
+  margin-left: -10px;
+  height: 36px;
+  display: flex;
+  align-items: center;
+  i {
+    font-size: 24px;
+    cursor: pointer;
+    margin-left: 5px;
+  }
+}
+</style>

+ 201 - 0
src/views/financed/accountsPayable/components/dislogTip.vue

@@ -0,0 +1,201 @@
+<template>
+  <div class="dislogTipBox">
+    <BaseDialog
+      width="900px"
+      :isShow.sync="isShow"
+      title="催款提醒"
+      @close="close"
+      @submit="submitForm"
+      @open="init"
+    >
+      <el-form
+        inline
+        hide-required-asterisk
+        :model="form"
+        :rules="rules"
+        ref="form"
+        label-width="100px"
+      >
+        <div>
+          <el-form-item label="最新提醒:">
+            {{ $methodsTools.onlyForma(orderInfo.lastTime) || "--" }}
+          </el-form-item>
+        </div>
+
+        <div>
+          <el-form-item prop="noteType" label="提醒设置:">
+            <el-select v-model="form.noteType" placeholder="请选择提醒类型">
+              <el-option
+                label="取消提醒"
+                v-if="orderInfo.noteId"
+                :value="0"
+              ></el-option>
+              <el-option label="立即提醒" :value="1"></el-option>
+              <el-option label="每天提醒" :value="2"></el-option>
+              <el-option label="每周提醒" :value="3"></el-option>
+              <el-option label="每月提醒" :value="4"></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="weekTime" label="" v-if="form.noteType == 3">
+            <el-select
+              v-model="form.weekTime"
+              multiple
+              placeholder="请选择星期"
+              key="3"
+            >
+              <el-option
+                v-for="week in weekList"
+                :key="week.value"
+                :label="week.label"
+                :value="week.value"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="monthTime" label="" v-if="form.noteType == 4">
+            <el-select
+              v-model="form.monthTime"
+              multiple
+              placeholder="请选择日期"
+              key="4"
+            >
+              <el-option
+                v-for="day in 31"
+                :key="day"
+                :label="day"
+                :value="day"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="dayTime" label="" v-if="form.noteType > 1"
+            ><el-time-picker
+              format="HH:mm"
+              value-format="HH:mm"
+              v-model="form.dayTime"
+              placeholder="选择时间"
+            >
+            </el-time-picker>
+          </el-form-item>
+        </div>
+      </el-form>
+    </BaseDialog>
+  </div>
+</template>
+
+<script>
+import { orderNote, orderNoteEdit } from "@/api/financed/index";
+export default {
+  name: "DislogTip",
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false,
+    },
+    orderInfo: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+  },
+  data() {
+    return {
+      form: {},
+      rules: {
+        dayTime: [{ required: true, message: "请选择时间", trigger: "change" }],
+        weekTime: [
+          { required: true, message: "请选择星期", trigger: "change" },
+        ],
+        monthTime: [{ required: true, message: "请选择日期", trigger: "blur" }],
+      },
+      weekList: [
+        { label: "星期一", value: "1" },
+        { label: "星期二", value: "2" },
+        { label: "星期三", value: "3" },
+        { label: "星期四", value: "4" },
+        { label: "星期五", value: "5" },
+        { label: "星期六", value: "6" },
+        { label: "星期日", value: "7" },
+      ],
+      dayList: [],
+      value: [],
+    };
+  },
+
+  mounted() {},
+
+  methods: {
+    init() {
+      this.resetForm();
+    },
+    close() {
+      this.$refs["form"].resetFields();
+    },
+    submit() {},
+    resetForm() {
+      let {
+        noteId,
+        orderSn,
+        tenantId,
+        dayTime,
+        weekTime,
+        monthTime,
+        noteType,
+      } = this.orderInfo;
+      this.form = {
+        noteType: noteType || 1,
+        id: noteId,
+        dayTime: dayTime,
+        weekTime: weekTime ? weekTime.split(",") : [],
+        monthTime: monthTime ? monthTime.split(",") : [],
+        orderSn: orderSn,
+        tenantId: tenantId,
+      };
+    },
+    submitForm() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          let form = JSON.parse(JSON.stringify(this.form));
+          let { noteType, weekTime, monthTime } = form;
+          delete form.weekTime;
+          delete form.monthTime;
+          if (noteType == 3) {
+            form.weekTime = weekTime.toString();
+          }
+          if (noteType == 4) {
+            form.monthTime = monthTime.toString();
+          }
+          if (noteType == 0) {
+            form.status = -1;
+            form.noteType = undefined;
+          }
+          if (form.id) {
+            orderNoteEdit(form).then((res) => {
+              this.$message.success("催款提醒修改成功");
+              this.isShow = false;
+              this.$emit("search");
+            });
+          } else {
+            orderNote(form).then((res) => {
+              this.$message.success("催款提醒设置成功");
+              this.isShow = false;
+              this.$emit("search");
+            });
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+  },
+  computed: {
+    isShow: {
+      get() {
+        return this.dialogVisible;
+      },
+      set(val) {
+        this.$emit("update:dialogVisible", false);
+      },
+    },
+  },
+};
+</script>

+ 1209 - 0
src/views/financed/accountsPayable/institutionDivide/index.vue

@@ -0,0 +1,1209 @@
+<template>
+  <div id="ActivityList">
+    <el-radio-group
+      v-model="type"
+      @change="changeSearch"
+      style="margin-bottom: 10px"
+    >
+      <el-radio-button :label="0">应收账款</el-radio-button>
+      <el-radio-button :label="1">机构分成</el-radio-button>
+      <el-radio-button :label="2">业务员提成</el-radio-button>
+      <el-radio-button :label="3">佣金结算</el-radio-button>
+    </el-radio-group>
+    <search-box-new
+      ref="searchBox"
+      :formData="formData"
+      :formList="formList"
+      @search="search(3)"
+      @init="init"
+    />
+    <picture-list
+      ref="pictureList"
+      :key="type + 'a'"
+      :info="info"
+      :list="showTabList[type]"
+    ></picture-list>
+    <table-list
+      :key="type"
+      rowKey="id"
+      ref="tableList"
+      :tableSets="tableSet"
+      :tableData="tableData"
+      :navText="navText"
+      :loading="loading"
+      @load="load"
+      @select="selectRow"
+    >
+      <template slot="customize">
+        <el-button v-if="type !== 0" @click="exportSH" type="success">
+          批量审核
+        </el-button>
+        <el-button v-if="type == 0" @click="openDialog({}, 4)" type="success">
+          坏账设置
+        </el-button>
+        <el-button @click="batchExport" type="primary"> 导出excel </el-button>
+      </template>
+      <template slot="predictPayTime" slot-scope="props">
+        <span v-if="props.scope.row.creditStatus == 1">已结清</span>
+        <span style="color: red" v-else>
+          {{ $methodsTools.onlyForma(props.scope.row.predictPayTime) || "--" }}
+        </span>
+      </template>
+      <template slot="noteType" slot-scope="props">
+        <div v-if="!props.scope.row.noteId || props.scope.row.noteType == 1">
+          --
+        </div>
+        <div v-else>
+          <div :class="'tip' + props.scope.row.noteType">
+            <span v-for="(text, idx) in backText(props.scope.row)" :key="idx">
+              <span v-if="props.scope.row.noteType == 3">周</span>
+              {{ text }}
+              <span v-if="props.scope.row.noteType == 4">日</span>
+              <i></i>
+            </span>
+          </div>
+          <div>{{ props.scope.row.dayTime }}</div>
+        </div>
+      </template>
+      <template slot="divideCheckStatus" slot-scope="props">
+        <div v-if="props.scope.row.billType != 7">
+          {{
+            divideCheckStatus(
+              props.scope.row.orderSn,
+              props.scope.row.payStatus,
+              props.scope.row.checkStatus
+            )
+          }}
+          <span style="color: #409eff" v-if="props.scope.row.roleName">
+            ({{ props.scope.row.roleName }})
+          </span>
+        </div>
+      </template>
+      <template slot="status" slot-scope="props">
+        {{ backStatus(props.scope) | formatPrice }}
+      </template>
+      <template slot="price" slot-scope="props">
+        <div v-if="props.scope.row.oId">
+          {{
+            $methodsTools.decimalPoint(
+              props.scope.row.orderPrice - props.scope.row.pretaxBrokerage
+            )
+          }}
+        </div>
+        <div v-else>--</div>
+      </template>
+      <template slot="btn" slot-scope="props">
+        <el-button
+          v-if="props.scope.row.oId || type == 0"
+          type="text"
+          @click="openDialog(props.scope.row, 3)"
+        >
+          查看详情
+        </el-button>
+        <el-button
+          v-if="type == 0"
+          type="text"
+          :disabled="props.scope.row.creditStatus == 1"
+          @click="openDialog(props.scope.row, 0)"
+        >
+          催款提醒
+        </el-button>
+        <template v-else>
+          <el-button
+            type="text"
+            v-if="!props.scope.row.orderSn"
+            :disabled="
+              !(
+                props.scope.row.payStatus === 0 ||
+                props.scope.row.payStatus === 4
+              )
+            "
+            @click="openDialog([props.scope.row], 1)"
+          >
+            {{
+              type == 1
+                ? "分成支付"
+                : type == 2
+                ? "提成支付"
+                : type == 3
+                ? "佣金支付"
+                : ""
+            }}
+          </el-button>
+          <el-button
+            v-else
+            type="text"
+            :disabled="
+              props.scope.row.checkStatus !== 0 ||
+              getRoles(props.scope.row.roleId)
+            "
+            @click="openDialog([props.scope.row], 1)"
+          >
+            {{
+              type == 1
+                ? "分成审核"
+                : type == 2
+                ? "提成审核"
+                : type == 3
+                ? "佣金审核"
+                : ""
+            }}
+          </el-button>
+          <el-button
+            type="text"
+            style="color: #e6a23c"
+            @click="openDialog(props.scope.row, 2)"
+          >
+            修改备注
+          </el-button>
+        </template>
+      </template>
+    </table-list>
+    <pagination
+      :total="total"
+      :pageSize.sync="formData.pageSize"
+      :currentPage.sync="formData.pageNum"
+      @search="search(3)"
+    />
+    <dislog-tip
+      :dialogVisible.sync="tipDialogVisible"
+      :orderInfo="activeOrderInfo"
+      @search="search(3)"
+    />
+    <!-- 订单详情 -->
+    <dislog-order-details
+      :orderSn="activeOrderInfo.orderSn"
+      :orderFrom="activeOrderInfo.orderFrom"
+      :dialogVisible.sync="orderDialogVisible"
+    />
+    <arap-remarks
+      :info="activeOrderInfo"
+      @search="search(4)"
+      :dialogVisible.sync="remarkDialogVisible"
+    />
+    <dislog-set
+      :dialogVisible.sync="examineDialogVisible"
+      @search="search"
+      :info="activeOrderInfoArray"
+    ></dislog-set>
+    <!-- 坏账设置 -->
+    <dislog-bad-bill
+      :dialogVisible.sync="badBillDialogVisible"
+    ></dislog-bad-bill>
+  </div>
+</template>
+
+<script>
+// import dislogSet from "../components/audit/dislogSet.vue";
+import searchBoxNew from "@/components/searchBoxNew";
+import tableList from "@/components/tableList";
+import pagination from "@/components/pagination";
+import dislogTip from "../components/dislogTip.vue";
+import dislogOrderDetails from "../../components/dislogOrderDetails.vue";
+import arapRemarks from "../components/arapRemarks.vue";
+import pictureList from "@/components/Comon/pictureList.vue";
+import dislogBadBill from "../components/dislogBadBill.vue";
+import { exportFn } from "@/utils/index.js";
+import {
+  orderList,
+  companyList,
+  orderExport,
+  tenantExport,
+  sellerExport,
+  countOrderNum,
+  commissionList,
+  sellerPercentageList,
+  monthOrderList,
+  commissionExport,
+} from "@/api/financed/index";
+export default {
+  name: "Arap",
+  components: {
+    searchBoxNew,
+    tableList,
+    pagination,
+    dislogTip,
+    dislogOrderDetails,
+    arapRemarks,
+    // dislogSet,
+    pictureList,
+    dislogBadBill,
+  },
+  data() {
+    return {
+      value5: [],
+      info: {},
+      showTabList: [
+        [
+          {
+            label: "未收账款",
+            prop: "orderUncollectedTotal",
+            img: "未收款",
+          },
+        ],
+        [
+          {
+            label: "待付分成",
+            prop: "unPayMoneyTotal",
+            img: "未收款",
+          },
+          {
+            label: "待扣分成",
+            prop: "unDeductMoneyTotal",
+            img: "已退款",
+          },
+          {
+            label: "已扣分成",
+            prop: "deductMoneyTotal",
+            img: "成本金额",
+          },
+          {
+            label: "已付分成",
+            prop: "payMoneyTotal",
+            img: "已收款",
+          },
+        ],
+        [
+          {
+            label: "待付分成",
+            prop: "unPayMoneyTotal",
+            img: "未收款",
+          },
+          {
+            label: "待扣分成",
+            prop: "unDeductMoneyTotal",
+            img: "已退款",
+          },
+          {
+            label: "已扣分成",
+            prop: "deductMoneyTotal",
+            img: "成本金额",
+          },
+          {
+            label: "已付分成",
+            prop: "payMoneyTotal",
+            img: "已收款",
+          },
+        ],
+        [
+          {
+            label: "待付佣金",
+            prop: "unPayMoneyTotal",
+            img: "未收款",
+          },
+          {
+            label: "已付佣金",
+            prop: "payMoneyTotal",
+            img: "已收款",
+          },
+        ],
+      ],
+      loading: false, //当前表单加载是否加载动画
+      navText: {
+        title: "应收应付",
+        index: 0,
+        ch: "条",
+        num: true,
+        choice: true,
+        addHide: true,
+        dontNum: false,
+        openCheckMore: false,
+        changeWidth: "240px",
+        custom: false,
+        tableColor: true,
+        tableColorFunc: ({ row, rowIndex }) => {
+          if (row.oId) {
+            return "child-row";
+          }
+          return "";
+        },
+        selectableStatus: true,
+        selectableFunc: (row, rowIndex) => {
+          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 true;
+          }
+        },
+      },
+      formData: {
+        pageSize: 10,
+        pageNum: 1,
+      },
+      // 表单
+      tableSet0: [
+        {
+          label: "坏账",
+          prop: "badBill",
+          hidden: true,
+          scope: "isOptions",
+          options: [
+            {
+              label: "否",
+              value: false,
+            },
+            {
+              label: "是",
+              value: true,
+              style: {
+                color: "red",
+              },
+            },
+          ],
+        },
+        {
+          label: "下单时间",
+          prop: "buyTime",
+          hidden: true,
+          scope: "aTimeList",
+        },
+        {
+          label: "订单单号",
+          prop: "orderSn",
+          hidden: true,
+        },
+        {
+          label: "机构名称",
+          prop: "tenantName",
+          hidden: true,
+        },
+        {
+          label: "业务员",
+          prop: "createUsername",
+          hidden: true,
+        },
+        {
+          label: "业务号",
+          prop: "createNo",
+          hidden: true,
+        },
+        {
+          label: "合同金额(元)",
+          prop: "orderPrice",
+          hidden: true,
+          scope: "formatPrice",
+        },
+        {
+          label: "已收账款(元)",
+          prop: "orderReceived",
+          hidden: true,
+          scope: "formatPrice",
+        },
+        {
+          label: "已退金额(元)",
+          prop: "orderRefunded",
+          hidden: true,
+          scope: "formatPrice",
+        },
+        {
+          label: "未收账款(元)",
+          prop: "orderUncollected",
+          hidden: true,
+          scope: "formatPrice",
+        },
+        {
+          label: "预收时间",
+          hidden: true,
+          prop: "predictReceiveTime",
+          scope: "aTimeList",
+        },
+        {
+          label: "剩余天数",
+          prop: "predictReceiveDay",
+          hidden: true,
+          scope: "fill",
+        },
+        {
+          label: "提醒设置",
+          prop: "noteType",
+          scope: "solt",
+          soltName: "noteType",
+          hidden: true,
+        },
+        {
+          label: "最新提醒",
+          prop: "lastTime",
+          hidden: true,
+          scope: "aTimeList",
+        },
+      ],
+      tableSet1: [
+        {
+          label: "时间",
+          prop: "monthTime",
+          hidden: true,
+          width: 140,
+        },
+        {
+          label: "订单单号",
+          prop: "orderSn",
+          hidden: true,
+          scope: "fill",
+          width: 200,
+        },
+        {
+          label: "类型",
+          prop: "billType",
+          scope: "type",
+          hidden: true,
+          values: {
+            1: "月份",
+            2: "季度",
+            3: "半年",
+            4: "年度",
+            6: "完单",
+            7: "退款",
+          },
+        },
+        {
+          label: "机构名称",
+          prop: "tenantName",
+          hidden: true,
+        },
+        {
+          label: "实际订单金额(元)",
+          prop: "orderPrice",
+          scope: "solt",
+          soltName: "price",
+          hidden: true,
+        },
+        {
+          label: "角色名称",
+          prop: "roleName",
+          hidden: true,
+          scope: "fill",
+        },
+        {
+          label: "已付分成(元)",
+          prop: "payMoney",
+          hidden: true,
+          scope: "solt",
+          soltName: "status",
+        },
+        {
+          label: "已扣分成(元)",
+          prop: "deductMoney",
+          hidden: true,
+          scope: "solt",
+          soltName: "status",
+        },
+        {
+          label: "待付分成(元)",
+          prop: "payMoney",
+          hidden: true,
+          scope: "solt",
+          soltName: "status",
+        },
+        {
+          label: "待扣分成(元)",
+          prop: "deductMoney",
+          hidden: true,
+          scope: "solt",
+          soltName: "status",
+        },
+        {
+          label: "预付时间",
+          prop: "predictPayTime",
+          hidden: true,
+          scope: "aTimeList",
+          hidden: true,
+        },
+        {
+          label: "剩余天数",
+          prop: "predictPayDay",
+          hidden: true,
+          scope: "fill",
+        },
+        {
+          label: "审核状态",
+          prop: "divideCheckStatus",
+          hidden: true,
+          scope: "solt",
+          soltName: "divideCheckStatus",
+        },
+        {
+          label: "支付时间",
+          prop: "payTime",
+          scope: "aTimeList",
+          hidden: true,
+        },
+        {
+          label: "备注",
+          prop: "remark",
+          hidden: true,
+        },
+      ],
+      tableSet2: [
+        {
+          label: "时间",
+          prop: "monthTime",
+          hidden: true,
+          width: 140,
+        },
+        {
+          label: "订单单号",
+          prop: "orderSn",
+          scope: "fill",
+          hidden: true,
+          width: 200,
+        },
+        {
+          label: "类型",
+          prop: "billType",
+          scope: "type",
+          hidden: true,
+          values: {
+            1: "月份",
+            2: "季度",
+            3: "半年",
+            4: "年度",
+            6: "完单",
+            7: "退款",
+          },
+        },
+        {
+          label: "机构名称",
+          prop: "tenantName",
+          hidden: true,
+        },
+        {
+          label: "实际订单金额(元)",
+          prop: "orderPrice",
+          scope: "solt",
+          soltName: "price",
+          hidden: true,
+        },
+        {
+          label: "角色名称",
+          prop: "roleName",
+          hidden: true,
+          scope: "fill",
+        },
+        {
+          label: "业务员",
+          prop: "createUsername",
+          hidden: true,
+          scope: "fill",
+        },
+        {
+          label: "业务号",
+          prop: "createNo",
+          hidden: true,
+          scope: "fill",
+        },
+        {
+          label: "已付提成(元)",
+          prop: "payMoney",
+          hidden: true,
+          scope: "solt",
+          soltName: "status",
+        },
+        {
+          label: "已扣提成(元)",
+          prop: "deductMoney",
+          hidden: true,
+          scope: "solt",
+          soltName: "status",
+        },
+        {
+          label: "待付提成(元)",
+          prop: "payMoney",
+          hidden: true,
+          scope: "solt",
+          soltName: "status",
+        },
+        {
+          label: "待扣提成(元)",
+          prop: "deductMoney",
+          hidden: true,
+          scope: "solt",
+          soltName: "status",
+        },
+        {
+          label: "审核状态",
+          prop: "divideCheckStatus",
+          hidden: true,
+          scope: "solt",
+          soltName: "divideCheckStatus",
+        },
+        {
+          label: "支付时间",
+          prop: "payTime",
+          scope: "aTimeList",
+          hidden: true,
+        },
+        {
+          label: "备注",
+          prop: "remark",
+          hidden: true,
+        },
+      ],
+      tableSet3: [
+        {
+          label: "时间",
+          prop: "monthTime",
+          hidden: true,
+          width: 140,
+        },
+        {
+          label: "订单单号",
+          prop: "orderSn",
+          scope: "fill",
+          hidden: true,
+          width: 200,
+        },
+        {
+          label: "机构名称",
+          prop: "tenantName",
+          hidden: true,
+        },
+        {
+          label: "实际订单金额(元)",
+          prop: "orderPrice",
+          scope: "solt",
+          soltName: "price",
+          hidden: true,
+        },
+        {
+          label: "角色名称",
+          prop: "roleName",
+          hidden: true,
+          scope: "fill",
+        },
+        {
+          label: "已付佣金(元)",
+          prop: "payMoney",
+          hidden: true,
+          scope: "solt",
+          soltName: "status",
+        },
+        {
+          label: "待付佣金(元)",
+          prop: "payMoney",
+          hidden: true,
+          scope: "solt",
+          soltName: "status",
+        },
+        {
+          label: "审核状态",
+          prop: "divideCheckStatus",
+          hidden: true,
+          scope: "solt",
+          soltName: "divideCheckStatus",
+        },
+        {
+          label: "支付时间",
+          prop: "payTime",
+          scope: "aTimeList",
+          hidden: true,
+        },
+        {
+          label: "备注",
+          prop: "remark",
+          hidden: true,
+        },
+      ],
+      tableData: [], //表单数据
+      total: 0, //一共多少条
+      tipDialogVisible: false,
+      orderDialogVisible: false,
+      remarkDialogVisible: false,
+      examineDialogVisible: false,
+      badBillDialogVisible: false,
+      type: 0,
+      activeOrderInfo: {},
+      activeOrderInfoArray: [],
+      roleList: [],
+      countInfo: {},
+      spanData: {},
+      maps: new Map(),
+      activeList: [],
+    };
+  },
+  created() {
+    this.init();
+  },
+  methods: {
+    getRoles(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;
+      } else {
+        return true;
+      }
+    },
+    divideCheckStatus(type, e1, e2) {
+      var a = "";
+      if (type) {
+        switch (e2) {
+          case -1:
+            a = "未通过";
+            break;
+          case 0:
+            a = "待审核";
+            break;
+          case 1:
+            a = "已通过";
+            break;
+          case 2:
+            a = "待支付";
+            break;
+          case 3:
+            a = "已支付";
+            break;
+          default:
+            break;
+        }
+      } else {
+        switch (e1) {
+          case 0:
+            a = "待支付";
+            break;
+          case 1:
+            a = "已打款";
+            break;
+          case 2:
+            a = "待审核";
+            break;
+          case 3:
+            a = "打款中";
+            break;
+          case 4:
+            a = "打款失败";
+            break;
+          default:
+            break;
+        }
+      }
+      return a;
+    },
+    exportSH() {
+      if (this.activeList.length === 0) {
+        this.$message.error("请勾选数据");
+        return;
+      }
+      this.openDialog(this.activeList, 1);
+    },
+    openDialog(data, type) {
+      if (type === 1) {
+        this.activeOrderInfoArray = data;
+        for (let i = 0; i < this.activeOrderInfoArray.length; i++) {
+          this.activeOrderInfoArray[i].checkFrom = this.type + 1;
+        }
+      } else {
+        this.activeOrderInfo = data;
+        this.activeOrderInfo.checkFrom = this.type + 1;
+      }
+      this[
+        ["tip", "examine", "remark", "order", "badBill"][type] + "DialogVisible"
+      ] = true;
+    },
+    batchExport() {
+      const fn = [orderExport, tenantExport, sellerExport, commissionExport][
+        this.type
+      ];
+      fn(this.formData).then((res) => {
+        if (res.msg) {
+          exportFn(
+            res.msg,
+            `导出${
+              ["应收应付", "机构分成", "业务员提成", "佣金结算"][this.type]
+            }数据`
+          );
+        } else {
+          this.$message.error("导出失败");
+        }
+      });
+    },
+    backText(row) {
+      const type = row.noteType;
+      if (type == 2) {
+        return ["每天"];
+      }
+      const key = ["weekTime", "monthTime"][type - 3];
+      let data = row[key].split(",").sort((a, b) => a - b);
+      return data;
+    },
+    changeSearch() {
+      this.maps.clear();
+      this.search(2);
+    },
+    getDataList() {
+      const fn = [orderList, companyList, sellerPercentageList, commissionList][
+        this.type
+      ];
+      fn(this.formData)
+        .then((res) => {
+          this.type != 0 &&
+            res.rows.forEach((e, i) => {
+              e.hasChildren = true;
+              e.monthTime = this.parseTime(e.monthTime, "{y}-{m}");
+            });
+          this.tableData = res.rows;
+          this.total = res.total;
+          this.navText.index = res.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    getReplaceData() {
+      return new Promise((resolve) => {
+        const fn = [
+          orderList,
+          companyList,
+          sellerPercentageList,
+          commissionList,
+        ][this.type];
+        fn(this.formData)
+          .then((res) => {
+            res.rows.forEach((i) => {
+              this.$set(
+                this.tableData[this.tableData.findIndex((k) => k.id === i.id)],
+                "payStatus",
+                i.payStatus
+              );
+            });
+            this.total = res.total;
+            this.navText.index = res.total;
+          })
+          .finally(() => {
+            this.loading = false;
+          });
+      });
+    },
+    load(tree, treeNode, resolve, type) {
+      monthOrderList({
+        divideLogId: tree.id,
+        roleId: this.formData.roleId,
+        startPrice: this.formData.startPrice,
+        endPrice: this.formData.endPrice,
+      })
+        .then((res) => {
+          // id冲突会报错
+          res.data.forEach((e) => {
+            e.oId = e.id;
+            e.id = e.id + 100086;
+            e.billType = e.orderType + 5;
+            e.monthTime = this.parseTime(e.orderTime, "{y}-{m}-{d}");
+            if (this.type == 3 || this.type == 2) {
+              e.divideCompanyMoney =
+                this.type == 2 ? e.divideSellerMoney : e.brokerage;
+            }
+          });
+          tree.children = res.data;
+          resolve(res.data);
+          if (tree.active) {
+            this.$nextTick(() => {
+              this.setChildren(res.data, true);
+            });
+          }
+          if (type === 2) {
+            this.$nextTick(() => {
+              this.$refs.tableList.$refs.pagerset.toggleRowSelection(
+                tree,
+                false
+              );
+              this.setChildren(res.data, false);
+            });
+          }
+          tree.active = true;
+        })
+        .catch(() => {
+          resolve([]);
+        });
+      this.maps.set(tree.id, { tree, treeNode, resolve });
+    },
+    update(parentId, type) {
+      const { tree, treeNode, resolve } = this.maps.get(parentId);
+      this.$set(
+        this.$refs.tableList.$refs.pagerset.store.states.lazyTreeNodeMap,
+        parentId,
+        []
+      );
+      if (tree) {
+        this.load(tree, treeNode, resolve, type);
+      }
+    },
+    setChildren(children, type) {
+      // 编辑多个子层级
+      children.map((j) => {
+        this.toggleSelection(j, type);
+        if (j.children) {
+          this.setChildren(j.children, type);
+        }
+      });
+    },
+    // 选中父节点时,子节点一起选中取消
+    async selectRow(selection, row) {
+      if (this.type === 0) return;
+      if (!row.oId && row.active !== true) {
+        row.active = true;
+        if (this.maps.get(row.id) !== undefined) return;
+        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;
+      let { label, property } = column;
+      if (oId) {
+        property =
+          property == "payMoney" ? "divideCompanyMoney" : "divideMoney";
+        // payStatus = payStatus != 3 ? 0 : 1;
+      }
+      payStatus = payStatus != 1 ? 0 : 1;
+      return ["0.00", row[property]][
+        (label.indexOf("已") != -1 ? 0 : 1) ^ payStatus
+      ];
+    },
+    changeData(data) {
+      if (this.type == 0) {
+        return data;
+      }
+      let total = 0;
+      let arr = [];
+      data.forEach((ele) => {
+        const monthList = ele.monthList;
+        delete ele.monthList;
+        this.spanData[total] = monthList.length;
+        total += monthList.length;
+        monthList.map((e) => {
+          Object.keys(e).forEach((key) => {
+            e[key] = e[key] || ele[key];
+          });
+        });
+        arr.push(...monthList);
+      });
+      return arr;
+    },
+    async search(v) {
+      this.loading = true;
+      if (v === 2) {
+        this.tableData = [];
+        this.maps.clear();
+        this.formData = {
+          pageSize: 10,
+          pageNum: 1,
+          month: [],
+        };
+      }
+      if (v === 3) {
+        this.tableData = [];
+        this.maps.clear();
+      }
+      this.$nextTick(() => {
+        this.activeList = [];
+        this.$refs.tableList.clearMoreActive();
+      });
+      this.getCountOrderNum();
+      if (v === 4 && this.type !== 0) {
+        await this.getReplaceData();
+        this.maps.forEach((value, id) => {
+          this.update(id, 2);
+        });
+        this.loading = false;
+        return;
+      }
+      this.getDataList();
+    },
+    init() {
+      this.getRoleList();
+      this.search(2);
+    },
+    getRoleList() {
+      this.$api.obtainRoleList().then((res) => {
+        this.roleList = res.rows;
+      });
+    },
+    getCountOrderNum() {
+      var data = JSON.parse(JSON.stringify(this.formData));
+      delete data.pageNum;
+      delete data.pageSize;
+      countOrderNum({ totalType: this.type + 1, ...data }).then((res) => {
+        this.info = res.data;
+      });
+    },
+  },
+  computed: {
+    tableSet() {
+      return this["tableSet" + this.type];
+    },
+    formList() {
+      const key = ["订单", "分成", "提成", "分成"][this.type];
+      let data = [
+        {
+          prop: "tenantId",
+          placeholder: "机构选择",
+          scope: "systemtenantlist",
+        },
+      ];
+      if (this.type != 0) {
+        data.push(
+          {
+            prop: "roleId",
+            scope: "roleList",
+            placeholder: "角色选择",
+          },
+          {
+            prop: "monthTime",
+            scope: "moreMonth",
+          },
+          {
+            prop: "payStatus",
+            placeholder: "审核状态",
+            scope: "select",
+            options: [
+              { label: "待支付", value: 0 },
+              { label: "已打款", value: 1 },
+              { label: "待审核", value: 2 },
+              { label: "打款中", value: 3 },
+              { label: "打款失败", value: 4 },
+            ],
+          },
+          {
+            prop1: "startPrice",
+            prop2: "endPrice",
+            ch: "-",
+            scope: "numList1",
+            placeholder1: "起始金额",
+            placeholder2: "结束金额",
+          }
+        );
+      }
+      if (this.type == 0) {
+        data.push(
+          {
+            prop: "badBill",
+            placeholder: "坏账选择",
+            scope: "select",
+            options: [
+              { label: "是", value: 1 },
+              { label: "否", value: 2 },
+            ],
+          },
+          {
+            prop1: "startTime",
+            prop2: "endTime",
+            placeholder1: key + "开始时间",
+            placeholder2: key + "结束时间",
+            scope: "moreDataPicker",
+          },
+          {
+            prop: "orderSn",
+            placeholder: "订单单号",
+          }
+        );
+      }
+      if (this.type == 0 || this.type == 2) {
+        data.push({
+          prop: "keyNo",
+          placeholder: "业务号",
+        });
+      }
+      if (this.type == 1) {
+        data.push({
+          prop: "billType",
+          placeholder: "账款类型",
+          scope: "select",
+          options: [
+            { label: "月份", value: 1 },
+            { label: "季度", value: 2 },
+            { label: "半年", value: 3 },
+            { label: "年度", value: 4 },
+          ],
+        });
+      }
+      return data;
+    },
+  },
+  watch: {
+    type(value) {
+      this.navText.title = ["应收应付", "机构分成", "业务员提成", "佣金结算"][
+        value
+      ];
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+/deep/ .el-table__header .el-table__cell > .cell > .el-checkbox {
+  //找到表头那一行,然后把里面的复选框隐藏掉
+  display: none;
+}
+.tip4,
+.tip3 {
+  white-space: normal;
+  i::before {
+    content: ",";
+  }
+}
+/deep/ {
+  .el-table {
+    .child-row {
+      background: #f0f9eb;
+      .el-table__cell {
+        background: #f0f9eb !important;
+      }
+    }
+  }
+}
+</style>

+ 1 - 1
src/views/financed/orderManageList/independent/index.vue

@@ -207,7 +207,7 @@
 
 <script>
 import { exportFn } from "@/utils/index.js";
-import dislogSetCost from "../../cost/dislogSet.vue";
+import dislogSetCost from "../../costSet/dislogOrganSet.vue";
 import dislogSet from "../../components/refund/dislogSet.vue";
 import dislogSetTrainee from "../../components/trainee/dislogSetTrainee.vue";
 import remarks from "../../components/remarks.vue";

+ 1 - 1
src/views/financed/orderManageList/operate/index.vue

@@ -285,7 +285,7 @@
 
 <script>
 import { exportFn } from "@/utils/index.js";
-import dislogSetCost from "../../cost/dislogSet.vue";
+import dislogSetCost from "../../costSet/dislogOrganSet.vue";
 import dislogSet from "../../components/refund/dislogSet.vue";
 import dislogSetTrainee from "../../components/trainee/dislogSetTrainee.vue";
 import remarks from "../../components/remarks.vue";