ContractRemindList.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <!-- 即将到期的合同 -->
  2. <template>
  3. <ContentWrap>
  4. <div class="pb-5 text-xl"> 即将到期的合同 </div>
  5. <!-- 搜索工作栏 -->
  6. <el-form
  7. class="-mb-15px"
  8. :model="queryParams"
  9. ref="queryFormRef"
  10. :inline="true"
  11. label-width="68px"
  12. >
  13. <el-form-item label="到期状态" prop="expiryType">
  14. <el-select
  15. v-model="queryParams.expiryType"
  16. class="!w-240px"
  17. placeholder="状态"
  18. @change="handleQuery"
  19. >
  20. <el-option
  21. v-for="(option, index) in CONTRACT_EXPIRY_TYPE"
  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="EndContract">
  173. import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
  174. import * as ContractApi from '@/api/crm/contract'
  175. import { fenToYuanFormat } from '@/utils/formatter'
  176. import { DICT_TYPE } from '@/utils/dict'
  177. import { CONTRACT_EXPIRY_TYPE } from './common'
  178. import { erpPriceInputFormatter, erpPriceTableColumnFormatter } from '@/utils'
  179. const loading = ref(true) // 列表的加载中
  180. const total = ref(0) // 列表的总页数
  181. const list = ref([]) // 列表的数据
  182. const queryParams = reactive({
  183. pageNo: 1,
  184. pageSize: 10,
  185. sceneType: '1', // 自己负责的
  186. expiryType: 1
  187. })
  188. const queryFormRef = ref() // 搜索的表单
  189. /** 查询列表 */
  190. const getList = async () => {
  191. loading.value = true
  192. try {
  193. const data = await ContractApi.getContractPage(queryParams)
  194. list.value = data.list
  195. total.value = data.total
  196. } finally {
  197. loading.value = false
  198. }
  199. }
  200. /** 搜索按钮操作 */
  201. const handleQuery = () => {
  202. queryParams.pageNo = 1
  203. getList()
  204. }
  205. /** 查看审批 */
  206. const handleProcessDetail = (row: ContractApi.ContractVO) => {
  207. push({ name: 'BpmProcessInstanceDetail', query: { id: row.processInstanceId } })
  208. }
  209. /** 打开合同详情 */
  210. const { push } = useRouter()
  211. const openDetail = (id: number) => {
  212. push({ name: 'CrmContractDetail', params: { id } })
  213. }
  214. /** 打开客户详情 */
  215. const openCustomerDetail = (id: number) => {
  216. push({ name: 'CrmCustomerDetail', params: { id } })
  217. }
  218. /** 打开联系人详情 */
  219. const openContactDetail = (id: number) => {
  220. push({ name: 'CrmContactDetail', params: { id } })
  221. }
  222. /** 打开商机详情 */
  223. const openBusinessDetail = (id: number) => {
  224. push({ name: 'CrmBusinessDetail', params: { id } })
  225. }
  226. /** 激活时 */
  227. onActivated(async () => {
  228. await getList()
  229. })
  230. /** 初始化 **/
  231. onMounted(() => {
  232. getList()
  233. })
  234. </script>