index.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <div>
  3. <el-card class="box-card">
  4. <byTable
  5. :source="sourceList.data"
  6. :pagination="sourceList.pagination"
  7. :config="config"
  8. :loading="loading"
  9. :searchConfig="searchConfig"
  10. highlight-current-row
  11. :action-list="[
  12. {
  13. text: 'Excel文件',
  14. action: () => clickExcelFile(),
  15. },
  16. ]"
  17. @get-list="getList"
  18. @clickReset="clickReset">
  19. <template #timePeriod="{ item }">
  20. <div>
  21. <el-row>
  22. <el-col :span="11">{{ item.timePeriod }}</el-col>
  23. <el-col :span="2" style="text-align: center">-</el-col>
  24. <el-col :span="11">{{ item.timePeriod }}</el-col>
  25. </el-row>
  26. </div>
  27. </template>
  28. <template #receiptFileList="{ item }">
  29. <div>
  30. <el-button type="primary" @click="clickReceiptFile(item)" v-if="item.receiptFileList && item.receiptFileList.length > 0" text>查看</el-button>
  31. </div>
  32. </template>
  33. <template #proofFileList="{ item }">
  34. <div>
  35. <el-button type="primary" @click="clickProofFile(item)" v-if="item.proofFileList && item.proofFileList.length > 0" text>查看</el-button>
  36. </div>
  37. </template>
  38. </byTable>
  39. </el-card>
  40. <el-dialog :title="title" v-if="open" v-model="open" width="600">
  41. <div v-if="fileList && fileList.length > 0">
  42. <div v-for="(item, index) in fileList" :key="index" style="padding: 8px">
  43. <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="openFile(item.fileUrl)">{{ item.fileName }}</a>
  44. </div>
  45. </div>
  46. <template #footer>
  47. <el-button @click="open = false" size="large">关 闭</el-button>
  48. </template>
  49. </el-dialog>
  50. <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="94%" class="print">
  51. <el-tabs v-model="tabsCard" type="card">
  52. <el-tab-pane v-for="(item, index) in cardList" :key="index" :label="item.dictValue" :name="item.dictKey"> </el-tab-pane>
  53. </el-tabs>
  54. <div style="padding: 0 10px">
  55. <el-tabs v-model="activeName">
  56. <el-tab-pane label="SKU对账单" name="sku">
  57. <PrintSKU :rowData="rowData" :tabValues="{ activeName: activeName, tabsCard: tabsCard }" @clickCancel="openPrint = false"></PrintSKU>
  58. </el-tab-pane>
  59. <el-tab-pane label="BOM对账单" name="bom">
  60. <PrintBOM :rowData="rowData" :tabValues="{ activeName: activeName, tabsCard: tabsCard }" @clickCancel="openPrint = false"></PrintBOM>
  61. </el-tab-pane>
  62. <el-tab-pane label="订单对账单" name="order">
  63. <PrintOrder :rowData="rowData" :tabValues="{ activeName: activeName, tabsCard: tabsCard }" @clickCancel="clickCancel"></PrintOrder>
  64. </el-tab-pane>
  65. </el-tabs>
  66. </div>
  67. </el-dialog>
  68. <el-dialog title="Excel文件" v-if="openFileList" v-model="openFileList" width="60%">
  69. <ExcelFile></ExcelFile>
  70. <template #footer>
  71. <el-button @click="openFileList = false" size="large">关 闭</el-button>
  72. </template>
  73. </el-dialog>
  74. </div>
  75. </template>
  76. <script setup>
  77. import byTable from "/src/components/byTable/index";
  78. import PrintSKU from "/src/views/group/finance/check-bill/printSKU.vue";
  79. import PrintBOM from "/src/views/group/finance/check-bill/printBOM.vue";
  80. import PrintOrder from "/src/views/group/finance/check-bill/printOrder.vue";
  81. import ExcelFile from "/src/views/group/finance/check-bill/ExcelFile.vue";
  82. const { proxy } = getCurrentInstance();
  83. const sourceList = ref({
  84. data: [],
  85. pagination: {
  86. total: 0,
  87. pageNum: 1,
  88. pageSize: 10,
  89. code: "",
  90. departmentId: proxy.useUserStore().user.deptId === "100" ? "" : proxy.useUserStore().user.deptId,
  91. beginTime: "",
  92. endTime: "",
  93. },
  94. });
  95. const loading = ref(false);
  96. const searchConfig = computed(() => {
  97. return [
  98. {
  99. type: "input",
  100. prop: "code",
  101. label: "对账单号",
  102. },
  103. {
  104. type: "date",
  105. propList: ["beginTime", "endTime"],
  106. label: "对账日期",
  107. },
  108. ];
  109. });
  110. const config = computed(() => {
  111. return [
  112. {
  113. attrs: {
  114. label: "对账单号",
  115. prop: "code",
  116. },
  117. },
  118. {
  119. attrs: {
  120. label: "创建时间",
  121. prop: "createTime",
  122. width: 160,
  123. },
  124. },
  125. {
  126. attrs: {
  127. label: "客户",
  128. prop: "departmentName",
  129. },
  130. },
  131. {
  132. attrs: {
  133. label: "对账金额",
  134. prop: "amount",
  135. align: "right",
  136. width: 180,
  137. },
  138. },
  139. {
  140. attrs: {
  141. label: "合同数量",
  142. prop: "orderNum",
  143. width: 100,
  144. },
  145. },
  146. {
  147. attrs: {
  148. label: "对账时间",
  149. prop: "timePeriod",
  150. align: "center",
  151. width: 180,
  152. },
  153. },
  154. {
  155. attrs: {
  156. label: "对账单",
  157. slot: "receiptFileList",
  158. align: "center",
  159. width: 120,
  160. },
  161. },
  162. {
  163. attrs: {
  164. label: "转账凭证",
  165. slot: "proofFileList",
  166. align: "center",
  167. width: 120,
  168. },
  169. },
  170. {
  171. attrs: {
  172. label: "操作",
  173. width: 80,
  174. align: "center",
  175. fixed: "right",
  176. },
  177. renderHTML(row) {
  178. return [
  179. {
  180. attrs: {
  181. label: "打印",
  182. type: "primary",
  183. text: true,
  184. },
  185. el: "button",
  186. click() {
  187. clickPrint(row);
  188. },
  189. },
  190. ];
  191. },
  192. },
  193. ];
  194. });
  195. const getList = async (req, status) => {
  196. if (status) {
  197. sourceList.value.pagination = {
  198. pageNum: sourceList.value.pagination.pageNum,
  199. pageSize: sourceList.value.pagination.pageSize,
  200. };
  201. } else {
  202. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  203. }
  204. loading.value = true;
  205. proxy.post("/statementOfAccount/page", sourceList.value.pagination).then((res) => {
  206. sourceList.value.data = res.rows;
  207. sourceList.value.pagination.total = res.total;
  208. setTimeout(() => {
  209. loading.value = false;
  210. }, 200);
  211. });
  212. };
  213. getList();
  214. const clickReset = () => {
  215. getList("", true);
  216. };
  217. const open = ref(false);
  218. const title = ref("");
  219. const fileList = ref([]);
  220. const clickReceiptFile = (row) => {
  221. title.value = "对账单";
  222. fileList.value = proxy.deepClone(row.receiptFileList);
  223. open.value = true;
  224. };
  225. const clickProofFile = (row) => {
  226. title.value = "转账凭证";
  227. fileList.value = proxy.deepClone(row.proofFileList);
  228. open.value = true;
  229. };
  230. const openFile = (path) => {
  231. window.open(path);
  232. };
  233. const openPrint = ref(false);
  234. const rowData = ref({});
  235. const cardList = ref([
  236. {
  237. dictKey: 1,
  238. dictValue: "万里牛订单",
  239. },
  240. {
  241. dictKey: 2,
  242. dictValue: "采购订单",
  243. },
  244. {
  245. dictKey: 3,
  246. dictValue: "委外订单",
  247. },
  248. {
  249. dictKey: 4,
  250. dictValue: "售后订单",
  251. },
  252. {
  253. dictKey: 5,
  254. dictValue: "无理由订单",
  255. },
  256. ]);
  257. const tabsCard = ref(1);
  258. const activeName = ref("sku");
  259. const clickPrint = (row) => {
  260. tabsCard.value = 1;
  261. activeName.value = "sku";
  262. rowData.value = row;
  263. openPrint.value = true;
  264. };
  265. const openFileList = ref(false);
  266. const clickCancel = (status) => {
  267. openPrint.value = false;
  268. if (status) {
  269. openFileList.value = true;
  270. }
  271. };
  272. const clickExcelFile = () => {
  273. openFileList.value = true;
  274. };
  275. </script>
  276. <style lang="scss" scoped>
  277. :deep(.el-dialog) {
  278. margin-top: 10px !important;
  279. margin-bottom: 10px !important;
  280. }
  281. :deep(.print) {
  282. .el-dialog__body {
  283. padding: 10px 20px !important;
  284. .el-tabs__header {
  285. margin: 0 !important;
  286. }
  287. }
  288. }
  289. </style>