index.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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. @get-list="getList"
  12. @clickReset="clickReset">
  13. <template #timePeriod="{ item }">
  14. <div>
  15. <el-row>
  16. <el-col :span="11">{{ item.timePeriod }}</el-col>
  17. <el-col :span="2" style="text-align: center">-</el-col>
  18. <el-col :span="11">{{ item.timePeriod }}</el-col>
  19. </el-row>
  20. </div>
  21. </template>
  22. <template #receiptFileList="{ item }">
  23. <div>
  24. <el-button type="primary" @click="clickReceiptFile(item)" v-if="item.receiptFileList && item.receiptFileList.length > 0" text>查看</el-button>
  25. </div>
  26. </template>
  27. <template #proofFileList="{ item }">
  28. <div>
  29. <el-button type="primary" @click="clickProofFile(item)" v-if="item.proofFileList && item.proofFileList.length > 0" text>查看</el-button>
  30. </div>
  31. </template>
  32. </byTable>
  33. </el-card>
  34. <el-dialog :title="title" v-if="open" v-model="open" width="600">
  35. <div v-if="fileList && fileList.length > 0">
  36. <div v-for="(item, index) in fileList" :key="index" style="padding: 8px">
  37. <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="openFile(item.fileUrl)">{{ item.fileName }}</a>
  38. </div>
  39. </div>
  40. <template #footer>
  41. <el-button @click="open = false" size="large">关 闭</el-button>
  42. </template>
  43. </el-dialog>
  44. <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="94%">
  45. <el-tabs v-model="activeName" class="demo-tabs">
  46. <el-tab-pane label="SKU对账单" name="sku">
  47. <PrintSKU :rowData="rowData" @clickCancel="openPrint = false"></PrintSKU>
  48. </el-tab-pane>
  49. <el-tab-pane label="BOM对账单" name="bom">
  50. <PrintBOM :rowData="rowData" @clickCancel="openPrint = false"></PrintBOM>
  51. </el-tab-pane>
  52. <el-tab-pane label="订单对账单" name="order">
  53. <PrintOrder :rowData="rowData" @clickCancel="openPrint = false"></PrintOrder>
  54. </el-tab-pane>
  55. </el-tabs>
  56. </el-dialog>
  57. </div>
  58. </template>
  59. <script setup name="Check-bill">
  60. import byTable from "@/components/byTable/index";
  61. import PrintSKU from "@/views/group/finance/check-bill/printSKU.vue";
  62. import PrintBOM from "@/views/group/finance/check-bill/printBOM.vue";
  63. import PrintOrder from "@/views/group/finance/check-bill/printOrder.vue";
  64. const { proxy } = getCurrentInstance();
  65. const sourceList = ref({
  66. data: [],
  67. pagination: {
  68. total: 0,
  69. pageNum: 1,
  70. pageSize: 10,
  71. code: "",
  72. departmentId: proxy.useUserStore().user.deptId,
  73. beginTime: "",
  74. endTime: "",
  75. },
  76. });
  77. const loading = ref(false);
  78. const searchConfig = computed(() => {
  79. return [
  80. {
  81. type: "input",
  82. prop: "code",
  83. label: "对账单号",
  84. },
  85. {
  86. type: "date",
  87. propList: ["beginTime", "endTime"],
  88. label: "对账日期",
  89. },
  90. ];
  91. });
  92. const config = computed(() => {
  93. return [
  94. {
  95. attrs: {
  96. label: "对账单号",
  97. prop: "code",
  98. },
  99. },
  100. {
  101. attrs: {
  102. label: "创建时间",
  103. prop: "createTime",
  104. width: 160,
  105. },
  106. },
  107. {
  108. attrs: {
  109. label: "客户",
  110. prop: "departmentName",
  111. },
  112. },
  113. {
  114. attrs: {
  115. label: "对账金额",
  116. prop: "amount",
  117. align: "right",
  118. width: 180,
  119. },
  120. },
  121. {
  122. attrs: {
  123. label: "合同数量",
  124. prop: "orderNum",
  125. width: 100,
  126. },
  127. },
  128. {
  129. attrs: {
  130. label: "对账时间",
  131. prop: "timePeriod",
  132. align: "center",
  133. width: 180,
  134. },
  135. },
  136. {
  137. attrs: {
  138. label: "对账单",
  139. slot: "receiptFileList",
  140. align: "center",
  141. width: 120,
  142. },
  143. },
  144. {
  145. attrs: {
  146. label: "转账凭证",
  147. slot: "proofFileList",
  148. align: "center",
  149. width: 120,
  150. },
  151. },
  152. {
  153. attrs: {
  154. label: "操作",
  155. width: 80,
  156. align: "center",
  157. fixed: "right",
  158. },
  159. renderHTML(row) {
  160. return [
  161. {
  162. attrs: {
  163. label: "打印",
  164. type: "primary",
  165. text: true,
  166. },
  167. el: "button",
  168. click() {
  169. clickPrint(row);
  170. },
  171. },
  172. ];
  173. },
  174. },
  175. ];
  176. });
  177. const getList = async (req, status) => {
  178. if (status) {
  179. sourceList.value.pagination = {
  180. pageNum: sourceList.value.pagination.pageNum,
  181. pageSize: sourceList.value.pagination.pageSize,
  182. };
  183. } else {
  184. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  185. }
  186. loading.value = true;
  187. proxy.post("/statementOfAccount/page", sourceList.value.pagination).then((res) => {
  188. sourceList.value.data = res.rows;
  189. sourceList.value.pagination.total = res.total;
  190. setTimeout(() => {
  191. loading.value = false;
  192. }, 200);
  193. });
  194. };
  195. getList();
  196. const clickReset = () => {
  197. getList("", true);
  198. };
  199. const open = ref(false);
  200. const title = ref("");
  201. const fileList = ref([]);
  202. const clickReceiptFile = (row) => {
  203. title.value = "对账单";
  204. fileList.value = proxy.deepClone(row.receiptFileList);
  205. open.value = true;
  206. };
  207. const clickProofFile = (row) => {
  208. title.value = "转账凭证";
  209. fileList.value = proxy.deepClone(row.proofFileList);
  210. open.value = true;
  211. };
  212. const openFile = (path) => {
  213. window.open(path);
  214. };
  215. const openPrint = ref(false);
  216. const rowData = ref({});
  217. const activeName = ref("sku");
  218. const clickPrint = (row) => {
  219. activeName.value = "sku";
  220. rowData.value = row;
  221. openPrint.value = true;
  222. };
  223. </script>
  224. <style lang="scss" scoped>
  225. :deep(.el-dialog) {
  226. margin-top: 10px !important;
  227. margin-bottom: 10px !important;
  228. }
  229. </style>