Skip to content

Commit 361c06b

Browse files
committed
feat: crm-backlog 待审核合同
1 parent e033793 commit 361c06b

File tree

2 files changed

+173
-7
lines changed

2 files changed

+173
-7
lines changed
Lines changed: 167 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,175 @@
11
<!-- 待审核合同 -->
2-
<!-- TODO: 后续再统一改名字 -->
32
<template>
4-
<div>
5-
TODO: 待审核合同
6-
</div>
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 CONTRACT_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+
31+
<ContentWrap>
32+
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
33+
<el-table-column align="center" fixed="left" label="合同编号" prop="no" width="130" />
34+
<el-table-column align="center" label="合同名称" prop="name" width="130" />
35+
<el-table-column align="center" label="客户名称" prop="customerName" width="120">
36+
<template #default="scope">
37+
<el-link
38+
:underline="false"
39+
type="primary"
40+
@click="openCustomerDetail(scope.row.customerId)"
41+
>
42+
{{ scope.row.customerName }}
43+
</el-link>
44+
</template>
45+
</el-table-column>
46+
<!-- TODO @puhui999:做了商机详情后,可以把这个超链接加上 -->
47+
<el-table-column align="center" label="商机名称" prop="businessName" width="130" />
48+
<el-table-column
49+
align="center"
50+
label="下单时间"
51+
prop="orderDate"
52+
width="120"
53+
:formatter="dateFormatter2"
54+
/>
55+
<el-table-column
56+
align="center"
57+
label="合同金额"
58+
prop="price"
59+
width="130"
60+
:formatter="fenToYuanFormat"
61+
/>
62+
<el-table-column
63+
align="center"
64+
label="合同开始时间"
65+
prop="startTime"
66+
width="120"
67+
:formatter="dateFormatter2"
68+
/>
69+
<el-table-column
70+
align="center"
71+
label="合同结束时间"
72+
prop="endTime"
73+
width="120"
74+
:formatter="dateFormatter2"
75+
/>
76+
<el-table-column align="center" label="客户签约人" prop="contactName" width="130">
77+
<template #default="scope">
78+
<el-link
79+
:underline="false"
80+
type="primary"
81+
@click="openContactDetail(scope.row.contactId)"
82+
>
83+
{{ scope.row.contactName }}
84+
</el-link>
85+
</template>
86+
</el-table-column>
87+
<el-table-column align="center" label="公司签约人" prop="signUserName" width="130" />
88+
<el-table-column align="center" label="备注" prop="remark" width="130" />
89+
<!-- TODO @puhui999:后续可加 【已收款金额】、【未收款金额】 -->
90+
<el-table-column align="center" label="负责人" prop="ownerUserName" width="120" />
91+
<el-table-column align="center" label="创建人" prop="creatorName" width="120" />
92+
<el-table-column
93+
:formatter="dateFormatter"
94+
align="center"
95+
label="更新时间"
96+
prop="updateTime"
97+
width="180px"
98+
/>
99+
<el-table-column
100+
:formatter="dateFormatter"
101+
align="center"
102+
label="创建时间"
103+
prop="createTime"
104+
width="180px"
105+
/>
106+
<el-table-column align="center" fixed="right" label="合同状态" prop="auditStatus" width="120">
107+
<template #default="scope">
108+
<dict-tag :type="DICT_TYPE.CRM_AUDIT_STATUS" :value="scope.row.auditStatus" />
109+
</template>
110+
</el-table-column>
111+
</el-table>
112+
<!-- 分页 -->
113+
<Pagination
114+
v-model:limit="queryParams.pageSize"
115+
v-model:page="queryParams.pageNo"
116+
:total="total"
117+
@pagination="getList"
118+
/>
119+
</ContentWrap>
7120
</template>
8121

9122
<script setup lang="ts" name="CheckContract">
123+
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
124+
import * as ContractApi from '@/api/crm/contract'
125+
import { fenToYuanFormat } from '@/utils/formatter'
126+
import { DICT_TYPE } from '@/utils/dict'
127+
import { CONTRACT_AUDIT_STATUS } from './common'
10128
11-
</script>
129+
const { push } = useRouter() // 路由
130+
131+
const loading = ref(true) // 列表的加载中
132+
const total = ref(0) // 列表的总页数
133+
const list = ref([]) // 列表的数据
134+
const queryParams = reactive({
135+
pageNo: 1,
136+
pageSize: 10,
137+
auditStatus: 20
138+
})
139+
const queryFormRef = ref() // 搜索的表单
140+
141+
/** 查询列表 */
142+
const getList = async () => {
143+
loading.value = true
144+
try {
145+
const data = await ContractApi.getContractPage(queryParams)
146+
list.value = data.list
147+
total.value = data.total
148+
} finally {
149+
loading.value = false
150+
}
151+
}
12152
13-
<style scoped>
153+
/** 搜索按钮操作 */
154+
const handleQuery = () => {
155+
queryParams.pageNo = 1
156+
getList()
157+
}
158+
159+
/** 打开客户详情 */
160+
const openCustomerDetail = (id: number) => {
161+
push({ name: 'CrmCustomerDetail', params: { id } })
162+
}
163+
164+
/** 打开联系人详情 */
165+
const openContactDetail = (id: number) => {
166+
push({ name: 'CrmContactDetail', params: { id } })
167+
}
168+
169+
/** 初始化 **/
170+
onMounted(() => {
171+
getList()
172+
})
173+
</script>
14174

15-
</style>
175+
<style scoped></style>

src/views/crm/backlog/tables/common.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,9 @@ export const CONTACT_STATUS = [
1717
{ label: '已逾期', value: 2 },
1818
{ label: '已联系', value: 3 }
1919
]
20+
21+
/** 合同审批状态 */
22+
export const CONTRACT_AUDIT_STATUS = [
23+
{ label: '已审批', value: 20 },
24+
{ label: '待审批', value: 10 }
25+
]

0 commit comments

Comments
 (0)