index.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. <template>
  2. <div class="operation">
  3. <search-box-new
  4. class="search_box_page"
  5. ref="searchBox"
  6. :redIcon="false"
  7. :formData="formData"
  8. :formList="formList"
  9. @search="search(3)"
  10. @init="init"
  11. />
  12. <picture-list ref="pictureList" :list="showTabList"></picture-list>
  13. <table-list
  14. ref="tableList"
  15. :tableSets="tableSet"
  16. :tableData="tableData"
  17. :navText="navText"
  18. :loading="loading"
  19. >
  20. <template slot="customize">
  21. <el-button type="primary" @click="batchCollection">批量催款</el-button>
  22. <el-button @click="openDialog({}, 2)" type="primary">
  23. 坏账设置
  24. </el-button>
  25. </template>
  26. <template slot="noteType" slot-scope="props">
  27. <div v-if="!props.scope.row.noteId || props.scope.row.noteType == 1">
  28. --
  29. </div>
  30. <div v-else>
  31. <div :class="'tip' + props.scope.row.noteType">
  32. <span v-for="(text, idx) in backText(props.scope.row)" :key="idx">
  33. <span v-if="props.scope.row.noteType == 3">周</span>
  34. {{ text }}
  35. <span v-if="props.scope.row.noteType == 4">日</span>
  36. <i></i>
  37. </span>
  38. </div>
  39. <div>{{ props.scope.row.dayTime }}</div>
  40. </div>
  41. </template>
  42. <template slot="predictPayTime" slot-scope="props">
  43. <span
  44. :style="{ color: props.scope.row.predictReceiveDay < 0 ? 'red' : '' }"
  45. >
  46. {{ props.scope.row.predictReceiveDay || "--" }}
  47. </span>
  48. </template>
  49. <template slot="btn" slot-scope="props">
  50. <el-button type="text" @click="openDialog(props.scope.row, 0)">
  51. 详情
  52. </el-button>
  53. <el-button
  54. type="text"
  55. :disabled="props.scope.row.creditStatus == 1"
  56. @click="openDialog({ ...props.scope.row, ctype: 1 }, 1)"
  57. >
  58. 催款
  59. </el-button>
  60. </template>
  61. </table-list>
  62. <pagination1
  63. :total="total"
  64. :pageSize.sync="formData.pageSize"
  65. :currentPage.sync="formData.pageNum"
  66. @search="search(3)"
  67. />
  68. <!-- 催款 -->
  69. <dislog-tip
  70. :dialogVisible.sync="tipDialogVisible"
  71. :orderInfo="activeOrderInfo"
  72. @search="search(3)"
  73. />
  74. <!-- 订单详情 -->
  75. <dislog-order-details
  76. :ShowStatus="1"
  77. :orderSn="activeOrderInfo.orderSn"
  78. :orderFrom="activeOrderInfo.orderFrom"
  79. :dialogVisible.sync="orderDialogVisible"
  80. />
  81. <!-- 坏账设置 -->
  82. <dislog-bad-bill :dialogVisible.sync="badBillDialogVisible" />
  83. </div>
  84. </template>
  85. <script>
  86. import pictureList from "@/components/Comon/pictureList.vue";
  87. import dislogBadBill from "../components/dislogBadBill.vue";
  88. import dislogOrderDetails from "../../components/dislogOrderDetails.vue";
  89. import dislogTip from "../components/dislogTip.vue";
  90. import { orderList } from "@/api/financed/index";
  91. export default {
  92. name: "SaasMasterPlatformIndex",
  93. data() {
  94. return {
  95. showTabList: [
  96. {
  97. label: "未收账款",
  98. prop: "orderUncollectedTotal",
  99. img: "未收款",
  100. },
  101. ],
  102. navText: {
  103. title: "应收应付",
  104. index: 0,
  105. ch: "条",
  106. num: true,
  107. choice: true,
  108. addHide: true,
  109. dontNum: false,
  110. openCheckMore: false,
  111. changeWidth: "240px",
  112. custom: false,
  113. },
  114. formList: [
  115. {
  116. prop: "tenantId",
  117. placeholder: "机构选择",
  118. scope: "systemtenantlist",
  119. },
  120. {
  121. prop: "badBill",
  122. placeholder: "坏账选择",
  123. scope: "select",
  124. options: [
  125. { label: "是", value: 1 },
  126. { label: "否", value: 2 },
  127. ],
  128. },
  129. {
  130. prop1: "startTime",
  131. prop2: "endTime",
  132. placeholder1: "订单开始时间",
  133. placeholder2: "订单结束时间",
  134. scope: "moreDataPicker",
  135. },
  136. {
  137. prop: "orderSn",
  138. placeholder: "订单单号",
  139. },
  140. {
  141. prop: "keyNo",
  142. placeholder: "业务号",
  143. },
  144. ],
  145. tableSet: [
  146. {
  147. label: "坏账",
  148. prop: "badBill",
  149. hidden: true,
  150. scope: "isOptions",
  151. options: [
  152. {
  153. label: "否",
  154. value: false,
  155. },
  156. {
  157. label: "是",
  158. value: true,
  159. style: {
  160. color: "red",
  161. },
  162. },
  163. ],
  164. },
  165. {
  166. label: "下单时间",
  167. prop: "buyTime",
  168. hidden: true,
  169. scope: "aTimeList",
  170. },
  171. {
  172. label: "订单单号",
  173. prop: "orderSn",
  174. hidden: true,
  175. },
  176. {
  177. label: "机构名称",
  178. prop: "tenantName",
  179. hidden: true,
  180. },
  181. {
  182. label: "业务员",
  183. prop: "createUsername",
  184. hidden: true,
  185. },
  186. {
  187. label: "业务号",
  188. prop: "createNo",
  189. hidden: true,
  190. },
  191. {
  192. label: "合同金额(元)",
  193. prop: "orderPrice",
  194. hidden: true,
  195. scope: "formatPrice",
  196. },
  197. {
  198. label: "已收账款(元)",
  199. prop: "orderReceived",
  200. hidden: true,
  201. scope: "formatPrice",
  202. },
  203. {
  204. label: "已退金额(元)",
  205. prop: "orderRefunded",
  206. hidden: true,
  207. scope: "formatPrice",
  208. },
  209. {
  210. label: "未收账款(元)",
  211. prop: "orderUncollected",
  212. hidden: true,
  213. scope: "formatPrice",
  214. },
  215. {
  216. label: "预收时间",
  217. hidden: true,
  218. prop: "predictReceiveTime",
  219. scope: "aTimeList",
  220. },
  221. {
  222. label: "剩余天数",
  223. prop: "predictReceiveDay",
  224. hidden: true,
  225. scope: "solt",
  226. soltName: "predictPayTime",
  227. },
  228. {
  229. label: "提醒设置",
  230. prop: "noteType",
  231. scope: "solt",
  232. soltName: "noteType",
  233. hidden: true,
  234. },
  235. {
  236. label: "最新提醒",
  237. prop: "lastTime",
  238. hidden: true,
  239. scope: "aTimeList",
  240. },
  241. ],
  242. formData: {},
  243. tableData: [],
  244. total: 0,
  245. loading: false,
  246. badBillDialogVisible: false,
  247. orderDialogVisible: false,
  248. tipDialogVisible: false,
  249. activeOrderInfo: {},
  250. };
  251. },
  252. created() {
  253. this.init();
  254. },
  255. methods: {
  256. async search(v) {
  257. this.loading = true;
  258. if (v === 2) {
  259. this.tableData = [];
  260. this.formData = {
  261. pageSize: 10,
  262. pageNum: 1,
  263. };
  264. }
  265. this.getDataList();
  266. },
  267. init() {
  268. this.search(2);
  269. },
  270. getDataList() {
  271. orderList(this.formData)
  272. .then((res) => {
  273. this.tableData = res.rows;
  274. this.total = res.total;
  275. this.navText.index = res.total;
  276. })
  277. .finally(() => {
  278. this.loading = false;
  279. });
  280. },
  281. backText(row) {
  282. const type = row.noteType;
  283. if (type == 2) {
  284. return ["每天"];
  285. }
  286. const key = ["weekTime", "monthTime"][type - 3];
  287. let data = row[key].split(",").sort((a, b) => a - b);
  288. return data;
  289. },
  290. openDialog(data, type) {
  291. data.checkFrom = 1;
  292. this.activeOrderInfo = data;
  293. this[["order", "tip", "badBill"][type] + "DialogVisible"] = true;
  294. },
  295. batchCollection() {
  296. let orderSnList = this.$refs.tableList.allCheckData.map((item) => {
  297. return { orderSn: item.orderSn, tenantId: item.tenantId };
  298. });
  299. if (orderSnList.length === 0) {
  300. this.$message.error("请先勾选批量催款数据");
  301. return;
  302. }
  303. this.openDialog({ orderSnList }, 1);
  304. },
  305. },
  306. components: {
  307. pictureList,
  308. dislogBadBill,
  309. dislogOrderDetails,
  310. dislogTip,
  311. },
  312. };
  313. </script>
  314. <style lang="scss" scoped>
  315. .search_box_page {
  316. /deep/ .el-select {
  317. width: 120px;
  318. }
  319. /deep/ .el-date-editor {
  320. width: 140px;
  321. }
  322. /deep/ .el-form-item__content > .el-input {
  323. width: 190px;
  324. }
  325. }
  326. </style>