ContractAuditList.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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. <el-table-column
  104. align="center"
  105. label="已回款金额(元)"
  106. prop="totalReceivablePrice"
  107. width="140"
  108. :formatter="erpPriceTableColumnFormatter"
  109. />
  110. <el-table-column
  111. align="center"
  112. label="未回款金额(元)"
  113. prop="totalReceivablePrice"
  114. width="140"
  115. :formatter="erpPriceTableColumnFormatter"
  116. >
  117. <template #default="scope">
  118. {{ erpPriceInputFormatter(scope.row.totalPrice - scope.row.totalReceivablePrice) }}
  119. </template>
  120. </el-table-column>
  121. <el-table-column
  122. :formatter="dateFormatter"
  123. align="center"
  124. label="最后跟进时间"
  125. prop="contactLastTime"
  126. width="180px"
  127. />
  128. <el-table-column align="center" label="负责人" prop="ownerUserName" width="120" />
  129. <el-table-column align="center" label="所属部门" prop="ownerUserDeptName" width="100px" />
  130. <el-table-column
  131. :formatter="dateFormatter"
  132. align="center"
  133. label="更新时间"
  134. prop="updateTime"
  135. width="180px"
  136. />
  137. <el-table-column
  138. :formatter="dateFormatter"
  139. align="center"
  140. label="创建时间"
  141. prop="createTime"
  142. width="180px"
  143. />
  144. <el-table-column align="center" label="创建人" prop="creatorName" width="120" />
  145. <el-table-column align="center" fixed="right" label="合同状态" prop="auditStatus" width="120">
  146. <template #default="scope">
  147. <dict-tag :type="DICT_TYPE.CRM_AUDIT_STATUS" :value="scope.row.auditStatus" />
  148. </template>
  149. </el-table-column>
  150. <el-table-column fixed="right" label="操作" width="90">
  151. <template #default="scope">
  152. <el-button
  153. link
  154. v-hasPermi="['crm:contract:update']"
  155. type="primary"
  156. @click="handleProcessDetail(scope.row)"
  157. >
  158. 查看审批
  159. </el-button>
  160. </template>
  161. </el-table-column>
  162. </el-table>
  163. <!-- 分页 -->
  164. <Pagination
  165. v-model:limit="queryParams.pageSize"
  166. v-model:page="queryParams.pageNo"
  167. :total="total"
  168. @pagination="getList"
  169. />
  170. </ContentWrap>
  171. </template>
  172. <script setup lang="ts" name="CheckContract">
  173. import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
  174. import * as ContractApi from '@/api/crm/contract'
  175. import { DICT_TYPE } from '@/utils/dict'
  176. import { AUDIT_STATUS } from './common'
  177. import { erpPriceInputFormatter, erpPriceTableColumnFormatter } from '@/utils'
  178. const loading = ref(true) // 列表的加载中
  179. const total = ref(0) // 列表的总页数
  180. const list = ref([]) // 列表的数据
  181. const queryParams = reactive({
  182. pageNo: 1,
  183. pageSize: 10,
  184. sceneType: 1, // 我负责的
  185. auditStatus: 10
  186. })
  187. const queryFormRef = ref() // 搜索的表单
  188. /** 查询列表 */
  189. const getList = async () => {
  190. loading.value = true
  191. try {
  192. const data = await ContractApi.getContractPage(queryParams)
  193. list.value = data.list
  194. total.value = data.total
  195. } finally {
  196. loading.value = false
  197. }
  198. }
  199. /** 搜索按钮操作 */
  200. const handleQuery = () => {
  201. queryParams.pageNo = 1
  202. getList()
  203. }
  204. /** 查看审批 */
  205. const handleProcessDetail = (row: ContractApi.ContractVO) => {
  206. push({ name: 'BpmProcessInstanceDetail', query: { id: row.processInstanceId } })
  207. }
  208. /** 打开合同详情 */
  209. const { push } = useRouter()
  210. const openDetail = (id: number) => {
  211. push({ name: 'CrmContractDetail', params: { id } })
  212. }
  213. /** 打开客户详情 */
  214. const openCustomerDetail = (id: number) => {
  215. push({ name: 'CrmCustomerDetail', params: { id } })
  216. }
  217. /** 打开联系人详情 */
  218. const openContactDetail = (id: number) => {
  219. push({ name: 'CrmContactDetail', params: { id } })
  220. }
  221. /** 打开商机详情 */
  222. const openBusinessDetail = (id: number) => {
  223. push({ name: 'CrmBusinessDetail', params: { id } })
  224. }
  225. /** 激活时 */
  226. onActivated(async () => {
  227. await getList()
  228. })
  229. /** 初始化 **/
  230. onMounted(() => {
  231. getList()
  232. })
  233. </script>
  234. <style scoped></style>