index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <template>
  2. <div class="pageIndexClass">
  3. <div class="content">
  4. <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :selectConfig="selectConfig"
  5. highlight-current-row :action-list="[]" @get-list="getList">
  6. <template #amount="{ item }">
  7. <div>
  8. <span style="padding-right: 4px">{{ item.currency }}</span>
  9. <span>{{ moneyFormat(item.amount, 2) }}</span>
  10. </div>
  11. </template>
  12. <template #refundMoney="{ item }">
  13. <div>
  14. <span style="padding-right: 4px">{{ item.currency }}</span>
  15. <span>{{ moneyFormat(item.sumContractClaimMoney, 2) }}</span>
  16. </div>
  17. </template>
  18. <template #sumContractNotClaimMoney="{ item }">
  19. <div>
  20. <span style="padding-right: 4px">{{ item.currency }}</span>
  21. <span>{{ moneyFormat(item.sumContractNotClaimMoney, 2) }}</span>
  22. </div>
  23. </template>
  24. <template #advanceRatio="{ item }">
  25. <div>
  26. <span>{{ item.advanceRatio }}%</span>
  27. </div>
  28. </template>
  29. </byTable>
  30. </div>
  31. </div>
  32. </template>
  33. <script setup>
  34. import { computed, ref } from "vue";
  35. import byTable from "@/components/byTable/index";
  36. import useUserStore from "@/store/modules/user";
  37. import { ElMessage, ElMessageBox } from "element-plus";
  38. const { proxy } = getCurrentInstance();
  39. const contractType = ref([]);
  40. const corporationList = ref([]);
  41. const status = ref([
  42. {
  43. label: "草稿",
  44. value: 0,
  45. },
  46. {
  47. label: "审批中",
  48. value: 10,
  49. },
  50. {
  51. label: "驳回",
  52. value: 20,
  53. },
  54. {
  55. label: "审批通过",
  56. value: 30,
  57. },
  58. {
  59. label: "终止",
  60. value: 99,
  61. },
  62. ]);
  63. const refundStatus = ref([
  64. {
  65. label: "未到款",
  66. value: 0,
  67. },
  68. {
  69. label: "部分到款",
  70. value: 10,
  71. },
  72. ]);
  73. const sourceList = ref({
  74. data: [],
  75. pagination: {
  76. total: 0,
  77. pageNum: 1,
  78. pageSize: 10,
  79. keyword: "",
  80. sellCorporationId: "",
  81. },
  82. });
  83. const loading = ref(false);
  84. const selectConfig = computed(() => {
  85. return [
  86. {
  87. label: "到款状态",
  88. prop: "refundStatusNew",
  89. data: refundStatus.value,
  90. },
  91. ];
  92. });
  93. const config = computed(() => {
  94. return [
  95. {
  96. attrs: {
  97. label: "业务公司",
  98. prop: "sellCorporationId",
  99. "min-width": 220,
  100. },
  101. render(type) {
  102. let text = "";
  103. if (corporationList.value && corporationList.value.length > 0) {
  104. let data = corporationList.value.filter((item) => item.value == type);
  105. if (data && data.length > 0) {
  106. text = data[0].label;
  107. }
  108. }
  109. return text;
  110. },
  111. },
  112. {
  113. attrs: {
  114. label: "订单类型",
  115. prop: "contractType",
  116. width: 120,
  117. },
  118. render(type) {
  119. let text = "";
  120. if (contractType.value && contractType.value.length > 0) {
  121. let data = contractType.value.filter((item) => item.value == type);
  122. if (data && data.length > 0) {
  123. text = data[0].label;
  124. }
  125. }
  126. return text;
  127. },
  128. },
  129. {
  130. attrs: {
  131. label: "合同编码",
  132. prop: "code",
  133. width: 180,
  134. },
  135. },
  136. {
  137. attrs: {
  138. label: "客户",
  139. prop: "buyCorporationName",
  140. "min-width": 220,
  141. },
  142. },
  143. // {
  144. // attrs: {
  145. // label: "版本号",
  146. // prop: "version",
  147. // width: 120,
  148. // },
  149. // },
  150. {
  151. attrs: {
  152. label: "合同金额",
  153. slot: "amount",
  154. width: 140,
  155. },
  156. },
  157. // {
  158. // attrs: {
  159. // label: "已到账金额",
  160. // slot: "refundMoney",
  161. // width: 140,
  162. // },
  163. // },
  164. {
  165. attrs: {
  166. label: "未结清金额",
  167. slot: "sumContractNotClaimMoney",
  168. width: 140,
  169. },
  170. },
  171. {
  172. attrs: {
  173. label: "业务员",
  174. prop: "userName",
  175. width: 140,
  176. },
  177. },
  178. {
  179. attrs: {
  180. label: "创建时间",
  181. prop: "createTime",
  182. width: 160,
  183. },
  184. },
  185. {
  186. attrs: {
  187. label: "到款状态",
  188. prop: "refundStatusNew",
  189. width: 80,
  190. },
  191. render(refundStatusNew) {
  192. return proxy.dictValueLabel(refundStatusNew, refundStatus.value);
  193. },
  194. },
  195. {
  196. attrs: {
  197. label: "审批状态",
  198. prop: "status",
  199. width: 140,
  200. },
  201. render(type) {
  202. let text = "";
  203. if (status.value && status.value.length > 0) {
  204. let data = status.value.filter((item) => item.value == type);
  205. if (data && data.length > 0) {
  206. text = data[0].label;
  207. }
  208. }
  209. return text;
  210. },
  211. },
  212. {
  213. attrs: {
  214. label: "操作",
  215. width: "120",
  216. align: "center",
  217. fixed: "right",
  218. },
  219. renderHTML(row) {
  220. return [
  221. {
  222. attrs: {
  223. label: "选择",
  224. type: "primary",
  225. text: true,
  226. },
  227. el: "button",
  228. click() {
  229. handleSelect(row);
  230. },
  231. },
  232. ];
  233. },
  234. },
  235. ];
  236. });
  237. const getDict = () => {
  238. proxy
  239. .post("/dictTenantData/page", {
  240. pageNum: 1,
  241. pageSize: 999,
  242. dictCode: "contract_type",
  243. tenantId: useUserStore().user.tenantId,
  244. })
  245. .then((res) => {
  246. if (res.rows && res.rows.length > 0) {
  247. contractType.value = res.rows.map((item) => {
  248. return {
  249. label: item.dictValue,
  250. value: item.dictKey,
  251. };
  252. });
  253. }
  254. });
  255. proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
  256. corporationList.value = res.rows.map((item) => {
  257. return {
  258. ...item,
  259. label: item.name,
  260. value: item.id,
  261. };
  262. });
  263. });
  264. };
  265. const getList = async (req) => {
  266. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  267. loading.value = true;
  268. proxy
  269. .post("/contract/contractAndSamplePage", sourceList.value.pagination)
  270. .then((res) => {
  271. sourceList.value.data = res.rows;
  272. sourceList.value.pagination.total = res.total;
  273. setTimeout(() => {
  274. loading.value = false;
  275. }, 200);
  276. });
  277. };
  278. getDict();
  279. getList();
  280. const handleSelect = (row) => {
  281. proxy.$emit("handleSelectContrct", row);
  282. };
  283. </script>
  284. <style lang="scss" scoped>
  285. .tenant {
  286. padding: 20px;
  287. }
  288. ::v-deep(.el-input-number .el-input__inner) {
  289. text-align: left;
  290. }
  291. </style>