Commit 0ef26feaa9f7d24e0975eebe87bfd367415176d5

Authored by gesilong
1 parent afd87ac8

commit:外贸暂时页面开发

  1 +import request from '@/utils/request'
  2 +import { ContentTypeEnum } from '@/utils/httpEnum'
  3 +
  4 +export function foreignCustomerCreditQueryApi(params) {
  5 + return request({
  6 + url: '/procurement/foreignCustomerCredit/query',
  7 + method: 'get',
  8 + params
  9 + })
  10 +}
  11 +
  12 +export function foreignCustomerCreditSaveApi(data) {
  13 + return request({
  14 + url: '/procurement/foreignCustomerCredit',
  15 + method: 'post',
  16 + data,
  17 + contentType: ContentTypeEnum.JSON
  18 + })
  19 +}
  20 +
  21 +export function foreignCustomerCreditGetApi(id) {
  22 + return request({
  23 + url: '/procurement/foreignCustomerCredit/get',
  24 + method: 'get',
  25 + params: { id }
  26 + })
  27 +}
  28 +
... ...
... ... @@ -244,6 +244,38 @@
244 244 }
245 245 },
246 246 {
  247 + "path": "pages/foreign_trade/index",
  248 + "style": {
  249 + "navigationBarTitleText": "外贸供应商资信列表",
  250 + "navigationBarBackgroundColor": "#ffffff",
  251 + "navigationBarTextStyle": "black"
  252 + }
  253 + },
  254 + {
  255 + "path": "pages/foreign_trade/add",
  256 + "style": {
  257 + "navigationBarTitleText": "新增外贸供应商资信",
  258 + "navigationBarBackgroundColor": "#ffffff",
  259 + "navigationBarTextStyle": "black"
  260 + }
  261 + },
  262 + {
  263 + "path": "pages/foreign_trade/modify",
  264 + "style": {
  265 + "navigationBarTitleText": "编辑外贸供应商资信",
  266 + "navigationBarBackgroundColor": "#ffffff",
  267 + "navigationBarTextStyle": "black"
  268 + }
  269 + },
  270 + {
  271 + "path": "pages/foreign_trade/detail",
  272 + "style": {
  273 + "navigationBarTitleText": "外贸供应商资信详情",
  274 + "navigationBarBackgroundColor": "#ffffff",
  275 + "navigationBarTextStyle": "black"
  276 + }
  277 + },
  278 + {
247 279 "path": "pages/order_list/index",
248 280 "style": {
249 281 "navigationBarTitleText": "订货单列表",
... ...
  1 +<template>
  2 + <view class="page">
  3 + <scroll-view class="scroll" scroll-y>
  4 + <uni-list>
  5 + <view class="title-header">
  6 + <image class="title-header_icon" src="/static/images/title.png" />
  7 + <span>供应商</span>
  8 + </view>
  9 +
  10 + <uni-list-item class="select-item" :class="form.supplierName ? 'is-filled' : 'is-empty'" clickable
  11 + @click="openSheet('supplier')" :rightText="displayLabel('supplierName')" showArrow>
  12 + <template v-slot:body>
  13 + <view class="item-title"><text>供应商</text></view>
  14 + </template>
  15 + </uni-list-item>
  16 +
  17 + <view class="title-header">
  18 + <image class="title-header_icon" src="/static/images/title.png" />
  19 + <span>基本资料</span>
  20 + </view>
  21 +
  22 + <uni-list-item title="单位名称">
  23 + <template v-slot:footer>
  24 + <uni-easyinput v-model="form.unitName" placeholder="请输入" :inputBorder="false" />
  25 + </template>
  26 + </uni-list-item>
  27 +
  28 + <uni-list-item title="公司性质">
  29 + <template v-slot:footer>
  30 + <uni-easyinput v-model="form.companyNature" placeholder="请输入" :inputBorder="false" />
  31 + </template>
  32 + </uni-list-item>
  33 +
  34 + <uni-list-item title="法人代表">
  35 + <template v-slot:footer>
  36 + <uni-easyinput v-model="form.legalRepresentative" placeholder="请输入" :inputBorder="false" />
  37 + </template>
  38 + </uni-list-item>
  39 +
  40 + <uni-list-item title="电话及传真">
  41 + <template v-slot:footer>
  42 + <uni-easyinput v-model="form.phoneFax" placeholder="请输入" :inputBorder="false" />
  43 + </template>
  44 + </uni-list-item>
  45 +
  46 + <uni-list-item title="注册证书号">
  47 + <template v-slot:footer>
  48 + <uni-easyinput v-model="form.registrationCertificateNo" placeholder="请输入" :inputBorder="false" />
  49 + </template>
  50 + </uni-list-item>
  51 +
  52 + <uni-list-item title="地址">
  53 + <template v-slot:footer>
  54 + <uni-easyinput v-model="form.address" placeholder="请输入" :inputBorder="false" />
  55 + </template>
  56 + </uni-list-item>
  57 +
  58 + <uni-list-item title="国内业务负责人">
  59 + <template v-slot:footer>
  60 + <uni-easyinput v-model="form.domesticBusinessLeader" placeholder="请输入" :inputBorder="false" />
  61 + </template>
  62 + </uni-list-item>
  63 +
  64 + <uni-list-item title="负责人身份证/护照号">
  65 + <template v-slot:footer>
  66 + <uni-easyinput v-model="form.leaderIdPassportNo" placeholder="请输入" :inputBorder="false" />
  67 + </template>
  68 + </uni-list-item>
  69 +
  70 + <uni-list-item title="成立时间及货场规模">
  71 + <template v-slot:footer>
  72 + <uni-easyinput type="textarea" v-model="form.establishedTimeAndYardScale" placeholder="请输入" :inputBorder="false" maxlength="2000" />
  73 + </template>
  74 + </uni-list-item>
  75 +
  76 + <uni-list-item title="经营品种、规模">
  77 + <template v-slot:footer>
  78 + <uni-easyinput type="textarea" v-model="form.overallBusinessVarietyScale" placeholder="请输入" :inputBorder="false" maxlength="2000" />
  79 + </template>
  80 + </uni-list-item>
  81 +
  82 + <uni-list-item title="出口到国内时间">
  83 + <template v-slot:footer>
  84 + <uni-easyinput v-model="form.exportToDomesticTime" placeholder="请输入" :inputBorder="false" />
  85 + </template>
  86 + </uni-list-item>
  87 +
  88 + <uni-list-item title="出口规模、品种">
  89 + <template v-slot:footer>
  90 + <uni-easyinput type="textarea" v-model="form.exportToDomesticScaleVariety" placeholder="请输入" :inputBorder="false" maxlength="2000" />
  91 + </template>
  92 + </uni-list-item>
  93 +
  94 + <uni-list-item title="与国内合作企业">
  95 + <template v-slot:footer>
  96 + <uni-easyinput type="textarea" v-model="form.domesticCooperationCompanies" placeholder="请输入" :inputBorder="false" maxlength="2000" />
  97 + </template>
  98 + </uni-list-item>
  99 +
  100 + <uni-list-item title="合作效果">
  101 + <template v-slot:footer>
  102 + <uni-easyinput type="textarea" v-model="form.cooperationEffect" placeholder="请输入" :inputBorder="false" maxlength="2000" />
  103 + </template>
  104 + </uni-list-item>
  105 +
  106 + <uni-list-item title="供应商考察">
  107 + <template v-slot:footer>
  108 + <uni-easyinput type="textarea" v-model="form.supplierInspection" placeholder="请输入" :inputBorder="false" maxlength="2000" />
  109 + </template>
  110 + </uni-list-item>
  111 +
  112 + <uni-list-item title="销售代表办公地考察">
  113 + <template v-slot:footer>
  114 + <uni-easyinput type="textarea" v-model="form.domesticSalesRepOfficeInspection" placeholder="请输入" :inputBorder="false" maxlength="2000" />
  115 + </template>
  116 + </uni-list-item>
  117 +
  118 + <uni-list-item title="有无担保函">
  119 + <template v-slot:footer>
  120 + <uni-easyinput v-model="form.hasGuaranteeLetter" placeholder="请输入" :inputBorder="false" />
  121 + </template>
  122 + </uni-list-item>
  123 +
  124 + <uni-list-item title="合同纠纷">
  125 + <template v-slot:footer>
  126 + <uni-easyinput type="textarea" v-model="form.contractDispute" placeholder="请输入" :inputBorder="false" maxlength="2000" />
  127 + </template>
  128 + </uni-list-item>
  129 +
  130 + <uni-list-item title="保险、运输方式">
  131 + <template v-slot:footer>
  132 + <uni-easyinput v-model="form.insuranceTransportMode" placeholder="请输入" :inputBorder="false" />
  133 + </template>
  134 + </uni-list-item>
  135 +
  136 + <uni-list-item title="滞箱滞报费用">
  137 + <template v-slot:footer>
  138 + <uni-easyinput v-model="form.demurrageFee" placeholder="请输入" :inputBorder="false" />
  139 + </template>
  140 + </uni-list-item>
  141 +
  142 + <uni-list-item title="操作品种">
  143 + <template v-slot:footer>
  144 + <uni-easyinput v-model="form.operatingVariety" placeholder="请输入" :inputBorder="false" />
  145 + </template>
  146 + </uni-list-item>
  147 +
  148 + <uni-list-item title="操作规模">
  149 + <template v-slot:footer>
  150 + <uni-easyinput v-model="form.operatingScale" placeholder="请输入" :inputBorder="false" />
  151 + </template>
  152 + </uni-list-item>
  153 +
  154 + <uni-list-item title="定价模式">
  155 + <template v-slot:footer>
  156 + <uni-easyinput v-model="form.pricingModel" placeholder="请输入" :inputBorder="false" />
  157 + </template>
  158 + </uni-list-item>
  159 +
  160 + <uni-list-item title="结算方式">
  161 + <template v-slot:footer>
  162 + <uni-easyinput v-model="form.settlementMethod" placeholder="请输入" :inputBorder="false" />
  163 + </template>
  164 + </uni-list-item>
  165 +
  166 + <uni-list-item title="磅差约定">
  167 + <template v-slot:footer>
  168 + <uni-easyinput v-model="form.weightDiffAgreement" placeholder="请输入" :inputBorder="false" />
  169 + </template>
  170 + </uni-list-item>
  171 +
  172 + <uni-list-item class="mgb10" title="质量标准">
  173 + <template v-slot:footer>
  174 + <uni-easyinput v-model="form.qualityStandard" placeholder="请输入" :inputBorder="false" />
  175 + </template>
  176 + </uni-list-item>
  177 +
  178 + <view class="title-header">
  179 + <image class="title-header_icon" src="/static/images/title.png" />
  180 + <span>供应商分类</span>
  181 + </view>
  182 +
  183 + <uni-list-item class="select-item mgb10" :class="form.supplierCategory ? 'is-filled' : 'is-empty'" clickable
  184 + @click="openSheet('supplierCategory')" :rightText="displayLabel('supplierCategory')" showArrow>
  185 + <template v-slot:body>
  186 + <view class="item-title"><text>供应商分类</text></view>
  187 + </template>
  188 + </uni-list-item>
  189 +
  190 + <view class="title-header">
  191 + <image class="title-header_icon" src="/static/images/title.png" />
  192 + <span>操作方案</span>
  193 + </view>
  194 +
  195 + <uni-list-item title="操作时间">
  196 + <template v-slot:footer>
  197 + <uni-easyinput v-model="form.operationTime" placeholder="请输入" :inputBorder="false" />
  198 + </template>
  199 + </uni-list-item>
  200 +
  201 + <uni-list-item title="操作模式">
  202 + <template v-slot:footer>
  203 + <uni-easyinput v-model="form.operationMode" placeholder="请输入" :inputBorder="false" />
  204 + </template>
  205 + </uni-list-item>
  206 +
  207 + <uni-list-item title="操作品种">
  208 + <template v-slot:footer>
  209 + <uni-easyinput v-model="form.operationVariety" placeholder="请输入" :inputBorder="false" />
  210 + </template>
  211 + </uni-list-item>
  212 +
  213 + <uni-list-item title="操作数量">
  214 + <template v-slot:footer>
  215 + <uni-easyinput v-model="form.operationQuantity" placeholder="请输入" :inputBorder="false" />
  216 + </template>
  217 + </uni-list-item>
  218 +
  219 + <uni-list-item title="发货要求">
  220 + <template v-slot:footer>
  221 + <uni-easyinput type="textarea" v-model="form.deliveryRequirement" placeholder="请输入" :inputBorder="false" maxlength="2000" />
  222 + </template>
  223 + </uni-list-item>
  224 +
  225 + <uni-list-item title="付款方式">
  226 + <template v-slot:footer>
  227 + <uni-easyinput v-model="form.paymentMethod" placeholder="请输入" :inputBorder="false" />
  228 + </template>
  229 + </uni-list-item>
  230 +
  231 + <uni-list-item title="下次评审时间">
  232 + <template v-slot:footer>
  233 + <uni-datetime-picker type="date" v-model="form.nextReviewTime" />
  234 + </template>
  235 + </uni-list-item>
  236 +
  237 + <uni-list-item class="mgb10" title="评审部门">
  238 + <template v-slot:footer>
  239 + <uni-easyinput v-model="form.reviewDepartment" placeholder="请输入" :inputBorder="false" />
  240 + </template>
  241 + </uni-list-item>
  242 + </uni-list>
  243 + </scroll-view>
  244 +
  245 + <view class="footer">
  246 + <button class="btn submit" type="primary" :disabled="submitting" @click="onSubmit">{{ submitting ? '提交中...' : '提交' }}</button>
  247 + </view>
  248 +
  249 + <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value"
  250 + @confirm="onSheetConfirm" />
  251 + </view>
  252 +</template>
  253 +
  254 +<script>
  255 +import SingleSelectSheet from '@/components/single-select/index.vue'
  256 +import { getDicByCodes } from '@/utils/dic.js'
  257 +import { foreignCustomerCreditSaveApi } from '@/api/procure-manage/foreignCustomerCredit.js'
  258 +
  259 +export default {
  260 + name: 'ForeignTradeAdd',
  261 + components: { SingleSelectSheet },
  262 + data() {
  263 + return {
  264 + submitting: false,
  265 + supplierOptions: [],
  266 + supplierCategoryOptions: [
  267 + { label: 'A类供应商', value: 'A' },
  268 + { label: 'B类供应商', value: 'B' },
  269 + { label: 'C类供应商', value: 'C' },
  270 + { label: 'D类供应商', value: 'D' }
  271 + ],
  272 + sheet: { visible: false, title: '', options: [], field: '', value: '' },
  273 + form: {
  274 + supplier: '',
  275 + supplierName: '',
  276 + unitName: '',
  277 + companyNature: '',
  278 + legalRepresentative: '',
  279 + phoneFax: '',
  280 + registrationCertificateNo: '',
  281 + address: '',
  282 + domesticBusinessLeader: '',
  283 + leaderIdPassportNo: '',
  284 + establishedTimeAndYardScale: '',
  285 + overallBusinessVarietyScale: '',
  286 + exportToDomesticTime: '',
  287 + exportToDomesticScaleVariety: '',
  288 + domesticCooperationCompanies: '',
  289 + cooperationEffect: '',
  290 + supplierInspection: '',
  291 + domesticSalesRepOfficeInspection: '',
  292 + hasGuaranteeLetter: '',
  293 + contractDispute: '',
  294 + insuranceTransportMode: '',
  295 + demurrageFee: '',
  296 + operatingVariety: '',
  297 + operatingScale: '',
  298 + pricingModel: '',
  299 + settlementMethod: '',
  300 + weightDiffAgreement: '',
  301 + qualityStandard: '',
  302 + supplierCategory: '',
  303 + operationTime: '',
  304 + operationMode: '',
  305 + operationVariety: '',
  306 + operationQuantity: '',
  307 + deliveryRequirement: '',
  308 + paymentMethod: '',
  309 + nextReviewTime: '',
  310 + reviewDepartment: ''
  311 + }
  312 + }
  313 + },
  314 + created() {
  315 + this.loadSupplierOptions()
  316 + },
  317 + methods: {
  318 + async loadSupplierOptions() {
  319 + try {
  320 + const results = await getDicByCodes(['SUPPLIER'])
  321 + const items = results && results.SUPPLIER && results.SUPPLIER.data ? results.SUPPLIER.data : []
  322 + this.supplierOptions = (Array.isArray(items) ? items : []).map(it => ({
  323 + label: it && it.name != null ? String(it.name) : '',
  324 + value: it && it.code != null ? String(it.code) : ''
  325 + })).filter(it => it.value)
  326 + } catch (e) {
  327 + this.supplierOptions = []
  328 + }
  329 + },
  330 + displayLabel(field) {
  331 + const m = this.form || {}
  332 + const map = {
  333 + supplierName: '请选择',
  334 + supplierCategory: '请选择'
  335 + }
  336 + const v = m[field]
  337 + if (v != null && String(v).trim()) return String(v)
  338 + if (field === 'supplierCategory') {
  339 + const code = m.supplierCategory
  340 + const found = (this.supplierCategoryOptions || []).find(o => String(o.value) === String(code))
  341 + return found ? String(found.label || '') : map[field]
  342 + }
  343 + return map[field] || '请选择'
  344 + },
  345 + openSheet(field) {
  346 + const map = {
  347 + supplier: { title: '选择供应商', options: this.supplierOptions, valueField: 'supplier', labelField: 'supplierName' },
  348 + supplierCategory: { title: '供应商分类', options: this.supplierCategoryOptions, valueField: 'supplierCategory', labelField: '' }
  349 + }
  350 + const cfg = map[field]
  351 + if (!cfg) return
  352 + const current = this.form[cfg.valueField]
  353 + const match = (cfg.options || []).find(o => String(o.value) === String(current))
  354 + this.sheet = {
  355 + ...this.sheet,
  356 + visible: true,
  357 + title: cfg.title,
  358 + options: cfg.options || [],
  359 + field,
  360 + value: match ? match.value : current
  361 + }
  362 + },
  363 + onSheetConfirm({ value, label }) {
  364 + const field = this.sheet.field
  365 + if (field === 'supplier') {
  366 + this.form.supplier = value
  367 + this.form.supplierName = label
  368 + }
  369 + if (field === 'supplierCategory') {
  370 + this.form.supplierCategory = value
  371 + }
  372 + this.sheet.visible = false
  373 + },
  374 + validate() {
  375 + const requiredFields = [
  376 + { key: 'supplier', label: '供应商' },
  377 + { key: 'unitName', label: '单位名称' },
  378 + { key: 'companyNature', label: '公司性质' },
  379 + { key: 'legalRepresentative', label: '法人代表' },
  380 + { key: 'phoneFax', label: '电话及传真' },
  381 + { key: 'registrationCertificateNo', label: '注册证书号' },
  382 + { key: 'address', label: '地址' },
  383 + { key: 'domesticBusinessLeader', label: '国内业务负责人' },
  384 + { key: 'leaderIdPassportNo', label: '负责人身份证/护照号' },
  385 + { key: 'establishedTimeAndYardScale', label: '成立时间及货场规模' },
  386 + { key: 'overallBusinessVarietyScale', label: '经营品种、规模' },
  387 + { key: 'exportToDomesticTime', label: '出口到国内时间' },
  388 + { key: 'exportToDomesticScaleVariety', label: '出口规模、品种' },
  389 + { key: 'domesticCooperationCompanies', label: '与国内合作企业' },
  390 + { key: 'cooperationEffect', label: '合作效果' },
  391 + { key: 'supplierInspection', label: '供应商考察' },
  392 + { key: 'domesticSalesRepOfficeInspection', label: '销售代表办公地考察' },
  393 + { key: 'hasGuaranteeLetter', label: '有无担保函' },
  394 + { key: 'contractDispute', label: '合同纠纷' },
  395 + { key: 'insuranceTransportMode', label: '保险、运输方式' },
  396 + { key: 'demurrageFee', label: '滞箱滞报费用' },
  397 + { key: 'operatingVariety', label: '操作品种' },
  398 + { key: 'operatingScale', label: '操作规模' },
  399 + { key: 'pricingModel', label: '定价模式' },
  400 + { key: 'settlementMethod', label: '结算方式' },
  401 + { key: 'weightDiffAgreement', label: '磅差约定' },
  402 + { key: 'qualityStandard', label: '质量标准' },
  403 + { key: 'supplierCategory', label: '供应商分类' },
  404 + { key: 'operationTime', label: '操作时间' },
  405 + { key: 'operationMode', label: '操作模式' },
  406 + { key: 'operationVariety', label: '操作品种' },
  407 + { key: 'operationQuantity', label: '操作数量' },
  408 + { key: 'deliveryRequirement', label: '发货要求' },
  409 + { key: 'paymentMethod', label: '付款方式' },
  410 + { key: 'nextReviewTime', label: '下次评审时间' },
  411 + { key: 'reviewDepartment', label: '评审部门' }
  412 + ]
  413 + for (let i = 0; i < requiredFields.length; i++) {
  414 + const f = requiredFields[i]
  415 + const v = this.form && this.form[f.key]
  416 + if (v == null || String(v).trim() === '') {
  417 + uni.showToast({ title: `${f.label}必填`, icon: 'none' })
  418 + return false
  419 + }
  420 + }
  421 + return true
  422 + },
  423 + buildPayload() {
  424 + return { ...this.form }
  425 + },
  426 + async onSubmit() {
  427 + if (this.submitting) return
  428 + if (!this.validate()) return
  429 + this.submitting = true
  430 + const payload = this.buildPayload()
  431 + try {
  432 + await foreignCustomerCreditSaveApi(payload)
  433 + uni.showToast({ title: '提交成功', icon: 'success' })
  434 + try { uni.setStorageSync('FOREIGN_TRADE_LIST_NEED_REFRESH', '1') } catch (e) {}
  435 + setTimeout(() => { uni.navigateBack() }, 300)
  436 + } catch (e) {
  437 + uni.showToast({ title: (e && e.msg) || '提交失败', icon: 'none' })
  438 + } finally {
  439 + this.submitting = false
  440 + }
  441 + },
  442 + }
  443 +}
  444 +</script>
  445 +
  446 +<style lang="scss" scoped>
  447 +.page {
  448 + display: flex;
  449 + flex-direction: column;
  450 + height: 100%;
  451 +}
  452 +
  453 +.scroll {
  454 + flex: 1;
  455 + padding: 12rpx 0 160rpx;
  456 +}
  457 +
  458 +.footer {
  459 + position: fixed;
  460 + left: 0;
  461 + right: 0;
  462 + bottom: 0;
  463 + padding: 32rpx;
  464 + padding-bottom: calc(32rpx + env(safe-area-inset-bottom));
  465 + background: #fff;
  466 + box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.06);
  467 + z-index: 10;
  468 +
  469 + .btn {
  470 + height: 80rpx;
  471 + line-height: 80rpx;
  472 + border-radius: 12rpx;
  473 + font-size: 32rpx;
  474 + }
  475 +
  476 + .submit {
  477 + background: $theme-primary;
  478 + color: #fff;
  479 + }
  480 +}
  481 +
  482 +.title-header {
  483 + display: flex;
  484 + align-items: center;
  485 + padding: 24rpx 32rpx 12rpx;
  486 + background-color: #ffffff;
  487 +
  488 + .title-header_icon {
  489 + width: 36rpx;
  490 + height: 36rpx;
  491 + margin-right: 12rpx;
  492 + }
  493 +
  494 + span {
  495 + font-size: 34rpx;
  496 + font-weight: 600;
  497 + color: rgba(0, 0, 0, 0.9);
  498 + }
  499 +}
  500 +
  501 +.mgb10 {
  502 + margin-bottom: 20rpx;
  503 +}
  504 +
  505 +::v-deep .uni-list {
  506 + .uni-easyinput {
  507 + display: flex;
  508 +
  509 + .uni-input-input {
  510 + color: rgba(0, 0, 0, 0.9);
  511 + }
  512 + }
  513 +
  514 + .uni-input-placeholder {
  515 + z-index: 1;
  516 + }
  517 +
  518 + .uni-input-input {
  519 + background-color: #ffffff;
  520 + }
  521 +
  522 + background: transparent;
  523 +
  524 + &-item {
  525 + &__extra-text {
  526 + font-size: 32rpx;
  527 + }
  528 +
  529 + &__content-title {
  530 + font-size: 32rpx;
  531 + color: rgba(0, 0, 0, 0.9);
  532 + }
  533 +
  534 + &__container {
  535 + padding: 32rpx;
  536 +
  537 + .uni-easyinput {
  538 + &__placeholder-class {
  539 + font-size: 32rpx;
  540 + color: rgba(0, 0, 0, 0.4);
  541 + }
  542 +
  543 + &__content {
  544 + border: none;
  545 + background-color: #ffffff !important;
  546 +
  547 + &-input {
  548 + padding-left: 0 !important;
  549 + height: 48rpx;
  550 + line-height: 48rpx;
  551 + font-size: 32rpx;
  552 + }
  553 +
  554 + .content-clear-icon {
  555 + font-size: 44rpx !important;
  556 + }
  557 + }
  558 + }
  559 +
  560 + .item-title,
  561 + .uni-list-item__content {
  562 + flex: none;
  563 + min-height: 48rpx;
  564 + line-height: 48rpx;
  565 + font-size: 32rpx;
  566 + position: relative;
  567 + width: 260rpx;
  568 + margin-right: 32rpx;
  569 + color: rgba(0, 0, 0, 0.9);
  570 + }
  571 + }
  572 +
  573 + &.select-item {
  574 + &.is-empty {
  575 + .uni-list-item__extra-text {
  576 + color: rgba(0, 0, 0, 0.4) !important;
  577 + }
  578 + }
  579 +
  580 + &.is-filled {
  581 + .uni-list-item__extra-text {
  582 + color: rgba(0, 0, 0, 0.9) !important;
  583 + }
  584 + }
  585 + }
  586 +
  587 + &.mgb10 {
  588 + margin-bottom: 20rpx;
  589 + }
  590 + }
  591 +}
  592 +</style>
  593 +
... ...
  1 +<template>
  2 + <view class="page">
  3 + <scroll-view class="scroll" scroll-y>
  4 + <view class="detail-page">
  5 + <view class="section">
  6 + <text class="row company">{{ safeText(form.unitName) }}</text>
  7 + <view class="row"><text class="label">供应商</text><text class="value">{{ safeText(form.supplierName) }}</text></view>
  8 + <view class="row"><text class="label">公司性质</text><text class="value">{{ safeText(form.companyNature) }}</text></view>
  9 + <view class="row"><text class="label">法人代表</text><text class="value">{{ safeText(form.legalRepresentative) }}</text></view>
  10 + <view class="row"><text class="label">电话及传真</text><text class="value">{{ safeText(form.phoneFax) }}</text></view>
  11 + <view class="row"><text class="label">注册证书号</text><text class="value">{{ safeText(form.registrationCertificateNo) }}</text></view>
  12 + <view class="row"><text class="label">地址</text><text class="value">{{ safeText(form.address) }}</text></view>
  13 + <view class="row"><text class="label">国内业务负责人</text><text class="value">{{ safeText(form.domesticBusinessLeader) }}</text></view>
  14 + <view class="row"><text class="label">负责人身份证/护照号</text><text class="value">{{ safeText(form.leaderIdPassportNo) }}</text></view>
  15 + <view class="row"><text class="label">成立时间及货场规模</text><text class="value pre">{{ safeText(form.establishedTimeAndYardScale) }}</text></view>
  16 + <view class="row"><text class="label">经营品种、规模</text><text class="value pre">{{ safeText(form.overallBusinessVarietyScale) }}</text></view>
  17 + <view class="row"><text class="label">出口到国内时间</text><text class="value">{{ safeText(form.exportToDomesticTime) }}</text></view>
  18 + <view class="row"><text class="label">出口规模、品种</text><text class="value pre">{{ safeText(form.exportToDomesticScaleVariety) }}</text></view>
  19 + <view class="row"><text class="label">与国内合作企业</text><text class="value pre">{{ safeText(form.domesticCooperationCompanies) }}</text></view>
  20 + <view class="row"><text class="label">合作效果</text><text class="value pre">{{ safeText(form.cooperationEffect) }}</text></view>
  21 + <view class="row"><text class="label">供应商考察</text><text class="value pre">{{ safeText(form.supplierInspection) }}</text></view>
  22 + <view class="row"><text class="label">销售代表办公地考察</text><text class="value pre">{{ safeText(form.domesticSalesRepOfficeInspection) }}</text></view>
  23 + <view class="row"><text class="label">有无担保函</text><text class="value">{{ safeText(form.hasGuaranteeLetter) }}</text></view>
  24 + <view class="row"><text class="label">合同纠纷</text><text class="value pre">{{ safeText(form.contractDispute) }}</text></view>
  25 + <view class="row"><text class="label">保险、运输方式</text><text class="value">{{ safeText(form.insuranceTransportMode) }}</text></view>
  26 + <view class="row"><text class="label">滞箱滞报费用</text><text class="value">{{ safeText(form.demurrageFee) }}</text></view>
  27 + <view class="row"><text class="label">操作品种</text><text class="value">{{ safeText(form.operatingVariety) }}</text></view>
  28 + <view class="row"><text class="label">操作规模</text><text class="value">{{ safeText(form.operatingScale) }}</text></view>
  29 + <view class="row"><text class="label">定价模式</text><text class="value">{{ safeText(form.pricingModel) }}</text></view>
  30 + <view class="row"><text class="label">结算方式</text><text class="value">{{ safeText(form.settlementMethod) }}</text></view>
  31 + <view class="row"><text class="label">磅差约定</text><text class="value">{{ safeText(form.weightDiffAgreement) }}</text></view>
  32 + <view class="row"><text class="label">质量标准</text><text class="value">{{ safeText(form.qualityStandard) }}</text></view>
  33 + </view>
  34 +
  35 + <view class="title-header">
  36 + <image class="title-header_icon" src="/static/images/title.png" />
  37 + <span>供应商分类</span>
  38 + </view>
  39 + <view class="section">
  40 + <view class="row"><text class="label">供应商分类</text><text class="value">{{ safeText(supplierCategoryName) }}</text></view>
  41 + <view class="row"><text class="label">分类说明</text><text class="value pre">{{ safeText(supplierCategoryDesc) }}</text></view>
  42 + </view>
  43 +
  44 + <view class="title-header">
  45 + <image class="title-header_icon" src="/static/images/title.png" />
  46 + <span>操作方案</span>
  47 + </view>
  48 + <view class="section">
  49 + <view class="row"><text class="label">操作时间</text><text class="value">{{ safeText(form.operationTime) }}</text></view>
  50 + <view class="row"><text class="label">操作模式</text><text class="value">{{ safeText(form.operationMode) }}</text></view>
  51 + <view class="row"><text class="label">操作品种</text><text class="value">{{ safeText(form.operationVariety) }}</text></view>
  52 + <view class="row"><text class="label">操作数量</text><text class="value">{{ safeText(form.operationQuantity) }}</text></view>
  53 + <view class="row"><text class="label">发货要求</text><text class="value pre">{{ safeText(form.deliveryRequirement) }}</text></view>
  54 + <view class="row"><text class="label">付款方式</text><text class="value">{{ safeText(form.paymentMethod) }}</text></view>
  55 + <view class="row"><text class="label">下次评审时间</text><text class="value">{{ safeText(form.nextReviewTime) }}</text></view>
  56 + <view class="row"><text class="label">评审部门</text><text class="value">{{ safeText(form.reviewDepartment) }}</text></view>
  57 + <view v-if="reviewHint" class="hint">{{ reviewHint }}</view>
  58 + </view>
  59 +
  60 + <view v-if="auditStatusText !== '-'" class="section">
  61 + <view class="row"><text class="label">审核状态</text><text class="value">{{ auditStatusText }}</text></view>
  62 + </view>
  63 + </view>
  64 + </scroll-view>
  65 +
  66 + <detail-buttons :buttons="displayButtons" @click="handleButtonClick" />
  67 + </view>
  68 +</template>
  69 +
  70 +<script>
  71 +import DetailButtons from '@/components/detail-buttons/index.vue'
  72 +import { getDicByCodes, getDicName } from '@/utils/dic.js'
  73 +import { foreignCustomerCreditGetApi } from '@/api/procure-manage/foreignCustomerCredit.js'
  74 +
  75 +export default {
  76 + name: 'ForeignTradeDetail',
  77 + components: { DetailButtons },
  78 + data() {
  79 + return {
  80 + id: '',
  81 + loading: false,
  82 + form: {},
  83 + dicOptions: {
  84 + AUDIT_STATUS: []
  85 + },
  86 + buttons: [{
  87 + text: '编辑',
  88 + visible: true,
  89 + variant: 'outline',
  90 + event: 'edit',
  91 + }]
  92 + }
  93 + },
  94 + computed: {
  95 + displayButtons() {
  96 + return [{ ...this.buttons[0], visible: true }]
  97 + },
  98 + auditStatusText() {
  99 + const v = this.form && this.form.status != null ? String(this.form.status) : ''
  100 + if (!v) return '-'
  101 + return getDicName('AUDIT_STATUS', v, this.dicOptions.AUDIT_STATUS) || v
  102 + },
  103 + supplierCategoryName() {
  104 + const v = this.form && this.form.supplierCategory != null ? String(this.form.supplierCategory) : ''
  105 + const map = { A: 'A类供应商', B: 'B类供应商', C: 'C类供应商', D: 'D类供应商' }
  106 + return map[v] || (v ? v : '-')
  107 + },
  108 + supplierCategoryDesc() {
  109 + const v = this.form && this.form.supplierCategory != null ? String(this.form.supplierCategory) : ''
  110 + const map = {
  111 + A: '资信调查有担保函无资金风险、资料齐全,料质可控,价格较好,若出现质量、磅差问题可以索赔解决,进口倒挂时可协商延迟点价,可推迟发货,可试操作(前3个月每月操作量300-500吨);第一次计划货到厂验收结束后进行评审,正常后可以增量操作,要求每年评审一次;',
  112 + B: '资信调查无担保函,国外企业属国内企业控股,无资金风险、资料齐全,价格较好,料质可控,若出现质量、磅差问题可以索赔解决(前3个月每月操作量200-400吨),第一次货到厂验收合格后可增量操作;操作正常每年评审一次;',
  113 + C: '资信调查无担保函,资料齐全,料质可控,价格一般,出现质量、磅差问题可以索赔解决,可试单限量操作(前3个月每月操作量100-200吨),第一次货到厂验收合格后可增量操作,新开发供应商首年操作按每半年评审一次,操作正常则次年调整为每年评审一次;若出现索赔问题不及时解决可中止后续开信用证和中止到港货物的DP/TT付款,且立即暂停业务操作。',
  114 + D: '资信调查无担保函,通过委托第三方机构调查无风险,虽然资料不齐全,但料质可控,价格略高,出现质量、磅差问题索赔解决有难度,一单一议,D类供应商第一次货到厂验收、付款、退款或者索赔正常后,可继续操作逐步增量(每月操作量100-200吨),每半年评审一次,操作正常到则次年调整为每年评审一次;若出现索赔问题不及时解决可终止后续到港货物的付款,且立即停止业务操作。'
  115 + }
  116 + return map[v] || '-'
  117 + },
  118 + reviewHint() {
  119 + const d = this.parseDateOnly(this.form && this.form.nextReviewTime)
  120 + if (!d) return ''
  121 + const now = new Date()
  122 + const today = new Date(now.getFullYear(), now.getMonth(), now.getDate())
  123 + const diffDays = Math.floor((d.getTime() - today.getTime()) / (24 * 60 * 60 * 1000))
  124 + if (diffDays < 0) return '已到评审时间'
  125 + if (diffDays <= 15) return `距评审还有${diffDays}天`
  126 + return ''
  127 + }
  128 + },
  129 + created() {
  130 + this.loadDicData()
  131 + },
  132 + onShow() {
  133 + const options = (this.$route && this.$route.query) ? this.$route.query : {}
  134 + const id = options && options.id ? String(options.id) : ''
  135 + this.id = id
  136 + this.loadDetail()
  137 + },
  138 + methods: {
  139 + async loadDicData() {
  140 + try {
  141 + const results = await getDicByCodes(['AUDIT_STATUS'])
  142 + this.dicOptions.AUDIT_STATUS = (results.AUDIT_STATUS && results.AUDIT_STATUS.data) || []
  143 + } catch (e) {
  144 + this.dicOptions.AUDIT_STATUS = []
  145 + }
  146 + },
  147 + handleButtonClick(btn) {
  148 + if (!btn || btn.disabled) return
  149 + if (typeof btn.onClick === 'function') return btn.onClick(this.detail, btn.params)
  150 + const e = btn.event || ''
  151 + if (e === 'edit') return this.onEdit(btn && btn.params)
  152 + },
  153 + onEdit() {
  154 + uni.navigateTo({ url: '/pages/foreign_trade/modify?id=' + this.id })
  155 + },
  156 + safeText(v) {
  157 + const s = v == null ? '' : String(v)
  158 + return s.trim() ? s : '-'
  159 + },
  160 + parseDateOnly(v) {
  161 + const s = v == null ? '' : String(v).trim()
  162 + if (!s) return null
  163 + const d = new Date(s.length >= 10 ? s.slice(0, 10) : s)
  164 + if (!Number.isFinite(d.getTime())) return null
  165 + return new Date(d.getFullYear(), d.getMonth(), d.getDate())
  166 + },
  167 + async loadDetail() {
  168 + if (!this.id) return
  169 + this.loading = true
  170 + try {
  171 + const res = await foreignCustomerCreditGetApi(this.id)
  172 + const data = (res && res.data) ? res.data : {}
  173 + this.form = data
  174 + } catch (e) {
  175 + this.form = {}
  176 + uni.showToast({ title: '详情加载失败', icon: 'none' })
  177 + } finally {
  178 + this.loading = false
  179 + }
  180 + },
  181 + }
  182 +}
  183 +</script>
  184 +
  185 +<style lang="scss" scoped>
  186 +.page {
  187 + display: flex;
  188 + flex-direction: column;
  189 + height: 100%;
  190 +}
  191 +
  192 +.scroll {
  193 + flex: 1;
  194 + padding: 8rpx 0 144rpx;
  195 +}
  196 +
  197 +.detail-page {
  198 + background: #f3f3f3;
  199 +}
  200 +
  201 +.title-header {
  202 + display: flex;
  203 + align-items: center;
  204 + padding: 24rpx 32rpx 12rpx;
  205 + background-color: #ffffff;
  206 +
  207 + .title-header_icon {
  208 + width: 36rpx;
  209 + height: 36rpx;
  210 + margin-right: 12rpx;
  211 + }
  212 +
  213 + span {
  214 + font-size: 34rpx;
  215 + font-weight: 600;
  216 + color: rgba(0, 0, 0, 0.9);
  217 + }
  218 +}
  219 +
  220 +.section {
  221 + padding: 32rpx;
  222 + background: #fff;
  223 + margin-bottom: 20rpx;
  224 +}
  225 +
  226 +.row {
  227 + display: flex;
  228 + margin-bottom: 28rpx;
  229 +
  230 + &:last-child {
  231 + margin-bottom: 0;
  232 + }
  233 +
  234 + &.company {
  235 + font-size: 36rpx;
  236 + font-weight: 600;
  237 + color: rgba(0, 0, 0, 0.9);
  238 + padding-top: 8rpx;
  239 + line-height: 50rpx;
  240 + }
  241 +
  242 + .label {
  243 + max-width: 420rpx;
  244 + margin-right: 20rpx;
  245 + line-height: 32rpx;
  246 + font-size: 28rpx;
  247 + color: rgba(0, 0, 0, 0.6);
  248 + }
  249 +
  250 + .value {
  251 + flex: 1;
  252 + line-height: 32rpx;
  253 + font-size: 28rpx;
  254 + color: rgba(0, 0, 0, 0.9);
  255 + text-align: right;
  256 + word-break: break-all;
  257 +
  258 + &.pre {
  259 + white-space: pre-wrap;
  260 + }
  261 + }
  262 +}
  263 +
  264 +.hint {
  265 + margin-top: 12rpx;
  266 + font-size: 26rpx;
  267 + color: #D54941;
  268 + text-align: right;
  269 +}
  270 +</style>
  271 +
... ...
  1 +<template>
  2 + <view class="page">
  3 + <view class="dev-list-fixed">
  4 + <view class="search-row">
  5 + <uni-search-bar v-model="searchKeyword" radius="6" placeholder="请输入单位名称" clearButton="auto"
  6 + cancelButton="none" bgColor="#F3F3F3" textColor="rgba(0,0,0,0.4)" @confirm="search"
  7 + @input="onSearchInput" />
  8 + <view class="tool-icons">
  9 + <image class="tool-icon" src="/static/images/dev_manage/add_icon.png" @click="onAdd" />
  10 + <image class="tool-icon" src="/static/images/dev_manage/filter_icon.png" @click="openFilter" />
  11 + </view>
  12 + </view>
  13 + </view>
  14 +
  15 + <view class="list-box">
  16 + <card-list ref="cardRef" :fetch-fn="fetchList" :query="query" :extra="extraParams" row-key="id"
  17 + :enable-refresh="true" :enable-load-more="true" @loaded="onCardLoaded" @error="onCardError">
  18 + <template v-slot="{ item }">
  19 + <view class="card" @click.stop="onCardClick(item)">
  20 + <view class="card-header">
  21 + <text class="title omit2">{{ item.unitName || '-' }}</text>
  22 + <text :class="['status', `status_${item.status}`]">{{ getAuditStatusText(item.status) }}</text>
  23 + </view>
  24 + <view class="info-row">
  25 + <text>供应商</text><text>{{ item.supplierName || '-' }}</text>
  26 + </view>
  27 + <view class="info-row">
  28 + <text>供应商分类</text><text>{{ supplierCategoryText(item.supplierCategory) }}</text>
  29 + </view>
  30 + <view class="info-row">
  31 + <text>下次评审时间</text><text>{{ formatDateOnly(item.nextReviewTime) }}</text>
  32 + </view>
  33 + <view class="info-row">
  34 + <text>登记日期</text><text>{{ formatDateOnly(item.createTime) }}</text>
  35 + </view>
  36 + <view v-if="reviewHint(item)" class="review-hint">{{ reviewHint(item) }}</view>
  37 + </view>
  38 + </template>
  39 + </card-list>
  40 + </view>
  41 +
  42 + <filter-modal :visible.sync="filterVisible" :value.sync="filterForm" title="筛选" @reset="onFilterReset"
  43 + @confirm="onFilterConfirm">
  44 + <template v-slot="{ model }">
  45 + <view class="filter-form">
  46 + <view class="form-item">
  47 + <view class="label">审核状态</view>
  48 + <uni-data-checkbox mode="tag" :multiple="false" :value-field="'value'" :text-field="'text'"
  49 + v-model="model.status" @change="onAuditStatusChange" :localdata="statusOptions" />
  50 + </view>
  51 + <view class="form-item">
  52 + <view class="label">登记日期</view>
  53 + <uni-datetime-picker type="daterange" v-model="model.dateRange" start="2023-01-01" />
  54 + </view>
  55 + </view>
  56 + </template>
  57 + </filter-modal>
  58 + </view>
  59 +</template>
  60 +
  61 +<script>
  62 +import CardList from '@/components/card/index.vue'
  63 +import FilterModal from '@/components/filter/index.vue'
  64 +import { getDicByCodes, getDicName } from '@/utils/dic.js'
  65 +import { foreignCustomerCreditQueryApi } from '@/api/procure-manage/foreignCustomerCredit.js'
  66 +
  67 +export default {
  68 + name: 'ForeignTradeList',
  69 + components: { CardList, FilterModal },
  70 + data() {
  71 + return {
  72 + searchKeyword: '',
  73 + searchKeywordDebounced: '',
  74 + searchDebounceTimer: null,
  75 + query: {
  76 + unitName: '',
  77 + status: '',
  78 + dateRange: []
  79 + },
  80 + extraParams: {},
  81 + currentItems: [],
  82 + filterVisible: false,
  83 + filterForm: {
  84 + status: '',
  85 + dateRange: []
  86 + },
  87 + statusOptions: [
  88 + { value: '', text: '全部' }
  89 + ],
  90 + dicOptions: {
  91 + AUDIT_STATUS: []
  92 + },
  93 + }
  94 + },
  95 + watch: {
  96 + searchKeywordDebounced(v) {
  97 + this.query = { ...this.query, unitName: v || '' }
  98 + }
  99 + },
  100 + created() {
  101 + this.loadDicData()
  102 + },
  103 + onShow() {
  104 + let needRefresh = ''
  105 + try { needRefresh = uni.getStorageSync('FOREIGN_TRADE_LIST_NEED_REFRESH') } catch (e) {}
  106 + if (!needRefresh) return
  107 + try { uni.removeStorageSync('FOREIGN_TRADE_LIST_NEED_REFRESH') } catch (e) {}
  108 + if (this.$refs && this.$refs.cardRef && this.$refs.cardRef.reload) {
  109 + this.$refs.cardRef.reload()
  110 + }
  111 + },
  112 + onReachBottom() {
  113 + if (this.$refs && this.$refs.cardRef && this.$refs.cardRef.onLoadMore) {
  114 + this.$refs.cardRef.onLoadMore()
  115 + }
  116 + },
  117 + beforeDestroy() {
  118 + if (this.searchDebounceTimer) {
  119 + clearTimeout(this.searchDebounceTimer)
  120 + this.searchDebounceTimer = null
  121 + }
  122 + },
  123 + methods: {
  124 + async loadDicData() {
  125 + try {
  126 + const results = await getDicByCodes(['AUDIT_STATUS'])
  127 + this.dicOptions.AUDIT_STATUS = (results.AUDIT_STATUS && results.AUDIT_STATUS.data) || []
  128 + const list = Array.isArray(this.dicOptions.AUDIT_STATUS) ? this.dicOptions.AUDIT_STATUS : []
  129 + this.statusOptions = [{ value: '', text: '全部' }].concat(
  130 + list.map(it => ({ value: it && it.code != null ? String(it.code) : '', text: it && it.name != null ? String(it.name) : '' })).filter(it => it.value)
  131 + )
  132 + } catch (e) {
  133 + this.dicOptions.AUDIT_STATUS = []
  134 + this.statusOptions = [{ value: '', text: '全部' }]
  135 + }
  136 + },
  137 + supplierCategoryText(v) {
  138 + const s = v == null ? '' : String(v).trim()
  139 + if (!s) return '-'
  140 + const map = { A: 'A类供应商', B: 'B类供应商', C: 'C类供应商', D: 'D类供应商' }
  141 + return map[s] || s
  142 + },
  143 + formatDateOnly(v) {
  144 + const s = v == null ? '' : String(v).trim()
  145 + if (!s) return '-'
  146 + if (s.length >= 10) return s.slice(0, 10)
  147 + return s
  148 + },
  149 + parseDateOnly(v) {
  150 + const s = v == null ? '' : String(v).trim()
  151 + if (!s) return null
  152 + const d = new Date(s.length >= 10 ? s.slice(0, 10) : s)
  153 + if (!Number.isFinite(d.getTime())) return null
  154 + return new Date(d.getFullYear(), d.getMonth(), d.getDate())
  155 + },
  156 + reviewHint(item) {
  157 + const nextReviewTime = item && item.nextReviewTime != null ? String(item.nextReviewTime) : ''
  158 + const d = this.parseDateOnly(nextReviewTime)
  159 + if (!d) return ''
  160 + const now = new Date()
  161 + const today = new Date(now.getFullYear(), now.getMonth(), now.getDate())
  162 + const diffDays = Math.floor((d.getTime() - today.getTime()) / (24 * 60 * 60 * 1000))
  163 + if (diffDays < 0) return '已到评审时间'
  164 + if (diffDays <= 15) return `距评审还有${diffDays}天`
  165 + return ''
  166 + },
  167 + onAdd() {
  168 + uni.navigateTo({ url: '/pages/foreign_trade/add' })
  169 + },
  170 + onCardLoaded({ items }) {
  171 + this.currentItems = items
  172 + },
  173 + onCardError() {
  174 + uni.showToast({ title: '列表加载失败', icon: 'none' })
  175 + },
  176 + onSearchInput() {
  177 + if (this.searchDebounceTimer) clearTimeout(this.searchDebounceTimer)
  178 + this.searchDebounceTimer = setTimeout(() => {
  179 + this.searchKeywordDebounced = this.searchKeyword
  180 + this.searchDebounceTimer = null
  181 + }, 1200)
  182 + },
  183 + search(e) {
  184 + const val = e && e.value != null ? e.value : this.searchKeyword
  185 + this.searchKeyword = val
  186 + this.searchKeywordDebounced = val
  187 + },
  188 + openFilter() {
  189 + this.filterForm = {
  190 + status: this.query.status || '',
  191 + dateRange: Array.isArray(this.query.dateRange) ? this.query.dateRange.slice(0) : []
  192 + }
  193 + this.filterVisible = true
  194 + },
  195 + onFilterReset(payload) {
  196 + this.filterForm = payload
  197 + },
  198 + onFilterConfirm(payload) {
  199 + this.query = {
  200 + unitName: this.query.unitName || '',
  201 + status: payload.status || '',
  202 + dateRange: Array.isArray(payload.dateRange) ? payload.dateRange : []
  203 + }
  204 + },
  205 + onAuditStatusChange(e) {
  206 + const raw = e && e.detail && e.detail.value !== undefined ? e.detail.value : (e && e.value !== undefined ? e.value : '')
  207 + this.filterForm.status = raw
  208 + },
  209 + getAuditStatusText(status) {
  210 + const v = status == null ? '' : String(status)
  211 + if (!v) return '-'
  212 + return getDicName('AUDIT_STATUS', v, this.dicOptions.AUDIT_STATUS) || v
  213 + },
  214 + fetchList({ pageIndex, pageSize, query }) {
  215 + const q = query || {}
  216 + const range = Array.isArray(q.dateRange) ? q.dateRange : []
  217 + const params = {
  218 + pageIndex,
  219 + pageSize,
  220 + unitName: q.unitName || '',
  221 + status: q.status || '',
  222 + createDateStart: (range && range.length === 2) ? range[0] : '',
  223 + createDateEnd: (range && range.length === 2) ? range[1] : ''
  224 + }
  225 + return foreignCustomerCreditQueryApi(params).then(res => {
  226 + const _data = res && res.data ? res.data : {}
  227 + let records = _data.datas || _data.list || _data.records || []
  228 + const totalCount = _data.totalCount || _data.count || 0
  229 + const hasNext = _data.hasNext || false
  230 + records = records.map(it => ({ ...it }))
  231 + return { records, totalCount, hasNext }
  232 + }).catch(() => {
  233 + this.onCardError()
  234 + return { records: [], totalCount: 0, hasNext: false }
  235 + })
  236 + },
  237 + onCardClick(item) {
  238 + uni.navigateTo({ url: '/pages/foreign_trade/detail?id=' + item.id })
  239 + },
  240 + }
  241 +}
  242 +</script>
  243 +
  244 +<style lang="scss" scoped>
  245 +.page {
  246 + display: flex;
  247 + flex-direction: column;
  248 + height: 100vh;
  249 +}
  250 +
  251 +.dev-list-fixed {
  252 + position: fixed;
  253 + top: 96rpx;
  254 + left: 0;
  255 + right: 0;
  256 + z-index: 2;
  257 + background: #fff;
  258 +
  259 + .search-row {
  260 + display: flex;
  261 + align-items: center;
  262 + padding: 16rpx 32rpx;
  263 +
  264 + .uni-searchbar {
  265 + padding: 0;
  266 + flex: 1;
  267 + }
  268 +
  269 + .tool-icons {
  270 + display: flex;
  271 +
  272 + .tool-icon {
  273 + width: 48rpx;
  274 + height: 48rpx;
  275 + display: block;
  276 + margin-left: 32rpx;
  277 + }
  278 + }
  279 + }
  280 +}
  281 +
  282 +::v-deep .uni-searchbar__box {
  283 + height: 80rpx !important;
  284 + justify-content: start;
  285 +
  286 + .uni-searchbar__box-search-input {
  287 + font-size: 32rpx !important;
  288 + }
  289 +}
  290 +
  291 +.list-box {
  292 + flex: 1;
  293 + padding-top: 140rpx;
  294 +
  295 + .card {
  296 + position: relative;
  297 + }
  298 +
  299 + .card-header {
  300 + margin-bottom: 28rpx;
  301 + position: relative;
  302 +
  303 + .title {
  304 + font-size: 36rpx;
  305 + font-weight: 600;
  306 + line-height: 50rpx;
  307 + color: rgba(0, 0, 0, 0.9);
  308 + width: 578rpx;
  309 + }
  310 +
  311 + .status {
  312 + position: absolute;
  313 + top: -32rpx;
  314 + right: -12rpx;
  315 + height: 48rpx;
  316 + line-height: 48rpx;
  317 + font-weight: 600;
  318 + color: #fff;
  319 + font-size: 24rpx;
  320 + padding: 0 14rpx;
  321 + border-radius: 6rpx;
  322 +
  323 + &.status_AUDIT {
  324 + background: $theme-primary;
  325 + }
  326 +
  327 + &.status_PASS {
  328 + background: #2BA471;
  329 + }
  330 +
  331 + &.status_REFUSE {
  332 + background: #D54941;
  333 + }
  334 +
  335 + &.status_CANCEL {
  336 + background: #E7E7E7;
  337 + color: rgba(0, 0, 0, 0.9);
  338 + }
  339 + }
  340 + }
  341 +
  342 + .info-row {
  343 + display: flex;
  344 + align-items: center;
  345 + color: rgba(0, 0, 0, 0.6);
  346 + font-size: 28rpx;
  347 + margin-bottom: 24rpx;
  348 + height: 32rpx;
  349 +
  350 + &:last-child {
  351 + margin-bottom: 0;
  352 + }
  353 +
  354 + text {
  355 + width: 50%;
  356 +
  357 + &:last-child {
  358 + color: rgba(0, 0, 0, 0.9);
  359 + width: 50%;
  360 + }
  361 + }
  362 + }
  363 +
  364 + .review-hint {
  365 + margin-top: 12rpx;
  366 + font-size: 26rpx;
  367 + color: #D54941;
  368 + }
  369 +}
  370 +
  371 +.filter-form {
  372 + .form-item {
  373 + margin-bottom: 24rpx;
  374 + }
  375 +
  376 + .label {
  377 + margin-bottom: 20rpx;
  378 + color: rgba(0, 0, 0, 0.9);
  379 + height: 44rpx;
  380 + line-height: 44rpx;
  381 + font-size: 30rpx;
  382 + }
  383 +}
  384 +</style>
... ...
  1 +<template>
  2 + <view class="page">
  3 + <scroll-view class="scroll" scroll-y>
  4 + <uni-list>
  5 + <view class="title-header">
  6 + <image class="title-header_icon" src="/static/images/title.png" />
  7 + <span>供应商</span>
  8 + </view>
  9 +
  10 + <uni-list-item class="select-item" :class="form.supplierName ? 'is-filled' : 'is-empty'" clickable
  11 + @click="openSheet('supplier')" :rightText="displayLabel('supplierName')" showArrow>
  12 + <template v-slot:body>
  13 + <view class="item-title"><text>供应商</text></view>
  14 + </template>
  15 + </uni-list-item>
  16 +
  17 + <view class="title-header">
  18 + <image class="title-header_icon" src="/static/images/title.png" />
  19 + <span>基本资料</span>
  20 + </view>
  21 +
  22 + <uni-list-item title="单位名称">
  23 + <template v-slot:footer>
  24 + <uni-easyinput v-model="form.unitName" placeholder="请输入" :inputBorder="false" />
  25 + </template>
  26 + </uni-list-item>
  27 +
  28 + <uni-list-item title="公司性质">
  29 + <template v-slot:footer>
  30 + <uni-easyinput v-model="form.companyNature" placeholder="请输入" :inputBorder="false" />
  31 + </template>
  32 + </uni-list-item>
  33 +
  34 + <uni-list-item title="法人代表">
  35 + <template v-slot:footer>
  36 + <uni-easyinput v-model="form.legalRepresentative" placeholder="请输入" :inputBorder="false" />
  37 + </template>
  38 + </uni-list-item>
  39 +
  40 + <uni-list-item title="电话及传真">
  41 + <template v-slot:footer>
  42 + <uni-easyinput v-model="form.phoneFax" placeholder="请输入" :inputBorder="false" />
  43 + </template>
  44 + </uni-list-item>
  45 +
  46 + <uni-list-item title="注册证书号">
  47 + <template v-slot:footer>
  48 + <uni-easyinput v-model="form.registrationCertificateNo" placeholder="请输入" :inputBorder="false" />
  49 + </template>
  50 + </uni-list-item>
  51 +
  52 + <uni-list-item title="地址">
  53 + <template v-slot:footer>
  54 + <uni-easyinput v-model="form.address" placeholder="请输入" :inputBorder="false" />
  55 + </template>
  56 + </uni-list-item>
  57 +
  58 + <uni-list-item title="国内业务负责人">
  59 + <template v-slot:footer>
  60 + <uni-easyinput v-model="form.domesticBusinessLeader" placeholder="请输入" :inputBorder="false" />
  61 + </template>
  62 + </uni-list-item>
  63 +
  64 + <uni-list-item title="负责人身份证/护照号">
  65 + <template v-slot:footer>
  66 + <uni-easyinput v-model="form.leaderIdPassportNo" placeholder="请输入" :inputBorder="false" />
  67 + </template>
  68 + </uni-list-item>
  69 +
  70 + <uni-list-item title="成立时间及货场规模">
  71 + <template v-slot:footer>
  72 + <uni-easyinput type="textarea" v-model="form.establishedTimeAndYardScale" placeholder="请输入" :inputBorder="false" maxlength="2000" />
  73 + </template>
  74 + </uni-list-item>
  75 +
  76 + <uni-list-item title="经营品种、规模">
  77 + <template v-slot:footer>
  78 + <uni-easyinput type="textarea" v-model="form.overallBusinessVarietyScale" placeholder="请输入" :inputBorder="false" maxlength="2000" />
  79 + </template>
  80 + </uni-list-item>
  81 +
  82 + <uni-list-item title="出口到国内时间">
  83 + <template v-slot:footer>
  84 + <uni-easyinput v-model="form.exportToDomesticTime" placeholder="请输入" :inputBorder="false" />
  85 + </template>
  86 + </uni-list-item>
  87 +
  88 + <uni-list-item title="出口规模、品种">
  89 + <template v-slot:footer>
  90 + <uni-easyinput type="textarea" v-model="form.exportToDomesticScaleVariety" placeholder="请输入" :inputBorder="false" maxlength="2000" />
  91 + </template>
  92 + </uni-list-item>
  93 +
  94 + <uni-list-item title="与国内合作企业">
  95 + <template v-slot:footer>
  96 + <uni-easyinput type="textarea" v-model="form.domesticCooperationCompanies" placeholder="请输入" :inputBorder="false" maxlength="2000" />
  97 + </template>
  98 + </uni-list-item>
  99 +
  100 + <uni-list-item title="合作效果">
  101 + <template v-slot:footer>
  102 + <uni-easyinput type="textarea" v-model="form.cooperationEffect" placeholder="请输入" :inputBorder="false" maxlength="2000" />
  103 + </template>
  104 + </uni-list-item>
  105 +
  106 + <uni-list-item title="供应商考察">
  107 + <template v-slot:footer>
  108 + <uni-easyinput type="textarea" v-model="form.supplierInspection" placeholder="请输入" :inputBorder="false" maxlength="2000" />
  109 + </template>
  110 + </uni-list-item>
  111 +
  112 + <uni-list-item title="销售代表办公地考察">
  113 + <template v-slot:footer>
  114 + <uni-easyinput type="textarea" v-model="form.domesticSalesRepOfficeInspection" placeholder="请输入" :inputBorder="false" maxlength="2000" />
  115 + </template>
  116 + </uni-list-item>
  117 +
  118 + <uni-list-item title="有无担保函">
  119 + <template v-slot:footer>
  120 + <uni-easyinput v-model="form.hasGuaranteeLetter" placeholder="请输入" :inputBorder="false" />
  121 + </template>
  122 + </uni-list-item>
  123 +
  124 + <uni-list-item title="合同纠纷">
  125 + <template v-slot:footer>
  126 + <uni-easyinput type="textarea" v-model="form.contractDispute" placeholder="请输入" :inputBorder="false" maxlength="2000" />
  127 + </template>
  128 + </uni-list-item>
  129 +
  130 + <uni-list-item title="保险、运输方式">
  131 + <template v-slot:footer>
  132 + <uni-easyinput v-model="form.insuranceTransportMode" placeholder="请输入" :inputBorder="false" />
  133 + </template>
  134 + </uni-list-item>
  135 +
  136 + <uni-list-item title="滞箱滞报费用">
  137 + <template v-slot:footer>
  138 + <uni-easyinput v-model="form.demurrageFee" placeholder="请输入" :inputBorder="false" />
  139 + </template>
  140 + </uni-list-item>
  141 +
  142 + <uni-list-item title="操作品种">
  143 + <template v-slot:footer>
  144 + <uni-easyinput v-model="form.operatingVariety" placeholder="请输入" :inputBorder="false" />
  145 + </template>
  146 + </uni-list-item>
  147 +
  148 + <uni-list-item title="操作规模">
  149 + <template v-slot:footer>
  150 + <uni-easyinput v-model="form.operatingScale" placeholder="请输入" :inputBorder="false" />
  151 + </template>
  152 + </uni-list-item>
  153 +
  154 + <uni-list-item title="定价模式">
  155 + <template v-slot:footer>
  156 + <uni-easyinput v-model="form.pricingModel" placeholder="请输入" :inputBorder="false" />
  157 + </template>
  158 + </uni-list-item>
  159 +
  160 + <uni-list-item title="结算方式">
  161 + <template v-slot:footer>
  162 + <uni-easyinput v-model="form.settlementMethod" placeholder="请输入" :inputBorder="false" />
  163 + </template>
  164 + </uni-list-item>
  165 +
  166 + <uni-list-item title="磅差约定">
  167 + <template v-slot:footer>
  168 + <uni-easyinput v-model="form.weightDiffAgreement" placeholder="请输入" :inputBorder="false" />
  169 + </template>
  170 + </uni-list-item>
  171 +
  172 + <uni-list-item class="mgb10" title="质量标准">
  173 + <template v-slot:footer>
  174 + <uni-easyinput v-model="form.qualityStandard" placeholder="请输入" :inputBorder="false" />
  175 + </template>
  176 + </uni-list-item>
  177 +
  178 + <view class="title-header">
  179 + <image class="title-header_icon" src="/static/images/title.png" />
  180 + <span>供应商分类</span>
  181 + </view>
  182 +
  183 + <uni-list-item class="select-item mgb10" :class="form.supplierCategory ? 'is-filled' : 'is-empty'" clickable
  184 + @click="openSheet('supplierCategory')" :rightText="displayLabel('supplierCategory')" showArrow>
  185 + <template v-slot:body>
  186 + <view class="item-title"><text>供应商分类</text></view>
  187 + </template>
  188 + </uni-list-item>
  189 +
  190 + <view class="title-header">
  191 + <image class="title-header_icon" src="/static/images/title.png" />
  192 + <span>操作方案</span>
  193 + </view>
  194 +
  195 + <uni-list-item title="操作时间">
  196 + <template v-slot:footer>
  197 + <uni-easyinput v-model="form.operationTime" placeholder="请输入" :inputBorder="false" />
  198 + </template>
  199 + </uni-list-item>
  200 +
  201 + <uni-list-item title="操作模式">
  202 + <template v-slot:footer>
  203 + <uni-easyinput v-model="form.operationMode" placeholder="请输入" :inputBorder="false" />
  204 + </template>
  205 + </uni-list-item>
  206 +
  207 + <uni-list-item title="操作品种">
  208 + <template v-slot:footer>
  209 + <uni-easyinput v-model="form.operationVariety" placeholder="请输入" :inputBorder="false" />
  210 + </template>
  211 + </uni-list-item>
  212 +
  213 + <uni-list-item title="操作数量">
  214 + <template v-slot:footer>
  215 + <uni-easyinput v-model="form.operationQuantity" placeholder="请输入" :inputBorder="false" />
  216 + </template>
  217 + </uni-list-item>
  218 +
  219 + <uni-list-item title="发货要求">
  220 + <template v-slot:footer>
  221 + <uni-easyinput type="textarea" v-model="form.deliveryRequirement" placeholder="请输入" :inputBorder="false" maxlength="2000" />
  222 + </template>
  223 + </uni-list-item>
  224 +
  225 + <uni-list-item title="付款方式">
  226 + <template v-slot:footer>
  227 + <uni-easyinput v-model="form.paymentMethod" placeholder="请输入" :inputBorder="false" />
  228 + </template>
  229 + </uni-list-item>
  230 +
  231 + <uni-list-item title="下次评审时间">
  232 + <template v-slot:footer>
  233 + <uni-datetime-picker type="date" v-model="form.nextReviewTime" />
  234 + </template>
  235 + </uni-list-item>
  236 +
  237 + <uni-list-item class="mgb10" title="评审部门">
  238 + <template v-slot:footer>
  239 + <uni-easyinput v-model="form.reviewDepartment" placeholder="请输入" :inputBorder="false" />
  240 + </template>
  241 + </uni-list-item>
  242 + </uni-list>
  243 + </scroll-view>
  244 +
  245 + <view class="footer">
  246 + <button class="btn submit" type="primary" :disabled="submitting" @click="onSubmit">{{ submitting ? '保存中...' : '保存' }}</button>
  247 + </view>
  248 +
  249 + <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value"
  250 + @confirm="onSheetConfirm" />
  251 + </view>
  252 +</template>
  253 +
  254 +<script>
  255 +import SingleSelectSheet from '@/components/single-select/index.vue'
  256 +import { getDicByCodes } from '@/utils/dic.js'
  257 +import { foreignCustomerCreditGetApi, foreignCustomerCreditSaveApi } from '@/api/procure-manage/foreignCustomerCredit.js'
  258 +
  259 +export default {
  260 + name: 'ForeignTradeModify',
  261 + components: { SingleSelectSheet },
  262 + data() {
  263 + return {
  264 + id: '',
  265 + submitting: false,
  266 + loading: false,
  267 + supplierOptions: [],
  268 + supplierCategoryOptions: [
  269 + { label: 'A类供应商', value: 'A' },
  270 + { label: 'B类供应商', value: 'B' },
  271 + { label: 'C类供应商', value: 'C' },
  272 + { label: 'D类供应商', value: 'D' }
  273 + ],
  274 + sheet: { visible: false, title: '', options: [], field: '', value: '' },
  275 + form: {
  276 + id: '',
  277 + supplier: '',
  278 + supplierName: '',
  279 + unitName: '',
  280 + companyNature: '',
  281 + legalRepresentative: '',
  282 + phoneFax: '',
  283 + registrationCertificateNo: '',
  284 + address: '',
  285 + domesticBusinessLeader: '',
  286 + leaderIdPassportNo: '',
  287 + establishedTimeAndYardScale: '',
  288 + overallBusinessVarietyScale: '',
  289 + exportToDomesticTime: '',
  290 + exportToDomesticScaleVariety: '',
  291 + domesticCooperationCompanies: '',
  292 + cooperationEffect: '',
  293 + supplierInspection: '',
  294 + domesticSalesRepOfficeInspection: '',
  295 + hasGuaranteeLetter: '',
  296 + contractDispute: '',
  297 + insuranceTransportMode: '',
  298 + demurrageFee: '',
  299 + operatingVariety: '',
  300 + operatingScale: '',
  301 + pricingModel: '',
  302 + settlementMethod: '',
  303 + weightDiffAgreement: '',
  304 + qualityStandard: '',
  305 + supplierCategory: '',
  306 + operationTime: '',
  307 + operationMode: '',
  308 + operationVariety: '',
  309 + operationQuantity: '',
  310 + deliveryRequirement: '',
  311 + paymentMethod: '',
  312 + nextReviewTime: '',
  313 + reviewDepartment: ''
  314 + }
  315 + }
  316 + },
  317 + async onLoad(query) {
  318 + const id = (query && (query.id || query.code)) ? String(query.id || query.code) : ''
  319 + this.id = id
  320 + await this.loadSupplierOptions()
  321 + await this.loadDetail()
  322 + },
  323 + methods: {
  324 + async loadSupplierOptions() {
  325 + try {
  326 + const results = await getDicByCodes(['SUPPLIER'])
  327 + const items = results && results.SUPPLIER && results.SUPPLIER.data ? results.SUPPLIER.data : []
  328 + this.supplierOptions = (Array.isArray(items) ? items : []).map(it => ({
  329 + label: it && it.name != null ? String(it.name) : '',
  330 + value: it && it.code != null ? String(it.code) : ''
  331 + })).filter(it => it.value)
  332 + } catch (e) {
  333 + this.supplierOptions = []
  334 + }
  335 + },
  336 + displayLabel(field) {
  337 + const m = this.form || {}
  338 + const map = {
  339 + supplierName: '请选择',
  340 + supplierCategory: '请选择'
  341 + }
  342 + const v = m[field]
  343 + if (v != null && String(v).trim()) return String(v)
  344 + if (field === 'supplierCategory') {
  345 + const code = m.supplierCategory
  346 + const found = (this.supplierCategoryOptions || []).find(o => String(o.value) === String(code))
  347 + return found ? String(found.label || '') : map[field]
  348 + }
  349 + return map[field] || '请选择'
  350 + },
  351 + openSheet(field) {
  352 + const map = {
  353 + supplier: { title: '选择供应商', options: this.supplierOptions, valueField: 'supplier', labelField: 'supplierName' },
  354 + supplierCategory: { title: '供应商分类', options: this.supplierCategoryOptions, valueField: 'supplierCategory', labelField: '' }
  355 + }
  356 + const cfg = map[field]
  357 + if (!cfg) return
  358 + const current = this.form[cfg.valueField]
  359 + const match = (cfg.options || []).find(o => String(o.value) === String(current))
  360 + this.sheet = {
  361 + ...this.sheet,
  362 + visible: true,
  363 + title: cfg.title,
  364 + options: cfg.options || [],
  365 + field,
  366 + value: match ? match.value : current
  367 + }
  368 + },
  369 + onSheetConfirm({ value, label }) {
  370 + const field = this.sheet.field
  371 + if (field === 'supplier') {
  372 + this.form.supplier = value
  373 + this.form.supplierName = label
  374 + }
  375 + if (field === 'supplierCategory') {
  376 + this.form.supplierCategory = value
  377 + }
  378 + this.sheet.visible = false
  379 + },
  380 + async loadDetail() {
  381 + if (!this.id) return
  382 + this.loading = true
  383 + try {
  384 + const res = await foreignCustomerCreditGetApi(this.id)
  385 + const data = (res && res.data) ? res.data : {}
  386 + this.form = { ...this.form, ...data, id: this.id }
  387 + if (!this.form.supplierName && this.form.supplier) {
  388 + const found = (this.supplierOptions || []).find(o => String(o.value) === String(this.form.supplier))
  389 + if (found) this.form.supplierName = String(found.label || '')
  390 + }
  391 + } catch (e) {
  392 + uni.showToast({ title: '详情加载失败', icon: 'none' })
  393 + } finally {
  394 + this.loading = false
  395 + }
  396 + },
  397 + validate() {
  398 + const requiredFields = [
  399 + { key: 'supplier', label: '供应商' },
  400 + { key: 'unitName', label: '单位名称' },
  401 + { key: 'companyNature', label: '公司性质' },
  402 + { key: 'legalRepresentative', label: '法人代表' },
  403 + { key: 'phoneFax', label: '电话及传真' },
  404 + { key: 'registrationCertificateNo', label: '注册证书号' },
  405 + { key: 'address', label: '地址' },
  406 + { key: 'domesticBusinessLeader', label: '国内业务负责人' },
  407 + { key: 'leaderIdPassportNo', label: '负责人身份证/护照号' },
  408 + { key: 'establishedTimeAndYardScale', label: '成立时间及货场规模' },
  409 + { key: 'overallBusinessVarietyScale', label: '经营品种、规模' },
  410 + { key: 'exportToDomesticTime', label: '出口到国内时间' },
  411 + { key: 'exportToDomesticScaleVariety', label: '出口规模、品种' },
  412 + { key: 'domesticCooperationCompanies', label: '与国内合作企业' },
  413 + { key: 'cooperationEffect', label: '合作效果' },
  414 + { key: 'supplierInspection', label: '供应商考察' },
  415 + { key: 'domesticSalesRepOfficeInspection', label: '销售代表办公地考察' },
  416 + { key: 'hasGuaranteeLetter', label: '有无担保函' },
  417 + { key: 'contractDispute', label: '合同纠纷' },
  418 + { key: 'insuranceTransportMode', label: '保险、运输方式' },
  419 + { key: 'demurrageFee', label: '滞箱滞报费用' },
  420 + { key: 'operatingVariety', label: '操作品种' },
  421 + { key: 'operatingScale', label: '操作规模' },
  422 + { key: 'pricingModel', label: '定价模式' },
  423 + { key: 'settlementMethod', label: '结算方式' },
  424 + { key: 'weightDiffAgreement', label: '磅差约定' },
  425 + { key: 'qualityStandard', label: '质量标准' },
  426 + { key: 'supplierCategory', label: '供应商分类' },
  427 + { key: 'operationTime', label: '操作时间' },
  428 + { key: 'operationMode', label: '操作模式' },
  429 + { key: 'operationVariety', label: '操作品种' },
  430 + { key: 'operationQuantity', label: '操作数量' },
  431 + { key: 'deliveryRequirement', label: '发货要求' },
  432 + { key: 'paymentMethod', label: '付款方式' },
  433 + { key: 'nextReviewTime', label: '下次评审时间' },
  434 + { key: 'reviewDepartment', label: '评审部门' }
  435 + ]
  436 + for (let i = 0; i < requiredFields.length; i++) {
  437 + const f = requiredFields[i]
  438 + const v = this.form && this.form[f.key]
  439 + if (v == null || String(v).trim() === '') {
  440 + uni.showToast({ title: `${f.label}必填`, icon: 'none' })
  441 + return false
  442 + }
  443 + }
  444 + return true
  445 + },
  446 + buildPayload() {
  447 + return { ...this.form, id: this.id }
  448 + },
  449 + async onSubmit() {
  450 + if (this.submitting) return
  451 + if (!this.validate()) return
  452 + this.submitting = true
  453 + const payload = this.buildPayload()
  454 + try {
  455 + await foreignCustomerCreditSaveApi(payload)
  456 + uni.showToast({ title: '保存成功', icon: 'success' })
  457 + try { uni.setStorageSync('FOREIGN_TRADE_LIST_NEED_REFRESH', '1') } catch (e) {}
  458 + setTimeout(() => { uni.navigateBack() }, 300)
  459 + } catch (e) {
  460 + uni.showToast({ title: (e && e.msg) || '保存失败', icon: 'none' })
  461 + } finally {
  462 + this.submitting = false
  463 + }
  464 + },
  465 + }
  466 +}
  467 +</script>
  468 +
  469 +<style lang="scss" scoped>
  470 +.page {
  471 + display: flex;
  472 + flex-direction: column;
  473 + height: 100%;
  474 +}
  475 +
  476 +.scroll {
  477 + flex: 1;
  478 + padding: 12rpx 0 160rpx;
  479 +}
  480 +
  481 +.footer {
  482 + position: fixed;
  483 + left: 0;
  484 + right: 0;
  485 + bottom: 0;
  486 + padding: 32rpx;
  487 + padding-bottom: calc(32rpx + env(safe-area-inset-bottom));
  488 + background: #fff;
  489 + box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.06);
  490 + z-index: 10;
  491 +
  492 + .btn {
  493 + height: 80rpx;
  494 + line-height: 80rpx;
  495 + border-radius: 12rpx;
  496 + font-size: 32rpx;
  497 + }
  498 +
  499 + .submit {
  500 + background: $theme-primary;
  501 + color: #fff;
  502 + }
  503 +}
  504 +
  505 +.title-header {
  506 + display: flex;
  507 + align-items: center;
  508 + padding: 24rpx 32rpx 12rpx;
  509 + background-color: #ffffff;
  510 +
  511 + .title-header_icon {
  512 + width: 36rpx;
  513 + height: 36rpx;
  514 + margin-right: 12rpx;
  515 + }
  516 +
  517 + span {
  518 + font-size: 34rpx;
  519 + font-weight: 600;
  520 + color: rgba(0, 0, 0, 0.9);
  521 + }
  522 +}
  523 +
  524 +.mgb10 {
  525 + margin-bottom: 20rpx;
  526 +}
  527 +
  528 +::v-deep .uni-list {
  529 + .uni-easyinput {
  530 + display: flex;
  531 +
  532 + .uni-input-input {
  533 + color: rgba(0, 0, 0, 0.9);
  534 + }
  535 + }
  536 +
  537 + .uni-input-placeholder {
  538 + z-index: 1;
  539 + }
  540 +
  541 + .uni-input-input {
  542 + background-color: #ffffff;
  543 + }
  544 +
  545 + background: transparent;
  546 +
  547 + &-item {
  548 + &__extra-text {
  549 + font-size: 32rpx;
  550 + }
  551 +
  552 + &__content-title {
  553 + font-size: 32rpx;
  554 + color: rgba(0, 0, 0, 0.9);
  555 + }
  556 +
  557 + &__container {
  558 + padding: 32rpx;
  559 +
  560 + .uni-easyinput {
  561 + &__placeholder-class {
  562 + font-size: 32rpx;
  563 + color: rgba(0, 0, 0, 0.4);
  564 + }
  565 +
  566 + &__content {
  567 + border: none;
  568 + background-color: #ffffff !important;
  569 +
  570 + &-input {
  571 + padding-left: 0 !important;
  572 + height: 48rpx;
  573 + line-height: 48rpx;
  574 + font-size: 32rpx;
  575 + }
  576 +
  577 + .content-clear-icon {
  578 + font-size: 44rpx !important;
  579 + }
  580 + }
  581 + }
  582 +
  583 + .item-title,
  584 + .uni-list-item__content {
  585 + flex: none;
  586 + min-height: 48rpx;
  587 + line-height: 48rpx;
  588 + font-size: 32rpx;
  589 + position: relative;
  590 + width: 260rpx;
  591 + margin-right: 32rpx;
  592 + color: rgba(0, 0, 0, 0.9);
  593 + }
  594 + }
  595 +
  596 + &.select-item {
  597 + &.is-empty {
  598 + .uni-list-item__extra-text {
  599 + color: rgba(0, 0, 0, 0.4) !important;
  600 + }
  601 + }
  602 +
  603 + &.is-filled {
  604 + .uni-list-item__extra-text {
  605 + color: rgba(0, 0, 0, 0.9) !important;
  606 + }
  607 + }
  608 + }
  609 +
  610 + &.mgb10 {
  611 + margin-bottom: 20rpx;
  612 + }
  613 + }
  614 +}
  615 +</style>
  616 +
... ...
... ... @@ -143,13 +143,20 @@ export default {
143 143 ],
144 144 },
145 145 {
146   - title: '销售管理',
  146 + title: '采购管理',
147 147 items: [{
148   - text: '内贸合同',
  148 + text: '内贸客户资信',
149 149 icon: '/static/images/index/order_list.png',
150 150 link: '/pages/domestic_trade/index',
151 151 name: 'DomesticTrade'
152   - }]
  152 + },
  153 + {
  154 + text: '外客户资信',
  155 + icon: '/static/images/index/order_list.png',
  156 + link: '/pages/foreign_trade/index',
  157 + name: 'ForeignTrade'
  158 + }
  159 + ]
153 160
154 161 },
155 162 {
... ...