Showing
7 changed files
with
1557 additions
and
3 deletions
| ... | ... | @@ -483,7 +483,7 @@ export default { |
| 483 | 483 | if (e === 'uploadStandard') return this.uploadContract(this.detail.id || '', 'standard') |
| 484 | 484 | if (e === 'audit1') return this.onAudit(this.detail.id || '', 'FORMAL_CONTRACT') |
| 485 | 485 | if (e === 'audit2') return this.onAudit(this.detail.parentId || '', 'FORMAL_CONTRACT') |
| 486 | - if (e === 'audit3') return this.onAudit(this.detail.id || '', 'STANDARD_CONTRACT') | |
| 486 | + if (e === 'audit3') return this.onAudit(this.detail.id || '', 'INTL_OPEN_SPEC_AGMT') | |
| 487 | 487 | if (e === 'auditDetail1') return this.onAuditDetail(this.detail.id || '', 'FORMAL_CONTRACT') |
| 488 | 488 | if (e === 'auditDetail2') return this.onAuditDetail(this.detail.parentId || '', 'FORMAL_CONTRACT') |
| 489 | 489 | if (e === 'auditDetail3') return this.onAuditDetail(this.detail.id || '', 'STANDARD_CONTRACT') | ... | ... |
| 1 | +<template> | |
| 2 | + <view class="page"> | |
| 3 | + <scroll-view class="scroll" scroll-y> | |
| 4 | + <uni-list> | |
| 5 | + <uni-list-item title="编号"> | |
| 6 | + <template v-slot:footer> | |
| 7 | + <uni-easyinput v-model="form.code" :inputBorder="false" disabled /> | |
| 8 | + </template> | |
| 9 | + </uni-list-item> | |
| 10 | + | |
| 11 | + <uni-list-item class="select-item" :class="form.supplier ? 'is-filled' : 'is-empty'" clickable | |
| 12 | + @click="openSheet('supplier')" :rightText="displayLabel('supplierName')" showArrow> | |
| 13 | + <template v-slot:body> | |
| 14 | + <view class="item-title"><text class="required">*</text><text>供方</text></view> | |
| 15 | + </template> | |
| 16 | + </uni-list-item> | |
| 17 | + | |
| 18 | + <uni-list-item class="select-item" :class="form.buyer ? 'is-filled' : 'is-empty'" clickable | |
| 19 | + @click="openRelate('buyer')" :rightText="form.buyerName || '请选择需方'" showArrow> | |
| 20 | + <template v-slot:body> | |
| 21 | + <view class="item-title"><text class="required">*</text><text>需方</text></view> | |
| 22 | + </template> | |
| 23 | + </uni-list-item> | |
| 24 | + | |
| 25 | + <uni-list-item class="select-item" :class="form.stockUpCompanyId ? 'is-filled' : 'is-empty'" clickable | |
| 26 | + @click="openRelate('stockUpCompanyId')" :rightText="form.stockUpCompanyName || '请选择备货单位'" showArrow> | |
| 27 | + <template v-slot:body> | |
| 28 | + <view class="item-title"><text class="required">*</text><text>备货单位/人(生产标准)</text></view> | |
| 29 | + </template> | |
| 30 | + </uni-list-item> | |
| 31 | + | |
| 32 | + <uni-list-item class="select-item" :class="form.workshopId ? 'is-filled' : 'is-empty'" clickable | |
| 33 | + @click="openSheet('workshopId')" :rightText="form.workshopName || '请选择生产厂'" showArrow> | |
| 34 | + <template v-slot:body> | |
| 35 | + <view class="item-title"><text class="required">*</text><text>生产厂</text></view> | |
| 36 | + </template> | |
| 37 | + </uni-list-item> | |
| 38 | + <uni-list-item class="select-item" :class="form.deptName ? 'is-filled' : 'is-empty'"> | |
| 39 | + <template v-slot:body> | |
| 40 | + <view class="item-title"><text class="required">*</text><text>办事处</text></view> | |
| 41 | + </template> | |
| 42 | + <template v-slot:footer> | |
| 43 | + <view class="serial-number-row"> | |
| 44 | + <uni-easyinput v-model="form.deptName" :inputBorder="false" disabled /> | |
| 45 | + </view> | |
| 46 | + </template> | |
| 47 | + </uni-list-item> | |
| 48 | + <uni-list-item class="select-item" :class="form.region ? 'is-filled' : 'is-empty'" clickable | |
| 49 | + @click="openSheet('region')" :rightText="displayLabel('regionName')" showArrow> | |
| 50 | + <template v-slot:body> | |
| 51 | + <view class="item-title"><text class="required">*</text><text>区域</text></view> | |
| 52 | + </template> | |
| 53 | + </uni-list-item> | |
| 54 | + | |
| 55 | + <uni-list-item title="订货日期"> | |
| 56 | + <template v-slot:footer> | |
| 57 | + <uni-datetime-picker type="date" v-model="form.orderDate" /> | |
| 58 | + </template> | |
| 59 | + </uni-list-item> | |
| 60 | + | |
| 61 | + <uni-list-item title="单位"> | |
| 62 | + <template v-slot:footer> | |
| 63 | + <uni-easyinput v-model="form.unit" :inputBorder="false" disabled /> | |
| 64 | + </template> | |
| 65 | + </uni-list-item> | |
| 66 | + | |
| 67 | + <ProductRel ref="productRel" mode="add" :deliveryDate="form.orderDate" :deliveryDateBase="form.deliveryDate" | |
| 68 | + :list="productLineList" @change="onProductsChange" :options="productList" /> | |
| 69 | + | |
| 70 | + <uni-list-item title="合计金额(大写)"> | |
| 71 | + <template v-slot:footer> | |
| 72 | + <uni-easyinput v-model="form.totalAmountCapital" placeholder="" :inputBorder="false" disabled /> | |
| 73 | + </template> | |
| 74 | + </uni-list-item> | |
| 75 | + <uni-list-item title="交付定金、数额、时间"> | |
| 76 | + <template v-slot:footer> | |
| 77 | + <uni-easyinput v-model="form.depositInfo" placeholder="请输入交付定金、数额、时间" :inputBorder="false" /> | |
| 78 | + </template> | |
| 79 | + </uni-list-item> | |
| 80 | + <uni-list-item title="包装要求"> | |
| 81 | + <template v-slot:footer> | |
| 82 | + <uni-easyinput v-model="form.packagingRequirements" placeholder="请输入包装要求" :inputBorder="false" /> | |
| 83 | + </template> | |
| 84 | + </uni-list-item> | |
| 85 | + <uni-list-item title="付款方式、付款期限"> | |
| 86 | + <template v-slot:footer> | |
| 87 | + <uni-easyinput v-model="form.paymentTerms" placeholder="请输入付款方式、付款期限" :inputBorder="false" /> | |
| 88 | + </template> | |
| 89 | + </uni-list-item> | |
| 90 | + <uni-list-item title="运输方式"> | |
| 91 | + <template v-slot:footer> | |
| 92 | + <uni-easyinput v-model="form.transportMode" placeholder="请输入运输方式" :inputBorder="false" /> | |
| 93 | + </template> | |
| 94 | + </uni-list-item> | |
| 95 | + <uni-list-item title="目的地"> | |
| 96 | + <template v-slot:footer> | |
| 97 | + <uni-easyinput v-model="form.foreignDestination" placeholder="请输入目的地" :inputBorder="false" /> | |
| 98 | + </template> | |
| 99 | + </uni-list-item> | |
| 100 | + | |
| 101 | + <uni-list-item class="select-item" :class="form.includesPackagingFeeName ? 'is-filled' : 'is-empty'" clickable | |
| 102 | + @click="openSheet('includesPackagingFee')" :rightText="form.includesPackagingFeeName || '请选择'" showArrow> | |
| 103 | + <template v-slot:body> | |
| 104 | + <view class="item-title"><text>单价中是否已包含包装费</text></view> | |
| 105 | + </template> | |
| 106 | + </uni-list-item> | |
| 107 | + <uni-list-item class="select-item" :class="form.includesTransportFeeName ? 'is-filled' : 'is-empty'" clickable | |
| 108 | + @click="openSheet('includesTransportFee')" :rightText="form.includesTransportFeeName || '请选择'" showArrow> | |
| 109 | + <template v-slot:body> | |
| 110 | + <view class="item-title"><text>单价中是否已包含运费</text></view> | |
| 111 | + </template> | |
| 112 | + </uni-list-item> | |
| 113 | + <uni-list-item title="需方指定收货人"> | |
| 114 | + <template v-slot:footer> | |
| 115 | + <uni-easyinput v-model="form.designatedConsignee" placeholder="请输入需方指定收货人" :inputBorder="false" /> | |
| 116 | + </template> | |
| 117 | + </uni-list-item> | |
| 118 | + <uni-list-item class="select-item" :class="form.specialTermsName ? 'is-filled' : 'is-empty'" clickable | |
| 119 | + @click="openSheet('specialTerms')" :rightText="form.specialTermsName || '请选择'" showArrow> | |
| 120 | + <template v-slot:body> | |
| 121 | + <view class="item-title"><text class="required">*</text><text>特别条款要求</text></view> | |
| 122 | + </template> | |
| 123 | + </uni-list-item> | |
| 124 | + <uni-list-item class="select-item" :class="form.executionStandardName ? 'is-filled' : 'is-empty'" clickable | |
| 125 | + @click="openSheet('executionStandard')" :rightText="form.executionStandardName || '请选择'" showArrow> | |
| 126 | + <template v-slot:body> | |
| 127 | + <view class="item-title"><text>执行标准</text></view> | |
| 128 | + </template> | |
| 129 | + </uni-list-item> | |
| 130 | + <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> | |
| 131 | + <template v-slot:footer> | |
| 132 | + <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" :inputBorder="false" /> | |
| 133 | + </template> | |
| 134 | + </uni-list-item> | |
| 135 | + <uni-list-item title="特别说明" style="margin-top: 20rpx;"> | |
| 136 | + <template v-slot:footer> | |
| 137 | + <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> | |
| 138 | + </template> | |
| 139 | + </uni-list-item> | |
| 140 | + <uni-list-item title="备注"> | |
| 141 | + <template v-slot:footer> | |
| 142 | + <uni-easyinput v-model="form.remarks" placeholder="请输入备注" :inputBorder="false" maxlength="2000" /> | |
| 143 | + </template> | |
| 144 | + </uni-list-item> | |
| 145 | + | |
| 146 | + <view class="quality"> | |
| 147 | + <image class="opCollapse" src="/static/images/title.png" /> | |
| 148 | + <text class="title">具体质量要求</text> | |
| 149 | + </view> | |
| 150 | + <uni-list-item title="件重条头"> | |
| 151 | + <template v-slot:footer> | |
| 152 | + <uni-easyinput v-model="form.pieceWeightHead" placeholder="请输入" :inputBorder="false" /> | |
| 153 | + </template> | |
| 154 | + </uni-list-item> | |
| 155 | + <uni-list-item title="表面"> | |
| 156 | + <template v-slot:footer> | |
| 157 | + <uni-easyinput v-model="form.surface" placeholder="请输入" :inputBorder="false" /> | |
| 158 | + </template> | |
| 159 | + </uni-list-item> | |
| 160 | + <uni-list-item title="公差"> | |
| 161 | + <template v-slot:footer> | |
| 162 | + <uni-easyinput v-model="form.tolerance" placeholder="请输入" :inputBorder="false" /> | |
| 163 | + </template> | |
| 164 | + </uni-list-item> | |
| 165 | + <uni-list-item title="性能"> | |
| 166 | + <template v-slot:footer> | |
| 167 | + <uni-easyinput v-model="form.performance" placeholder="请输入" :inputBorder="false" /> | |
| 168 | + </template> | |
| 169 | + </uni-list-item> | |
| 170 | + <uni-list-item title="成分"> | |
| 171 | + <template v-slot:footer> | |
| 172 | + <uni-easyinput v-model="form.component" placeholder="请输入" :inputBorder="false" /> | |
| 173 | + </template> | |
| 174 | + </uni-list-item> | |
| 175 | + <uni-list-item title="包装"> | |
| 176 | + <template v-slot:footer> | |
| 177 | + <uni-easyinput v-model="form.packaging" placeholder="请输入" :inputBorder="false" /> | |
| 178 | + </template> | |
| 179 | + </uni-list-item> | |
| 180 | + | |
| 181 | + <uni-list-item title="标准合同附件" style="margin-top: 20rpx;"> | |
| 182 | + <template v-slot:footer> | |
| 183 | + <FileUpload v-model="fileInfo" /> | |
| 184 | + </template> | |
| 185 | + </uni-list-item> | |
| 186 | + <uni-list-item class="select-item" :class="standardStandardizedName ? 'is-filled' : 'is-empty'" clickable | |
| 187 | + @click="openSheet('standardStandardized')" :rightText="standardStandardizedName || '请选择'" showArrow> | |
| 188 | + <template v-slot:body> | |
| 189 | + <view class="item-title"><text class="required">*</text><text>合同是否规范</text></view> | |
| 190 | + </template> | |
| 191 | + </uni-list-item> | |
| 192 | + | |
| 193 | + <view class="footer-total"> | |
| 194 | + <div class="total"> | |
| 195 | + <div class="total-text">合计</div> | |
| 196 | + <div class="total-item" style="padding: 20rpx 0;"> | |
| 197 | + <div class="total-item-text">数量</div> | |
| 198 | + <div class="total-item-price">{{ (totalQuantity || 0).toFixed(2) }}kg</div> | |
| 199 | + </div> | |
| 200 | + </div> | |
| 201 | + </view> | |
| 202 | + </uni-list> | |
| 203 | + </scroll-view> | |
| 204 | + | |
| 205 | + <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value" | |
| 206 | + @confirm="onSheetConfirm" /> | |
| 207 | + <RelateSelectSheet :visible.sync="relate.visible" :title="relate.title" :source="relate.source" | |
| 208 | + :display-fields="relate.display" :multiple="relate.multiple" :row-key="relate.rowKey" | |
| 209 | + :selectedKeys.sync="relate.selectedKeys" @confirm="onRelateConfirm" /> | |
| 210 | + </view> | |
| 211 | +</template> | |
| 212 | + | |
| 213 | +<script> | |
| 214 | +import SingleSelectSheet from '@/components/single-select/index.vue' | |
| 215 | +import RelateSelectSheet from '@/components/relate-select/index.vue' | |
| 216 | +import ProductRel from './productRel.vue' | |
| 217 | +import FileUpload from '@/components/file-upload/index.vue' | |
| 218 | +import { getContractApi, uploadStandardContract } from '@/api/contract' | |
| 219 | +import { getDicByCodes } from '@/utils/dic' | |
| 220 | +import { formatCurrencyToChinese } from '@/utils/common' | |
| 221 | +import { workshopQueryApi } from '@/api/devManage' | |
| 222 | +import { getArea } from '@/api/credit_manage.js' | |
| 223 | + | |
| 224 | +export default { | |
| 225 | + name: 'ForeignDraftDistAgmtViewer', | |
| 226 | + components: { SingleSelectSheet, RelateSelectSheet, ProductRel, FileUpload }, | |
| 227 | + props: { | |
| 228 | + id: { | |
| 229 | + type: [String, Number], | |
| 230 | + default: '' | |
| 231 | + } | |
| 232 | + }, | |
| 233 | + data() { | |
| 234 | + return { | |
| 235 | + loadedId: '', | |
| 236 | + uploadType: 'standard', | |
| 237 | + fileInfo: { id: '', name: '' }, | |
| 238 | + standardStandardized: '', | |
| 239 | + standardStandardizedName: '', | |
| 240 | + form: { | |
| 241 | + id: '', | |
| 242 | + code: '', | |
| 243 | + supplier: '', | |
| 244 | + supplierName: '', | |
| 245 | + buyer: '', | |
| 246 | + buyerName: '', | |
| 247 | + stockUpCompanyId: '', | |
| 248 | + stockUpCompanyName: '', | |
| 249 | + workshopId: '', | |
| 250 | + workshopName: '', | |
| 251 | + region: '', | |
| 252 | + regionName: '', | |
| 253 | + deptName: '', | |
| 254 | + deptId: '', | |
| 255 | + orderDate: '', | |
| 256 | + deliveryDate: '', | |
| 257 | + designatedConsignee: '', | |
| 258 | + specialTerms: '', | |
| 259 | + specialTermsName: '', | |
| 260 | + executionStandard: '', | |
| 261 | + executionStandardName: '', | |
| 262 | + executionStandardRemarks: '', | |
| 263 | + includesPackagingFee: false, | |
| 264 | + includesPackagingFeeName: '否', | |
| 265 | + includesTransportFee: false, | |
| 266 | + includesTransportFeeName: '否', | |
| 267 | + unit: '美元、公斤、美元/公斤', | |
| 268 | + totalAmountCapital: '', | |
| 269 | + depositInfo: '', | |
| 270 | + packagingRequirements: '', | |
| 271 | + paymentTerms: '', | |
| 272 | + transportMode: '', | |
| 273 | + foreignDestination: '', | |
| 274 | + specialInstructions: '', | |
| 275 | + remarks: '', | |
| 276 | + pieceWeightHead: '', | |
| 277 | + surface: '', | |
| 278 | + tolerance: '', | |
| 279 | + performance: '', | |
| 280 | + component: '', | |
| 281 | + packaging: '' | |
| 282 | + }, | |
| 283 | + dataInfo: {}, | |
| 284 | + supplierList: [], | |
| 285 | + specialTermsList: [], | |
| 286 | + executionStandardList: [], | |
| 287 | + yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], | |
| 288 | + sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, | |
| 289 | + relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, | |
| 290 | + totalQuantity: 0, | |
| 291 | + totalAmountIncludingTax: 0, | |
| 292 | + productLineList: [], | |
| 293 | + newProductLineList: [], | |
| 294 | + productList: [], | |
| 295 | + regionOptions: [] | |
| 296 | + } | |
| 297 | + }, | |
| 298 | + watch: { | |
| 299 | + id: { | |
| 300 | + immediate: true, | |
| 301 | + handler(v) { | |
| 302 | + const nextId = (v === undefined || v === null) ? '' : String(v) | |
| 303 | + if (!nextId || nextId === this.loadedId) return | |
| 304 | + this.loadedId = nextId | |
| 305 | + console.log('nextId', nextId) | |
| 306 | + this.loadDetail(nextId) | |
| 307 | + } | |
| 308 | + } | |
| 309 | + }, | |
| 310 | + created() { | |
| 311 | + this.loadSuppliers() | |
| 312 | + this.loadExtraOptions() | |
| 313 | + this.loadRegionOptions() | |
| 314 | + }, | |
| 315 | + methods: { | |
| 316 | + async loadRegionOptions() { | |
| 317 | + try { | |
| 318 | + const res = await getArea() | |
| 319 | + const list = res.data || [] | |
| 320 | + this.regionOptions = (list || []).map(it => ({ label: it.name || '', value: it.id || '' })) | |
| 321 | + } catch (e) { | |
| 322 | + this.regionOptions = [] | |
| 323 | + } | |
| 324 | + }, | |
| 325 | + async loadDetail(contractId) { | |
| 326 | + const id = (contractId === undefined || contractId === null) ? '' : String(contractId) | |
| 327 | + if (!id) return | |
| 328 | + try { | |
| 329 | + const res = await getContractApi(id) | |
| 330 | + this.dataInfo = res && res.data ? res.data : {} | |
| 331 | + const data = res && res.data ? res.data : {} | |
| 332 | + const includesPackagingFeeName = data.includesPackagingFeeName || (data.includesPackagingFee ? '是' : '否') | |
| 333 | + const includesTransportFeeName = data.includesTransportFeeName || (data.includesTransportFee ? '是' : '否') | |
| 334 | + const m = { ...data, includesPackagingFeeName, includesTransportFeeName } | |
| 335 | + this.form = { | |
| 336 | + ...this.form, | |
| 337 | + id: m.id || '', | |
| 338 | + code: m.code || '', | |
| 339 | + supplier: m.supplier || '', | |
| 340 | + supplierName: m.supplierName || '', | |
| 341 | + buyer: m.buyer || (m.customer && m.customer.id) || '', | |
| 342 | + buyerName: m.buyerName || (m.customer && m.customer.name) || '', | |
| 343 | + stockUpCompanyId: m.stockUpCompanyId || '', | |
| 344 | + stockUpCompanyName: m.stockUpCompanyName || '', | |
| 345 | + orderDate: m.orderDate || '', | |
| 346 | + designatedConsignee: m.designatedConsignee || '', | |
| 347 | + specialTerms: m.specialTerms || '', | |
| 348 | + specialTermsName: m.specialTermsName || '', | |
| 349 | + executionStandard: m.executionStandard || '', | |
| 350 | + executionStandardName: m.executionStandardName || '', | |
| 351 | + executionStandardRemarks: m.executionStandardRemarks || '', | |
| 352 | + includesPackagingFee: !!m.includesPackagingFee, | |
| 353 | + includesPackagingFeeName, | |
| 354 | + includesTransportFee: !!m.includesTransportFee, | |
| 355 | + includesTransportFeeName, | |
| 356 | + unit: m.unit || this.form.unit, | |
| 357 | + totalAmountCapital: m.totalAmountCapital || '', | |
| 358 | + depositInfo: m.depositInfo || '', | |
| 359 | + packagingRequirements: m.packagingRequirements || '', | |
| 360 | + paymentTerms: m.paymentTerms || '', | |
| 361 | + transportMode: m.transportMode || '', | |
| 362 | + foreignDestination: (m.foreignDestination || ''), | |
| 363 | + specialInstructions: m.specialInstructions || '', | |
| 364 | + remarks: m.remarks || '', | |
| 365 | + pieceWeightHead: m.pieceWeightHead || '', | |
| 366 | + surface: m.surface || '', | |
| 367 | + tolerance: m.tolerance || '', | |
| 368 | + performance: m.performance || '', | |
| 369 | + component: m.component || '', | |
| 370 | + packaging: m.packaging || '', | |
| 371 | + workshopId: m.workshopId || '', | |
| 372 | + workshopName: m.workshopName || '', | |
| 373 | + region: m.region || '', | |
| 374 | + regionName: m.regionName || '', | |
| 375 | + deptName: m.deptName || '', | |
| 376 | + deptId: m.deptId || '' | |
| 377 | + } | |
| 378 | + this.fileInfo = { id: m.standardFileId || '', name: m.standardFileName || '' } | |
| 379 | + this.standardStandardized = (m.standardStandardized === true || m.standardStandardized === false) ? m.standardStandardized : '' | |
| 380 | + this.standardStandardizedName = (this.standardStandardized === true) ? '是' : (this.standardStandardized === false) ? '否' : '' | |
| 381 | + const lines = Array.isArray(m.contractDistributorLineList) ? m.contractDistributorLineList : [] | |
| 382 | + this.productLineList = lines | |
| 383 | + this.onProductsChange(lines) | |
| 384 | + } catch (e) { } | |
| 385 | + }, | |
| 386 | + onProductsChange(products) { | |
| 387 | + const list = Array.isArray(products) ? products : [] | |
| 388 | + this.newProductLineList = list | |
| 389 | + const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) | |
| 390 | + const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) | |
| 391 | + this.totalQuantity = sumQ | |
| 392 | + this.totalAmountIncludingTax = sumT | |
| 393 | + this.form.totalAmountCapital = formatCurrencyToChinese(sumT) | |
| 394 | + }, | |
| 395 | + async loadSuppliers() { | |
| 396 | + try { | |
| 397 | + const results = await getDicByCodes(['SUPPLIER']) | |
| 398 | + const items = results && results.SUPPLIER && results.SUPPLIER.data ? results.SUPPLIER.data : [] | |
| 399 | + this.supplierList = items.map(it => ({ label: it.name, value: it.code })) | |
| 400 | + } catch (e) { this.supplierList = [] } | |
| 401 | + }, | |
| 402 | + async loadExtraOptions() { | |
| 403 | + try { | |
| 404 | + const results = await getDicByCodes(['CONDITIONS_REQUIRED', 'APPLICABLE_STANDARD', 'CONTRACT_PRODUCT']) | |
| 405 | + const c1 = results && results.CONDITIONS_REQUIRED && results.CONDITIONS_REQUIRED.data ? results.CONDITIONS_REQUIRED.data : [] | |
| 406 | + const c2 = results && results.APPLICABLE_STANDARD && results.APPLICABLE_STANDARD.data ? results.APPLICABLE_STANDARD.data : [] | |
| 407 | + const c3 = results && results.CONTRACT_PRODUCT && results.CONTRACT_PRODUCT.data ? results.CONTRACT_PRODUCT.data : [] | |
| 408 | + this.specialTermsList = c1.map(it => ({ label: it.name, value: it.code })) | |
| 409 | + this.executionStandardList = c2.map(it => ({ label: it.name, value: it.code })) | |
| 410 | + this.productList = c3.map(it => ({ label: it.name, value: it.code })) | |
| 411 | + } catch (e) { | |
| 412 | + this.specialTermsList = [] | |
| 413 | + this.executionStandardList = [] | |
| 414 | + this.productList = [] | |
| 415 | + } | |
| 416 | + }, | |
| 417 | + displayLabel(field) { | |
| 418 | + const m = this.form | |
| 419 | + const map = { supplierName: '请选择供方', buyerName: '请选择需方', workshopName: '请选择生产厂', regionName: '请选择区域' } | |
| 420 | + const val = m[field] | |
| 421 | + return val ? String(val) : map[field] | |
| 422 | + }, | |
| 423 | + async openSheet(field) { | |
| 424 | + if (field === 'standardStandardized') { | |
| 425 | + const options = this.yesNoList | |
| 426 | + const current = this.standardStandardized | |
| 427 | + const match = (options || []).find(o => String(o.value) === String(current) || String(o.label) === String(current)) | |
| 428 | + this.sheet = { ...this.sheet, visible: true, title: '合同是否规范', options, field, value: match ? match.value : '' } | |
| 429 | + return | |
| 430 | + } | |
| 431 | + const setSheet = (title, options) => { | |
| 432 | + const current = this.form[field] | |
| 433 | + const match = (options || []).find(o => String(o.label) === String(current) || String(o.value) === String(current)) | |
| 434 | + this.sheet = { ...this.sheet, visible: true, title, options, field, value: match ? match.value : '' } | |
| 435 | + } | |
| 436 | + if (field === 'workshopId') { | |
| 437 | + const res = await workshopQueryApi({ pageIndex: 1, pageSize: 9999 }) | |
| 438 | + const _data = res.data || {} | |
| 439 | + const list = _data.datas || (Array.isArray(_data) ? _data : []) | |
| 440 | + const opts = (list || []).map(it => ({ label: it.name, value: it.id })) | |
| 441 | + setSheet('生产厂', opts) | |
| 442 | + } else if (field === 'supplier') { | |
| 443 | + setSheet('供方', this.supplierList) | |
| 444 | + } else if (field === 'specialTerms') { | |
| 445 | + setSheet('特别条款要求', this.specialTermsList) | |
| 446 | + } else if (field === 'executionStandard') { | |
| 447 | + setSheet('执行标准', this.executionStandardList) | |
| 448 | + } else if (field === 'includesPackagingFee') { | |
| 449 | + setSheet('单价中是否已包含包装费', this.yesNoList) | |
| 450 | + } else if (field === 'includesTransportFee') { | |
| 451 | + setSheet('单价中是否已包含运费', this.yesNoList) | |
| 452 | + } else if (field === 'region') { | |
| 453 | + setSheet('区域', this.regionOptions) | |
| 454 | + } | |
| 455 | + }, | |
| 456 | + onSheetConfirm({ value, label }) { | |
| 457 | + const field = this.sheet.field | |
| 458 | + if (!field) return | |
| 459 | + const v = (value === undefined || value === null) ? '' : value | |
| 460 | + if (field === 'standardStandardized') { | |
| 461 | + this.standardStandardized = v | |
| 462 | + this.standardStandardizedName = label || '' | |
| 463 | + return | |
| 464 | + } | |
| 465 | + this.form[field] = v | |
| 466 | + this.form[field + 'Name'] = label || '' | |
| 467 | + }, | |
| 468 | + openRelate(fieldKey) { | |
| 469 | + let config = {} | |
| 470 | + if (fieldKey === 'buyer') { | |
| 471 | + config = { title: '需方', source: 'customer', rowKey: 'id', multiple: false, display: [{ label: '名称', field: 'name' }, { label: '编号', field: 'code' }, { label: '状态', field: 'available', format: v => (v ? '启用' : '停用') }] } | |
| 472 | + } else if (fieldKey === 'stockUpCompanyId') { | |
| 473 | + config = { title: '备货单位/人(生产标准)', source: 'customer', rowKey: 'id', multiple: false, display: [{ label: '姓名', field: 'name' }, { label: '编号', field: 'code' }, { label: '状态', field: 'available', format: v => (v ? '启用' : '停用') }] } | |
| 474 | + } | |
| 475 | + const selectedKeys = this.form[fieldKey] ? [this.form[fieldKey]] : [] | |
| 476 | + this.sheet.visible = false | |
| 477 | + this.relate = { ...this.relate, title: config.title, source: config.source, display: config.display, multiple: config.multiple, rowKey: config.rowKey, selectedKeys, fieldKey } | |
| 478 | + this.$nextTick(() => { this.relate.visible = true }) | |
| 479 | + }, | |
| 480 | + onRelateConfirm({ items }) { | |
| 481 | + const _fieldKey = this.relate.fieldKey | |
| 482 | + const first = (items && items.length > 0) ? items[0] : null | |
| 483 | + this.form[_fieldKey] = (first && first.id) ? first.id : '' | |
| 484 | + if (_fieldKey === 'stockUpCompanyId') { | |
| 485 | + this.form.stockUpCompanyName = (first && first.name) ? first.name : '' | |
| 486 | + } else { | |
| 487 | + this.form[_fieldKey + 'Name'] = (first && first.name) ? first.name : '' | |
| 488 | + } | |
| 489 | + }, | |
| 490 | + validateRequired() { | |
| 491 | + const checks = [ | |
| 492 | + { key: 'code', label: '编号' }, | |
| 493 | + { key: 'supplier', label: '供方' }, | |
| 494 | + { key: 'buyer', label: '需方' }, | |
| 495 | + { key: 'stockUpCompanyId', label: '备货单位/人(生产标准)' }, | |
| 496 | + { key: 'orderDate', label: '订货日期' }, | |
| 497 | + { key: 'unit', label: '单位' }, | |
| 498 | + { key: 'workshopId', label: '生产厂' }, | |
| 499 | + { key: 'region', label: '区域' }, | |
| 500 | + { key: 'specialTerms', label: '特别条款要求' }, | |
| 501 | + ] | |
| 502 | + for (const it of checks) { | |
| 503 | + const val = this.form[it.key] | |
| 504 | + const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) | |
| 505 | + if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } | |
| 506 | + } | |
| 507 | + const list = Array.isArray(this.newProductLineList) ? this.newProductLineList : [] | |
| 508 | + if (list.length === 0) { | |
| 509 | + uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false | |
| 510 | + } | |
| 511 | + const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === '')) | |
| 512 | + const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v))) | |
| 513 | + for (const [idx, it] of list.entries()) { | |
| 514 | + if ( | |
| 515 | + strEmpty(it.productName) || | |
| 516 | + strEmpty(it.industry) || | |
| 517 | + strEmpty(it.quality) || | |
| 518 | + strEmpty(it.brand) || | |
| 519 | + numEmpty(it.quantity) || | |
| 520 | + numEmpty(it.unitPrice) || | |
| 521 | + strEmpty(it.deliveryDate) | |
| 522 | + ) { | |
| 523 | + uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false | |
| 524 | + } | |
| 525 | + } | |
| 526 | + if (this.$refs.productRel && !this.$refs.productRel.validate()) return false | |
| 527 | + return true | |
| 528 | + }, | |
| 529 | + getFormValues() { | |
| 530 | + const clone = (v) => JSON.parse(JSON.stringify(v == null ? null : v)) | |
| 531 | + const form = clone(this.form) || {} | |
| 532 | + return { | |
| 533 | + ...this.dataInfo, | |
| 534 | + ...form, | |
| 535 | + contractDistributorLineList: clone(this.newProductLineList) || [], | |
| 536 | + totalQuantity: this.totalQuantity, | |
| 537 | + totalAmountExcludingTax: this.totalAmountExcludingTax, | |
| 538 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | |
| 539 | + standardStandardized: this.standardStandardized, | |
| 540 | + standardStandardizedName: this.standardStandardizedName, | |
| 541 | + standardFileId: this.fileInfo.id, | |
| 542 | + standardFileName: this.fileInfo.name, | |
| 543 | + } | |
| 544 | + }, | |
| 545 | + async onSubmit() { | |
| 546 | + if (!this.fileInfo.id) { | |
| 547 | + uni.showToast({ title: '请上传合同附件', icon: 'error' }) | |
| 548 | + return | |
| 549 | + } | |
| 550 | + if (!this.standardStandardized && this.standardStandardized !== false) { | |
| 551 | + uni.showToast({ title: '请选择合同是否规范', icon: 'error' }) | |
| 552 | + return | |
| 553 | + } | |
| 554 | + if (!this.validateRequired()) return | |
| 555 | + const confirmRes = await new Promise(resolve => { | |
| 556 | + uni.showModal({ title: '确认提交', content: '确定提交标准合同吗?', confirmText: '确定', cancelText: '取消', success: resolve }) | |
| 557 | + }) | |
| 558 | + if (!(confirmRes && confirmRes.confirm)) return | |
| 559 | + const clean = (obj) => { | |
| 560 | + const out = {} | |
| 561 | + Object.keys(obj || {}).forEach(k => { | |
| 562 | + const v = obj[k] | |
| 563 | + const isEmptyString = typeof v === 'string' && v.trim() === '' | |
| 564 | + const isUndef = v === undefined || v === null | |
| 565 | + const isNaNNumber = typeof v === 'number' && isNaN(v) | |
| 566 | + if (!(isEmptyString || isUndef || isNaNNumber)) out[k] = v | |
| 567 | + }) | |
| 568 | + return out | |
| 569 | + } | |
| 570 | + const lines = (this.newProductLineList || []).map(it => clean(it)) | |
| 571 | + const payload = clean({ | |
| 572 | + ...this.form, | |
| 573 | + id: this.form.id, | |
| 574 | + type: 'INTL_OPEN_SPEC_AGMT', | |
| 575 | + totalQuantity: this.totalQuantity, | |
| 576 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | |
| 577 | + contractDistributorLineList: lines, | |
| 578 | + standardFileId: this.fileInfo.id, | |
| 579 | + standardFileName: this.fileInfo.name, | |
| 580 | + standardStandardized: this.standardStandardized, | |
| 581 | + }) | |
| 582 | + try { | |
| 583 | + await uploadStandardContract(payload) | |
| 584 | + uni.showToast({ title: '提交成功', icon: 'none' }) | |
| 585 | + setTimeout(() => { uni.redirectTo({ url: '/pages/contract_foreign_unplan/index' }) }, 400) | |
| 586 | + } catch (e) { | |
| 587 | + uni.showToast({ title: e.msg || '提交失败', icon: 'none' }) | |
| 588 | + } | |
| 589 | + } | |
| 590 | + } | |
| 591 | +} | |
| 592 | +</script> | |
| 593 | + | |
| 594 | +<style lang="scss" scoped> | |
| 595 | +.total { | |
| 596 | + .total-text { | |
| 597 | + font-weight: 600; | |
| 598 | + font-size: 32rpx; | |
| 599 | + color: rgba(0, 0, 0, 0.9); | |
| 600 | + padding-bottom: 28rpx; | |
| 601 | + border-bottom: 2rpx solid #E7E7E7; | |
| 602 | + } | |
| 603 | + | |
| 604 | + .total-item { | |
| 605 | + display: flex; | |
| 606 | + align-items: center; | |
| 607 | + } | |
| 608 | + | |
| 609 | + .total-item-text { | |
| 610 | + font-weight: 400; | |
| 611 | + font-size: 28rpx; | |
| 612 | + color: rgba(0, 0, 0, 0.6); | |
| 613 | + line-height: 32rpx; | |
| 614 | + width: 240rpx; | |
| 615 | + padding: 12rpx 0; | |
| 616 | + } | |
| 617 | + | |
| 618 | + .total-item-price { | |
| 619 | + font-weight: 600; | |
| 620 | + font-size: 32rpx; | |
| 621 | + color: rgba(0, 0, 0, 0.9); | |
| 622 | + line-height: 32rpx; | |
| 623 | + } | |
| 624 | + | |
| 625 | + .text-red { | |
| 626 | + color: #D54941; | |
| 627 | + } | |
| 628 | +} | |
| 629 | + | |
| 630 | +.page { | |
| 631 | + display: flex; | |
| 632 | + flex-direction: column; | |
| 633 | + height: 100%; | |
| 634 | +} | |
| 635 | + | |
| 636 | +.scroll { | |
| 637 | + flex: 1; | |
| 638 | + padding: 12rpx 0 500rpx !important; | |
| 639 | +} | |
| 640 | + | |
| 641 | +.footer-total { | |
| 642 | + z-index: 2; | |
| 643 | + position: fixed; | |
| 644 | + left: 0; | |
| 645 | + right: 0; | |
| 646 | + bottom: 120rpx; | |
| 647 | + padding: 32rpx; | |
| 648 | + padding-bottom: calc(32rpx + env(safe-area-inset-bottom)); | |
| 649 | + background: #fff; | |
| 650 | + box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.06); | |
| 651 | +} | |
| 652 | + | |
| 653 | +.footer-total .btn { | |
| 654 | + height: 80rpx; | |
| 655 | + line-height: 80rpx; | |
| 656 | + border-radius: 12rpx; | |
| 657 | + font-size: 32rpx; | |
| 658 | +} | |
| 659 | + | |
| 660 | +.quality { | |
| 661 | + background-color: #fff; | |
| 662 | + display: flex; | |
| 663 | + align-items: center; | |
| 664 | + padding: 24rpx 32rpx; | |
| 665 | + border-bottom: 1rpx solid #f0f0f0; | |
| 666 | + margin-top: 20rpx; | |
| 667 | + | |
| 668 | + .title { | |
| 669 | + font-size: 32rpx; | |
| 670 | + color: rgba(0, 0, 0, 0.9); | |
| 671 | + font-weight: 600; | |
| 672 | + } | |
| 673 | + | |
| 674 | + .opCollapse { | |
| 675 | + color: rgba(0, 0, 0, 0.6); | |
| 676 | + width: 32rpx; | |
| 677 | + height: 28rpx; | |
| 678 | + margin-right: 16rpx; | |
| 679 | + } | |
| 680 | +} | |
| 681 | + | |
| 682 | +::v-deep .uni-list { | |
| 683 | + background: transparent; | |
| 684 | +} | |
| 685 | + | |
| 686 | +::v-deep .uni-list .uni-easyinput .uni-input-input { | |
| 687 | + color: rgba(0, 0, 0, 0.9); | |
| 688 | +} | |
| 689 | + | |
| 690 | +::v-deep .uni-list .uni-input-placeholder { | |
| 691 | + z-index: 1; | |
| 692 | +} | |
| 693 | + | |
| 694 | +::v-deep .uni-list .uni-input-input { | |
| 695 | + background-color: #ffffff; | |
| 696 | +} | |
| 697 | + | |
| 698 | +::v-deep .uni-list-item__extra-text { | |
| 699 | + font-size: 32rpx; | |
| 700 | +} | |
| 701 | + | |
| 702 | +::v-deep .uni-list-item__content-title { | |
| 703 | + font-size: 32rpx; | |
| 704 | + color: rgba(0, 0, 0, 0.9); | |
| 705 | +} | |
| 706 | + | |
| 707 | +::v-deep .uni-list-item__container { | |
| 708 | + padding: 32rpx; | |
| 709 | +} | |
| 710 | + | |
| 711 | +::v-deep .uni-list-item__container .uni-easyinput__placeholder-class { | |
| 712 | + font-size: 32rpx; | |
| 713 | + color: rgba(0, 0, 0, 0.4); | |
| 714 | +} | |
| 715 | + | |
| 716 | +::v-deep .uni-list-item__container .uni-easyinput__content { | |
| 717 | + border: none; | |
| 718 | + background-color: #ffffff !important; | |
| 719 | +} | |
| 720 | + | |
| 721 | +::v-deep .uni-list-item__container .uni-easyinput__content-input { | |
| 722 | + padding-left: 0 !important; | |
| 723 | + height: 48rpx; | |
| 724 | + line-height: 48rpx; | |
| 725 | + font-size: 32rpx; | |
| 726 | +} | |
| 727 | + | |
| 728 | +::v-deep .uni-list-item__container .item-title, | |
| 729 | +::v-deep .uni-list-item__container .uni-list-item__content { | |
| 730 | + flex: none; | |
| 731 | + min-height: 48rpx; | |
| 732 | + line-height: 48rpx; | |
| 733 | + font-size: 32rpx; | |
| 734 | + position: relative; | |
| 735 | + width: 210rpx; | |
| 736 | + margin-right: 32rpx; | |
| 737 | + color: rgba(0, 0, 0, 0.9); | |
| 738 | +} | |
| 739 | + | |
| 740 | +::v-deep .uni-list-item__container .item-title .required { | |
| 741 | + color: red; | |
| 742 | + position: absolute; | |
| 743 | + top: 50%; | |
| 744 | + transform: translateY(-50%); | |
| 745 | + left: -16rpx; | |
| 746 | +} | |
| 747 | + | |
| 748 | +::v-deep .uni-list-item.select-item.is-empty .uni-list-item__extra-text { | |
| 749 | + color: rgba(0, 0, 0, 0.4) !important; | |
| 750 | +} | |
| 751 | + | |
| 752 | +::v-deep .uni-list-item.select-item.is-filled .uni-list-item__extra-text { | |
| 753 | + color: rgba(0, 0, 0, 0.9) !important; | |
| 754 | +} | |
| 755 | +</style> | ... | ... |
pages/contract_process/agmtViewer.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <view class="page"> | |
| 3 | + <scroll-view class="scroll" scroll-y> | |
| 4 | + <uni-list> | |
| 5 | + <uni-list-item title="编号"> | |
| 6 | + <template v-slot:footer> | |
| 7 | + <uni-easyinput v-model="form.code" :inputBorder="false" disabled /> | |
| 8 | + </template> | |
| 9 | + </uni-list-item> | |
| 10 | + | |
| 11 | + <uni-list-item class="select-item" :class="form.supplier ? 'is-filled' : 'is-empty'" clickable | |
| 12 | + @click="openSheet('supplier')" :rightText="displayLabel('supplierName')" showArrow> | |
| 13 | + <template v-slot:body> | |
| 14 | + <view class="item-title"><text class="required">*</text><text>承揽方</text></view> | |
| 15 | + </template> | |
| 16 | + </uni-list-item> | |
| 17 | + | |
| 18 | + <uni-list-item class="select-item" :class="form.buyer ? 'is-filled' : 'is-empty'" clickable | |
| 19 | + @click="openRelate('buyer')" :rightText="form.buyerName || '请选择定作方'" showArrow> | |
| 20 | + <template v-slot:body> | |
| 21 | + <view class="item-title"><text class="required">*</text><text>定作方</text></view> | |
| 22 | + </template> | |
| 23 | + </uni-list-item> | |
| 24 | + | |
| 25 | + <uni-list-item class="select-item" :class="form.workshopId ? 'is-filled' : 'is-empty'" clickable | |
| 26 | + @click="openSheet('workshopId')" :rightText="form.workshopName || '请选择生产厂'" showArrow> | |
| 27 | + <template v-slot:body> | |
| 28 | + <view class="item-title"><text class="required">*</text><text>生产厂</text></view> | |
| 29 | + </template> | |
| 30 | + </uni-list-item> | |
| 31 | + | |
| 32 | + <uni-list-item title="订货日期"> | |
| 33 | + <template v-slot:footer> | |
| 34 | + <uni-datetime-picker type="date" v-model="form.orderDate" /> | |
| 35 | + </template> | |
| 36 | + </uni-list-item> | |
| 37 | + | |
| 38 | + <uni-list-item title="单位"> | |
| 39 | + <template v-slot:footer> | |
| 40 | + <uni-easyinput v-model="form.unit" :inputBorder="false" disabled /> | |
| 41 | + </template> | |
| 42 | + </uni-list-item> | |
| 43 | + | |
| 44 | + <ProductRel mode="add" :deliveryDate="form.orderDate" :deliveryDateBase="form.deliveryDate" :rawToProdRatioList="rawToProdRatioList" :list="productLineList" @change="onProductsChange" :options="productList" :rawProductList="rawProductList" :rawProductGradeList="rawProductGradeList" /> | |
| 45 | + | |
| 46 | + <uni-list-item title="合计金额(大写)"> | |
| 47 | + <template v-slot:footer> | |
| 48 | + <uni-easyinput v-model="form.totalAmountCapital" placeholder="" :inputBorder="false" | |
| 49 | + disabled /> | |
| 50 | + </template> | |
| 51 | + </uni-list-item> | |
| 52 | + <uni-list-item title="交付定金、数额、时间"> | |
| 53 | + <template v-slot:footer> | |
| 54 | + <uni-easyinput v-model="form.depositInfo" 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.packagingRequirements" placeholder="请输入包装要求" | |
| 60 | + :inputBorder="false" /> | |
| 61 | + </template> | |
| 62 | + </uni-list-item> | |
| 63 | + <uni-list-item title="付款方式、付款期限"> | |
| 64 | + <template v-slot:footer> | |
| 65 | + <uni-easyinput v-model="form.paymentTerms" placeholder="请输入付款方式、付款期限" :inputBorder="false" /> | |
| 66 | + </template> | |
| 67 | + </uni-list-item> | |
| 68 | + <uni-list-item title="运输方式"> | |
| 69 | + <template v-slot:footer> | |
| 70 | + <uni-easyinput v-model="form.transportMode" placeholder="请输入运输方式" :inputBorder="false" /> | |
| 71 | + </template> | |
| 72 | + </uni-list-item> | |
| 73 | + <uni-list-item title="目的地"> | |
| 74 | + <template v-slot:footer> | |
| 75 | + <uni-easyinput v-model="form.foreignDestination" placeholder="请输入目的地" :inputBorder="false" /> | |
| 76 | + </template> | |
| 77 | + </uni-list-item> | |
| 78 | + | |
| 79 | + <uni-list-item class="select-item" :class="form.includesPackagingFeeName ? 'is-filled' : 'is-empty'" | |
| 80 | + clickable @click="openSheet('includesPackagingFee')" | |
| 81 | + :rightText="form.includesPackagingFeeName || '请选择'" showArrow> | |
| 82 | + <template v-slot:body> | |
| 83 | + <view class="item-title"><text>单价中是否已包含包装费</text></view> | |
| 84 | + </template> | |
| 85 | + </uni-list-item> | |
| 86 | + <uni-list-item class="select-item" :class="form.includesTransportFeeName ? 'is-filled' : 'is-empty'" | |
| 87 | + clickable @click="openSheet('includesTransportFee')" | |
| 88 | + :rightText="form.includesTransportFeeName || '请选择'" showArrow> | |
| 89 | + <template v-slot:body> | |
| 90 | + <view class="item-title"><text>单价中是否已包含运费</text></view> | |
| 91 | + </template> | |
| 92 | + </uni-list-item> | |
| 93 | + <uni-list-item title="需方指定收货人"> | |
| 94 | + <template v-slot:footer> | |
| 95 | + <uni-easyinput v-model="form.designatedConsignee" placeholder="请输入需方指定收货人" | |
| 96 | + :inputBorder="false" /> | |
| 97 | + </template> | |
| 98 | + </uni-list-item> | |
| 99 | + | |
| 100 | + <uni-list-item class="select-item" :class="form.specialTermsName ? 'is-filled' : 'is-empty'" clickable | |
| 101 | + @click="openSheet('specialTerms')" :rightText="form.specialTermsName || '请选择'" showArrow> | |
| 102 | + <template v-slot:body> | |
| 103 | + <view class="item-title"><text class="required">*</text><text>特别条款要求</text></view> | |
| 104 | + </template> | |
| 105 | + </uni-list-item> | |
| 106 | + <uni-list-item class="select-item" :class="form.executionStandardName ? 'is-filled' : 'is-empty'" clickable | |
| 107 | + @click="openSheet('executionStandard')" :rightText="form.executionStandardName || '请选择'" showArrow> | |
| 108 | + <template v-slot:body> | |
| 109 | + <view class="item-title"><text>执行标准</text></view> | |
| 110 | + </template> | |
| 111 | + </uni-list-item> | |
| 112 | + <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> | |
| 113 | + <template v-slot:footer> | |
| 114 | + <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" | |
| 115 | + :inputBorder="false" /> | |
| 116 | + </template> | |
| 117 | + </uni-list-item> | |
| 118 | + <uni-list-item title="特别说明" style="margin-top: 20rpx;"> | |
| 119 | + <template v-slot:footer> | |
| 120 | + <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> | |
| 121 | + </template> | |
| 122 | + </uni-list-item> | |
| 123 | + <uni-list-item title="备注"> | |
| 124 | + <template v-slot:footer> | |
| 125 | + <uni-easyinput v-model="form.remarks" placeholder="请输入备注" :inputBorder="false" maxlength="2000" /> | |
| 126 | + </template> | |
| 127 | + </uni-list-item> | |
| 128 | + | |
| 129 | + <view class="quality"> | |
| 130 | + <image class="opCollapse" src="/static/images/title.png" /> | |
| 131 | + <text class="title">具体质量要求</text> | |
| 132 | + </view> | |
| 133 | + <uni-list-item title="件重条头"> | |
| 134 | + <template v-slot:footer> | |
| 135 | + <uni-easyinput v-model="form.pieceWeightHead" 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.surface" 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.tolerance" 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.performance" 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.component" 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.packaging" placeholder="请输入" :inputBorder="false" /> | |
| 161 | + </template> | |
| 162 | + </uni-list-item> | |
| 163 | + <uni-list-item title="合同附件" style="margin-top: 20rpx;"> | |
| 164 | + <template v-slot:footer> | |
| 165 | + <FileUpload v-model="fileInfo" /> | |
| 166 | + </template> | |
| 167 | + </uni-list-item> | |
| 168 | + <uni-list-item class="select-item" :class="standardStandardizedName ? 'is-filled' : 'is-empty'" clickable | |
| 169 | + @click="openSheet('standardStandardized')" :rightText="standardStandardizedName || '请选择'" showArrow> | |
| 170 | + <template v-slot:body> | |
| 171 | + <view class="item-title"><text class="required">*</text><text>合同是否规范</text></view> | |
| 172 | + </template> | |
| 173 | + </uni-list-item> | |
| 174 | + <view class="footer-total"> | |
| 175 | + <div class="total"> | |
| 176 | + <div class="total-text">合计</div> | |
| 177 | + <div class="total-item"> | |
| 178 | + <div class="total-item-text">数量</div> | |
| 179 | + <div class="total-item-price">{{ (totalQuantity || 0).toFixed(2) }}kg</div> | |
| 180 | + </div> | |
| 181 | + <div class="total-item"> | |
| 182 | + <div class="total-item-text">不含税金额</div> | |
| 183 | + <div class="total-item-price text-red">¥{{ (totalAmountExcludingTax || 0).toFixed(2) }}</div> | |
| 184 | + </div> | |
| 185 | + <div class="total-item"> | |
| 186 | + <div class="total-item-text">总金额</div> | |
| 187 | + <div class="total-item-price text-red">¥{{ (totalAmountIncludingTax || 0).toFixed(2) }}</div> | |
| 188 | + </div> | |
| 189 | + </div> | |
| 190 | + </view> | |
| 191 | + </uni-list> | |
| 192 | + </scroll-view> | |
| 193 | + | |
| 194 | + <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" | |
| 195 | + v-model="sheet.value" @confirm="onSheetConfirm" /> | |
| 196 | + <RelateSelectSheet :visible.sync="relate.visible" :title="relate.title" :source="relate.source" | |
| 197 | + :display-fields="relate.display" :multiple="relate.multiple" :row-key="relate.rowKey" | |
| 198 | + :selectedKeys.sync="relate.selectedKeys" @confirm="onRelateConfirm" /> | |
| 199 | + </view> | |
| 200 | +</template> | |
| 201 | + | |
| 202 | +<script> | |
| 203 | +import SingleSelectSheet from '@/components/single-select/index.vue' | |
| 204 | +import RelateSelectSheet from '@/components/relate-select/index.vue' | |
| 205 | +import ProductRel from './productRel.vue' | |
| 206 | +import FileUpload from '@/components/file-upload/index.vue' | |
| 207 | +import { getContractApi, uploadStandardContract } from '@/api/contract' | |
| 208 | +import { getDicByCodes } from '@/utils/dic' | |
| 209 | +import { formatCurrencyToChinese } from '@/utils/common' | |
| 210 | +import { workshopQueryApi } from '@/api/devManage' | |
| 211 | +import { getArea } from '@/api/credit_manage.js' | |
| 212 | + | |
| 213 | +export default { | |
| 214 | + name: 'AgmtViewer', | |
| 215 | + components: { SingleSelectSheet, RelateSelectSheet, ProductRel, FileUpload }, | |
| 216 | + props: { | |
| 217 | + id: { | |
| 218 | + type: [String, Number], | |
| 219 | + default: '' | |
| 220 | + } | |
| 221 | + }, | |
| 222 | + data() { | |
| 223 | + return { | |
| 224 | + loadedId: '', | |
| 225 | + form: { | |
| 226 | + id: '', | |
| 227 | + code: '', | |
| 228 | + supplier: '', | |
| 229 | + supplierName: '', | |
| 230 | + buyer: '', | |
| 231 | + buyerName: '', | |
| 232 | + stockUpCompanyId: '', | |
| 233 | + stockUpCompanyName: '', | |
| 234 | + workshopId: '', | |
| 235 | + workshopName: '', | |
| 236 | + region: '', | |
| 237 | + regionName: '', | |
| 238 | + deptName: '', | |
| 239 | + deptId: '', | |
| 240 | + orderDate: '', | |
| 241 | + deliveryDate: '', | |
| 242 | + designatedConsignee: '', | |
| 243 | + specialTerms: '', | |
| 244 | + specialTermsName: '', | |
| 245 | + executionStandard: '', | |
| 246 | + executionStandardName: '', | |
| 247 | + executionStandardRemarks: '', | |
| 248 | + includesPackagingFee: false, | |
| 249 | + includesPackagingFeeName: '否', | |
| 250 | + includesTransportFee: false, | |
| 251 | + includesTransportFeeName: '否', | |
| 252 | + unit: '元、公斤、元/公斤', | |
| 253 | + totalAmountCapital: '', | |
| 254 | + depositInfo: '', | |
| 255 | + packagingRequirements: '', | |
| 256 | + paymentTerms: '', | |
| 257 | + transportMode: '', | |
| 258 | + foreignDestination: '', | |
| 259 | + specialInstructions: '', | |
| 260 | + remarks: '', | |
| 261 | + pieceWeightHead: '', | |
| 262 | + surface: '', | |
| 263 | + tolerance: '', | |
| 264 | + performance: '', | |
| 265 | + component: '', | |
| 266 | + packaging: '' | |
| 267 | + }, | |
| 268 | + dataInfo: {}, | |
| 269 | + supplierList: [], | |
| 270 | + specialTermsList: [], | |
| 271 | + executionStandardList: [], | |
| 272 | + yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], | |
| 273 | + sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, | |
| 274 | + relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, | |
| 275 | + fileInfo: { id: '', name: '' }, | |
| 276 | + standardStandardized: '', | |
| 277 | + standardStandardizedName: '', | |
| 278 | + totalQuantity: 0, | |
| 279 | + totalAmountExcludingTax: 0, | |
| 280 | + totalAmountIncludingTax: 0, | |
| 281 | + productLineList: [], | |
| 282 | + newProductLineList: [], | |
| 283 | + productList: [], | |
| 284 | + regionOptions: [], | |
| 285 | + rawToProdRatioList: [], | |
| 286 | + rawProductList: [], | |
| 287 | + rawProductGradeList: [], | |
| 288 | + } | |
| 289 | + }, | |
| 290 | + watch: { | |
| 291 | + id: { | |
| 292 | + immediate: true, | |
| 293 | + handler(v) { | |
| 294 | + const nextId = (v === undefined || v === null) ? '' : String(v) | |
| 295 | + if (!nextId || nextId === this.loadedId) return | |
| 296 | + this.loadedId = nextId | |
| 297 | + this.loadDetail(nextId) | |
| 298 | + } | |
| 299 | + } | |
| 300 | + }, | |
| 301 | + created() { | |
| 302 | + this.loadSuppliers() | |
| 303 | + this.loadExtraOptions() | |
| 304 | + this.loadRegionOptions() | |
| 305 | + }, | |
| 306 | + methods: { | |
| 307 | + async loadRegionOptions() { | |
| 308 | + try { | |
| 309 | + const res = await getArea() | |
| 310 | + const list = res.data || [] | |
| 311 | + this.regionOptions = (list || []).map(it => ({ label: it.name || '', value: it.id || '' })) | |
| 312 | + } catch (e) { | |
| 313 | + this.regionOptions = [] | |
| 314 | + } | |
| 315 | + }, | |
| 316 | + async loadDetail(contractId) { | |
| 317 | + const id = (contractId === undefined || contractId === null) ? '' : String(contractId) | |
| 318 | + if (!id) return | |
| 319 | + try { | |
| 320 | + const res = await getContractApi(id) | |
| 321 | + this.dataInfo = res && res.data ? res.data : {} | |
| 322 | + const data = res && res.data ? res.data : {} | |
| 323 | + const includesPackagingFeeName = data.includesPackagingFeeName || (data.includesPackagingFee ? '是' : '否') | |
| 324 | + const includesTransportFeeName = data.includesTransportFeeName || (data.includesTransportFee ? '是' : '否') | |
| 325 | + const m = { ...data, includesPackagingFeeName, includesTransportFeeName } | |
| 326 | + this.form = { | |
| 327 | + ...this.form, | |
| 328 | + id: m.id || '', | |
| 329 | + code: m.code || '', | |
| 330 | + supplier: m.supplier || '', | |
| 331 | + supplierName: m.supplierName || '', | |
| 332 | + buyer: m.buyer || (m.customer && m.customer.id) || '', | |
| 333 | + buyerName: m.buyerName || (m.customer && m.customer.name) || '', | |
| 334 | + stockUpCompanyId: m.stockUpCompanyId || '', | |
| 335 | + stockUpCompanyName: m.stockUpCompanyName || '', | |
| 336 | + orderDate: m.orderDate || '', | |
| 337 | + designatedConsignee: m.designatedConsignee || '', | |
| 338 | + specialTerms: m.specialTerms || '', | |
| 339 | + specialTermsName: m.specialTermsName || '', | |
| 340 | + executionStandard: m.executionStandard || '', | |
| 341 | + executionStandardName: m.executionStandardName || '', | |
| 342 | + executionStandardRemarks: m.executionStandardRemarks || '', | |
| 343 | + includesPackagingFee: !!m.includesPackagingFee, | |
| 344 | + includesPackagingFeeName, | |
| 345 | + includesTransportFee: !!m.includesTransportFee, | |
| 346 | + includesTransportFeeName, | |
| 347 | + unit: m.unit || this.form.unit, | |
| 348 | + totalAmountCapital: m.totalAmountCapital || '', | |
| 349 | + depositInfo: m.depositInfo || '', | |
| 350 | + packagingRequirements: m.packagingRequirements || '', | |
| 351 | + paymentTerms: m.paymentTerms || '', | |
| 352 | + transportMode: m.transportMode || '', | |
| 353 | + foreignDestination: (m.foreignDestination || ''), | |
| 354 | + specialInstructions: m.specialInstructions || '', | |
| 355 | + remarks: m.remarks || '', | |
| 356 | + pieceWeightHead: m.pieceWeightHead || '', | |
| 357 | + surface: m.surface || '', | |
| 358 | + tolerance: m.tolerance || '', | |
| 359 | + performance: m.performance || '', | |
| 360 | + component: m.component || '', | |
| 361 | + packaging: m.packaging || '', | |
| 362 | + workshopId: m.workshopId || '', | |
| 363 | + workshopName: m.workshopName || '', | |
| 364 | + region: m.region || '', | |
| 365 | + regionName: m.regionName || '', | |
| 366 | + deptName: m.deptName || '', | |
| 367 | + deptId: m.deptId || '', | |
| 368 | + } | |
| 369 | + this.fileInfo = { | |
| 370 | + id: m.standardFileId || '', | |
| 371 | + name: m.standardFileName || '' | |
| 372 | + } | |
| 373 | + this.standardStandardized = (m.standardStandardized === true || m.standardStandardized === false) ? m.standardStandardized : '' | |
| 374 | + this.standardStandardizedName = (this.standardStandardized === true) ? '是' : (this.standardStandardized === false) ? '否' : '' | |
| 375 | + const lines = Array.isArray(m.contractStdProcessingLineList) ? m.contractStdProcessingLineList : [] | |
| 376 | + this.productLineList = lines | |
| 377 | + this.onProductsChange(lines) | |
| 378 | + } catch (e) { } | |
| 379 | + }, | |
| 380 | + onProductsChange(products) { | |
| 381 | + const list = Array.isArray(products) ? products : [] | |
| 382 | + this.newProductLineList = list | |
| 383 | + const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.productQuantity) || 0), 0) | |
| 384 | + const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) | |
| 385 | + const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) | |
| 386 | + this.totalQuantity = sumQ | |
| 387 | + this.totalAmountExcludingTax = sumE | |
| 388 | + this.totalAmountIncludingTax = sumT | |
| 389 | + this.form.totalAmountCapital = formatCurrencyToChinese(sumT) | |
| 390 | + }, | |
| 391 | + async loadSuppliers() { | |
| 392 | + try { | |
| 393 | + const results = await getDicByCodes(['SUPPLIER']) | |
| 394 | + const items = results && results.SUPPLIER && results.SUPPLIER.data ? results.SUPPLIER.data : [] | |
| 395 | + this.supplierList = items.map(it => ({ label: it.name, value: it.code })) | |
| 396 | + } catch (e) { this.supplierList = [] } | |
| 397 | + }, | |
| 398 | + async loadExtraOptions() { | |
| 399 | + try { | |
| 400 | + const results = await getDicByCodes(['CONDITIONS_REQUIRED', 'APPLICABLE_STANDARD', 'CONTRACT_PRODUCT','RAW_TO_PROD_RATIO', 'RAW_MATERIAL', 'RAW_MATERIAL_GRADE']) | |
| 401 | + const c1 = results && results.CONDITIONS_REQUIRED && results.CONDITIONS_REQUIRED.data ? results.CONDITIONS_REQUIRED.data : [] | |
| 402 | + const c2 = results && results.APPLICABLE_STANDARD && results.APPLICABLE_STANDARD.data ? results.APPLICABLE_STANDARD.data : [] | |
| 403 | + const c3 = results && results.CONTRACT_PRODUCT && results.CONTRACT_PRODUCT.data ? results.CONTRACT_PRODUCT.data : [] | |
| 404 | + const c4 = results && results.RAW_TO_PROD_RATIO && results.RAW_TO_PROD_RATIO.data ? results.RAW_TO_PROD_RATIO.data : [] | |
| 405 | + const c5 = results && results.RAW_MATERIAL && results.RAW_MATERIAL.data ? results.RAW_MATERIAL.data : [] | |
| 406 | + const c6 = results && results.RAW_MATERIAL_GRADE && results.RAW_MATERIAL_GRADE.data ? results.RAW_MATERIAL_GRADE.data : [] | |
| 407 | + this.rawToProdRatioList = c4.map(it => ({ label: it.name, value: it.code })) | |
| 408 | + this.specialTermsList = c1.map(it => ({ label: it.name, value: it.code })) | |
| 409 | + this.executionStandardList = c2.map(it => ({ label: it.name, value: it.code })) | |
| 410 | + this.productList = c3.map(it => ({ label: it.name, value: it.code })) | |
| 411 | + console.log('c5', c5) | |
| 412 | + this.rawProductList = c5.map(it => ({ label: it.name, value: it.code })) | |
| 413 | + this.rawProductGradeList = c6.map(it => ({ label: it.name, value: it.code })) | |
| 414 | + } catch (e) { | |
| 415 | + this.specialTermsList = [] | |
| 416 | + this.executionStandardList = [] | |
| 417 | + this.productList = [] | |
| 418 | + this.rawToProdRatioList = [] | |
| 419 | + this.rawProductList = [] | |
| 420 | + this.rawProductGradeList = [] | |
| 421 | + } | |
| 422 | + }, | |
| 423 | + displayLabel(field) { | |
| 424 | + const m = this.form | |
| 425 | + const map = { supplierName: '请选择承揽方', buyerName: '请选择定作方', workshopName: '请选择生产厂' } | |
| 426 | + const val = m[field] | |
| 427 | + return val ? String(val) : map[field] | |
| 428 | + }, | |
| 429 | + async openSheet(field) { | |
| 430 | + const setSheet = (title, options) => { | |
| 431 | + const current = this.form[field] | |
| 432 | + const match = (options || []).find(o => String(o.label) === String(current) || String(o.value) === String(current)) | |
| 433 | + this.sheet = { ...this.sheet, visible: true, title, options, field, value: match ? match.value : '' } | |
| 434 | + } | |
| 435 | + if (field === 'workshopId') { | |
| 436 | + const res = await workshopQueryApi({ pageIndex: 1, pageSize: 9999 }) | |
| 437 | + const _data = res.data || {} | |
| 438 | + const list = _data.datas || (Array.isArray(_data) ? _data : []) | |
| 439 | + const opts = (list || []).map(it => ({ | |
| 440 | + label: it.name , | |
| 441 | + value: it.id | |
| 442 | + })) | |
| 443 | + setSheet('生产厂', opts) | |
| 444 | + } else if (field === 'supplier') { | |
| 445 | + setSheet('承揽方', this.supplierList) | |
| 446 | + } else if (field === 'specialTerms') { | |
| 447 | + setSheet('特别条款要求', this.specialTermsList) | |
| 448 | + } else if (field === 'executionStandard') { | |
| 449 | + setSheet('执行标准', this.executionStandardList) | |
| 450 | + } else if (field === 'includesPackagingFee') { | |
| 451 | + setSheet('单价中是否已包含包装费', this.yesNoList) | |
| 452 | + } else if (field === 'includesTransportFee') { | |
| 453 | + setSheet('单价中是否已包含运费', this.yesNoList) | |
| 454 | + } else if (field === 'standardStandardized') { | |
| 455 | + const options = this.yesNoList | |
| 456 | + const current = this.standardStandardized | |
| 457 | + const match = (options || []).find(o => String(o.value) === String(current) || String(o.label) === String(current)) | |
| 458 | + this.sheet = { ...this.sheet, visible: true, title: '合同是否规范', options, field, value: match ? match.value : '' } | |
| 459 | + } | |
| 460 | + }, | |
| 461 | + onSheetConfirm({ value, label }) { | |
| 462 | + const field = this.sheet.field | |
| 463 | + if (!field) return | |
| 464 | + const v = (value === undefined || value === null) ? '' : value | |
| 465 | + if (field === 'standardStandardized') { | |
| 466 | + this.standardStandardized = v | |
| 467 | + this.standardStandardizedName = label || '' | |
| 468 | + } else { | |
| 469 | + this.form[field] = v | |
| 470 | + this.form[field + 'Name'] = label || '' | |
| 471 | + } | |
| 472 | + }, | |
| 473 | + openRelate(fieldKey) { | |
| 474 | + let config = {} | |
| 475 | + if (fieldKey === 'buyer') { | |
| 476 | + config = { title: '定作方', source: 'customer', rowKey: 'id', multiple: false, display: [{ label: '名称', field: 'name' }, { label: '编号', field: 'code' }, { label: '状态', field: 'available', format: v => (v ? '启用' : '停用') }] } | |
| 477 | + } | |
| 478 | + const selectedKeys = this.form[fieldKey] ? [this.form[fieldKey]] : [] | |
| 479 | + this.sheet.visible = false | |
| 480 | + this.relate = { ...this.relate, title: config.title, source: config.source, display: config.display, multiple: config.multiple, rowKey: config.rowKey, selectedKeys, fieldKey } | |
| 481 | + this.$nextTick(() => { this.relate.visible = true }) | |
| 482 | + }, | |
| 483 | + onRelateConfirm({ items }) { | |
| 484 | + const _fieldKey = this.relate.fieldKey | |
| 485 | + const first = (items && items.length > 0) ? items[0] : null | |
| 486 | + this.form[_fieldKey] = (first && first.id) ? first.id : '' | |
| 487 | + this.form[_fieldKey + 'Name'] = (first && first.name) ? first.name : '' | |
| 488 | + }, | |
| 489 | + onRadioSelect(field, nameField, opt) { | |
| 490 | + const val = opt && opt.value != null ? opt.value : '' | |
| 491 | + const label = opt && opt.label != null ? opt.label : '' | |
| 492 | + this.form[field] = val | |
| 493 | + this.form[nameField] = label | |
| 494 | + if (field === 'executionStandard' && val !== 'OTHER') { | |
| 495 | + this.form.executionStandardRemarks = '' | |
| 496 | + } | |
| 497 | + }, | |
| 498 | + validateRequired() { | |
| 499 | + const checks = [ | |
| 500 | + { key: 'code', label: '编号' }, | |
| 501 | + { key: 'supplier', label: '承揽方' }, | |
| 502 | + { key: 'buyer', label: '定作方' }, | |
| 503 | + { key: 'orderDate', label: '订货日期' }, | |
| 504 | + { key: 'workshopId', label: '生产厂' }, | |
| 505 | + { key: 'unit', label: '单位' }, | |
| 506 | + { key: 'specialTerms', label: '特别条款要求' }, | |
| 507 | + ] | |
| 508 | + for (const it of checks) { | |
| 509 | + const val = this.form[it.key] | |
| 510 | + const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) | |
| 511 | + if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } | |
| 512 | + } | |
| 513 | + if (this.$refs.productRel && !this.$refs.productRel.validate()) return false | |
| 514 | + const list = Array.isArray(this.newProductLineList) ? this.newProductLineList : [] | |
| 515 | + if (list.length === 0) { | |
| 516 | + uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false | |
| 517 | + } | |
| 518 | + const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === '')) | |
| 519 | + const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v))) | |
| 520 | + console.log('list11', list) | |
| 521 | + for (const [idx, it] of list.entries()) { | |
| 522 | + if ( | |
| 523 | + strEmpty(it.productName) || | |
| 524 | + strEmpty(it.industry) || | |
| 525 | + strEmpty(it.quality) || | |
| 526 | + numEmpty(it.productQuantity) || | |
| 527 | + strEmpty(it.unitPrice) || | |
| 528 | + strEmpty(it.deliveryDate) | |
| 529 | + ) { | |
| 530 | + uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false | |
| 531 | + } | |
| 532 | + } | |
| 533 | + return true | |
| 534 | + }, | |
| 535 | + getFormValues() { | |
| 536 | + const clone = (v) => JSON.parse(JSON.stringify(v == null ? null : v)) | |
| 537 | + const form = clone(this.form) || {} | |
| 538 | + return { | |
| 539 | + ...this.dataInfo, | |
| 540 | + ...form, | |
| 541 | + contractDistributorLineList: clone(this.newProductLineList) || [], | |
| 542 | + totalQuantity: this.totalQuantity, | |
| 543 | + totalAmountExcludingTax: this.totalAmountExcludingTax, | |
| 544 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | |
| 545 | + standardStandardized: this.standardStandardized, | |
| 546 | + standardStandardizedName: this.standardStandardizedName, | |
| 547 | + standardFileId: this.fileInfo.id, | |
| 548 | + standardFileName: this.fileInfo.name, | |
| 549 | + } | |
| 550 | + } | |
| 551 | + } | |
| 552 | +} | |
| 553 | +</script> | |
| 554 | + | |
| 555 | +<style lang="scss" scoped> | |
| 556 | +.total { | |
| 557 | + .total-text { | |
| 558 | + font-weight: 600; | |
| 559 | + font-size: 32rpx; | |
| 560 | + color: rgba(0, 0, 0, 0.9); | |
| 561 | + padding-bottom: 28rpx; | |
| 562 | + border-bottom: 2rpx solid #E7E7E7; | |
| 563 | + } | |
| 564 | + | |
| 565 | + .total-item { | |
| 566 | + display: flex; | |
| 567 | + align-items: center; | |
| 568 | + } | |
| 569 | + | |
| 570 | + .total-item-text { | |
| 571 | + font-weight: 400; | |
| 572 | + font-size: 28rpx; | |
| 573 | + color: rgba(0, 0, 0, 0.6); | |
| 574 | + line-height: 32rpx; | |
| 575 | + width: 240rpx; | |
| 576 | + padding: 12rpx 0; | |
| 577 | + } | |
| 578 | + | |
| 579 | + .total-item-price { | |
| 580 | + font-weight: 600; | |
| 581 | + font-size: 32rpx; | |
| 582 | + color: rgba(0, 0, 0, 0.9); | |
| 583 | + line-height: 32rpx; | |
| 584 | + } | |
| 585 | + | |
| 586 | + .text-red { | |
| 587 | + color: #D54941; | |
| 588 | + } | |
| 589 | +} | |
| 590 | + | |
| 591 | +.page { | |
| 592 | + display: flex; | |
| 593 | + flex-direction: column; | |
| 594 | + height: 100%; | |
| 595 | +} | |
| 596 | + | |
| 597 | +.scroll { | |
| 598 | + flex: 1; | |
| 599 | + padding: 12rpx 0 500rpx !important; | |
| 600 | +} | |
| 601 | + | |
| 602 | +.footer-total { | |
| 603 | + z-index: 2; | |
| 604 | + position: fixed; | |
| 605 | + left: 0; | |
| 606 | + right: 0; | |
| 607 | + bottom: 120rpx; | |
| 608 | + padding: 32rpx; | |
| 609 | + padding-bottom: calc(32rpx + env(safe-area-inset-bottom)); | |
| 610 | + background: #fff; | |
| 611 | + box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.06); | |
| 612 | +} | |
| 613 | + | |
| 614 | +.footer-total .btn { | |
| 615 | + height: 80rpx; | |
| 616 | + line-height: 80rpx; | |
| 617 | + border-radius: 12rpx; | |
| 618 | + font-size: 32rpx; | |
| 619 | +} | |
| 620 | + | |
| 621 | +.group { | |
| 622 | + background: #fff; | |
| 623 | + padding: 24rpx 32rpx; | |
| 624 | + margin-bottom: 20rpx; | |
| 625 | +} | |
| 626 | + | |
| 627 | +.group-title { | |
| 628 | + color: rgba(0, 0, 0, 0.9); | |
| 629 | + font-size: 32rpx; | |
| 630 | + padding-bottom: 16rpx; | |
| 631 | +} | |
| 632 | + | |
| 633 | +.radio-list { | |
| 634 | + display: flex; | |
| 635 | + flex-direction: column; | |
| 636 | +} | |
| 637 | +.quality { | |
| 638 | + background-color: #fff; | |
| 639 | + display: flex; | |
| 640 | + align-items: center; | |
| 641 | + padding: 24rpx 32rpx; | |
| 642 | + border-bottom: 1rpx solid #f0f0f0; | |
| 643 | + margin-top: 20rpx; | |
| 644 | + | |
| 645 | + .title { | |
| 646 | + font-size: 32rpx; | |
| 647 | + color: rgba(0, 0, 0, 0.9); | |
| 648 | + font-weight: 600; | |
| 649 | + } | |
| 650 | + | |
| 651 | + .opCollapse { | |
| 652 | + color: rgba(0, 0, 0, 0.6); | |
| 653 | + width: 32rpx; | |
| 654 | + height: 28rpx; | |
| 655 | + margin-right: 16rpx; | |
| 656 | + } | |
| 657 | +} | |
| 658 | + | |
| 659 | +.radio-item { | |
| 660 | + display: flex; | |
| 661 | + align-items: center; | |
| 662 | + padding: 24rpx 0; | |
| 663 | + border-bottom: 1rpx solid #f0f0f0; | |
| 664 | +} | |
| 665 | + | |
| 666 | +.radio-item:last-child { | |
| 667 | + border-bottom: none; | |
| 668 | +} | |
| 669 | + | |
| 670 | +.radio { | |
| 671 | + width: 32rpx; | |
| 672 | + height: 32rpx; | |
| 673 | + border-radius: 50%; | |
| 674 | + border: 2rpx solid #DCDCDC; | |
| 675 | + margin-right: 20rpx; | |
| 676 | + box-sizing: border-box; | |
| 677 | +} | |
| 678 | + | |
| 679 | +.radio.checked { | |
| 680 | + background: $theme-primary; | |
| 681 | + border-color: $theme-primary; | |
| 682 | +} | |
| 683 | + | |
| 684 | +.radio-item .label { | |
| 685 | + font-size: 32rpx; | |
| 686 | + color: rgba(0, 0, 0, 0.9); | |
| 687 | +} | |
| 688 | + | |
| 689 | +::v-deep .uni-list { | |
| 690 | + background: transparent; | |
| 691 | +} | |
| 692 | + | |
| 693 | +::v-deep .uni-list .uni-easyinput .uni-input-input { | |
| 694 | + color: rgba(0, 0, 0, 0.9); | |
| 695 | +} | |
| 696 | + | |
| 697 | +::v-deep .uni-list .uni-input-placeholder { | |
| 698 | + z-index: 1; | |
| 699 | +} | |
| 700 | + | |
| 701 | +::v-deep .uni-list .uni-input-input { | |
| 702 | + background-color: #ffffff; | |
| 703 | +} | |
| 704 | + | |
| 705 | +::v-deep .uni-list-item__extra-text { | |
| 706 | + font-size: 32rpx; | |
| 707 | +} | |
| 708 | + | |
| 709 | +::v-deep .uni-list-item__content-title { | |
| 710 | + font-size: 32rpx; | |
| 711 | + color: rgba(0, 0, 0, 0.9); | |
| 712 | +} | |
| 713 | + | |
| 714 | +::v-deep .uni-list-item__container { | |
| 715 | + padding: 32rpx; | |
| 716 | +} | |
| 717 | + | |
| 718 | +::v-deep .uni-list-item__container .uni-easyinput__placeholder-class { | |
| 719 | + font-size: 32rpx; | |
| 720 | + color: rgba(0, 0, 0, 0.4); | |
| 721 | +} | |
| 722 | + | |
| 723 | +::v-deep .uni-list-item__container .uni-easyinput__content { | |
| 724 | + border: none; | |
| 725 | + background-color: #ffffff !important; | |
| 726 | +} | |
| 727 | + | |
| 728 | +::v-deep .uni-list-item__container .uni-easyinput__content-input { | |
| 729 | + padding-left: 0 !important; | |
| 730 | + height: 48rpx; | |
| 731 | + line-height: 48rpx; | |
| 732 | + font-size: 32rpx; | |
| 733 | +} | |
| 734 | + | |
| 735 | +::v-deep .uni-list-item__container .uni-easyinput__content .content-clear-icon { | |
| 736 | + font-size: 44rpx !important; | |
| 737 | +} | |
| 738 | + | |
| 739 | +::v-deep .uni-list-item__container .item-title, | |
| 740 | +::v-deep .uni-list-item__container .uni-list-item__content { | |
| 741 | + flex: none; | |
| 742 | + min-height: 48rpx; | |
| 743 | + line-height: 48rpx; | |
| 744 | + font-size: 32rpx; | |
| 745 | + position: relative; | |
| 746 | + width: 210rpx; | |
| 747 | + margin-right: 32rpx; | |
| 748 | + color: rgba(0, 0, 0, 0.9); | |
| 749 | +} | |
| 750 | + | |
| 751 | +::v-deep .uni-list-item__container .item-title .required { | |
| 752 | + color: red; | |
| 753 | + position: absolute; | |
| 754 | + top: 50%; | |
| 755 | + transform: translateY(-50%); | |
| 756 | + left: -16rpx; | |
| 757 | +} | |
| 758 | + | |
| 759 | +::v-deep .uni-list-item.select-item.is-empty .uni-list-item__extra-text { | |
| 760 | + color: rgba(0, 0, 0, 0.4) !important; | |
| 761 | +} | |
| 762 | + | |
| 763 | +::v-deep .uni-list-item.select-item.is-filled .uni-list-item__extra-text { | |
| 764 | + color: rgba(0, 0, 0, 0.9) !important; | |
| 765 | +} | |
| 766 | +::v-deep .uni-easyinput { | |
| 767 | + &__placeholder-class { | |
| 768 | + font-size: 32rpx; | |
| 769 | + color: rgba(0, 0, 0, 0.4); | |
| 770 | + } | |
| 771 | + | |
| 772 | + &__content { | |
| 773 | + border: none; | |
| 774 | + background-color: #ffffff !important; | |
| 775 | + height: 100%; | |
| 776 | + &-input { | |
| 777 | + padding-left: 0 !important; | |
| 778 | + height: 48rpx; | |
| 779 | + line-height: 48rpx; | |
| 780 | + font-size: 32rpx; | |
| 781 | + } | |
| 782 | + | |
| 783 | + .content-clear-icon { | |
| 784 | + font-size: 44rpx !important; | |
| 785 | + } | |
| 786 | + } | |
| 787 | + } | |
| 788 | + | |
| 789 | +</style> | ... | ... |
| ... | ... | @@ -222,7 +222,7 @@ import { workshopQueryApi } from '@/api/devManage' |
| 222 | 222 | import { getArea } from '@/api/credit_manage.js' |
| 223 | 223 | |
| 224 | 224 | export default { |
| 225 | - name: 'UploadContractUnplan', | |
| 225 | + name: 'DraftDistAgmtViewer', | |
| 226 | 226 | components: { SingleSelectSheet, RelateSelectSheet, ProductRel, CitySelector, FileUpload }, |
| 227 | 227 | props: { |
| 228 | 228 | id: { | ... | ... |
| ... | ... | @@ -239,7 +239,7 @@ export default { |
| 239 | 239 | if (_contractType && _contractType !== 'PROCESS_STD_AGMT' && _contractType !== 'DISTRIB_STD'&& _contractType !== 'INTL_STD_CONTRACT') { |
| 240 | 240 | if (_contractType === 'DIST_STOCK_CONTRACT' || _contractType === 'INTL_INVENTORY_AGMT') { |
| 241 | 241 | params.mode = 'FORMAL_CONTRACT' |
| 242 | - }else if(_contractType === 'DRAFT_DIST_AGMT'){ | |
| 242 | + }else if(_contractType === 'DRAFT_DIST_AGMT' || _contractType === 'INTL_OPEN_SPEC_AGMT'){ | |
| 243 | 243 | params.mode = 'STANDARD_CONTRACT' |
| 244 | 244 | }else{ |
| 245 | 245 | params.mode = _contractType; | ... | ... |
| ... | ... | @@ -5,9 +5,11 @@ import ForeignStdViewer from '@/pages/contract_foreign_std/foreignStdViewer.vue' |
| 5 | 5 | import StockViewer from '@/pages/contract_stock/stockViewer.vue' |
| 6 | 6 | import ForeignStockViewer from '@/pages/contract_foreign_stock/foreignStockViewer.vue' |
| 7 | 7 | import DraftDistAgmtViewer from '@/pages/contract_unplan/draftDistAgmtViewer.vue' |
| 8 | +import AgmtViewer from '@/pages/contract_process/agmtViewer.vue' | |
| 8 | 9 | import StandardContractViewer from '@/components/contract-view/standardContractViewer.vue' |
| 9 | 10 | import FormalContractViewer from '@/components/contract-view/formalContractViewer.vue' |
| 10 | 11 | import ProcessStdAgmtViewer from '@/pages/contract_process/processStdAgmtViewer.vue' |
| 12 | +import ForeignDraftDistAgmtViewer from '@/pages/contract_foreign_unplan/foreignDraftDistAgmtViewer.vue' | |
| 11 | 13 | import SpecLockDelayViewer from '@/components/contract-view/specLockDelayViewer.vue' |
| 12 | 14 | import OrderListApprove from '@/pages/order_list/approve.vue' |
| 13 | 15 | import OrderListViewer from '@/pages/order_list/viewer.vue' |
| ... | ... | @@ -44,4 +46,6 @@ export default function registerComponents(Vue) { |
| 44 | 46 | Vue.component('ForeignStockViewer', ForeignStockViewer) |
| 45 | 47 | Vue.component('FollowUpFormViewer', FollowUpFormViewer) |
| 46 | 48 | Vue.component('DraftDistAgmtViewer', DraftDistAgmtViewer) |
| 49 | + Vue.component('ForeignDraftDistAgmtViewer', ForeignDraftDistAgmtViewer) | |
| 50 | + Vue.component('AgmtViewer', AgmtViewer) | |
| 47 | 51 | } |
| \ No newline at end of file | ... | ... |
| ... | ... | @@ -29,8 +29,14 @@ export const getSysFlowComponentPath = (bizFlag) => { |
| 29 | 29 | case 'INTL_INVENTORY_AGMT': // 外贸库存合同 |
| 30 | 30 | componentPath = 'ForeignStockViewer'; // 外贸库存合同-审批修改 |
| 31 | 31 | break; |
| 32 | + case 'INTL_OPEN_SPEC_AGMT': // 外贸未锁规合同 | |
| 33 | + componentPath = 'ForeignDraftDistAgmtViewer'; // 外贸未锁规合同-审批修改 | |
| 34 | + break; | |
| 32 | 35 | case 'DRAFT_DIST_AGMT': // 经销未锁规合同 |
| 33 | 36 | componentPath = 'DraftDistAgmtViewer'; // 经销未锁规合同-审批修改 |
| 37 | + break; | |
| 38 | + case 'AGMT_VIEW': // 加工标准合同 | |
| 39 | + componentPath = 'AgmtViewer'; // 加工标准合同-审批详情 | |
| 34 | 40 | break; |
| 35 | 41 | case 'STANDARD_CONTRACT_EDIT': // 标准合同 |
| 36 | 42 | componentPath = 'StandardContractViewer'; // 标准合同-审批 | ... | ... |