index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. <template>
  2. <div id="ActivityList">
  3. <search-box-new
  4. ref="searchBox"
  5. :redIcon="false"
  6. :formData="formData"
  7. :formList="formList"
  8. @search="search(3)"
  9. @init="init"
  10. />
  11. <picture-list ref="pictureList" :list="showTabList"></picture-list>
  12. <table-list
  13. :key="type"
  14. rowKey="id"
  15. ref="tableList"
  16. :tableSets="tableSet"
  17. :tableData="tableData"
  18. :navText="navText"
  19. :loading="loading"
  20. >
  21. <template slot="customize">
  22. <el-button @click="batchAudit(1)" type="primary"> 批量审核 </el-button>
  23. <el-button v-if="isTj" @click="batchAudit(-1)" type="warning"
  24. >批量审核不通过</el-button
  25. >
  26. <!-- <el-button @click="batchExport" type="primary"> 导出excel </el-button> -->
  27. </template>
  28. <template slot="checkStatus" slot-scope="props">
  29. <div>
  30. {{
  31. [
  32. "未通过",
  33. "待审核",
  34. "已通过",
  35. "待支付",
  36. "已结算",
  37. "审核中",
  38. "支付失败",
  39. ][props.scope.row.checkStatus + 1]
  40. }}
  41. <span style="color: red" v-if="props.scope.row.roleName">
  42. ({{ props.scope.row.roleName }})
  43. </span>
  44. </div>
  45. </template>
  46. <template slot="pretax" slot-scope="props">
  47. {{ props.scope.row.pretax * 100 }}%
  48. </template>
  49. <template slot="btn" slot-scope="props">
  50. <el-button
  51. type="text"
  52. @click="openDialog({ ...props.scope.row, type: 1 })"
  53. >
  54. 详情
  55. </el-button>
  56. <el-button
  57. type="text"
  58. v-if="
  59. props.scope.row.checkStatus === 1 ||
  60. props.scope.row.checkStatus === 5
  61. "
  62. :disabled="getRoles(props.scope.row.roleId)"
  63. @click="openDialog({ ...props.scope.row, type: 3 })"
  64. >
  65. 支付
  66. </el-button>
  67. <el-button
  68. v-else
  69. type="text"
  70. :disabled="
  71. props.scope.row.checkStatus !== 0 ||
  72. getRoles(props.scope.row.roleId)
  73. "
  74. @click="openDialog({ ...props.scope.row, type: 2 })"
  75. >
  76. 审核
  77. </el-button>
  78. <el-button
  79. type="text"
  80. :style="{
  81. color:
  82. props.scope.row.checkStatus !== 1 ? '#ccc' : 'rgb(230, 162, 60)',
  83. }"
  84. :disabled="props.scope.row.checkStatus !== 1"
  85. @click="openDialog({ ...props.scope.row, type: 3, printType: 1 }, 0)"
  86. >
  87. 单据打印
  88. </el-button>
  89. <el-button
  90. type="text"
  91. style="color: rgb(230, 162, 60)"
  92. @click="openDialog({ ...props.scope.row, type: 3, printType: 2 }, 0)"
  93. >
  94. 明细打印
  95. </el-button>
  96. </template>
  97. </table-list>
  98. <pagination1
  99. :total="total"
  100. :pageSize.sync="formData.pageSize"
  101. :currentPage.sync="formData.pageNum"
  102. @search="search(3)"
  103. />
  104. <!-- 打印 -->
  105. <dislog-print
  106. :activeData="activeOrderInfo"
  107. :dialogVisible.sync="printDialogVisible"
  108. />
  109. <!-- 批量审核 -->
  110. <dislog-batch-audit
  111. :info="activeOrderInfo"
  112. @search="search"
  113. :dialogVisible.sync="auditDialogVisible"
  114. />
  115. <!-- 佣金审核或支付 -->
  116. <dislog-Cms-Audit
  117. :info="activeOrderInfo"
  118. @search="search"
  119. :dialogVisible.sync="cmsAuditDialogVisible"
  120. />
  121. </div>
  122. </template>
  123. <script>
  124. import pictureList from "@/components/Comon/pictureList.vue";
  125. import dislogPrint from "../components/dislogPrint.vue";
  126. import dislogBatchAudit from "../components/dislogBatchAudit";
  127. import dislogCmsAudit from "../components/dislogCmsAudit";
  128. import { exportFn } from "@/utils/index.js";
  129. import {
  130. commissionList,
  131. commissionExport,
  132. commissionOrderCount,
  133. } from "@/api/financed/index";
  134. export default {
  135. name: "Arap",
  136. components: {
  137. pictureList,
  138. dislogPrint,
  139. dislogBatchAudit,
  140. dislogCmsAudit,
  141. },
  142. data() {
  143. return {
  144. showTabList: [
  145. {
  146. label: "订单金额",
  147. img: "未收款",
  148. value: 0,
  149. },
  150. {
  151. label: "税前佣金",
  152. img: "已退款",
  153. value: 0,
  154. },
  155. {
  156. label: "结算佣金",
  157. img: "成本金额",
  158. value: 0,
  159. },
  160. ],
  161. loading: false, //当前表单加载是否加载动画
  162. navText: {
  163. title: "佣金结算",
  164. index: 0,
  165. ch: "条",
  166. num: true,
  167. choice: true,
  168. addHide: true,
  169. dontNum: true,
  170. openCheckMore: false,
  171. changeWidth: "280px",
  172. custom: false,
  173. tableColor: true,
  174. selectableStatus: true,
  175. selectableFunc: (row, rowIndex) => {
  176. return row.checkStatus === 0 && !this.getRoles(row.roleId);
  177. },
  178. },
  179. formData: {
  180. pageSize: 10,
  181. pageNum: 1,
  182. },
  183. tableSet: [
  184. {
  185. label: "订单日期",
  186. prop: "createTime",
  187. hidden: true,
  188. scope: "aTimeList",
  189. width: 160,
  190. },
  191. {
  192. label: "订单号",
  193. prop: "orderSn",
  194. width: "210",
  195. hidden: true,
  196. },
  197. {
  198. label: "机构名称",
  199. prop: "tenantName",
  200. hidden: true,
  201. },
  202. {
  203. label: "业务员",
  204. prop: "createUsername",
  205. hidden: true,
  206. },
  207. {
  208. label: "业务号",
  209. prop: "createNo",
  210. hidden: true,
  211. },
  212. {
  213. label: "下单企业",
  214. prop: "purchaseOrg",
  215. hidden: true,
  216. },
  217. {
  218. label: "订单金额",
  219. prop: "orderPrice",
  220. hidden: true,
  221. scope: "formatPrice",
  222. },
  223. {
  224. label: "税前佣金",
  225. prop: "pretaxBrokerage",
  226. hidden: true,
  227. scope: "formatPrice",
  228. },
  229. {
  230. label: "佣金税占比",
  231. prop: "pretax",
  232. hidden: true,
  233. scope: "solt",
  234. soltName: "pretax",
  235. },
  236. {
  237. label: "结算佣金",
  238. prop: "brokerage",
  239. hidden: true,
  240. scope: "formatPrice",
  241. },
  242. {
  243. label: "支付方式",
  244. prop: "payType",
  245. hidden: true,
  246. scope: "type",
  247. hidden: true,
  248. values: {
  249. 1: "微信",
  250. 2: "支付宝",
  251. 3: "金币",
  252. 4: "现金",
  253. 5: "网银支付",
  254. 6: "协议",
  255. 7: "对公转账",
  256. },
  257. },
  258. {
  259. label: "审核状态",
  260. prop: "checkStatus",
  261. hidden: true,
  262. scope: "solt",
  263. soltName: "checkStatus",
  264. },
  265. {
  266. label: "审核意见",
  267. prop: "checkReason",
  268. hidden: true,
  269. },
  270. ],
  271. tableData: [], //表单数据
  272. formList: [
  273. {
  274. prop: "tenantIds",
  275. placeholder: "机构选择",
  276. scope: "systemtenantlist",
  277. multiple: true,
  278. },
  279. {
  280. prop: "monthTime",
  281. placeholder: "账期时间",
  282. scope: "moreMonth",
  283. },
  284. {
  285. prop: "checkStatus",
  286. placeholder: "审核状态",
  287. scope: "select",
  288. multiple: true,
  289. options: [
  290. { label: "待审核", value: 0 },
  291. { label: "审核中", value: 4 },
  292. { label: "未通过", value: -1 },
  293. { label: "待结算", value: 2 },
  294. { label: "已结算", value: 3 },
  295. ],
  296. },
  297. {
  298. prop: "orderSn",
  299. placeholder: "输入订单号",
  300. },
  301. {
  302. prop: "createNo",
  303. placeholder: "输入业务号/业务员号",
  304. },
  305. ],
  306. total: 0, //一共多少条
  307. printDialogVisible: false,
  308. auditDialogVisible: false,
  309. cmsAuditDialogVisible: false,
  310. type: 1,
  311. activeOrderInfo: {},
  312. activeOrderInfoArray: [],
  313. roleList: [],
  314. countInfo: {},
  315. spanData: {},
  316. maps: new Map(),
  317. activeList: [],
  318. };
  319. },
  320. created() {
  321. this.init();
  322. },
  323. methods: {
  324. getRoles(roleId) {
  325. if (
  326. (this.$store.state.user.rolesId?.length > 0 &&
  327. this.$store.state.user.rolesId.includes(roleId)) ||
  328. this.$store.state.user.rolesId.includes(1)
  329. ) {
  330. return false;
  331. } else {
  332. return true;
  333. }
  334. },
  335. openDialog(data, type = 1) {
  336. data.checkFrom = 4;
  337. this.activeOrderInfo = data;
  338. this[["print", "cmsAudit", "audit"][type] + "DialogVisible"] = true;
  339. },
  340. batchExport() {
  341. commissionExport(this.formData).then((res) => {
  342. if (res.msg) {
  343. exportFn(res.msg, "导出佣金结算数据");
  344. } else {
  345. this.$message.error("导出失败");
  346. }
  347. });
  348. },
  349. getDataList() {
  350. commissionList(this.formData)
  351. .then((res) => {
  352. res.rows.forEach((e) => {
  353. e.monthTime = this.parseTime(e.monthTime, "{y}-{m}");
  354. e.closeOrderMoney = e.deductMoney + e.payMoney;
  355. });
  356. this.tableData = res.rows;
  357. this.total = res.total;
  358. this.navText.index = res.total;
  359. })
  360. .finally(() => {
  361. this.loading = false;
  362. });
  363. },
  364. async search(v) {
  365. this.loading = true;
  366. if (v === 2) {
  367. this.tableData = [];
  368. this.formData = {
  369. pageSize: 10,
  370. pageNum: 1,
  371. monthTime: [],
  372. years: [],
  373. roleIds: this.rolesId,
  374. };
  375. }
  376. this.$nextTick(() => {
  377. this.$refs.tableList.clearMoreActive();
  378. });
  379. this.getCountOrderNum();
  380. this.getDataList();
  381. },
  382. init() {
  383. this.search(2);
  384. },
  385. getCountOrderNum() {
  386. commissionOrderCount(this.formData).then((res) => {
  387. this.showTabList[0].value = res.data.orderTotalPrice;
  388. this.showTabList[1].value = res.data.pretaxTotalBrokerage;
  389. this.showTabList[2].value = res.data.BrokerageTotalMoney;
  390. });
  391. },
  392. batchAudit(checkResult = 1) {
  393. const orderSn = this.$refs.tableList.allCheckData.map((e) => e.orderSn);
  394. if (orderSn.length === 0) {
  395. this.$message.error("请先勾选待审核数据");
  396. return;
  397. }
  398. this.openDialog(
  399. {
  400. orderSn,
  401. checkResult,
  402. isCommission: true,
  403. },
  404. 2
  405. );
  406. },
  407. },
  408. computed: {
  409. rolesId() {
  410. return this.$store.state.user.rolesId;
  411. },
  412. isTj() {
  413. return !this.$store.state.user.roles.includes("统计");
  414. },
  415. },
  416. };
  417. </script>
  418. <style lang="scss" scoped></style>