pi.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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, index) in statusData"
  24. :key="index"
  25. :value="item.value"
  26. :label="item.label"
  27. ></el-option>
  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. },
  83. });
  84. const statusData = ref([
  85. {
  86. label: "草稿",
  87. value: 0,
  88. },
  89. {
  90. label: "审批中",
  91. value: 10,
  92. },
  93. {
  94. label: "驳回",
  95. value: 20,
  96. },
  97. {
  98. label: "通过",
  99. value: 30,
  100. },
  101. {
  102. label: "终止",
  103. value: 99,
  104. },
  105. ]);
  106. const { proxy } = getCurrentInstance();
  107. const getStatus = (row) => {
  108. const current = statusData.value.find((x) => x.value == row.status);
  109. if (current) return current.label;
  110. };
  111. const getData = () => {
  112. loading.value = true;
  113. proxy.post("/contract/page", sourceList.value.pagination).then((res) => {
  114. sourceList.value.data = res.rows;
  115. sourceList.value.pagination.total = res.total;
  116. setTimeout(() => {
  117. loading.value = false;
  118. }, 200);
  119. });
  120. };
  121. const handleCurrentChange = (val) => {
  122. sourceList.value.pagination.pageNum = val;
  123. getData();
  124. };
  125. getData();
  126. onMounted(() => {});
  127. const handleMakeNew = () => {
  128. proxy.$router.replace({
  129. path: "/platform_manage/process/processApproval",
  130. query: {
  131. flowKey: "contract_flow",
  132. flowName: "销售合同审批流程",
  133. random: proxy.random(),
  134. },
  135. });
  136. };
  137. </script>
  138. <style lang="scss" scoped>
  139. * {
  140. font-size: 12px;
  141. }
  142. .el-button {
  143. padding: 0px;
  144. }
  145. .btn {
  146. width: 100%;
  147. border-radius: 10px;
  148. padding: 6px 10px;
  149. height: 24px;
  150. }
  151. .el-pagination {
  152. padding-left: 30px;
  153. }
  154. :deep(.el-pagination button, .el-pager li) {
  155. font-size: 12px;
  156. }
  157. :deep(.el-table .el-table__cell) {
  158. padding: 2px 0px;
  159. }
  160. </style>