|
|
|
1
|
+<template>
|
|
|
|
2
|
+ <view class="page">
|
|
|
|
3
|
+ <scroll-view class="scroll" scroll-y>
|
|
|
|
4
|
+ <uni-list>
|
|
|
|
5
|
+ <uni-list-item class="select-item" :class="form.serialNumber ? 'is-filled' : 'is-empty'">
|
|
|
|
6
|
+ <template v-slot:body>
|
|
|
|
7
|
+ <view class="item-title"><text class="required">*</text><text>编号</text></view>
|
|
|
|
8
|
+ </template>
|
|
|
|
9
|
+ <template v-slot:footer>
|
|
|
|
10
|
+ <view class="serial-number-row">
|
|
|
|
11
|
+ <uni-easyinput v-model="form.serialNumber" placeholder="自动生成编号" :inputBorder="false" disabled />
|
|
|
|
12
|
+ <button class="generate-btn" @click="loadSerialNumber">点此生成</button>
|
|
|
|
13
|
+ </view>
|
|
|
|
14
|
+ </template>
|
|
|
|
15
|
+ </uni-list-item>
|
|
|
|
16
|
+
|
|
|
|
17
|
+ <uni-list-item title="区域">
|
|
|
|
18
|
+ <template v-slot:footer>
|
|
|
|
19
|
+ <uni-easyinput v-model="form.region" placeholder="请输入区域" :inputBorder="false" />
|
|
|
|
20
|
+ </template>
|
|
|
|
21
|
+ </uni-list-item>
|
|
|
|
22
|
+ <uni-list-item title="客户简称">
|
|
|
|
23
|
+ <template v-slot:footer>
|
|
|
|
24
|
+ <uni-easyinput v-model="form.customerShortName" placeholder="请输入客户简称" :inputBorder="false" />
|
|
|
|
25
|
+ </template>
|
|
|
|
26
|
+ </uni-list-item>
|
|
|
|
27
|
+
|
|
|
|
28
|
+ <uni-list-item class="select-item" :class="form.enterpriseType ? 'is-filled' : 'is-empty'" clickable
|
|
|
|
29
|
+ @click="openSheet('enterpriseType')" :rightText="displayLabel('enterpriseTypeName')" showArrow>
|
|
|
|
30
|
+ <template v-slot:body>
|
|
|
|
31
|
+ <view class="item-title"><text>企业类型</text></view>
|
|
|
|
32
|
+ </template>
|
|
|
|
33
|
+ </uni-list-item>
|
|
|
|
34
|
+
|
|
|
|
35
|
+ <uni-list-item class="mgb10" title="登记日期">
|
|
|
|
36
|
+ <template v-slot:footer>
|
|
|
|
37
|
+ <uni-datetime-picker type="date" v-model="form.registerDate" />
|
|
|
|
38
|
+ </template>
|
|
|
|
39
|
+ </uni-list-item>
|
|
|
|
40
|
+
|
|
|
|
41
|
+ <view class="title-header">
|
|
|
|
42
|
+ <image class="title-header_icon" src="/static/images/title.png" />
|
|
|
|
43
|
+ <span>基础资料</span>
|
|
|
|
44
|
+ </view>
|
|
|
|
45
|
+
|
|
|
|
46
|
+ <uni-list-item class="select-item" :class="form.companyId ? 'is-filled' : 'is-empty'" clickable
|
|
|
|
47
|
+ @click="openRelate('companyId')" :rightText="form.companyIdName || '请选择单位名称'" showArrow>
|
|
|
|
48
|
+ <template v-slot:body>
|
|
|
|
49
|
+ <view class="item-title"><text class="required">*</text><text>单位名称</text></view>
|
|
|
|
50
|
+ </template>
|
|
|
|
51
|
+ </uni-list-item>
|
|
|
|
52
|
+
|
|
|
|
53
|
+ <uni-list-item title="企业性质">
|
|
|
|
54
|
+ <template v-slot:footer>
|
|
|
|
55
|
+ <uni-easyinput v-model="form.companyNature" placeholder="请输入企业性质" :inputBorder="false" />
|
|
|
|
56
|
+ </template>
|
|
|
|
57
|
+ </uni-list-item>
|
|
|
|
58
|
+ <uni-list-item title="单位地址">
|
|
|
|
59
|
+ <template v-slot:footer>
|
|
|
|
60
|
+ <uni-easyinput v-model="form.companyAddress" placeholder="请输入单位地址" :inputBorder="false" />
|
|
|
|
61
|
+ </template>
|
|
|
|
62
|
+ </uni-list-item>
|
|
|
|
63
|
+ <uni-list-item title="注册资本(万元)">
|
|
|
|
64
|
+ <template v-slot:footer>
|
|
|
|
65
|
+ <uni-easyinput type="number" v-model="form.registeredCapital" placeholder="请输入注册资本" :inputBorder="false" />
|
|
|
|
66
|
+ </template>
|
|
|
|
67
|
+ </uni-list-item>
|
|
|
|
68
|
+ <uni-list-item title="账号">
|
|
|
|
69
|
+ <template v-slot:footer>
|
|
|
|
70
|
+ <uni-easyinput v-model="form.bankAccount" placeholder="请输入账号" :inputBorder="false" />
|
|
|
|
71
|
+ </template>
|
|
|
|
72
|
+ </uni-list-item>
|
|
|
|
73
|
+ <uni-list-item title="账开户行">
|
|
|
|
74
|
+ <template v-slot:footer>
|
|
|
|
75
|
+ <uni-easyinput v-model="form.bankName" placeholder="请输入账开户行" :inputBorder="false" />
|
|
|
|
76
|
+ </template>
|
|
|
|
77
|
+ </uni-list-item>
|
|
|
|
78
|
+ <uni-list-item title="税号">
|
|
|
|
79
|
+ <template v-slot:footer>
|
|
|
|
80
|
+ <uni-easyinput v-model="form.taxNumber" placeholder="请输入税号" :inputBorder="false" />
|
|
|
|
81
|
+ </template>
|
|
|
|
82
|
+ </uni-list-item>
|
|
|
|
83
|
+ <uni-list-item title="注册时间">
|
|
|
|
84
|
+ <template v-slot:footer>
|
|
|
|
85
|
+ <uni-datetime-picker type="date" v-model="form.registrationTime" />
|
|
|
|
86
|
+ </template>
|
|
|
|
87
|
+ </uni-list-item>
|
|
|
|
88
|
+ <uni-list-item title="经营年限">
|
|
|
|
89
|
+ <template v-slot:footer>
|
|
|
|
90
|
+ <uni-easyinput v-model="form.businessYears" placeholder="请输入经营年限" :inputBorder="false" />
|
|
|
|
91
|
+ </template>
|
|
|
|
92
|
+ </uni-list-item>
|
|
|
|
93
|
+ <uni-list-item title="经营范围">
|
|
|
|
94
|
+ <template v-slot:footer>
|
|
|
|
95
|
+ <uni-easyinput type="textarea" v-model="form.businessScope" placeholder="请输入经营范围" :inputBorder="false" />
|
|
|
|
96
|
+ </template>
|
|
|
|
97
|
+ </uni-list-item>
|
|
|
|
98
|
+
|
|
|
|
99
|
+ <uni-list-item title="经营场地属性">
|
|
|
|
100
|
+ <template v-slot:footer>
|
|
|
|
101
|
+ <uni-easyinput v-model="form.businessProperty" placeholder="请输入经营场地属性" :inputBorder="false" />
|
|
|
|
102
|
+ </template>
|
|
|
|
103
|
+ </uni-list-item>
|
|
|
|
104
|
+ <uni-list-item title="占地面积(平方米)">
|
|
|
|
105
|
+ <template v-slot:footer>
|
|
|
|
106
|
+ <uni-easyinput v-model="form.landArea" placeholder="请输入占地面积" :inputBorder="false" />
|
|
|
|
107
|
+ </template>
|
|
|
|
108
|
+ </uni-list-item>
|
|
|
|
109
|
+ <uni-list-item title="仓储条件">
|
|
|
|
110
|
+ <template v-slot:footer>
|
|
|
|
111
|
+ <uni-easyinput v-model="form.storageConditions" placeholder="请输入仓储条件" :inputBorder="false" />
|
|
|
|
112
|
+ </template>
|
|
|
|
113
|
+ </uni-list-item>
|
|
|
|
114
|
+ <uni-list-item title="员工人数">
|
|
|
|
115
|
+ <template v-slot:footer>
|
|
|
|
116
|
+ <uni-easyinput type="number" v-model="form.employeeCount" placeholder="请输入员工人数" :inputBorder="false" />
|
|
|
|
117
|
+ </template>
|
|
|
|
118
|
+ </uni-list-item>
|
|
|
|
119
|
+ <uni-list-item title="设备属性">
|
|
|
|
120
|
+ <template v-slot:footer>
|
|
|
|
121
|
+ <uni-easyinput v-model="form.equipmentAttributes" placeholder="请输入设备属性" :inputBorder="false" />
|
|
|
|
122
|
+ </template>
|
|
|
|
123
|
+ </uni-list-item>
|
|
|
|
124
|
+ <uni-list-item title="资产评估">
|
|
|
|
125
|
+ <template v-slot:footer>
|
|
|
|
126
|
+ <uni-easyinput v-model="form.assetEvaluation" placeholder="请输入资产评估" :inputBorder="false" />
|
|
|
|
127
|
+ </template>
|
|
|
|
128
|
+ </uni-list-item>
|
|
|
|
129
|
+ <uni-list-item title="上年度销售额">
|
|
|
|
130
|
+ <template v-slot:footer>
|
|
|
|
131
|
+ <uni-easyinput v-model="form.lastYearSales" placeholder="请输入上年度销售额" :inputBorder="false" />
|
|
|
|
132
|
+ </template>
|
|
|
|
133
|
+ </uni-list-item>
|
|
|
|
134
|
+ <uni-list-item title="月均销量">
|
|
|
|
135
|
+ <template v-slot:footer>
|
|
|
|
136
|
+ <uni-easyinput v-model="form.monthlyAvgSales" placeholder="请输入月均销量" :inputBorder="false" />
|
|
|
|
137
|
+ </template>
|
|
|
|
138
|
+ </uni-list-item>
|
|
|
|
139
|
+ <uni-list-item title="销项发票所开品名与计量单位">
|
|
|
|
140
|
+ <template v-slot:footer>
|
|
|
|
141
|
+ <uni-easyinput v-model="form.invoiceItemUnit" placeholder="请输入品名与计量单位" :inputBorder="false" />
|
|
|
|
142
|
+ </template>
|
|
|
|
143
|
+ </uni-list-item>
|
|
|
|
144
|
+ <uni-list-item title="认证证书">
|
|
|
|
145
|
+ <template v-slot:footer>
|
|
|
|
146
|
+ <uni-easyinput v-model="form.certificationCertificate" placeholder="请输入认证证书" :inputBorder="false" />
|
|
|
|
147
|
+ </template>
|
|
|
|
148
|
+ </uni-list-item>
|
|
|
|
149
|
+ <uni-list-item title="产品与经营范围是否匹配">
|
|
|
|
150
|
+ <template v-slot:footer>
|
|
|
|
151
|
+ <uni-easyinput v-model="form.productMatch" placeholder="请输入是否匹配" :inputBorder="false" />
|
|
|
|
152
|
+ </template>
|
|
|
|
153
|
+ </uni-list-item>
|
|
|
|
154
|
+ <uni-list-item title="主要客户">
|
|
|
|
155
|
+ <template v-slot:footer>
|
|
|
|
156
|
+ <uni-easyinput v-model="form.majorCustomers" placeholder="请输入主要客户" :inputBorder="false" />
|
|
|
|
157
|
+ </template>
|
|
|
|
158
|
+ </uni-list-item>
|
|
|
|
159
|
+ <uni-list-item title="主营项目">
|
|
|
|
160
|
+ <template v-slot:footer>
|
|
|
|
161
|
+ <uni-easyinput v-model="form.mainProjects" placeholder="请输入主营项目" :inputBorder="false" />
|
|
|
|
162
|
+ </template>
|
|
|
|
163
|
+ </uni-list-item>
|
|
|
|
164
|
+ <uni-list-item title="从事行业">
|
|
|
|
165
|
+ <template v-slot:footer>
|
|
|
|
166
|
+ <uni-easyinput v-model="form.industryInvolved" placeholder="请输入从事行业" :inputBorder="false" />
|
|
|
|
167
|
+ </template>
|
|
|
|
168
|
+ </uni-list-item>
|
|
|
|
169
|
+ <uni-list-item title="在该行业中的经验">
|
|
|
|
170
|
+ <template v-slot:footer>
|
|
|
|
171
|
+ <uni-easyinput v-model="form.industryExperience" placeholder="请输入行业经验" :inputBorder="false" />
|
|
|
|
172
|
+ </template>
|
|
|
|
173
|
+ </uni-list-item>
|
|
|
|
174
|
+ <uni-list-item title="是否有经济纠纷等">
|
|
|
|
175
|
+ <template v-slot:footer>
|
|
|
|
176
|
+ <uni-easyinput v-model="form.hasDispute" placeholder="请输入情况" :inputBorder="false" />
|
|
|
|
177
|
+ </template>
|
|
|
|
178
|
+ </uni-list-item>
|
|
|
|
179
|
+
|
|
|
|
180
|
+ <uni-list-item title="与我司合作时间">
|
|
|
|
181
|
+ <template v-slot:footer>
|
|
|
|
182
|
+ <uni-easyinput v-model="form.cooperationStartDate" placeholder="请输入与我司合作时间" :inputBorder="false" />
|
|
|
|
183
|
+ </template>
|
|
|
|
184
|
+ </uni-list-item>
|
|
|
|
185
|
+ <uni-list-item title="月均操作量">
|
|
|
|
186
|
+ <template v-slot:footer>
|
|
|
|
187
|
+ <uni-easyinput v-model="form.monthlyAvgVolume" placeholder="请输入月均操作量" :inputBorder="false" />
|
|
|
|
188
|
+ </template>
|
|
|
|
189
|
+ </uni-list-item>
|
|
|
|
190
|
+ <uni-list-item title="是否口头协议操作">
|
|
|
|
191
|
+ <template v-slot:footer>
|
|
|
|
192
|
+ <uni-easyinput v-model="form.isVerbalAgreement" placeholder="请输入是否口头协议" :inputBorder="false" />
|
|
|
|
193
|
+ </template>
|
|
|
|
194
|
+ </uni-list-item>
|
|
|
|
195
|
+ <uni-list-item title="是否签订其他协议(列举)">
|
|
|
|
196
|
+ <template v-slot:footer>
|
|
|
|
197
|
+ <uni-easyinput v-model="form.otherAgreements" placeholder="请输入其他协议" :inputBorder="false" />
|
|
|
|
198
|
+ </template>
|
|
|
|
199
|
+ </uni-list-item>
|
|
|
|
200
|
+ <uni-list-item title="是否签订长年合同">
|
|
|
|
201
|
+ <template v-slot:footer>
|
|
|
|
202
|
+ <uni-easyinput v-model="form.hasLongTermContract" placeholder="请输入是否签订" :inputBorder="false" />
|
|
|
|
203
|
+ </template>
|
|
|
|
204
|
+ </uni-list-item>
|
|
|
|
205
|
+ <uni-list-item title="合同类型">
|
|
|
|
206
|
+ <template v-slot:footer>
|
|
|
|
207
|
+ <uni-easyinput v-model="form.contractType" placeholder="请输入合同类型" :inputBorder="false" />
|
|
|
|
208
|
+ </template>
|
|
|
|
209
|
+ </uni-list-item>
|
|
|
|
210
|
+ <uni-list-item title="是否有过中断及原因">
|
|
|
|
211
|
+ <template v-slot:footer>
|
|
|
|
212
|
+ <uni-easyinput v-model="form.hasInterruption" placeholder="请输入中断情况" :inputBorder="false" />
|
|
|
|
213
|
+ </template>
|
|
|
|
214
|
+ </uni-list-item>
|
|
|
|
215
|
+
|
|
|
|
216
|
+ <uni-list-item title="结算期限">
|
|
|
|
217
|
+ <template v-slot:footer>
|
|
|
|
218
|
+ <uni-easyinput v-model="form.settlementPeriod" placeholder="请输入结算期限" :inputBorder="false" />
|
|
|
|
219
|
+ </template>
|
|
|
|
220
|
+ </uni-list-item>
|
|
|
|
221
|
+ <uni-list-item title="加工操作方案">
|
|
|
|
222
|
+ <template v-slot:footer>
|
|
|
|
223
|
+ <uni-easyinput v-model="form.materialSupplyPlan" placeholder="请输入加工操作方案" :inputBorder="false" />
|
|
|
|
224
|
+ </template>
|
|
|
|
225
|
+ </uni-list-item>
|
|
|
|
226
|
+ <uni-list-item class="select-item" :class="form.suggestedCategory ? 'is-filled' : 'is-empty'" clickable
|
|
|
|
227
|
+ @click="openSheet('suggestedCategory')" :rightText="displayLabel('suggestedCategoryName')" showArrow>
|
|
|
|
228
|
+ <template v-slot:body>
|
|
|
|
229
|
+ <view class="item-title"><text>建议客户分类</text></view>
|
|
|
|
230
|
+ </template>
|
|
|
|
231
|
+ </uni-list-item>
|
|
|
|
232
|
+ <uni-list-item title="授信额度(万元)">
|
|
|
|
233
|
+ <template v-slot:footer>
|
|
|
|
234
|
+ <uni-easyinput type="number" v-model="form.creditLimit" placeholder="请输入授信额度" :inputBorder="false" />
|
|
|
|
235
|
+ </template>
|
|
|
|
236
|
+ </uni-list-item>
|
|
|
|
237
|
+
|
|
|
|
238
|
+ <uni-list-item class="select-item" :class="form.investigatorName ? 'is-filled' : 'is-empty'" clickable
|
|
|
|
239
|
+ @click="openSheet('investigator')" :rightText="form.investigatorName || '请选择调查人'" showArrow>
|
|
|
|
240
|
+ <template v-slot:body>
|
|
|
|
241
|
+ <view class="item-title"><text>调查人</text></view>
|
|
|
|
242
|
+ </template>
|
|
|
|
243
|
+ </uni-list-item>
|
|
|
|
244
|
+ <uni-list-item title="主管审核">
|
|
|
|
245
|
+ <template v-slot:footer>
|
|
|
|
246
|
+ <uni-easyinput v-model="form.supervisorReviewName" placeholder="" :inputBorder="false" disabled />
|
|
|
|
247
|
+ </template>
|
|
|
|
248
|
+ </uni-list-item>
|
|
|
|
249
|
+
|
|
|
|
250
|
+ <uni-list-item title="年度总销量">
|
|
|
|
251
|
+ <template v-slot:footer>
|
|
|
|
252
|
+ <uni-easyinput v-model="form.annualTotalSales" placeholder="请输入年度总销量" :inputBorder="false" />
|
|
|
|
253
|
+ </template>
|
|
|
|
254
|
+ </uni-list-item>
|
|
|
|
255
|
+ <uni-list-item title="主要行业">
|
|
|
|
256
|
+ <template v-slot:footer>
|
|
|
|
257
|
+ <uni-easyinput v-model="form.mainIndustry" placeholder="请输入主要行业" :inputBorder="false" />
|
|
|
|
258
|
+ </template>
|
|
|
|
259
|
+ </uni-list-item>
|
|
|
|
260
|
+ <uni-list-item title="年度款料概况">
|
|
|
|
261
|
+ <template v-slot:footer>
|
|
|
|
262
|
+ <uni-easyinput v-model="form.annualMaterialOverview" placeholder="请输入年度款料概况" :inputBorder="false" />
|
|
|
|
263
|
+ </template>
|
|
|
|
264
|
+ </uni-list-item>
|
|
|
|
265
|
+
|
|
|
|
266
|
+ <uni-list-item title="公司结算期限">
|
|
|
|
267
|
+ <template v-slot:footer>
|
|
|
|
268
|
+ <uni-easyinput v-model="form.companySettlementPeriod" placeholder="请输入公司结算期限" :inputBorder="false" />
|
|
|
|
269
|
+ </template>
|
|
|
|
270
|
+ </uni-list-item>
|
|
|
|
271
|
+ <uni-list-item title="公司授信额度(万元)">
|
|
|
|
272
|
+ <template v-slot:footer>
|
|
|
|
273
|
+ <uni-easyinput type="number" v-model="form.companyCreditLimit" placeholder="请输入公司授信额度"
|
|
|
|
274
|
+ :inputBorder="false" />
|
|
|
|
275
|
+ </template>
|
|
|
|
276
|
+ </uni-list-item>
|
|
|
|
277
|
+ <uni-list-item title="公司加工操作方案">
|
|
|
|
278
|
+ <template v-slot:footer>
|
|
|
|
279
|
+ <uni-easyinput v-model="form.companyMaterialSupplyPlan" placeholder="请输入公司加工操作方案" :inputBorder="false" />
|
|
|
|
280
|
+ </template>
|
|
|
|
281
|
+ </uni-list-item>
|
|
|
|
282
|
+ <uni-list-item class="select-item" :class="form.companySuggestedCategory ? 'is-filled' : 'is-empty'" clickable
|
|
|
|
283
|
+ @click="openSheet('companySuggestedCategory')" :rightText="displayLabel('companySuggestedCategoryName')"
|
|
|
|
284
|
+ showArrow>
|
|
|
|
285
|
+ <template v-slot:body>
|
|
|
|
286
|
+ <view class="item-title"><text>客户分类</text></view>
|
|
|
|
287
|
+ </template>
|
|
|
|
288
|
+ </uni-list-item>
|
|
|
|
289
|
+ </uni-list>
|
|
|
|
290
|
+ </scroll-view>
|
|
|
|
291
|
+
|
|
|
|
292
|
+ <view class="footer">
|
|
|
|
293
|
+ <button class="btn submit" type="primary" @click="onSubmit">提交</button>
|
|
|
|
294
|
+ </view>
|
|
|
|
295
|
+
|
|
|
|
296
|
+ <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value"
|
|
|
|
297
|
+ @confirm="onSheetConfirm" />
|
|
|
|
298
|
+ <RelateSelectSheet :visible.sync="relate.visible" :title="relate.title" :source="relate.source"
|
|
|
|
299
|
+ :display-fields="relate.display" :multiple="relate.multiple" :row-key="relate.rowKey"
|
|
|
|
300
|
+ :selectedKeys.sync="relate.selectedKeys" @confirm="onRelateConfirm" />
|
|
|
|
301
|
+ </view>
|
|
|
|
302
|
+
|
|
|
|
303
|
+</template>
|
|
|
|
304
|
+
|
|
|
|
305
|
+<script>
|
|
|
|
306
|
+import SingleSelectSheet from '@/components/single-select/index.vue'
|
|
|
|
307
|
+import RelateSelectSheet from '@/components/relate-select/index.vue'
|
|
|
|
308
|
+import { generateCreditCode, getAllUser, getDeptUser, createApi } from '@/api/credit_manage.js'
|
|
|
|
309
|
+import { getDicByCodeApi } from '@/api/base.js'
|
|
|
|
310
|
+
|
|
|
|
311
|
+export default {
|
|
|
|
312
|
+ name: 'CreditManageAdd',
|
|
|
|
313
|
+ components: { SingleSelectSheet, RelateSelectSheet },
|
|
|
|
314
|
+ data() {
|
|
|
|
315
|
+ return {
|
|
|
|
316
|
+ form: {
|
|
|
|
317
|
+ serialNumber: '',
|
|
|
|
318
|
+ region: '',
|
|
|
|
319
|
+ customerShortName: '',
|
|
|
|
320
|
+ enterpriseType: '',
|
|
|
|
321
|
+ enterpriseTypeName: '',
|
|
|
|
322
|
+ registerDate: '',
|
|
|
|
323
|
+ companyId: '',
|
|
|
|
324
|
+ companyIdName: '',
|
|
|
|
325
|
+ companyNature: '',
|
|
|
|
326
|
+ companyAddress: '',
|
|
|
|
327
|
+ registeredCapital: '',
|
|
|
|
328
|
+ bankAccount: '',
|
|
|
|
329
|
+ bankName: '',
|
|
|
|
330
|
+ taxNumber: '',
|
|
|
|
331
|
+ registrationTime: '',
|
|
|
|
332
|
+ businessYears: '',
|
|
|
|
333
|
+ businessScope: '',
|
|
|
|
334
|
+ businessProperty: '',
|
|
|
|
335
|
+ landArea: '',
|
|
|
|
336
|
+ storageConditions: '',
|
|
|
|
337
|
+ employeeCount: '',
|
|
|
|
338
|
+ equipmentAttributes: '',
|
|
|
|
339
|
+ assetEvaluation: '',
|
|
|
|
340
|
+ lastYearSales: '',
|
|
|
|
341
|
+ monthlyAvgSales: '',
|
|
|
|
342
|
+ invoiceItemUnit: '',
|
|
|
|
343
|
+ certificationCertificate: '',
|
|
|
|
344
|
+ productMatch: '',
|
|
|
|
345
|
+ majorCustomers: '',
|
|
|
|
346
|
+ mainProjects: '',
|
|
|
|
347
|
+ industryInvolved: '',
|
|
|
|
348
|
+ industryExperience: '',
|
|
|
|
349
|
+ hasDispute: '',
|
|
|
|
350
|
+ cooperationStartDate: '',
|
|
|
|
351
|
+ monthlyAvgVolume: '',
|
|
|
|
352
|
+ isVerbalAgreement: '',
|
|
|
|
353
|
+ otherAgreements: '',
|
|
|
|
354
|
+ hasLongTermContract: '',
|
|
|
|
355
|
+ contractType: '',
|
|
|
|
356
|
+ hasInterruption: '',
|
|
|
|
357
|
+ settlementPeriod: '',
|
|
|
|
358
|
+ materialSupplyPlan: '',
|
|
|
|
359
|
+ suggestedCategory: '',
|
|
|
|
360
|
+ suggestedCategoryName: '',
|
|
|
|
361
|
+ creditLimit: '',
|
|
|
|
362
|
+ investigator: '',
|
|
|
|
363
|
+ investigatorName: '',
|
|
|
|
364
|
+ supervisorReviewName: '',
|
|
|
|
365
|
+ annualTotalSales: '',
|
|
|
|
366
|
+ mainIndustry: '',
|
|
|
|
367
|
+ annualMaterialOverview: '',
|
|
|
|
368
|
+ companySettlementPeriod: '',
|
|
|
|
369
|
+ companyCreditLimit: '',
|
|
|
|
370
|
+ companyMaterialSupplyPlan: '',
|
|
|
|
371
|
+ companySuggestedCategory: '',
|
|
|
|
372
|
+ companySuggestedCategoryName: ''
|
|
|
|
373
|
+ },
|
|
|
|
374
|
+ sheet: { visible: false, title: '请选择', field: '', options: [], value: '' },
|
|
|
|
375
|
+ relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' },
|
|
|
|
376
|
+ enterpriseTypeOptions: [],
|
|
|
|
377
|
+ categoryOptions: [],
|
|
|
|
378
|
+ companyCategoryOptions: [],
|
|
|
|
379
|
+ investigatorOptions: []
|
|
|
|
380
|
+ }
|
|
|
|
381
|
+ },
|
|
|
|
382
|
+ created() {
|
|
|
|
383
|
+ this.loadSerialNumber()
|
|
|
|
384
|
+ this.loadEnterpriseTypeOptions()
|
|
|
|
385
|
+ this.loadCategoryOptions()
|
|
|
|
386
|
+ this.loadCompanyCategoryOptions()
|
|
|
|
387
|
+ this.loadInvestigatorOptions()
|
|
|
|
388
|
+ this.loadInvestigatorDefault()
|
|
|
|
389
|
+ },
|
|
|
|
390
|
+ methods: {
|
|
|
|
391
|
+ async loadSerialNumber() {
|
|
|
|
392
|
+ try {
|
|
|
|
393
|
+ const res = await generateCreditCode()
|
|
|
|
394
|
+ this.form.serialNumber = (res && res.data) || ''
|
|
|
|
395
|
+ } catch (e) {
|
|
|
|
396
|
+ this.form.serialNumber = ''
|
|
|
|
397
|
+ }
|
|
|
|
398
|
+ },
|
|
|
|
399
|
+ displayLabel(field) {
|
|
|
|
400
|
+ const m = this.form
|
|
|
|
401
|
+ const map = {
|
|
|
|
402
|
+ enterpriseTypeName: '请选择企业类型',
|
|
|
|
403
|
+ suggestedCategoryName: '请选择建议客户分类',
|
|
|
|
404
|
+ companySuggestedCategoryName: '请选择客户分类'
|
|
|
|
405
|
+ }
|
|
|
|
406
|
+ const val = m[field]
|
|
|
|
407
|
+ return val ? String(val) : map[field]
|
|
|
|
408
|
+ },
|
|
|
|
409
|
+ async openSheet(field) {
|
|
|
|
410
|
+ const setSheet = (title, options) => {
|
|
|
|
411
|
+ const current = this.form[field]
|
|
|
|
412
|
+ const match = (options || []).find(o => String(o.label) === String(current) || String(o.value) === String(current))
|
|
|
|
413
|
+ this.sheet = { ...this.sheet, visible: true, title, options, field, value: match ? match.value : '' }
|
|
|
|
414
|
+ }
|
|
|
|
415
|
+ if (field === 'enterpriseType') {
|
|
|
|
416
|
+ setSheet('企业类型', this.enterpriseTypeOptions)
|
|
|
|
417
|
+ } else if (field === 'suggestedCategory') {
|
|
|
|
418
|
+ setSheet('建议客户分类', this.categoryOptions)
|
|
|
|
419
|
+ } else if (field === 'companySuggestedCategory') {
|
|
|
|
420
|
+ setSheet('客户分类', this.companyCategoryOptions)
|
|
|
|
421
|
+ } else if (field === 'investigator') {
|
|
|
|
422
|
+ setSheet('调查人', this.investigatorOptions)
|
|
|
|
423
|
+ }
|
|
|
|
424
|
+ },
|
|
|
|
425
|
+ onSheetConfirm({ value, label }) {
|
|
|
|
426
|
+ const field = this.sheet.field
|
|
|
|
427
|
+ if (!field) return
|
|
|
|
428
|
+ this.form[field] = value || ''
|
|
|
|
429
|
+ this.form[field + 'Name'] = label || ''
|
|
|
|
430
|
+ this.sheet.visible = false
|
|
|
|
431
|
+ },
|
|
|
|
432
|
+ openRelate(fieldKey) {
|
|
|
|
433
|
+ let config = {}
|
|
|
|
434
|
+ if (fieldKey === 'companyId') {
|
|
|
|
435
|
+ config = {
|
|
|
|
436
|
+ title: '单位名称',
|
|
|
|
437
|
+ source: 'customer',
|
|
|
|
438
|
+ rowKey: 'id',
|
|
|
|
439
|
+ multiple: false,
|
|
|
|
440
|
+ display: [
|
|
|
|
441
|
+ { label: '姓名', field: 'name' },
|
|
|
|
442
|
+ { label: '编号', field: 'code' },
|
|
|
|
443
|
+ { label: '状态', field: 'available', format: v => (v ? '启用' : '停用') }
|
|
|
|
444
|
+ ]
|
|
|
|
445
|
+ }
|
|
|
|
446
|
+ }
|
|
|
|
447
|
+ const selectedKeys = this.form[fieldKey] ? [this.form[fieldKey]] : []
|
|
|
|
448
|
+ this.sheet.visible = false
|
|
|
|
449
|
+ this.relate.title = config.title
|
|
|
|
450
|
+ this.relate.source = config.source
|
|
|
|
451
|
+ this.relate.display = config.display
|
|
|
|
452
|
+ this.relate.multiple = config.multiple
|
|
|
|
453
|
+ this.relate.rowKey = config.rowKey
|
|
|
|
454
|
+ this.relate.selectedKeys = selectedKeys
|
|
|
|
455
|
+ this.relate.fieldKey = fieldKey
|
|
|
|
456
|
+ this.$nextTick(() => { this.relate.visible = true })
|
|
|
|
457
|
+ },
|
|
|
|
458
|
+ onRelateConfirm({ items }) {
|
|
|
|
459
|
+ const _fieldKey = this.relate.fieldKey
|
|
|
|
460
|
+ const first = (items && items.length > 0) ? items[0] : null
|
|
|
|
461
|
+ this.form[_fieldKey] = (first && (first.id || first.code)) || ''
|
|
|
|
462
|
+ this.form[_fieldKey + 'Name'] = (first && (first.name || first.text)) || ''
|
|
|
|
463
|
+ },
|
|
|
|
464
|
+ validateRequired() {
|
|
|
|
465
|
+ const checks = [
|
|
|
|
466
|
+ { key: 'serialNumber', label: '编号' },
|
|
|
|
467
|
+ { key: 'companyId', label: '单位名称' }
|
|
|
|
468
|
+ ]
|
|
|
|
469
|
+ for (const it of checks) {
|
|
|
|
470
|
+ const val = this.form[it.key]
|
|
|
|
471
|
+ if (val === undefined || val === null || String(val).trim() === '') {
|
|
|
|
472
|
+ uni.showToast({ title: `请先选择${it.label}`, icon: 'none' })
|
|
|
|
473
|
+ return false
|
|
|
|
474
|
+ }
|
|
|
|
475
|
+ }
|
|
|
|
476
|
+ return true
|
|
|
|
477
|
+ },
|
|
|
|
478
|
+ async loadEnterpriseTypeOptions() {
|
|
|
|
479
|
+ try {
|
|
|
|
480
|
+ const res = await getDicByCodeApi('ENTERPRISE_TYPE')
|
|
|
|
481
|
+ const list = res.data || []
|
|
|
|
482
|
+ this.enterpriseTypeOptions = (list || []).map(it => ({ label: it.name || '', value: it.code || '' }))
|
|
|
|
483
|
+ } catch (e) {
|
|
|
|
484
|
+ this.enterpriseTypeOptions = []
|
|
|
|
485
|
+ }
|
|
|
|
486
|
+ },
|
|
|
|
487
|
+ async loadCategoryOptions() {
|
|
|
|
488
|
+ try {
|
|
|
|
489
|
+ const res = await getDicByCodeApi('CUSTOMER_CATEGORY')
|
|
|
|
490
|
+ const list = res.data || []
|
|
|
|
491
|
+ this.categoryOptions = (list || []).map(it => ({ label: it.name || '', value: it.code || '' }))
|
|
|
|
492
|
+ } catch (e) {
|
|
|
|
493
|
+ this.categoryOptions = []
|
|
|
|
494
|
+ }
|
|
|
|
495
|
+ },
|
|
|
|
496
|
+ async loadCompanyCategoryOptions() {
|
|
|
|
497
|
+ try {
|
|
|
|
498
|
+ const res = await getDicByCodeApi('CUSTOMER_CATEGORY')
|
|
|
|
499
|
+ const list = res.data || []
|
|
|
|
500
|
+ this.companyCategoryOptions = (list || []).map(it => ({ label: it.name || '', value: it.code || '' }))
|
|
|
|
501
|
+ } catch (e) {
|
|
|
|
502
|
+ this.companyCategoryOptions = []
|
|
|
|
503
|
+ }
|
|
|
|
504
|
+ },
|
|
|
|
505
|
+ async loadInvestigatorOptions() {
|
|
|
|
506
|
+ try {
|
|
|
|
507
|
+ const res = await getAllUser()
|
|
|
|
508
|
+ const list = res.data || []
|
|
|
|
509
|
+ this.investigatorOptions = (list || []).map(it => ({ label: it.name || it.userName || '', value: it.id || it.userId || '' }))
|
|
|
|
510
|
+ } catch (e) {
|
|
|
|
511
|
+ this.investigatorOptions = []
|
|
|
|
512
|
+ }
|
|
|
|
513
|
+ },
|
|
|
|
514
|
+ async loadInvestigatorDefault() {
|
|
|
|
515
|
+ try {
|
|
|
|
516
|
+ const res = await getDeptUser()
|
|
|
|
517
|
+ const u = (res && res.data) || {}
|
|
|
|
518
|
+ this.form.investigator = u.id || u.userId || ''
|
|
|
|
519
|
+ this.form.investigatorName = u.name || u.userName || ''
|
|
|
|
520
|
+ } catch (e) { }
|
|
|
|
521
|
+ },
|
|
|
|
522
|
+ async onSubmit() {
|
|
|
|
523
|
+ if (!this.validateRequired()) return
|
|
|
|
524
|
+ const payload = { ...this.form }
|
|
|
|
525
|
+ delete payload.enterpriseTypeName
|
|
|
|
526
|
+ delete payload.suggestedCategoryName
|
|
|
|
527
|
+ delete payload.companySuggestedCategoryName
|
|
|
|
528
|
+ delete payload.companyIdName
|
|
|
|
529
|
+ delete payload.investigatorName
|
|
|
|
530
|
+ try {
|
|
|
|
531
|
+ await createApi(payload)
|
|
|
|
532
|
+ uni.showToast({ title: '提交成功', icon: 'success' })
|
|
|
|
533
|
+ setTimeout(() => uni.navigateBack(), 600)
|
|
|
|
534
|
+ } catch (e) {
|
|
|
|
535
|
+ uni.showToast({ title: (e && e.msg) || '提交失败', icon: 'none' })
|
|
|
|
536
|
+ }
|
|
|
|
537
|
+ }
|
|
|
|
538
|
+ }
|
|
|
|
539
|
+}
|
|
|
|
540
|
+</script>
|
|
|
|
541
|
+
|
|
|
|
542
|
+<style lang="scss" scoped>
|
|
|
|
543
|
+.page {
|
|
|
|
544
|
+ display: flex;
|
|
|
|
545
|
+ flex-direction: column;
|
|
|
|
546
|
+ height: 100%;
|
|
|
|
547
|
+}
|
|
|
|
548
|
+
|
|
|
|
549
|
+.scroll {
|
|
|
|
550
|
+ flex: 1;
|
|
|
|
551
|
+ padding: 12rpx 0 160rpx;
|
|
|
|
552
|
+}
|
|
|
|
553
|
+
|
|
|
|
554
|
+.footer {
|
|
|
|
555
|
+ position: fixed;
|
|
|
|
556
|
+ left: 0;
|
|
|
|
557
|
+ right: 0;
|
|
|
|
558
|
+ bottom: 0;
|
|
|
|
559
|
+ padding: 32rpx;
|
|
|
|
560
|
+ padding-bottom: calc(32rpx + env(safe-area-inset-bottom));
|
|
|
|
561
|
+ background: #fff;
|
|
|
|
562
|
+ box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.06);
|
|
|
|
563
|
+
|
|
|
|
564
|
+ .btn {
|
|
|
|
565
|
+ height: 80rpx;
|
|
|
|
566
|
+ line-height: 80rpx;
|
|
|
|
567
|
+ border-radius: 12rpx;
|
|
|
|
568
|
+ font-size: 32rpx;
|
|
|
|
569
|
+ }
|
|
|
|
570
|
+
|
|
|
|
571
|
+ .submit {
|
|
|
|
572
|
+ background: $theme-primary;
|
|
|
|
573
|
+ color: #fff;
|
|
|
|
574
|
+ }
|
|
|
|
575
|
+}
|
|
|
|
576
|
+
|
|
|
|
577
|
+::v-deep .uni-list {
|
|
|
|
578
|
+ background: transparent;
|
|
|
|
579
|
+
|
|
|
|
580
|
+ &-item {
|
|
|
|
581
|
+ &__extra-text {
|
|
|
|
582
|
+ font-size: 32rpx;
|
|
|
|
583
|
+ }
|
|
|
|
584
|
+
|
|
|
|
585
|
+ &__content-title {
|
|
|
|
586
|
+ font-size: 32rpx;
|
|
|
|
587
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
588
|
+ }
|
|
|
|
589
|
+
|
|
|
|
590
|
+ &__container {
|
|
|
|
591
|
+ padding: 32rpx;
|
|
|
|
592
|
+ align-items: center;
|
|
|
|
593
|
+
|
|
|
|
594
|
+ .uni-easyinput {
|
|
|
|
595
|
+
|
|
|
|
596
|
+ .is-disabled {
|
|
|
|
597
|
+ background-color: transparent !important;
|
|
|
|
598
|
+ }
|
|
|
|
599
|
+
|
|
|
|
600
|
+ &__placeholder-class {
|
|
|
|
601
|
+ font-size: 32rpx;
|
|
|
|
602
|
+ color: rgba(0, 0, 0, 0.4);
|
|
|
|
603
|
+ }
|
|
|
|
604
|
+
|
|
|
|
605
|
+ &__content {
|
|
|
|
606
|
+ border: none;
|
|
|
|
607
|
+
|
|
|
|
608
|
+ &-input {
|
|
|
|
609
|
+ padding-left: 0 !important;
|
|
|
|
610
|
+ height: 48rpx;
|
|
|
|
611
|
+ line-height: 48rpx;
|
|
|
|
612
|
+ font-size: 32rpx;
|
|
|
|
613
|
+ }
|
|
|
|
614
|
+
|
|
|
|
615
|
+ .content-clear-icon {
|
|
|
|
616
|
+ font-size: 44rpx !important;
|
|
|
|
617
|
+ }
|
|
|
|
618
|
+ }
|
|
|
|
619
|
+ }
|
|
|
|
620
|
+
|
|
|
|
621
|
+ .item-title,
|
|
|
|
622
|
+ .uni-list-item__content {
|
|
|
|
623
|
+ flex: none;
|
|
|
|
624
|
+ min-height: 48rpx;
|
|
|
|
625
|
+ line-height: 48rpx;
|
|
|
|
626
|
+ font-size: 32rpx;
|
|
|
|
627
|
+ position: relative;
|
|
|
|
628
|
+ width: 162rpx;
|
|
|
|
629
|
+ margin-right: 32rpx;
|
|
|
|
630
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
631
|
+
|
|
|
|
632
|
+ .required {
|
|
|
|
633
|
+ color: red;
|
|
|
|
634
|
+ position: absolute;
|
|
|
|
635
|
+ top: 50%;
|
|
|
|
636
|
+ transform: translateY(-50%);
|
|
|
|
637
|
+ left: -16rpx;
|
|
|
|
638
|
+ }
|
|
|
|
639
|
+ }
|
|
|
|
640
|
+
|
|
|
|
641
|
+ }
|
|
|
|
642
|
+
|
|
|
|
643
|
+ &.select-item {
|
|
|
|
644
|
+ &.is-empty {
|
|
|
|
645
|
+ .uni-list-item__extra-text {
|
|
|
|
646
|
+ color: rgba(0, 0, 0, 0.4) !important;
|
|
|
|
647
|
+ }
|
|
|
|
648
|
+ }
|
|
|
|
649
|
+
|
|
|
|
650
|
+ &.is-filled {
|
|
|
|
651
|
+ .uni-list-item__extra-text {
|
|
|
|
652
|
+ color: rgba(0, 0, 0, 0.9) !important;
|
|
|
|
653
|
+ }
|
|
|
|
654
|
+ }
|
|
|
|
655
|
+
|
|
|
|
656
|
+ .serial-number-row {
|
|
|
|
657
|
+ display: flex;
|
|
|
|
658
|
+ align-items: center;
|
|
|
|
659
|
+
|
|
|
|
660
|
+ .generate-btn {
|
|
|
|
661
|
+ margin-left: 24rpx;
|
|
|
|
662
|
+ height: 64rpx;
|
|
|
|
663
|
+ line-height: 64rpx;
|
|
|
|
664
|
+ padding: 0 24rpx;
|
|
|
|
665
|
+ font-size: 28rpx;
|
|
|
|
666
|
+ border-radius: 8rpx;
|
|
|
|
667
|
+ background: $theme-primary;
|
|
|
|
668
|
+ color: #fff;
|
|
|
|
669
|
+ }
|
|
|
|
670
|
+ }
|
|
|
|
671
|
+
|
|
|
|
672
|
+ }
|
|
|
|
673
|
+
|
|
|
|
674
|
+ &.mgb10 {
|
|
|
|
675
|
+ margin-bottom: 20rpx;
|
|
|
|
676
|
+ }
|
|
|
|
677
|
+
|
|
|
|
678
|
+ }
|
|
|
|
679
|
+ .title-header {
|
|
|
|
680
|
+ background-color: #fff;
|
|
|
|
681
|
+ display: flex;
|
|
|
|
682
|
+ align-items: center;
|
|
|
|
683
|
+ padding: 24rpx 32rpx;
|
|
|
|
684
|
+ border-bottom: 1rpx solid #f0f0f0;
|
|
|
|
685
|
+
|
|
|
|
686
|
+ &_icon {
|
|
|
|
687
|
+ width: 32rpx;
|
|
|
|
688
|
+ height: 28rpx;
|
|
|
|
689
|
+ margin-right: 16rpx;
|
|
|
|
690
|
+ margin-top: 8rpx;
|
|
|
|
691
|
+ }
|
|
|
|
692
|
+ }
|
|
|
|
693
|
+}
|
|
|
|
694
|
+</style> |