quotation.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <div>
  3. <el-button type="primary" size="mini" class="btn" @click="handleMakeNew"
  4. >制作报价单</el-button
  5. >
  6. <div style="margin: 10px 0; display: flex; align-items: center">
  7. <el-input
  8. class="input_content"
  9. placeholder="请输入内容"
  10. v-model="sourceList.pagination.keyword"
  11. style="width: 50%"
  12. clearable
  13. size="small"
  14. ></el-input>
  15. <el-select
  16. v-model="sourceList.pagination.status"
  17. clearable
  18. filterable
  19. style="width: 40%; margin-left: 10px"
  20. size="small"
  21. >
  22. <el-option
  23. v-for="item in statusData"
  24. :key="item.value"
  25. :label="item.label"
  26. :value="item.value"
  27. />
  28. </el-select>
  29. <div style="text-align: center; width: 10%">
  30. <el-icon style="cursor: pointer" @click="getData"><Search /></el-icon>
  31. </div>
  32. </div>
  33. <el-table
  34. :data="sourceList.data"
  35. style="width: 100%; margin-top: 10px"
  36. v-loading="loading"
  37. :height="tableHeight"
  38. >
  39. <el-table-column prop="code" label="单号" width="130" fixed="left">
  40. <template #default="{ row }">
  41. <div
  42. style="cursor: pointer; color: #409eff"
  43. @click="handleClickContractCode(row)"
  44. >
  45. {{ row.code }}
  46. </div>
  47. </template>
  48. </el-table-column>
  49. <el-table-column prop="createTime" label="日期" width="140" />
  50. <el-table-column prop="buyContactName" label="客户" min-width="150" />
  51. <el-table-column prop="amount" label="报价" width="100">
  52. <template #default="{ row }">
  53. <div>{{ row.currency }} {{ moneyFormat(row.amount, 2) }}</div>
  54. </template>
  55. </el-table-column>
  56. <el-table-column
  57. prop="status"
  58. label="状态"
  59. width="80"
  60. :formatter="getStatus"
  61. />
  62. <!-- <el-table-column label="操作" width="60" fixed="right" align="center">
  63. <template #default="{ row }">
  64. <el-button type="primary" text
  65. ><i class="iconfont icon-iconm_wofqd"></i
  66. ></el-button>
  67. </template>
  68. </el-table-column> -->
  69. </el-table>
  70. <el-pagination
  71. style="margin-top: 10px"
  72. v-model:current-page="sourceList.pagination.pageNum"
  73. :page-size="10"
  74. layout="total, prev, pager, next"
  75. :total="sourceList.pagination.total"
  76. prev-text="上一页"
  77. next-text="下一页"
  78. @current-change="handleCurrentChange"
  79. />
  80. </div>
  81. </template>
  82. <script setup>
  83. const tableHeight = ref(0);
  84. const getTableHeight = () => {
  85. tableHeight.value = window.innerHeight - 280;
  86. };
  87. getTableHeight();
  88. window.addEventListener("resize", () => {
  89. getTableHeight();
  90. });
  91. const loading = ref(false);
  92. const sourceList = ref({
  93. data: [],
  94. pagination: {
  95. total: 300,
  96. pageNum: 1,
  97. pageSize: 10,
  98. keyword: "",
  99. },
  100. });
  101. const statusData = ref([
  102. {
  103. label: "草稿",
  104. value: 0,
  105. },
  106. {
  107. label: "审批中",
  108. value: 10,
  109. },
  110. {
  111. label: "驳回",
  112. value: 20,
  113. },
  114. {
  115. label: "通过",
  116. value: 30,
  117. },
  118. {
  119. label: "终止",
  120. value: 99,
  121. },
  122. ]);
  123. const { proxy } = getCurrentInstance();
  124. const getStatus = (row) => {
  125. const current = statusData.value.find((x) => x.value == row.status);
  126. if (current) return current.label;
  127. };
  128. const getData = () => {
  129. loading.value = true;
  130. proxy.post("/saleQuotation/page", sourceList.value.pagination).then((res) => {
  131. sourceList.value.data = res.rows;
  132. sourceList.value.pagination.total = res.total;
  133. setTimeout(() => {
  134. loading.value = false;
  135. }, 200);
  136. });
  137. };
  138. const handleCurrentChange = (val) => {
  139. sourceList.value.pagination.pageNum = val;
  140. getData();
  141. };
  142. getData();
  143. onMounted(() => {});
  144. const handleMakeNew = () => {
  145. proxy.$router.replace({
  146. path: "/platform_manage/process/processApproval",
  147. query: {
  148. flowKey: "sale_quotation_flow",
  149. flowName: "报价审批流程",
  150. random: proxy.random(),
  151. },
  152. });
  153. };
  154. const handleClickContractCode = (row) => {
  155. proxy.$router.push({
  156. path: "/ERP/saleContract/priceSheet",
  157. query: {
  158. code: row.code,
  159. },
  160. });
  161. };
  162. </script>
  163. <style lang="scss" scoped>
  164. * {
  165. font-size: 12px;
  166. }
  167. .el-button {
  168. padding: 0px;
  169. }
  170. .btn {
  171. width: 100%;
  172. border-radius: 10px;
  173. padding: 6px 10px;
  174. height: 24px;
  175. }
  176. .el-pagination {
  177. padding-left: 30px;
  178. }
  179. :deep(.el-pagination button, .el-pager li) {
  180. font-size: 12px;
  181. }
  182. :deep(.el-table .el-table__cell) {
  183. padding: 2px 0px;
  184. }
  185. </style>