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