ContractAuditList.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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="180" />
  33. <el-table-column align="center" fixed="left" label="合同名称" prop="name" width="160">
  34. <template #default="scope">
  35. <el-link :underline="false" type="primary" @click="openDetail(scope.row.id)">
  36. {{ scope.row.name }}
  37. </el-link>
  38. </template>
  39. </el-table-column>
  40. <el-table-column align="center" label="客户名称" prop="customerName" width="120">
  41. <template #default="scope">
  42. <el-link
  43. :underline="false"
  44. type="primary"
  45. @click="openCustomerDetail(scope.row.customerId)"
  46. >
  47. {{ scope.row.customerName }}
  48. </el-link>
  49. </template>
  50. </el-table-column>
  51. <el-table-column align="center" label="商机名称" prop="businessName" width="130">
  52. <template #default="scope">
  53. <el-link
  54. :underline="false"
  55. type="primary"
  56. @click="openBusinessDetail(scope.row.businessId)"
  57. >
  58. {{ scope.row.businessName }}
  59. </el-link>
  60. </template>
  61. </el-table-column>
  62. <el-table-column
  63. align="center"
  64. label="合同金额(元)"
  65. prop="totalPrice"
  66. width="140"
  67. :formatter="erpPriceTableColumnFormatter"
  68. />
  69. <el-table-column
  70. align="center"
  71. label="下单时间"
  72. prop="orderDate"
  73. width="120"
  74. :formatter="dateFormatter2"
  75. />
  76. <el-table-column
  77. align="center"
  78. label="合同开始时间"
  79. prop="startTime"
  80. width="120"
  81. :formatter="dateFormatter2"
  82. />
  83. <el-table-column
  84. align="center"
  85. label="合同结束时间"
  86. prop="endTime"
  87. width="120"
  88. :formatter="dateFormatter2"
  89. />
  90. <el-table-column align="center" label="客户签约人" prop="contactName" width="130">
  91. <template #default="scope">
  92. <el-link
  93. :underline="false"
  94. type="primary"
  95. @click="openContactDetail(scope.row.signContactId)"
  96. >
  97. {{ scope.row.signContactName }}
  98. </el-link>
  99. </template>
  100. </el-table-column>
  101. <el-table-column align="center" label="公司签约人" prop="signUserName" width="130" />
  102. <el-table-column align="center" label="备注" prop="remark" width="200" />
  103. <!-- TODO @puhui999:后续可加 【已收款金额】、【未收款金额】 -->
  104. <el-table-column
  105. :formatter="dateFormatter"
  106. align="center"
  107. label="最后跟进时间"
  108. prop="contactLastTime"
  109. width="180px"
  110. />
  111. <el-table-column align="center" label="负责人" prop="ownerUserName" width="120" />
  112. <el-table-column align="center" label="所属部门" prop="ownerUserDeptName" width="100px" />
  113. <el-table-column
  114. :formatter="dateFormatter"
  115. align="center"
  116. label="更新时间"
  117. prop="updateTime"
  118. width="180px"
  119. />
  120. <el-table-column
  121. :formatter="dateFormatter"
  122. align="center"
  123. label="创建时间"
  124. prop="createTime"
  125. width="180px"
  126. />
  127. <el-table-column align="center" label="创建人" prop="creatorName" width="120" />
  128. <el-table-column align="center" fixed="right" label="合同状态" prop="auditStatus" width="120">
  129. <template #default="scope">
  130. <dict-tag :type="DICT_TYPE.CRM_AUDIT_STATUS" :value="scope.row.auditStatus" />
  131. </template>
  132. </el-table-column>
  133. <el-table-column fixed="right" label="操作" width="90">
  134. <template #default="scope">
  135. <el-button
  136. link
  137. v-hasPermi="['crm:contract:update']"
  138. type="primary"
  139. @click="handleProcessDetail(scope.row)"
  140. >
  141. 查看审批
  142. </el-button>
  143. </template>
  144. </el-table-column>
  145. </el-table>
  146. <!-- 分页 -->
  147. <Pagination
  148. v-model:limit="queryParams.pageSize"
  149. v-model:page="queryParams.pageNo"
  150. :total="total"
  151. @pagination="getList"
  152. />
  153. </ContentWrap>
  154. </template>
  155. <script setup lang="ts" name="CheckContract">
  156. import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
  157. import * as ContractApi from '@/api/crm/contract'
  158. import { DICT_TYPE } from '@/utils/dict'
  159. import { AUDIT_STATUS } from './common'
  160. import { erpPriceTableColumnFormatter } from '@/utils'
  161. const loading = ref(true) // 列表的加载中
  162. const total = ref(0) // 列表的总页数
  163. const list = ref([]) // 列表的数据
  164. const queryParams = reactive({
  165. pageNo: 1,
  166. pageSize: 10,
  167. sceneType: 1, // 我负责的
  168. auditStatus: 10
  169. })
  170. const queryFormRef = ref() // 搜索的表单
  171. /** 查询列表 */
  172. const getList = async () => {
  173. loading.value = true
  174. try {
  175. const data = await ContractApi.getContractPage(queryParams)
  176. list.value = data.list
  177. total.value = data.total
  178. } finally {
  179. loading.value = false
  180. }
  181. }
  182. /** 搜索按钮操作 */
  183. const handleQuery = () => {
  184. queryParams.pageNo = 1
  185. getList()
  186. }
  187. /** 查看审批 */
  188. const handleProcessDetail = (row: ContractApi.ContractVO) => {
  189. push({ name: 'BpmProcessInstanceDetail', query: { id: row.processInstanceId } })
  190. }
  191. /** 打开合同详情 */
  192. const { push } = useRouter()
  193. const openDetail = (id: number) => {
  194. push({ name: 'CrmContractDetail', params: { id } })
  195. }
  196. /** 打开客户详情 */
  197. const openCustomerDetail = (id: number) => {
  198. push({ name: 'CrmCustomerDetail', params: { id } })
  199. }
  200. /** 打开联系人详情 */
  201. const openContactDetail = (id: number) => {
  202. push({ name: 'CrmContactDetail', params: { id } })
  203. }
  204. /** 打开商机详情 */
  205. const openBusinessDetail = (id: number) => {
  206. push({ name: 'CrmBusinessDetail', params: { id } })
  207. }
  208. /** 激活时 */
  209. onActivated(async () => {
  210. await getList()
  211. })
  212. /** 初始化 **/
  213. onMounted(() => {
  214. getList()
  215. })
  216. </script>
  217. <style scoped></style>