123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989 |
- <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"
- @init="init"
- />
- <picture-list
- :key="type + 'a'"
- :fn="getCountOrderNum"
- :list="showTabList[type]"
- ></picture-list>
- <table-list
- :key="type"
- rowKey="id"
- ref="tableList"
- :tableSets="tableSet"
- :tableData="tableData"
- :navText="navText"
- :loading="loading"
- :setIndex="setIndex"
- @load="load"
- >
- <template slot="customize">
- <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="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"
- @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"
- />
- <dislog-tip
- :dialogVisible.sync="tipDialogVisible"
- :orderInfo="activeOrderInfo"
- @search="search"
- />
- <!-- 订单详情 -->
- <dislog-order-details
- :orderSn="activeOrderInfo.orderSn"
- :orderFrom="activeOrderInfo.orderFrom"
- :dialogVisible.sync="orderDialogVisible"
- />
- <arap-remarks
- :info="activeOrderInfo"
- @search="search"
- :dialogVisible.sync="remarkDialogVisible"
- />
- <dislog-set
- :dialogVisible.sync="examineDialogVisible"
- @search="search"
- :info="activeOrderInfo"
- @update="update"
- ></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 "./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: [],
- 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: false,
- addHide: true,
- dontNum: false,
- openCheckMore: true,
- changeWidth: "240px",
- custom: false,
- tableColor: true,
- tableColorFunc: ({ row, rowIndex }) => {
- if (row.oId) {
- return "child-row";
- }
- return "";
- },
- },
- 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: "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: "roleName",
- hidden: true,
- scope: "fill",
- },
- {
- label: "业务员",
- prop: "createUsername",
- hidden: true,
- },
- {
- label: "业务号",
- prop: "createNo",
- hidden: true,
- },
- {
- 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: "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: {},
- roleList: [],
- countInfo: {},
- spanData: {},
- maps: new Map(),
- };
- },
- created() {
- this.init();
- },
- methods: {
- 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;
- },
- openDialog(data, type) {
- 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;
- },
- setIndex(index) {
- return index + 1;
- },
- 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) => {
- e.children = [];
- 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;
- });
- },
- load(tree, treeNode, resolve) {
- monthOrderList({ divideLogId: tree.id, roleId: this.formData.roleId })
- .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;
- }
- });
- resolve(res.data);
- })
- .catch(() => {
- resolve([]);
- });
- this.maps.set(tree.id, { tree, treeNode, resolve });
- },
- update(parentId) {
- 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);
- }
- },
- // 切换已付待付
- 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;
- },
- search(v) {
- this.loading = true;
- if (v === 2) {
- this.formData = {
- pageSize: 10,
- pageNum: 1,
- month: [],
- };
- }
- this.maps.forEach((value, id) => {
- this.update(id);
- });
- this.getDataList();
- },
- init() {
- this.getRoleList();
- this.search(2);
- },
- getRoleList() {
- this.$api.obtainRoleList().then((res) => {
- this.roleList = res.rows;
- });
- },
- getCountOrderNum() {
- return countOrderNum({ totalType: this.type + 1 }).then((res) => {
- return Promise.resolve(res);
- });
- },
- },
- 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 },
- ],
- }
- );
- }
- 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>
- .tip4,
- .tip3 {
- white-space: normal;
- i::before {
- content: ",";
- }
- }
- /deep/ {
- .el-table {
- .child-row {
- background: #f0f9eb;
- .el-table__cell {
- background: #f0f9eb !important;
- }
- }
- }
- }
- </style>
|