CheckContract.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <!-- 待审核合同 -->
  2. <template>
  3. <ContentWrap>
  4. <div class="pb-5 text-xl">待审核合同</div>
  5. <!-- 搜索工作栏 -->
  6. <el-form
  7. ref="queryFormRef"
  8. :inline="true"
  9. :model="queryParams"
  10. class="-mb-15px"
  11. label-width="68px"
  12. >
  13. <el-form-item label="合同状态" prop="auditStatus">
  14. <el-select
  15. v-model="queryParams.auditStatus"
  16. class="!w-240px"
  17. placeholder="状态"
  18. @change="handleQuery"
  19. >
  20. <el-option
  21. v-for="(option, index) in AUDIT_STATUS"
  22. :label="option.label"
  23. :value="option.value"
  24. :key="index"
  25. />
  26. </el-select>
  27. </el-form-item>
  28. </el-form>
  29. </ContentWrap>
  30. <ContentWrap>
  31. <el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
  32. <el-table-column align="center" fixed="left" label="合同编号" prop="no" width="130" />
  33. <el-table-column align="center" label="合同名称" prop="name" width="130" />
  34. <el-table-column align="center" label="客户名称" prop="customerName" width="120">
  35. <template #default="scope">
  36. <el-link
  37. :underline="false"
  38. type="primary"
  39. @click="openCustomerDetail(scope.row.customerId)"
  40. >
  41. {{ scope.row.customerName }}
  42. </el-link>
  43. </template>
  44. </el-table-column>
  45. <!-- TODO @puhui999:做了商机详情后,可以把这个超链接加上 -->
  46. <el-table-column align="center" label="商机名称" prop="businessName" width="130" />
  47. <el-table-column
  48. align="center"
  49. label="下单时间"
  50. prop="orderDate"
  51. width="120"
  52. :formatter="dateFormatter2"
  53. />
  54. <el-table-column
  55. align="center"
  56. label="合同金额"
  57. prop="price"
  58. width="130"
  59. :formatter="fenToYuanFormat"
  60. />
  61. <el-table-column
  62. align="center"
  63. label="合同开始时间"
  64. prop="startTime"
  65. width="120"
  66. :formatter="dateFormatter2"
  67. />
  68. <el-table-column
  69. align="center"
  70. label="合同结束时间"
  71. prop="endTime"
  72. width="120"
  73. :formatter="dateFormatter2"
  74. />
  75. <el-table-column align="center" label="客户签约人" prop="contactName" width="130">
  76. <template #default="scope">
  77. <el-link
  78. :underline="false"
  79. type="primary"
  80. @click="openContactDetail(scope.row.contactId)"
  81. >
  82. {{ scope.row.contactName }}
  83. </el-link>
  84. </template>
  85. </el-table-column>
  86. <el-table-column align="center" label="公司签约人" prop="signUserName" width="130" />
  87. <el-table-column align="center" label="备注" prop="remark" width="130" />
  88. <!-- TODO @puhui999:后续可加 【已收款金额】、【未收款金额】 -->
  89. <el-table-column align="center" label="负责人" prop="ownerUserName" width="120" />
  90. <el-table-column align="center" label="创建人" prop="creatorName" width="120" />
  91. <el-table-column
  92. :formatter="dateFormatter"
  93. align="center"
  94. label="更新时间"
  95. prop="updateTime"
  96. width="180px"
  97. />
  98. <el-table-column
  99. :formatter="dateFormatter"
  100. align="center"
  101. label="创建时间"
  102. prop="createTime"
  103. width="180px"
  104. />
  105. <el-table-column align="center" fixed="right" label="合同状态" prop="auditStatus" width="120">
  106. <template #default="scope">
  107. <dict-tag :type="DICT_TYPE.CRM_AUDIT_STATUS" :value="scope.row.auditStatus" />
  108. </template>
  109. </el-table-column>
  110. </el-table>
  111. <!-- 分页 -->
  112. <Pagination
  113. v-model:limit="queryParams.pageSize"
  114. v-model:page="queryParams.pageNo"
  115. :total="total"
  116. @pagination="getList"
  117. />
  118. </ContentWrap>
  119. </template>
  120. <script setup lang="ts" name="CheckContract">
  121. import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
  122. import * as ContractApi from '@/api/crm/contract'
  123. import { fenToYuanFormat } from '@/utils/formatter'
  124. import { DICT_TYPE } from '@/utils/dict'
  125. import { AUDIT_STATUS } from './common'
  126. const { push } = useRouter() // 路由
  127. const loading = ref(true) // 列表的加载中
  128. const total = ref(0) // 列表的总页数
  129. const list = ref([]) // 列表的数据
  130. const queryParams = reactive({
  131. pageNo: 1,
  132. pageSize: 10,
  133. auditStatus: 20
  134. })
  135. const queryFormRef = ref() // 搜索的表单
  136. /** 查询列表 */
  137. const getList = async () => {
  138. loading.value = true
  139. try {
  140. const data = await ContractApi.getContractPage(queryParams)
  141. list.value = data.list
  142. total.value = data.total
  143. } finally {
  144. loading.value = false
  145. }
  146. }
  147. /** 搜索按钮操作 */
  148. const handleQuery = () => {
  149. queryParams.pageNo = 1
  150. getList()
  151. }
  152. /** 打开客户详情 */
  153. const openCustomerDetail = (id: number) => {
  154. push({ name: 'CrmCustomerDetail', params: { id } })
  155. }
  156. /** 打开联系人详情 */
  157. const openContactDetail = (id: number) => {
  158. push({ name: 'CrmContactDetail', params: { id } })
  159. }
  160. /** 初始化 **/
  161. onMounted(() => {
  162. getList()
  163. })
  164. </script>
  165. <style scoped></style>