quotation.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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="115" fixed="left" />
  40. <el-table-column prop="createTime" label="日期" width="140" />
  41. <el-table-column prop="buyContactName" label="客户" min-width="150" />
  42. <el-table-column prop="amount" label="报价" width="100">
  43. <template #default="{ row }">
  44. <div>{{ row.currency }} {{ moneyFormat(row.amount, 2) }}</div>
  45. </template>
  46. </el-table-column>
  47. <el-table-column
  48. prop="status"
  49. label="状态"
  50. width="80"
  51. :formatter="getStatus"
  52. />
  53. <!-- <el-table-column label="操作" width="60" fixed="right" align="center">
  54. <template #default="{ row }">
  55. <el-button type="primary" text
  56. ><i class="iconfont icon-iconm_wofqd"></i
  57. ></el-button>
  58. </template>
  59. </el-table-column> -->
  60. </el-table>
  61. <el-pagination
  62. style="margin-top: 10px"
  63. v-model:current-page="sourceList.pagination.pageNum"
  64. :page-size="10"
  65. layout="total, prev, pager, next"
  66. :total="sourceList.pagination.total"
  67. prev-text="上一页"
  68. next-text="下一页"
  69. @current-change="handleCurrentChange"
  70. />
  71. </div>
  72. </template>
  73. <script setup>
  74. const tableHeight = window.innerHeight - 280;
  75. const loading = ref(false);
  76. const sourceList = ref({
  77. data: [],
  78. pagination: {
  79. total: 300,
  80. pageNum: 1,
  81. pageSize: 10,
  82. keyword: "",
  83. },
  84. });
  85. const statusData = ref([
  86. {
  87. label: "草稿",
  88. value: 0,
  89. },
  90. {
  91. label: "审批中",
  92. value: 10,
  93. },
  94. {
  95. label: "驳回",
  96. value: 20,
  97. },
  98. {
  99. label: "通过",
  100. value: 30,
  101. },
  102. {
  103. label: "终止",
  104. value: 99,
  105. },
  106. ]);
  107. const { proxy } = getCurrentInstance();
  108. const getStatus = (row) => {
  109. const current = statusData.value.find((x) => x.value == row.status);
  110. if (current) return current.label;
  111. };
  112. const getData = () => {
  113. loading.value = true;
  114. proxy.post("/saleQuotation/page", sourceList.value.pagination).then((res) => {
  115. sourceList.value.data = res.rows;
  116. sourceList.value.pagination.total = res.total;
  117. setTimeout(() => {
  118. loading.value = false;
  119. }, 200);
  120. });
  121. };
  122. const handleCurrentChange = (val) => {
  123. sourceList.value.pagination.pageNum = val;
  124. getData();
  125. };
  126. getData();
  127. onMounted(() => {});
  128. const handleMakeNew = () => {
  129. proxy.$router.replace({
  130. path: "/platform_manage/process/processApproval",
  131. query: {
  132. flowKey: "sale_quotation_flow",
  133. flowName: "报价审批流程",
  134. random: proxy.random(),
  135. },
  136. });
  137. };
  138. </script>
  139. <style lang="scss" scoped>
  140. * {
  141. font-size: 12px;
  142. }
  143. .el-button {
  144. padding: 0px;
  145. }
  146. .btn {
  147. width: 100%;
  148. border-radius: 10px;
  149. padding: 6px 10px;
  150. height: 24px;
  151. }
  152. .el-pagination {
  153. padding-left: 30px;
  154. }
  155. :deep(.el-pagination button, .el-pager li) {
  156. font-size: 12px;
  157. }
  158. :deep(.el-table .el-table__cell) {
  159. padding: 2px 0px;
  160. }
  161. </style>