index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <div class="tenant">
  3. <div class="content">
  4. <byTable
  5. :source="sourceList.data"
  6. :pagination="sourceList.pagination"
  7. :config="config"
  8. :loading="loading"
  9. highlight-current-row
  10. :table-events="{
  11. select: selectRow,
  12. 'select-all': selectRow,
  13. }"
  14. :action-list="[
  15. {
  16. text: '采购',
  17. disabled: selectData.length === 0,
  18. action: () => clickPurchase(),
  19. },
  20. ]"
  21. @get-list="getList">
  22. <template #claimTime="{ item }">
  23. <div>
  24. <span v-if="item.claimTime">{{ item.claimTime }}</span>
  25. <span v-else>未到账</span>
  26. </div>
  27. </template>
  28. </byTable>
  29. </div>
  30. <el-dialog title="交接单" v-if="openAllFile" v-model="openAllFile" width="500">
  31. <div>
  32. <div v-for="(file, index) in rowData.fileList" :key="index" style="padding: 8px 0;">
  33. <a style="color: #409eff; cursor: pointer" @click="openFile(file.fileUrl)">{{ file.fileName }}</a>
  34. </div>
  35. </div>
  36. <template #footer>
  37. <el-button @click="openAllFile = false" size="large">关 闭</el-button>
  38. </template>
  39. </el-dialog>
  40. </div>
  41. </template>
  42. <script setup>
  43. import { computed, ref } from "vue";
  44. import byTable from "@/components/byTable/index";
  45. const { proxy } = getCurrentInstance();
  46. const sourceList = ref({
  47. data: [],
  48. pagination: {
  49. total: 0,
  50. pageNum: 1,
  51. pageSize: 10,
  52. keyword: "",
  53. },
  54. });
  55. const loading = ref(false);
  56. const config = computed(() => {
  57. return [
  58. {
  59. type: "selection",
  60. },
  61. {
  62. attrs: {
  63. label: "订单类型",
  64. prop: "orderType",
  65. width: 140,
  66. },
  67. },
  68. {
  69. attrs: {
  70. label: "外销合同编码",
  71. prop: "contractCode",
  72. width: 180,
  73. },
  74. },
  75. {
  76. attrs: {
  77. label: "合同到账时间",
  78. slot: "claimTime",
  79. width: 160,
  80. },
  81. },
  82. {
  83. attrs: {
  84. label: "业务员",
  85. prop: "userName",
  86. width: 140,
  87. },
  88. },
  89. {
  90. attrs: {
  91. label: "版本号",
  92. prop: "contractVersion",
  93. width: 100,
  94. },
  95. },
  96. {
  97. attrs: {
  98. label: "产品编码",
  99. prop: "productCode",
  100. width: 160,
  101. },
  102. },
  103. {
  104. attrs: {
  105. label: "产品名称",
  106. prop: "productName",
  107. "min-width": 220,
  108. },
  109. },
  110. {
  111. attrs: {
  112. label: "单位",
  113. prop: "productUnit",
  114. width: 140,
  115. },
  116. },
  117. {
  118. attrs: {
  119. label: "待采购数量",
  120. prop: "expendQuantity",
  121. width: 140,
  122. },
  123. },
  124. {
  125. attrs: {
  126. label: "交接单",
  127. width: 80,
  128. align: "center",
  129. fixed: "right",
  130. },
  131. renderHTML(row) {
  132. return [
  133. {
  134. attrs: {
  135. label: "查看",
  136. type: "primary",
  137. text: true,
  138. },
  139. el: "button",
  140. click() {
  141. checkTheTransferSlip(row);
  142. },
  143. },
  144. ];
  145. },
  146. },
  147. {
  148. attrs: {
  149. label: "操作",
  150. width: 80,
  151. align: "center",
  152. fixed: "right",
  153. },
  154. renderHTML(row) {
  155. return [
  156. {
  157. attrs: {
  158. label: "采购",
  159. type: "primary",
  160. text: true,
  161. },
  162. el: "button",
  163. click() {
  164. clickPurchase(row);
  165. },
  166. },
  167. ];
  168. },
  169. },
  170. ];
  171. });
  172. const getList = async (req) => {
  173. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  174. loading.value = true;
  175. proxy.post("/delivery/page", sourceList.value.pagination).then((res) => {
  176. sourceList.value.data = res.rows;
  177. sourceList.value.pagination.total = res.total;
  178. setTimeout(() => {
  179. loading.value = false;
  180. }, 200);
  181. });
  182. };
  183. getList();
  184. const clickPurchase = (item) => {
  185. console.log(item, selectData.value);
  186. // proxy.$router.replace({
  187. // path: "/platform_manage/process/processApproval",
  188. // query: {
  189. // flowKey: "contract_flow",
  190. // flowName: "销售合同审批流程",
  191. // random: proxy.random(),
  192. // tenantType: "EHSD",
  193. // },
  194. // });
  195. };
  196. const selectData = ref([]);
  197. const selectRow = (data) => {
  198. selectData.value = data;
  199. };
  200. const rowData = ref({
  201. fileList: [],
  202. });
  203. const openAllFile = ref(false);
  204. const checkTheTransferSlip = (item) => {
  205. rowData.value = item;
  206. rowData.value.fileList = [];
  207. openAllFile.value = true;
  208. proxy.post("/fileInfo/getList", { businessIdList: [item.contractId] }).then((fileObj) => {
  209. rowData.value.fileList = fileObj[item.contractId] || [];
  210. });
  211. };
  212. const openFile = (path) => {
  213. window.open(path, "_blank");
  214. };
  215. </script>
  216. <style lang="scss" scoped>
  217. .tenant {
  218. padding: 20px;
  219. }
  220. ::v-deep(.el-input-number .el-input__inner) {
  221. text-align: left;
  222. }
  223. .baseRow {
  224. min-height: 24px;
  225. border-top: 1px solid black;
  226. border-left: 1px solid black;
  227. }
  228. .contentRow {
  229. border-right: 1px solid black;
  230. line-height: 24px;
  231. padding-left: 4px;
  232. }
  233. </style>