Showing
36 changed files
with
1486 additions
and
837 deletions
Too many changes to show.
To preserve performance only 36 of 37 files are displayed.
| @@ -5,6 +5,7 @@ export const statusStyle = [ | @@ -5,6 +5,7 @@ export const statusStyle = [ | ||
| 5 | { color: '#2BA471', bgColor:'#E3F9E9',text: '审核通过' }, | 5 | { color: '#2BA471', bgColor:'#E3F9E9',text: '审核通过' }, |
| 6 | { color: '#D54941', bgColor:'#FFF0ED',text: '已驳回' }, | 6 | { color: '#D54941', bgColor:'#FFF0ED',text: '已驳回' }, |
| 7 | { color: '#3D48A3', bgColor:'#F2F3FF',text: '审核中' }, | 7 | { color: '#3D48A3', bgColor:'#F2F3FF',text: '审核中' }, |
| 8 | + { color: '#000', bgColor:'#F2F3FF',text: '已取消' }, | ||
| 8 | ]; | 9 | ]; |
| 9 | 10 | ||
| 10 | export const statusMap = { | 11 | export const statusMap = { |
| @@ -129,7 +129,7 @@ | @@ -129,7 +129,7 @@ | ||
| 129 | </uni-list-item> | 129 | </uni-list-item> |
| 130 | <uni-list-item title="发货日期"> | 130 | <uni-list-item title="发货日期"> |
| 131 | <template v-slot:footer> | 131 | <template v-slot:footer> |
| 132 | - <uni-datetime-picker type="date" v-model="item.orderDate" @change="onDateChange(idx, $event)" /> | 132 | + <uni-datetime-picker type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" /> |
| 133 | </template> | 133 | </template> |
| 134 | </uni-list-item> | 134 | </uni-list-item> |
| 135 | </uni-list> | 135 | </uni-list> |
| @@ -151,7 +151,30 @@ | @@ -151,7 +151,30 @@ | ||
| 151 | <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view> | 151 | <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view> |
| 152 | <view class="row"><text class="label">牌号</text><text class="value">{{ item.brand }}</text></view> | 152 | <view class="row"><text class="label">牌号</text><text class="value">{{ item.brand }}</text></view> |
| 153 | <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view> | 153 | <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view> |
| 154 | - <view class="row"><text class="label">规格</text><text class="value">{{ item.specDisplay }}</text></view> | 154 | + <!-- 厚(公差) * 宽(公差) * 长(公差) --> |
| 155 | + <view class="row row-spec"><text class="label">规格(mm)</text> | ||
| 156 | + <view class="value value-spec"> | ||
| 157 | + <view v-if="item.thickness" class="value-spec_val">{{ item.thickness }}</view> | ||
| 158 | + <view v-if="item.thickness" class="value-spec_box"> | ||
| 159 | + <view v-if="item.thicknessTolPos" class="value-spec_box_1">+{{ item.thicknessTolPos }} | ||
| 160 | + </view> | ||
| 161 | + <view v-if="item.thicknessTolNeg" class="value-spec_box_2">-{{ item.thicknessTolNeg }} | ||
| 162 | + </view> | ||
| 163 | + </view> | ||
| 164 | + <view v-if="item.width" class="value-spec_val p12">*</view> | ||
| 165 | + <view v-if="item.width" class="value-spec_val">{{ item.width }}</view> | ||
| 166 | + <view v-if="item.width" class="value-spec_box"> | ||
| 167 | + <view v-if="item.widthTolPos" class="value-spec_box_1">+{{ item.widthTolPos }}</view> | ||
| 168 | + <view v-if="item.widthTolNeg" class="value-spec_box_2">-{{ item.widthTolNeg }}</view> | ||
| 169 | + </view> | ||
| 170 | + <view v-if="item.length" class="value-spec_val p12">*</view> | ||
| 171 | + <view v-if="item.length" class="value-spec_val">{{ item.length }}</view> | ||
| 172 | + <view v-if="item.length" class="value-spec_box"> | ||
| 173 | + <view v-if="item.lengthTolPos" class="value-spec_box_1">+{{ item.lengthTolPos }}</view> | ||
| 174 | + <view v-if="item.lengthTolNeg" class="value-spec_box_2">-{{ item.lengthTolNeg }}</view> | ||
| 175 | + </view> | ||
| 176 | + </view> | ||
| 177 | + </view> | ||
| 155 | <view class="row"><text class="label">状态</text><text class="value">{{ item.status }}</text></view> | 178 | <view class="row"><text class="label">状态</text><text class="value">{{ item.status }}</text></view> |
| 156 | <view class="row"><text class="label">数量</text><text class="value">{{ item.quantity }}</text></view> | 179 | <view class="row"><text class="label">数量</text><text class="value">{{ item.quantity }}</text></view> |
| 157 | <view class="row"><text class="label">单价</text><text class="value">{{ formatCurrency(item.unitPrice) | 180 | <view class="row"><text class="label">单价</text><text class="value">{{ formatCurrency(item.unitPrice) |
| @@ -162,7 +185,7 @@ | @@ -162,7 +185,7 @@ | ||
| 162 | }}</text></view> | 185 | }}</text></view> |
| 163 | <view class="row"><text class="label">总金额</text><text class="value">{{ formatCurrency(item.totalAmount) | 186 | <view class="row"><text class="label">总金额</text><text class="value">{{ formatCurrency(item.totalAmount) |
| 164 | }}</text></view> | 187 | }}</text></view> |
| 165 | - <view class="row"><text class="label">发货日期</text><text class="value">{{ item.orderDate }}</text></view> | 188 | + <view class="row"><text class="label">发货日期</text><text class="value">{{ item.deliveryDate }}</text></view> |
| 166 | </view> | 189 | </view> |
| 167 | </view> | 190 | </view> |
| 168 | <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value" @confirm="onProductConfirm" /> | 191 | <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value" @confirm="onProductConfirm" /> |
| @@ -176,7 +199,7 @@ export default { | @@ -176,7 +199,7 @@ export default { | ||
| 176 | mode: { type: String, default: 'add' }, | 199 | mode: { type: String, default: 'add' }, |
| 177 | list: { type: Array, default: () => [] }, | 200 | list: { type: Array, default: () => [] }, |
| 178 | max: { type: Number, default: 8 }, | 201 | max: { type: Number, default: 8 }, |
| 179 | - orderDateBase: { type: String, default: '' }, | 202 | + deliveryDateBase: { type: String, default: '' }, |
| 180 | options: { type: Array, default: () => [] } | 203 | options: { type: Array, default: () => [] } |
| 181 | }, | 204 | }, |
| 182 | components: { SingleSelectSheet }, | 205 | components: { SingleSelectSheet }, |
| @@ -218,7 +241,7 @@ export default { | @@ -218,7 +241,7 @@ export default { | ||
| 218 | }, | 241 | }, |
| 219 | methods: { | 242 | methods: { |
| 220 | defaultItem() { | 243 | defaultItem() { |
| 221 | - return { productId: '', productName: '', industry: '', brand: '', quality: '', thickness: '', thicknessTolPos: '', thicknessTolNeg: '', width: '', widthTolPos: '', widthTolNeg: '', length: '', lengthTolPos: '', lengthTolNeg: '', status: '', quantity: '', unitPrice: '', amountExcludingTax: 0, totalAmount: 0, orderDate: '' } | 244 | + return { productId: '', productName: '', industry: '', brand: '', quality: '', thickness: '', thicknessTolPos: '', thicknessTolNeg: '', width: '', widthTolPos: '', widthTolNeg: '', length: '', lengthTolPos: '', lengthTolNeg: '', status: '', quantity: '', unitPrice: '', amountExcludingTax: 0, totalAmount: 0, deliveryDate: '' } |
| 222 | }, | 245 | }, |
| 223 | onImmediateChange(idx) { | 246 | onImmediateChange(idx) { |
| 224 | this.$nextTick(() => this.recalculate(idx)) | 247 | this.$nextTick(() => this.recalculate(idx)) |
| @@ -319,15 +342,15 @@ export default { | @@ -319,15 +342,15 @@ export default { | ||
| 319 | onDateChange(idx, e) { | 342 | onDateChange(idx, e) { |
| 320 | const it = this.items[idx] | 343 | const it = this.items[idx] |
| 321 | if (!it) return | 344 | if (!it) return |
| 322 | - const val = typeof e === 'string' ? e : (e && e.detail && e.detail.value) ? e.detail.value : it.orderDate | 345 | + const val = typeof e === 'string' ? e : (e && e.detail && e.detail.value) ? e.detail.value : it.deliveryDate |
| 323 | const dateStr = String(val).slice(0, 10) | 346 | const dateStr = String(val).slice(0, 10) |
| 324 | - const base = this.orderDateBase ? new Date(this.orderDateBase) : null | 347 | + const base = this.deliveryDateBase ? new Date(this.deliveryDateBase) : null |
| 325 | const d = new Date(dateStr) | 348 | const d = new Date(dateStr) |
| 326 | if (base && !isNaN(d.getTime()) && d.getTime() < base.getTime()) { | 349 | if (base && !isNaN(d.getTime()) && d.getTime() < base.getTime()) { |
| 327 | uni.showToast({ title: '发货日期不得早于订货日期', icon: 'none' }) | 350 | uni.showToast({ title: '发货日期不得早于订货日期', icon: 'none' }) |
| 328 | - it.orderDate = this.orderDateBase | 351 | + it.deliveryDate = this.deliveryDateBase |
| 329 | } else { | 352 | } else { |
| 330 | - it.orderDate = dateStr | 353 | + it.deliveryDate = dateStr |
| 331 | } | 354 | } |
| 332 | this.$set(this.items, idx, it) | 355 | this.$set(this.items, idx, it) |
| 333 | }, | 356 | }, |
| @@ -500,8 +523,46 @@ export default { | @@ -500,8 +523,46 @@ export default { | ||
| 500 | 523 | ||
| 501 | .value { | 524 | .value { |
| 502 | flex: 1; | 525 | flex: 1; |
| 503 | - text-align: right; | 526 | + // text-align: right; |
| 504 | color: rgba(0, 0, 0, 0.9); | 527 | color: rgba(0, 0, 0, 0.9); |
| 505 | font-size: 28rpx; | 528 | font-size: 28rpx; |
| 506 | } | 529 | } |
| 530 | + .value-spec { | ||
| 531 | + height: 48rpx; | ||
| 532 | + display: flex; | ||
| 533 | + align-items: center; | ||
| 534 | + color: #000000; | ||
| 535 | + // justify-content: end; | ||
| 536 | + &_box { | ||
| 537 | + position: relative; | ||
| 538 | + width: 60rpx; | ||
| 539 | + height: 48rpx; | ||
| 540 | + | ||
| 541 | + &_1 { | ||
| 542 | + font-size: 16rpx; | ||
| 543 | + position: absolute; | ||
| 544 | + top: -10rpx; | ||
| 545 | + left: 0; | ||
| 546 | + } | ||
| 547 | + | ||
| 548 | + &_2 { | ||
| 549 | + font-size: 16rpx; | ||
| 550 | + position: absolute; | ||
| 551 | + bottom: -10rpx; | ||
| 552 | + left: 0; | ||
| 553 | + } | ||
| 554 | + } | ||
| 555 | + | ||
| 556 | + &_val { | ||
| 557 | + font-size: 28rpx; | ||
| 558 | + | ||
| 559 | + &.p12 { | ||
| 560 | + padding-right: 12rpx; | ||
| 561 | + } | ||
| 562 | + } | ||
| 563 | + } | ||
| 564 | + .row-spec { | ||
| 565 | + height: 60rpx; | ||
| 566 | + align-items: center; | ||
| 567 | + } | ||
| 507 | </style> | 568 | </style> |
| @@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
| 39 | <view class="item-title"><text class="required">*</text><text>生产厂</text></view> | 39 | <view class="item-title"><text class="required">*</text><text>生产厂</text></view> |
| 40 | </template> | 40 | </template> |
| 41 | </uni-list-item> | 41 | </uni-list-item> |
| 42 | - <ProductRel mode="add" :orderDateBase="form.orderDate" @change="onProductsChange" :options="productList" /> | 42 | + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" /> |
| 43 | <uni-list-item title="合计人民币金额(大写)"> | 43 | <uni-list-item title="合计人民币金额(大写)"> |
| 44 | <template v-slot:footer> | 44 | <template v-slot:footer> |
| 45 | <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled /> | 45 | <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled /> |
| @@ -92,33 +92,25 @@ | @@ -92,33 +92,25 @@ | ||
| 92 | :inputBorder="false" /> | 92 | :inputBorder="false" /> |
| 93 | </template> | 93 | </template> |
| 94 | </uni-list-item> | 94 | </uni-list-item> |
| 95 | - <view class="group"> | ||
| 96 | - <view class="group-title">特别条款要求</view> | ||
| 97 | - <view class="radio-list"> | ||
| 98 | - <view v-for="(opt, i) in specialTermsList" :key="'cr-' + i" class="radio-item" | ||
| 99 | - @click="onRadioSelect('specialTerms', 'specialTermsName', opt)"> | ||
| 100 | - <view :class="['radio', { checked: form.specialTerms === opt.value }]" /> | ||
| 101 | - <text class="label">{{ opt.label }}</text> | ||
| 102 | - </view> | ||
| 103 | - </view> | ||
| 104 | - </view> | ||
| 105 | - <view class="group"> | ||
| 106 | - <view class="group-title">执行标准</view> | ||
| 107 | - <view class="radio-list"> | ||
| 108 | - <view v-for="(opt, i) in executionStandardList" :key="'es-' + i" class="radio-item" | ||
| 109 | - @click="onRadioSelect('executionStandard', 'executionStandardName', opt)"> | ||
| 110 | - <view :class="['radio', { checked: form.executionStandard === opt.value }]" /> | ||
| 111 | - <text class="label">{{ opt.label }}</text> | ||
| 112 | - </view> | ||
| 113 | - </view> | ||
| 114 | - </view> | 95 | + <uni-list-item class="select-item" :class="form.specialTermsName ? 'is-filled' : 'is-empty'" clickable |
| 96 | + @click="openSheet('specialTerms')" :rightText="form.specialTermsName || '请选择'" showArrow> | ||
| 97 | + <template v-slot:body> | ||
| 98 | + <view class="item-title"><text class="required">*</text><text>特别条款要求</text></view> | ||
| 99 | + </template> | ||
| 100 | + </uni-list-item> | ||
| 101 | + <uni-list-item class="select-item" :class="form.executionStandardName ? 'is-filled' : 'is-empty'" clickable | ||
| 102 | + @click="openSheet('executionStandard')" :rightText="form.executionStandardName || '请选择'" showArrow> | ||
| 103 | + <template v-slot:body> | ||
| 104 | + <view class="item-title"><text>执行标准</text></view> | ||
| 105 | + </template> | ||
| 106 | + </uni-list-item> | ||
| 115 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> | 107 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> |
| 116 | <template v-slot:footer> | 108 | <template v-slot:footer> |
| 117 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" | 109 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" |
| 118 | :inputBorder="false" /> | 110 | :inputBorder="false" /> |
| 119 | </template> | 111 | </template> |
| 120 | </uni-list-item> | 112 | </uni-list-item> |
| 121 | - <uni-list-item title="特别说明"> | 113 | + <uni-list-item title="特别说明" style="margin-top: 20rpx;"> |
| 122 | <template v-slot:footer> | 114 | <template v-slot:footer> |
| 123 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> | 115 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> |
| 124 | </template> | 116 | </template> |
| @@ -181,7 +173,7 @@ | @@ -181,7 +173,7 @@ | ||
| 181 | 数量 | 173 | 数量 |
| 182 | </div> | 174 | </div> |
| 183 | <div class="total-item-price"> | 175 | <div class="total-item-price"> |
| 184 | - {{ (sumQuantity || 0).toFixed(2) }}t | 176 | + {{ (totalQuantity || 0).toFixed(2) }}kg |
| 185 | </div> | 177 | </div> |
| 186 | </div> | 178 | </div> |
| 187 | <div class="total-item"> | 179 | <div class="total-item"> |
| @@ -189,7 +181,7 @@ | @@ -189,7 +181,7 @@ | ||
| 189 | 不含税金额 | 181 | 不含税金额 |
| 190 | </div> | 182 | </div> |
| 191 | <div class="total-item-price text-red"> | 183 | <div class="total-item-price text-red"> |
| 192 | - ¥{{ (sumAmountExcl || 0).toFixed(2) }} | 184 | + ¥{{ (totalAmountExcludingTax || 0).toFixed(2) }} |
| 193 | </div> | 185 | </div> |
| 194 | </div> | 186 | </div> |
| 195 | <div class="total-item"> | 187 | <div class="total-item"> |
| @@ -197,7 +189,7 @@ | @@ -197,7 +189,7 @@ | ||
| 197 | 总金额 | 189 | 总金额 |
| 198 | </div> | 190 | </div> |
| 199 | <div class="total-item-price text-red"> | 191 | <div class="total-item-price text-red"> |
| 200 | - ¥{{ (sumTotal || 0).toFixed(2) }} | 192 | + ¥{{ (totalAmountIncludingTax || 0).toFixed(2) }} |
| 201 | </div> | 193 | </div> |
| 202 | </div> | 194 | </div> |
| 203 | </div> | 195 | </div> |
| @@ -233,6 +225,7 @@ export default { | @@ -233,6 +225,7 @@ export default { | ||
| 233 | buyer: '', | 225 | buyer: '', |
| 234 | buyerName: '', | 226 | buyerName: '', |
| 235 | orderDate: '', | 227 | orderDate: '', |
| 228 | + deliveryDate: '', | ||
| 236 | designatedConsignee: '', | 229 | designatedConsignee: '', |
| 237 | specialTerms: '', | 230 | specialTerms: '', |
| 238 | specialTermsName: '', | 231 | specialTermsName: '', |
| @@ -263,9 +256,9 @@ export default { | @@ -263,9 +256,9 @@ export default { | ||
| 263 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], | 256 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], |
| 264 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, | 257 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, |
| 265 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, | 258 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, |
| 266 | - sumQuantity: 0, | ||
| 267 | - sumAmountExcl: 0, | ||
| 268 | - sumTotal: 0, | 259 | + totalQuantity: 0, |
| 260 | + totalAmountExcludingTax: 0, | ||
| 261 | + totalAmountIncludingTax: 0, | ||
| 269 | productLineList: [], | 262 | productLineList: [], |
| 270 | productList: [], | 263 | productList: [], |
| 271 | customerRemarks: [], | 264 | customerRemarks: [], |
| @@ -367,9 +360,9 @@ export default { | @@ -367,9 +360,9 @@ export default { | ||
| 367 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) | 360 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) |
| 368 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) | 361 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) |
| 369 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) | 362 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) |
| 370 | - this.sumQuantity = sumQ | ||
| 371 | - this.sumAmountExcl = sumE | ||
| 372 | - this.sumTotal = sumT | 363 | + this.totalQuantity = sumQ |
| 364 | + this.totalAmountExcludingTax = sumE | ||
| 365 | + this.totalAmountIncludingTax = sumT | ||
| 373 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) | 366 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) |
| 374 | this.productLineList = list | 367 | this.productLineList = list |
| 375 | }, | 368 | }, |
| @@ -445,6 +438,10 @@ export default { | @@ -445,6 +438,10 @@ export default { | ||
| 445 | setSheet('生产厂', opts) | 438 | setSheet('生产厂', opts) |
| 446 | } else if (field === 'supplier') { | 439 | } else if (field === 'supplier') { |
| 447 | setSheet('供方', this.supplierList) | 440 | setSheet('供方', this.supplierList) |
| 441 | + } else if (field === 'specialTerms') { | ||
| 442 | + setSheet('特别条款要求', this.specialTermsList) | ||
| 443 | + } else if (field === 'executionStandard') { | ||
| 444 | + setSheet('执行标准', this.executionStandardList) | ||
| 448 | } else if (field === 'includesPackagingFee') { | 445 | } else if (field === 'includesPackagingFee') { |
| 449 | setSheet('单价中是否已包含包装费', this.yesNoList) | 446 | setSheet('单价中是否已包含包装费', this.yesNoList) |
| 450 | } else if (field === 'includesTransportFee') { | 447 | } else if (field === 'includesTransportFee') { |
| @@ -515,9 +512,9 @@ export default { | @@ -515,9 +512,9 @@ export default { | ||
| 515 | ...formForSubmit, | 512 | ...formForSubmit, |
| 516 | destination, | 513 | destination, |
| 517 | type: 'INTL_STD_CONTRACT', | 514 | type: 'INTL_STD_CONTRACT', |
| 518 | - sumQuantity: this.sumQuantity, | ||
| 519 | - sumAmountExcl: this.sumAmountExcl, | ||
| 520 | - sumTotal: this.sumTotal, | 515 | + totalQuantity: this.totalQuantity, |
| 516 | + totalAmountExcludingTax: this.totalAmountExcludingTax, | ||
| 517 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | ||
| 521 | contractDistributorLineList: lines | 518 | contractDistributorLineList: lines |
| 522 | }) | 519 | }) |
| 523 | console.log('onSubmit__payload', payload) | 520 | console.log('onSubmit__payload', payload) |
| @@ -536,18 +533,31 @@ export default { | @@ -536,18 +533,31 @@ export default { | ||
| 536 | { key: 'supplier', label: '供方' }, | 533 | { key: 'supplier', label: '供方' }, |
| 537 | { key: 'buyer', label: '需方' }, | 534 | { key: 'buyer', label: '需方' }, |
| 538 | { key: 'orderDate', label: '订货日期' }, | 535 | { key: 'orderDate', label: '订货日期' }, |
| 536 | + { key: 'unit', label: '单位' }, | ||
| 539 | { key: 'workshopId', label: '生产厂' }, | 537 | { key: 'workshopId', label: '生产厂' }, |
| 538 | + { key: 'specialTerms', label: '特别条款要求' }, | ||
| 540 | ] | 539 | ] |
| 541 | for (const it of checks) { | 540 | for (const it of checks) { |
| 542 | const val = this.form[it.key] | 541 | const val = this.form[it.key] |
| 543 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) | 542 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) |
| 544 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } | 543 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } |
| 545 | } | 544 | } |
| 546 | - if (!Array.isArray(this.productLineList) || this.productLineList.length === 0) { | 545 | + const list = Array.isArray(this.productLineList) ? this.productLineList : [] |
| 546 | + if (list.length === 0) { | ||
| 547 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false | 547 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false |
| 548 | } | 548 | } |
| 549 | - for (const [idx, it] of this.productLineList.entries()) { | ||
| 550 | - if (!it.productName || !it.quantity || !it.unitPrice) { | 549 | + const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === '')) |
| 550 | + const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v))) | ||
| 551 | + for (const [idx, it] of list.entries()) { | ||
| 552 | + if ( | ||
| 553 | + strEmpty(it.productName) || | ||
| 554 | + strEmpty(it.industry) || | ||
| 555 | + strEmpty(it.quality) || | ||
| 556 | + strEmpty(it.brand) || | ||
| 557 | + numEmpty(it.quantity) || | ||
| 558 | + numEmpty(it.unitPrice) || | ||
| 559 | + strEmpty(it.deliveryDate) | ||
| 560 | + ) { | ||
| 551 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false | 561 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false |
| 552 | } | 562 | } |
| 553 | } | 563 | } |
| @@ -575,7 +585,7 @@ export default { | @@ -575,7 +585,7 @@ export default { | ||
| 575 | color: rgba(0, 0, 0, 0.6); | 585 | color: rgba(0, 0, 0, 0.6); |
| 576 | line-height: 32rpx; | 586 | line-height: 32rpx; |
| 577 | width: 240rpx; | 587 | width: 240rpx; |
| 578 | - padding: 24rpx 0; | 588 | + padding: 12rpx 0; |
| 579 | } | 589 | } |
| 580 | .total-item-price { | 590 | .total-item-price { |
| 581 | font-weight: 600; | 591 | font-weight: 600; |
| @@ -597,7 +607,7 @@ export default { | @@ -597,7 +607,7 @@ export default { | ||
| 597 | 607 | ||
| 598 | .scroll { | 608 | .scroll { |
| 599 | flex: 1; | 609 | flex: 1; |
| 600 | - padding: 12rpx 0 480rpx !important; | 610 | + padding: 12rpx 0 392rpx !important; |
| 601 | } | 611 | } |
| 602 | 612 | ||
| 603 | .footer { | 613 | .footer { |
| @@ -40,9 +40,7 @@ | @@ -40,9 +40,7 @@ | ||
| 40 | <uni-easyinput v-model="form.unit" :inputBorder="false" disabled /> | 40 | <uni-easyinput v-model="form.unit" :inputBorder="false" disabled /> |
| 41 | </template> | 41 | </template> |
| 42 | </uni-list-item> | 42 | </uni-list-item> |
| 43 | - | ||
| 44 | - <ProductRel mode="add" :orderDateBase="form.orderDate" :list="productLineList" @change="onProductsChange" :options="productList" /> | ||
| 45 | - | 43 | + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" /> |
| 46 | <uni-list-item title="合计人民币金额(大写)"> | 44 | <uni-list-item title="合计人民币金额(大写)"> |
| 47 | <template v-slot:footer> | 45 | <template v-slot:footer> |
| 48 | <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" | 46 | <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" |
| @@ -98,34 +96,25 @@ | @@ -98,34 +96,25 @@ | ||
| 98 | :inputBorder="false" /> | 96 | :inputBorder="false" /> |
| 99 | </template> | 97 | </template> |
| 100 | </uni-list-item> | 98 | </uni-list-item> |
| 101 | - | ||
| 102 | - <view class="group"> | ||
| 103 | - <view class="group-title">特别条款要求</view> | ||
| 104 | - <view class="radio-list"> | ||
| 105 | - <view v-for="(opt, i) in specialTermsList" :key="'cr-' + i" class="radio-item" | ||
| 106 | - @click="onRadioSelect('specialTerms', 'specialTermsName', opt)"> | ||
| 107 | - <view :class="['radio', { checked: form.specialTerms === opt.value }]" /> | ||
| 108 | - <text class="label">{{ opt.label }}</text> | ||
| 109 | - </view> | ||
| 110 | - </view> | ||
| 111 | - </view> | ||
| 112 | - <view class="group"> | ||
| 113 | - <view class="group-title">执行标准</view> | ||
| 114 | - <view class="radio-list"> | ||
| 115 | - <view v-for="(opt, i) in executionStandardList" :key="'es-' + i" class="radio-item" | ||
| 116 | - @click="onRadioSelect('executionStandard', 'executionStandardName', opt)"> | ||
| 117 | - <view :class="['radio', { checked: form.executionStandard === opt.value }]" /> | ||
| 118 | - <text class="label">{{ opt.label }}</text> | ||
| 119 | - </view> | ||
| 120 | - </view> | ||
| 121 | - </view> | 99 | + <uni-list-item class="select-item" :class="form.specialTermsName ? 'is-filled' : 'is-empty'" clickable |
| 100 | + @click="openSheet('specialTerms')" :rightText="form.specialTermsName || '请选择'" showArrow> | ||
| 101 | + <template v-slot:body> | ||
| 102 | + <view class="item-title"><text class="required">*</text><text>特别条款要求</text></view> | ||
| 103 | + </template> | ||
| 104 | + </uni-list-item> | ||
| 105 | + <uni-list-item class="select-item" :class="form.executionStandardName ? 'is-filled' : 'is-empty'" clickable | ||
| 106 | + @click="openSheet('executionStandard')" :rightText="form.executionStandardName || '请选择'" showArrow> | ||
| 107 | + <template v-slot:body> | ||
| 108 | + <view class="item-title"><text>执行标准</text></view> | ||
| 109 | + </template> | ||
| 110 | + </uni-list-item> | ||
| 122 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> | 111 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> |
| 123 | <template v-slot:footer> | 112 | <template v-slot:footer> |
| 124 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" | 113 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" |
| 125 | :inputBorder="false" /> | 114 | :inputBorder="false" /> |
| 126 | </template> | 115 | </template> |
| 127 | </uni-list-item> | 116 | </uni-list-item> |
| 128 | - <uni-list-item title="特别说明"> | 117 | + <uni-list-item title="特别说明" style="margin-top: 20rpx;"> |
| 129 | <template v-slot:footer> | 118 | <template v-slot:footer> |
| 130 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> | 119 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> |
| 131 | </template> | 120 | </template> |
| @@ -177,15 +166,15 @@ | @@ -177,15 +166,15 @@ | ||
| 177 | <div class="total-text">合计</div> | 166 | <div class="total-text">合计</div> |
| 178 | <div class="total-item"> | 167 | <div class="total-item"> |
| 179 | <div class="total-item-text">数量</div> | 168 | <div class="total-item-text">数量</div> |
| 180 | - <div class="total-item-price">{{ (sumQuantity || 0).toFixed(2) }}t</div> | 169 | + <div class="total-item-price">{{ (totalQuantity || 0).toFixed(2) }}kg</div> |
| 181 | </div> | 170 | </div> |
| 182 | <div class="total-item"> | 171 | <div class="total-item"> |
| 183 | <div class="total-item-text">不含税金额</div> | 172 | <div class="total-item-text">不含税金额</div> |
| 184 | - <div class="total-item-price text-red">¥{{ (sumAmountExcl || 0).toFixed(2) }}</div> | 173 | + <div class="total-item-price text-red">¥{{ (totalAmountExcludingTax || 0).toFixed(2) }}</div> |
| 185 | </div> | 174 | </div> |
| 186 | <div class="total-item"> | 175 | <div class="total-item"> |
| 187 | <div class="total-item-text">总金额</div> | 176 | <div class="total-item-text">总金额</div> |
| 188 | - <div class="total-item-price text-red">¥{{ (sumTotal || 0).toFixed(2) }}</div> | 177 | + <div class="total-item-price text-red">¥{{ (totalAmountIncludingTax || 0).toFixed(2) }}</div> |
| 189 | </div> | 178 | </div> |
| 190 | </div> | 179 | </div> |
| 191 | <button class="btn submit" type="primary" @click="onSubmit">保存</button> | 180 | <button class="btn submit" type="primary" @click="onSubmit">保存</button> |
| @@ -223,6 +212,7 @@ export default { | @@ -223,6 +212,7 @@ export default { | ||
| 223 | workshopId: '', | 212 | workshopId: '', |
| 224 | workshopName: '', | 213 | workshopName: '', |
| 225 | orderDate: '', | 214 | orderDate: '', |
| 215 | + deliveryDate: '', | ||
| 226 | designatedConsignee: '', | 216 | designatedConsignee: '', |
| 227 | specialTerms: '', | 217 | specialTerms: '', |
| 228 | specialTermsName: '', | 218 | specialTermsName: '', |
| @@ -256,9 +246,9 @@ export default { | @@ -256,9 +246,9 @@ export default { | ||
| 256 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], | 246 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], |
| 257 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, | 247 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, |
| 258 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, | 248 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, |
| 259 | - sumQuantity: 0, | ||
| 260 | - sumAmountExcl: 0, | ||
| 261 | - sumTotal: 0, | 249 | + totalQuantity: 0, |
| 250 | + totalAmountExcludingTax: 0, | ||
| 251 | + totalAmountIncludingTax: 0, | ||
| 262 | productLineList: [], | 252 | productLineList: [], |
| 263 | newProductLineList: [], | 253 | newProductLineList: [], |
| 264 | productList: [] | 254 | productList: [] |
| @@ -349,9 +339,9 @@ export default { | @@ -349,9 +339,9 @@ export default { | ||
| 349 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) | 339 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) |
| 350 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) | 340 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) |
| 351 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) | 341 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) |
| 352 | - this.sumQuantity = sumQ | ||
| 353 | - this.sumAmountExcl = sumE | ||
| 354 | - this.sumTotal = sumT | 342 | + this.totalQuantity = sumQ |
| 343 | + this.totalAmountExcludingTax = sumE | ||
| 344 | + this.totalAmountIncludingTax = sumT | ||
| 355 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) | 345 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) |
| 356 | }, | 346 | }, |
| 357 | async loadSuppliers() { | 347 | async loadSuppliers() { |
| @@ -399,6 +389,10 @@ export default { | @@ -399,6 +389,10 @@ export default { | ||
| 399 | setSheet('生产厂', opts) | 389 | setSheet('生产厂', opts) |
| 400 | } else if (field === 'supplier') { | 390 | } else if (field === 'supplier') { |
| 401 | setSheet('供方', this.supplierList) | 391 | setSheet('供方', this.supplierList) |
| 392 | + } else if (field === 'specialTerms') { | ||
| 393 | + setSheet('特别条款要求', this.specialTermsList) | ||
| 394 | + } else if (field === 'executionStandard') { | ||
| 395 | + setSheet('执行标准', this.executionStandardList) | ||
| 402 | } else if (field === 'includesPackagingFee') { | 396 | } else if (field === 'includesPackagingFee') { |
| 403 | setSheet('单价中是否已包含包装费', this.yesNoList) | 397 | setSheet('单价中是否已包含包装费', this.yesNoList) |
| 404 | } else if (field === 'includesTransportFee') { | 398 | } else if (field === 'includesTransportFee') { |
| @@ -443,18 +437,32 @@ export default { | @@ -443,18 +437,32 @@ export default { | ||
| 443 | { key: 'supplier', label: '供方' }, | 437 | { key: 'supplier', label: '供方' }, |
| 444 | { key: 'buyer', label: '需方' }, | 438 | { key: 'buyer', label: '需方' }, |
| 445 | { key: 'orderDate', label: '订货日期' }, | 439 | { key: 'orderDate', label: '订货日期' }, |
| 440 | + { key: 'unit', label: '单位' }, | ||
| 446 | { key: 'workshopId', label: '生产厂' }, | 441 | { key: 'workshopId', label: '生产厂' }, |
| 442 | + { key: 'specialTerms', label: '特别条款要求' }, | ||
| 447 | ] | 443 | ] |
| 448 | for (const it of checks) { | 444 | for (const it of checks) { |
| 449 | const val = this.form[it.key] | 445 | const val = this.form[it.key] |
| 450 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) | 446 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) |
| 451 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } | 447 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } |
| 452 | } | 448 | } |
| 453 | - if (!Array.isArray(this.productLineList) || this.productLineList.length === 0) { | 449 | + const list = Array.isArray(this.newProductLineList) ? this.newProductLineList : [] |
| 450 | + if (list.length === 0) { | ||
| 454 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false | 451 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false |
| 455 | } | 452 | } |
| 456 | - for (const [idx, it] of this.productLineList.entries()) { | ||
| 457 | - if (!it.productName || !it.quantity || !it.unitPrice) { | 453 | + const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === '')) |
| 454 | + const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v))) | ||
| 455 | + for (const [idx, it] of list.entries()) { | ||
| 456 | + console.log('it111', it) | ||
| 457 | + if ( | ||
| 458 | + strEmpty(it.productName) || | ||
| 459 | + strEmpty(it.industry) || | ||
| 460 | + strEmpty(it.quality) || | ||
| 461 | + strEmpty(it.brand) || | ||
| 462 | + numEmpty(it.quantity) || | ||
| 463 | + numEmpty(it.unitPrice) || | ||
| 464 | + strEmpty(it.deliveryDate) | ||
| 465 | + ) { | ||
| 458 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false | 466 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false |
| 459 | } | 467 | } |
| 460 | } | 468 | } |
| @@ -479,25 +487,25 @@ export default { | @@ -479,25 +487,25 @@ export default { | ||
| 479 | return out | 487 | return out |
| 480 | } | 488 | } |
| 481 | const lines = (this.newProductLineList || []).map(it => clean(it)) | 489 | const lines = (this.newProductLineList || []).map(it => clean(it)) |
| 482 | - const { destinationLabel, destinationId, ...formForSubmit } = this.form; | ||
| 483 | - const destination = destinationId && destinationId.length > 0 ? destinationId[destinationId.length - 1] : ''; | ||
| 484 | - const payload = clean({ | ||
| 485 | - ...formForSubmit, | ||
| 486 | - id: this.form.id, | ||
| 487 | - destination, | ||
| 488 | - type: 'INTL_STD_CONTRACT', | ||
| 489 | - sumQuantity: this.sumQuantity, | ||
| 490 | - sumAmountExcl: this.sumAmountExcl, | ||
| 491 | - sumTotal: this.sumTotal, | ||
| 492 | - contractDistributorLineList: lines | ||
| 493 | - }) | ||
| 494 | - try { | ||
| 495 | - await updateContractApi(payload) | ||
| 496 | - uni.showToast({ title: '保存成功', icon: 'none' }) | ||
| 497 | - setTimeout(() => { uni.redirectTo({ url: '/pages/contract_foreign_std/index' }) }, 400) | ||
| 498 | - } catch (e) { | ||
| 499 | - uni.showToast({ title: '提交失败', icon: 'none' }) | ||
| 500 | - } | 490 | + const { destinationLabel, destinationId, ...formForSubmit } = this.form; |
| 491 | + const destination = destinationId && destinationId.length > 0 ? destinationId[destinationId.length - 1] : ''; | ||
| 492 | + const payload = clean({ | ||
| 493 | + ...formForSubmit, | ||
| 494 | + id: this.form.id, | ||
| 495 | + destination, | ||
| 496 | + type: 'INTL_STD_CONTRACT', | ||
| 497 | + totalQuantity: this.totalQuantity, | ||
| 498 | + totalAmountExcludingTax: this.totalAmountExcludingTax, | ||
| 499 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | ||
| 500 | + contractDistributorLineList: lines | ||
| 501 | + }) | ||
| 502 | + try { | ||
| 503 | + await updateContractApi(payload) | ||
| 504 | + uni.showToast({ title: '保存成功', icon: 'none' }) | ||
| 505 | + setTimeout(() => { uni.redirectTo({ url: '/pages/contract_foreign_std/index' }) }, 400) | ||
| 506 | + } catch (e) { | ||
| 507 | + uni.showToast({ title: '提交失败', icon: 'none' }) | ||
| 508 | + } | ||
| 501 | } | 509 | } |
| 502 | } | 510 | } |
| 503 | } | 511 | } |
| @@ -524,7 +532,7 @@ export default { | @@ -524,7 +532,7 @@ export default { | ||
| 524 | color: rgba(0, 0, 0, 0.6); | 532 | color: rgba(0, 0, 0, 0.6); |
| 525 | line-height: 32rpx; | 533 | line-height: 32rpx; |
| 526 | width: 240rpx; | 534 | width: 240rpx; |
| 527 | - padding: 24rpx 0; | 535 | + padding: 12rpx 0; |
| 528 | } | 536 | } |
| 529 | 537 | ||
| 530 | .total-item-price { | 538 | .total-item-price { |
| @@ -547,7 +555,7 @@ export default { | @@ -547,7 +555,7 @@ export default { | ||
| 547 | 555 | ||
| 548 | .scroll { | 556 | .scroll { |
| 549 | flex: 1; | 557 | flex: 1; |
| 550 | - padding: 12rpx 0 480rpx !important; | 558 | + padding: 12rpx 0 392rpx !important; |
| 551 | } | 559 | } |
| 552 | 560 | ||
| 553 | .footer { | 561 | .footer { |
| @@ -55,51 +55,51 @@ | @@ -55,51 +55,51 @@ | ||
| 55 | </uni-list-item> | 55 | </uni-list-item> |
| 56 | <uni-list-item title="厚度"> | 56 | <uni-list-item title="厚度"> |
| 57 | <template v-slot:footer> | 57 | <template v-slot:footer> |
| 58 | - <uni-easyinput v-model="item.thickness" :inputBorder="false" placeholder="请输入厚度" /> | 58 | + <uni-easyinput type="digit" v-model="item.thickness" :inputBorder="false" placeholder="请输入厚度" @input="onNonNegativeInput(idx, 'thickness')" @blur="onNonNegativeBlur(idx, 'thickness', 2)" /> |
| 59 | </template> | 59 | </template> |
| 60 | </uni-list-item> | 60 | </uni-list-item> |
| 61 | <uni-list-item title="厚度公差(单项+)"> | 61 | <uni-list-item title="厚度公差(单项+)"> |
| 62 | <template v-slot:footer> | 62 | <template v-slot:footer> |
| 63 | - <uni-easyinput v-model="item.thicknessTolPos" :inputBorder="false" | ||
| 64 | - placeholder="请输入厚度公差(单项+)" /> | 63 | + <uni-easyinput type="digit" v-model="item.thicknessTolPos" :inputBorder="false" |
| 64 | + placeholder="请输入厚度公差(单项+)" @input="onNonNegativeInput(idx, 'thicknessTolPos')" @blur="onNonNegativeBlur(idx, 'thicknessTolPos', 2)" /> | ||
| 65 | </template> | 65 | </template> |
| 66 | </uni-list-item> | 66 | </uni-list-item> |
| 67 | <uni-list-item title="厚度公差(单项-)"> | 67 | <uni-list-item title="厚度公差(单项-)"> |
| 68 | <template v-slot:footer> | 68 | <template v-slot:footer> |
| 69 | - <uni-easyinput v-model="item.thicknessTolNeg" :inputBorder="false" | ||
| 70 | - placeholder="请输入厚度公差(单项-)" /> | 69 | + <uni-easyinput type="digit" v-model="item.thicknessTolNeg" :inputBorder="false" |
| 70 | + placeholder="请输入厚度公差(单项-)" @input="onNonNegativeInput(idx, 'thicknessTolNeg')" @blur="onNonNegativeBlur(idx, 'thicknessTolNeg', 2)" /> | ||
| 71 | </template> | 71 | </template> |
| 72 | </uni-list-item> | 72 | </uni-list-item> |
| 73 | <uni-list-item title="宽度"> | 73 | <uni-list-item title="宽度"> |
| 74 | <template v-slot:footer> | 74 | <template v-slot:footer> |
| 75 | - <uni-easyinput v-model="item.width" :inputBorder="false" placeholder="请输入宽度" /> | 75 | + <uni-easyinput type="digit" v-model="item.width" :inputBorder="false" placeholder="请输入宽度" @input="onNonNegativeInput(idx, 'width')" @blur="onNonNegativeBlur(idx, 'width', 2)" /> |
| 76 | </template> | 76 | </template> |
| 77 | </uni-list-item> | 77 | </uni-list-item> |
| 78 | <uni-list-item title="宽度公差(单项+)"> | 78 | <uni-list-item title="宽度公差(单项+)"> |
| 79 | <template v-slot:footer> | 79 | <template v-slot:footer> |
| 80 | - <uni-easyinput v-model="item.widthTolPos" :inputBorder="false" placeholder="请输入宽度公差(单项+)" /> | 80 | + <uni-easyinput type="digit" v-model="item.widthTolPos" :inputBorder="false" placeholder="请输入宽度公差(单项+)" @input="onNonNegativeInput(idx, 'widthTolPos')" @blur="onNonNegativeBlur(idx, 'widthTolPos', 2)" /> |
| 81 | </template> | 81 | </template> |
| 82 | </uni-list-item> | 82 | </uni-list-item> |
| 83 | <uni-list-item title="宽度公差(单项-)"> | 83 | <uni-list-item title="宽度公差(单项-)"> |
| 84 | <template v-slot:footer> | 84 | <template v-slot:footer> |
| 85 | - <uni-easyinput v-model="item.widthTolNeg" :inputBorder="false" placeholder="请输入宽度公差(单项-)" /> | 85 | + <uni-easyinput type="digit" v-model="item.widthTolNeg" :inputBorder="false" placeholder="请输入宽度公差(单项-)" @input="onNonNegativeInput(idx, 'widthTolNeg')" @blur="onNonNegativeBlur(idx, 'widthTolNeg', 2)" /> |
| 86 | </template> | 86 | </template> |
| 87 | </uni-list-item> | 87 | </uni-list-item> |
| 88 | <uni-list-item title="长度"> | 88 | <uni-list-item title="长度"> |
| 89 | <template v-slot:footer> | 89 | <template v-slot:footer> |
| 90 | - <uni-easyinput v-model="item.length" :inputBorder="false" placeholder="请输入长度" /> | 90 | + <uni-easyinput type="digit" v-model="item.length" :inputBorder="false" placeholder="请输入长度" @input="onNonNegativeInput(idx, 'length')" @blur="onNonNegativeBlur(idx, 'length', 2)" /> |
| 91 | </template> | 91 | </template> |
| 92 | </uni-list-item> | 92 | </uni-list-item> |
| 93 | <uni-list-item title="长度公差(单项+)"> | 93 | <uni-list-item title="长度公差(单项+)"> |
| 94 | <template v-slot:footer> | 94 | <template v-slot:footer> |
| 95 | - <uni-easyinput v-model="item.lengthTolPos" :inputBorder="false" | ||
| 96 | - placeholder="请输入长度公差(单项+)" /> | 95 | + <uni-easyinput type="digit" v-model="item.lengthTolPos" :inputBorder="false" |
| 96 | + placeholder="请输入长度公差(单项+)" @input="onNonNegativeInput(idx, 'lengthTolPos')" @blur="onNonNegativeBlur(idx, 'lengthTolPos', 2)" /> | ||
| 97 | </template> | 97 | </template> |
| 98 | </uni-list-item> | 98 | </uni-list-item> |
| 99 | <uni-list-item title="长度公差(单项-)"> | 99 | <uni-list-item title="长度公差(单项-)"> |
| 100 | <template v-slot:footer> | 100 | <template v-slot:footer> |
| 101 | - <uni-easyinput v-model="item.lengthTolNeg" :inputBorder="false" | ||
| 102 | - placeholder="请输入长度公差(单项-)" /> | 101 | + <uni-easyinput type="digit" v-model="item.lengthTolNeg" :inputBorder="false" |
| 102 | + placeholder="请输入长度公差(单项-)" @input="onNonNegativeInput(idx, 'lengthTolNeg')" @blur="onNonNegativeBlur(idx, 'lengthTolNeg', 2)" /> | ||
| 103 | </template> | 103 | </template> |
| 104 | </uni-list-item> | 104 | </uni-list-item> |
| 105 | <uni-list-item title="状态"> | 105 | <uni-list-item title="状态"> |
| @@ -109,12 +109,12 @@ | @@ -109,12 +109,12 @@ | ||
| 109 | </uni-list-item> | 109 | </uni-list-item> |
| 110 | <uni-list-item title="数量"> | 110 | <uni-list-item title="数量"> |
| 111 | <template v-slot:footer> | 111 | <template v-slot:footer> |
| 112 | - <uni-easyinput v-model="item.quantity" type="number" :inputBorder="false" placeholder="请输入数量" @input="onImmediateChange(idx)" @blur="onNumberBlur(idx, 'quantity', 0)" /> | 112 | + <uni-easyinput v-model="item.quantity" type="digit" :inputBorder="false" placeholder="请输入数量kg" @input="onNonNegativeInput(idx, 'quantity')" @blur="onNonNegativeBlur(idx, 'quantity', 2)" /> |
| 113 | </template> | 113 | </template> |
| 114 | </uni-list-item> | 114 | </uni-list-item> |
| 115 | <uni-list-item title="单价"> | 115 | <uni-list-item title="单价"> |
| 116 | <template v-slot:footer> | 116 | <template v-slot:footer> |
| 117 | - <uni-easyinput v-model="item.unitPrice" disabled type="number" :inputBorder="false" placeholder="请输入单价" @input="onImmediateChange(idx)" @blur="onNumberBlur(idx, 'unitPrice', 0)" /> | 117 | + <uni-easyinput v-model="item.unitPrice" type="digit" :inputBorder="false" placeholder="请输入销售价格" @input="onNonNegativeInput(idx, 'unitPrice')" @blur="onNonNegativeBlur(idx, 'unitPrice', 2)" /> |
| 118 | </template> | 118 | </template> |
| 119 | </uni-list-item> | 119 | </uni-list-item> |
| 120 | <uni-list-item title="外贸加工费"> | 120 | <uni-list-item title="外贸加工费"> |
| @@ -134,7 +134,7 @@ | @@ -134,7 +134,7 @@ | ||
| 134 | </uni-list-item> | 134 | </uni-list-item> |
| 135 | <uni-list-item title="发货日期"> | 135 | <uni-list-item title="发货日期"> |
| 136 | <template v-slot:footer> | 136 | <template v-slot:footer> |
| 137 | - <uni-datetime-picker type="date" v-model="item.orderDate" @change="onDateChange(idx, $event)" /> | 137 | + <uni-datetime-picker type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" /> |
| 138 | </template> | 138 | </template> |
| 139 | </uni-list-item> | 139 | </uni-list-item> |
| 140 | </uni-list> | 140 | </uni-list> |
| @@ -156,7 +156,30 @@ | @@ -156,7 +156,30 @@ | ||
| 156 | <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view> | 156 | <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view> |
| 157 | <view class="row"><text class="label">牌号</text><text class="value">{{ item.brand }}</text></view> | 157 | <view class="row"><text class="label">牌号</text><text class="value">{{ item.brand }}</text></view> |
| 158 | <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view> | 158 | <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view> |
| 159 | - <view class="row"><text class="label">规格</text><text class="value">{{ item.specDisplay }}</text></view> | 159 | + <!-- 厚(公差) * 宽(公差) * 长(公差) --> |
| 160 | + <view class="row row-spec"><text class="label">规格(mm)</text> | ||
| 161 | + <view class="value value-spec"> | ||
| 162 | + <view v-if="item.thickness" class="value-spec_val">{{ item.thickness }}</view> | ||
| 163 | + <view v-if="item.thickness" class="value-spec_box"> | ||
| 164 | + <view v-if="item.thicknessTolPos" class="value-spec_box_1">+{{ item.thicknessTolPos }} | ||
| 165 | + </view> | ||
| 166 | + <view v-if="item.thicknessTolNeg" class="value-spec_box_2">-{{ item.thicknessTolNeg }} | ||
| 167 | + </view> | ||
| 168 | + </view> | ||
| 169 | + <view v-if="item.width" class="value-spec_val p12">*</view> | ||
| 170 | + <view v-if="item.width" class="value-spec_val">{{ item.width }}</view> | ||
| 171 | + <view v-if="item.width" class="value-spec_box"> | ||
| 172 | + <view v-if="item.widthTolPos" class="value-spec_box_1">+{{ item.widthTolPos }}</view> | ||
| 173 | + <view v-if="item.widthTolNeg" class="value-spec_box_2">-{{ item.widthTolNeg }}</view> | ||
| 174 | + </view> | ||
| 175 | + <view v-if="item.length" class="value-spec_val p12">*</view> | ||
| 176 | + <view v-if="item.length" class="value-spec_val">{{ item.length }}</view> | ||
| 177 | + <view v-if="item.length" class="value-spec_box"> | ||
| 178 | + <view v-if="item.lengthTolPos" class="value-spec_box_1">+{{ item.lengthTolPos }}</view> | ||
| 179 | + <view v-if="item.lengthTolNeg" class="value-spec_box_2">-{{ item.lengthTolNeg }}</view> | ||
| 180 | + </view> | ||
| 181 | + </view> | ||
| 182 | + </view> | ||
| 160 | <view class="row"><text class="label">状态</text><text class="value">{{ item.status }}</text></view> | 183 | <view class="row"><text class="label">状态</text><text class="value">{{ item.status }}</text></view> |
| 161 | <view class="row"><text class="label">数量</text><text class="value">{{ item.quantity }}</text></view> | 184 | <view class="row"><text class="label">数量</text><text class="value">{{ item.quantity }}</text></view> |
| 162 | <view class="row"><text class="label">单价</text><text class="value">{{ formatCurrency(item.unitPrice) | 185 | <view class="row"><text class="label">单价</text><text class="value">{{ formatCurrency(item.unitPrice) |
| @@ -167,7 +190,7 @@ | @@ -167,7 +190,7 @@ | ||
| 167 | }}</text></view> | 190 | }}</text></view> |
| 168 | <view class="row"><text class="label">总金额</text><text class="value">{{ formatCurrency(item.totalAmount) | 191 | <view class="row"><text class="label">总金额</text><text class="value">{{ formatCurrency(item.totalAmount) |
| 169 | }}</text></view> | 192 | }}</text></view> |
| 170 | - <view class="row"><text class="label">发货日期</text><text class="value">{{ item.orderDate }}</text></view> | 193 | + <view class="row"><text class="label">发货日期</text><text class="value">{{ item.deliveryDate }}</text></view> |
| 171 | </view> | 194 | </view> |
| 172 | </view> | 195 | </view> |
| 173 | <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value" @confirm="onProductConfirm" /> | 196 | <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value" @confirm="onProductConfirm" /> |
| @@ -181,7 +204,7 @@ export default { | @@ -181,7 +204,7 @@ export default { | ||
| 181 | mode: { type: String, default: 'add' }, | 204 | mode: { type: String, default: 'add' }, |
| 182 | list: { type: Array, default: () => [] }, | 205 | list: { type: Array, default: () => [] }, |
| 183 | max: { type: Number, default: 8 }, | 206 | max: { type: Number, default: 8 }, |
| 184 | - orderDateBase: { type: String, default: '' }, | 207 | + deliveryDateBase: { type: String, default: '' }, |
| 185 | options: { type: Array, default: () => [] } | 208 | options: { type: Array, default: () => [] } |
| 186 | }, | 209 | }, |
| 187 | components: { SingleSelectSheet }, | 210 | components: { SingleSelectSheet }, |
| @@ -223,10 +246,18 @@ export default { | @@ -223,10 +246,18 @@ export default { | ||
| 223 | }, | 246 | }, |
| 224 | methods: { | 247 | methods: { |
| 225 | defaultItem() { | 248 | defaultItem() { |
| 226 | - return { productId: '', productName: '', industry: '', brand: '', quality: '', thickness: '', thicknessTolPos: '', thicknessTolNeg: '', width: '', widthTolPos: '', widthTolNeg: '', length: '', lengthTolPos: '', lengthTolNeg: '', status: '', quantity: '', unitPrice: '', processingFee: undefined, amountExcludingTax: 0, totalAmount: 0, orderDate: '' } | 249 | + return { productId: '', productName: '', industry: '', brand: '', quality: '', thickness: '', thicknessTolPos: '', thicknessTolNeg: '', width: '', widthTolPos: '', widthTolNeg: '', length: '', lengthTolPos: '', lengthTolNeg: '',processingFee: undefined, status: '', quantity: '', unitPrice: '', amountExcludingTax: 0, totalAmount: 0, deliveryDate: '' } |
| 227 | }, | 250 | }, |
| 228 | - onImmediateChange(idx) { | ||
| 229 | - this.$nextTick(() => this.recalculate(idx)) | 251 | + onNonNegativeInput(idx, field) { |
| 252 | + const it = this.items[idx] | ||
| 253 | + if (!it) return | ||
| 254 | + let v = String(it[field] != null ? it[field] : '') | ||
| 255 | + v = v.replace(/[^0-9.]/g, '') | ||
| 256 | + v = v.replace(/(\..*)\./g, '$1') | ||
| 257 | + if (v.startsWith('.')) v = '0' + v | ||
| 258 | + it[field] = v | ||
| 259 | + this.$set(this.items, idx, it) | ||
| 260 | + if (field === 'quantity' || field === 'unitPrice') this.$nextTick(() => this.recalculate(idx)) | ||
| 230 | }, | 261 | }, |
| 231 | toNumber(val) { | 262 | toNumber(val) { |
| 232 | if (typeof val === 'number') return isNaN(val) ? 0 : val | 263 | if (typeof val === 'number') return isNaN(val) ? 0 : val |
| @@ -239,21 +270,21 @@ export default { | @@ -239,21 +270,21 @@ export default { | ||
| 239 | const m = Math.pow(10, digits) | 270 | const m = Math.pow(10, digits) |
| 240 | return Math.round(n * m) / m | 271 | return Math.round(n * m) / m |
| 241 | }, | 272 | }, |
| 242 | - onNumberBlur(idx, field, digits) { | 273 | + onNonNegativeBlur(idx, field, digits) { |
| 243 | const it = this.items[idx] | 274 | const it = this.items[idx] |
| 244 | if (!it) return | 275 | if (!it) return |
| 245 | const raw = it[field] | 276 | const raw = it[field] |
| 246 | - // 如果为空则保持为空,不自动置为0,仅重新计算依赖字段 | ||
| 247 | if (raw === '' || raw === null || raw === undefined) { | 277 | if (raw === '' || raw === null || raw === undefined) { |
| 248 | this.$set(this.items, idx, it) | 278 | this.$set(this.items, idx, it) |
| 249 | - this.recalculate(idx) | 279 | + if (field === 'quantity' || field === 'unitPrice') this.recalculate(idx) |
| 250 | return | 280 | return |
| 251 | } | 281 | } |
| 252 | - const num = this.toNumber(raw) | 282 | + let num = this.toNumber(raw) |
| 283 | + if (isNaN(num) || num < 0) num = 0 | ||
| 253 | const rounded = this.round(num, digits) | 284 | const rounded = this.round(num, digits) |
| 254 | it[field] = rounded | 285 | it[field] = rounded |
| 255 | this.$set(this.items, idx, it) | 286 | this.$set(this.items, idx, it) |
| 256 | - this.recalculate(idx) | 287 | + if (field === 'quantity' || field === 'unitPrice') this.recalculate(idx) |
| 257 | }, | 288 | }, |
| 258 | formatCurrency(val) { | 289 | formatCurrency(val) { |
| 259 | if (val == null || val === '') return '' | 290 | if (val == null || val === '') return '' |
| @@ -324,15 +355,15 @@ export default { | @@ -324,15 +355,15 @@ export default { | ||
| 324 | onDateChange(idx, e) { | 355 | onDateChange(idx, e) { |
| 325 | const it = this.items[idx] | 356 | const it = this.items[idx] |
| 326 | if (!it) return | 357 | if (!it) return |
| 327 | - const val = typeof e === 'string' ? e : (e && e.detail && e.detail.value) ? e.detail.value : it.orderDate | 358 | + const val = typeof e === 'string' ? e : (e && e.detail && e.detail.value) ? e.detail.value : it.deliveryDate |
| 328 | const dateStr = String(val).slice(0, 10) | 359 | const dateStr = String(val).slice(0, 10) |
| 329 | - const base = this.orderDateBase ? new Date(this.orderDateBase) : null | 360 | + const base = this.deliveryDateBase ? new Date(this.deliveryDateBase) : null |
| 330 | const d = new Date(dateStr) | 361 | const d = new Date(dateStr) |
| 331 | if (base && !isNaN(d.getTime()) && d.getTime() < base.getTime()) { | 362 | if (base && !isNaN(d.getTime()) && d.getTime() < base.getTime()) { |
| 332 | uni.showToast({ title: '发货日期不得早于订货日期', icon: 'none' }) | 363 | uni.showToast({ title: '发货日期不得早于订货日期', icon: 'none' }) |
| 333 | - it.orderDate = this.orderDateBase | 364 | + it.deliveryDate = this.deliveryDateBase |
| 334 | } else { | 365 | } else { |
| 335 | - it.orderDate = dateStr | 366 | + it.deliveryDate = dateStr |
| 336 | } | 367 | } |
| 337 | this.$set(this.items, idx, it) | 368 | this.$set(this.items, idx, it) |
| 338 | }, | 369 | }, |
| @@ -388,12 +419,13 @@ export default { | @@ -388,12 +419,13 @@ export default { | ||
| 388 | height: 40rpx; | 419 | height: 40rpx; |
| 389 | } | 420 | } |
| 390 | 421 | ||
| 391 | - .opCollapse { | ||
| 392 | - color: rgba(0, 0, 0, 0.6); | ||
| 393 | - width: 32rpx; | ||
| 394 | - height: 28rpx; | ||
| 395 | - margin-right: 16rpx; | ||
| 396 | - } | 422 | +.opCollapse { |
| 423 | + color: rgba(0, 0, 0, 0.6); | ||
| 424 | + width: 32rpx; | ||
| 425 | + height: 28rpx; | ||
| 426 | + margin-right: 16rpx; | ||
| 427 | + margin-top: 8rpx; | ||
| 428 | +} | ||
| 397 | 429 | ||
| 398 | 430 | ||
| 399 | .block { | 431 | .block { |
| @@ -504,8 +536,46 @@ export default { | @@ -504,8 +536,46 @@ export default { | ||
| 504 | 536 | ||
| 505 | .value { | 537 | .value { |
| 506 | flex: 1; | 538 | flex: 1; |
| 507 | - text-align: right; | 539 | + // text-align: right; |
| 508 | color: rgba(0, 0, 0, 0.9); | 540 | color: rgba(0, 0, 0, 0.9); |
| 509 | font-size: 28rpx; | 541 | font-size: 28rpx; |
| 510 | } | 542 | } |
| 543 | + .value-spec { | ||
| 544 | + height: 48rpx; | ||
| 545 | + display: flex; | ||
| 546 | + align-items: center; | ||
| 547 | + color: #000000; | ||
| 548 | + // justify-content: end; | ||
| 549 | + &_box { | ||
| 550 | + position: relative; | ||
| 551 | + width: 60rpx; | ||
| 552 | + height: 48rpx; | ||
| 553 | + | ||
| 554 | + &_1 { | ||
| 555 | + font-size: 16rpx; | ||
| 556 | + position: absolute; | ||
| 557 | + top: -10rpx; | ||
| 558 | + left: 0; | ||
| 559 | + } | ||
| 560 | + | ||
| 561 | + &_2 { | ||
| 562 | + font-size: 16rpx; | ||
| 563 | + position: absolute; | ||
| 564 | + bottom: -10rpx; | ||
| 565 | + left: 0; | ||
| 566 | + } | ||
| 567 | + } | ||
| 568 | + | ||
| 569 | + &_val { | ||
| 570 | + font-size: 28rpx; | ||
| 571 | + | ||
| 572 | + &.p12 { | ||
| 573 | + padding-right: 12rpx; | ||
| 574 | + } | ||
| 575 | + } | ||
| 576 | + } | ||
| 577 | + .row-spec { | ||
| 578 | + height: 60rpx; | ||
| 579 | + align-items: center; | ||
| 580 | + } | ||
| 511 | </style> | 581 | </style> |
| @@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
| 39 | <view class="item-title"><text class="required">*</text><text>生产厂</text></view> | 39 | <view class="item-title"><text class="required">*</text><text>生产厂</text></view> |
| 40 | </template> | 40 | </template> |
| 41 | </uni-list-item> | 41 | </uni-list-item> |
| 42 | - <ProductRel mode="add" :orderDateBase="form.orderDate" @change="onProductsChange" :options="productList" /> | 42 | + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" /> |
| 43 | <uni-list-item title="合计人民币金额(大写)"> | 43 | <uni-list-item title="合计人民币金额(大写)"> |
| 44 | <template v-slot:footer> | 44 | <template v-slot:footer> |
| 45 | <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled /> | 45 | <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled /> |
| @@ -92,33 +92,25 @@ | @@ -92,33 +92,25 @@ | ||
| 92 | :inputBorder="false" /> | 92 | :inputBorder="false" /> |
| 93 | </template> | 93 | </template> |
| 94 | </uni-list-item> | 94 | </uni-list-item> |
| 95 | - <view class="group"> | ||
| 96 | - <view class="group-title">特别条款要求</view> | ||
| 97 | - <view class="radio-list"> | ||
| 98 | - <view v-for="(opt, i) in specialTermsList" :key="'cr-' + i" class="radio-item" | ||
| 99 | - @click="onRadioSelect('specialTerms', 'specialTermsName', opt)"> | ||
| 100 | - <view :class="['radio', { checked: form.specialTerms === opt.value }]" /> | ||
| 101 | - <text class="label">{{ opt.label }}</text> | ||
| 102 | - </view> | ||
| 103 | - </view> | ||
| 104 | - </view> | ||
| 105 | - <view class="group"> | ||
| 106 | - <view class="group-title">执行标准</view> | ||
| 107 | - <view class="radio-list"> | ||
| 108 | - <view v-for="(opt, i) in executionStandardList" :key="'es-' + i" class="radio-item" | ||
| 109 | - @click="onRadioSelect('executionStandard', 'executionStandardName', opt)"> | ||
| 110 | - <view :class="['radio', { checked: form.executionStandard === opt.value }]" /> | ||
| 111 | - <text class="label">{{ opt.label }}</text> | ||
| 112 | - </view> | ||
| 113 | - </view> | ||
| 114 | - </view> | 95 | + <uni-list-item class="select-item" :class="form.specialTermsName ? 'is-filled' : 'is-empty'" clickable |
| 96 | + @click="openSheet('specialTerms')" :rightText="form.specialTermsName || '请选择'" showArrow> | ||
| 97 | + <template v-slot:body> | ||
| 98 | + <view class="item-title"><text class="required">*</text><text>特别条款要求</text></view> | ||
| 99 | + </template> | ||
| 100 | + </uni-list-item> | ||
| 101 | + <uni-list-item class="select-item" :class="form.executionStandardName ? 'is-filled' : 'is-empty'" clickable | ||
| 102 | + @click="openSheet('executionStandard')" :rightText="form.executionStandardName || '请选择'" showArrow> | ||
| 103 | + <template v-slot:body> | ||
| 104 | + <view class="item-title"><text>执行标准</text></view> | ||
| 105 | + </template> | ||
| 106 | + </uni-list-item> | ||
| 115 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> | 107 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> |
| 116 | <template v-slot:footer> | 108 | <template v-slot:footer> |
| 117 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" | 109 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" |
| 118 | :inputBorder="false" /> | 110 | :inputBorder="false" /> |
| 119 | </template> | 111 | </template> |
| 120 | </uni-list-item> | 112 | </uni-list-item> |
| 121 | - <uni-list-item title="特别说明"> | 113 | + <uni-list-item title="特别说明" style="margin-top: 20rpx;"> |
| 122 | <template v-slot:footer> | 114 | <template v-slot:footer> |
| 123 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> | 115 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> |
| 124 | </template> | 116 | </template> |
| @@ -181,7 +173,7 @@ | @@ -181,7 +173,7 @@ | ||
| 181 | 数量 | 173 | 数量 |
| 182 | </div> | 174 | </div> |
| 183 | <div class="total-item-price"> | 175 | <div class="total-item-price"> |
| 184 | - {{ (sumQuantity || 0).toFixed(2) }}t | 176 | + {{ (totalQuantity || 0).toFixed(2) }}kg |
| 185 | </div> | 177 | </div> |
| 186 | </div> | 178 | </div> |
| 187 | <div class="total-item"> | 179 | <div class="total-item"> |
| @@ -189,7 +181,7 @@ | @@ -189,7 +181,7 @@ | ||
| 189 | 不含税金额 | 181 | 不含税金额 |
| 190 | </div> | 182 | </div> |
| 191 | <div class="total-item-price text-red"> | 183 | <div class="total-item-price text-red"> |
| 192 | - ¥{{ (sumAmountExcl || 0).toFixed(2) }} | 184 | + ¥{{ (totalAmountExcludingTax || 0).toFixed(2) }} |
| 193 | </div> | 185 | </div> |
| 194 | </div> | 186 | </div> |
| 195 | <div class="total-item"> | 187 | <div class="total-item"> |
| @@ -197,7 +189,7 @@ | @@ -197,7 +189,7 @@ | ||
| 197 | 总金额 | 189 | 总金额 |
| 198 | </div> | 190 | </div> |
| 199 | <div class="total-item-price text-red"> | 191 | <div class="total-item-price text-red"> |
| 200 | - ¥{{ (sumTotal || 0).toFixed(2) }} | 192 | + ¥{{ (totalAmountIncludingTax || 0).toFixed(2) }} |
| 201 | </div> | 193 | </div> |
| 202 | </div> | 194 | </div> |
| 203 | </div> | 195 | </div> |
| @@ -233,6 +225,7 @@ export default { | @@ -233,6 +225,7 @@ export default { | ||
| 233 | buyer: '', | 225 | buyer: '', |
| 234 | buyerName: '', | 226 | buyerName: '', |
| 235 | orderDate: '', | 227 | orderDate: '', |
| 228 | + deliveryDate: '', | ||
| 236 | designatedConsignee: '', | 229 | designatedConsignee: '', |
| 237 | specialTerms: '', | 230 | specialTerms: '', |
| 238 | specialTermsName: '', | 231 | specialTermsName: '', |
| @@ -263,9 +256,9 @@ export default { | @@ -263,9 +256,9 @@ export default { | ||
| 263 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], | 256 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], |
| 264 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, | 257 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, |
| 265 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, | 258 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, |
| 266 | - sumQuantity: 0, | ||
| 267 | - sumAmountExcl: 0, | ||
| 268 | - sumTotal: 0, | 259 | + totalQuantity: 0, |
| 260 | + totalAmountExcludingTax: 0, | ||
| 261 | + totalAmountIncludingTax: 0, | ||
| 269 | productLineList: [], | 262 | productLineList: [], |
| 270 | productList: [], | 263 | productList: [], |
| 271 | customerRemarks: [], | 264 | customerRemarks: [], |
| @@ -369,9 +362,9 @@ export default { | @@ -369,9 +362,9 @@ export default { | ||
| 369 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) | 362 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) |
| 370 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) | 363 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) |
| 371 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) | 364 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) |
| 372 | - this.sumQuantity = sumQ | ||
| 373 | - this.sumAmountExcl = sumE | ||
| 374 | - this.sumTotal = sumT | 365 | + this.totalQuantity = sumQ |
| 366 | + this.totalAmountExcludingTax = sumE | ||
| 367 | + this.totalAmountIncludingTax = sumT | ||
| 375 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) | 368 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) |
| 376 | this.productLineList = list | 369 | this.productLineList = list |
| 377 | }, | 370 | }, |
| @@ -447,6 +440,10 @@ export default { | @@ -447,6 +440,10 @@ export default { | ||
| 447 | setSheet('生产厂', opts) | 440 | setSheet('生产厂', opts) |
| 448 | } else if (field === 'supplier') { | 441 | } else if (field === 'supplier') { |
| 449 | setSheet('供方', this.supplierList) | 442 | setSheet('供方', this.supplierList) |
| 443 | + } else if (field === 'specialTerms') { | ||
| 444 | + setSheet('特别条款要求', this.specialTermsList) | ||
| 445 | + } else if (field === 'executionStandard') { | ||
| 446 | + setSheet('执行标准', this.executionStandardList) | ||
| 450 | } else if (field === 'includesPackagingFee') { | 447 | } else if (field === 'includesPackagingFee') { |
| 451 | setSheet('单价中是否已包含包装费', this.yesNoList) | 448 | setSheet('单价中是否已包含包装费', this.yesNoList) |
| 452 | } else if (field === 'includesTransportFee') { | 449 | } else if (field === 'includesTransportFee') { |
| @@ -517,9 +514,9 @@ export default { | @@ -517,9 +514,9 @@ export default { | ||
| 517 | ...formForSubmit, | 514 | ...formForSubmit, |
| 518 | destination, | 515 | destination, |
| 519 | type: 'INTL_INVENTORY_AGMT', | 516 | type: 'INTL_INVENTORY_AGMT', |
| 520 | - sumQuantity: this.sumQuantity, | ||
| 521 | - sumAmountExcl: this.sumAmountExcl, | ||
| 522 | - sumTotal: this.sumTotal, | 517 | + totalQuantity: this.totalQuantity, |
| 518 | + totalAmountExcludingTax: this.totalAmountExcludingTax, | ||
| 519 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | ||
| 523 | contractDistributorLineList: lines | 520 | contractDistributorLineList: lines |
| 524 | }) | 521 | }) |
| 525 | console.log('onSubmit__payload', payload) | 522 | console.log('onSubmit__payload', payload) |
| @@ -538,18 +535,30 @@ export default { | @@ -538,18 +535,30 @@ export default { | ||
| 538 | { key: 'supplier', label: '供方' }, | 535 | { key: 'supplier', label: '供方' }, |
| 539 | { key: 'buyer', label: '需方' }, | 536 | { key: 'buyer', label: '需方' }, |
| 540 | { key: 'orderDate', label: '订货日期' }, | 537 | { key: 'orderDate', label: '订货日期' }, |
| 538 | + { key: 'unit', label: '单位' }, | ||
| 541 | { key: 'workshopId', label: '生产厂' }, | 539 | { key: 'workshopId', label: '生产厂' }, |
| 540 | + { key: 'specialTerms', label: '特别条款要求' }, | ||
| 542 | ] | 541 | ] |
| 543 | for (const it of checks) { | 542 | for (const it of checks) { |
| 544 | const val = this.form[it.key] | 543 | const val = this.form[it.key] |
| 545 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) | 544 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) |
| 546 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } | 545 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } |
| 547 | } | 546 | } |
| 548 | - if (!Array.isArray(this.productLineList) || this.productLineList.length === 0) { | 547 | + const list = Array.isArray(this.productLineList) ? this.productLineList : [] |
| 548 | + if (list.length === 0) { | ||
| 549 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false | 549 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false |
| 550 | } | 550 | } |
| 551 | - for (const [idx, it] of this.productLineList.entries()) { | ||
| 552 | - if (!it.productName || !it.quantity || !it.unitPrice) { | 551 | + const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === '')) |
| 552 | + const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v))) | ||
| 553 | + for (const [idx, it] of list.entries()) { | ||
| 554 | + if ( | ||
| 555 | + strEmpty(it.productName) || | ||
| 556 | + strEmpty(it.industry) || | ||
| 557 | + strEmpty(it.quality) || | ||
| 558 | + strEmpty(it.brand) || | ||
| 559 | + numEmpty(it.quantity) || | ||
| 560 | + strEmpty(it.deliveryDate) | ||
| 561 | + ) { | ||
| 553 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false | 562 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false |
| 554 | } | 563 | } |
| 555 | } | 564 | } |
| @@ -577,7 +586,7 @@ export default { | @@ -577,7 +586,7 @@ export default { | ||
| 577 | color: rgba(0, 0, 0, 0.6); | 586 | color: rgba(0, 0, 0, 0.6); |
| 578 | line-height: 32rpx; | 587 | line-height: 32rpx; |
| 579 | width: 240rpx; | 588 | width: 240rpx; |
| 580 | - padding: 24rpx 0; | 589 | + padding: 12rpx 0; |
| 581 | } | 590 | } |
| 582 | .total-item-price { | 591 | .total-item-price { |
| 583 | font-weight: 600; | 592 | font-weight: 600; |
| @@ -599,7 +608,7 @@ export default { | @@ -599,7 +608,7 @@ export default { | ||
| 599 | 608 | ||
| 600 | .scroll { | 609 | .scroll { |
| 601 | flex: 1; | 610 | flex: 1; |
| 602 | - padding: 12rpx 0 480rpx !important; | 611 | + padding: 12rpx 0 392rpx !important; |
| 603 | } | 612 | } |
| 604 | 613 | ||
| 605 | .footer { | 614 | .footer { |
| @@ -53,13 +53,13 @@ | @@ -53,13 +53,13 @@ | ||
| 53 | }}</text></view> | 53 | }}</text></view> |
| 54 | </view> | 54 | </view> |
| 55 | 55 | ||
| 56 | - <view class="section" v-if="status === 'STANDARD'"> | 56 | + <view class="section" v-if="detail.status === 'STANDARD'"> |
| 57 | <view class="row"><text class="label">规范性合同</text><text class="value" style="color: #3D48A3;">{{ | 57 | <view class="row"><text class="label">规范性合同</text><text class="value" style="color: #3D48A3;">{{ |
| 58 | detail.standardFileName || '-' }}</text></view> | 58 | detail.standardFileName || '-' }}</text></view> |
| 59 | <view class="row"><text class="label">合同是否规范</text><text class="value">{{ | 59 | <view class="row"><text class="label">合同是否规范</text><text class="value">{{ |
| 60 | detail.standardStandardized ? '是' : '否' }}</text></view> | 60 | detail.standardStandardized ? '是' : '否' }}</text></view> |
| 61 | </view> | 61 | </view> |
| 62 | - <view class="section" v-if="status === 'FORMAL'"> | 62 | + <view class="section" v-if="detail.status === 'FORMAL'"> |
| 63 | <view class="row"><text class="label">规范性合同</text><text class="value" style="color: #3D48A3;">{{ | 63 | <view class="row"><text class="label">规范性合同</text><text class="value" style="color: #3D48A3;">{{ |
| 64 | detail.formalFileName || '-' }}</text></view> | 64 | detail.formalFileName || '-' }}</text></view> |
| 65 | <view class="row"><text class="label">合同是否规范</text><text class="value">{{ detail.formalStandardized | 65 | <view class="row"><text class="label">合同是否规范</text><text class="value">{{ detail.formalStandardized |
| @@ -61,7 +61,9 @@ | @@ -61,7 +61,9 @@ | ||
| 61 | <text>订单总额</text><text class="amount" :style="{ color: '#b67a76' }">{{ item.totalAmountIncludingTax ? '¥' : '' }}{{ formatAmount(item.totalAmountIncludingTax) || '-' }}</text> | 61 | <text>订单总额</text><text class="amount" :style="{ color: '#b67a76' }">{{ item.totalAmountIncludingTax ? '¥' : '' }}{{ formatAmount(item.totalAmountIncludingTax) || '-' }}</text> |
| 62 | </view> | 62 | </view> |
| 63 | <view class="info-row" v-if="item.status === 'STANDARD' || item.status === 'FORMAL'"> | 63 | <view class="info-row" v-if="item.status === 'STANDARD' || item.status === 'FORMAL'"> |
| 64 | - <text>{{ item.status === 'STANDARD' ? '标准合同' : '正式合同' }}规范性审核状态</text><span class="info-status" :style="item.standardApprovedName ? getStatusCss(item.standardApprovedName) : ''">{{ item.standardApprovedName || '-' }}</span> | 64 | + <text>{{ item.status === 'STANDARD' ? '标准合同' : '正式合同' }}规范性审核状态</text> |
| 65 | + <span v-if="item.status === 'STANDARD' ? item.standardApprovedName : item.formalApprovedName" class="info-status" :style="getStatusCss(item.status === 'STANDARD' ? item.standardApprovedName : item.formalApprovedName)">{{ item.status === 'STANDARD' ? item.standardApprovedName : item.formalApprovedName }}</span> | ||
| 66 | + <span v-else>-</span> | ||
| 65 | </view> | 67 | </view> |
| 66 | <view class="info-row"> | 68 | <view class="info-row"> |
| 67 | <text>订货日期</text><text>{{ item.orderDate }}</text> | 69 | <text>订货日期</text><text>{{ item.orderDate }}</text> |
| @@ -108,7 +108,7 @@ | @@ -108,7 +108,7 @@ | ||
| 108 | 数量 | 108 | 数量 |
| 109 | </div> | 109 | </div> |
| 110 | <div class="total-item-price"> | 110 | <div class="total-item-price"> |
| 111 | - {{ (sumQuantity || 0).toFixed(2) }}t | 111 | + {{ (totalQuantity || 0).toFixed(2) }}t |
| 112 | </div> | 112 | </div> |
| 113 | </div> | 113 | </div> |
| 114 | <div class="total-item"> | 114 | <div class="total-item"> |
| @@ -116,7 +116,7 @@ | @@ -116,7 +116,7 @@ | ||
| 116 | 不含税金额 | 116 | 不含税金额 |
| 117 | </div> | 117 | </div> |
| 118 | <div class="total-item-price text-red"> | 118 | <div class="total-item-price text-red"> |
| 119 | - ¥{{ (sumAmountExcl || 0).toFixed(2) }} | 119 | + ¥{{ (totalAmountExcludingTax || 0).toFixed(2) }} |
| 120 | </div> | 120 | </div> |
| 121 | </div> | 121 | </div> |
| 122 | <div class="total-item"> | 122 | <div class="total-item"> |
| @@ -124,7 +124,7 @@ | @@ -124,7 +124,7 @@ | ||
| 124 | 总金额 | 124 | 总金额 |
| 125 | </div> | 125 | </div> |
| 126 | <div class="total-item-price text-red"> | 126 | <div class="total-item-price text-red"> |
| 127 | - ¥{{ (sumTotal || 0).toFixed(2) }} | 127 | + ¥{{ (totalAmountIncludingTax || 0).toFixed(2) }} |
| 128 | </div> | 128 | </div> |
| 129 | </div> | 129 | </div> |
| 130 | </div> | 130 | </div> |
| @@ -147,15 +147,15 @@ export default { | @@ -147,15 +147,15 @@ export default { | ||
| 147 | } | 147 | } |
| 148 | }, | 148 | }, |
| 149 | computed: { | 149 | computed: { |
| 150 | - sumQuantity() { | 150 | + totalQuantity() { |
| 151 | const qty = this.items.filter(it => it.locked).reduce((p, c) => p + this.toNumber(c.quantity), 0) | 151 | const qty = this.items.filter(it => it.locked).reduce((p, c) => p + this.toNumber(c.quantity), 0) |
| 152 | return this.round(qty, 2) | 152 | return this.round(qty, 2) |
| 153 | }, | 153 | }, |
| 154 | - sumAmountExcl() { | 154 | + totalAmountExcludingTax() { |
| 155 | const sum = this.items.filter(it => it.locked).reduce((p, c) => p + this.toNumber(c.amountExcludingTax), 0) | 155 | const sum = this.items.filter(it => it.locked).reduce((p, c) => p + this.toNumber(c.amountExcludingTax), 0) |
| 156 | return this.round(sum, 2) | 156 | return this.round(sum, 2) |
| 157 | }, | 157 | }, |
| 158 | - sumTotal() { return this.totalAmount }, | 158 | + totalAmountIncludingTax() { return this.totalAmount }, |
| 159 | totalAmount() { | 159 | totalAmount() { |
| 160 | let sum = 0 | 160 | let sum = 0 |
| 161 | for (const it of this.items) { | 161 | for (const it of this.items) { |
| @@ -325,9 +325,9 @@ export default { | @@ -325,9 +325,9 @@ export default { | ||
| 325 | const payload = { | 325 | const payload = { |
| 326 | id: this.id, | 326 | id: this.id, |
| 327 | totalAmountCapital: formatCurrencyToChinese(this.sumTotal), | 327 | totalAmountCapital: formatCurrencyToChinese(this.sumTotal), |
| 328 | - totalAmountExcludingTax: this.sumAmountExcl, | ||
| 329 | - totalAmountIncludingTax: this.sumTotal, | ||
| 330 | - totalQuantity: this.sumQuantity, | 328 | + totalAmountExcludingTax: this.totalAmountExcludingTax, |
| 329 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | ||
| 330 | + totalQuantity: this.totalQuantity, | ||
| 331 | type:'INTL_INVENTORY_AGMT', | 331 | type:'INTL_INVENTORY_AGMT', |
| 332 | contractDistributorLineList: selected | 332 | contractDistributorLineList: selected |
| 333 | } | 333 | } |
| @@ -362,7 +362,7 @@ export default { | @@ -362,7 +362,7 @@ export default { | ||
| 362 | 362 | ||
| 363 | .scroll { | 363 | .scroll { |
| 364 | flex: 1; | 364 | flex: 1; |
| 365 | - padding: 12rpx 0 480rpx !important; | 365 | + padding: 12rpx 0 392rpx !important; |
| 366 | } | 366 | } |
| 367 | 367 | ||
| 368 | .header { | 368 | .header { |
| @@ -646,7 +646,7 @@ export default { | @@ -646,7 +646,7 @@ export default { | ||
| 646 | color: rgba(0, 0, 0, 0.6); | 646 | color: rgba(0, 0, 0, 0.6); |
| 647 | line-height: 32rpx; | 647 | line-height: 32rpx; |
| 648 | width: 240rpx; | 648 | width: 240rpx; |
| 649 | - padding: 24rpx 0; | 649 | + padding: 12rpx 0; |
| 650 | } | 650 | } |
| 651 | 651 | ||
| 652 | .total-item-price { | 652 | .total-item-price { |
| @@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
| 41 | </template> | 41 | </template> |
| 42 | </uni-list-item> | 42 | </uni-list-item> |
| 43 | 43 | ||
| 44 | - <ProductRel mode="add" :orderDateBase="form.orderDate" :list="productLineList" @change="onProductsChange" :options="productList" /> | 44 | + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" /> |
| 45 | 45 | ||
| 46 | <uni-list-item title="合计人民币金额(大写)"> | 46 | <uni-list-item title="合计人民币金额(大写)"> |
| 47 | <template v-slot:footer> | 47 | <template v-slot:footer> |
| @@ -98,34 +98,25 @@ | @@ -98,34 +98,25 @@ | ||
| 98 | :inputBorder="false" /> | 98 | :inputBorder="false" /> |
| 99 | </template> | 99 | </template> |
| 100 | </uni-list-item> | 100 | </uni-list-item> |
| 101 | - | ||
| 102 | - <view class="group"> | ||
| 103 | - <view class="group-title">特别条款要求</view> | ||
| 104 | - <view class="radio-list"> | ||
| 105 | - <view v-for="(opt, i) in specialTermsList" :key="'cr-' + i" class="radio-item" | ||
| 106 | - @click="onRadioSelect('specialTerms', 'specialTermsName', opt)"> | ||
| 107 | - <view :class="['radio', { checked: form.specialTerms === opt.value }]" /> | ||
| 108 | - <text class="label">{{ opt.label }}</text> | ||
| 109 | - </view> | ||
| 110 | - </view> | ||
| 111 | - </view> | ||
| 112 | - <view class="group"> | ||
| 113 | - <view class="group-title">执行标准</view> | ||
| 114 | - <view class="radio-list"> | ||
| 115 | - <view v-for="(opt, i) in executionStandardList" :key="'es-' + i" class="radio-item" | ||
| 116 | - @click="onRadioSelect('executionStandard', 'executionStandardName', opt)"> | ||
| 117 | - <view :class="['radio', { checked: form.executionStandard === opt.value }]" /> | ||
| 118 | - <text class="label">{{ opt.label }}</text> | ||
| 119 | - </view> | ||
| 120 | - </view> | ||
| 121 | - </view> | 101 | + <uni-list-item class="select-item" :class="form.specialTermsName ? 'is-filled' : 'is-empty'" clickable |
| 102 | + @click="openSheet('specialTerms')" :rightText="form.specialTermsName || '请选择'" showArrow> | ||
| 103 | + <template v-slot:body> | ||
| 104 | + <view class="item-title"><text class="required">*</text><text>特别条款要求</text></view> | ||
| 105 | + </template> | ||
| 106 | + </uni-list-item> | ||
| 107 | + <uni-list-item class="select-item" :class="form.executionStandardName ? 'is-filled' : 'is-empty'" clickable | ||
| 108 | + @click="openSheet('executionStandard')" :rightText="form.executionStandardName || '请选择'" showArrow> | ||
| 109 | + <template v-slot:body> | ||
| 110 | + <view class="item-title"><text>执行标准</text></view> | ||
| 111 | + </template> | ||
| 112 | + </uni-list-item> | ||
| 122 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> | 113 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> |
| 123 | <template v-slot:footer> | 114 | <template v-slot:footer> |
| 124 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" | 115 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" |
| 125 | :inputBorder="false" /> | 116 | :inputBorder="false" /> |
| 126 | </template> | 117 | </template> |
| 127 | </uni-list-item> | 118 | </uni-list-item> |
| 128 | - <uni-list-item title="特别说明"> | 119 | + <uni-list-item title="特别说明" style="margin-top: 20rpx;"> |
| 129 | <template v-slot:footer> | 120 | <template v-slot:footer> |
| 130 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> | 121 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> |
| 131 | </template> | 122 | </template> |
| @@ -177,15 +168,15 @@ | @@ -177,15 +168,15 @@ | ||
| 177 | <div class="total-text">合计</div> | 168 | <div class="total-text">合计</div> |
| 178 | <div class="total-item"> | 169 | <div class="total-item"> |
| 179 | <div class="total-item-text">数量</div> | 170 | <div class="total-item-text">数量</div> |
| 180 | - <div class="total-item-price">{{ (sumQuantity || 0).toFixed(2) }}t</div> | 171 | + <div class="total-item-price">{{ (totalQuantity || 0).toFixed(2) }}kg</div> |
| 181 | </div> | 172 | </div> |
| 182 | <div class="total-item"> | 173 | <div class="total-item"> |
| 183 | <div class="total-item-text">不含税金额</div> | 174 | <div class="total-item-text">不含税金额</div> |
| 184 | - <div class="total-item-price text-red">¥{{ (sumAmountExcl || 0).toFixed(2) }}</div> | 175 | + <div class="total-item-price text-red">¥{{ (totalAmountExcludingTax || 0).toFixed(2) }}</div> |
| 185 | </div> | 176 | </div> |
| 186 | <div class="total-item"> | 177 | <div class="total-item"> |
| 187 | <div class="total-item-text">总金额</div> | 178 | <div class="total-item-text">总金额</div> |
| 188 | - <div class="total-item-price text-red">¥{{ (sumTotal || 0).toFixed(2) }}</div> | 179 | + <div class="total-item-price text-red">¥{{ (totalAmountIncludingTax || 0).toFixed(2) }}</div> |
| 189 | </div> | 180 | </div> |
| 190 | </div> | 181 | </div> |
| 191 | <button class="btn submit" type="primary" @click="onSubmit">保存</button> | 182 | <button class="btn submit" type="primary" @click="onSubmit">保存</button> |
| @@ -223,6 +214,7 @@ export default { | @@ -223,6 +214,7 @@ export default { | ||
| 223 | workshopId: '', | 214 | workshopId: '', |
| 224 | workshopName: '', | 215 | workshopName: '', |
| 225 | orderDate: '', | 216 | orderDate: '', |
| 217 | + deliveryDate: '', | ||
| 226 | designatedConsignee: '', | 218 | designatedConsignee: '', |
| 227 | specialTerms: '', | 219 | specialTerms: '', |
| 228 | specialTermsName: '', | 220 | specialTermsName: '', |
| @@ -256,9 +248,9 @@ export default { | @@ -256,9 +248,9 @@ export default { | ||
| 256 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], | 248 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], |
| 257 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, | 249 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, |
| 258 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, | 250 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, |
| 259 | - sumQuantity: 0, | ||
| 260 | - sumAmountExcl: 0, | ||
| 261 | - sumTotal: 0, | 251 | + totalQuantity: 0, |
| 252 | + totalAmountExcludingTax: 0, | ||
| 253 | + totalAmountIncludingTax: 0, | ||
| 262 | productLineList: [], | 254 | productLineList: [], |
| 263 | newProductLineList: [], | 255 | newProductLineList: [], |
| 264 | productList: [] | 256 | productList: [] |
| @@ -349,9 +341,9 @@ export default { | @@ -349,9 +341,9 @@ export default { | ||
| 349 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) | 341 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) |
| 350 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) | 342 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) |
| 351 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) | 343 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) |
| 352 | - this.sumQuantity = sumQ | ||
| 353 | - this.sumAmountExcl = sumE | ||
| 354 | - this.sumTotal = sumT | 344 | + this.totalQuantity = sumQ |
| 345 | + this.totalAmountExcludingTax = sumE | ||
| 346 | + this.totalAmountIncludingTax = sumT | ||
| 355 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) | 347 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) |
| 356 | }, | 348 | }, |
| 357 | async loadSuppliers() { | 349 | async loadSuppliers() { |
| @@ -399,6 +391,10 @@ export default { | @@ -399,6 +391,10 @@ export default { | ||
| 399 | setSheet('生产厂', opts) | 391 | setSheet('生产厂', opts) |
| 400 | } else if (field === 'supplier') { | 392 | } else if (field === 'supplier') { |
| 401 | setSheet('供方', this.supplierList) | 393 | setSheet('供方', this.supplierList) |
| 394 | + } else if (field === 'specialTerms') { | ||
| 395 | + setSheet('特别条款要求', this.specialTermsList) | ||
| 396 | + } else if (field === 'executionStandard') { | ||
| 397 | + setSheet('执行标准', this.executionStandardList) | ||
| 402 | } else if (field === 'includesPackagingFee') { | 398 | } else if (field === 'includesPackagingFee') { |
| 403 | setSheet('单价中是否已包含包装费', this.yesNoList) | 399 | setSheet('单价中是否已包含包装费', this.yesNoList) |
| 404 | } else if (field === 'includesTransportFee') { | 400 | } else if (field === 'includesTransportFee') { |
| @@ -443,18 +439,30 @@ export default { | @@ -443,18 +439,30 @@ export default { | ||
| 443 | { key: 'supplier', label: '供方' }, | 439 | { key: 'supplier', label: '供方' }, |
| 444 | { key: 'buyer', label: '需方' }, | 440 | { key: 'buyer', label: '需方' }, |
| 445 | { key: 'orderDate', label: '订货日期' }, | 441 | { key: 'orderDate', label: '订货日期' }, |
| 442 | + { key: 'unit', label: '单位' }, | ||
| 446 | { key: 'workshopId', label: '生产厂' }, | 443 | { key: 'workshopId', label: '生产厂' }, |
| 444 | + { key: 'specialTerms', label: '特别条款要求' }, | ||
| 447 | ] | 445 | ] |
| 448 | for (const it of checks) { | 446 | for (const it of checks) { |
| 449 | const val = this.form[it.key] | 447 | const val = this.form[it.key] |
| 450 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) | 448 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) |
| 451 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } | 449 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } |
| 452 | } | 450 | } |
| 453 | - if (!Array.isArray(this.productLineList) || this.productLineList.length === 0) { | 451 | + const list = Array.isArray(this.newProductLineList) ? this.newProductLineList : [] |
| 452 | + if (list.length === 0) { | ||
| 454 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false | 453 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false |
| 455 | } | 454 | } |
| 456 | - for (const [idx, it] of this.productLineList.entries()) { | ||
| 457 | - if (!it.productName || !it.quantity || !it.unitPrice) { | 455 | + const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === '')) |
| 456 | + const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v))) | ||
| 457 | + for (const [idx, it] of list.entries()) { | ||
| 458 | + if ( | ||
| 459 | + strEmpty(it.productName) || | ||
| 460 | + strEmpty(it.industry) || | ||
| 461 | + strEmpty(it.quality) || | ||
| 462 | + strEmpty(it.brand) || | ||
| 463 | + numEmpty(it.quantity) || | ||
| 464 | + strEmpty(it.deliveryDate) | ||
| 465 | + ) { | ||
| 458 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false | 466 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false |
| 459 | } | 467 | } |
| 460 | } | 468 | } |
| @@ -486,9 +494,9 @@ export default { | @@ -486,9 +494,9 @@ export default { | ||
| 486 | id: this.form.id, | 494 | id: this.form.id, |
| 487 | destination, | 495 | destination, |
| 488 | type: 'INTL_INVENTORY_AGMT', | 496 | type: 'INTL_INVENTORY_AGMT', |
| 489 | - sumQuantity: this.sumQuantity, | ||
| 490 | - sumAmountExcl: this.sumAmountExcl, | ||
| 491 | - sumTotal: this.sumTotal, | 497 | + totalQuantity: this.totalQuantity, |
| 498 | + totalAmountExcludingTax: this.totalAmountExcludingTax, | ||
| 499 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | ||
| 492 | contractDistributorLineList: lines | 500 | contractDistributorLineList: lines |
| 493 | }) | 501 | }) |
| 494 | try { | 502 | try { |
| @@ -524,7 +532,7 @@ export default { | @@ -524,7 +532,7 @@ export default { | ||
| 524 | color: rgba(0, 0, 0, 0.6); | 532 | color: rgba(0, 0, 0, 0.6); |
| 525 | line-height: 32rpx; | 533 | line-height: 32rpx; |
| 526 | width: 240rpx; | 534 | width: 240rpx; |
| 527 | - padding: 24rpx 0; | 535 | + padding: 12rpx 0; |
| 528 | } | 536 | } |
| 529 | 537 | ||
| 530 | .total-item-price { | 538 | .total-item-price { |
| @@ -547,7 +555,7 @@ export default { | @@ -547,7 +555,7 @@ export default { | ||
| 547 | 555 | ||
| 548 | .scroll { | 556 | .scroll { |
| 549 | flex: 1; | 557 | flex: 1; |
| 550 | - padding: 12rpx 0 480rpx !important; | 558 | + padding: 12rpx 0 392rpx !important; |
| 551 | } | 559 | } |
| 552 | 560 | ||
| 553 | .footer { | 561 | .footer { |
| @@ -55,51 +55,51 @@ | @@ -55,51 +55,51 @@ | ||
| 55 | </uni-list-item> | 55 | </uni-list-item> |
| 56 | <uni-list-item title="厚度"> | 56 | <uni-list-item title="厚度"> |
| 57 | <template v-slot:footer> | 57 | <template v-slot:footer> |
| 58 | - <uni-easyinput v-model="item.thickness" :inputBorder="false" placeholder="请输入厚度" /> | 58 | + <uni-easyinput type="digit" v-model="item.thickness" :inputBorder="false" placeholder="请输入厚度" @input="onNonNegativeInput(idx, 'thickness')" @blur="onNonNegativeBlur(idx, 'thickness', 2)" /> |
| 59 | </template> | 59 | </template> |
| 60 | </uni-list-item> | 60 | </uni-list-item> |
| 61 | <uni-list-item title="厚度公差(单项+)"> | 61 | <uni-list-item title="厚度公差(单项+)"> |
| 62 | <template v-slot:footer> | 62 | <template v-slot:footer> |
| 63 | - <uni-easyinput v-model="item.thicknessTolPos" :inputBorder="false" | ||
| 64 | - placeholder="请输入厚度公差(单项+)" /> | 63 | + <uni-easyinput type="digit" v-model="item.thicknessTolPos" :inputBorder="false" |
| 64 | + placeholder="请输入厚度公差(单项+)" @input="onNonNegativeInput(idx, 'thicknessTolPos')" @blur="onNonNegativeBlur(idx, 'thicknessTolPos', 2)" /> | ||
| 65 | </template> | 65 | </template> |
| 66 | </uni-list-item> | 66 | </uni-list-item> |
| 67 | <uni-list-item title="厚度公差(单项-)"> | 67 | <uni-list-item title="厚度公差(单项-)"> |
| 68 | <template v-slot:footer> | 68 | <template v-slot:footer> |
| 69 | - <uni-easyinput v-model="item.thicknessTolNeg" :inputBorder="false" | ||
| 70 | - placeholder="请输入厚度公差(单项-)" /> | 69 | + <uni-easyinput type="digit" v-model="item.thicknessTolNeg" :inputBorder="false" |
| 70 | + placeholder="请输入厚度公差(单项-)" @input="onNonNegativeInput(idx, 'thicknessTolNeg')" @blur="onNonNegativeBlur(idx, 'thicknessTolNeg', 2)" /> | ||
| 71 | </template> | 71 | </template> |
| 72 | </uni-list-item> | 72 | </uni-list-item> |
| 73 | <uni-list-item title="宽度"> | 73 | <uni-list-item title="宽度"> |
| 74 | <template v-slot:footer> | 74 | <template v-slot:footer> |
| 75 | - <uni-easyinput v-model="item.width" :inputBorder="false" placeholder="请输入宽度" /> | 75 | + <uni-easyinput type="digit" v-model="item.width" :inputBorder="false" placeholder="请输入宽度" @input="onNonNegativeInput(idx, 'width')" @blur="onNonNegativeBlur(idx, 'width', 2)" /> |
| 76 | </template> | 76 | </template> |
| 77 | </uni-list-item> | 77 | </uni-list-item> |
| 78 | <uni-list-item title="宽度公差(单项+)"> | 78 | <uni-list-item title="宽度公差(单项+)"> |
| 79 | <template v-slot:footer> | 79 | <template v-slot:footer> |
| 80 | - <uni-easyinput v-model="item.widthTolPos" :inputBorder="false" placeholder="请输入宽度公差(单项+)" /> | 80 | + <uni-easyinput type="digit" v-model="item.widthTolPos" :inputBorder="false" placeholder="请输入宽度公差(单项+)" @input="onNonNegativeInput(idx, 'widthTolPos')" @blur="onNonNegativeBlur(idx, 'widthTolPos', 2)" /> |
| 81 | </template> | 81 | </template> |
| 82 | </uni-list-item> | 82 | </uni-list-item> |
| 83 | <uni-list-item title="宽度公差(单项-)"> | 83 | <uni-list-item title="宽度公差(单项-)"> |
| 84 | <template v-slot:footer> | 84 | <template v-slot:footer> |
| 85 | - <uni-easyinput v-model="item.widthTolNeg" :inputBorder="false" placeholder="请输入宽度公差(单项-)" /> | 85 | + <uni-easyinput type="digit" v-model="item.widthTolNeg" :inputBorder="false" placeholder="请输入宽度公差(单项-)" @input="onNonNegativeInput(idx, 'widthTolNeg')" @blur="onNonNegativeBlur(idx, 'widthTolNeg', 2)" /> |
| 86 | </template> | 86 | </template> |
| 87 | </uni-list-item> | 87 | </uni-list-item> |
| 88 | <uni-list-item title="长度"> | 88 | <uni-list-item title="长度"> |
| 89 | <template v-slot:footer> | 89 | <template v-slot:footer> |
| 90 | - <uni-easyinput v-model="item.length" :inputBorder="false" placeholder="请输入长度" /> | 90 | + <uni-easyinput type="digit" v-model="item.length" :inputBorder="false" placeholder="请输入长度" @input="onNonNegativeInput(idx, 'length')" @blur="onNonNegativeBlur(idx, 'length', 2)" /> |
| 91 | </template> | 91 | </template> |
| 92 | </uni-list-item> | 92 | </uni-list-item> |
| 93 | <uni-list-item title="长度公差(单项+)"> | 93 | <uni-list-item title="长度公差(单项+)"> |
| 94 | <template v-slot:footer> | 94 | <template v-slot:footer> |
| 95 | - <uni-easyinput v-model="item.lengthTolPos" :inputBorder="false" | ||
| 96 | - placeholder="请输入长度公差(单项+)" /> | 95 | + <uni-easyinput type="digit" v-model="item.lengthTolPos" :inputBorder="false" |
| 96 | + placeholder="请输入长度公差(单项+)" @input="onNonNegativeInput(idx, 'lengthTolPos')" @blur="onNonNegativeBlur(idx, 'lengthTolPos', 2)" /> | ||
| 97 | </template> | 97 | </template> |
| 98 | </uni-list-item> | 98 | </uni-list-item> |
| 99 | <uni-list-item title="长度公差(单项-)"> | 99 | <uni-list-item title="长度公差(单项-)"> |
| 100 | <template v-slot:footer> | 100 | <template v-slot:footer> |
| 101 | - <uni-easyinput v-model="item.lengthTolNeg" :inputBorder="false" | ||
| 102 | - placeholder="请输入长度公差(单项-)" /> | 101 | + <uni-easyinput type="digit" v-model="item.lengthTolNeg" :inputBorder="false" |
| 102 | + placeholder="请输入长度公差(单项-)" @input="onNonNegativeInput(idx, 'lengthTolNeg')" @blur="onNonNegativeBlur(idx, 'lengthTolNeg', 2)" /> | ||
| 103 | </template> | 103 | </template> |
| 104 | </uni-list-item> | 104 | </uni-list-item> |
| 105 | <uni-list-item title="状态"> | 105 | <uni-list-item title="状态"> |
| @@ -109,7 +109,7 @@ | @@ -109,7 +109,7 @@ | ||
| 109 | </uni-list-item> | 109 | </uni-list-item> |
| 110 | <uni-list-item title="数量"> | 110 | <uni-list-item title="数量"> |
| 111 | <template v-slot:footer> | 111 | <template v-slot:footer> |
| 112 | - <uni-easyinput v-model="item.quantity" type="number" :inputBorder="false" placeholder="请输入数量" @input="onImmediateChange(idx)" @blur="onNumberBlur(idx, 'quantity', 0)" /> | 112 | + <uni-easyinput v-model="item.quantity" type="digit" :inputBorder="false" placeholder="请输入数量" @input="onNonNegativeInput(idx, 'quantity')" @blur="onNonNegativeBlur(idx, 'quantity', 2)" /> |
| 113 | </template> | 113 | </template> |
| 114 | </uni-list-item> | 114 | </uni-list-item> |
| 115 | <uni-list-item title="单价"> | 115 | <uni-list-item title="单价"> |
| @@ -134,7 +134,7 @@ | @@ -134,7 +134,7 @@ | ||
| 134 | </uni-list-item> | 134 | </uni-list-item> |
| 135 | <uni-list-item title="发货日期"> | 135 | <uni-list-item title="发货日期"> |
| 136 | <template v-slot:footer> | 136 | <template v-slot:footer> |
| 137 | - <uni-datetime-picker type="date" v-model="item.orderDate" @change="onDateChange(idx, $event)" /> | 137 | + <uni-datetime-picker type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" /> |
| 138 | </template> | 138 | </template> |
| 139 | </uni-list-item> | 139 | </uni-list-item> |
| 140 | </uni-list> | 140 | </uni-list> |
| @@ -156,7 +156,30 @@ | @@ -156,7 +156,30 @@ | ||
| 156 | <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view> | 156 | <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view> |
| 157 | <view class="row"><text class="label">牌号</text><text class="value">{{ item.brand }}</text></view> | 157 | <view class="row"><text class="label">牌号</text><text class="value">{{ item.brand }}</text></view> |
| 158 | <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view> | 158 | <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view> |
| 159 | - <view class="row"><text class="label">规格</text><text class="value">{{ item.specDisplay }}</text></view> | 159 | + <!-- 厚(公差) * 宽(公差) * 长(公差) --> |
| 160 | + <view class="row row-spec"><text class="label">规格(mm)</text> | ||
| 161 | + <view class="value value-spec"> | ||
| 162 | + <view v-if="item.thickness" class="value-spec_val">{{ item.thickness }}</view> | ||
| 163 | + <view v-if="item.thickness" class="value-spec_box"> | ||
| 164 | + <view v-if="item.thicknessTolPos" class="value-spec_box_1">+{{ item.thicknessTolPos }} | ||
| 165 | + </view> | ||
| 166 | + <view v-if="item.thicknessTolNeg" class="value-spec_box_2">-{{ item.thicknessTolNeg }} | ||
| 167 | + </view> | ||
| 168 | + </view> | ||
| 169 | + <view v-if="item.width" class="value-spec_val p12">*</view> | ||
| 170 | + <view v-if="item.width" class="value-spec_val">{{ item.width }}</view> | ||
| 171 | + <view v-if="item.width" class="value-spec_box"> | ||
| 172 | + <view v-if="item.widthTolPos" class="value-spec_box_1">+{{ item.widthTolPos }}</view> | ||
| 173 | + <view v-if="item.widthTolNeg" class="value-spec_box_2">-{{ item.widthTolNeg }}</view> | ||
| 174 | + </view> | ||
| 175 | + <view v-if="item.length" class="value-spec_val p12">*</view> | ||
| 176 | + <view v-if="item.length" class="value-spec_val">{{ item.length }}</view> | ||
| 177 | + <view v-if="item.length" class="value-spec_box"> | ||
| 178 | + <view v-if="item.lengthTolPos" class="value-spec_box_1">+{{ item.lengthTolPos }}</view> | ||
| 179 | + <view v-if="item.lengthTolNeg" class="value-spec_box_2">-{{ item.lengthTolNeg }}</view> | ||
| 180 | + </view> | ||
| 181 | + </view> | ||
| 182 | + </view> | ||
| 160 | <view class="row"><text class="label">状态</text><text class="value">{{ item.status }}</text></view> | 183 | <view class="row"><text class="label">状态</text><text class="value">{{ item.status }}</text></view> |
| 161 | <view class="row"><text class="label">数量</text><text class="value">{{ item.quantity }}</text></view> | 184 | <view class="row"><text class="label">数量</text><text class="value">{{ item.quantity }}</text></view> |
| 162 | <view class="row"><text class="label">单价</text><text class="value">{{ formatCurrency(item.unitPrice) | 185 | <view class="row"><text class="label">单价</text><text class="value">{{ formatCurrency(item.unitPrice) |
| @@ -167,7 +190,7 @@ | @@ -167,7 +190,7 @@ | ||
| 167 | }}</text></view> | 190 | }}</text></view> |
| 168 | <view class="row"><text class="label">总金额</text><text class="value">{{ formatCurrency(item.totalAmount) | 191 | <view class="row"><text class="label">总金额</text><text class="value">{{ formatCurrency(item.totalAmount) |
| 169 | }}</text></view> | 192 | }}</text></view> |
| 170 | - <view class="row"><text class="label">发货日期</text><text class="value">{{ item.orderDate }}</text></view> | 193 | + <view class="row"><text class="label">发货日期</text><text class="value">{{ item.deliveryDate }}</text></view> |
| 171 | </view> | 194 | </view> |
| 172 | </view> | 195 | </view> |
| 173 | <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value" @confirm="onProductConfirm" /> | 196 | <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value" @confirm="onProductConfirm" /> |
| @@ -181,7 +204,7 @@ export default { | @@ -181,7 +204,7 @@ export default { | ||
| 181 | mode: { type: String, default: 'add' }, | 204 | mode: { type: String, default: 'add' }, |
| 182 | list: { type: Array, default: () => [] }, | 205 | list: { type: Array, default: () => [] }, |
| 183 | max: { type: Number, default: 8 }, | 206 | max: { type: Number, default: 8 }, |
| 184 | - orderDateBase: { type: String, default: '' }, | 207 | + deliveryDateBase: { type: String, default: '' }, |
| 185 | options: { type: Array, default: () => [] } | 208 | options: { type: Array, default: () => [] } |
| 186 | }, | 209 | }, |
| 187 | components: { SingleSelectSheet }, | 210 | components: { SingleSelectSheet }, |
| @@ -223,7 +246,18 @@ export default { | @@ -223,7 +246,18 @@ export default { | ||
| 223 | }, | 246 | }, |
| 224 | methods: { | 247 | methods: { |
| 225 | defaultItem() { | 248 | defaultItem() { |
| 226 | - return { productId: '', productName: '', industry: '', brand: '', quality: '', thickness: '', thicknessTolPos: '', thicknessTolNeg: '', width: '', widthTolPos: '', widthTolNeg: '', length: '', lengthTolPos: '', lengthTolNeg: '', status: '', quantity: '', unitPrice: '', processingFee: undefined, amountExcludingTax: 0, totalAmount: 0, orderDate: '' } | 249 | + return { productId: '', productName: '', industry: '', brand: '', quality: '', thickness: '', thicknessTolPos: '', thicknessTolNeg: '', width: '', widthTolPos: '', widthTolNeg: '', length: '', lengthTolPos: '', lengthTolNeg: '', status: '', quantity: '', unitPrice: '', processingFee: undefined, amountExcludingTax: 0, totalAmount: 0, deliveryDate: '' } |
| 250 | + }, | ||
| 251 | + onNonNegativeInput(idx, field) { | ||
| 252 | + const it = this.items[idx] | ||
| 253 | + if (!it) return | ||
| 254 | + let v = String(it[field] != null ? it[field] : '') | ||
| 255 | + v = v.replace(/[^0-9.]/g, '') | ||
| 256 | + v = v.replace(/(\..*)\./g, '$1') | ||
| 257 | + if (v.startsWith('.')) v = '0' + v | ||
| 258 | + it[field] = v | ||
| 259 | + this.$set(this.items, idx, it) | ||
| 260 | + if (field === 'quantity' || field === 'unitPrice') this.$nextTick(() => this.recalculate(idx)) | ||
| 227 | }, | 261 | }, |
| 228 | onImmediateChange(idx) { | 262 | onImmediateChange(idx) { |
| 229 | this.$nextTick(() => this.recalculate(idx)) | 263 | this.$nextTick(() => this.recalculate(idx)) |
| @@ -239,21 +273,21 @@ export default { | @@ -239,21 +273,21 @@ export default { | ||
| 239 | const m = Math.pow(10, digits) | 273 | const m = Math.pow(10, digits) |
| 240 | return Math.round(n * m) / m | 274 | return Math.round(n * m) / m |
| 241 | }, | 275 | }, |
| 242 | - onNumberBlur(idx, field, digits) { | 276 | + onNonNegativeBlur(idx, field, digits) { |
| 243 | const it = this.items[idx] | 277 | const it = this.items[idx] |
| 244 | if (!it) return | 278 | if (!it) return |
| 245 | const raw = it[field] | 279 | const raw = it[field] |
| 246 | - // 如果为空则保持为空,不自动置为0,仅重新计算依赖字段 | ||
| 247 | if (raw === '' || raw === null || raw === undefined) { | 280 | if (raw === '' || raw === null || raw === undefined) { |
| 248 | this.$set(this.items, idx, it) | 281 | this.$set(this.items, idx, it) |
| 249 | - this.recalculate(idx) | 282 | + if (field === 'quantity' || field === 'unitPrice') this.recalculate(idx) |
| 250 | return | 283 | return |
| 251 | } | 284 | } |
| 252 | - const num = this.toNumber(raw) | 285 | + let num = this.toNumber(raw) |
| 286 | + if (isNaN(num) || num < 0) num = 0 | ||
| 253 | const rounded = this.round(num, digits) | 287 | const rounded = this.round(num, digits) |
| 254 | it[field] = rounded | 288 | it[field] = rounded |
| 255 | this.$set(this.items, idx, it) | 289 | this.$set(this.items, idx, it) |
| 256 | - this.recalculate(idx) | 290 | + if (field === 'quantity' || field === 'unitPrice') this.recalculate(idx) |
| 257 | }, | 291 | }, |
| 258 | formatCurrency(val) { | 292 | formatCurrency(val) { |
| 259 | if (val == null || val === '') return '' | 293 | if (val == null || val === '') return '' |
| @@ -324,15 +358,15 @@ export default { | @@ -324,15 +358,15 @@ export default { | ||
| 324 | onDateChange(idx, e) { | 358 | onDateChange(idx, e) { |
| 325 | const it = this.items[idx] | 359 | const it = this.items[idx] |
| 326 | if (!it) return | 360 | if (!it) return |
| 327 | - const val = typeof e === 'string' ? e : (e && e.detail && e.detail.value) ? e.detail.value : it.orderDate | 361 | + const val = typeof e === 'string' ? e : (e && e.detail && e.detail.value) ? e.detail.value : it.deliveryDate |
| 328 | const dateStr = String(val).slice(0, 10) | 362 | const dateStr = String(val).slice(0, 10) |
| 329 | - const base = this.orderDateBase ? new Date(this.orderDateBase) : null | 363 | + const base = this.deliveryDateBase ? new Date(this.deliveryDateBase) : null |
| 330 | const d = new Date(dateStr) | 364 | const d = new Date(dateStr) |
| 331 | if (base && !isNaN(d.getTime()) && d.getTime() < base.getTime()) { | 365 | if (base && !isNaN(d.getTime()) && d.getTime() < base.getTime()) { |
| 332 | uni.showToast({ title: '发货日期不得早于订货日期', icon: 'none' }) | 366 | uni.showToast({ title: '发货日期不得早于订货日期', icon: 'none' }) |
| 333 | - it.orderDate = this.orderDateBase | 367 | + it.deliveryDate = this.deliveryDateBase |
| 334 | } else { | 368 | } else { |
| 335 | - it.orderDate = dateStr | 369 | + it.deliveryDate = dateStr |
| 336 | } | 370 | } |
| 337 | this.$set(this.items, idx, it) | 371 | this.$set(this.items, idx, it) |
| 338 | }, | 372 | }, |
| @@ -505,8 +539,46 @@ export default { | @@ -505,8 +539,46 @@ export default { | ||
| 505 | 539 | ||
| 506 | .value { | 540 | .value { |
| 507 | flex: 1; | 541 | flex: 1; |
| 508 | - text-align: right; | 542 | + // text-align: right; |
| 509 | color: rgba(0, 0, 0, 0.9); | 543 | color: rgba(0, 0, 0, 0.9); |
| 510 | font-size: 28rpx; | 544 | font-size: 28rpx; |
| 511 | } | 545 | } |
| 546 | + .value-spec { | ||
| 547 | + height: 48rpx; | ||
| 548 | + display: flex; | ||
| 549 | + align-items: center; | ||
| 550 | + color: #000000; | ||
| 551 | + // justify-content: end; | ||
| 552 | + &_box { | ||
| 553 | + position: relative; | ||
| 554 | + width: 60rpx; | ||
| 555 | + height: 48rpx; | ||
| 556 | + | ||
| 557 | + &_1 { | ||
| 558 | + font-size: 16rpx; | ||
| 559 | + position: absolute; | ||
| 560 | + top: -10rpx; | ||
| 561 | + left: 0; | ||
| 562 | + } | ||
| 563 | + | ||
| 564 | + &_2 { | ||
| 565 | + font-size: 16rpx; | ||
| 566 | + position: absolute; | ||
| 567 | + bottom: -10rpx; | ||
| 568 | + left: 0; | ||
| 569 | + } | ||
| 570 | + } | ||
| 571 | + | ||
| 572 | + &_val { | ||
| 573 | + font-size: 28rpx; | ||
| 574 | + | ||
| 575 | + &.p12 { | ||
| 576 | + padding-right: 12rpx; | ||
| 577 | + } | ||
| 578 | + } | ||
| 579 | + } | ||
| 580 | + .row-spec { | ||
| 581 | + height: 60rpx; | ||
| 582 | + align-items: center; | ||
| 583 | + } | ||
| 512 | </style> | 584 | </style> |
| @@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
| 39 | <view class="item-title"><text class="required">*</text><text>生产厂</text></view> | 39 | <view class="item-title"><text class="required">*</text><text>生产厂</text></view> |
| 40 | </template> | 40 | </template> |
| 41 | </uni-list-item> | 41 | </uni-list-item> |
| 42 | - <ProductRel mode="add" :orderDateBase="form.orderDate" @change="onProductsChange" :options="productList" /> | 42 | + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" /> |
| 43 | <uni-list-item title="合计人民币金额(大写)"> | 43 | <uni-list-item title="合计人民币金额(大写)"> |
| 44 | <template v-slot:footer> | 44 | <template v-slot:footer> |
| 45 | <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled /> | 45 | <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled /> |
| @@ -92,33 +92,25 @@ | @@ -92,33 +92,25 @@ | ||
| 92 | :inputBorder="false" /> | 92 | :inputBorder="false" /> |
| 93 | </template> | 93 | </template> |
| 94 | </uni-list-item> | 94 | </uni-list-item> |
| 95 | - <view class="group"> | ||
| 96 | - <view class="group-title">特别条款要求</view> | ||
| 97 | - <view class="radio-list"> | ||
| 98 | - <view v-for="(opt, i) in specialTermsList" :key="'cr-' + i" class="radio-item" | ||
| 99 | - @click="onRadioSelect('specialTerms', 'specialTermsName', opt)"> | ||
| 100 | - <view :class="['radio', { checked: form.specialTerms === opt.value }]" /> | ||
| 101 | - <text class="label">{{ opt.label }}</text> | ||
| 102 | - </view> | ||
| 103 | - </view> | ||
| 104 | - </view> | ||
| 105 | - <view class="group"> | ||
| 106 | - <view class="group-title">执行标准</view> | ||
| 107 | - <view class="radio-list"> | ||
| 108 | - <view v-for="(opt, i) in executionStandardList" :key="'es-' + i" class="radio-item" | ||
| 109 | - @click="onRadioSelect('executionStandard', 'executionStandardName', opt)"> | ||
| 110 | - <view :class="['radio', { checked: form.executionStandard === opt.value }]" /> | ||
| 111 | - <text class="label">{{ opt.label }}</text> | ||
| 112 | - </view> | ||
| 113 | - </view> | ||
| 114 | - </view> | 95 | + <uni-list-item class="select-item" :class="form.specialTermsName ? 'is-filled' : 'is-empty'" clickable |
| 96 | + @click="openSheet('specialTerms')" :rightText="form.specialTermsName || '请选择'" showArrow> | ||
| 97 | + <template v-slot:body> | ||
| 98 | + <view class="item-title"><text class="required">*</text><text>特别条款要求</text></view> | ||
| 99 | + </template> | ||
| 100 | + </uni-list-item> | ||
| 101 | + <uni-list-item class="select-item" :class="form.executionStandardName ? 'is-filled' : 'is-empty'" clickable | ||
| 102 | + @click="openSheet('executionStandard')" :rightText="form.executionStandardName || '请选择'" showArrow> | ||
| 103 | + <template v-slot:body> | ||
| 104 | + <view class="item-title"><text>执行标准</text></view> | ||
| 105 | + </template> | ||
| 106 | + </uni-list-item> | ||
| 115 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> | 107 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> |
| 116 | <template v-slot:footer> | 108 | <template v-slot:footer> |
| 117 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" | 109 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" |
| 118 | :inputBorder="false" /> | 110 | :inputBorder="false" /> |
| 119 | </template> | 111 | </template> |
| 120 | </uni-list-item> | 112 | </uni-list-item> |
| 121 | - <uni-list-item title="特别说明"> | 113 | + <uni-list-item title="特别说明" style="margin-top: 20rpx;"> |
| 122 | <template v-slot:footer> | 114 | <template v-slot:footer> |
| 123 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> | 115 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> |
| 124 | </template> | 116 | </template> |
| @@ -180,8 +172,8 @@ | @@ -180,8 +172,8 @@ | ||
| 180 | <div class="total-item-text"> | 172 | <div class="total-item-text"> |
| 181 | 数量 | 173 | 数量 |
| 182 | </div> | 174 | </div> |
| 183 | - <div class="total-item-price"> | ||
| 184 | - {{ (sumQuantity || 0).toFixed(2) }}t | 175 | + <div class="total-item-price"> |
| 176 | + {{ (totalQuantity || 0).toFixed(2) }}kg | ||
| 185 | </div> | 177 | </div> |
| 186 | </div> | 178 | </div> |
| 187 | <div class="total-item"> | 179 | <div class="total-item"> |
| @@ -189,7 +181,7 @@ | @@ -189,7 +181,7 @@ | ||
| 189 | 不含税金额 | 181 | 不含税金额 |
| 190 | </div> | 182 | </div> |
| 191 | <div class="total-item-price text-red"> | 183 | <div class="total-item-price text-red"> |
| 192 | - ¥{{ (sumAmountExcl || 0).toFixed(2) }} | 184 | + ¥{{ (totalAmountExcludingTax || 0).toFixed(2) }} |
| 193 | </div> | 185 | </div> |
| 194 | </div> | 186 | </div> |
| 195 | <div class="total-item"> | 187 | <div class="total-item"> |
| @@ -197,7 +189,7 @@ | @@ -197,7 +189,7 @@ | ||
| 197 | 总金额 | 189 | 总金额 |
| 198 | </div> | 190 | </div> |
| 199 | <div class="total-item-price text-red"> | 191 | <div class="total-item-price text-red"> |
| 200 | - ¥{{ (sumTotal || 0).toFixed(2) }} | 192 | + ¥{{ (totalAmountIncludingTax || 0).toFixed(2) }} |
| 201 | </div> | 193 | </div> |
| 202 | </div> | 194 | </div> |
| 203 | </div> | 195 | </div> |
| @@ -233,6 +225,7 @@ export default { | @@ -233,6 +225,7 @@ export default { | ||
| 233 | buyer: '', | 225 | buyer: '', |
| 234 | buyerName: '', | 226 | buyerName: '', |
| 235 | orderDate: '', | 227 | orderDate: '', |
| 228 | + deliveryDate: '', | ||
| 236 | designatedConsignee: '', | 229 | designatedConsignee: '', |
| 237 | specialTerms: '', | 230 | specialTerms: '', |
| 238 | specialTermsName: '', | 231 | specialTermsName: '', |
| @@ -263,9 +256,9 @@ export default { | @@ -263,9 +256,9 @@ export default { | ||
| 263 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], | 256 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], |
| 264 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, | 257 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, |
| 265 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, | 258 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, |
| 266 | - sumQuantity: 0, | ||
| 267 | - sumAmountExcl: 0, | ||
| 268 | - sumTotal: 0, | 259 | + totalQuantity: 0, |
| 260 | + totalAmountExcludingTax: 0, | ||
| 261 | + totalAmountIncludingTax: 0, | ||
| 269 | productLineList: [], | 262 | productLineList: [], |
| 270 | productList: [], | 263 | productList: [], |
| 271 | customerRemarks: [], | 264 | customerRemarks: [], |
| @@ -368,9 +361,9 @@ export default { | @@ -368,9 +361,9 @@ export default { | ||
| 368 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) | 361 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) |
| 369 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) | 362 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) |
| 370 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) | 363 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) |
| 371 | - this.sumQuantity = sumQ | ||
| 372 | - this.sumAmountExcl = sumE | ||
| 373 | - this.sumTotal = sumT | 364 | + this.totalQuantity = sumQ |
| 365 | + this.totalAmountExcludingTax = sumE | ||
| 366 | + this.totalAmountIncludingTax = sumT | ||
| 374 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) | 367 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) |
| 375 | this.productLineList = list | 368 | this.productLineList = list |
| 376 | }, | 369 | }, |
| @@ -446,6 +439,10 @@ export default { | @@ -446,6 +439,10 @@ export default { | ||
| 446 | setSheet('生产厂', opts) | 439 | setSheet('生产厂', opts) |
| 447 | } else if (field === 'supplier') { | 440 | } else if (field === 'supplier') { |
| 448 | setSheet('供方', this.supplierList) | 441 | setSheet('供方', this.supplierList) |
| 442 | + } else if (field === 'specialTerms') { | ||
| 443 | + setSheet('特别条款要求', this.specialTermsList) | ||
| 444 | + } else if (field === 'executionStandard') { | ||
| 445 | + setSheet('执行标准', this.executionStandardList) | ||
| 449 | } else if (field === 'includesPackagingFee') { | 446 | } else if (field === 'includesPackagingFee') { |
| 450 | setSheet('单价中是否已包含包装费', this.yesNoList) | 447 | setSheet('单价中是否已包含包装费', this.yesNoList) |
| 451 | } else if (field === 'includesTransportFee') { | 448 | } else if (field === 'includesTransportFee') { |
| @@ -516,9 +513,9 @@ export default { | @@ -516,9 +513,9 @@ export default { | ||
| 516 | ...formForSubmit, | 513 | ...formForSubmit, |
| 517 | destination, | 514 | destination, |
| 518 | type: 'INTL_OPEN_SPEC_AGMT', | 515 | type: 'INTL_OPEN_SPEC_AGMT', |
| 519 | - sumQuantity: this.sumQuantity, | ||
| 520 | - sumAmountExcl: this.sumAmountExcl, | ||
| 521 | - sumTotal: this.sumTotal, | 516 | + totalQuantity: this.totalQuantity, |
| 517 | + totalAmountExcludingTax: this.totalAmountExcludingTax, | ||
| 518 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | ||
| 522 | contractDistributorLineList: lines | 519 | contractDistributorLineList: lines |
| 523 | }) | 520 | }) |
| 524 | console.log('onSubmit__payload', payload) | 521 | console.log('onSubmit__payload', payload) |
| @@ -537,18 +534,31 @@ export default { | @@ -537,18 +534,31 @@ export default { | ||
| 537 | { key: 'supplier', label: '供方' }, | 534 | { key: 'supplier', label: '供方' }, |
| 538 | { key: 'buyer', label: '需方' }, | 535 | { key: 'buyer', label: '需方' }, |
| 539 | { key: 'orderDate', label: '订货日期' }, | 536 | { key: 'orderDate', label: '订货日期' }, |
| 537 | + { key: 'unit', label: '单位' }, | ||
| 540 | { key: 'workshopId', label: '生产厂' }, | 538 | { key: 'workshopId', label: '生产厂' }, |
| 539 | + { key: 'specialTerms', label: '特别条款要求' }, | ||
| 541 | ] | 540 | ] |
| 542 | for (const it of checks) { | 541 | for (const it of checks) { |
| 543 | const val = this.form[it.key] | 542 | const val = this.form[it.key] |
| 544 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) | 543 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) |
| 545 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } | 544 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } |
| 546 | } | 545 | } |
| 547 | - if (!Array.isArray(this.productLineList) || this.productLineList.length === 0) { | 546 | + const list = Array.isArray(this.productLineList) ? this.productLineList : [] |
| 547 | + if (list.length === 0) { | ||
| 548 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false | 548 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false |
| 549 | } | 549 | } |
| 550 | - for (const [idx, it] of this.productLineList.entries()) { | ||
| 551 | - if (!it.productName || !it.quantity || !it.unitPrice) { | 550 | + const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === '')) |
| 551 | + const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v))) | ||
| 552 | + for (const [idx, it] of list.entries()) { | ||
| 553 | + if ( | ||
| 554 | + strEmpty(it.productName) || | ||
| 555 | + strEmpty(it.industry) || | ||
| 556 | + strEmpty(it.quality) || | ||
| 557 | + strEmpty(it.brand) || | ||
| 558 | + numEmpty(it.quantity) || | ||
| 559 | + numEmpty(it.unitPrice) || | ||
| 560 | + strEmpty(it.deliveryDate) | ||
| 561 | + ) { | ||
| 552 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false | 562 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false |
| 553 | } | 563 | } |
| 554 | } | 564 | } |
| @@ -576,7 +586,7 @@ export default { | @@ -576,7 +586,7 @@ export default { | ||
| 576 | color: rgba(0, 0, 0, 0.6); | 586 | color: rgba(0, 0, 0, 0.6); |
| 577 | line-height: 32rpx; | 587 | line-height: 32rpx; |
| 578 | width: 240rpx; | 588 | width: 240rpx; |
| 579 | - padding: 24rpx 0; | 589 | + padding: 12rpx 0; |
| 580 | } | 590 | } |
| 581 | .total-item-price { | 591 | .total-item-price { |
| 582 | font-weight: 600; | 592 | font-weight: 600; |
| @@ -598,7 +608,7 @@ export default { | @@ -598,7 +608,7 @@ export default { | ||
| 598 | 608 | ||
| 599 | .scroll { | 609 | .scroll { |
| 600 | flex: 1; | 610 | flex: 1; |
| 601 | - padding: 12rpx 0 480rpx !important; | 611 | + padding: 12rpx 0 392rpx !important; |
| 602 | } | 612 | } |
| 603 | 613 | ||
| 604 | .footer { | 614 | .footer { |
| @@ -53,7 +53,7 @@ | @@ -53,7 +53,7 @@ | ||
| 53 | }}</text></view> | 53 | }}</text></view> |
| 54 | </view> | 54 | </view> |
| 55 | 55 | ||
| 56 | - <view class="section"> | 56 | + <view class="section" v-if="detail.status === 'STANDARD'"> |
| 57 | <view class="row"><text class="label">规范性合同</text><text class="value" style="color: #3D48A3;">{{ | 57 | <view class="row"><text class="label">规范性合同</text><text class="value" style="color: #3D48A3;">{{ |
| 58 | detail.standardFileName || '-' | 58 | detail.standardFileName || '-' |
| 59 | }}</text></view> | 59 | }}</text></view> |
| @@ -61,7 +61,7 @@ | @@ -61,7 +61,7 @@ | ||
| 61 | detail.standardStandardized ? '是' : '否' | 61 | detail.standardStandardized ? '是' : '否' |
| 62 | }}</text></view> | 62 | }}</text></view> |
| 63 | </view> | 63 | </view> |
| 64 | - <view class="section" v-if="status === 'FORMAL'"> | 64 | + <view class="section" v-if="detail.status === 'FORMAL'"> |
| 65 | <view class="row"><text class="label">规范性合同</text><text class="value" style="color: #3D48A3;">{{ | 65 | <view class="row"><text class="label">规范性合同</text><text class="value" style="color: #3D48A3;">{{ |
| 66 | detail.formalFileName || '-' }}</text></view> | 66 | detail.formalFileName || '-' }}</text></view> |
| 67 | <view class="row"><text class="label">合同是否规范</text><text class="value">{{ detail.formalStandardized | 67 | <view class="row"><text class="label">合同是否规范</text><text class="value">{{ detail.formalStandardized |
| @@ -61,7 +61,9 @@ | @@ -61,7 +61,9 @@ | ||
| 61 | <text>订单总额</text><text class="amount" :style="{ color: '#b67a76' }">{{ item.totalAmountIncludingTax ? '¥' : '' }}{{ formatAmount(item.totalAmountIncludingTax) || '-' }}</text> | 61 | <text>订单总额</text><text class="amount" :style="{ color: '#b67a76' }">{{ item.totalAmountIncludingTax ? '¥' : '' }}{{ formatAmount(item.totalAmountIncludingTax) || '-' }}</text> |
| 62 | </view> | 62 | </view> |
| 63 | <view class="info-row" v-if="item.status === 'STANDARD' || item.status === 'FORMAL'"> | 63 | <view class="info-row" v-if="item.status === 'STANDARD' || item.status === 'FORMAL'"> |
| 64 | - <text>{{ item.status === 'STANDARD' ? '标准合同' : '正式合同' }}规范性审核状态</text><span class="info-status" :style="item.standardApprovedName ? getStatusCss(item.standardApprovedName) : ''">{{ item.standardApprovedName || '-' }}</span> | 64 | + <text>{{ item.status === 'STANDARD' ? '标准合同' : '正式合同' }}规范性审核状态</text> |
| 65 | + <span v-if="item.status === 'STANDARD' ? item.standardApprovedName : item.formalApprovedName" class="info-status" :style="getStatusCss(item.status === 'STANDARD' ? item.standardApprovedName : item.formalApprovedName)">{{ item.status === 'STANDARD' ? item.standardApprovedName : item.formalApprovedName }}</span> | ||
| 66 | + <span v-else>-</span> | ||
| 65 | </view> | 67 | </view> |
| 66 | <view class="info-row"> | 68 | <view class="info-row"> |
| 67 | <text>订货日期</text><text>{{ item.orderDate }}</text> | 69 | <text>订货日期</text><text>{{ item.orderDate }}</text> |
| @@ -107,7 +107,7 @@ | @@ -107,7 +107,7 @@ | ||
| 107 | 数量 | 107 | 数量 |
| 108 | </div> | 108 | </div> |
| 109 | <div class="total-item-price"> | 109 | <div class="total-item-price"> |
| 110 | - {{ (sumQuantity || 0).toFixed(2) }}t | 110 | + {{ (totalQuantity || 0).toFixed(2) }}kg |
| 111 | </div> | 111 | </div> |
| 112 | </div> | 112 | </div> |
| 113 | <div class="total-item"> | 113 | <div class="total-item"> |
| @@ -115,7 +115,7 @@ | @@ -115,7 +115,7 @@ | ||
| 115 | 不含税金额 | 115 | 不含税金额 |
| 116 | </div> | 116 | </div> |
| 117 | <div class="total-item-price text-red"> | 117 | <div class="total-item-price text-red"> |
| 118 | - ¥{{ (sumAmountExcl || 0).toFixed(2) }} | 118 | + ¥{{ (totalAmountExcludingTax || 0).toFixed(2) }} |
| 119 | </div> | 119 | </div> |
| 120 | </div> | 120 | </div> |
| 121 | <div class="total-item"> | 121 | <div class="total-item"> |
| @@ -123,7 +123,7 @@ | @@ -123,7 +123,7 @@ | ||
| 123 | 总金额 | 123 | 总金额 |
| 124 | </div> | 124 | </div> |
| 125 | <div class="total-item-price text-red"> | 125 | <div class="total-item-price text-red"> |
| 126 | - ¥{{ (sumTotal || 0).toFixed(2) }} | 126 | + ¥{{ (totalAmountIncludingTax || 0).toFixed(2) }} |
| 127 | </div> | 127 | </div> |
| 128 | </div> | 128 | </div> |
| 129 | </div> | 129 | </div> |
| @@ -146,15 +146,15 @@ export default { | @@ -146,15 +146,15 @@ export default { | ||
| 146 | } | 146 | } |
| 147 | }, | 147 | }, |
| 148 | computed: { | 148 | computed: { |
| 149 | - sumQuantity() { | 149 | + totalQuantity() { |
| 150 | const qty = this.items.filter(it => it.locked).reduce((p, c) => p + this.toNumber(c.quantity), 0) | 150 | const qty = this.items.filter(it => it.locked).reduce((p, c) => p + this.toNumber(c.quantity), 0) |
| 151 | return this.round(qty, 2) | 151 | return this.round(qty, 2) |
| 152 | }, | 152 | }, |
| 153 | - sumAmountExcl() { | 153 | + totalAmountExcludingTax() { |
| 154 | const sum = this.items.filter(it => it.locked).reduce((p, c) => p + this.toNumber(c.amountExcludingTax), 0) | 154 | const sum = this.items.filter(it => it.locked).reduce((p, c) => p + this.toNumber(c.amountExcludingTax), 0) |
| 155 | return this.round(sum, 2) | 155 | return this.round(sum, 2) |
| 156 | }, | 156 | }, |
| 157 | - sumTotal() { return this.totalAmount }, | 157 | + totalAmountIncludingTax() { return this.totalAmount }, |
| 158 | totalAmount() { | 158 | totalAmount() { |
| 159 | let sum = 0 | 159 | let sum = 0 |
| 160 | for (const it of this.items) { | 160 | for (const it of this.items) { |
| @@ -325,9 +325,9 @@ export default { | @@ -325,9 +325,9 @@ export default { | ||
| 325 | const payload = { | 325 | const payload = { |
| 326 | id: this.id, | 326 | id: this.id, |
| 327 | totalAmountCapital: formatCurrencyToChinese(this.sumTotal), | 327 | totalAmountCapital: formatCurrencyToChinese(this.sumTotal), |
| 328 | - totalAmountExcludingTax: this.sumAmountExcl, | ||
| 329 | - totalAmountIncludingTax: this.sumTotal, | ||
| 330 | - totalQuantity: this.sumQuantity, | 328 | + totalAmountExcludingTax: this.totalAmountExcludingTax, |
| 329 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | ||
| 330 | + totalQuantity: this.totalQuantity, | ||
| 331 | type:'INTL_OPEN_SPEC_AGMT', | 331 | type:'INTL_OPEN_SPEC_AGMT', |
| 332 | contractDistributorLineList: selected | 332 | contractDistributorLineList: selected |
| 333 | } | 333 | } |
| @@ -362,7 +362,7 @@ export default { | @@ -362,7 +362,7 @@ export default { | ||
| 362 | 362 | ||
| 363 | .scroll { | 363 | .scroll { |
| 364 | flex: 1; | 364 | flex: 1; |
| 365 | - padding: 12rpx 0 480rpx !important; | 365 | + padding: 12rpx 0 392rpx !important; |
| 366 | } | 366 | } |
| 367 | 367 | ||
| 368 | .header { | 368 | .header { |
| @@ -646,7 +646,7 @@ export default { | @@ -646,7 +646,7 @@ export default { | ||
| 646 | color: rgba(0, 0, 0, 0.6); | 646 | color: rgba(0, 0, 0, 0.6); |
| 647 | line-height: 32rpx; | 647 | line-height: 32rpx; |
| 648 | width: 240rpx; | 648 | width: 240rpx; |
| 649 | - padding: 24rpx 0; | 649 | + padding: 12rpx 0; |
| 650 | } | 650 | } |
| 651 | 651 | ||
| 652 | .total-item-price { | 652 | .total-item-price { |
| @@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
| 41 | </template> | 41 | </template> |
| 42 | </uni-list-item> | 42 | </uni-list-item> |
| 43 | 43 | ||
| 44 | - <ProductRel mode="add" :orderDateBase="form.orderDate" :list="productLineList" @change="onProductsChange" :options="productList" /> | 44 | + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" /> |
| 45 | 45 | ||
| 46 | <uni-list-item title="合计人民币金额(大写)"> | 46 | <uni-list-item title="合计人民币金额(大写)"> |
| 47 | <template v-slot:footer> | 47 | <template v-slot:footer> |
| @@ -98,34 +98,25 @@ | @@ -98,34 +98,25 @@ | ||
| 98 | :inputBorder="false" /> | 98 | :inputBorder="false" /> |
| 99 | </template> | 99 | </template> |
| 100 | </uni-list-item> | 100 | </uni-list-item> |
| 101 | - | ||
| 102 | - <view class="group"> | ||
| 103 | - <view class="group-title">特别条款要求</view> | ||
| 104 | - <view class="radio-list"> | ||
| 105 | - <view v-for="(opt, i) in specialTermsList" :key="'cr-' + i" class="radio-item" | ||
| 106 | - @click="onRadioSelect('specialTerms', 'specialTermsName', opt)"> | ||
| 107 | - <view :class="['radio', { checked: form.specialTerms === opt.value }]" /> | ||
| 108 | - <text class="label">{{ opt.label }}</text> | ||
| 109 | - </view> | ||
| 110 | - </view> | ||
| 111 | - </view> | ||
| 112 | - <view class="group"> | ||
| 113 | - <view class="group-title">执行标准</view> | ||
| 114 | - <view class="radio-list"> | ||
| 115 | - <view v-for="(opt, i) in executionStandardList" :key="'es-' + i" class="radio-item" | ||
| 116 | - @click="onRadioSelect('executionStandard', 'executionStandardName', opt)"> | ||
| 117 | - <view :class="['radio', { checked: form.executionStandard === opt.value }]" /> | ||
| 118 | - <text class="label">{{ opt.label }}</text> | ||
| 119 | - </view> | ||
| 120 | - </view> | ||
| 121 | - </view> | 101 | + <uni-list-item class="select-item" :class="form.specialTermsName ? 'is-filled' : 'is-empty'" clickable |
| 102 | + @click="openSheet('specialTerms')" :rightText="form.specialTermsName || '请选择'" showArrow> | ||
| 103 | + <template v-slot:body> | ||
| 104 | + <view class="item-title"><text class="required">*</text><text>特别条款要求</text></view> | ||
| 105 | + </template> | ||
| 106 | + </uni-list-item> | ||
| 107 | + <uni-list-item class="select-item" :class="form.executionStandardName ? 'is-filled' : 'is-empty'" clickable | ||
| 108 | + @click="openSheet('executionStandard')" :rightText="form.executionStandardName || '请选择'" showArrow> | ||
| 109 | + <template v-slot:body> | ||
| 110 | + <view class="item-title"><text>执行标准</text></view> | ||
| 111 | + </template> | ||
| 112 | + </uni-list-item> | ||
| 122 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> | 113 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> |
| 123 | <template v-slot:footer> | 114 | <template v-slot:footer> |
| 124 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" | 115 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" |
| 125 | :inputBorder="false" /> | 116 | :inputBorder="false" /> |
| 126 | </template> | 117 | </template> |
| 127 | </uni-list-item> | 118 | </uni-list-item> |
| 128 | - <uni-list-item title="特别说明"> | 119 | + <uni-list-item title="特别说明" style="margin-top: 20rpx;"> |
| 129 | <template v-slot:footer> | 120 | <template v-slot:footer> |
| 130 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> | 121 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> |
| 131 | </template> | 122 | </template> |
| @@ -177,15 +168,15 @@ | @@ -177,15 +168,15 @@ | ||
| 177 | <div class="total-text">合计</div> | 168 | <div class="total-text">合计</div> |
| 178 | <div class="total-item"> | 169 | <div class="total-item"> |
| 179 | <div class="total-item-text">数量</div> | 170 | <div class="total-item-text">数量</div> |
| 180 | - <div class="total-item-price">{{ (sumQuantity || 0).toFixed(2) }}t</div> | 171 | + <div class="total-item-price">{{ (totalQuantity || 0).toFixed(2) }}kg</div> |
| 181 | </div> | 172 | </div> |
| 182 | <div class="total-item"> | 173 | <div class="total-item"> |
| 183 | <div class="total-item-text">不含税金额</div> | 174 | <div class="total-item-text">不含税金额</div> |
| 184 | - <div class="total-item-price text-red">¥{{ (sumAmountExcl || 0).toFixed(2) }}</div> | 175 | + <div class="total-item-price text-red">¥{{ (totalAmountExcludingTax || 0).toFixed(2) }}</div> |
| 185 | </div> | 176 | </div> |
| 186 | <div class="total-item"> | 177 | <div class="total-item"> |
| 187 | <div class="total-item-text">总金额</div> | 178 | <div class="total-item-text">总金额</div> |
| 188 | - <div class="total-item-price text-red">¥{{ (sumTotal || 0).toFixed(2) }}</div> | 179 | + <div class="total-item-price text-red">¥{{ (totalAmountIncludingTax || 0).toFixed(2) }}</div> |
| 189 | </div> | 180 | </div> |
| 190 | </div> | 181 | </div> |
| 191 | <button class="btn submit" type="primary" @click="onSubmit">保存</button> | 182 | <button class="btn submit" type="primary" @click="onSubmit">保存</button> |
| @@ -223,6 +214,7 @@ export default { | @@ -223,6 +214,7 @@ export default { | ||
| 223 | workshopId: '', | 214 | workshopId: '', |
| 224 | workshopName: '', | 215 | workshopName: '', |
| 225 | orderDate: '', | 216 | orderDate: '', |
| 217 | + deliveryDate: '', | ||
| 226 | designatedConsignee: '', | 218 | designatedConsignee: '', |
| 227 | specialTerms: '', | 219 | specialTerms: '', |
| 228 | specialTermsName: '', | 220 | specialTermsName: '', |
| @@ -256,9 +248,9 @@ export default { | @@ -256,9 +248,9 @@ export default { | ||
| 256 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], | 248 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], |
| 257 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, | 249 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, |
| 258 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, | 250 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, |
| 259 | - sumQuantity: 0, | ||
| 260 | - sumAmountExcl: 0, | ||
| 261 | - sumTotal: 0, | 251 | + totalQuantity: 0, |
| 252 | + totalAmountExcludingTax: 0, | ||
| 253 | + totalAmountIncludingTax: 0, | ||
| 262 | productLineList: [], | 254 | productLineList: [], |
| 263 | newProductLineList: [], | 255 | newProductLineList: [], |
| 264 | productList: [] | 256 | productList: [] |
| @@ -349,9 +341,9 @@ export default { | @@ -349,9 +341,9 @@ export default { | ||
| 349 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) | 341 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) |
| 350 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) | 342 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) |
| 351 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) | 343 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) |
| 352 | - this.sumQuantity = sumQ | ||
| 353 | - this.sumAmountExcl = sumE | ||
| 354 | - this.sumTotal = sumT | 344 | + this.totalQuantity = sumQ |
| 345 | + this.totalAmountExcludingTax = sumE | ||
| 346 | + this.totalAmountIncludingTax = sumT | ||
| 355 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) | 347 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) |
| 356 | }, | 348 | }, |
| 357 | async loadSuppliers() { | 349 | async loadSuppliers() { |
| @@ -399,6 +391,10 @@ export default { | @@ -399,6 +391,10 @@ export default { | ||
| 399 | setSheet('生产厂', opts) | 391 | setSheet('生产厂', opts) |
| 400 | } else if (field === 'supplier') { | 392 | } else if (field === 'supplier') { |
| 401 | setSheet('供方', this.supplierList) | 393 | setSheet('供方', this.supplierList) |
| 394 | + } else if (field === 'specialTerms') { | ||
| 395 | + setSheet('特别条款要求', this.specialTermsList) | ||
| 396 | + } else if (field === 'executionStandard') { | ||
| 397 | + setSheet('执行标准', this.executionStandardList) | ||
| 402 | } else if (field === 'includesPackagingFee') { | 398 | } else if (field === 'includesPackagingFee') { |
| 403 | setSheet('单价中是否已包含包装费', this.yesNoList) | 399 | setSheet('单价中是否已包含包装费', this.yesNoList) |
| 404 | } else if (field === 'includesTransportFee') { | 400 | } else if (field === 'includesTransportFee') { |
| @@ -443,18 +439,31 @@ export default { | @@ -443,18 +439,31 @@ export default { | ||
| 443 | { key: 'supplier', label: '供方' }, | 439 | { key: 'supplier', label: '供方' }, |
| 444 | { key: 'buyer', label: '需方' }, | 440 | { key: 'buyer', label: '需方' }, |
| 445 | { key: 'orderDate', label: '订货日期' }, | 441 | { key: 'orderDate', label: '订货日期' }, |
| 442 | + { key: 'unit', label: '单位' }, | ||
| 446 | { key: 'workshopId', label: '生产厂' }, | 443 | { key: 'workshopId', label: '生产厂' }, |
| 444 | + { key: 'specialTerms', label: '特别条款要求' }, | ||
| 447 | ] | 445 | ] |
| 448 | for (const it of checks) { | 446 | for (const it of checks) { |
| 449 | const val = this.form[it.key] | 447 | const val = this.form[it.key] |
| 450 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) | 448 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) |
| 451 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } | 449 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } |
| 452 | } | 450 | } |
| 453 | - if (!Array.isArray(this.productLineList) || this.productLineList.length === 0) { | 451 | + const list = Array.isArray(this.newProductLineList) ? this.newProductLineList : [] |
| 452 | + if (list.length === 0) { | ||
| 454 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false | 453 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false |
| 455 | } | 454 | } |
| 456 | - for (const [idx, it] of this.productLineList.entries()) { | ||
| 457 | - if (!it.productName || !it.quantity || !it.unitPrice) { | 455 | + const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === '')) |
| 456 | + const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v))) | ||
| 457 | + for (const [idx, it] of list.entries()) { | ||
| 458 | + if ( | ||
| 459 | + strEmpty(it.productName) || | ||
| 460 | + strEmpty(it.industry) || | ||
| 461 | + strEmpty(it.quality) || | ||
| 462 | + strEmpty(it.brand) || | ||
| 463 | + numEmpty(it.quantity) || | ||
| 464 | + strEmpty(it.unitPrice) || | ||
| 465 | + strEmpty(it.deliveryDate) | ||
| 466 | + ) { | ||
| 458 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false | 467 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false |
| 459 | } | 468 | } |
| 460 | } | 469 | } |
| @@ -486,9 +495,9 @@ export default { | @@ -486,9 +495,9 @@ export default { | ||
| 486 | id: this.form.id, | 495 | id: this.form.id, |
| 487 | destination, | 496 | destination, |
| 488 | type: 'INTL_OPEN_SPEC_AGMT', | 497 | type: 'INTL_OPEN_SPEC_AGMT', |
| 489 | - sumQuantity: this.sumQuantity, | ||
| 490 | - sumAmountExcl: this.sumAmountExcl, | ||
| 491 | - sumTotal: this.sumTotal, | 498 | + totalQuantity: this.totalQuantity, |
| 499 | + totalAmountExcludingTax: this.totalAmountExcludingTax, | ||
| 500 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | ||
| 492 | contractDistributorLineList: lines | 501 | contractDistributorLineList: lines |
| 493 | }) | 502 | }) |
| 494 | try { | 503 | try { |
| @@ -524,7 +533,7 @@ export default { | @@ -524,7 +533,7 @@ export default { | ||
| 524 | color: rgba(0, 0, 0, 0.6); | 533 | color: rgba(0, 0, 0, 0.6); |
| 525 | line-height: 32rpx; | 534 | line-height: 32rpx; |
| 526 | width: 240rpx; | 535 | width: 240rpx; |
| 527 | - padding: 24rpx 0; | 536 | + padding: 12rpx 0; |
| 528 | } | 537 | } |
| 529 | 538 | ||
| 530 | .total-item-price { | 539 | .total-item-price { |
| @@ -547,7 +556,7 @@ export default { | @@ -547,7 +556,7 @@ export default { | ||
| 547 | 556 | ||
| 548 | .scroll { | 557 | .scroll { |
| 549 | flex: 1; | 558 | flex: 1; |
| 550 | - padding: 12rpx 0 480rpx !important; | 559 | + padding: 12rpx 0 392rpx !important; |
| 551 | } | 560 | } |
| 552 | 561 | ||
| 553 | .footer { | 562 | .footer { |
| @@ -55,51 +55,51 @@ | @@ -55,51 +55,51 @@ | ||
| 55 | </uni-list-item> | 55 | </uni-list-item> |
| 56 | <uni-list-item title="厚度"> | 56 | <uni-list-item title="厚度"> |
| 57 | <template v-slot:footer> | 57 | <template v-slot:footer> |
| 58 | - <uni-easyinput v-model="item.thickness" :inputBorder="false" placeholder="请输入厚度" /> | 58 | + <uni-easyinput type="digit" v-model="item.thickness" :inputBorder="false" placeholder="请输入厚度" @input="onNonNegativeInput(idx, 'thickness')" @blur="onNonNegativeBlur(idx, 'thickness', 2)" /> |
| 59 | </template> | 59 | </template> |
| 60 | </uni-list-item> | 60 | </uni-list-item> |
| 61 | <uni-list-item title="厚度公差(单项+)"> | 61 | <uni-list-item title="厚度公差(单项+)"> |
| 62 | <template v-slot:footer> | 62 | <template v-slot:footer> |
| 63 | - <uni-easyinput v-model="item.thicknessTolPos" :inputBorder="false" | ||
| 64 | - placeholder="请输入厚度公差(单项+)" /> | 63 | + <uni-easyinput type="digit" v-model="item.thicknessTolPos" :inputBorder="false" |
| 64 | + placeholder="请输入厚度公差(单项+)" @input="onNonNegativeInput(idx, 'thicknessTolPos')" @blur="onNonNegativeBlur(idx, 'thicknessTolPos', 2)" /> | ||
| 65 | </template> | 65 | </template> |
| 66 | </uni-list-item> | 66 | </uni-list-item> |
| 67 | <uni-list-item title="厚度公差(单项-)"> | 67 | <uni-list-item title="厚度公差(单项-)"> |
| 68 | <template v-slot:footer> | 68 | <template v-slot:footer> |
| 69 | - <uni-easyinput v-model="item.thicknessTolNeg" :inputBorder="false" | ||
| 70 | - placeholder="请输入厚度公差(单项-)" /> | 69 | + <uni-easyinput type="digit" v-model="item.thicknessTolNeg" :inputBorder="false" |
| 70 | + placeholder="请输入厚度公差(单项-)" @input="onNonNegativeInput(idx, 'thicknessTolNeg')" @blur="onNonNegativeBlur(idx, 'thicknessTolNeg', 2)" /> | ||
| 71 | </template> | 71 | </template> |
| 72 | </uni-list-item> | 72 | </uni-list-item> |
| 73 | <uni-list-item title="宽度"> | 73 | <uni-list-item title="宽度"> |
| 74 | <template v-slot:footer> | 74 | <template v-slot:footer> |
| 75 | - <uni-easyinput v-model="item.width" :inputBorder="false" placeholder="请输入宽度" /> | 75 | + <uni-easyinput type="digit" v-model="item.width" :inputBorder="false" placeholder="请输入宽度" @input="onNonNegativeInput(idx, 'width')" @blur="onNonNegativeBlur(idx, 'width', 2)" /> |
| 76 | </template> | 76 | </template> |
| 77 | </uni-list-item> | 77 | </uni-list-item> |
| 78 | <uni-list-item title="宽度公差(单项+)"> | 78 | <uni-list-item title="宽度公差(单项+)"> |
| 79 | <template v-slot:footer> | 79 | <template v-slot:footer> |
| 80 | - <uni-easyinput v-model="item.widthTolPos" :inputBorder="false" placeholder="请输入宽度公差(单项+)" /> | 80 | + <uni-easyinput type="digit" v-model="item.widthTolPos" :inputBorder="false" placeholder="请输入宽度公差(单项+)" @input="onNonNegativeInput(idx, 'widthTolPos')" @blur="onNonNegativeBlur(idx, 'widthTolPos', 2)" /> |
| 81 | </template> | 81 | </template> |
| 82 | </uni-list-item> | 82 | </uni-list-item> |
| 83 | <uni-list-item title="宽度公差(单项-)"> | 83 | <uni-list-item title="宽度公差(单项-)"> |
| 84 | <template v-slot:footer> | 84 | <template v-slot:footer> |
| 85 | - <uni-easyinput v-model="item.widthTolNeg" :inputBorder="false" placeholder="请输入宽度公差(单项-)" /> | 85 | + <uni-easyinput type="digit" v-model="item.widthTolNeg" :inputBorder="false" placeholder="请输入宽度公差(单项-)" @input="onNonNegativeInput(idx, 'widthTolNeg')" @blur="onNonNegativeBlur(idx, 'widthTolNeg', 2)" /> |
| 86 | </template> | 86 | </template> |
| 87 | </uni-list-item> | 87 | </uni-list-item> |
| 88 | <uni-list-item title="长度"> | 88 | <uni-list-item title="长度"> |
| 89 | <template v-slot:footer> | 89 | <template v-slot:footer> |
| 90 | - <uni-easyinput v-model="item.length" :inputBorder="false" placeholder="请输入长度" /> | 90 | + <uni-easyinput type="digit" v-model="item.length" :inputBorder="false" placeholder="请输入长度" @input="onNonNegativeInput(idx, 'length')" @blur="onNonNegativeBlur(idx, 'length', 2)" /> |
| 91 | </template> | 91 | </template> |
| 92 | </uni-list-item> | 92 | </uni-list-item> |
| 93 | <uni-list-item title="长度公差(单项+)"> | 93 | <uni-list-item title="长度公差(单项+)"> |
| 94 | <template v-slot:footer> | 94 | <template v-slot:footer> |
| 95 | - <uni-easyinput v-model="item.lengthTolPos" :inputBorder="false" | ||
| 96 | - placeholder="请输入长度公差(单项+)" /> | 95 | + <uni-easyinput type="digit" v-model="item.lengthTolPos" :inputBorder="false" |
| 96 | + placeholder="请输入长度公差(单项+)" @input="onNonNegativeInput(idx, 'lengthTolPos')" @blur="onNonNegativeBlur(idx, 'lengthTolPos', 2)" /> | ||
| 97 | </template> | 97 | </template> |
| 98 | </uni-list-item> | 98 | </uni-list-item> |
| 99 | <uni-list-item title="长度公差(单项-)"> | 99 | <uni-list-item title="长度公差(单项-)"> |
| 100 | <template v-slot:footer> | 100 | <template v-slot:footer> |
| 101 | - <uni-easyinput v-model="item.lengthTolNeg" :inputBorder="false" | ||
| 102 | - placeholder="请输入长度公差(单项-)" /> | 101 | + <uni-easyinput type="digit" v-model="item.lengthTolNeg" :inputBorder="false" |
| 102 | + placeholder="请输入长度公差(单项-)" @input="onNonNegativeInput(idx, 'lengthTolNeg')" @blur="onNonNegativeBlur(idx, 'lengthTolNeg', 2)" /> | ||
| 103 | </template> | 103 | </template> |
| 104 | </uni-list-item> | 104 | </uni-list-item> |
| 105 | <uni-list-item title="状态"> | 105 | <uni-list-item title="状态"> |
| @@ -109,12 +109,17 @@ | @@ -109,12 +109,17 @@ | ||
| 109 | </uni-list-item> | 109 | </uni-list-item> |
| 110 | <uni-list-item title="数量"> | 110 | <uni-list-item title="数量"> |
| 111 | <template v-slot:footer> | 111 | <template v-slot:footer> |
| 112 | - <uni-easyinput v-model="item.quantity" type="number" :inputBorder="false" placeholder="请输入数量" @input="onImmediateChange(idx)" @blur="onNumberBlur(idx, 'quantity', 0)" /> | 112 | + <uni-easyinput v-model="item.quantity" type="digit" :inputBorder="false" placeholder="请输入数量kg" @input="onNonNegativeInput(idx, 'quantity')" @blur="onNonNegativeBlur(idx, 'quantity', 2)" /> |
| 113 | </template> | 113 | </template> |
| 114 | </uni-list-item> | 114 | </uni-list-item> |
| 115 | <uni-list-item title="单价"> | 115 | <uni-list-item title="单价"> |
| 116 | <template v-slot:footer> | 116 | <template v-slot:footer> |
| 117 | - <uni-easyinput v-model="item.unitPrice" type="number" :inputBorder="false" placeholder="请输入单价" @input="onImmediateChange(idx)" @blur="onNumberBlur(idx, 'unitPrice', 0)" /> | 117 | + <uni-easyinput v-model="item.unitPrice" type="digit" :inputBorder="false" placeholder="请输入销售价格" @input="onNonNegativeInput(idx, 'unitPrice')" @blur="onNonNegativeBlur(idx, 'unitPrice', 2)" /> |
| 118 | + </template> | ||
| 119 | + </uni-list-item> | ||
| 120 | + <uni-list-item title="外贸加工费"> | ||
| 121 | + <template v-slot:footer> | ||
| 122 | + <uni-easyinput v-model="item.processingFee" type="number" :inputBorder="false" placeholder="请输入外贸加工费" /> | ||
| 118 | </template> | 123 | </template> |
| 119 | </uni-list-item> | 124 | </uni-list-item> |
| 120 | <uni-list-item title="不含税金额"> | 125 | <uni-list-item title="不含税金额"> |
| @@ -129,7 +134,7 @@ | @@ -129,7 +134,7 @@ | ||
| 129 | </uni-list-item> | 134 | </uni-list-item> |
| 130 | <uni-list-item title="发货日期"> | 135 | <uni-list-item title="发货日期"> |
| 131 | <template v-slot:footer> | 136 | <template v-slot:footer> |
| 132 | - <uni-datetime-picker type="date" v-model="item.orderDate" @change="onDateChange(idx, $event)" /> | 137 | + <uni-datetime-picker type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" /> |
| 133 | </template> | 138 | </template> |
| 134 | </uni-list-item> | 139 | </uni-list-item> |
| 135 | </uni-list> | 140 | </uni-list> |
| @@ -151,7 +156,30 @@ | @@ -151,7 +156,30 @@ | ||
| 151 | <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view> | 156 | <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view> |
| 152 | <view class="row"><text class="label">牌号</text><text class="value">{{ item.brand }}</text></view> | 157 | <view class="row"><text class="label">牌号</text><text class="value">{{ item.brand }}</text></view> |
| 153 | <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view> | 158 | <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view> |
| 154 | - <view class="row"><text class="label">规格</text><text class="value">{{ item.specDisplay }}</text></view> | 159 | + <!-- 厚(公差) * 宽(公差) * 长(公差) --> |
| 160 | + <view class="row row-spec"><text class="label">规格(mm)</text> | ||
| 161 | + <view class="value value-spec"> | ||
| 162 | + <view v-if="item.thickness" class="value-spec_val">{{ item.thickness }}</view> | ||
| 163 | + <view v-if="item.thickness" class="value-spec_box"> | ||
| 164 | + <view v-if="item.thicknessTolPos" class="value-spec_box_1">+{{ item.thicknessTolPos }} | ||
| 165 | + </view> | ||
| 166 | + <view v-if="item.thicknessTolNeg" class="value-spec_box_2">-{{ item.thicknessTolNeg }} | ||
| 167 | + </view> | ||
| 168 | + </view> | ||
| 169 | + <view v-if="item.width" class="value-spec_val p12">*</view> | ||
| 170 | + <view v-if="item.width" class="value-spec_val">{{ item.width }}</view> | ||
| 171 | + <view v-if="item.width" class="value-spec_box"> | ||
| 172 | + <view v-if="item.widthTolPos" class="value-spec_box_1">+{{ item.widthTolPos }}</view> | ||
| 173 | + <view v-if="item.widthTolNeg" class="value-spec_box_2">-{{ item.widthTolNeg }}</view> | ||
| 174 | + </view> | ||
| 175 | + <view v-if="item.length" class="value-spec_val p12">*</view> | ||
| 176 | + <view v-if="item.length" class="value-spec_val">{{ item.length }}</view> | ||
| 177 | + <view v-if="item.length" class="value-spec_box"> | ||
| 178 | + <view v-if="item.lengthTolPos" class="value-spec_box_1">+{{ item.lengthTolPos }}</view> | ||
| 179 | + <view v-if="item.lengthTolNeg" class="value-spec_box_2">-{{ item.lengthTolNeg }}</view> | ||
| 180 | + </view> | ||
| 181 | + </view> | ||
| 182 | + </view> | ||
| 155 | <view class="row"><text class="label">状态</text><text class="value">{{ item.status }}</text></view> | 183 | <view class="row"><text class="label">状态</text><text class="value">{{ item.status }}</text></view> |
| 156 | <view class="row"><text class="label">数量</text><text class="value">{{ item.quantity }}</text></view> | 184 | <view class="row"><text class="label">数量</text><text class="value">{{ item.quantity }}</text></view> |
| 157 | <view class="row"><text class="label">单价</text><text class="value">{{ formatCurrency(item.unitPrice) | 185 | <view class="row"><text class="label">单价</text><text class="value">{{ formatCurrency(item.unitPrice) |
| @@ -162,7 +190,7 @@ | @@ -162,7 +190,7 @@ | ||
| 162 | }}</text></view> | 190 | }}</text></view> |
| 163 | <view class="row"><text class="label">总金额</text><text class="value">{{ formatCurrency(item.totalAmount) | 191 | <view class="row"><text class="label">总金额</text><text class="value">{{ formatCurrency(item.totalAmount) |
| 164 | }}</text></view> | 192 | }}</text></view> |
| 165 | - <view class="row"><text class="label">发货日期</text><text class="value">{{ item.orderDate }}</text></view> | 193 | + <view class="row"><text class="label">发货日期</text><text class="value">{{ item.deliveryDate }}</text></view> |
| 166 | </view> | 194 | </view> |
| 167 | </view> | 195 | </view> |
| 168 | <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value" @confirm="onProductConfirm" /> | 196 | <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value" @confirm="onProductConfirm" /> |
| @@ -176,7 +204,7 @@ export default { | @@ -176,7 +204,7 @@ export default { | ||
| 176 | mode: { type: String, default: 'add' }, | 204 | mode: { type: String, default: 'add' }, |
| 177 | list: { type: Array, default: () => [] }, | 205 | list: { type: Array, default: () => [] }, |
| 178 | max: { type: Number, default: 8 }, | 206 | max: { type: Number, default: 8 }, |
| 179 | - orderDateBase: { type: String, default: '' }, | 207 | + deliveryDateBase: { type: String, default: '' }, |
| 180 | options: { type: Array, default: () => [] } | 208 | options: { type: Array, default: () => [] } |
| 181 | }, | 209 | }, |
| 182 | components: { SingleSelectSheet }, | 210 | components: { SingleSelectSheet }, |
| @@ -218,10 +246,18 @@ export default { | @@ -218,10 +246,18 @@ export default { | ||
| 218 | }, | 246 | }, |
| 219 | methods: { | 247 | methods: { |
| 220 | defaultItem() { | 248 | defaultItem() { |
| 221 | - return { productId: '', productName: '', industry: '', brand: '', quality: '', thickness: '', thicknessTolPos: '', thicknessTolNeg: '', width: '', widthTolPos: '', widthTolNeg: '', length: '', lengthTolPos: '', lengthTolNeg: '', status: '', quantity: '', unitPrice: '', amountExcludingTax: 0, totalAmount: 0, orderDate: '' } | 249 | + return { productId: '', productName: '', industry: '', brand: '', quality: '', thickness: '', thicknessTolPos: '', thicknessTolNeg: '', width: '', widthTolPos: '', widthTolNeg: '', length: '', lengthTolPos: '', lengthTolNeg: '', status: '', quantity: '', unitPrice: '', amountExcludingTax: 0, totalAmount: 0, deliveryDate: '' } |
| 222 | }, | 250 | }, |
| 223 | - onImmediateChange(idx) { | ||
| 224 | - this.$nextTick(() => this.recalculate(idx)) | 251 | + onNonNegativeInput(idx, field) { |
| 252 | + const it = this.items[idx] | ||
| 253 | + if (!it) return | ||
| 254 | + let v = String(it[field] != null ? it[field] : '') | ||
| 255 | + v = v.replace(/[^0-9.]/g, '') | ||
| 256 | + v = v.replace(/(\..*)\./g, '$1') | ||
| 257 | + if (v.startsWith('.')) v = '0' + v | ||
| 258 | + it[field] = v | ||
| 259 | + this.$set(this.items, idx, it) | ||
| 260 | + if (field === 'quantity' || field === 'unitPrice') this.$nextTick(() => this.recalculate(idx)) | ||
| 225 | }, | 261 | }, |
| 226 | toNumber(val) { | 262 | toNumber(val) { |
| 227 | if (typeof val === 'number') return isNaN(val) ? 0 : val | 263 | if (typeof val === 'number') return isNaN(val) ? 0 : val |
| @@ -234,21 +270,21 @@ export default { | @@ -234,21 +270,21 @@ export default { | ||
| 234 | const m = Math.pow(10, digits) | 270 | const m = Math.pow(10, digits) |
| 235 | return Math.round(n * m) / m | 271 | return Math.round(n * m) / m |
| 236 | }, | 272 | }, |
| 237 | - onNumberBlur(idx, field, digits) { | 273 | + onNonNegativeBlur(idx, field, digits) { |
| 238 | const it = this.items[idx] | 274 | const it = this.items[idx] |
| 239 | if (!it) return | 275 | if (!it) return |
| 240 | const raw = it[field] | 276 | const raw = it[field] |
| 241 | - // 如果为空则保持为空,不自动置为0,仅重新计算依赖字段 | ||
| 242 | if (raw === '' || raw === null || raw === undefined) { | 277 | if (raw === '' || raw === null || raw === undefined) { |
| 243 | this.$set(this.items, idx, it) | 278 | this.$set(this.items, idx, it) |
| 244 | - this.recalculate(idx) | 279 | + if (field === 'quantity' || field === 'unitPrice') this.recalculate(idx) |
| 245 | return | 280 | return |
| 246 | } | 281 | } |
| 247 | - const num = this.toNumber(raw) | 282 | + let num = this.toNumber(raw) |
| 283 | + if (isNaN(num) || num < 0) num = 0 | ||
| 248 | const rounded = this.round(num, digits) | 284 | const rounded = this.round(num, digits) |
| 249 | it[field] = rounded | 285 | it[field] = rounded |
| 250 | this.$set(this.items, idx, it) | 286 | this.$set(this.items, idx, it) |
| 251 | - this.recalculate(idx) | 287 | + if (field === 'quantity' || field === 'unitPrice') this.recalculate(idx) |
| 252 | }, | 288 | }, |
| 253 | formatCurrency(val) { | 289 | formatCurrency(val) { |
| 254 | if (val == null || val === '') return '' | 290 | if (val == null || val === '') return '' |
| @@ -319,15 +355,15 @@ export default { | @@ -319,15 +355,15 @@ export default { | ||
| 319 | onDateChange(idx, e) { | 355 | onDateChange(idx, e) { |
| 320 | const it = this.items[idx] | 356 | const it = this.items[idx] |
| 321 | if (!it) return | 357 | if (!it) return |
| 322 | - const val = typeof e === 'string' ? e : (e && e.detail && e.detail.value) ? e.detail.value : it.orderDate | 358 | + const val = typeof e === 'string' ? e : (e && e.detail && e.detail.value) ? e.detail.value : it.deliveryDate |
| 323 | const dateStr = String(val).slice(0, 10) | 359 | const dateStr = String(val).slice(0, 10) |
| 324 | - const base = this.orderDateBase ? new Date(this.orderDateBase) : null | 360 | + const base = this.deliveryDateBase ? new Date(this.deliveryDateBase) : null |
| 325 | const d = new Date(dateStr) | 361 | const d = new Date(dateStr) |
| 326 | if (base && !isNaN(d.getTime()) && d.getTime() < base.getTime()) { | 362 | if (base && !isNaN(d.getTime()) && d.getTime() < base.getTime()) { |
| 327 | uni.showToast({ title: '发货日期不得早于订货日期', icon: 'none' }) | 363 | uni.showToast({ title: '发货日期不得早于订货日期', icon: 'none' }) |
| 328 | - it.orderDate = this.orderDateBase | 364 | + it.deliveryDate = this.deliveryDateBase |
| 329 | } else { | 365 | } else { |
| 330 | - it.orderDate = dateStr | 366 | + it.deliveryDate = dateStr |
| 331 | } | 367 | } |
| 332 | this.$set(this.items, idx, it) | 368 | this.$set(this.items, idx, it) |
| 333 | }, | 369 | }, |
| @@ -500,8 +536,46 @@ export default { | @@ -500,8 +536,46 @@ export default { | ||
| 500 | 536 | ||
| 501 | .value { | 537 | .value { |
| 502 | flex: 1; | 538 | flex: 1; |
| 503 | - text-align: right; | 539 | + // text-align: right; |
| 504 | color: rgba(0, 0, 0, 0.9); | 540 | color: rgba(0, 0, 0, 0.9); |
| 505 | font-size: 28rpx; | 541 | font-size: 28rpx; |
| 506 | } | 542 | } |
| 543 | + .value-spec { | ||
| 544 | + height: 48rpx; | ||
| 545 | + display: flex; | ||
| 546 | + align-items: center; | ||
| 547 | + color: #000000; | ||
| 548 | + // justify-content: end; | ||
| 549 | + &_box { | ||
| 550 | + position: relative; | ||
| 551 | + width: 60rpx; | ||
| 552 | + height: 48rpx; | ||
| 553 | + | ||
| 554 | + &_1 { | ||
| 555 | + font-size: 16rpx; | ||
| 556 | + position: absolute; | ||
| 557 | + top: -10rpx; | ||
| 558 | + left: 0; | ||
| 559 | + } | ||
| 560 | + | ||
| 561 | + &_2 { | ||
| 562 | + font-size: 16rpx; | ||
| 563 | + position: absolute; | ||
| 564 | + bottom: -10rpx; | ||
| 565 | + left: 0; | ||
| 566 | + } | ||
| 567 | + } | ||
| 568 | + | ||
| 569 | + &_val { | ||
| 570 | + font-size: 28rpx; | ||
| 571 | + | ||
| 572 | + &.p12 { | ||
| 573 | + padding-right: 12rpx; | ||
| 574 | + } | ||
| 575 | + } | ||
| 576 | + } | ||
| 577 | + .row-spec { | ||
| 578 | + height: 60rpx; | ||
| 579 | + align-items: center; | ||
| 580 | + } | ||
| 507 | </style> | 581 | </style> |
| @@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
| 24 | <text>框架合同编号</text><text>{{ item.code }}</text> | 24 | <text>框架合同编号</text><text>{{ item.code }}</text> |
| 25 | </view> | 25 | </view> |
| 26 | <view class="info-row"> | 26 | <view class="info-row"> |
| 27 | - <text>是否签订</text><text>{{ item.hasFrameworkAgreement }}</text> | 27 | + <text>是否签订</text><text>{{ item.hasFrameworkAgreement ? '是' : '否' }}</text> |
| 28 | </view> | 28 | </view> |
| 29 | <view class="info-row"> | 29 | <view class="info-row"> |
| 30 | <text>品种</text><text>{{ item.materialTypeName }}</text> | 30 | <text>品种</text><text>{{ item.materialTypeName }}</text> |
| @@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
| 39 | <view class="item-title"><text class="required">*</text><text>生产厂</text></view> | 39 | <view class="item-title"><text class="required">*</text><text>生产厂</text></view> |
| 40 | </template> | 40 | </template> |
| 41 | </uni-list-item> | 41 | </uni-list-item> |
| 42 | - <!-- <ProductRel mode="add" :orderDateBase="form.orderDate" @change="onProductsChange" :options="productList" :rawToProdRatioList="rawToProdRatioList" /> --> | 42 | + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" :rawToProdRatioList="rawToProdRatioList" /> |
| 43 | <uni-list-item title="合计人民币金额(大写)"> | 43 | <uni-list-item title="合计人民币金额(大写)"> |
| 44 | <template v-slot:footer> | 44 | <template v-slot:footer> |
| 45 | <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled /> | 45 | <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled /> |
| @@ -92,33 +92,25 @@ | @@ -92,33 +92,25 @@ | ||
| 92 | :inputBorder="false" /> | 92 | :inputBorder="false" /> |
| 93 | </template> | 93 | </template> |
| 94 | </uni-list-item> | 94 | </uni-list-item> |
| 95 | - <view class="group"> | ||
| 96 | - <view class="group-title">特别条款要求</view> | ||
| 97 | - <view class="radio-list"> | ||
| 98 | - <view v-for="(opt, i) in specialTermsList" :key="'cr-' + i" class="radio-item" | ||
| 99 | - @click="onRadioSelect('specialTerms', 'specialTermsName', opt)"> | ||
| 100 | - <view :class="['radio', { checked: form.specialTerms === opt.value }]" /> | ||
| 101 | - <text class="label">{{ opt.label }}</text> | ||
| 102 | - </view> | ||
| 103 | - </view> | ||
| 104 | - </view> | ||
| 105 | - <view class="group"> | ||
| 106 | - <view class="group-title">执行标准</view> | ||
| 107 | - <view class="radio-list"> | ||
| 108 | - <view v-for="(opt, i) in executionStandardList" :key="'es-' + i" class="radio-item" | ||
| 109 | - @click="onRadioSelect('executionStandard', 'executionStandardName', opt)"> | ||
| 110 | - <view :class="['radio', { checked: form.executionStandard === opt.value }]" /> | ||
| 111 | - <text class="label">{{ opt.label }}</text> | ||
| 112 | - </view> | ||
| 113 | - </view> | ||
| 114 | - </view> | 95 | + <uni-list-item class="select-item" :class="form.specialTermsName ? 'is-filled' : 'is-empty'" clickable |
| 96 | + @click="openSheet('specialTerms')" :rightText="form.specialTermsName || '请选择'" showArrow> | ||
| 97 | + <template v-slot:body> | ||
| 98 | + <view class="item-title"><text class="required">*</text><text>特别条款要求</text></view> | ||
| 99 | + </template> | ||
| 100 | + </uni-list-item> | ||
| 101 | + <uni-list-item class="select-item" :class="form.executionStandardName ? 'is-filled' : 'is-empty'" clickable | ||
| 102 | + @click="openSheet('executionStandard')" :rightText="form.executionStandardName || '请选择'" showArrow> | ||
| 103 | + <template v-slot:body> | ||
| 104 | + <view class="item-title"><text>执行标准</text></view> | ||
| 105 | + </template> | ||
| 106 | + </uni-list-item> | ||
| 115 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> | 107 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> |
| 116 | <template v-slot:footer> | 108 | <template v-slot:footer> |
| 117 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" | 109 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" |
| 118 | :inputBorder="false" /> | 110 | :inputBorder="false" /> |
| 119 | </template> | 111 | </template> |
| 120 | </uni-list-item> | 112 | </uni-list-item> |
| 121 | - <uni-list-item title="特别说明"> | 113 | + <uni-list-item title="特别说明" style="margin-top: 20rpx;"> |
| 122 | <template v-slot:footer> | 114 | <template v-slot:footer> |
| 123 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> | 115 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> |
| 124 | </template> | 116 | </template> |
| @@ -181,7 +173,7 @@ | @@ -181,7 +173,7 @@ | ||
| 181 | 数量 | 173 | 数量 |
| 182 | </div> | 174 | </div> |
| 183 | <div class="total-item-price"> | 175 | <div class="total-item-price"> |
| 184 | - {{ (sumQuantity || 0).toFixed(2) }}t | 176 | + {{ (totalQuantity || 0).toFixed(2) }}kg |
| 185 | </div> | 177 | </div> |
| 186 | </div> | 178 | </div> |
| 187 | <div class="total-item"> | 179 | <div class="total-item"> |
| @@ -189,7 +181,7 @@ | @@ -189,7 +181,7 @@ | ||
| 189 | 不含税金额 | 181 | 不含税金额 |
| 190 | </div> | 182 | </div> |
| 191 | <div class="total-item-price text-red"> | 183 | <div class="total-item-price text-red"> |
| 192 | - ¥{{ (sumAmountExcl || 0).toFixed(2) }} | 184 | + ¥{{ (totalAmountExcludingTax || 0).toFixed(2) }} |
| 193 | </div> | 185 | </div> |
| 194 | </div> | 186 | </div> |
| 195 | <div class="total-item"> | 187 | <div class="total-item"> |
| @@ -197,7 +189,7 @@ | @@ -197,7 +189,7 @@ | ||
| 197 | 总金额 | 189 | 总金额 |
| 198 | </div> | 190 | </div> |
| 199 | <div class="total-item-price text-red"> | 191 | <div class="total-item-price text-red"> |
| 200 | - ¥{{ (sumTotal || 0).toFixed(2) }} | 192 | + ¥{{ (totalAmountIncludingTax || 0).toFixed(2) }} |
| 201 | </div> | 193 | </div> |
| 202 | </div> | 194 | </div> |
| 203 | </div> | 195 | </div> |
| @@ -214,7 +206,7 @@ | @@ -214,7 +206,7 @@ | ||
| 214 | <script> | 206 | <script> |
| 215 | import SingleSelectSheet from '@/components/single-select/index.vue' | 207 | import SingleSelectSheet from '@/components/single-select/index.vue' |
| 216 | import RelateSelectSheet from '@/components/relate-select/index.vue' | 208 | import RelateSelectSheet from '@/components/relate-select/index.vue' |
| 217 | -//import ProductRel from './productRel.vue' | 209 | +import ProductRel from './productRel.vue' |
| 218 | import CitySelector from '@/components/city-selector/index.vue' | 210 | import CitySelector from '@/components/city-selector/index.vue' |
| 219 | import { getRetailCodeApi, createContractApi, getCustomerRemarks,getCustomerSpecificQualityRequirements } from '@/api/contract' | 211 | import { getRetailCodeApi, createContractApi, getCustomerRemarks,getCustomerSpecificQualityRequirements } from '@/api/contract' |
| 220 | import { getDicByCodes } from '@/utils/dic' | 212 | import { getDicByCodes } from '@/utils/dic' |
| @@ -223,7 +215,7 @@ import { workshopQueryApi } from '@/api/devManage' | @@ -223,7 +215,7 @@ import { workshopQueryApi } from '@/api/devManage' | ||
| 223 | 215 | ||
| 224 | export default { | 216 | export default { |
| 225 | name: 'AddContractProcess', | 217 | name: 'AddContractProcess', |
| 226 | - components: { SingleSelectSheet, RelateSelectSheet, /* ProductRel, */ CitySelector }, | 218 | + components: { SingleSelectSheet, RelateSelectSheet, ProductRel, CitySelector }, |
| 227 | data() { | 219 | data() { |
| 228 | return { | 220 | return { |
| 229 | form: { | 221 | form: { |
| @@ -233,6 +225,7 @@ export default { | @@ -233,6 +225,7 @@ export default { | ||
| 233 | buyer: '', | 225 | buyer: '', |
| 234 | buyerName: '', | 226 | buyerName: '', |
| 235 | orderDate: '', | 227 | orderDate: '', |
| 228 | + deliveryDate: '', | ||
| 236 | designatedConsignee: '', | 229 | designatedConsignee: '', |
| 237 | specialTerms: '', | 230 | specialTerms: '', |
| 238 | specialTermsName: '', | 231 | specialTermsName: '', |
| @@ -263,9 +256,9 @@ export default { | @@ -263,9 +256,9 @@ export default { | ||
| 263 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], | 256 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], |
| 264 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, | 257 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, |
| 265 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, | 258 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, |
| 266 | - sumQuantity: 0, | ||
| 267 | - sumAmountExcl: 0, | ||
| 268 | - sumTotal: 0, | 259 | + totalQuantity: 0, |
| 260 | + totalAmountExcludingTax: 0, | ||
| 261 | + totalAmountIncludingTax: 0, | ||
| 269 | productLineList: [], | 262 | productLineList: [], |
| 270 | productList: [], | 263 | productList: [], |
| 271 | rawToProdRatioList: [], | 264 | rawToProdRatioList: [], |
| @@ -366,12 +359,12 @@ export default { | @@ -366,12 +359,12 @@ export default { | ||
| 366 | }, | 359 | }, |
| 367 | onProductsChange(products) { | 360 | onProductsChange(products) { |
| 368 | const list = Array.isArray(products) ? products : [] | 361 | const list = Array.isArray(products) ? products : [] |
| 369 | - const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) | 362 | + const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.productQuantity) || 0), 0) |
| 370 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) | 363 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) |
| 371 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) | 364 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) |
| 372 | - this.sumQuantity = sumQ | ||
| 373 | - this.sumAmountExcl = sumE | ||
| 374 | - this.sumTotal = sumT | 365 | + this.totalQuantity = sumQ |
| 366 | + this.totalAmountExcludingTax = sumE | ||
| 367 | + this.totalAmountIncludingTax = sumT | ||
| 375 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) | 368 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) |
| 376 | this.productLineList = list | 369 | this.productLineList = list |
| 377 | }, | 370 | }, |
| @@ -450,6 +443,10 @@ export default { | @@ -450,6 +443,10 @@ export default { | ||
| 450 | setSheet('生产厂', opts) | 443 | setSheet('生产厂', opts) |
| 451 | } else if (field === 'supplier') { | 444 | } else if (field === 'supplier') { |
| 452 | setSheet('承揽方', this.supplierList) | 445 | setSheet('承揽方', this.supplierList) |
| 446 | + } else if (field === 'specialTerms') { | ||
| 447 | + setSheet('特别条款要求', this.specialTermsList) | ||
| 448 | + } else if (field === 'executionStandard') { | ||
| 449 | + setSheet('执行标准', this.executionStandardList) | ||
| 453 | } else if (field === 'includesPackagingFee') { | 450 | } else if (field === 'includesPackagingFee') { |
| 454 | setSheet('单价中是否已包含包装费', this.yesNoList) | 451 | setSheet('单价中是否已包含包装费', this.yesNoList) |
| 455 | } else if (field === 'includesTransportFee') { | 452 | } else if (field === 'includesTransportFee') { |
| @@ -520,10 +517,15 @@ export default { | @@ -520,10 +517,15 @@ export default { | ||
| 520 | ...formForSubmit, | 517 | ...formForSubmit, |
| 521 | destination, | 518 | destination, |
| 522 | type: 'PROCESS_STD_AGMT', | 519 | type: 'PROCESS_STD_AGMT', |
| 523 | - sumQuantity: this.sumQuantity, | ||
| 524 | - sumAmountExcl: this.sumAmountExcl, | ||
| 525 | - sumTotal: this.sumTotal, | ||
| 526 | - contractDistributorLineList: lines | 520 | + totalQuantity: this.totalQuantity, |
| 521 | + totalAmountExcludingTax: this.totalAmountExcludingTax, | ||
| 522 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | ||
| 523 | + contractStdProcessingLineList: lines.map(it => ({ | ||
| 524 | + ...it, | ||
| 525 | + productId: it.rawProductId || '', | ||
| 526 | + productName: it.rawProductName || '', | ||
| 527 | + productGrade: it.rawProductGrade || '', | ||
| 528 | + })) | ||
| 527 | }) | 529 | }) |
| 528 | console.log('onSubmit__payload', payload) | 530 | console.log('onSubmit__payload', payload) |
| 529 | 531 | ||
| @@ -542,17 +544,30 @@ export default { | @@ -542,17 +544,30 @@ export default { | ||
| 542 | { key: 'buyer', label: '定作方' }, | 544 | { key: 'buyer', label: '定作方' }, |
| 543 | { key: 'orderDate', label: '订货日期' }, | 545 | { key: 'orderDate', label: '订货日期' }, |
| 544 | { key: 'workshopId', label: '生产厂' }, | 546 | { key: 'workshopId', label: '生产厂' }, |
| 547 | + { key: 'unit', label: '单位' }, | ||
| 548 | + { key: 'specialTerms', label: '特别条款要求' }, | ||
| 545 | ] | 549 | ] |
| 546 | for (const it of checks) { | 550 | for (const it of checks) { |
| 547 | const val = this.form[it.key] | 551 | const val = this.form[it.key] |
| 548 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) | 552 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) |
| 549 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } | 553 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } |
| 550 | } | 554 | } |
| 551 | - if (!Array.isArray(this.productLineList) || this.productLineList.length === 0) { | 555 | + const list = Array.isArray(this.productLineList) ? this.productLineList : [] |
| 556 | + if (list.length === 0) { | ||
| 552 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false | 557 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false |
| 553 | } | 558 | } |
| 554 | - for (const [idx, it] of this.productLineList.entries()) { | ||
| 555 | - if (!it.productName || !it.quantity || !it.unitPrice) { | 559 | + const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === '')) |
| 560 | + const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v))) | ||
| 561 | + for (const [idx, it] of list.entries()) { | ||
| 562 | + if ( | ||
| 563 | + strEmpty(it.rawProductName) || | ||
| 564 | + strEmpty(it.industry) || | ||
| 565 | + strEmpty(it.quality) || | ||
| 566 | + strEmpty(it.rawProductGrade) || | ||
| 567 | + numEmpty(it.productQuantity) || | ||
| 568 | + numEmpty(it.unitPrice) || | ||
| 569 | + strEmpty(it.deliveryDate) | ||
| 570 | + ) { | ||
| 556 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false | 571 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false |
| 557 | } | 572 | } |
| 558 | } | 573 | } |
| @@ -580,7 +595,7 @@ export default { | @@ -580,7 +595,7 @@ export default { | ||
| 580 | color: rgba(0, 0, 0, 0.6); | 595 | color: rgba(0, 0, 0, 0.6); |
| 581 | line-height: 32rpx; | 596 | line-height: 32rpx; |
| 582 | width: 240rpx; | 597 | width: 240rpx; |
| 583 | - padding: 24rpx 0; | 598 | + padding: 12rpx 0; |
| 584 | } | 599 | } |
| 585 | .total-item-price { | 600 | .total-item-price { |
| 586 | font-weight: 600; | 601 | font-weight: 600; |
| @@ -602,7 +617,7 @@ export default { | @@ -602,7 +617,7 @@ export default { | ||
| 602 | 617 | ||
| 603 | .scroll { | 618 | .scroll { |
| 604 | flex: 1; | 619 | flex: 1; |
| 605 | - padding: 12rpx 0 480rpx !important; | 620 | + padding: 12rpx 0 392rpx !important; |
| 606 | } | 621 | } |
| 607 | 622 | ||
| 608 | .footer { | 623 | .footer { |
| @@ -206,7 +206,7 @@ export default { | @@ -206,7 +206,7 @@ export default { | ||
| 206 | if (!this.batchMode) this.selectedKeys = [] | 206 | if (!this.batchMode) this.selectedKeys = [] |
| 207 | }, | 207 | }, |
| 208 | onAdd() { | 208 | onAdd() { |
| 209 | - uni.showToast({ title: '点击新增', icon: 'none' }) | 209 | + uni.navigateTo({ url: '/pages/contract_process/add' }) |
| 210 | }, | 210 | }, |
| 211 | fetchList({ pageIndex, pageSize, query, extra }) { | 211 | fetchList({ pageIndex, pageSize, query, extra }) { |
| 212 | console.log('fetchList', pageIndex, pageSize, query, extra) | 212 | console.log('fetchList', pageIndex, pageSize, query, extra) |
| @@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
| 41 | </template> | 41 | </template> |
| 42 | </uni-list-item> | 42 | </uni-list-item> |
| 43 | 43 | ||
| 44 | - <ProductRel mode="add" :orderDateBase="form.orderDate" :list="productLineList" @change="onProductsChange" :options="productList" /> | 44 | + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" /> |
| 45 | 45 | ||
| 46 | <uni-list-item title="合计人民币金额(大写)"> | 46 | <uni-list-item title="合计人民币金额(大写)"> |
| 47 | <template v-slot:footer> | 47 | <template v-slot:footer> |
| @@ -99,33 +99,25 @@ | @@ -99,33 +99,25 @@ | ||
| 99 | </template> | 99 | </template> |
| 100 | </uni-list-item> | 100 | </uni-list-item> |
| 101 | 101 | ||
| 102 | - <view class="group"> | ||
| 103 | - <view class="group-title">特别条款要求</view> | ||
| 104 | - <view class="radio-list"> | ||
| 105 | - <view v-for="(opt, i) in specialTermsList" :key="'cr-' + i" class="radio-item" | ||
| 106 | - @click="onRadioSelect('specialTerms', 'specialTermsName', opt)"> | ||
| 107 | - <view :class="['radio', { checked: form.specialTerms === opt.value }]" /> | ||
| 108 | - <text class="label">{{ opt.label }}</text> | ||
| 109 | - </view> | ||
| 110 | - </view> | ||
| 111 | - </view> | ||
| 112 | - <view class="group"> | ||
| 113 | - <view class="group-title">执行标准</view> | ||
| 114 | - <view class="radio-list"> | ||
| 115 | - <view v-for="(opt, i) in executionStandardList" :key="'es-' + i" class="radio-item" | ||
| 116 | - @click="onRadioSelect('executionStandard', 'executionStandardName', opt)"> | ||
| 117 | - <view :class="['radio', { checked: form.executionStandard === opt.value }]" /> | ||
| 118 | - <text class="label">{{ opt.label }}</text> | ||
| 119 | - </view> | ||
| 120 | - </view> | ||
| 121 | - </view> | 102 | + <uni-list-item class="select-item" :class="form.specialTermsName ? 'is-filled' : 'is-empty'" clickable |
| 103 | + @click="openSheet('specialTerms')" :rightText="form.specialTermsName || '请选择'" showArrow> | ||
| 104 | + <template v-slot:body> | ||
| 105 | + <view class="item-title"><text class="required">*</text><text>特别条款要求</text></view> | ||
| 106 | + </template> | ||
| 107 | + </uni-list-item> | ||
| 108 | + <uni-list-item class="select-item" :class="form.executionStandardName ? 'is-filled' : 'is-empty'" clickable | ||
| 109 | + @click="openSheet('executionStandard')" :rightText="form.executionStandardName || '请选择'" showArrow> | ||
| 110 | + <template v-slot:body> | ||
| 111 | + <view class="item-title"><text>执行标准</text></view> | ||
| 112 | + </template> | ||
| 113 | + </uni-list-item> | ||
| 122 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> | 114 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> |
| 123 | <template v-slot:footer> | 115 | <template v-slot:footer> |
| 124 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" | 116 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" |
| 125 | :inputBorder="false" /> | 117 | :inputBorder="false" /> |
| 126 | </template> | 118 | </template> |
| 127 | </uni-list-item> | 119 | </uni-list-item> |
| 128 | - <uni-list-item title="特别说明"> | 120 | + <uni-list-item title="特别说明" style="margin-top: 20rpx;"> |
| 129 | <template v-slot:footer> | 121 | <template v-slot:footer> |
| 130 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> | 122 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> |
| 131 | </template> | 123 | </template> |
| @@ -177,15 +169,15 @@ | @@ -177,15 +169,15 @@ | ||
| 177 | <div class="total-text">合计</div> | 169 | <div class="total-text">合计</div> |
| 178 | <div class="total-item"> | 170 | <div class="total-item"> |
| 179 | <div class="total-item-text">数量</div> | 171 | <div class="total-item-text">数量</div> |
| 180 | - <div class="total-item-price">{{ (sumQuantity || 0).toFixed(2) }}t</div> | 172 | + <div class="total-item-price">{{ (totalQuantity || 0).toFixed(2) }}kg</div> |
| 181 | </div> | 173 | </div> |
| 182 | <div class="total-item"> | 174 | <div class="total-item"> |
| 183 | <div class="total-item-text">不含税金额</div> | 175 | <div class="total-item-text">不含税金额</div> |
| 184 | - <div class="total-item-price text-red">¥{{ (sumAmountExcl || 0).toFixed(2) }}</div> | 176 | + <div class="total-item-price text-red">¥{{ (totalAmountExcludingTax || 0).toFixed(2) }}</div> |
| 185 | </div> | 177 | </div> |
| 186 | <div class="total-item"> | 178 | <div class="total-item"> |
| 187 | <div class="total-item-text">总金额</div> | 179 | <div class="total-item-text">总金额</div> |
| 188 | - <div class="total-item-price text-red">¥{{ (sumTotal || 0).toFixed(2) }}</div> | 180 | + <div class="total-item-price text-red">¥{{ (totalAmountIncludingTax || 0).toFixed(2) }}</div> |
| 189 | </div> | 181 | </div> |
| 190 | </div> | 182 | </div> |
| 191 | <button class="btn submit" type="primary" @click="onSubmit">保存</button> | 183 | <button class="btn submit" type="primary" @click="onSubmit">保存</button> |
| @@ -223,6 +215,7 @@ export default { | @@ -223,6 +215,7 @@ export default { | ||
| 223 | workshopId: '', | 215 | workshopId: '', |
| 224 | workshopName: '', | 216 | workshopName: '', |
| 225 | orderDate: '', | 217 | orderDate: '', |
| 218 | + deliveryDate: '', | ||
| 226 | designatedConsignee: '', | 219 | designatedConsignee: '', |
| 227 | specialTerms: '', | 220 | specialTerms: '', |
| 228 | specialTermsName: '', | 221 | specialTermsName: '', |
| @@ -256,9 +249,9 @@ export default { | @@ -256,9 +249,9 @@ export default { | ||
| 256 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], | 249 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], |
| 257 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, | 250 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, |
| 258 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, | 251 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, |
| 259 | - sumQuantity: 0, | ||
| 260 | - sumAmountExcl: 0, | ||
| 261 | - sumTotal: 0, | 252 | + totalQuantity: 0, |
| 253 | + totalAmountExcludingTax: 0, | ||
| 254 | + totalAmountIncludingTax: 0, | ||
| 262 | productLineList: [], | 255 | productLineList: [], |
| 263 | newProductLineList: [], | 256 | newProductLineList: [], |
| 264 | productList: [], | 257 | productList: [], |
| @@ -325,7 +318,7 @@ export default { | @@ -325,7 +318,7 @@ export default { | ||
| 325 | workshopId: m.workshopId || '', | 318 | workshopId: m.workshopId || '', |
| 326 | workshopName: m.workshopName || '', | 319 | workshopName: m.workshopName || '', |
| 327 | } | 320 | } |
| 328 | - const lines = Array.isArray(m.contractDistributorLineList) ? m.contractDistributorLineList : [] | 321 | + const lines = Array.isArray(m.contractStdProcessingLineList) ? m.contractStdProcessingLineList : [] |
| 329 | this.productLineList = lines | 322 | this.productLineList = lines |
| 330 | this.onProductsChange(lines) | 323 | this.onProductsChange(lines) |
| 331 | } catch (e) { } | 324 | } catch (e) { } |
| @@ -347,12 +340,12 @@ export default { | @@ -347,12 +340,12 @@ export default { | ||
| 347 | onProductsChange(products) { | 340 | onProductsChange(products) { |
| 348 | const list = Array.isArray(products) ? products : [] | 341 | const list = Array.isArray(products) ? products : [] |
| 349 | this.newProductLineList = list | 342 | this.newProductLineList = list |
| 350 | - const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) | 343 | + const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.productQuantity) || 0), 0) |
| 351 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) | 344 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) |
| 352 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) | 345 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) |
| 353 | - this.sumQuantity = sumQ | ||
| 354 | - this.sumAmountExcl = sumE | ||
| 355 | - this.sumTotal = sumT | 346 | + this.totalQuantity = sumQ |
| 347 | + this.totalAmountExcludingTax = sumE | ||
| 348 | + this.totalAmountIncludingTax = sumT | ||
| 356 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) | 349 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) |
| 357 | }, | 350 | }, |
| 358 | async loadSuppliers() { | 351 | async loadSuppliers() { |
| @@ -403,6 +396,10 @@ export default { | @@ -403,6 +396,10 @@ export default { | ||
| 403 | setSheet('生产厂', opts) | 396 | setSheet('生产厂', opts) |
| 404 | } else if (field === 'supplier') { | 397 | } else if (field === 'supplier') { |
| 405 | setSheet('承揽方', this.supplierList) | 398 | setSheet('承揽方', this.supplierList) |
| 399 | + } else if (field === 'specialTerms') { | ||
| 400 | + setSheet('特别条款要求', this.specialTermsList) | ||
| 401 | + } else if (field === 'executionStandard') { | ||
| 402 | + setSheet('执行标准', this.executionStandardList) | ||
| 406 | } else if (field === 'includesPackagingFee') { | 403 | } else if (field === 'includesPackagingFee') { |
| 407 | setSheet('单价中是否已包含包装费', this.yesNoList) | 404 | setSheet('单价中是否已包含包装费', this.yesNoList) |
| 408 | } else if (field === 'includesTransportFee') { | 405 | } else if (field === 'includesTransportFee') { |
| @@ -448,17 +445,30 @@ export default { | @@ -448,17 +445,30 @@ export default { | ||
| 448 | { key: 'buyer', label: '定作方' }, | 445 | { key: 'buyer', label: '定作方' }, |
| 449 | { key: 'orderDate', label: '订货日期' }, | 446 | { key: 'orderDate', label: '订货日期' }, |
| 450 | { key: 'workshopId', label: '生产厂' }, | 447 | { key: 'workshopId', label: '生产厂' }, |
| 448 | + { key: 'unit', label: '单位' }, | ||
| 449 | + { key: 'specialTerms', label: '特别条款要求' }, | ||
| 451 | ] | 450 | ] |
| 452 | for (const it of checks) { | 451 | for (const it of checks) { |
| 453 | const val = this.form[it.key] | 452 | const val = this.form[it.key] |
| 454 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) | 453 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) |
| 455 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } | 454 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } |
| 456 | } | 455 | } |
| 457 | - if (!Array.isArray(this.productLineList) || this.productLineList.length === 0) { | 456 | + const list = Array.isArray(this.newProductLineList) ? this.newProductLineList : [] |
| 457 | + if (list.length === 0) { | ||
| 458 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false | 458 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false |
| 459 | } | 459 | } |
| 460 | - for (const [idx, it] of this.productLineList.entries()) { | ||
| 461 | - if (!it.productName || !it.quantity || !it.unitPrice) { | 460 | + const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === '')) |
| 461 | + const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v))) | ||
| 462 | + for (const [idx, it] of list.entries()) { | ||
| 463 | + if ( | ||
| 464 | + strEmpty(it.productName) || | ||
| 465 | + strEmpty(it.industry) || | ||
| 466 | + strEmpty(it.quality) || | ||
| 467 | + strEmpty(it.brand) || | ||
| 468 | + numEmpty(it.productQuantity) || | ||
| 469 | + strEmpty(it.unitPrice) || | ||
| 470 | + strEmpty(it.deliveryDate) | ||
| 471 | + ) { | ||
| 462 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false | 472 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false |
| 463 | } | 473 | } |
| 464 | } | 474 | } |
| @@ -493,7 +503,7 @@ export default { | @@ -493,7 +503,7 @@ export default { | ||
| 493 | sumQuantity: this.sumQuantity, | 503 | sumQuantity: this.sumQuantity, |
| 494 | sumAmountExcl: this.sumAmountExcl, | 504 | sumAmountExcl: this.sumAmountExcl, |
| 495 | sumTotal: this.sumTotal, | 505 | sumTotal: this.sumTotal, |
| 496 | - contractDistributorLineList: lines | 506 | + contractStdProcessingLineList: lines |
| 497 | }) | 507 | }) |
| 498 | try { | 508 | try { |
| 499 | await updateContractApi(payload) | 509 | await updateContractApi(payload) |
| @@ -528,7 +538,7 @@ export default { | @@ -528,7 +538,7 @@ export default { | ||
| 528 | color: rgba(0, 0, 0, 0.6); | 538 | color: rgba(0, 0, 0, 0.6); |
| 529 | line-height: 32rpx; | 539 | line-height: 32rpx; |
| 530 | width: 240rpx; | 540 | width: 240rpx; |
| 531 | - padding: 24rpx 0; | 541 | + padding: 12rpx 0; |
| 532 | } | 542 | } |
| 533 | 543 | ||
| 534 | .total-item-price { | 544 | .total-item-price { |
| @@ -551,7 +561,7 @@ export default { | @@ -551,7 +561,7 @@ export default { | ||
| 551 | 561 | ||
| 552 | .scroll { | 562 | .scroll { |
| 553 | flex: 1; | 563 | flex: 1; |
| 554 | - padding: 12rpx 0 480rpx !important; | 564 | + padding: 12rpx 0 392rpx !important; |
| 555 | } | 565 | } |
| 556 | 566 | ||
| 557 | .footer { | 567 | .footer { |
| @@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
| 38 | <view class="item-title"><text>原材料名称</text></view> | 38 | <view class="item-title"><text>原材料名称</text></view> |
| 39 | </template> | 39 | </template> |
| 40 | </uni-list-item> | 40 | </uni-list-item> |
| 41 | - <uni-list-item title="原材料牌号"> | 41 | + <uni-list-item title="原材料牌号"> |
| 42 | <template v-slot:footer> | 42 | <template v-slot:footer> |
| 43 | <uni-easyinput v-model="item.rawProductGrade" :inputBorder="false" placeholder="请输入原材料牌号" /> | 43 | <uni-easyinput v-model="item.rawProductGrade" :inputBorder="false" placeholder="请输入原材料牌号" /> |
| 44 | </template> | 44 | </template> |
| @@ -71,61 +71,61 @@ | @@ -71,61 +71,61 @@ | ||
| 71 | 71 | ||
| 72 | <uni-list-item title="厚度"> | 72 | <uni-list-item title="厚度"> |
| 73 | <template v-slot:footer> | 73 | <template v-slot:footer> |
| 74 | - <uni-easyinput v-model="item.thickness" :inputBorder="false" placeholder="请输入厚度" /> | 74 | + <uni-easyinput type="digit" v-model="item.thickness" :inputBorder="false" placeholder="请输入厚度" @input="onNonNegativeInput(idx, 'thickness')" @blur="onNonNegativeBlur(idx, 'thickness', 2)" /> |
| 75 | </template> | 75 | </template> |
| 76 | </uni-list-item> | 76 | </uni-list-item> |
| 77 | <uni-list-item title="厚度公差(单项+)"> | 77 | <uni-list-item title="厚度公差(单项+)"> |
| 78 | <template v-slot:footer> | 78 | <template v-slot:footer> |
| 79 | - <uni-easyinput v-model="item.thicknessTolPos" :inputBorder="false" | ||
| 80 | - placeholder="请输入厚度公差(单项+)" /> | 79 | + <uni-easyinput type="digit" v-model="item.thicknessTolPos" :inputBorder="false" |
| 80 | + placeholder="请输入厚度公差(单项+)" @input="onNonNegativeInput(idx, 'thicknessTolPos')" @blur="onNonNegativeBlur(idx, 'thicknessTolPos', 2)" /> | ||
| 81 | </template> | 81 | </template> |
| 82 | </uni-list-item> | 82 | </uni-list-item> |
| 83 | <uni-list-item title="厚度公差(单项-)"> | 83 | <uni-list-item title="厚度公差(单项-)"> |
| 84 | <template v-slot:footer> | 84 | <template v-slot:footer> |
| 85 | - <uni-easyinput v-model="item.thicknessTolNeg" :inputBorder="false" | ||
| 86 | - placeholder="请输入厚度公差(单项-)" /> | 85 | + <uni-easyinput type="digit" v-model="item.thicknessTolNeg" :inputBorder="false" |
| 86 | + placeholder="请输入厚度公差(单项-)" @input="onNonNegativeInput(idx, 'thicknessTolNeg')" @blur="onNonNegativeBlur(idx, 'thicknessTolNeg', 2)" /> | ||
| 87 | </template> | 87 | </template> |
| 88 | </uni-list-item> | 88 | </uni-list-item> |
| 89 | <uni-list-item title="宽度"> | 89 | <uni-list-item title="宽度"> |
| 90 | <template v-slot:footer> | 90 | <template v-slot:footer> |
| 91 | - <uni-easyinput v-model="item.width" :inputBorder="false" placeholder="请输入宽度" /> | 91 | + <uni-easyinput type="digit" v-model="item.width" :inputBorder="false" placeholder="请输入宽度" @input="onNonNegativeInput(idx, 'width')" @blur="onNonNegativeBlur(idx, 'width', 2)" /> |
| 92 | </template> | 92 | </template> |
| 93 | </uni-list-item> | 93 | </uni-list-item> |
| 94 | <uni-list-item title="宽度公差(单项+)"> | 94 | <uni-list-item title="宽度公差(单项+)"> |
| 95 | <template v-slot:footer> | 95 | <template v-slot:footer> |
| 96 | - <uni-easyinput v-model="item.widthTolPos" :inputBorder="false" placeholder="请输入宽度公差(单项+)" /> | 96 | + <uni-easyinput type="digit" v-model="item.widthTolPos" :inputBorder="false" placeholder="请输入宽度公差(单项+)" @input="onNonNegativeInput(idx, 'widthTolPos')" @blur="onNonNegativeBlur(idx, 'widthTolPos', 2)" /> |
| 97 | </template> | 97 | </template> |
| 98 | </uni-list-item> | 98 | </uni-list-item> |
| 99 | <uni-list-item title="宽度公差(单项-)"> | 99 | <uni-list-item title="宽度公差(单项-)"> |
| 100 | <template v-slot:footer> | 100 | <template v-slot:footer> |
| 101 | - <uni-easyinput v-model="item.widthTolNeg" :inputBorder="false" placeholder="请输入宽度公差(单项-)" /> | 101 | + <uni-easyinput type="digit" v-model="item.widthTolNeg" :inputBorder="false" placeholder="请输入宽度公差(单项-)" @input="onNonNegativeInput(idx, 'widthTolNeg')" @blur="onNonNegativeBlur(idx, 'widthTolNeg', 2)" /> |
| 102 | </template> | 102 | </template> |
| 103 | </uni-list-item> | 103 | </uni-list-item> |
| 104 | <uni-list-item title="长度"> | 104 | <uni-list-item title="长度"> |
| 105 | <template v-slot:footer> | 105 | <template v-slot:footer> |
| 106 | - <uni-easyinput v-model="item.length" :inputBorder="false" placeholder="请输入长度" /> | 106 | + <uni-easyinput type="digit" v-model="item.length" :inputBorder="false" placeholder="请输入长度" @input="onNonNegativeInput(idx, 'length')" @blur="onNonNegativeBlur(idx, 'length', 2)" /> |
| 107 | </template> | 107 | </template> |
| 108 | </uni-list-item> | 108 | </uni-list-item> |
| 109 | <uni-list-item title="长度公差(单项+)"> | 109 | <uni-list-item title="长度公差(单项+)"> |
| 110 | <template v-slot:footer> | 110 | <template v-slot:footer> |
| 111 | - <uni-easyinput v-model="item.lengthTolPos" :inputBorder="false" | ||
| 112 | - placeholder="请输入长度公差(单项+)" /> | 111 | + <uni-easyinput type="digit" v-model="item.lengthTolPos" :inputBorder="false" |
| 112 | + placeholder="请输入长度公差(单项+)" @input="onNonNegativeInput(idx, 'lengthTolPos')" @blur="onNonNegativeBlur(idx, 'lengthTolPos', 2)" /> | ||
| 113 | </template> | 113 | </template> |
| 114 | </uni-list-item> | 114 | </uni-list-item> |
| 115 | <uni-list-item title="长度公差(单项-)"> | 115 | <uni-list-item title="长度公差(单项-)"> |
| 116 | <template v-slot:footer> | 116 | <template v-slot:footer> |
| 117 | - <uni-easyinput v-model="item.lengthTolNeg" :inputBorder="false" | ||
| 118 | - placeholder="请输入长度公差(单项-)" /> | 117 | + <uni-easyinput type="digit" v-model="item.lengthTolNeg" :inputBorder="false" |
| 118 | + placeholder="请输入长度公差(单项-)" @input="onNonNegativeInput(idx, 'lengthTolNeg')" @blur="onNonNegativeBlur(idx, 'lengthTolNeg', 2)" /> | ||
| 119 | </template> | 119 | </template> |
| 120 | </uni-list-item> | 120 | </uni-list-item> |
| 121 | <uni-list-item title="定做物数量"> | 121 | <uni-list-item title="定做物数量"> |
| 122 | <template v-slot:footer> | 122 | <template v-slot:footer> |
| 123 | - <uni-easyinput v-model="item.productQuantity" type="number" :inputBorder="false" placeholder="请输入数量" @input="onImmediateChange(idx)" @blur="onNumberBlur(idx, 'productQuantity', 0)" /> | 123 | + <uni-easyinput v-model="item.productQuantity" type="digit" :inputBorder="false" placeholder="请输入数量kg" @input="onNonNegativeInput(idx, 'productQuantity')" @blur="onNonNegativeBlur(idx, 'productQuantity', 2)" /> |
| 124 | </template> | 124 | </template> |
| 125 | </uni-list-item> | 125 | </uni-list-item> |
| 126 | <uni-list-item title="加工费单价"> | 126 | <uni-list-item title="加工费单价"> |
| 127 | <template v-slot:footer> | 127 | <template v-slot:footer> |
| 128 | - <uni-easyinput v-model="item.unitPrice" type="number" :inputBorder="false" placeholder="请输入单价" @input="onImmediateChange(idx)" @blur="onNumberBlur(idx, 'unitPrice', 0)" /> | 128 | + <uni-easyinput v-model="item.unitPrice" type="digit" :inputBorder="false" placeholder="请输入销售价格" @input="onNonNegativeInput(idx, 'unitPrice')" @blur="onNonNegativeBlur(idx, 'unitPrice', 2)" /> |
| 129 | </template> | 129 | </template> |
| 130 | </uni-list-item> | 130 | </uni-list-item> |
| 131 | <uni-list-item title="不含税金额"> | 131 | <uni-list-item title="不含税金额"> |
| @@ -140,7 +140,7 @@ | @@ -140,7 +140,7 @@ | ||
| 140 | </uni-list-item> | 140 | </uni-list-item> |
| 141 | <uni-list-item title="发货日期"> | 141 | <uni-list-item title="发货日期"> |
| 142 | <template v-slot:footer> | 142 | <template v-slot:footer> |
| 143 | - <uni-datetime-picker type="date" v-model="item.orderDate" @change="onDateChange(idx, $event)" /> | 143 | + <uni-datetime-picker type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" /> |
| 144 | </template> | 144 | </template> |
| 145 | </uni-list-item> | 145 | </uni-list-item> |
| 146 | </uni-list> | 146 | </uni-list> |
| @@ -164,7 +164,30 @@ | @@ -164,7 +164,30 @@ | ||
| 164 | <view class="row"><text class="label">原材料到产品的转换比例</text><text class="value">{{ item.rawToProdRatioName }}</text></view> | 164 | <view class="row"><text class="label">原材料到产品的转换比例</text><text class="value">{{ item.rawToProdRatioName }}</text></view> |
| 165 | <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view> | 165 | <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view> |
| 166 | <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view> | 166 | <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view> |
| 167 | - <view class="row"><text class="label">规格</text><text class="value">{{ item.specDisplay }}</text></view> | 167 | + <!-- 厚(公差) * 宽(公差) * 长(公差) --> |
| 168 | + <view class="row row-spec"><text class="label">规格(mm)</text> | ||
| 169 | + <view class="value value-spec"> | ||
| 170 | + <view v-if="item.thickness" class="value-spec_val">{{ item.thickness }}</view> | ||
| 171 | + <view v-if="item.thickness" class="value-spec_box"> | ||
| 172 | + <view v-if="item.thicknessTolPos" class="value-spec_box_1">+{{ item.thicknessTolPos }} | ||
| 173 | + </view> | ||
| 174 | + <view v-if="item.thicknessTolNeg" class="value-spec_box_2">-{{ item.thicknessTolNeg }} | ||
| 175 | + </view> | ||
| 176 | + </view> | ||
| 177 | + <view v-if="item.width" class="value-spec_val p12">*</view> | ||
| 178 | + <view v-if="item.width" class="value-spec_val">{{ item.width }}</view> | ||
| 179 | + <view v-if="item.width" class="value-spec_box"> | ||
| 180 | + <view v-if="item.widthTolPos" class="value-spec_box_1">+{{ item.widthTolPos }}</view> | ||
| 181 | + <view v-if="item.widthTolNeg" class="value-spec_box_2">-{{ item.widthTolNeg }}</view> | ||
| 182 | + </view> | ||
| 183 | + <view v-if="item.length" class="value-spec_val p12">*</view> | ||
| 184 | + <view v-if="item.length" class="value-spec_val">{{ item.length }}</view> | ||
| 185 | + <view v-if="item.length" class="value-spec_box"> | ||
| 186 | + <view v-if="item.lengthTolPos" class="value-spec_box_1">+{{ item.lengthTolPos }}</view> | ||
| 187 | + <view v-if="item.lengthTolNeg" class="value-spec_box_2">-{{ item.lengthTolNeg }}</view> | ||
| 188 | + </view> | ||
| 189 | + </view> | ||
| 190 | + </view> | ||
| 168 | <view class="row"><text class="label">定做物数量</text><text class="value">{{ item.productQuantity }}</text></view> | 191 | <view class="row"><text class="label">定做物数量</text><text class="value">{{ item.productQuantity }}</text></view> |
| 169 | <view class="row"><text class="label">加工费单价</text><text class="value">{{ formatCurrency(item.unitPrice) | 192 | <view class="row"><text class="label">加工费单价</text><text class="value">{{ formatCurrency(item.unitPrice) |
| 170 | }}</text> | 193 | }}</text> |
| @@ -174,7 +197,7 @@ | @@ -174,7 +197,7 @@ | ||
| 174 | }}</text></view> | 197 | }}</text></view> |
| 175 | <view class="row"><text class="label">总金额</text><text class="value">{{ formatCurrency(item.totalAmount) | 198 | <view class="row"><text class="label">总金额</text><text class="value">{{ formatCurrency(item.totalAmount) |
| 176 | }}</text></view> | 199 | }}</text></view> |
| 177 | - <view class="row"><text class="label">发货日期</text><text class="value">{{ item.orderDate }}</text></view> | 200 | + <view class="row"><text class="label">发货日期</text><text class="value">{{ item.deliveryDate }}</text></view> |
| 178 | </view> | 201 | </view> |
| 179 | </view> | 202 | </view> |
| 180 | <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value" @confirm="onProductConfirm" /> | 203 | <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value" @confirm="onProductConfirm" /> |
| @@ -188,7 +211,7 @@ export default { | @@ -188,7 +211,7 @@ export default { | ||
| 188 | mode: { type: String, default: 'add' }, | 211 | mode: { type: String, default: 'add' }, |
| 189 | list: { type: Array, default: () => [] }, | 212 | list: { type: Array, default: () => [] }, |
| 190 | max: { type: Number, default: 8 }, | 213 | max: { type: Number, default: 8 }, |
| 191 | - orderDateBase: { type: String, default: '' }, | 214 | + deliveryDateBase: { type: String, default: '' }, |
| 192 | options: { type: Array, default: () => [] }, | 215 | options: { type: Array, default: () => [] }, |
| 193 | rawToProdRatioList: { type: Array, default: () => [] } | 216 | rawToProdRatioList: { type: Array, default: () => [] } |
| 194 | }, | 217 | }, |
| @@ -239,7 +262,34 @@ export default { | @@ -239,7 +262,34 @@ export default { | ||
| 239 | }, | 262 | }, |
| 240 | methods: { | 263 | methods: { |
| 241 | defaultItem() { | 264 | defaultItem() { |
| 242 | - return { rawProductId: '', rawProductName: '', rawProductGrade: '', industry: '',materialProductRatioRemarks:'', supplyTime: '存料加工', materialProductRatio: '', rawToProdRatioName: '', quality: '', thickness: '', thicknessTolPos: '', thicknessTolNeg: '', width: '', widthTolPos: '', widthTolNeg: '', length: '', lengthTolPos: '', lengthTolNeg: '', productQuantity: '', unitPrice: '', amountExcludingTax: 0, totalAmount: 0, orderDate: '' } | 265 | + return { rawProductId: '', rawProductName: '', rawProductGrade: '', industry: '',materialProductRatioRemarks:'', supplyTime: '存料加工', materialProductRatio: '', rawToProdRatioName: '', quality: '', thickness: '', thicknessTolPos: '', thicknessTolNeg: '', width: '', widthTolPos: '', widthTolNeg: '', length: '', lengthTolPos: '', lengthTolNeg: '', productQuantity: '', unitPrice: '', amountExcludingTax: 0, totalAmount: 0, deliveryDate: '' } |
| 266 | + }, | ||
| 267 | + onNonNegativeInput(idx, field) { | ||
| 268 | + const it = this.items[idx] | ||
| 269 | + if (!it) return | ||
| 270 | + let v = String(it[field] != null ? it[field] : '') | ||
| 271 | + v = v.replace(/[^0-9.]/g, '') | ||
| 272 | + v = v.replace(/(\..*)\./g, '$1') | ||
| 273 | + if (v.startsWith('.')) v = '0' + v | ||
| 274 | + it[field] = v | ||
| 275 | + this.$set(this.items, idx, it) | ||
| 276 | + if (field === 'productQuantity' || field === 'unitPrice') this.$nextTick(() => this.recalculate(idx)) | ||
| 277 | + }, | ||
| 278 | + onNonNegativeBlur(idx, field, digits) { | ||
| 279 | + const it = this.items[idx] | ||
| 280 | + if (!it) return | ||
| 281 | + const raw = it[field] | ||
| 282 | + if (raw === '' || raw === null || raw === undefined) { | ||
| 283 | + this.$set(this.items, idx, it) | ||
| 284 | + if (field === 'productQuantity' || field === 'unitPrice') this.recalculate(idx) | ||
| 285 | + return | ||
| 286 | + } | ||
| 287 | + let num = this.toNumber(raw) | ||
| 288 | + if (isNaN(num) || num < 0) num = 0 | ||
| 289 | + const rounded = this.round(num, digits) | ||
| 290 | + it[field] = rounded | ||
| 291 | + this.$set(this.items, idx, it) | ||
| 292 | + if (field === 'productQuantity' || field === 'unitPrice') this.recalculate(idx) | ||
| 243 | }, | 293 | }, |
| 244 | onImmediateChange(idx) { | 294 | onImmediateChange(idx) { |
| 245 | this.$nextTick(() => this.recalculate(idx)) | 295 | this.$nextTick(() => this.recalculate(idx)) |
| @@ -351,15 +401,15 @@ export default { | @@ -351,15 +401,15 @@ export default { | ||
| 351 | onDateChange(idx, e) { | 401 | onDateChange(idx, e) { |
| 352 | const it = this.items[idx] | 402 | const it = this.items[idx] |
| 353 | if (!it) return | 403 | if (!it) return |
| 354 | - const val = typeof e === 'string' ? e : (e && e.detail && e.detail.value) ? e.detail.value : it.orderDate | 404 | + const val = typeof e === 'string' ? e : (e && e.detail && e.detail.value) ? e.detail.value : it.deliveryDate |
| 355 | const dateStr = String(val).slice(0, 10) | 405 | const dateStr = String(val).slice(0, 10) |
| 356 | - const base = this.orderDateBase ? new Date(this.orderDateBase) : null | 406 | + const base = this.deliveryDateBase ? new Date(this.deliveryDateBase) : null |
| 357 | const d = new Date(dateStr) | 407 | const d = new Date(dateStr) |
| 358 | if (base && !isNaN(d.getTime()) && d.getTime() < base.getTime()) { | 408 | if (base && !isNaN(d.getTime()) && d.getTime() < base.getTime()) { |
| 359 | uni.showToast({ title: '发货日期不得早于订货日期', icon: 'none' }) | 409 | uni.showToast({ title: '发货日期不得早于订货日期', icon: 'none' }) |
| 360 | - it.orderDate = this.orderDateBase | 410 | + it.deliveryDate = this.deliveryDateBase |
| 361 | } else { | 411 | } else { |
| 362 | - it.orderDate = dateStr | 412 | + it.deliveryDate = dateStr |
| 363 | } | 413 | } |
| 364 | this.$set(this.items, idx, it) | 414 | this.$set(this.items, idx, it) |
| 365 | }, | 415 | }, |
| @@ -532,8 +582,45 @@ export default { | @@ -532,8 +582,45 @@ export default { | ||
| 532 | 582 | ||
| 533 | .value { | 583 | .value { |
| 534 | flex: 1; | 584 | flex: 1; |
| 535 | - text-align: right; | ||
| 536 | color: rgba(0, 0, 0, 0.9); | 585 | color: rgba(0, 0, 0, 0.9); |
| 537 | font-size: 28rpx; | 586 | font-size: 28rpx; |
| 538 | } | 587 | } |
| 588 | + .value-spec { | ||
| 589 | + height: 48rpx; | ||
| 590 | + display: flex; | ||
| 591 | + align-items: center; | ||
| 592 | + color: #000000; | ||
| 593 | + // justify-content: end; | ||
| 594 | + &_box { | ||
| 595 | + position: relative; | ||
| 596 | + width: 60rpx; | ||
| 597 | + height: 48rpx; | ||
| 598 | + | ||
| 599 | + &_1 { | ||
| 600 | + font-size: 16rpx; | ||
| 601 | + position: absolute; | ||
| 602 | + top: -10rpx; | ||
| 603 | + left: 0; | ||
| 604 | + } | ||
| 605 | + | ||
| 606 | + &_2 { | ||
| 607 | + font-size: 16rpx; | ||
| 608 | + position: absolute; | ||
| 609 | + bottom: -10rpx; | ||
| 610 | + left: 0; | ||
| 611 | + } | ||
| 612 | + } | ||
| 613 | + | ||
| 614 | + &_val { | ||
| 615 | + font-size: 28rpx; | ||
| 616 | + | ||
| 617 | + &.p12 { | ||
| 618 | + padding-right: 12rpx; | ||
| 619 | + } | ||
| 620 | + } | ||
| 621 | + } | ||
| 622 | + .row-spec { | ||
| 623 | + height: 60rpx; | ||
| 624 | + align-items: center; | ||
| 625 | + } | ||
| 539 | </style> | 626 | </style> |
| @@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
| 39 | <view class="item-title"><text class="required">*</text><text>生产厂</text></view> | 39 | <view class="item-title"><text class="required">*</text><text>生产厂</text></view> |
| 40 | </template> | 40 | </template> |
| 41 | </uni-list-item> | 41 | </uni-list-item> |
| 42 | - <ProductRel mode="add" :orderDateBase="form.orderDate" @change="onProductsChange" :options="productList" /> | 42 | + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" /> |
| 43 | <uni-list-item title="合计人民币金额(大写)"> | 43 | <uni-list-item title="合计人民币金额(大写)"> |
| 44 | <template v-slot:footer> | 44 | <template v-slot:footer> |
| 45 | <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled /> | 45 | <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled /> |
| @@ -92,33 +92,25 @@ | @@ -92,33 +92,25 @@ | ||
| 92 | :inputBorder="false" /> | 92 | :inputBorder="false" /> |
| 93 | </template> | 93 | </template> |
| 94 | </uni-list-item> | 94 | </uni-list-item> |
| 95 | - <view class="group"> | ||
| 96 | - <view class="group-title">特别条款要求</view> | ||
| 97 | - <view class="radio-list"> | ||
| 98 | - <view v-for="(opt, i) in specialTermsList" :key="'cr-' + i" class="radio-item" | ||
| 99 | - @click="onRadioSelect('specialTerms', 'specialTermsName', opt)"> | ||
| 100 | - <view :class="['radio', { checked: form.specialTerms === opt.value }]" /> | ||
| 101 | - <text class="label">{{ opt.label }}</text> | ||
| 102 | - </view> | ||
| 103 | - </view> | ||
| 104 | - </view> | ||
| 105 | - <view class="group"> | ||
| 106 | - <view class="group-title">执行标准</view> | ||
| 107 | - <view class="radio-list"> | ||
| 108 | - <view v-for="(opt, i) in executionStandardList" :key="'es-' + i" class="radio-item" | ||
| 109 | - @click="onRadioSelect('executionStandard', 'executionStandardName', opt)"> | ||
| 110 | - <view :class="['radio', { checked: form.executionStandard === opt.value }]" /> | ||
| 111 | - <text class="label">{{ opt.label }}</text> | ||
| 112 | - </view> | ||
| 113 | - </view> | ||
| 114 | - </view> | 95 | + <uni-list-item class="select-item" :class="form.specialTermsName ? 'is-filled' : 'is-empty'" clickable |
| 96 | + @click="openSheet('specialTerms')" :rightText="form.specialTermsName || '请选择'" showArrow> | ||
| 97 | + <template v-slot:body> | ||
| 98 | + <view class="item-title"><text class="required">*</text><text>特别条款要求</text></view> | ||
| 99 | + </template> | ||
| 100 | + </uni-list-item> | ||
| 101 | + <uni-list-item class="select-item" :class="form.executionStandardName ? 'is-filled' : 'is-empty'" clickable | ||
| 102 | + @click="openSheet('executionStandard')" :rightText="form.executionStandardName || '请选择'" showArrow> | ||
| 103 | + <template v-slot:body> | ||
| 104 | + <view class="item-title"><text>执行标准</text></view> | ||
| 105 | + </template> | ||
| 106 | + </uni-list-item> | ||
| 115 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> | 107 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> |
| 116 | <template v-slot:footer> | 108 | <template v-slot:footer> |
| 117 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" | 109 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" |
| 118 | :inputBorder="false" /> | 110 | :inputBorder="false" /> |
| 119 | </template> | 111 | </template> |
| 120 | </uni-list-item> | 112 | </uni-list-item> |
| 121 | - <uni-list-item title="特别说明"> | 113 | + <uni-list-item title="特别说明" style="margin-top: 20rpx;"> |
| 122 | <template v-slot:footer> | 114 | <template v-slot:footer> |
| 123 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> | 115 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> |
| 124 | </template> | 116 | </template> |
| @@ -181,7 +173,7 @@ | @@ -181,7 +173,7 @@ | ||
| 181 | 数量 | 173 | 数量 |
| 182 | </div> | 174 | </div> |
| 183 | <div class="total-item-price"> | 175 | <div class="total-item-price"> |
| 184 | - {{ (sumQuantity || 0).toFixed(2) }}t | 176 | + {{ (totalQuantity || 0).toFixed(2) }}kg |
| 185 | </div> | 177 | </div> |
| 186 | </div> | 178 | </div> |
| 187 | <div class="total-item"> | 179 | <div class="total-item"> |
| @@ -189,7 +181,7 @@ | @@ -189,7 +181,7 @@ | ||
| 189 | 不含税金额 | 181 | 不含税金额 |
| 190 | </div> | 182 | </div> |
| 191 | <div class="total-item-price text-red"> | 183 | <div class="total-item-price text-red"> |
| 192 | - ¥{{ (sumAmountExcl || 0).toFixed(2) }} | 184 | + ¥{{ (totalAmountExcludingTax || 0).toFixed(2) }} |
| 193 | </div> | 185 | </div> |
| 194 | </div> | 186 | </div> |
| 195 | <div class="total-item"> | 187 | <div class="total-item"> |
| @@ -197,7 +189,7 @@ | @@ -197,7 +189,7 @@ | ||
| 197 | 总金额 | 189 | 总金额 |
| 198 | </div> | 190 | </div> |
| 199 | <div class="total-item-price text-red"> | 191 | <div class="total-item-price text-red"> |
| 200 | - ¥{{ (sumTotal || 0).toFixed(2) }} | 192 | + ¥{{ (totalAmountIncludingTax || 0).toFixed(2) }} |
| 201 | </div> | 193 | </div> |
| 202 | </div> | 194 | </div> |
| 203 | </div> | 195 | </div> |
| @@ -233,6 +225,7 @@ export default { | @@ -233,6 +225,7 @@ export default { | ||
| 233 | buyer: '', | 225 | buyer: '', |
| 234 | buyerName: '', | 226 | buyerName: '', |
| 235 | orderDate: '', | 227 | orderDate: '', |
| 228 | + deliveryDate: '', | ||
| 236 | designatedConsignee: '', | 229 | designatedConsignee: '', |
| 237 | specialTerms: '', | 230 | specialTerms: '', |
| 238 | specialTermsName: '', | 231 | specialTermsName: '', |
| @@ -263,9 +256,9 @@ export default { | @@ -263,9 +256,9 @@ export default { | ||
| 263 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], | 256 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], |
| 264 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, | 257 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, |
| 265 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, | 258 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, |
| 266 | - sumQuantity: 0, | ||
| 267 | - sumAmountExcl: 0, | ||
| 268 | - sumTotal: 0, | 259 | + totalQuantity: 0, |
| 260 | + totalAmountExcludingTax: 0, | ||
| 261 | + totalAmountIncludingTax: 0, | ||
| 269 | productLineList: [], | 262 | productLineList: [], |
| 270 | productList: [], | 263 | productList: [], |
| 271 | customerRemarks: [], | 264 | customerRemarks: [], |
| @@ -369,9 +362,9 @@ export default { | @@ -369,9 +362,9 @@ export default { | ||
| 369 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) | 362 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) |
| 370 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) | 363 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) |
| 371 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) | 364 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) |
| 372 | - this.sumQuantity = sumQ | ||
| 373 | - this.sumAmountExcl = sumE | ||
| 374 | - this.sumTotal = sumT | 365 | + this.totalQuantity = sumQ |
| 366 | + this.totalAmountExcludingTax = sumE | ||
| 367 | + this.totalAmountIncludingTax = sumT | ||
| 375 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) | 368 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) |
| 376 | this.productLineList = list | 369 | this.productLineList = list |
| 377 | }, | 370 | }, |
| @@ -447,6 +440,10 @@ export default { | @@ -447,6 +440,10 @@ export default { | ||
| 447 | setSheet('生产厂', opts) | 440 | setSheet('生产厂', opts) |
| 448 | } else if (field === 'supplier') { | 441 | } else if (field === 'supplier') { |
| 449 | setSheet('供方', this.supplierList) | 442 | setSheet('供方', this.supplierList) |
| 443 | + } else if (field === 'specialTerms') { | ||
| 444 | + setSheet('特别条款要求', this.specialTermsList) | ||
| 445 | + } else if (field === 'executionStandard') { | ||
| 446 | + setSheet('执行标准', this.executionStandardList) | ||
| 450 | } else if (field === 'includesPackagingFee') { | 447 | } else if (field === 'includesPackagingFee') { |
| 451 | setSheet('单价中是否已包含包装费', this.yesNoList) | 448 | setSheet('单价中是否已包含包装费', this.yesNoList) |
| 452 | } else if (field === 'includesTransportFee') { | 449 | } else if (field === 'includesTransportFee') { |
| @@ -517,9 +514,9 @@ export default { | @@ -517,9 +514,9 @@ export default { | ||
| 517 | ...formForSubmit, | 514 | ...formForSubmit, |
| 518 | destination, | 515 | destination, |
| 519 | type: 'DISTRIB_STD', | 516 | type: 'DISTRIB_STD', |
| 520 | - sumQuantity: this.sumQuantity, | ||
| 521 | - sumAmountExcl: this.sumAmountExcl, | ||
| 522 | - sumTotal: this.sumTotal, | 517 | + totalQuantity: this.totalQuantity, |
| 518 | + totalAmountExcludingTax: this.totalAmountExcludingTax, | ||
| 519 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | ||
| 523 | contractDistributorLineList: lines | 520 | contractDistributorLineList: lines |
| 524 | }) | 521 | }) |
| 525 | console.log('onSubmit__payload', payload) | 522 | console.log('onSubmit__payload', payload) |
| @@ -538,18 +535,31 @@ export default { | @@ -538,18 +535,31 @@ export default { | ||
| 538 | { key: 'supplier', label: '供方' }, | 535 | { key: 'supplier', label: '供方' }, |
| 539 | { key: 'buyer', label: '需方' }, | 536 | { key: 'buyer', label: '需方' }, |
| 540 | { key: 'orderDate', label: '订货日期' }, | 537 | { key: 'orderDate', label: '订货日期' }, |
| 538 | + { key: 'unit', label: '单位' }, | ||
| 541 | { key: 'workshopId', label: '生产厂' }, | 539 | { key: 'workshopId', label: '生产厂' }, |
| 540 | + { key: 'specialTerms', label: '特别条款要求' }, | ||
| 542 | ] | 541 | ] |
| 543 | for (const it of checks) { | 542 | for (const it of checks) { |
| 544 | const val = this.form[it.key] | 543 | const val = this.form[it.key] |
| 545 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) | 544 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) |
| 546 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } | 545 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } |
| 547 | } | 546 | } |
| 548 | - if (!Array.isArray(this.productLineList) || this.productLineList.length === 0) { | 547 | + const list = Array.isArray(this.productLineList) ? this.productLineList : [] |
| 548 | + if (list.length === 0) { | ||
| 549 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false | 549 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false |
| 550 | } | 550 | } |
| 551 | - for (const [idx, it] of this.productLineList.entries()) { | ||
| 552 | - if (!it.productName || !it.quantity || !it.unitPrice) { | 551 | + const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === '')) |
| 552 | + const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v))) | ||
| 553 | + for (const [idx, it] of list.entries()) { | ||
| 554 | + if ( | ||
| 555 | + strEmpty(it.productName) || | ||
| 556 | + strEmpty(it.industry) || | ||
| 557 | + strEmpty(it.quality) || | ||
| 558 | + strEmpty(it.brand) || | ||
| 559 | + numEmpty(it.quantity) || | ||
| 560 | + numEmpty(it.unitPrice) || | ||
| 561 | + strEmpty(it.deliveryDate) | ||
| 562 | + ) { | ||
| 553 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false | 563 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false |
| 554 | } | 564 | } |
| 555 | } | 565 | } |
| @@ -577,7 +587,7 @@ export default { | @@ -577,7 +587,7 @@ export default { | ||
| 577 | color: rgba(0, 0, 0, 0.6); | 587 | color: rgba(0, 0, 0, 0.6); |
| 578 | line-height: 32rpx; | 588 | line-height: 32rpx; |
| 579 | width: 240rpx; | 589 | width: 240rpx; |
| 580 | - padding: 24rpx 0; | 590 | + padding: 12rpx 0; |
| 581 | } | 591 | } |
| 582 | .total-item-price { | 592 | .total-item-price { |
| 583 | font-weight: 600; | 593 | font-weight: 600; |
| @@ -599,7 +609,7 @@ export default { | @@ -599,7 +609,7 @@ export default { | ||
| 599 | 609 | ||
| 600 | .scroll { | 610 | .scroll { |
| 601 | flex: 1; | 611 | flex: 1; |
| 602 | - padding: 12rpx 0 480rpx !important; | 612 | + padding: 12rpx 0 392rpx !important; |
| 603 | } | 613 | } |
| 604 | 614 | ||
| 605 | .footer { | 615 | .footer { |
| @@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
| 41 | </template> | 41 | </template> |
| 42 | </uni-list-item> | 42 | </uni-list-item> |
| 43 | 43 | ||
| 44 | - <ProductRel mode="add" :orderDateBase="form.orderDate" :list="productLineList" @change="onProductsChange" :options="productList" /> | 44 | + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" /> |
| 45 | 45 | ||
| 46 | <uni-list-item title="合计人民币金额(大写)"> | 46 | <uni-list-item title="合计人民币金额(大写)"> |
| 47 | <template v-slot:footer> | 47 | <template v-slot:footer> |
| @@ -99,33 +99,25 @@ | @@ -99,33 +99,25 @@ | ||
| 99 | </template> | 99 | </template> |
| 100 | </uni-list-item> | 100 | </uni-list-item> |
| 101 | 101 | ||
| 102 | - <view class="group"> | ||
| 103 | - <view class="group-title">特别条款要求</view> | ||
| 104 | - <view class="radio-list"> | ||
| 105 | - <view v-for="(opt, i) in specialTermsList" :key="'cr-' + i" class="radio-item" | ||
| 106 | - @click="onRadioSelect('specialTerms', 'specialTermsName', opt)"> | ||
| 107 | - <view :class="['radio', { checked: form.specialTerms === opt.value }]" /> | ||
| 108 | - <text class="label">{{ opt.label }}</text> | ||
| 109 | - </view> | ||
| 110 | - </view> | ||
| 111 | - </view> | ||
| 112 | - <view class="group"> | ||
| 113 | - <view class="group-title">执行标准</view> | ||
| 114 | - <view class="radio-list"> | ||
| 115 | - <view v-for="(opt, i) in executionStandardList" :key="'es-' + i" class="radio-item" | ||
| 116 | - @click="onRadioSelect('executionStandard', 'executionStandardName', opt)"> | ||
| 117 | - <view :class="['radio', { checked: form.executionStandard === opt.value }]" /> | ||
| 118 | - <text class="label">{{ opt.label }}</text> | ||
| 119 | - </view> | ||
| 120 | - </view> | ||
| 121 | - </view> | 102 | + <uni-list-item class="select-item" :class="form.specialTermsName ? 'is-filled' : 'is-empty'" clickable |
| 103 | + @click="openSheet('specialTerms')" :rightText="form.specialTermsName || '请选择'" showArrow> | ||
| 104 | + <template v-slot:body> | ||
| 105 | + <view class="item-title"><text class="required">*</text><text>特别条款要求</text></view> | ||
| 106 | + </template> | ||
| 107 | + </uni-list-item> | ||
| 108 | + <uni-list-item class="select-item" :class="form.executionStandardName ? 'is-filled' : 'is-empty'" clickable | ||
| 109 | + @click="openSheet('executionStandard')" :rightText="form.executionStandardName || '请选择'" showArrow> | ||
| 110 | + <template v-slot:body> | ||
| 111 | + <view class="item-title"><text>执行标准</text></view> | ||
| 112 | + </template> | ||
| 113 | + </uni-list-item> | ||
| 122 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> | 114 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> |
| 123 | <template v-slot:footer> | 115 | <template v-slot:footer> |
| 124 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" | 116 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" |
| 125 | :inputBorder="false" /> | 117 | :inputBorder="false" /> |
| 126 | </template> | 118 | </template> |
| 127 | </uni-list-item> | 119 | </uni-list-item> |
| 128 | - <uni-list-item title="特别说明"> | 120 | + <uni-list-item title="特别说明" style="margin-top: 20rpx;"> |
| 129 | <template v-slot:footer> | 121 | <template v-slot:footer> |
| 130 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> | 122 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> |
| 131 | </template> | 123 | </template> |
| @@ -177,15 +169,15 @@ | @@ -177,15 +169,15 @@ | ||
| 177 | <div class="total-text">合计</div> | 169 | <div class="total-text">合计</div> |
| 178 | <div class="total-item"> | 170 | <div class="total-item"> |
| 179 | <div class="total-item-text">数量</div> | 171 | <div class="total-item-text">数量</div> |
| 180 | - <div class="total-item-price">{{ (sumQuantity || 0).toFixed(2) }}t</div> | 172 | + <div class="total-item-price">{{ (totalQuantity || 0).toFixed(2) }}kg</div> |
| 181 | </div> | 173 | </div> |
| 182 | <div class="total-item"> | 174 | <div class="total-item"> |
| 183 | <div class="total-item-text">不含税金额</div> | 175 | <div class="total-item-text">不含税金额</div> |
| 184 | - <div class="total-item-price text-red">¥{{ (sumAmountExcl || 0).toFixed(2) }}</div> | 176 | + <div class="total-item-price text-red">¥{{ (totalAmountExcludingTax || 0).toFixed(2) }}</div> |
| 185 | </div> | 177 | </div> |
| 186 | <div class="total-item"> | 178 | <div class="total-item"> |
| 187 | <div class="total-item-text">总金额</div> | 179 | <div class="total-item-text">总金额</div> |
| 188 | - <div class="total-item-price text-red">¥{{ (sumTotal || 0).toFixed(2) }}</div> | 180 | + <div class="total-item-price text-red">¥{{ (totalAmountIncludingTax || 0).toFixed(2) }}</div> |
| 189 | </div> | 181 | </div> |
| 190 | </div> | 182 | </div> |
| 191 | <button class="btn submit" type="primary" @click="onSubmit">保存</button> | 183 | <button class="btn submit" type="primary" @click="onSubmit">保存</button> |
| @@ -223,6 +215,7 @@ export default { | @@ -223,6 +215,7 @@ export default { | ||
| 223 | workshopId: '', | 215 | workshopId: '', |
| 224 | workshopName: '', | 216 | workshopName: '', |
| 225 | orderDate: '', | 217 | orderDate: '', |
| 218 | + deliveryDate: '', | ||
| 226 | designatedConsignee: '', | 219 | designatedConsignee: '', |
| 227 | specialTerms: '', | 220 | specialTerms: '', |
| 228 | specialTermsName: '', | 221 | specialTermsName: '', |
| @@ -256,9 +249,9 @@ export default { | @@ -256,9 +249,9 @@ export default { | ||
| 256 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], | 249 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], |
| 257 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, | 250 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, |
| 258 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, | 251 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, |
| 259 | - sumQuantity: 0, | ||
| 260 | - sumAmountExcl: 0, | ||
| 261 | - sumTotal: 0, | 252 | + totalQuantity: 0, |
| 253 | + totalAmountExcludingTax: 0, | ||
| 254 | + totalAmountIncludingTax: 0, | ||
| 262 | productLineList: [], | 255 | productLineList: [], |
| 263 | newProductLineList: [], | 256 | newProductLineList: [], |
| 264 | productList: [] | 257 | productList: [] |
| @@ -349,9 +342,9 @@ export default { | @@ -349,9 +342,9 @@ export default { | ||
| 349 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) | 342 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) |
| 350 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) | 343 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) |
| 351 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) | 344 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) |
| 352 | - this.sumQuantity = sumQ | ||
| 353 | - this.sumAmountExcl = sumE | ||
| 354 | - this.sumTotal = sumT | 345 | + this.totalQuantity = sumQ |
| 346 | + this.totalAmountExcludingTax = sumE | ||
| 347 | + this.totalAmountIncludingTax = sumT | ||
| 355 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) | 348 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) |
| 356 | }, | 349 | }, |
| 357 | async loadSuppliers() { | 350 | async loadSuppliers() { |
| @@ -399,6 +392,10 @@ export default { | @@ -399,6 +392,10 @@ export default { | ||
| 399 | setSheet('生产厂', opts) | 392 | setSheet('生产厂', opts) |
| 400 | } else if (field === 'supplier') { | 393 | } else if (field === 'supplier') { |
| 401 | setSheet('供方', this.supplierList) | 394 | setSheet('供方', this.supplierList) |
| 395 | + } else if (field === 'specialTerms') { | ||
| 396 | + setSheet('特别条款要求', this.specialTermsList) | ||
| 397 | + } else if (field === 'executionStandard') { | ||
| 398 | + setSheet('执行标准', this.executionStandardList) | ||
| 402 | } else if (field === 'includesPackagingFee') { | 399 | } else if (field === 'includesPackagingFee') { |
| 403 | setSheet('单价中是否已包含包装费', this.yesNoList) | 400 | setSheet('单价中是否已包含包装费', this.yesNoList) |
| 404 | } else if (field === 'includesTransportFee') { | 401 | } else if (field === 'includesTransportFee') { |
| @@ -443,18 +440,32 @@ export default { | @@ -443,18 +440,32 @@ export default { | ||
| 443 | { key: 'supplier', label: '供方' }, | 440 | { key: 'supplier', label: '供方' }, |
| 444 | { key: 'buyer', label: '需方' }, | 441 | { key: 'buyer', label: '需方' }, |
| 445 | { key: 'orderDate', label: '订货日期' }, | 442 | { key: 'orderDate', label: '订货日期' }, |
| 443 | + { key: 'unit', label: '单位' }, | ||
| 446 | { key: 'workshopId', label: '生产厂' }, | 444 | { key: 'workshopId', label: '生产厂' }, |
| 445 | + { key: 'specialTerms', label: '特别条款要求' }, | ||
| 447 | ] | 446 | ] |
| 448 | for (const it of checks) { | 447 | for (const it of checks) { |
| 449 | const val = this.form[it.key] | 448 | const val = this.form[it.key] |
| 450 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) | 449 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) |
| 451 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } | 450 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } |
| 452 | } | 451 | } |
| 453 | - if (!Array.isArray(this.productLineList) || this.productLineList.length === 0) { | 452 | + const list = Array.isArray(this.newProductLineList) ? this.newProductLineList : [] |
| 453 | + if (list.length === 0) { | ||
| 454 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false | 454 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false |
| 455 | } | 455 | } |
| 456 | - for (const [idx, it] of this.productLineList.entries()) { | ||
| 457 | - if (!it.productName || !it.quantity || !it.unitPrice) { | 456 | + const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === '')) |
| 457 | + const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v))) | ||
| 458 | + for (const [idx, it] of list.entries()) { | ||
| 459 | + console.log('it111', it) | ||
| 460 | + if ( | ||
| 461 | + strEmpty(it.productName) || | ||
| 462 | + strEmpty(it.industry) || | ||
| 463 | + strEmpty(it.quality) || | ||
| 464 | + strEmpty(it.brand) || | ||
| 465 | + numEmpty(it.quantity) || | ||
| 466 | + numEmpty(it.unitPrice) || | ||
| 467 | + strEmpty(it.deliveryDate) | ||
| 468 | + ) { | ||
| 458 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false | 469 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false |
| 459 | } | 470 | } |
| 460 | } | 471 | } |
| @@ -486,9 +497,9 @@ export default { | @@ -486,9 +497,9 @@ export default { | ||
| 486 | id: this.form.id, | 497 | id: this.form.id, |
| 487 | destination, | 498 | destination, |
| 488 | type: 'DISTRIB_STD', | 499 | type: 'DISTRIB_STD', |
| 489 | - sumQuantity: this.sumQuantity, | ||
| 490 | - sumAmountExcl: this.sumAmountExcl, | ||
| 491 | - sumTotal: this.sumTotal, | 500 | + totalQuantity: this.totalQuantity, |
| 501 | + totalAmountExcludingTax: this.totalAmountExcludingTax, | ||
| 502 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | ||
| 492 | contractDistributorLineList: lines | 503 | contractDistributorLineList: lines |
| 493 | }) | 504 | }) |
| 494 | try { | 505 | try { |
| @@ -524,7 +535,7 @@ export default { | @@ -524,7 +535,7 @@ export default { | ||
| 524 | color: rgba(0, 0, 0, 0.6); | 535 | color: rgba(0, 0, 0, 0.6); |
| 525 | line-height: 32rpx; | 536 | line-height: 32rpx; |
| 526 | width: 240rpx; | 537 | width: 240rpx; |
| 527 | - padding: 24rpx 0; | 538 | + padding: 12rpx 0; |
| 528 | } | 539 | } |
| 529 | 540 | ||
| 530 | .total-item-price { | 541 | .total-item-price { |
| @@ -547,7 +558,7 @@ export default { | @@ -547,7 +558,7 @@ export default { | ||
| 547 | 558 | ||
| 548 | .scroll { | 559 | .scroll { |
| 549 | flex: 1; | 560 | flex: 1; |
| 550 | - padding: 12rpx 0 480rpx !important; | 561 | + padding: 12rpx 0 392rpx !important; |
| 551 | } | 562 | } |
| 552 | 563 | ||
| 553 | .footer { | 564 | .footer { |
| @@ -742,4 +753,4 @@ export default { | @@ -742,4 +753,4 @@ export default { | ||
| 742 | } | 753 | } |
| 743 | } | 754 | } |
| 744 | 755 | ||
| 745 | -</style> | ||
| 756 | +</style> |
| @@ -55,51 +55,51 @@ | @@ -55,51 +55,51 @@ | ||
| 55 | </uni-list-item> | 55 | </uni-list-item> |
| 56 | <uni-list-item title="厚度"> | 56 | <uni-list-item title="厚度"> |
| 57 | <template v-slot:footer> | 57 | <template v-slot:footer> |
| 58 | - <uni-easyinput v-model="item.thickness" :inputBorder="false" placeholder="请输入厚度" /> | 58 | + <uni-easyinput type="digit" v-model="item.thickness" :inputBorder="false" placeholder="请输入厚度" @input="onNonNegativeInput(idx, 'thickness')" @blur="onNonNegativeBlur(idx, 'thickness', 2)" /> |
| 59 | </template> | 59 | </template> |
| 60 | </uni-list-item> | 60 | </uni-list-item> |
| 61 | <uni-list-item title="厚度公差(单项+)"> | 61 | <uni-list-item title="厚度公差(单项+)"> |
| 62 | <template v-slot:footer> | 62 | <template v-slot:footer> |
| 63 | - <uni-easyinput v-model="item.thicknessTolPos" :inputBorder="false" | ||
| 64 | - placeholder="请输入厚度公差(单项+)" /> | 63 | + <uni-easyinput type="digit" v-model="item.thicknessTolPos" :inputBorder="false" |
| 64 | + placeholder="请输入厚度公差(单项+)" @input="onNonNegativeInput(idx, 'thicknessTolPos')" @blur="onNonNegativeBlur(idx, 'thicknessTolPos', 2)" /> | ||
| 65 | </template> | 65 | </template> |
| 66 | </uni-list-item> | 66 | </uni-list-item> |
| 67 | <uni-list-item title="厚度公差(单项-)"> | 67 | <uni-list-item title="厚度公差(单项-)"> |
| 68 | <template v-slot:footer> | 68 | <template v-slot:footer> |
| 69 | - <uni-easyinput v-model="item.thicknessTolNeg" :inputBorder="false" | ||
| 70 | - placeholder="请输入厚度公差(单项-)" /> | 69 | + <uni-easyinput type="digit" v-model="item.thicknessTolNeg" :inputBorder="false" |
| 70 | + placeholder="请输入厚度公差(单项-)" @input="onNonNegativeInput(idx, 'thicknessTolNeg')" @blur="onNonNegativeBlur(idx, 'thicknessTolNeg', 2)" /> | ||
| 71 | </template> | 71 | </template> |
| 72 | </uni-list-item> | 72 | </uni-list-item> |
| 73 | <uni-list-item title="宽度"> | 73 | <uni-list-item title="宽度"> |
| 74 | <template v-slot:footer> | 74 | <template v-slot:footer> |
| 75 | - <uni-easyinput v-model="item.width" :inputBorder="false" placeholder="请输入宽度" /> | 75 | + <uni-easyinput type="digit" v-model="item.width" :inputBorder="false" placeholder="请输入宽度" @input="onNonNegativeInput(idx, 'width')" @blur="onNonNegativeBlur(idx, 'width', 2)" /> |
| 76 | </template> | 76 | </template> |
| 77 | </uni-list-item> | 77 | </uni-list-item> |
| 78 | <uni-list-item title="宽度公差(单项+)"> | 78 | <uni-list-item title="宽度公差(单项+)"> |
| 79 | <template v-slot:footer> | 79 | <template v-slot:footer> |
| 80 | - <uni-easyinput v-model="item.widthTolPos" :inputBorder="false" placeholder="请输入宽度公差(单项+)" /> | 80 | + <uni-easyinput type="digit" v-model="item.widthTolPos" :inputBorder="false" placeholder="请输入宽度公差(单项+)" @input="onNonNegativeInput(idx, 'widthTolPos')" @blur="onNonNegativeBlur(idx, 'widthTolPos', 2)" /> |
| 81 | </template> | 81 | </template> |
| 82 | </uni-list-item> | 82 | </uni-list-item> |
| 83 | <uni-list-item title="宽度公差(单项-)"> | 83 | <uni-list-item title="宽度公差(单项-)"> |
| 84 | <template v-slot:footer> | 84 | <template v-slot:footer> |
| 85 | - <uni-easyinput v-model="item.widthTolNeg" :inputBorder="false" placeholder="请输入宽度公差(单项-)" /> | 85 | + <uni-easyinput type="digit" v-model="item.widthTolNeg" :inputBorder="false" placeholder="请输入宽度公差(单项-)" @input="onNonNegativeInput(idx, 'widthTolNeg')" @blur="onNonNegativeBlur(idx, 'widthTolNeg', 2)" /> |
| 86 | </template> | 86 | </template> |
| 87 | </uni-list-item> | 87 | </uni-list-item> |
| 88 | <uni-list-item title="长度"> | 88 | <uni-list-item title="长度"> |
| 89 | <template v-slot:footer> | 89 | <template v-slot:footer> |
| 90 | - <uni-easyinput v-model="item.length" :inputBorder="false" placeholder="请输入长度" /> | 90 | + <uni-easyinput type="digit" v-model="item.length" :inputBorder="false" placeholder="请输入长度" @input="onNonNegativeInput(idx, 'length')" @blur="onNonNegativeBlur(idx, 'length', 2)" /> |
| 91 | </template> | 91 | </template> |
| 92 | </uni-list-item> | 92 | </uni-list-item> |
| 93 | <uni-list-item title="长度公差(单项+)"> | 93 | <uni-list-item title="长度公差(单项+)"> |
| 94 | <template v-slot:footer> | 94 | <template v-slot:footer> |
| 95 | - <uni-easyinput v-model="item.lengthTolPos" :inputBorder="false" | ||
| 96 | - placeholder="请输入长度公差(单项+)" /> | 95 | + <uni-easyinput type="digit" v-model="item.lengthTolPos" :inputBorder="false" |
| 96 | + placeholder="请输入长度公差(单项+)" @input="onNonNegativeInput(idx, 'lengthTolPos')" @blur="onNonNegativeBlur(idx, 'lengthTolPos', 2)" /> | ||
| 97 | </template> | 97 | </template> |
| 98 | </uni-list-item> | 98 | </uni-list-item> |
| 99 | <uni-list-item title="长度公差(单项-)"> | 99 | <uni-list-item title="长度公差(单项-)"> |
| 100 | <template v-slot:footer> | 100 | <template v-slot:footer> |
| 101 | - <uni-easyinput v-model="item.lengthTolNeg" :inputBorder="false" | ||
| 102 | - placeholder="请输入长度公差(单项-)" /> | 101 | + <uni-easyinput type="digit" v-model="item.lengthTolNeg" :inputBorder="false" |
| 102 | + placeholder="请输入长度公差(单项-)" @input="onNonNegativeInput(idx, 'lengthTolNeg')" @blur="onNonNegativeBlur(idx, 'lengthTolNeg', 2)" /> | ||
| 103 | </template> | 103 | </template> |
| 104 | </uni-list-item> | 104 | </uni-list-item> |
| 105 | <uni-list-item title="状态"> | 105 | <uni-list-item title="状态"> |
| @@ -107,14 +107,14 @@ | @@ -107,14 +107,14 @@ | ||
| 107 | <uni-easyinput v-model="item.status" :inputBorder="false" placeholder="请输入状态" /> | 107 | <uni-easyinput v-model="item.status" :inputBorder="false" placeholder="请输入状态" /> |
| 108 | </template> | 108 | </template> |
| 109 | </uni-list-item> | 109 | </uni-list-item> |
| 110 | - <uni-list-item title="数量"> | 110 | + <uni-list-item title="数量kg"> |
| 111 | <template v-slot:footer> | 111 | <template v-slot:footer> |
| 112 | - <uni-easyinput v-model="item.quantity" type="number" :inputBorder="false" placeholder="请输入数量" @input="onImmediateChange(idx)" @blur="onNumberBlur(idx, 'quantity', 0)" /> | 112 | + <uni-easyinput v-model="item.quantity" type="digit" :inputBorder="false" placeholder="请输入数量kg" @input="onNonNegativeInput(idx, 'quantity')" @blur="onNonNegativeBlur(idx, 'quantity', 2)" /> |
| 113 | </template> | 113 | </template> |
| 114 | </uni-list-item> | 114 | </uni-list-item> |
| 115 | - <uni-list-item title="单价"> | 115 | + <uni-list-item title="销售价格"> |
| 116 | <template v-slot:footer> | 116 | <template v-slot:footer> |
| 117 | - <uni-easyinput v-model="item.unitPrice" type="number" :inputBorder="false" placeholder="请输入单价" @input="onImmediateChange(idx)" @blur="onNumberBlur(idx, 'unitPrice', 0)" /> | 117 | + <uni-easyinput v-model="item.unitPrice" type="digit" :inputBorder="false" placeholder="请输入销售价格" @input="onNonNegativeInput(idx, 'unitPrice')" @blur="onNonNegativeBlur(idx, 'unitPrice', 2)" /> |
| 118 | </template> | 118 | </template> |
| 119 | </uni-list-item> | 119 | </uni-list-item> |
| 120 | <uni-list-item title="不含税金额"> | 120 | <uni-list-item title="不含税金额"> |
| @@ -129,7 +129,7 @@ | @@ -129,7 +129,7 @@ | ||
| 129 | </uni-list-item> | 129 | </uni-list-item> |
| 130 | <uni-list-item title="发货日期"> | 130 | <uni-list-item title="发货日期"> |
| 131 | <template v-slot:footer> | 131 | <template v-slot:footer> |
| 132 | - <uni-datetime-picker type="date" v-model="item.orderDate" @change="onDateChange(idx, $event)" /> | 132 | + <uni-datetime-picker type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" /> |
| 133 | </template> | 133 | </template> |
| 134 | </uni-list-item> | 134 | </uni-list-item> |
| 135 | </uni-list> | 135 | </uni-list> |
| @@ -151,7 +151,30 @@ | @@ -151,7 +151,30 @@ | ||
| 151 | <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view> | 151 | <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view> |
| 152 | <view class="row"><text class="label">牌号</text><text class="value">{{ item.brand }}</text></view> | 152 | <view class="row"><text class="label">牌号</text><text class="value">{{ item.brand }}</text></view> |
| 153 | <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view> | 153 | <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view> |
| 154 | - <view class="row"><text class="label">规格</text><text class="value">{{ item.specDisplay }}</text></view> | 154 | + <!-- 厚(公差) * 宽(公差) * 长(公差) --> |
| 155 | + <view class="row row-spec"><text class="label">规格(mm)</text> | ||
| 156 | + <view class="value value-spec"> | ||
| 157 | + <view v-if="item.thickness" class="value-spec_val">{{ item.thickness }}</view> | ||
| 158 | + <view v-if="item.thickness" class="value-spec_box"> | ||
| 159 | + <view v-if="item.thicknessTolPos" class="value-spec_box_1">+{{ item.thicknessTolPos }} | ||
| 160 | + </view> | ||
| 161 | + <view v-if="item.thicknessTolNeg" class="value-spec_box_2">-{{ item.thicknessTolNeg }} | ||
| 162 | + </view> | ||
| 163 | + </view> | ||
| 164 | + <view v-if="item.width" class="value-spec_val p12">*</view> | ||
| 165 | + <view v-if="item.width" class="value-spec_val">{{ item.width }}</view> | ||
| 166 | + <view v-if="item.width" class="value-spec_box"> | ||
| 167 | + <view v-if="item.widthTolPos" class="value-spec_box_1">+{{ item.widthTolPos }}</view> | ||
| 168 | + <view v-if="item.widthTolNeg" class="value-spec_box_2">-{{ item.widthTolNeg }}</view> | ||
| 169 | + </view> | ||
| 170 | + <view v-if="item.length" class="value-spec_val p12">*</view> | ||
| 171 | + <view v-if="item.length" class="value-spec_val">{{ item.length }}</view> | ||
| 172 | + <view v-if="item.length" class="value-spec_box"> | ||
| 173 | + <view v-if="item.lengthTolPos" class="value-spec_box_1">+{{ item.lengthTolPos }}</view> | ||
| 174 | + <view v-if="item.lengthTolNeg" class="value-spec_box_2">-{{ item.lengthTolNeg }}</view> | ||
| 175 | + </view> | ||
| 176 | + </view> | ||
| 177 | + </view> | ||
| 155 | <view class="row"><text class="label">状态</text><text class="value">{{ item.status }}</text></view> | 178 | <view class="row"><text class="label">状态</text><text class="value">{{ item.status }}</text></view> |
| 156 | <view class="row"><text class="label">数量</text><text class="value">{{ item.quantity }}</text></view> | 179 | <view class="row"><text class="label">数量</text><text class="value">{{ item.quantity }}</text></view> |
| 157 | <view class="row"><text class="label">单价</text><text class="value">{{ formatCurrency(item.unitPrice) | 180 | <view class="row"><text class="label">单价</text><text class="value">{{ formatCurrency(item.unitPrice) |
| @@ -162,7 +185,7 @@ | @@ -162,7 +185,7 @@ | ||
| 162 | }}</text></view> | 185 | }}</text></view> |
| 163 | <view class="row"><text class="label">总金额</text><text class="value">{{ formatCurrency(item.totalAmount) | 186 | <view class="row"><text class="label">总金额</text><text class="value">{{ formatCurrency(item.totalAmount) |
| 164 | }}</text></view> | 187 | }}</text></view> |
| 165 | - <view class="row"><text class="label">发货日期</text><text class="value">{{ item.orderDate }}</text></view> | 188 | + <view class="row"><text class="label">发货日期</text><text class="value">{{ item.deliveryDate }}</text></view> |
| 166 | </view> | 189 | </view> |
| 167 | </view> | 190 | </view> |
| 168 | <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value" @confirm="onProductConfirm" /> | 191 | <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value" @confirm="onProductConfirm" /> |
| @@ -176,7 +199,7 @@ export default { | @@ -176,7 +199,7 @@ export default { | ||
| 176 | mode: { type: String, default: 'add' }, | 199 | mode: { type: String, default: 'add' }, |
| 177 | list: { type: Array, default: () => [] }, | 200 | list: { type: Array, default: () => [] }, |
| 178 | max: { type: Number, default: 8 }, | 201 | max: { type: Number, default: 8 }, |
| 179 | - orderDateBase: { type: String, default: '' }, | 202 | + deliveryDateBase: { type: String, default: '' }, |
| 180 | options: { type: Array, default: () => [] } | 203 | options: { type: Array, default: () => [] } |
| 181 | }, | 204 | }, |
| 182 | components: { SingleSelectSheet }, | 205 | components: { SingleSelectSheet }, |
| @@ -218,10 +241,18 @@ export default { | @@ -218,10 +241,18 @@ export default { | ||
| 218 | }, | 241 | }, |
| 219 | methods: { | 242 | methods: { |
| 220 | defaultItem() { | 243 | defaultItem() { |
| 221 | - return { productId: '', productName: '', industry: '', brand: '', quality: '', thickness: '', thicknessTolPos: '', thicknessTolNeg: '', width: '', widthTolPos: '', widthTolNeg: '', length: '', lengthTolPos: '', lengthTolNeg: '', status: '', quantity: '', unitPrice: '', amountExcludingTax: 0, totalAmount: 0, orderDate: '' } | 244 | + return { productId: '', productName: '', industry: '', brand: '', quality: '', thickness: '', thicknessTolPos: '', thicknessTolNeg: '', width: '', widthTolPos: '', widthTolNeg: '', length: '', lengthTolPos: '', lengthTolNeg: '', status: '', quantity: '', unitPrice: '', amountExcludingTax: 0, totalAmount: 0, deliveryDate: '' } |
| 222 | }, | 245 | }, |
| 223 | - onImmediateChange(idx) { | ||
| 224 | - this.$nextTick(() => this.recalculate(idx)) | 246 | + onNonNegativeInput(idx, field) { |
| 247 | + const it = this.items[idx] | ||
| 248 | + if (!it) return | ||
| 249 | + let v = String(it[field] != null ? it[field] : '') | ||
| 250 | + v = v.replace(/[^0-9.]/g, '') | ||
| 251 | + v = v.replace(/(\..*)\./g, '$1') | ||
| 252 | + if (v.startsWith('.')) v = '0' + v | ||
| 253 | + it[field] = v | ||
| 254 | + this.$set(this.items, idx, it) | ||
| 255 | + if (field === 'quantity' || field === 'unitPrice') this.$nextTick(() => this.recalculate(idx)) | ||
| 225 | }, | 256 | }, |
| 226 | toNumber(val) { | 257 | toNumber(val) { |
| 227 | if (typeof val === 'number') return isNaN(val) ? 0 : val | 258 | if (typeof val === 'number') return isNaN(val) ? 0 : val |
| @@ -234,21 +265,21 @@ export default { | @@ -234,21 +265,21 @@ export default { | ||
| 234 | const m = Math.pow(10, digits) | 265 | const m = Math.pow(10, digits) |
| 235 | return Math.round(n * m) / m | 266 | return Math.round(n * m) / m |
| 236 | }, | 267 | }, |
| 237 | - onNumberBlur(idx, field, digits) { | 268 | + onNonNegativeBlur(idx, field, digits) { |
| 238 | const it = this.items[idx] | 269 | const it = this.items[idx] |
| 239 | if (!it) return | 270 | if (!it) return |
| 240 | const raw = it[field] | 271 | const raw = it[field] |
| 241 | - // 如果为空则保持为空,不自动置为0,仅重新计算依赖字段 | ||
| 242 | if (raw === '' || raw === null || raw === undefined) { | 272 | if (raw === '' || raw === null || raw === undefined) { |
| 243 | this.$set(this.items, idx, it) | 273 | this.$set(this.items, idx, it) |
| 244 | - this.recalculate(idx) | 274 | + if (field === 'quantity' || field === 'unitPrice') this.recalculate(idx) |
| 245 | return | 275 | return |
| 246 | } | 276 | } |
| 247 | - const num = this.toNumber(raw) | 277 | + let num = this.toNumber(raw) |
| 278 | + if (isNaN(num) || num < 0) num = 0 | ||
| 248 | const rounded = this.round(num, digits) | 279 | const rounded = this.round(num, digits) |
| 249 | it[field] = rounded | 280 | it[field] = rounded |
| 250 | this.$set(this.items, idx, it) | 281 | this.$set(this.items, idx, it) |
| 251 | - this.recalculate(idx) | 282 | + if (field === 'quantity' || field === 'unitPrice') this.recalculate(idx) |
| 252 | }, | 283 | }, |
| 253 | formatCurrency(val) { | 284 | formatCurrency(val) { |
| 254 | if (val == null || val === '') return '' | 285 | if (val == null || val === '') return '' |
| @@ -319,15 +350,15 @@ export default { | @@ -319,15 +350,15 @@ export default { | ||
| 319 | onDateChange(idx, e) { | 350 | onDateChange(idx, e) { |
| 320 | const it = this.items[idx] | 351 | const it = this.items[idx] |
| 321 | if (!it) return | 352 | if (!it) return |
| 322 | - const val = typeof e === 'string' ? e : (e && e.detail && e.detail.value) ? e.detail.value : it.orderDate | 353 | + const val = typeof e === 'string' ? e : (e && e.detail && e.detail.value) ? e.detail.value : it.deliveryDate |
| 323 | const dateStr = String(val).slice(0, 10) | 354 | const dateStr = String(val).slice(0, 10) |
| 324 | - const base = this.orderDateBase ? new Date(this.orderDateBase) : null | 355 | + const base = this.deliveryDateBase ? new Date(this.deliveryDateBase) : null |
| 325 | const d = new Date(dateStr) | 356 | const d = new Date(dateStr) |
| 326 | if (base && !isNaN(d.getTime()) && d.getTime() < base.getTime()) { | 357 | if (base && !isNaN(d.getTime()) && d.getTime() < base.getTime()) { |
| 327 | uni.showToast({ title: '发货日期不得早于订货日期', icon: 'none' }) | 358 | uni.showToast({ title: '发货日期不得早于订货日期', icon: 'none' }) |
| 328 | - it.orderDate = this.orderDateBase | 359 | + it.deliveryDate = this.deliveryDateBase |
| 329 | } else { | 360 | } else { |
| 330 | - it.orderDate = dateStr | 361 | + it.deliveryDate = dateStr |
| 331 | } | 362 | } |
| 332 | this.$set(this.items, idx, it) | 363 | this.$set(this.items, idx, it) |
| 333 | }, | 364 | }, |
| @@ -500,8 +531,46 @@ export default { | @@ -500,8 +531,46 @@ export default { | ||
| 500 | 531 | ||
| 501 | .value { | 532 | .value { |
| 502 | flex: 1; | 533 | flex: 1; |
| 503 | - text-align: right; | 534 | + // text-align: right; |
| 504 | color: rgba(0, 0, 0, 0.9); | 535 | color: rgba(0, 0, 0, 0.9); |
| 505 | font-size: 28rpx; | 536 | font-size: 28rpx; |
| 506 | } | 537 | } |
| 538 | + .value-spec { | ||
| 539 | + height: 48rpx; | ||
| 540 | + display: flex; | ||
| 541 | + align-items: center; | ||
| 542 | + color: #000000; | ||
| 543 | + // justify-content: end; | ||
| 544 | + &_box { | ||
| 545 | + position: relative; | ||
| 546 | + width: 60rpx; | ||
| 547 | + height: 48rpx; | ||
| 548 | + | ||
| 549 | + &_1 { | ||
| 550 | + font-size: 16rpx; | ||
| 551 | + position: absolute; | ||
| 552 | + top: -10rpx; | ||
| 553 | + left: 0; | ||
| 554 | + } | ||
| 555 | + | ||
| 556 | + &_2 { | ||
| 557 | + font-size: 16rpx; | ||
| 558 | + position: absolute; | ||
| 559 | + bottom: -10rpx; | ||
| 560 | + left: 0; | ||
| 561 | + } | ||
| 562 | + } | ||
| 563 | + | ||
| 564 | + &_val { | ||
| 565 | + font-size: 28rpx; | ||
| 566 | + | ||
| 567 | + &.p12 { | ||
| 568 | + padding-right: 12rpx; | ||
| 569 | + } | ||
| 570 | + } | ||
| 571 | + } | ||
| 572 | + .row-spec { | ||
| 573 | + height: 60rpx; | ||
| 574 | + align-items: center; | ||
| 575 | + } | ||
| 507 | </style> | 576 | </style> |
| @@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
| 39 | <view class="item-title"><text class="required">*</text><text>生产厂</text></view> | 39 | <view class="item-title"><text class="required">*</text><text>生产厂</text></view> |
| 40 | </template> | 40 | </template> |
| 41 | </uni-list-item> | 41 | </uni-list-item> |
| 42 | - <ProductRel mode="add" :orderDateBase="form.orderDate" @change="onProductsChange" :options="productList" /> | 42 | + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" /> |
| 43 | <uni-list-item title="合计人民币金额(大写)"> | 43 | <uni-list-item title="合计人民币金额(大写)"> |
| 44 | <template v-slot:footer> | 44 | <template v-slot:footer> |
| 45 | <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled /> | 45 | <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled /> |
| @@ -92,33 +92,25 @@ | @@ -92,33 +92,25 @@ | ||
| 92 | :inputBorder="false" /> | 92 | :inputBorder="false" /> |
| 93 | </template> | 93 | </template> |
| 94 | </uni-list-item> | 94 | </uni-list-item> |
| 95 | - <view class="group"> | ||
| 96 | - <view class="group-title">特别条款要求</view> | ||
| 97 | - <view class="radio-list"> | ||
| 98 | - <view v-for="(opt, i) in specialTermsList" :key="'cr-' + i" class="radio-item" | ||
| 99 | - @click="onRadioSelect('specialTerms', 'specialTermsName', opt)"> | ||
| 100 | - <view :class="['radio', { checked: form.specialTerms === opt.value }]" /> | ||
| 101 | - <text class="label">{{ opt.label }}</text> | ||
| 102 | - </view> | ||
| 103 | - </view> | ||
| 104 | - </view> | ||
| 105 | - <view class="group"> | ||
| 106 | - <view class="group-title">执行标准</view> | ||
| 107 | - <view class="radio-list"> | ||
| 108 | - <view v-for="(opt, i) in executionStandardList" :key="'es-' + i" class="radio-item" | ||
| 109 | - @click="onRadioSelect('executionStandard', 'executionStandardName', opt)"> | ||
| 110 | - <view :class="['radio', { checked: form.executionStandard === opt.value }]" /> | ||
| 111 | - <text class="label">{{ opt.label }}</text> | ||
| 112 | - </view> | ||
| 113 | - </view> | ||
| 114 | - </view> | 95 | + <uni-list-item class="select-item" :class="form.specialTermsName ? 'is-filled' : 'is-empty'" clickable |
| 96 | + @click="openSheet('specialTerms')" :rightText="form.specialTermsName || '请选择'" showArrow> | ||
| 97 | + <template v-slot:body> | ||
| 98 | + <view class="item-title"><text class="required">*</text><text>特别条款要求</text></view> | ||
| 99 | + </template> | ||
| 100 | + </uni-list-item> | ||
| 101 | + <uni-list-item class="select-item" :class="form.executionStandardName ? 'is-filled' : 'is-empty'" clickable | ||
| 102 | + @click="openSheet('executionStandard')" :rightText="form.executionStandardName || '请选择'" showArrow> | ||
| 103 | + <template v-slot:body> | ||
| 104 | + <view class="item-title"><text>执行标准</text></view> | ||
| 105 | + </template> | ||
| 106 | + </uni-list-item> | ||
| 115 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> | 107 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> |
| 116 | <template v-slot:footer> | 108 | <template v-slot:footer> |
| 117 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" | 109 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" |
| 118 | :inputBorder="false" /> | 110 | :inputBorder="false" /> |
| 119 | </template> | 111 | </template> |
| 120 | </uni-list-item> | 112 | </uni-list-item> |
| 121 | - <uni-list-item title="特别说明"> | 113 | + <uni-list-item title="特别说明" style="margin-top: 20rpx;"> |
| 122 | <template v-slot:footer> | 114 | <template v-slot:footer> |
| 123 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> | 115 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> |
| 124 | </template> | 116 | </template> |
| @@ -181,7 +173,7 @@ | @@ -181,7 +173,7 @@ | ||
| 181 | 数量 | 173 | 数量 |
| 182 | </div> | 174 | </div> |
| 183 | <div class="total-item-price"> | 175 | <div class="total-item-price"> |
| 184 | - {{ (sumQuantity || 0).toFixed(2) }}t | 176 | + {{ (totalQuantity || 0).toFixed(2) }}kg |
| 185 | </div> | 177 | </div> |
| 186 | </div> | 178 | </div> |
| 187 | <div class="total-item"> | 179 | <div class="total-item"> |
| @@ -189,7 +181,7 @@ | @@ -189,7 +181,7 @@ | ||
| 189 | 不含税金额 | 181 | 不含税金额 |
| 190 | </div> | 182 | </div> |
| 191 | <div class="total-item-price text-red"> | 183 | <div class="total-item-price text-red"> |
| 192 | - ¥{{ (sumAmountExcl || 0).toFixed(2) }} | 184 | + ¥{{ (totalAmountExcludingTax || 0).toFixed(2) }} |
| 193 | </div> | 185 | </div> |
| 194 | </div> | 186 | </div> |
| 195 | <div class="total-item"> | 187 | <div class="total-item"> |
| @@ -197,7 +189,7 @@ | @@ -197,7 +189,7 @@ | ||
| 197 | 总金额 | 189 | 总金额 |
| 198 | </div> | 190 | </div> |
| 199 | <div class="total-item-price text-red"> | 191 | <div class="total-item-price text-red"> |
| 200 | - ¥{{ (sumTotal || 0).toFixed(2) }} | 192 | + ¥{{ (totalAmountIncludingTax || 0).toFixed(2) }} |
| 201 | </div> | 193 | </div> |
| 202 | </div> | 194 | </div> |
| 203 | </div> | 195 | </div> |
| @@ -233,6 +225,7 @@ export default { | @@ -233,6 +225,7 @@ export default { | ||
| 233 | buyer: '', | 225 | buyer: '', |
| 234 | buyerName: '', | 226 | buyerName: '', |
| 235 | orderDate: '', | 227 | orderDate: '', |
| 228 | + deliveryDate: '', | ||
| 236 | designatedConsignee: '', | 229 | designatedConsignee: '', |
| 237 | specialTerms: '', | 230 | specialTerms: '', |
| 238 | specialTermsName: '', | 231 | specialTermsName: '', |
| @@ -263,9 +256,9 @@ export default { | @@ -263,9 +256,9 @@ export default { | ||
| 263 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], | 256 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], |
| 264 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, | 257 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, |
| 265 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, | 258 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, |
| 266 | - sumQuantity: 0, | ||
| 267 | - sumAmountExcl: 0, | ||
| 268 | - sumTotal: 0, | 259 | + totalQuantity: 0, |
| 260 | + totalAmountExcludingTax: 0, | ||
| 261 | + totalAmountIncludingTax: 0, | ||
| 269 | productLineList: [], | 262 | productLineList: [], |
| 270 | productList: [], | 263 | productList: [], |
| 271 | customerRemarks: [], | 264 | customerRemarks: [], |
| @@ -368,9 +361,9 @@ export default { | @@ -368,9 +361,9 @@ export default { | ||
| 368 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) | 361 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) |
| 369 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) | 362 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) |
| 370 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) | 363 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) |
| 371 | - this.sumQuantity = sumQ | ||
| 372 | - this.sumAmountExcl = sumE | ||
| 373 | - this.sumTotal = sumT | 364 | + this.totalQuantity = sumQ |
| 365 | + this.totalAmountExcludingTax = sumE | ||
| 366 | + this.totalAmountIncludingTax = sumT | ||
| 374 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) | 367 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) |
| 375 | this.productLineList = list | 368 | this.productLineList = list |
| 376 | }, | 369 | }, |
| @@ -446,6 +439,10 @@ export default { | @@ -446,6 +439,10 @@ export default { | ||
| 446 | setSheet('生产厂', opts) | 439 | setSheet('生产厂', opts) |
| 447 | } else if (field === 'supplier') { | 440 | } else if (field === 'supplier') { |
| 448 | setSheet('供方', this.supplierList) | 441 | setSheet('供方', this.supplierList) |
| 442 | + } else if (field === 'specialTerms') { | ||
| 443 | + setSheet('特别条款要求', this.specialTermsList) | ||
| 444 | + } else if (field === 'executionStandard') { | ||
| 445 | + setSheet('执行标准', this.executionStandardList) | ||
| 449 | } else if (field === 'includesPackagingFee') { | 446 | } else if (field === 'includesPackagingFee') { |
| 450 | setSheet('单价中是否已包含包装费', this.yesNoList) | 447 | setSheet('单价中是否已包含包装费', this.yesNoList) |
| 451 | } else if (field === 'includesTransportFee') { | 448 | } else if (field === 'includesTransportFee') { |
| @@ -516,9 +513,9 @@ export default { | @@ -516,9 +513,9 @@ export default { | ||
| 516 | ...formForSubmit, | 513 | ...formForSubmit, |
| 517 | destination, | 514 | destination, |
| 518 | type: 'DIST_STOCK_CONTRACT', | 515 | type: 'DIST_STOCK_CONTRACT', |
| 519 | - sumQuantity: this.sumQuantity, | ||
| 520 | - sumAmountExcl: this.sumAmountExcl, | ||
| 521 | - sumTotal: this.sumTotal, | 516 | + totalQuantity: this.totalQuantity, |
| 517 | + totalAmountExcludingTax: this.totalAmountExcludingTax, | ||
| 518 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | ||
| 522 | contractDistributorLineList: lines | 519 | contractDistributorLineList: lines |
| 523 | }) | 520 | }) |
| 524 | console.log('onSubmit__payload', payload) | 521 | console.log('onSubmit__payload', payload) |
| @@ -537,18 +534,30 @@ export default { | @@ -537,18 +534,30 @@ export default { | ||
| 537 | { key: 'supplier', label: '供方' }, | 534 | { key: 'supplier', label: '供方' }, |
| 538 | { key: 'buyer', label: '需方' }, | 535 | { key: 'buyer', label: '需方' }, |
| 539 | { key: 'orderDate', label: '订货日期' }, | 536 | { key: 'orderDate', label: '订货日期' }, |
| 537 | + { key: 'unit', label: '单位' }, | ||
| 540 | { key: 'workshopId', label: '生产厂' }, | 538 | { key: 'workshopId', label: '生产厂' }, |
| 539 | + { key: 'specialTerms', label: '特别条款要求' }, | ||
| 541 | ] | 540 | ] |
| 542 | for (const it of checks) { | 541 | for (const it of checks) { |
| 543 | const val = this.form[it.key] | 542 | const val = this.form[it.key] |
| 544 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) | 543 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) |
| 545 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } | 544 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } |
| 546 | } | 545 | } |
| 547 | - if (!Array.isArray(this.productLineList) || this.productLineList.length === 0) { | 546 | + const list = Array.isArray(this.productLineList) ? this.productLineList : [] |
| 547 | + if (list.length === 0) { | ||
| 548 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false | 548 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false |
| 549 | } | 549 | } |
| 550 | - for (const [idx, it] of this.productLineList.entries()) { | ||
| 551 | - if (!it.productName || !it.quantity || !it.unitPrice) { | 550 | + const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === '')) |
| 551 | + const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v))) | ||
| 552 | + for (const [idx, it] of list.entries()) { | ||
| 553 | + if ( | ||
| 554 | + strEmpty(it.productName) || | ||
| 555 | + strEmpty(it.industry) || | ||
| 556 | + strEmpty(it.quality) || | ||
| 557 | + strEmpty(it.brand) || | ||
| 558 | + numEmpty(it.quantity) || | ||
| 559 | + strEmpty(it.deliveryDate) | ||
| 560 | + ) { | ||
| 552 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false | 561 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false |
| 553 | } | 562 | } |
| 554 | } | 563 | } |
| @@ -576,7 +585,7 @@ export default { | @@ -576,7 +585,7 @@ export default { | ||
| 576 | color: rgba(0, 0, 0, 0.6); | 585 | color: rgba(0, 0, 0, 0.6); |
| 577 | line-height: 32rpx; | 586 | line-height: 32rpx; |
| 578 | width: 240rpx; | 587 | width: 240rpx; |
| 579 | - padding: 24rpx 0; | 588 | + padding: 12rpx 0; |
| 580 | } | 589 | } |
| 581 | .total-item-price { | 590 | .total-item-price { |
| 582 | font-weight: 600; | 591 | font-weight: 600; |
| @@ -598,7 +607,7 @@ export default { | @@ -598,7 +607,7 @@ export default { | ||
| 598 | 607 | ||
| 599 | .scroll { | 608 | .scroll { |
| 600 | flex: 1; | 609 | flex: 1; |
| 601 | - padding: 12rpx 0 480rpx !important; | 610 | + padding: 12rpx 0 392rpx !important; |
| 602 | } | 611 | } |
| 603 | 612 | ||
| 604 | .footer { | 613 | .footer { |
| @@ -52,13 +52,13 @@ | @@ -52,13 +52,13 @@ | ||
| 52 | }}</text></view> | 52 | }}</text></view> |
| 53 | </view> | 53 | </view> |
| 54 | 54 | ||
| 55 | - <view class="section"> | 55 | + <view class="section" v-if="detail.status === 'STANDARD'"> |
| 56 | <view class="row"><text class="label">规范性合同</text><text class="value" style="color: #3D48A3;">{{ detail.standardFileName || '-' | 56 | <view class="row"><text class="label">规范性合同</text><text class="value" style="color: #3D48A3;">{{ detail.standardFileName || '-' |
| 57 | }}</text></view> | 57 | }}</text></view> |
| 58 | <view class="row"><text class="label">合同是否规范</text><text class="value">{{ detail.standardStandardized ? '是' : '否' | 58 | <view class="row"><text class="label">合同是否规范</text><text class="value">{{ detail.standardStandardized ? '是' : '否' |
| 59 | }}</text></view> | 59 | }}</text></view> |
| 60 | </view> | 60 | </view> |
| 61 | - <view class="section" v-if="status === 'FORMAL'"> | 61 | + <view class="section" v-if="detail.status === 'FORMAL'"> |
| 62 | <view class="row"><text class="label">规范性合同</text><text class="value" style="color: #3D48A3;">{{ detail.formalFileName || '-' }}</text></view> | 62 | <view class="row"><text class="label">规范性合同</text><text class="value" style="color: #3D48A3;">{{ detail.formalFileName || '-' }}</text></view> |
| 63 | <view class="row"><text class="label">合同是否规范</text><text class="value">{{ detail.formalStandardized ? '是' : '否' }}</text></view> | 63 | <view class="row"><text class="label">合同是否规范</text><text class="value">{{ detail.formalStandardized ? '是' : '否' }}</text></view> |
| 64 | </view> | 64 | </view> |
| @@ -61,7 +61,9 @@ | @@ -61,7 +61,9 @@ | ||
| 61 | <text>订单总额</text><text class="amount" :style="{ color: '#b67a76' }">¥{{ formatAmount(item.totalAmountIncludingTax) }}</text> | 61 | <text>订单总额</text><text class="amount" :style="{ color: '#b67a76' }">¥{{ formatAmount(item.totalAmountIncludingTax) }}</text> |
| 62 | </view> | 62 | </view> |
| 63 | <view class="info-row" v-if="item.status === 'STANDARD' || item.status === 'FORMAL'"> | 63 | <view class="info-row" v-if="item.status === 'STANDARD' || item.status === 'FORMAL'"> |
| 64 | - <text>{{ item.status === 'STANDARD' ? '标准合同' : '正式合同' }}规范性审核状态</text><span class="info-status" :style="getStatusCss(item.standardApprovedName)">{{ item.standardApprovedName }}</span> | 64 | + <text>{{ item.status === 'STANDARD' ? '标准合同' : '正式合同' }}规范性审核状态</text> |
| 65 | + <span v-if="item.status === 'STANDARD' ? item.standardApprovedName : item.formalApprovedName" class="info-status" :style="getStatusCss(item.status === 'STANDARD' ? item.standardApprovedName : item.formalApprovedName)">{{ item.status === 'STANDARD' ? item.standardApprovedName : item.formalApprovedName }}</span> | ||
| 66 | + <span v-else>-</span> | ||
| 65 | </view> | 67 | </view> |
| 66 | <view class="info-row"> | 68 | <view class="info-row"> |
| 67 | <text>订货日期</text><text>{{ item.orderDate }}</text> | 69 | <text>订货日期</text><text>{{ item.orderDate }}</text> |
| @@ -244,7 +246,7 @@ export default { | @@ -244,7 +246,7 @@ export default { | ||
| 244 | const list = Array.isArray(this.statusStyle) ? this.statusStyle : [] | 246 | const list = Array.isArray(this.statusStyle) ? this.statusStyle : [] |
| 245 | const found = list.find(it => it && it.text === name) || {} | 247 | const found = list.find(it => it && it.text === name) || {} |
| 246 | return { | 248 | return { |
| 247 | - color: found.color || '#000', | 249 | + color: found.color || '#fff', |
| 248 | backgroundColor: found.bgColor || '#000' | 250 | backgroundColor: found.bgColor || '#000' |
| 249 | } | 251 | } |
| 250 | } | 252 | } |
| @@ -108,7 +108,7 @@ | @@ -108,7 +108,7 @@ | ||
| 108 | 数量 | 108 | 数量 |
| 109 | </div> | 109 | </div> |
| 110 | <div class="total-item-price"> | 110 | <div class="total-item-price"> |
| 111 | - {{ (sumQuantity || 0).toFixed(2) }}t | 111 | + {{ (totalQuantity || 0).toFixed(2) }}t |
| 112 | </div> | 112 | </div> |
| 113 | </div> | 113 | </div> |
| 114 | <div class="total-item"> | 114 | <div class="total-item"> |
| @@ -116,7 +116,7 @@ | @@ -116,7 +116,7 @@ | ||
| 116 | 不含税金额 | 116 | 不含税金额 |
| 117 | </div> | 117 | </div> |
| 118 | <div class="total-item-price text-red"> | 118 | <div class="total-item-price text-red"> |
| 119 | - ¥{{ (sumAmountExcl || 0).toFixed(2) }} | 119 | + ¥{{ (totalAmountExcludingTax || 0).toFixed(2) }} |
| 120 | </div> | 120 | </div> |
| 121 | </div> | 121 | </div> |
| 122 | <div class="total-item"> | 122 | <div class="total-item"> |
| @@ -124,7 +124,7 @@ | @@ -124,7 +124,7 @@ | ||
| 124 | 总金额 | 124 | 总金额 |
| 125 | </div> | 125 | </div> |
| 126 | <div class="total-item-price text-red"> | 126 | <div class="total-item-price text-red"> |
| 127 | - ¥{{ (sumTotal || 0).toFixed(2) }} | 127 | + ¥{{ (totalAmountIncludingTax || 0).toFixed(2) }} |
| 128 | </div> | 128 | </div> |
| 129 | </div> | 129 | </div> |
| 130 | </div> | 130 | </div> |
| @@ -147,15 +147,15 @@ export default { | @@ -147,15 +147,15 @@ export default { | ||
| 147 | } | 147 | } |
| 148 | }, | 148 | }, |
| 149 | computed: { | 149 | computed: { |
| 150 | - sumQuantity() { | 150 | + totalQuantity() { |
| 151 | const qty = this.items.filter(it => it.locked).reduce((p, c) => p + this.toNumber(c.quantity), 0) | 151 | const qty = this.items.filter(it => it.locked).reduce((p, c) => p + this.toNumber(c.quantity), 0) |
| 152 | return this.round(qty, 2) | 152 | return this.round(qty, 2) |
| 153 | }, | 153 | }, |
| 154 | - sumAmountExcl() { | 154 | + totalAmountExcludingTax() { |
| 155 | const sum = this.items.filter(it => it.locked).reduce((p, c) => p + this.toNumber(c.amountExcludingTax), 0) | 155 | const sum = this.items.filter(it => it.locked).reduce((p, c) => p + this.toNumber(c.amountExcludingTax), 0) |
| 156 | return this.round(sum, 2) | 156 | return this.round(sum, 2) |
| 157 | }, | 157 | }, |
| 158 | - sumTotal() { return this.totalAmount }, | 158 | + totalAmountIncludingTax() { return this.totalAmount }, |
| 159 | totalAmount() { | 159 | totalAmount() { |
| 160 | let sum = 0 | 160 | let sum = 0 |
| 161 | for (const it of this.items) { | 161 | for (const it of this.items) { |
| @@ -325,9 +325,9 @@ export default { | @@ -325,9 +325,9 @@ export default { | ||
| 325 | const payload = { | 325 | const payload = { |
| 326 | id: this.id, | 326 | id: this.id, |
| 327 | totalAmountCapital: formatCurrencyToChinese(this.sumTotal), | 327 | totalAmountCapital: formatCurrencyToChinese(this.sumTotal), |
| 328 | - totalAmountExcludingTax: this.sumAmountExcl, | ||
| 329 | - totalAmountIncludingTax: this.sumTotal, | ||
| 330 | - totalQuantity: this.sumQuantity, | 328 | + totalAmountExcludingTax: this.totalAmountExcludingTax, |
| 329 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | ||
| 330 | + totalQuantity: this.totalQuantity, | ||
| 331 | type:'DIST_STOCK_CONTRACT', | 331 | type:'DIST_STOCK_CONTRACT', |
| 332 | contractDistributorLineList: selected | 332 | contractDistributorLineList: selected |
| 333 | } | 333 | } |
| @@ -362,7 +362,7 @@ export default { | @@ -362,7 +362,7 @@ export default { | ||
| 362 | 362 | ||
| 363 | .scroll { | 363 | .scroll { |
| 364 | flex: 1; | 364 | flex: 1; |
| 365 | - padding: 12rpx 0 480rpx !important; | 365 | + padding: 12rpx 0 392rpx !important; |
| 366 | } | 366 | } |
| 367 | 367 | ||
| 368 | .header { | 368 | .header { |
| @@ -646,7 +646,7 @@ export default { | @@ -646,7 +646,7 @@ export default { | ||
| 646 | color: rgba(0, 0, 0, 0.6); | 646 | color: rgba(0, 0, 0, 0.6); |
| 647 | line-height: 32rpx; | 647 | line-height: 32rpx; |
| 648 | width: 240rpx; | 648 | width: 240rpx; |
| 649 | - padding: 24rpx 0; | 649 | + padding: 12rpx 0; |
| 650 | } | 650 | } |
| 651 | 651 | ||
| 652 | .total-item-price { | 652 | .total-item-price { |
| @@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
| 41 | </template> | 41 | </template> |
| 42 | </uni-list-item> | 42 | </uni-list-item> |
| 43 | 43 | ||
| 44 | - <ProductRel mode="add" :orderDateBase="form.orderDate" :list="productLineList" @change="onProductsChange" :options="productList" /> | 44 | + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" /> |
| 45 | 45 | ||
| 46 | <uni-list-item title="合计人民币金额(大写)"> | 46 | <uni-list-item title="合计人民币金额(大写)"> |
| 47 | <template v-slot:footer> | 47 | <template v-slot:footer> |
| @@ -99,33 +99,25 @@ | @@ -99,33 +99,25 @@ | ||
| 99 | </template> | 99 | </template> |
| 100 | </uni-list-item> | 100 | </uni-list-item> |
| 101 | 101 | ||
| 102 | - <view class="group"> | ||
| 103 | - <view class="group-title">特别条款要求</view> | ||
| 104 | - <view class="radio-list"> | ||
| 105 | - <view v-for="(opt, i) in specialTermsList" :key="'cr-' + i" class="radio-item" | ||
| 106 | - @click="onRadioSelect('specialTerms', 'specialTermsName', opt)"> | ||
| 107 | - <view :class="['radio', { checked: form.specialTerms === opt.value }]" /> | ||
| 108 | - <text class="label">{{ opt.label }}</text> | ||
| 109 | - </view> | ||
| 110 | - </view> | ||
| 111 | - </view> | ||
| 112 | - <view class="group"> | ||
| 113 | - <view class="group-title">执行标准</view> | ||
| 114 | - <view class="radio-list"> | ||
| 115 | - <view v-for="(opt, i) in executionStandardList" :key="'es-' + i" class="radio-item" | ||
| 116 | - @click="onRadioSelect('executionStandard', 'executionStandardName', opt)"> | ||
| 117 | - <view :class="['radio', { checked: form.executionStandard === opt.value }]" /> | ||
| 118 | - <text class="label">{{ opt.label }}</text> | ||
| 119 | - </view> | ||
| 120 | - </view> | ||
| 121 | - </view> | 102 | + <uni-list-item class="select-item" :class="form.specialTermsName ? 'is-filled' : 'is-empty'" clickable |
| 103 | + @click="openSheet('specialTerms')" :rightText="form.specialTermsName || '请选择'" showArrow> | ||
| 104 | + <template v-slot:body> | ||
| 105 | + <view class="item-title"><text class="required">*</text><text>特别条款要求</text></view> | ||
| 106 | + </template> | ||
| 107 | + </uni-list-item> | ||
| 108 | + <uni-list-item class="select-item" :class="form.executionStandardName ? 'is-filled' : 'is-empty'" clickable | ||
| 109 | + @click="openSheet('executionStandard')" :rightText="form.executionStandardName || '请选择'" showArrow> | ||
| 110 | + <template v-slot:body> | ||
| 111 | + <view class="item-title"><text>执行标准</text></view> | ||
| 112 | + </template> | ||
| 113 | + </uni-list-item> | ||
| 122 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> | 114 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> |
| 123 | <template v-slot:footer> | 115 | <template v-slot:footer> |
| 124 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" | 116 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" |
| 125 | :inputBorder="false" /> | 117 | :inputBorder="false" /> |
| 126 | </template> | 118 | </template> |
| 127 | </uni-list-item> | 119 | </uni-list-item> |
| 128 | - <uni-list-item title="特别说明"> | 120 | + <uni-list-item title="特别说明" style="margin-top: 20rpx;"> |
| 129 | <template v-slot:footer> | 121 | <template v-slot:footer> |
| 130 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> | 122 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> |
| 131 | </template> | 123 | </template> |
| @@ -177,15 +169,15 @@ | @@ -177,15 +169,15 @@ | ||
| 177 | <div class="total-text">合计</div> | 169 | <div class="total-text">合计</div> |
| 178 | <div class="total-item"> | 170 | <div class="total-item"> |
| 179 | <div class="total-item-text">数量</div> | 171 | <div class="total-item-text">数量</div> |
| 180 | - <div class="total-item-price">{{ (sumQuantity || 0).toFixed(2) }}t</div> | 172 | + <div class="total-item-price">{{ (totalQuantity || 0).toFixed(2) }}kg</div> |
| 181 | </div> | 173 | </div> |
| 182 | <div class="total-item"> | 174 | <div class="total-item"> |
| 183 | <div class="total-item-text">不含税金额</div> | 175 | <div class="total-item-text">不含税金额</div> |
| 184 | - <div class="total-item-price text-red">¥{{ (sumAmountExcl || 0).toFixed(2) }}</div> | 176 | + <div class="total-item-price text-red">¥{{ (totalAmountExcludingTax || 0).toFixed(2) }}</div> |
| 185 | </div> | 177 | </div> |
| 186 | <div class="total-item"> | 178 | <div class="total-item"> |
| 187 | <div class="total-item-text">总金额</div> | 179 | <div class="total-item-text">总金额</div> |
| 188 | - <div class="total-item-price text-red">¥{{ (sumTotal || 0).toFixed(2) }}</div> | 180 | + <div class="total-item-price text-red">¥{{ (totalAmountIncludingTax || 0).toFixed(2) }}</div> |
| 189 | </div> | 181 | </div> |
| 190 | </div> | 182 | </div> |
| 191 | <button class="btn submit" type="primary" @click="onSubmit">保存</button> | 183 | <button class="btn submit" type="primary" @click="onSubmit">保存</button> |
| @@ -223,6 +215,7 @@ export default { | @@ -223,6 +215,7 @@ export default { | ||
| 223 | workshopId: '', | 215 | workshopId: '', |
| 224 | workshopName: '', | 216 | workshopName: '', |
| 225 | orderDate: '', | 217 | orderDate: '', |
| 218 | + deliveryDate: '', | ||
| 226 | designatedConsignee: '', | 219 | designatedConsignee: '', |
| 227 | specialTerms: '', | 220 | specialTerms: '', |
| 228 | specialTermsName: '', | 221 | specialTermsName: '', |
| @@ -256,9 +249,9 @@ export default { | @@ -256,9 +249,9 @@ export default { | ||
| 256 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], | 249 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], |
| 257 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, | 250 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, |
| 258 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, | 251 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, |
| 259 | - sumQuantity: 0, | ||
| 260 | - sumAmountExcl: 0, | ||
| 261 | - sumTotal: 0, | 252 | + totalQuantity: 0, |
| 253 | + totalAmountExcludingTax: 0, | ||
| 254 | + totalAmountIncludingTax: 0, | ||
| 262 | productLineList: [], | 255 | productLineList: [], |
| 263 | newProductLineList: [], | 256 | newProductLineList: [], |
| 264 | productList: [] | 257 | productList: [] |
| @@ -349,9 +342,9 @@ export default { | @@ -349,9 +342,9 @@ export default { | ||
| 349 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) | 342 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) |
| 350 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) | 343 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) |
| 351 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) | 344 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) |
| 352 | - this.sumQuantity = sumQ | ||
| 353 | - this.sumAmountExcl = sumE | ||
| 354 | - this.sumTotal = sumT | 345 | + this.totalQuantity = sumQ |
| 346 | + this.totalAmountExcludingTax = sumE | ||
| 347 | + this.totalAmountIncludingTax = sumT | ||
| 355 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) | 348 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) |
| 356 | }, | 349 | }, |
| 357 | async loadSuppliers() { | 350 | async loadSuppliers() { |
| @@ -399,6 +392,10 @@ export default { | @@ -399,6 +392,10 @@ export default { | ||
| 399 | setSheet('生产厂', opts) | 392 | setSheet('生产厂', opts) |
| 400 | } else if (field === 'supplier') { | 393 | } else if (field === 'supplier') { |
| 401 | setSheet('供方', this.supplierList) | 394 | setSheet('供方', this.supplierList) |
| 395 | + } else if (field === 'specialTerms') { | ||
| 396 | + setSheet('特别条款要求', this.specialTermsList) | ||
| 397 | + } else if (field === 'executionStandard') { | ||
| 398 | + setSheet('执行标准', this.executionStandardList) | ||
| 402 | } else if (field === 'includesPackagingFee') { | 399 | } else if (field === 'includesPackagingFee') { |
| 403 | setSheet('单价中是否已包含包装费', this.yesNoList) | 400 | setSheet('单价中是否已包含包装费', this.yesNoList) |
| 404 | } else if (field === 'includesTransportFee') { | 401 | } else if (field === 'includesTransportFee') { |
| @@ -443,18 +440,30 @@ export default { | @@ -443,18 +440,30 @@ export default { | ||
| 443 | { key: 'supplier', label: '供方' }, | 440 | { key: 'supplier', label: '供方' }, |
| 444 | { key: 'buyer', label: '需方' }, | 441 | { key: 'buyer', label: '需方' }, |
| 445 | { key: 'orderDate', label: '订货日期' }, | 442 | { key: 'orderDate', label: '订货日期' }, |
| 443 | + { key: 'unit', label: '单位' }, | ||
| 446 | { key: 'workshopId', label: '生产厂' }, | 444 | { key: 'workshopId', label: '生产厂' }, |
| 445 | + { key: 'specialTerms', label: '特别条款要求' }, | ||
| 447 | ] | 446 | ] |
| 448 | for (const it of checks) { | 447 | for (const it of checks) { |
| 449 | const val = this.form[it.key] | 448 | const val = this.form[it.key] |
| 450 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) | 449 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) |
| 451 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } | 450 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } |
| 452 | } | 451 | } |
| 453 | - if (!Array.isArray(this.productLineList) || this.productLineList.length === 0) { | 452 | + const list = Array.isArray(this.newProductLineList) ? this.newProductLineList : [] |
| 453 | + if (list.length === 0) { | ||
| 454 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false | 454 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false |
| 455 | } | 455 | } |
| 456 | - for (const [idx, it] of this.productLineList.entries()) { | ||
| 457 | - if (!it.productName || !it.quantity) { | 456 | + const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === '')) |
| 457 | + const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v))) | ||
| 458 | + for (const [idx, it] of list.entries()) { | ||
| 459 | + if ( | ||
| 460 | + strEmpty(it.productName) || | ||
| 461 | + strEmpty(it.industry) || | ||
| 462 | + strEmpty(it.quality) || | ||
| 463 | + strEmpty(it.brand) || | ||
| 464 | + numEmpty(it.quantity) || | ||
| 465 | + strEmpty(it.deliveryDate) | ||
| 466 | + ) { | ||
| 458 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false | 467 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false |
| 459 | } | 468 | } |
| 460 | } | 469 | } |
| @@ -486,9 +495,9 @@ export default { | @@ -486,9 +495,9 @@ export default { | ||
| 486 | id: this.form.id, | 495 | id: this.form.id, |
| 487 | destination, | 496 | destination, |
| 488 | type: 'DIST_STOCK_CONTRACT', | 497 | type: 'DIST_STOCK_CONTRACT', |
| 489 | - sumQuantity: this.sumQuantity, | ||
| 490 | - sumAmountExcl: this.sumAmountExcl, | ||
| 491 | - sumTotal: this.sumTotal, | 498 | + totalQuantity: this.totalQuantity, |
| 499 | + totalAmountExcludingTax: this.totalAmountExcludingTax, | ||
| 500 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | ||
| 492 | contractDistributorLineList: lines | 501 | contractDistributorLineList: lines |
| 493 | }) | 502 | }) |
| 494 | try { | 503 | try { |
| @@ -524,7 +533,7 @@ export default { | @@ -524,7 +533,7 @@ export default { | ||
| 524 | color: rgba(0, 0, 0, 0.6); | 533 | color: rgba(0, 0, 0, 0.6); |
| 525 | line-height: 32rpx; | 534 | line-height: 32rpx; |
| 526 | width: 240rpx; | 535 | width: 240rpx; |
| 527 | - padding: 24rpx 0; | 536 | + padding: 12rpx 0; |
| 528 | } | 537 | } |
| 529 | 538 | ||
| 530 | .total-item-price { | 539 | .total-item-price { |
| @@ -547,7 +556,7 @@ export default { | @@ -547,7 +556,7 @@ export default { | ||
| 547 | 556 | ||
| 548 | .scroll { | 557 | .scroll { |
| 549 | flex: 1; | 558 | flex: 1; |
| 550 | - padding: 12rpx 0 480rpx !important; | 559 | + padding: 12rpx 0 392rpx !important; |
| 551 | } | 560 | } |
| 552 | 561 | ||
| 553 | .footer { | 562 | .footer { |
| @@ -742,4 +751,4 @@ export default { | @@ -742,4 +751,4 @@ export default { | ||
| 742 | } | 751 | } |
| 743 | } | 752 | } |
| 744 | 753 | ||
| 745 | -</style> | ||
| 754 | +</style> |
| @@ -55,51 +55,51 @@ | @@ -55,51 +55,51 @@ | ||
| 55 | </uni-list-item> | 55 | </uni-list-item> |
| 56 | <uni-list-item title="厚度"> | 56 | <uni-list-item title="厚度"> |
| 57 | <template v-slot:footer> | 57 | <template v-slot:footer> |
| 58 | - <uni-easyinput v-model="item.thickness" :inputBorder="false" placeholder="请输入厚度" /> | 58 | + <uni-easyinput type="digit" v-model="item.thickness" :inputBorder="false" placeholder="请输入厚度" @input="onNonNegativeInput(idx, 'thickness')" @blur="onNonNegativeBlur(idx, 'thickness', 2)" /> |
| 59 | </template> | 59 | </template> |
| 60 | </uni-list-item> | 60 | </uni-list-item> |
| 61 | <uni-list-item title="厚度公差(单项+)"> | 61 | <uni-list-item title="厚度公差(单项+)"> |
| 62 | <template v-slot:footer> | 62 | <template v-slot:footer> |
| 63 | - <uni-easyinput v-model="item.thicknessTolPos" :inputBorder="false" | ||
| 64 | - placeholder="请输入厚度公差(单项+)" /> | 63 | + <uni-easyinput type="digit" v-model="item.thicknessTolPos" :inputBorder="false" |
| 64 | + placeholder="请输入厚度公差(单项+)" @input="onNonNegativeInput(idx, 'thicknessTolPos')" @blur="onNonNegativeBlur(idx, 'thicknessTolPos', 2)" /> | ||
| 65 | </template> | 65 | </template> |
| 66 | </uni-list-item> | 66 | </uni-list-item> |
| 67 | <uni-list-item title="厚度公差(单项-)"> | 67 | <uni-list-item title="厚度公差(单项-)"> |
| 68 | <template v-slot:footer> | 68 | <template v-slot:footer> |
| 69 | - <uni-easyinput v-model="item.thicknessTolNeg" :inputBorder="false" | ||
| 70 | - placeholder="请输入厚度公差(单项-)" /> | 69 | + <uni-easyinput type="digit" v-model="item.thicknessTolNeg" :inputBorder="false" |
| 70 | + placeholder="请输入厚度公差(单项-)" @input="onNonNegativeInput(idx, 'thicknessTolNeg')" @blur="onNonNegativeBlur(idx, 'thicknessTolNeg', 2)" /> | ||
| 71 | </template> | 71 | </template> |
| 72 | </uni-list-item> | 72 | </uni-list-item> |
| 73 | <uni-list-item title="宽度"> | 73 | <uni-list-item title="宽度"> |
| 74 | <template v-slot:footer> | 74 | <template v-slot:footer> |
| 75 | - <uni-easyinput v-model="item.width" :inputBorder="false" placeholder="请输入宽度" /> | 75 | + <uni-easyinput type="digit" v-model="item.width" :inputBorder="false" placeholder="请输入宽度" @input="onNonNegativeInput(idx, 'width')" @blur="onNonNegativeBlur(idx, 'width', 2)" /> |
| 76 | </template> | 76 | </template> |
| 77 | </uni-list-item> | 77 | </uni-list-item> |
| 78 | <uni-list-item title="宽度公差(单项+)"> | 78 | <uni-list-item title="宽度公差(单项+)"> |
| 79 | <template v-slot:footer> | 79 | <template v-slot:footer> |
| 80 | - <uni-easyinput v-model="item.widthTolPos" :inputBorder="false" placeholder="请输入宽度公差(单项+)" /> | 80 | + <uni-easyinput type="digit" v-model="item.widthTolPos" :inputBorder="false" placeholder="请输入宽度公差(单项+)" @input="onNonNegativeInput(idx, 'widthTolPos')" @blur="onNonNegativeBlur(idx, 'widthTolPos', 2)" /> |
| 81 | </template> | 81 | </template> |
| 82 | </uni-list-item> | 82 | </uni-list-item> |
| 83 | <uni-list-item title="宽度公差(单项-)"> | 83 | <uni-list-item title="宽度公差(单项-)"> |
| 84 | <template v-slot:footer> | 84 | <template v-slot:footer> |
| 85 | - <uni-easyinput v-model="item.widthTolNeg" :inputBorder="false" placeholder="请输入宽度公差(单项-)" /> | 85 | + <uni-easyinput type="digit" v-model="item.widthTolNeg" :inputBorder="false" placeholder="请输入宽度公差(单项-)" @input="onNonNegativeInput(idx, 'widthTolNeg')" @blur="onNonNegativeBlur(idx, 'widthTolNeg', 2)" /> |
| 86 | </template> | 86 | </template> |
| 87 | </uni-list-item> | 87 | </uni-list-item> |
| 88 | <uni-list-item title="长度"> | 88 | <uni-list-item title="长度"> |
| 89 | <template v-slot:footer> | 89 | <template v-slot:footer> |
| 90 | - <uni-easyinput v-model="item.length" :inputBorder="false" placeholder="请输入长度" /> | 90 | + <uni-easyinput type="digit" v-model="item.length" :inputBorder="false" placeholder="请输入长度" @input="onNonNegativeInput(idx, 'length')" @blur="onNonNegativeBlur(idx, 'length', 2)" /> |
| 91 | </template> | 91 | </template> |
| 92 | </uni-list-item> | 92 | </uni-list-item> |
| 93 | <uni-list-item title="长度公差(单项+)"> | 93 | <uni-list-item title="长度公差(单项+)"> |
| 94 | <template v-slot:footer> | 94 | <template v-slot:footer> |
| 95 | - <uni-easyinput v-model="item.lengthTolPos" :inputBorder="false" | ||
| 96 | - placeholder="请输入长度公差(单项+)" /> | 95 | + <uni-easyinput type="digit" v-model="item.lengthTolPos" :inputBorder="false" |
| 96 | + placeholder="请输入长度公差(单项+)" @input="onNonNegativeInput(idx, 'lengthTolPos')" @blur="onNonNegativeBlur(idx, 'lengthTolPos', 2)" /> | ||
| 97 | </template> | 97 | </template> |
| 98 | </uni-list-item> | 98 | </uni-list-item> |
| 99 | <uni-list-item title="长度公差(单项-)"> | 99 | <uni-list-item title="长度公差(单项-)"> |
| 100 | <template v-slot:footer> | 100 | <template v-slot:footer> |
| 101 | - <uni-easyinput v-model="item.lengthTolNeg" :inputBorder="false" | ||
| 102 | - placeholder="请输入长度公差(单项-)" /> | 101 | + <uni-easyinput type="digit" v-model="item.lengthTolNeg" :inputBorder="false" |
| 102 | + placeholder="请输入长度公差(单项-)" @input="onNonNegativeInput(idx, 'lengthTolNeg')" @blur="onNonNegativeBlur(idx, 'lengthTolNeg', 2)" /> | ||
| 103 | </template> | 103 | </template> |
| 104 | </uni-list-item> | 104 | </uni-list-item> |
| 105 | <uni-list-item title="状态"> | 105 | <uni-list-item title="状态"> |
| @@ -109,12 +109,12 @@ | @@ -109,12 +109,12 @@ | ||
| 109 | </uni-list-item> | 109 | </uni-list-item> |
| 110 | <uni-list-item title="数量"> | 110 | <uni-list-item title="数量"> |
| 111 | <template v-slot:footer> | 111 | <template v-slot:footer> |
| 112 | - <uni-easyinput v-model="item.quantity" type="number" :inputBorder="false" placeholder="请输入数量" @input="onImmediateChange(idx)" @blur="onNumberBlur(idx, 'quantity', 0)" /> | 112 | + <uni-easyinput v-model="item.quantity" type="digit" :inputBorder="false" placeholder="请输入数量kg" @input="onNonNegativeInput(idx, 'quantity')" @blur="onNonNegativeBlur(idx, 'quantity', 2)" /> |
| 113 | </template> | 113 | </template> |
| 114 | </uni-list-item> | 114 | </uni-list-item> |
| 115 | <uni-list-item title="单价"> | 115 | <uni-list-item title="单价"> |
| 116 | <template v-slot:footer> | 116 | <template v-slot:footer> |
| 117 | - <uni-easyinput v-model="item.unitPrice" type="number" :inputBorder="false" placeholder="-" @input="onImmediateChange(idx)" @blur="onNumberBlur(idx, 'unitPrice', 0)" disabled /> | 117 | + <uni-easyinput v-model="item.unitPrice" type="digit" :inputBorder="false" disabled placeholder="请输入销售价格" @input="onNonNegativeInput(idx, 'unitPrice')" @blur="onNonNegativeBlur(idx, 'unitPrice', 2)" /> |
| 118 | </template> | 118 | </template> |
| 119 | </uni-list-item> | 119 | </uni-list-item> |
| 120 | <uni-list-item title="不含税金额"> | 120 | <uni-list-item title="不含税金额"> |
| @@ -129,7 +129,7 @@ | @@ -129,7 +129,7 @@ | ||
| 129 | </uni-list-item> | 129 | </uni-list-item> |
| 130 | <uni-list-item title="发货日期"> | 130 | <uni-list-item title="发货日期"> |
| 131 | <template v-slot:footer> | 131 | <template v-slot:footer> |
| 132 | - <uni-datetime-picker type="date" v-model="item.orderDate" @change="onDateChange(idx, $event)" /> | 132 | + <uni-datetime-picker type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" /> |
| 133 | </template> | 133 | </template> |
| 134 | </uni-list-item> | 134 | </uni-list-item> |
| 135 | </uni-list> | 135 | </uni-list> |
| @@ -151,7 +151,30 @@ | @@ -151,7 +151,30 @@ | ||
| 151 | <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view> | 151 | <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view> |
| 152 | <view class="row"><text class="label">牌号</text><text class="value">{{ item.brand }}</text></view> | 152 | <view class="row"><text class="label">牌号</text><text class="value">{{ item.brand }}</text></view> |
| 153 | <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view> | 153 | <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view> |
| 154 | - <view class="row"><text class="label">规格</text><text class="value">{{ item.specDisplay }}</text></view> | 154 | + <!-- 厚(公差) * 宽(公差) * 长(公差) --> |
| 155 | + <view class="row row-spec"><text class="label">规格(mm)</text> | ||
| 156 | + <view class="value value-spec"> | ||
| 157 | + <view v-if="item.thickness" class="value-spec_val">{{ item.thickness }}</view> | ||
| 158 | + <view v-if="item.thickness" class="value-spec_box"> | ||
| 159 | + <view v-if="item.thicknessTolPos" class="value-spec_box_1">+{{ item.thicknessTolPos }} | ||
| 160 | + </view> | ||
| 161 | + <view v-if="item.thicknessTolNeg" class="value-spec_box_2">-{{ item.thicknessTolNeg }} | ||
| 162 | + </view> | ||
| 163 | + </view> | ||
| 164 | + <view v-if="item.width" class="value-spec_val p12">*</view> | ||
| 165 | + <view v-if="item.width" class="value-spec_val">{{ item.width }}</view> | ||
| 166 | + <view v-if="item.width" class="value-spec_box"> | ||
| 167 | + <view v-if="item.widthTolPos" class="value-spec_box_1">+{{ item.widthTolPos }}</view> | ||
| 168 | + <view v-if="item.widthTolNeg" class="value-spec_box_2">-{{ item.widthTolNeg }}</view> | ||
| 169 | + </view> | ||
| 170 | + <view v-if="item.length" class="value-spec_val p12">*</view> | ||
| 171 | + <view v-if="item.length" class="value-spec_val">{{ item.length }}</view> | ||
| 172 | + <view v-if="item.length" class="value-spec_box"> | ||
| 173 | + <view v-if="item.lengthTolPos" class="value-spec_box_1">+{{ item.lengthTolPos }}</view> | ||
| 174 | + <view v-if="item.lengthTolNeg" class="value-spec_box_2">-{{ item.lengthTolNeg }}</view> | ||
| 175 | + </view> | ||
| 176 | + </view> | ||
| 177 | + </view> | ||
| 155 | <view class="row"><text class="label">状态</text><text class="value">{{ item.status }}</text></view> | 178 | <view class="row"><text class="label">状态</text><text class="value">{{ item.status }}</text></view> |
| 156 | <view class="row"><text class="label">数量</text><text class="value">{{ item.quantity }}</text></view> | 179 | <view class="row"><text class="label">数量</text><text class="value">{{ item.quantity }}</text></view> |
| 157 | <view class="row"><text class="label">单价</text><text class="value">{{ formatCurrency(item.unitPrice) | 180 | <view class="row"><text class="label">单价</text><text class="value">{{ formatCurrency(item.unitPrice) |
| @@ -162,7 +185,7 @@ | @@ -162,7 +185,7 @@ | ||
| 162 | }}</text></view> | 185 | }}</text></view> |
| 163 | <view class="row"><text class="label">总金额</text><text class="value">{{ formatCurrency(item.totalAmount) | 186 | <view class="row"><text class="label">总金额</text><text class="value">{{ formatCurrency(item.totalAmount) |
| 164 | }}</text></view> | 187 | }}</text></view> |
| 165 | - <view class="row"><text class="label">发货日期</text><text class="value">{{ item.orderDate }}</text></view> | 188 | + <view class="row"><text class="label">发货日期</text><text class="value">{{ item.deliveryDate }}</text></view> |
| 166 | </view> | 189 | </view> |
| 167 | </view> | 190 | </view> |
| 168 | <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value" @confirm="onProductConfirm" /> | 191 | <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value" @confirm="onProductConfirm" /> |
| @@ -176,7 +199,7 @@ export default { | @@ -176,7 +199,7 @@ export default { | ||
| 176 | mode: { type: String, default: 'add' }, | 199 | mode: { type: String, default: 'add' }, |
| 177 | list: { type: Array, default: () => [] }, | 200 | list: { type: Array, default: () => [] }, |
| 178 | max: { type: Number, default: 8 }, | 201 | max: { type: Number, default: 8 }, |
| 179 | - orderDateBase: { type: String, default: '' }, | 202 | + deliveryDateBase: { type: String, default: '' }, |
| 180 | options: { type: Array, default: () => [] } | 203 | options: { type: Array, default: () => [] } |
| 181 | }, | 204 | }, |
| 182 | components: { SingleSelectSheet }, | 205 | components: { SingleSelectSheet }, |
| @@ -218,10 +241,18 @@ export default { | @@ -218,10 +241,18 @@ export default { | ||
| 218 | }, | 241 | }, |
| 219 | methods: { | 242 | methods: { |
| 220 | defaultItem() { | 243 | defaultItem() { |
| 221 | - return { productId: '', productName: '', industry: '', brand: '', quality: '', thickness: '', thicknessTolPos: '', thicknessTolNeg: '', width: '', widthTolPos: '', widthTolNeg: '', length: '', lengthTolPos: '', lengthTolNeg: '', status: '', quantity: '', unitPrice: '', amountExcludingTax: 0, totalAmount: 0, orderDate: '' } | 244 | + return { productId: '', productName: '', industry: '', brand: '', quality: '', thickness: '', thicknessTolPos: '', thicknessTolNeg: '', width: '', widthTolPos: '', widthTolNeg: '', length: '', lengthTolPos: '', lengthTolNeg: '', status: '', quantity: '', unitPrice: '', amountExcludingTax: 0, totalAmount: 0, deliveryDate: '' } |
| 222 | }, | 245 | }, |
| 223 | - onImmediateChange(idx) { | ||
| 224 | - this.$nextTick(() => this.recalculate(idx)) | 246 | + onNonNegativeInput(idx, field) { |
| 247 | + const it = this.items[idx] | ||
| 248 | + if (!it) return | ||
| 249 | + let v = String(it[field] != null ? it[field] : '') | ||
| 250 | + v = v.replace(/[^0-9.]/g, '') | ||
| 251 | + v = v.replace(/(\..*)\./g, '$1') | ||
| 252 | + if (v.startsWith('.')) v = '0' + v | ||
| 253 | + it[field] = v | ||
| 254 | + this.$set(this.items, idx, it) | ||
| 255 | + if (field === 'quantity' || field === 'unitPrice') this.$nextTick(() => this.recalculate(idx)) | ||
| 225 | }, | 256 | }, |
| 226 | toNumber(val) { | 257 | toNumber(val) { |
| 227 | if (typeof val === 'number') return isNaN(val) ? 0 : val | 258 | if (typeof val === 'number') return isNaN(val) ? 0 : val |
| @@ -234,21 +265,21 @@ export default { | @@ -234,21 +265,21 @@ export default { | ||
| 234 | const m = Math.pow(10, digits) | 265 | const m = Math.pow(10, digits) |
| 235 | return Math.round(n * m) / m | 266 | return Math.round(n * m) / m |
| 236 | }, | 267 | }, |
| 237 | - onNumberBlur(idx, field, digits) { | 268 | + onNonNegativeBlur(idx, field, digits) { |
| 238 | const it = this.items[idx] | 269 | const it = this.items[idx] |
| 239 | if (!it) return | 270 | if (!it) return |
| 240 | const raw = it[field] | 271 | const raw = it[field] |
| 241 | - // 如果为空则保持为空,不自动置为0,仅重新计算依赖字段 | ||
| 242 | if (raw === '' || raw === null || raw === undefined) { | 272 | if (raw === '' || raw === null || raw === undefined) { |
| 243 | this.$set(this.items, idx, it) | 273 | this.$set(this.items, idx, it) |
| 244 | - this.recalculate(idx) | 274 | + if (field === 'quantity' || field === 'unitPrice') this.recalculate(idx) |
| 245 | return | 275 | return |
| 246 | } | 276 | } |
| 247 | - const num = this.toNumber(raw) | 277 | + let num = this.toNumber(raw) |
| 278 | + if (isNaN(num) || num < 0) num = 0 | ||
| 248 | const rounded = this.round(num, digits) | 279 | const rounded = this.round(num, digits) |
| 249 | it[field] = rounded | 280 | it[field] = rounded |
| 250 | this.$set(this.items, idx, it) | 281 | this.$set(this.items, idx, it) |
| 251 | - this.recalculate(idx) | 282 | + if (field === 'quantity' || field === 'unitPrice') this.recalculate(idx) |
| 252 | }, | 283 | }, |
| 253 | formatCurrency(val) { | 284 | formatCurrency(val) { |
| 254 | if (val == null || val === '') return '' | 285 | if (val == null || val === '') return '' |
| @@ -319,15 +350,15 @@ export default { | @@ -319,15 +350,15 @@ export default { | ||
| 319 | onDateChange(idx, e) { | 350 | onDateChange(idx, e) { |
| 320 | const it = this.items[idx] | 351 | const it = this.items[idx] |
| 321 | if (!it) return | 352 | if (!it) return |
| 322 | - const val = typeof e === 'string' ? e : (e && e.detail && e.detail.value) ? e.detail.value : it.orderDate | 353 | + const val = typeof e === 'string' ? e : (e && e.detail && e.detail.value) ? e.detail.value : it.deliveryDate |
| 323 | const dateStr = String(val).slice(0, 10) | 354 | const dateStr = String(val).slice(0, 10) |
| 324 | - const base = this.orderDateBase ? new Date(this.orderDateBase) : null | 355 | + const base = this.deliveryDateBase ? new Date(this.deliveryDateBase) : null |
| 325 | const d = new Date(dateStr) | 356 | const d = new Date(dateStr) |
| 326 | if (base && !isNaN(d.getTime()) && d.getTime() < base.getTime()) { | 357 | if (base && !isNaN(d.getTime()) && d.getTime() < base.getTime()) { |
| 327 | uni.showToast({ title: '发货日期不得早于订货日期', icon: 'none' }) | 358 | uni.showToast({ title: '发货日期不得早于订货日期', icon: 'none' }) |
| 328 | - it.orderDate = this.orderDateBase | 359 | + it.deliveryDate = this.deliveryDateBase |
| 329 | } else { | 360 | } else { |
| 330 | - it.orderDate = dateStr | 361 | + it.deliveryDate = dateStr |
| 331 | } | 362 | } |
| 332 | this.$set(this.items, idx, it) | 363 | this.$set(this.items, idx, it) |
| 333 | }, | 364 | }, |
| @@ -500,8 +531,46 @@ export default { | @@ -500,8 +531,46 @@ export default { | ||
| 500 | 531 | ||
| 501 | .value { | 532 | .value { |
| 502 | flex: 1; | 533 | flex: 1; |
| 503 | - text-align: right; | 534 | + // text-align: right; |
| 504 | color: rgba(0, 0, 0, 0.9); | 535 | color: rgba(0, 0, 0, 0.9); |
| 505 | font-size: 28rpx; | 536 | font-size: 28rpx; |
| 506 | } | 537 | } |
| 538 | + .value-spec { | ||
| 539 | + height: 48rpx; | ||
| 540 | + display: flex; | ||
| 541 | + align-items: center; | ||
| 542 | + color: #000000; | ||
| 543 | + // justify-content: end; | ||
| 544 | + &_box { | ||
| 545 | + position: relative; | ||
| 546 | + width: 60rpx; | ||
| 547 | + height: 48rpx; | ||
| 548 | + | ||
| 549 | + &_1 { | ||
| 550 | + font-size: 16rpx; | ||
| 551 | + position: absolute; | ||
| 552 | + top: -10rpx; | ||
| 553 | + left: 0; | ||
| 554 | + } | ||
| 555 | + | ||
| 556 | + &_2 { | ||
| 557 | + font-size: 16rpx; | ||
| 558 | + position: absolute; | ||
| 559 | + bottom: -10rpx; | ||
| 560 | + left: 0; | ||
| 561 | + } | ||
| 562 | + } | ||
| 563 | + | ||
| 564 | + &_val { | ||
| 565 | + font-size: 28rpx; | ||
| 566 | + | ||
| 567 | + &.p12 { | ||
| 568 | + padding-right: 12rpx; | ||
| 569 | + } | ||
| 570 | + } | ||
| 571 | + } | ||
| 572 | + .row-spec { | ||
| 573 | + height: 60rpx; | ||
| 574 | + align-items: center; | ||
| 575 | + } | ||
| 507 | </style> | 576 | </style> |
| @@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
| 39 | <view class="item-title"><text class="required">*</text><text>生产厂</text></view> | 39 | <view class="item-title"><text class="required">*</text><text>生产厂</text></view> |
| 40 | </template> | 40 | </template> |
| 41 | </uni-list-item> | 41 | </uni-list-item> |
| 42 | - <ProductRel mode="add" :orderDateBase="form.orderDate" @change="onProductsChange" :options="productList" /> | 42 | + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" /> |
| 43 | <uni-list-item title="合计人民币金额(大写)"> | 43 | <uni-list-item title="合计人民币金额(大写)"> |
| 44 | <template v-slot:footer> | 44 | <template v-slot:footer> |
| 45 | <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled /> | 45 | <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled /> |
| @@ -92,33 +92,25 @@ | @@ -92,33 +92,25 @@ | ||
| 92 | :inputBorder="false" /> | 92 | :inputBorder="false" /> |
| 93 | </template> | 93 | </template> |
| 94 | </uni-list-item> | 94 | </uni-list-item> |
| 95 | - <view class="group"> | ||
| 96 | - <view class="group-title">特别条款要求</view> | ||
| 97 | - <view class="radio-list"> | ||
| 98 | - <view v-for="(opt, i) in specialTermsList" :key="'cr-' + i" class="radio-item" | ||
| 99 | - @click="onRadioSelect('specialTerms', 'specialTermsName', opt)"> | ||
| 100 | - <view :class="['radio', { checked: form.specialTerms === opt.value }]" /> | ||
| 101 | - <text class="label">{{ opt.label }}</text> | ||
| 102 | - </view> | ||
| 103 | - </view> | ||
| 104 | - </view> | ||
| 105 | - <view class="group"> | ||
| 106 | - <view class="group-title">执行标准</view> | ||
| 107 | - <view class="radio-list"> | ||
| 108 | - <view v-for="(opt, i) in executionStandardList" :key="'es-' + i" class="radio-item" | ||
| 109 | - @click="onRadioSelect('executionStandard', 'executionStandardName', opt)"> | ||
| 110 | - <view :class="['radio', { checked: form.executionStandard === opt.value }]" /> | ||
| 111 | - <text class="label">{{ opt.label }}</text> | ||
| 112 | - </view> | ||
| 113 | - </view> | ||
| 114 | - </view> | 95 | + <uni-list-item class="select-item" :class="form.specialTermsName ? 'is-filled' : 'is-empty'" clickable |
| 96 | + @click="openSheet('specialTerms')" :rightText="form.specialTermsName || '请选择'" showArrow> | ||
| 97 | + <template v-slot:body> | ||
| 98 | + <view class="item-title"><text class="required">*</text><text>特别条款要求</text></view> | ||
| 99 | + </template> | ||
| 100 | + </uni-list-item> | ||
| 101 | + <uni-list-item class="select-item" :class="form.executionStandardName ? 'is-filled' : 'is-empty'" clickable | ||
| 102 | + @click="openSheet('executionStandard')" :rightText="form.executionStandardName || '请选择'" showArrow> | ||
| 103 | + <template v-slot:body> | ||
| 104 | + <view class="item-title"><text>执行标准</text></view> | ||
| 105 | + </template> | ||
| 106 | + </uni-list-item> | ||
| 115 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> | 107 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> |
| 116 | <template v-slot:footer> | 108 | <template v-slot:footer> |
| 117 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" | 109 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" |
| 118 | :inputBorder="false" /> | 110 | :inputBorder="false" /> |
| 119 | </template> | 111 | </template> |
| 120 | </uni-list-item> | 112 | </uni-list-item> |
| 121 | - <uni-list-item title="特别说明"> | 113 | + <uni-list-item title="特别说明" style="margin-top: 20rpx;"> |
| 122 | <template v-slot:footer> | 114 | <template v-slot:footer> |
| 123 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> | 115 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> |
| 124 | </template> | 116 | </template> |
| @@ -180,8 +172,8 @@ | @@ -180,8 +172,8 @@ | ||
| 180 | <div class="total-item-text"> | 172 | <div class="total-item-text"> |
| 181 | 数量 | 173 | 数量 |
| 182 | </div> | 174 | </div> |
| 183 | - <div class="total-item-price"> | ||
| 184 | - {{ (sumQuantity || 0).toFixed(2) }}t | 175 | + <div class="total-item-price"> |
| 176 | + {{ (totalQuantity || 0).toFixed(2) }}kg | ||
| 185 | </div> | 177 | </div> |
| 186 | </div> | 178 | </div> |
| 187 | <div class="total-item"> | 179 | <div class="total-item"> |
| @@ -189,7 +181,7 @@ | @@ -189,7 +181,7 @@ | ||
| 189 | 不含税金额 | 181 | 不含税金额 |
| 190 | </div> | 182 | </div> |
| 191 | <div class="total-item-price text-red"> | 183 | <div class="total-item-price text-red"> |
| 192 | - ¥{{ (sumAmountExcl || 0).toFixed(2) }} | 184 | + ¥{{ (totalAmountExcludingTax || 0).toFixed(2) }} |
| 193 | </div> | 185 | </div> |
| 194 | </div> | 186 | </div> |
| 195 | <div class="total-item"> | 187 | <div class="total-item"> |
| @@ -197,7 +189,7 @@ | @@ -197,7 +189,7 @@ | ||
| 197 | 总金额 | 189 | 总金额 |
| 198 | </div> | 190 | </div> |
| 199 | <div class="total-item-price text-red"> | 191 | <div class="total-item-price text-red"> |
| 200 | - ¥{{ (sumTotal || 0).toFixed(2) }} | 192 | + ¥{{ (totalAmountIncludingTax || 0).toFixed(2) }} |
| 201 | </div> | 193 | </div> |
| 202 | </div> | 194 | </div> |
| 203 | </div> | 195 | </div> |
| @@ -233,6 +225,7 @@ export default { | @@ -233,6 +225,7 @@ export default { | ||
| 233 | buyer: '', | 225 | buyer: '', |
| 234 | buyerName: '', | 226 | buyerName: '', |
| 235 | orderDate: '', | 227 | orderDate: '', |
| 228 | + deliveryDate: '', | ||
| 236 | designatedConsignee: '', | 229 | designatedConsignee: '', |
| 237 | specialTerms: '', | 230 | specialTerms: '', |
| 238 | specialTermsName: '', | 231 | specialTermsName: '', |
| @@ -263,9 +256,9 @@ export default { | @@ -263,9 +256,9 @@ export default { | ||
| 263 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], | 256 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], |
| 264 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, | 257 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, |
| 265 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, | 258 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, |
| 266 | - sumQuantity: 0, | ||
| 267 | - sumAmountExcl: 0, | ||
| 268 | - sumTotal: 0, | 259 | + totalQuantity: 0, |
| 260 | + totalAmountExcludingTax: 0, | ||
| 261 | + totalAmountIncludingTax: 0, | ||
| 269 | productLineList: [], | 262 | productLineList: [], |
| 270 | productList: [], | 263 | productList: [], |
| 271 | customerRemarks: [], | 264 | customerRemarks: [], |
| @@ -368,9 +361,9 @@ export default { | @@ -368,9 +361,9 @@ export default { | ||
| 368 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) | 361 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) |
| 369 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) | 362 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) |
| 370 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) | 363 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) |
| 371 | - this.sumQuantity = sumQ | ||
| 372 | - this.sumAmountExcl = sumE | ||
| 373 | - this.sumTotal = sumT | 364 | + this.totalQuantity = sumQ |
| 365 | + this.totalAmountExcludingTax = sumE | ||
| 366 | + this.totalAmountIncludingTax = sumT | ||
| 374 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) | 367 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) |
| 375 | this.productLineList = list | 368 | this.productLineList = list |
| 376 | }, | 369 | }, |
| @@ -446,6 +439,10 @@ export default { | @@ -446,6 +439,10 @@ export default { | ||
| 446 | setSheet('生产厂', opts) | 439 | setSheet('生产厂', opts) |
| 447 | } else if (field === 'supplier') { | 440 | } else if (field === 'supplier') { |
| 448 | setSheet('供方', this.supplierList) | 441 | setSheet('供方', this.supplierList) |
| 442 | + } else if (field === 'specialTerms') { | ||
| 443 | + setSheet('特别条款要求', this.specialTermsList) | ||
| 444 | + } else if (field === 'executionStandard') { | ||
| 445 | + setSheet('执行标准', this.executionStandardList) | ||
| 449 | } else if (field === 'includesPackagingFee') { | 446 | } else if (field === 'includesPackagingFee') { |
| 450 | setSheet('单价中是否已包含包装费', this.yesNoList) | 447 | setSheet('单价中是否已包含包装费', this.yesNoList) |
| 451 | } else if (field === 'includesTransportFee') { | 448 | } else if (field === 'includesTransportFee') { |
| @@ -516,9 +513,9 @@ export default { | @@ -516,9 +513,9 @@ export default { | ||
| 516 | ...formForSubmit, | 513 | ...formForSubmit, |
| 517 | destination, | 514 | destination, |
| 518 | type: 'DRAFT_DIST_AGMT', | 515 | type: 'DRAFT_DIST_AGMT', |
| 519 | - sumQuantity: this.sumQuantity, | ||
| 520 | - sumAmountExcl: this.sumAmountExcl, | ||
| 521 | - sumTotal: this.sumTotal, | 516 | + totalQuantity: this.totalQuantity, |
| 517 | + totalAmountExcludingTax: this.totalAmountExcludingTax, | ||
| 518 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | ||
| 522 | contractDistributorLineList: lines | 519 | contractDistributorLineList: lines |
| 523 | }) | 520 | }) |
| 524 | console.log('onSubmit__payload', payload) | 521 | console.log('onSubmit__payload', payload) |
| @@ -537,18 +534,31 @@ export default { | @@ -537,18 +534,31 @@ export default { | ||
| 537 | { key: 'supplier', label: '供方' }, | 534 | { key: 'supplier', label: '供方' }, |
| 538 | { key: 'buyer', label: '需方' }, | 535 | { key: 'buyer', label: '需方' }, |
| 539 | { key: 'orderDate', label: '订货日期' }, | 536 | { key: 'orderDate', label: '订货日期' }, |
| 537 | + { key: 'unit', label: '单位' }, | ||
| 540 | { key: 'workshopId', label: '生产厂' }, | 538 | { key: 'workshopId', label: '生产厂' }, |
| 539 | + { key: 'specialTerms', label: '特别条款要求' }, | ||
| 541 | ] | 540 | ] |
| 542 | for (const it of checks) { | 541 | for (const it of checks) { |
| 543 | const val = this.form[it.key] | 542 | const val = this.form[it.key] |
| 544 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) | 543 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) |
| 545 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } | 544 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } |
| 546 | } | 545 | } |
| 547 | - if (!Array.isArray(this.productLineList) || this.productLineList.length === 0) { | 546 | + const list = Array.isArray(this.productLineList) ? this.productLineList : [] |
| 547 | + if (list.length === 0) { | ||
| 548 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false | 548 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false |
| 549 | } | 549 | } |
| 550 | - for (const [idx, it] of this.productLineList.entries()) { | ||
| 551 | - if (!it.productName || !it.quantity || !it.unitPrice) { | 550 | + const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === '')) |
| 551 | + const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v))) | ||
| 552 | + for (const [idx, it] of list.entries()) { | ||
| 553 | + if ( | ||
| 554 | + strEmpty(it.productName) || | ||
| 555 | + strEmpty(it.industry) || | ||
| 556 | + strEmpty(it.quality) || | ||
| 557 | + strEmpty(it.brand) || | ||
| 558 | + numEmpty(it.quantity) || | ||
| 559 | + numEmpty(it.unitPrice) || | ||
| 560 | + strEmpty(it.deliveryDate) | ||
| 561 | + ) { | ||
| 552 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false | 562 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false |
| 553 | } | 563 | } |
| 554 | } | 564 | } |
| @@ -576,7 +586,7 @@ export default { | @@ -576,7 +586,7 @@ export default { | ||
| 576 | color: rgba(0, 0, 0, 0.6); | 586 | color: rgba(0, 0, 0, 0.6); |
| 577 | line-height: 32rpx; | 587 | line-height: 32rpx; |
| 578 | width: 240rpx; | 588 | width: 240rpx; |
| 579 | - padding: 24rpx 0; | 589 | + padding: 12rpx 0; |
| 580 | } | 590 | } |
| 581 | .total-item-price { | 591 | .total-item-price { |
| 582 | font-weight: 600; | 592 | font-weight: 600; |
| @@ -598,7 +608,7 @@ export default { | @@ -598,7 +608,7 @@ export default { | ||
| 598 | 608 | ||
| 599 | .scroll { | 609 | .scroll { |
| 600 | flex: 1; | 610 | flex: 1; |
| 601 | - padding: 12rpx 0 480rpx !important; | 611 | + padding: 12rpx 0 392rpx !important; |
| 602 | } | 612 | } |
| 603 | 613 | ||
| 604 | .footer { | 614 | .footer { |
| @@ -53,7 +53,7 @@ | @@ -53,7 +53,7 @@ | ||
| 53 | }}</text></view> | 53 | }}</text></view> |
| 54 | </view> | 54 | </view> |
| 55 | 55 | ||
| 56 | - <view class="section"> | 56 | + <view class="section" v-if="detail.status === 'STANDARD'"> |
| 57 | <view class="row"><text class="label">规范性合同</text><text class="value" style="color: #3D48A3;">{{ | 57 | <view class="row"><text class="label">规范性合同</text><text class="value" style="color: #3D48A3;">{{ |
| 58 | detail.standardFileName || '-' | 58 | detail.standardFileName || '-' |
| 59 | }}</text></view> | 59 | }}</text></view> |
| @@ -61,7 +61,7 @@ | @@ -61,7 +61,7 @@ | ||
| 61 | detail.standardStandardized ? '是' : '否' | 61 | detail.standardStandardized ? '是' : '否' |
| 62 | }}</text></view> | 62 | }}</text></view> |
| 63 | </view> | 63 | </view> |
| 64 | - <view class="section" v-if="status === 'FORMAL'"> | 64 | + <view class="section" v-if="detail.status === 'FORMAL'"> |
| 65 | <view class="row"><text class="label">规范性合同</text><text class="value" style="color: #3D48A3;">{{ | 65 | <view class="row"><text class="label">规范性合同</text><text class="value" style="color: #3D48A3;">{{ |
| 66 | detail.formalFileName || '-' }}</text></view> | 66 | detail.formalFileName || '-' }}</text></view> |
| 67 | <view class="row"><text class="label">合同是否规范</text><text class="value">{{ detail.formalStandardized | 67 | <view class="row"><text class="label">合同是否规范</text><text class="value">{{ detail.formalStandardized |
| @@ -114,7 +114,7 @@ | @@ -114,7 +114,7 @@ | ||
| 114 | </template> | 114 | </template> |
| 115 | 115 | ||
| 116 | <script> | 116 | <script> |
| 117 | -import { getContractApi, deleteContractApi, uploadFormalContract, statusStyle } from '@/api/contract' | 117 | +import { getContractApi, deleteContractApi, uploadFormalContract, statusStyle, uploadStandardContract } from '@/api/contract' |
| 118 | import ProductRel from './productRel.vue' | 118 | import ProductRel from './productRel.vue' |
| 119 | import DetailButtons from '@/components/detail-buttons/index.vue' | 119 | import DetailButtons from '@/components/detail-buttons/index.vue' |
| 120 | import FileUpload from '@/components/file-upload/index.vue' | 120 | import FileUpload from '@/components/file-upload/index.vue' |
| @@ -61,7 +61,9 @@ | @@ -61,7 +61,9 @@ | ||
| 61 | <text>订单总额</text><text class="amount" :style="{ color: '#b67a76' }">{{ item.totalAmountIncludingTax ? '¥' : '' }}{{ formatAmount(item.totalAmountIncludingTax) || '-' }}</text> | 61 | <text>订单总额</text><text class="amount" :style="{ color: '#b67a76' }">{{ item.totalAmountIncludingTax ? '¥' : '' }}{{ formatAmount(item.totalAmountIncludingTax) || '-' }}</text> |
| 62 | </view> | 62 | </view> |
| 63 | <view class="info-row" v-if="item.status === 'STANDARD' || item.status === 'FORMAL'"> | 63 | <view class="info-row" v-if="item.status === 'STANDARD' || item.status === 'FORMAL'"> |
| 64 | - <text>{{ item.status === 'STANDARD' ? '标准合同' : '正式合同' }}规范性审核状态</text><span class="info-status" :style="item.standardApprovedName ? getStatusCss(item.standardApprovedName) : ''">{{ item.standardApprovedName || '-' }}</span> | 64 | + <text>{{ item.status === 'STANDARD' ? '标准合同' : '正式合同' }}规范性审核状态</text> |
| 65 | + <span v-if="item.status === 'STANDARD' ? item.standardApprovedName : item.formalApprovedName" class="info-status" :style="getStatusCss(item.status === 'STANDARD' ? item.standardApprovedName : item.formalApprovedName)">{{ item.status === 'STANDARD' ? item.standardApprovedName : item.formalApprovedName }}</span> | ||
| 66 | + <span v-else>-</span> | ||
| 65 | </view> | 67 | </view> |
| 66 | <view class="info-row"> | 68 | <view class="info-row"> |
| 67 | <text>订货日期</text><text>{{ item.orderDate }}</text> | 69 | <text>订货日期</text><text>{{ item.orderDate }}</text> |
| @@ -107,7 +107,7 @@ | @@ -107,7 +107,7 @@ | ||
| 107 | 数量 | 107 | 数量 |
| 108 | </div> | 108 | </div> |
| 109 | <div class="total-item-price"> | 109 | <div class="total-item-price"> |
| 110 | - {{ (sumQuantity || 0).toFixed(2) }}t | 110 | + {{ (totalQuantity || 0).toFixed(2) }}kg |
| 111 | </div> | 111 | </div> |
| 112 | </div> | 112 | </div> |
| 113 | <div class="total-item"> | 113 | <div class="total-item"> |
| @@ -115,7 +115,7 @@ | @@ -115,7 +115,7 @@ | ||
| 115 | 不含税金额 | 115 | 不含税金额 |
| 116 | </div> | 116 | </div> |
| 117 | <div class="total-item-price text-red"> | 117 | <div class="total-item-price text-red"> |
| 118 | - ¥{{ (sumAmountExcl || 0).toFixed(2) }} | 118 | + ¥{{ (totalAmountExcludingTax || 0).toFixed(2) }} |
| 119 | </div> | 119 | </div> |
| 120 | </div> | 120 | </div> |
| 121 | <div class="total-item"> | 121 | <div class="total-item"> |
| @@ -123,7 +123,7 @@ | @@ -123,7 +123,7 @@ | ||
| 123 | 总金额 | 123 | 总金额 |
| 124 | </div> | 124 | </div> |
| 125 | <div class="total-item-price text-red"> | 125 | <div class="total-item-price text-red"> |
| 126 | - ¥{{ (sumTotal || 0).toFixed(2) }} | 126 | + ¥{{ (totalAmountIncludingTax || 0).toFixed(2) }} |
| 127 | </div> | 127 | </div> |
| 128 | </div> | 128 | </div> |
| 129 | </div> | 129 | </div> |
| @@ -146,15 +146,15 @@ export default { | @@ -146,15 +146,15 @@ export default { | ||
| 146 | } | 146 | } |
| 147 | }, | 147 | }, |
| 148 | computed: { | 148 | computed: { |
| 149 | - sumQuantity() { | 149 | + totalQuantity() { |
| 150 | const qty = this.items.filter(it => it.locked).reduce((p, c) => p + this.toNumber(c.quantity), 0) | 150 | const qty = this.items.filter(it => it.locked).reduce((p, c) => p + this.toNumber(c.quantity), 0) |
| 151 | return this.round(qty, 2) | 151 | return this.round(qty, 2) |
| 152 | }, | 152 | }, |
| 153 | - sumAmountExcl() { | 153 | + totalAmountExcludingTax() { |
| 154 | const sum = this.items.filter(it => it.locked).reduce((p, c) => p + this.toNumber(c.amountExcludingTax), 0) | 154 | const sum = this.items.filter(it => it.locked).reduce((p, c) => p + this.toNumber(c.amountExcludingTax), 0) |
| 155 | return this.round(sum, 2) | 155 | return this.round(sum, 2) |
| 156 | }, | 156 | }, |
| 157 | - sumTotal() { return this.totalAmount }, | 157 | + totalAmountIncludingTax() { return this.totalAmount }, |
| 158 | totalAmount() { | 158 | totalAmount() { |
| 159 | let sum = 0 | 159 | let sum = 0 |
| 160 | for (const it of this.items) { | 160 | for (const it of this.items) { |
| @@ -325,9 +325,9 @@ export default { | @@ -325,9 +325,9 @@ export default { | ||
| 325 | const payload = { | 325 | const payload = { |
| 326 | id: this.id, | 326 | id: this.id, |
| 327 | totalAmountCapital: formatCurrencyToChinese(this.sumTotal), | 327 | totalAmountCapital: formatCurrencyToChinese(this.sumTotal), |
| 328 | - totalAmountExcludingTax: this.sumAmountExcl, | ||
| 329 | - totalAmountIncludingTax: this.sumTotal, | ||
| 330 | - totalQuantity: this.sumQuantity, | 328 | + totalAmountExcludingTax: this.totalAmountExcludingTax, |
| 329 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | ||
| 330 | + totalQuantity: this.totalQuantity, | ||
| 331 | type:'DRAFT_DIST_AGMT', | 331 | type:'DRAFT_DIST_AGMT', |
| 332 | contractDistributorLineList: selected | 332 | contractDistributorLineList: selected |
| 333 | } | 333 | } |
| @@ -362,7 +362,7 @@ export default { | @@ -362,7 +362,7 @@ export default { | ||
| 362 | 362 | ||
| 363 | .scroll { | 363 | .scroll { |
| 364 | flex: 1; | 364 | flex: 1; |
| 365 | - padding: 12rpx 0 480rpx !important; | 365 | + padding: 12rpx 0 392rpx !important; |
| 366 | } | 366 | } |
| 367 | 367 | ||
| 368 | .header { | 368 | .header { |
| @@ -646,7 +646,7 @@ export default { | @@ -646,7 +646,7 @@ export default { | ||
| 646 | color: rgba(0, 0, 0, 0.6); | 646 | color: rgba(0, 0, 0, 0.6); |
| 647 | line-height: 32rpx; | 647 | line-height: 32rpx; |
| 648 | width: 240rpx; | 648 | width: 240rpx; |
| 649 | - padding: 24rpx 0; | 649 | + padding: 12rpx 0; |
| 650 | } | 650 | } |
| 651 | 651 | ||
| 652 | .total-item-price { | 652 | .total-item-price { |
| @@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
| 41 | </template> | 41 | </template> |
| 42 | </uni-list-item> | 42 | </uni-list-item> |
| 43 | 43 | ||
| 44 | - <ProductRel mode="add" :orderDateBase="form.orderDate" :list="productLineList" @change="onProductsChange" :options="productList" /> | 44 | + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" /> |
| 45 | 45 | ||
| 46 | <uni-list-item title="合计人民币金额(大写)"> | 46 | <uni-list-item title="合计人民币金额(大写)"> |
| 47 | <template v-slot:footer> | 47 | <template v-slot:footer> |
| @@ -99,33 +99,25 @@ | @@ -99,33 +99,25 @@ | ||
| 99 | </template> | 99 | </template> |
| 100 | </uni-list-item> | 100 | </uni-list-item> |
| 101 | 101 | ||
| 102 | - <view class="group"> | ||
| 103 | - <view class="group-title">特别条款要求</view> | ||
| 104 | - <view class="radio-list"> | ||
| 105 | - <view v-for="(opt, i) in specialTermsList" :key="'cr-' + i" class="radio-item" | ||
| 106 | - @click="onRadioSelect('specialTerms', 'specialTermsName', opt)"> | ||
| 107 | - <view :class="['radio', { checked: form.specialTerms === opt.value }]" /> | ||
| 108 | - <text class="label">{{ opt.label }}</text> | ||
| 109 | - </view> | ||
| 110 | - </view> | ||
| 111 | - </view> | ||
| 112 | - <view class="group"> | ||
| 113 | - <view class="group-title">执行标准</view> | ||
| 114 | - <view class="radio-list"> | ||
| 115 | - <view v-for="(opt, i) in executionStandardList" :key="'es-' + i" class="radio-item" | ||
| 116 | - @click="onRadioSelect('executionStandard', 'executionStandardName', opt)"> | ||
| 117 | - <view :class="['radio', { checked: form.executionStandard === opt.value }]" /> | ||
| 118 | - <text class="label">{{ opt.label }}</text> | ||
| 119 | - </view> | ||
| 120 | - </view> | ||
| 121 | - </view> | 102 | + <uni-list-item class="select-item" :class="form.specialTermsName ? 'is-filled' : 'is-empty'" clickable |
| 103 | + @click="openSheet('specialTerms')" :rightText="form.specialTermsName || '请选择'" showArrow> | ||
| 104 | + <template v-slot:body> | ||
| 105 | + <view class="item-title"><text class="required">*</text><text>特别条款要求</text></view> | ||
| 106 | + </template> | ||
| 107 | + </uni-list-item> | ||
| 108 | + <uni-list-item class="select-item" :class="form.executionStandardName ? 'is-filled' : 'is-empty'" clickable | ||
| 109 | + @click="openSheet('executionStandard')" :rightText="form.executionStandardName || '请选择'" showArrow> | ||
| 110 | + <template v-slot:body> | ||
| 111 | + <view class="item-title"><text>执行标准</text></view> | ||
| 112 | + </template> | ||
| 113 | + </uni-list-item> | ||
| 122 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> | 114 | <uni-list-item v-if="form.executionStandard === 'OTHER'" title="其他"> |
| 123 | <template v-slot:footer> | 115 | <template v-slot:footer> |
| 124 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" | 116 | <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入其他标准备注" |
| 125 | :inputBorder="false" /> | 117 | :inputBorder="false" /> |
| 126 | </template> | 118 | </template> |
| 127 | </uni-list-item> | 119 | </uni-list-item> |
| 128 | - <uni-list-item title="特别说明"> | 120 | + <uni-list-item title="特别说明" style="margin-top: 20rpx;"> |
| 129 | <template v-slot:footer> | 121 | <template v-slot:footer> |
| 130 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> | 122 | <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" /> |
| 131 | </template> | 123 | </template> |
| @@ -177,15 +169,15 @@ | @@ -177,15 +169,15 @@ | ||
| 177 | <div class="total-text">合计</div> | 169 | <div class="total-text">合计</div> |
| 178 | <div class="total-item"> | 170 | <div class="total-item"> |
| 179 | <div class="total-item-text">数量</div> | 171 | <div class="total-item-text">数量</div> |
| 180 | - <div class="total-item-price">{{ (sumQuantity || 0).toFixed(2) }}t</div> | 172 | + <div class="total-item-price">{{ (totalQuantity || 0).toFixed(2) }}kg</div> |
| 181 | </div> | 173 | </div> |
| 182 | <div class="total-item"> | 174 | <div class="total-item"> |
| 183 | <div class="total-item-text">不含税金额</div> | 175 | <div class="total-item-text">不含税金额</div> |
| 184 | - <div class="total-item-price text-red">¥{{ (sumAmountExcl || 0).toFixed(2) }}</div> | 176 | + <div class="total-item-price text-red">¥{{ (totalAmountExcludingTax || 0).toFixed(2) }}</div> |
| 185 | </div> | 177 | </div> |
| 186 | <div class="total-item"> | 178 | <div class="total-item"> |
| 187 | <div class="total-item-text">总金额</div> | 179 | <div class="total-item-text">总金额</div> |
| 188 | - <div class="total-item-price text-red">¥{{ (sumTotal || 0).toFixed(2) }}</div> | 180 | + <div class="total-item-price text-red">¥{{ (totalAmountIncludingTax || 0).toFixed(2) }}</div> |
| 189 | </div> | 181 | </div> |
| 190 | </div> | 182 | </div> |
| 191 | <button class="btn submit" type="primary" @click="onSubmit">保存</button> | 183 | <button class="btn submit" type="primary" @click="onSubmit">保存</button> |
| @@ -223,6 +215,7 @@ export default { | @@ -223,6 +215,7 @@ export default { | ||
| 223 | workshopId: '', | 215 | workshopId: '', |
| 224 | workshopName: '', | 216 | workshopName: '', |
| 225 | orderDate: '', | 217 | orderDate: '', |
| 218 | + deliveryDate: '', | ||
| 226 | designatedConsignee: '', | 219 | designatedConsignee: '', |
| 227 | specialTerms: '', | 220 | specialTerms: '', |
| 228 | specialTermsName: '', | 221 | specialTermsName: '', |
| @@ -256,9 +249,9 @@ export default { | @@ -256,9 +249,9 @@ export default { | ||
| 256 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], | 249 | yesNoList: [{ label: '是', value: true }, { label: '否', value: false }], |
| 257 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, | 250 | sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, |
| 258 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, | 251 | relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, |
| 259 | - sumQuantity: 0, | ||
| 260 | - sumAmountExcl: 0, | ||
| 261 | - sumTotal: 0, | 252 | + totalQuantity: 0, |
| 253 | + totalAmountExcludingTax: 0, | ||
| 254 | + totalAmountIncludingTax: 0, | ||
| 262 | productLineList: [], | 255 | productLineList: [], |
| 263 | newProductLineList: [], | 256 | newProductLineList: [], |
| 264 | productList: [] | 257 | productList: [] |
| @@ -349,9 +342,9 @@ export default { | @@ -349,9 +342,9 @@ export default { | ||
| 349 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) | 342 | const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0) |
| 350 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) | 343 | const sumE = list.reduce((acc, it) => acc + (parseFloat(it.amountExcludingTax) || 0), 0) |
| 351 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) | 344 | const sumT = list.reduce((acc, it) => acc + (parseFloat(it.totalAmount) || 0), 0) |
| 352 | - this.sumQuantity = sumQ | ||
| 353 | - this.sumAmountExcl = sumE | ||
| 354 | - this.sumTotal = sumT | 345 | + this.totalQuantity = sumQ |
| 346 | + this.totalAmountExcludingTax = sumE | ||
| 347 | + this.totalAmountIncludingTax = sumT | ||
| 355 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) | 348 | this.form.totalAmountCapital = formatCurrencyToChinese(sumT) |
| 356 | }, | 349 | }, |
| 357 | async loadSuppliers() { | 350 | async loadSuppliers() { |
| @@ -399,6 +392,10 @@ export default { | @@ -399,6 +392,10 @@ export default { | ||
| 399 | setSheet('生产厂', opts) | 392 | setSheet('生产厂', opts) |
| 400 | } else if (field === 'supplier') { | 393 | } else if (field === 'supplier') { |
| 401 | setSheet('供方', this.supplierList) | 394 | setSheet('供方', this.supplierList) |
| 395 | + } else if (field === 'specialTerms') { | ||
| 396 | + setSheet('特别条款要求', this.specialTermsList) | ||
| 397 | + } else if (field === 'executionStandard') { | ||
| 398 | + setSheet('执行标准', this.executionStandardList) | ||
| 402 | } else if (field === 'includesPackagingFee') { | 399 | } else if (field === 'includesPackagingFee') { |
| 403 | setSheet('单价中是否已包含包装费', this.yesNoList) | 400 | setSheet('单价中是否已包含包装费', this.yesNoList) |
| 404 | } else if (field === 'includesTransportFee') { | 401 | } else if (field === 'includesTransportFee') { |
| @@ -439,22 +436,35 @@ export default { | @@ -439,22 +436,35 @@ export default { | ||
| 439 | }, | 436 | }, |
| 440 | validateRequired() { | 437 | validateRequired() { |
| 441 | const checks = [ | 438 | const checks = [ |
| 442 | - { key: 'code', label: '编号' }, | 439 | + { key: 'code', label: '编号' }, |
| 443 | { key: 'supplier', label: '供方' }, | 440 | { key: 'supplier', label: '供方' }, |
| 444 | { key: 'buyer', label: '需方' }, | 441 | { key: 'buyer', label: '需方' }, |
| 445 | { key: 'orderDate', label: '订货日期' }, | 442 | { key: 'orderDate', label: '订货日期' }, |
| 443 | + { key: 'unit', label: '单位' }, | ||
| 446 | { key: 'workshopId', label: '生产厂' }, | 444 | { key: 'workshopId', label: '生产厂' }, |
| 445 | + { key: 'specialTerms', label: '特别条款要求' }, | ||
| 447 | ] | 446 | ] |
| 448 | for (const it of checks) { | 447 | for (const it of checks) { |
| 449 | const val = this.form[it.key] | 448 | const val = this.form[it.key] |
| 450 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) | 449 | const empty = (val === undefined || val === null || (typeof val === 'string' && val.trim() === '') || (typeof val === 'number' && isNaN(val))) |
| 451 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } | 450 | if (empty) { uni.showToast({ title: `请先选择${it.label}`, icon: 'none' }); return false } |
| 452 | } | 451 | } |
| 453 | - if (!Array.isArray(this.productLineList) || this.productLineList.length === 0) { | 452 | + const list = Array.isArray(this.newProductLineList) ? this.newProductLineList : [] |
| 453 | + if (list.length === 0) { | ||
| 454 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false | 454 | uni.showToast({ title: '请至少添加一条产品明细', icon: 'none' }); return false |
| 455 | } | 455 | } |
| 456 | - for (const [idx, it] of this.productLineList.entries()) { | ||
| 457 | - if (!it.productName || !it.quantity || !it.unitPrice) { | 456 | + const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === '')) |
| 457 | + const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v))) | ||
| 458 | + for (const [idx, it] of list.entries()) { | ||
| 459 | + if ( | ||
| 460 | + strEmpty(it.productName) || | ||
| 461 | + strEmpty(it.industry) || | ||
| 462 | + strEmpty(it.quality) || | ||
| 463 | + strEmpty(it.brand) || | ||
| 464 | + numEmpty(it.quantity) || | ||
| 465 | + strEmpty(it.unitPrice) || | ||
| 466 | + strEmpty(it.deliveryDate) | ||
| 467 | + ) { | ||
| 458 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false | 468 | uni.showToast({ title: `第${idx + 1}条明细未完整填写`, icon: 'none' }); return false |
| 459 | } | 469 | } |
| 460 | } | 470 | } |
| @@ -486,9 +496,9 @@ export default { | @@ -486,9 +496,9 @@ export default { | ||
| 486 | id: this.form.id, | 496 | id: this.form.id, |
| 487 | destination, | 497 | destination, |
| 488 | type: 'DRAFT_DIST_AGMT', | 498 | type: 'DRAFT_DIST_AGMT', |
| 489 | - sumQuantity: this.sumQuantity, | ||
| 490 | - sumAmountExcl: this.sumAmountExcl, | ||
| 491 | - sumTotal: this.sumTotal, | 499 | + totalQuantity: this.totalQuantity, |
| 500 | + totalAmountExcludingTax: this.totalAmountExcludingTax, | ||
| 501 | + totalAmountIncludingTax: this.totalAmountIncludingTax, | ||
| 492 | contractDistributorLineList: lines | 502 | contractDistributorLineList: lines |
| 493 | }) | 503 | }) |
| 494 | try { | 504 | try { |
| @@ -524,7 +534,7 @@ export default { | @@ -524,7 +534,7 @@ export default { | ||
| 524 | color: rgba(0, 0, 0, 0.6); | 534 | color: rgba(0, 0, 0, 0.6); |
| 525 | line-height: 32rpx; | 535 | line-height: 32rpx; |
| 526 | width: 240rpx; | 536 | width: 240rpx; |
| 527 | - padding: 24rpx 0; | 537 | + padding: 12rpx 0; |
| 528 | } | 538 | } |
| 529 | 539 | ||
| 530 | .total-item-price { | 540 | .total-item-price { |
| @@ -547,7 +557,7 @@ export default { | @@ -547,7 +557,7 @@ export default { | ||
| 547 | 557 | ||
| 548 | .scroll { | 558 | .scroll { |
| 549 | flex: 1; | 559 | flex: 1; |
| 550 | - padding: 12rpx 0 480rpx !important; | 560 | + padding: 12rpx 0 392rpx !important; |
| 551 | } | 561 | } |
| 552 | 562 | ||
| 553 | .footer { | 563 | .footer { |