Showing
21 changed files
with
125 additions
and
19 deletions
| ... | ... | @@ -48,6 +48,7 @@ |
| 48 | 48 | :product-options="productOptions" |
| 49 | 49 | :workshop-options="workshopOptions" |
| 50 | 50 | @invoice-name-change="handleInvoiceNameChange" |
| 51 | + :isAnyBuyout="isAnyBuyout" | |
| 51 | 52 | /> |
| 52 | 53 | |
| 53 | 54 | <view class="title-header"> |
| ... | ... | @@ -146,6 +147,9 @@ export default { |
| 146 | 147 | } |
| 147 | 148 | }, |
| 148 | 149 | computed: { |
| 150 | + isAnyBuyout() { | |
| 151 | + return this.form.commodityBuyout || this.form.qualityBuyout || this.form.quantityBuyout | |
| 152 | + }, | |
| 149 | 153 | productMap() { |
| 150 | 154 | var list = Array.isArray(this.productOptions) ? this.productOptions : [] |
| 151 | 155 | var m = {} | ... | ... |
| ... | ... | @@ -47,6 +47,7 @@ |
| 47 | 47 | :product-options="productOptions" |
| 48 | 48 | :workshop-options="workshopOptions" |
| 49 | 49 | @invoice-name-change="handleInvoiceNameChange" |
| 50 | + :isAnyBuyout="isAnyBuyout" | |
| 50 | 51 | /> |
| 51 | 52 | |
| 52 | 53 | <view class="title-header"> |
| ... | ... | @@ -115,6 +116,9 @@ export default { |
| 115 | 116 | } |
| 116 | 117 | }, |
| 117 | 118 | computed: { |
| 119 | + isAnyBuyout() { | |
| 120 | + return this.form.commodityBuyout || this.form.qualityBuyout || this.form.quantityBuyout | |
| 121 | + }, | |
| 118 | 122 | productMap() { |
| 119 | 123 | var list = Array.isArray(this.productOptions) ? this.productOptions : [] |
| 120 | 124 | var m = {} | ... | ... |
| ... | ... | @@ -98,7 +98,7 @@ |
| 98 | 98 | </uni-list-item> |
| 99 | 99 | <uni-list-item title="买断料预计损耗"> |
| 100 | 100 | <template v-slot:footer> |
| 101 | - <text class="lock-value">{{ formatTextNumber(item.estimatedLoss) }}</text> | |
| 101 | + <text class="lock-value">{{ isAnyBuyout ? formatTextNumber(item.estimatedLoss) : '' }}</text> | |
| 102 | 102 | </template> |
| 103 | 103 | </uni-list-item> |
| 104 | 104 | <uni-list-item title="申请损耗(%)"> |
| ... | ... | @@ -172,7 +172,7 @@ |
| 172 | 172 | <view class="row"><text class="label">含运到厂价</text><text class="value">{{ formatNumber(item.includingShippingPrice) }}</text></view> |
| 173 | 173 | <view class="row"><text class="label">价格表价格</text><text class="value">{{ formatNumber(item.priceListPrices) }}</text></view> |
| 174 | 174 | <view class="row"><text class="label">协调幅度</text><text class="value">{{ formatNumber(item.coordinationRange) }}</text></view> |
| 175 | - <view class="row"><text class="label">买断料预计损耗</text><text class="value">{{ formatNumber(item.estimatedLoss) }}</text></view> | |
| 175 | + <view class="row"><text class="label">买断料预计损耗</text><text class="value">{{ isAnyBuyout ? formatNumber(item.estimatedLoss) : '' }}</text></view> | |
| 176 | 176 | <view class="row"><text class="label">申请损耗(%)</text><text class="value">{{ formatNumber(item.applicationAttrition) }}</text></view> |
| 177 | 177 | <view class="row"><text class="label">分厂</text><text class="value">{{ safeText(item.workshopName || item.workshopId) }}</text></view> |
| 178 | 178 | </view> |
| ... | ... | @@ -199,7 +199,8 @@ export default { |
| 199 | 199 | list: { type: Array, default: function () { return [] } }, |
| 200 | 200 | max: { type: Number, default: 50 }, |
| 201 | 201 | productOptions: { type: Array, default: function () { return [] } }, |
| 202 | - workshopOptions: { type: Array, default: function () { return [] } } | |
| 202 | + workshopOptions: { type: Array, default: function () { return [] } }, | |
| 203 | + isAnyBuyout: { type: Boolean, default: false } | |
| 203 | 204 | }, |
| 204 | 205 | components: { SingleSelectSheet }, |
| 205 | 206 | data() { |
| ... | ... | @@ -484,6 +485,7 @@ export default { |
| 484 | 485 | delete c._selected |
| 485 | 486 | delete c.fixedLossRate |
| 486 | 487 | if (!c.itemId) c.itemId = key |
| 488 | + if (!this.isAnyBuyout) c.estimatedLoss = null | |
| 487 | 489 | return c |
| 488 | 490 | }) |
| 489 | 491 | this.$emit('change', list) | ... | ... |
| ... | ... | @@ -225,6 +225,7 @@ |
| 225 | 225 | :workshop-options="workshopOptions" |
| 226 | 226 | @change="onLineChange" |
| 227 | 227 | @invoice-name-change="handleInvoiceNameChange" |
| 228 | + :isAnyBuyout="isAnyBuyout" | |
| 228 | 229 | /> |
| 229 | 230 | </uni-list> |
| 230 | 231 | |
| ... | ... | @@ -309,6 +310,9 @@ export default { |
| 309 | 310 | } |
| 310 | 311 | }, |
| 311 | 312 | computed: { |
| 313 | + isAnyBuyout() { | |
| 314 | + return this.form.commodityBuyout || this.form.qualityBuyout || this.form.quantityBuyout | |
| 315 | + }, | |
| 312 | 316 | companyNameDisplay() { |
| 313 | 317 | var d = this.detail || {} |
| 314 | 318 | return d.companyShortName != null ? d.companyShortName : (d.companyName != null ? d.companyName : '') | ... | ... |
| ... | ... | @@ -237,6 +237,7 @@ |
| 237 | 237 | :workshop-options="workshopOptions" |
| 238 | 238 | @change="onLineChange" |
| 239 | 239 | @invoice-name-change="handleInvoiceNameChange" |
| 240 | + :isAnyBuyout="isAnyBuyout" | |
| 240 | 241 | /> |
| 241 | 242 | </uni-list> |
| 242 | 243 | |
| ... | ... | @@ -377,6 +378,9 @@ export default { |
| 377 | 378 | } |
| 378 | 379 | }, |
| 379 | 380 | computed: { |
| 381 | + isAnyBuyout() { | |
| 382 | + return this.form.commodityBuyout || this.form.qualityBuyout || this.form.quantityBuyout | |
| 383 | + }, | |
| 380 | 384 | shippingCostNumber() { |
| 381 | 385 | var v = this.form.shippingCost |
| 382 | 386 | if (v == null || v === '') return 0 | ... | ... |
| ... | ... | @@ -203,7 +203,9 @@ |
| 203 | 203 | </uni-list-item> |
| 204 | 204 | |
| 205 | 205 | <!-- 明细信息 --> |
| 206 | - <ProductRel ref="productRel" mode="add" :options="productList" :priced="form.priced" @change="onProductsChange" @invoice-name-change="onInvoiceNameChange" /> | |
| 206 | + <ProductRel ref="productRel" mode="add" :options="productList" :priced="form.priced" @change="onProductsChange" @invoice-name-change="onInvoiceNameChange" | |
| 207 | + :isAnyBuyout="isAnyBuyout" | |
| 208 | + /> | |
| 207 | 209 | </uni-list> |
| 208 | 210 | |
| 209 | 211 | <!-- 料质状况模块(明细下方) --> |
| ... | ... | @@ -343,6 +345,12 @@ export default { |
| 343 | 345 | dictData: {} |
| 344 | 346 | } |
| 345 | 347 | }, |
| 348 | + computed: { | |
| 349 | + // 监听三个买断字段中是否有任一选择为“是” | |
| 350 | + isAnyBuyout() { | |
| 351 | + return !!(this.form.commodityBuyout || this.form.qualityBuyout || this.form.quantityBuyout); | |
| 352 | + } | |
| 353 | + }, | |
| 346 | 354 | created() { |
| 347 | 355 | this.supplierSheet.fetchFn = this.fetchSuppliers.bind(this) |
| 348 | 356 | this.initCode() | ... | ... |
| ... | ... | @@ -203,7 +203,9 @@ |
| 203 | 203 | </uni-list-item> |
| 204 | 204 | |
| 205 | 205 | <!-- 明细信息 --> |
| 206 | - <ProductRel ref="productRel" mode="add" :options="productList" :priced="form.priced" :list="productLineList" @change="onProductsChange" @invoice-name-change="onInvoiceNameChange"/> | |
| 206 | + <ProductRel ref="productRel" mode="add" :options="productList" :priced="form.priced" :list="productLineList" @change="onProductsChange" @invoice-name-change="onInvoiceNameChange" | |
| 207 | + :isAnyBuyout="isAnyBuyout" | |
| 208 | + /> | |
| 207 | 209 | </uni-list> |
| 208 | 210 | |
| 209 | 211 | <!-- 料质状况模块(明细下方) --> |
| ... | ... | @@ -343,6 +345,11 @@ export default { |
| 343 | 345 | dictData: {} |
| 344 | 346 | } |
| 345 | 347 | }, |
| 348 | + computed: { | |
| 349 | + isAnyBuyout() { | |
| 350 | + return this.form.commodityBuyout || this.form.qualityBuyout || this.form.quantityBuyout | |
| 351 | + } | |
| 352 | + }, | |
| 346 | 353 | onLoad(query) { |
| 347 | 354 | this.sourceId = (query && query.id) || '' |
| 348 | 355 | this.supplierSheet.fetchFn = this.fetchSuppliers.bind(this) | ... | ... |
| ... | ... | @@ -31,7 +31,7 @@ |
| 31 | 31 | </view> |
| 32 | 32 | |
| 33 | 33 | <!-- 明细信息 --> |
| 34 | - <ProductRel mode="view" :list="productLineList" @invoiceNameChange="onInvoiceNameChange" /> | |
| 34 | + <ProductRel mode="view" :list="productLineList" @invoiceNameChange="onInvoiceNameChange" :isAnyBuyout="isAnyBuyout" /> | |
| 35 | 35 | |
| 36 | 36 | <!-- 料质状况 --> |
| 37 | 37 | <view class="title-header"> |
| ... | ... | @@ -117,6 +117,9 @@ export default { |
| 117 | 117 | { ...this.buttons[4], visible: (s === 'AUDIT' && this.form.showExamine && this.$auth.hasPermi('procure-manage:sales-price:approves')) }, |
| 118 | 118 | { ...this.buttons[5], visible: (this.form.showExamineDetail && this.$auth.hasPermi('procure-manage:sales-price:view')) }, |
| 119 | 119 | ] |
| 120 | + }, | |
| 121 | + isAnyBuyout() { | |
| 122 | + return this.form.commodityBuyout || this.form.qualityBuyout || this.form.quantityBuyout | |
| 120 | 123 | } |
| 121 | 124 | }, |
| 122 | 125 | onLoad(query) { | ... | ... |
| ... | ... | @@ -202,7 +202,8 @@ |
| 202 | 202 | </uni-list-item> |
| 203 | 203 | |
| 204 | 204 | <!-- 明细信息 --> |
| 205 | - <ProductRel ref="productRel" mode="edit" :options="productList" :priced="form.priced" :list="productLineList" @change="onProductsChange" @invoice-name-change="onInvoiceNameChange"/> | |
| 205 | + <ProductRel ref="productRel" mode="edit" :options="productList" :priced="form.priced" :list="productLineList" @change="onProductsChange" @invoice-name-change="onInvoiceNameChange" | |
| 206 | + :isAnyBuyout="isAnyBuyout" /> | |
| 206 | 207 | </uni-list> |
| 207 | 208 | |
| 208 | 209 | <!-- 料质状况模块(明细下方) --> |
| ... | ... | @@ -342,6 +343,11 @@ export default { |
| 342 | 343 | dictData: {} |
| 343 | 344 | } |
| 344 | 345 | }, |
| 346 | + computed: { | |
| 347 | + isAnyBuyout() { | |
| 348 | + return this.form.commodityBuyout || this.form.qualityBuyout || this.form.quantityBuyout | |
| 349 | + } | |
| 350 | + }, | |
| 345 | 351 | onLoad(query) { |
| 346 | 352 | this.id = (query && query.id) || '' |
| 347 | 353 | this.supplierSheet.fetchFn = this.fetchSuppliers.bind(this) | ... | ... |
| ... | ... | @@ -42,7 +42,7 @@ |
| 42 | 42 | </uni-list-item> |
| 43 | 43 | <uni-list-item title="买断料预计损耗"> |
| 44 | 44 | <template v-slot:footer> |
| 45 | - <uni-easyinput v-model="item.estimatedLoss" type="digit" :inputBorder="false" disabled placeholder="" /> | |
| 45 | + <uni-easyinput :value="isAnyBuyout ? item.estimatedLoss : null" type="digit" :inputBorder="false" disabled placeholder="" /> | |
| 46 | 46 | </template> |
| 47 | 47 | </uni-list-item> |
| 48 | 48 | <uni-list-item title="申请损耗(%)"> |
| ... | ... | @@ -82,7 +82,7 @@ |
| 82 | 82 | <view class="row"><text class="label">开票品名</text><text class="value">{{ item.invoiceProductName }}</text></view> |
| 83 | 83 | <view class="row"><text class="label">数量(吨)</text><text class="value">{{ item.quantity }}</text></view> |
| 84 | 84 | <view class="row"><text class="label">采购价</text><text class="value">{{ item.purchasePrice }}</text></view> |
| 85 | - <view class="row"><text class="label">买断料预计损耗</text><text class="value">{{ item.estimatedLoss }}</text></view> | |
| 85 | + <view class="row"><text class="label">买断料预计损耗</text><text class="value">{{ isAnyBuyout ? item.estimatedLoss : '' }}</text></view> | |
| 86 | 86 | <view class="row"><text class="label">申请损耗(%)</text><text class="value">{{ item.applicationAttrition }}</text></view> |
| 87 | 87 | <view class="row"><text class="label">漆损率(%)</text><text class="value">{{ item.paint_damage_ratio }}</text></view> |
| 88 | 88 | </view> |
| ... | ... | @@ -101,7 +101,8 @@ export default { |
| 101 | 101 | list: { type: Array, default: () => [] }, |
| 102 | 102 | max: { type: Number, default: 50 }, |
| 103 | 103 | options: { type: Array, default: () => [] }, |
| 104 | - priced: { type: Boolean, default: true } | |
| 104 | + priced: { type: Boolean, default: true }, | |
| 105 | + isAnyBuyout: { type: Boolean, default: false } | |
| 105 | 106 | }, |
| 106 | 107 | components: { SingleSelectSheet }, |
| 107 | 108 | data() { |
| ... | ... | @@ -136,7 +137,20 @@ export default { |
| 136 | 137 | this.initItems() |
| 137 | 138 | this.$nextTick(() => { this._initialized = true }) |
| 138 | 139 | } |
| 139 | - } | |
| 140 | + }, | |
| 141 | + isAnyBuyout: { | |
| 142 | + handler(val) { | |
| 143 | + if (val) { | |
| 144 | + // 当买断状态变为“是”时,重新计算所有行的预计损耗 | |
| 145 | + if (Array.isArray(this.items)) { | |
| 146 | + this.items.forEach((row, idx) => { | |
| 147 | + this.recalcEstimatedLoss(idx); | |
| 148 | + }); | |
| 149 | + } | |
| 150 | + } | |
| 151 | + }, | |
| 152 | + immediate: true, | |
| 153 | + }, | |
| 140 | 154 | }, |
| 141 | 155 | created() { |
| 142 | 156 | this.initItems() |
| ... | ... | @@ -292,6 +306,7 @@ export default { |
| 292 | 306 | delete c.collapsed |
| 293 | 307 | delete c._selected |
| 294 | 308 | if (!c.itemId) c.itemId = key |
| 309 | + c.estimatedLoss = this.isAnyBuyout ? c.estimatedLoss : null | |
| 295 | 310 | return c |
| 296 | 311 | }) |
| 297 | 312 | this.$emit('change', list) | ... | ... |
| ... | ... | @@ -30,7 +30,7 @@ |
| 30 | 30 | </view> |
| 31 | 31 | |
| 32 | 32 | <!-- 明细信息 --> |
| 33 | - <ProductRel mode="view" :list="productLineList" @invoiceNameChange="onInvoiceNameChange" /> | |
| 33 | + <ProductRel mode="view" :list="productLineList" @invoiceNameChange="onInvoiceNameChange" :isAnyBuyout="isAnyBuyout" /> | |
| 34 | 34 | |
| 35 | 35 | <!-- 料质状况 --> |
| 36 | 36 | <view class="title-header"> |
| ... | ... | @@ -91,6 +91,11 @@ export default { |
| 91 | 91 | dictData: {} |
| 92 | 92 | } |
| 93 | 93 | }, |
| 94 | + computed: { | |
| 95 | + isAnyBuyout() { | |
| 96 | + return this.form.commodityBuyout || this.form.qualityBuyout || this.form.quantityBuyout | |
| 97 | + } | |
| 98 | + }, | |
| 94 | 99 | created() { |
| 95 | 100 | this.loadDictData() |
| 96 | 101 | }, | ... | ... |
| ... | ... | @@ -243,6 +243,7 @@ |
| 243 | 243 | :workshop-options="workshopOptions" |
| 244 | 244 | @change="onLineChange" |
| 245 | 245 | @invoice-name-change="onInvoiceNameChange" |
| 246 | + :isAnyBuyout="isAnyBuyout" | |
| 246 | 247 | /> |
| 247 | 248 | </uni-list> |
| 248 | 249 | |
| ... | ... | @@ -375,6 +376,9 @@ export default { |
| 375 | 376 | } |
| 376 | 377 | }, |
| 377 | 378 | computed: { |
| 379 | + isAnyBuyout() { | |
| 380 | + return this.detail.commodityBuyout || this.detail.qualityBuyout || this.detail.quantityBuyout | |
| 381 | + }, | |
| 378 | 382 | companyNameDisplay() { |
| 379 | 383 | var d = this.detail || {} |
| 380 | 384 | return d.companyShortName != null ? d.companyShortName : (d.companyName != null ? d.companyName : '') | ... | ... |
| ... | ... | @@ -58,7 +58,7 @@ |
| 58 | 58 | <view class="row"><text class="label">含运到厂价</text><text class="value">{{ formatNumber(line.includingShippingPrice) }}</text></view> |
| 59 | 59 | <view class="row"><text class="label">价格表价格</text><text class="value">{{ formatNumber(line.priceListPrices) }}</text></view> |
| 60 | 60 | <view class="row"><text class="label">协调幅度</text><text class="value">{{ formatNumber(line.coordinationRange) }}</text></view> |
| 61 | - <view class="row"><text class="label">买断料预计损耗</text><text class="value">{{ formatNumber(line.estimatedLoss) }}</text></view> | |
| 61 | + <view class="row"><text class="label">买断料预计损耗</text><text class="value">{{ isAnyBuyout ? formatNumber(line.estimatedLoss) : '' }}</text></view> | |
| 62 | 62 | <view class="row"><text class="label">申请损耗(%)</text><text class="value">{{ formatNumber(line.applicationAttrition) }}</text></view> |
| 63 | 63 | <view class="row"><text class="label">选择分厂</text><text class="value">{{ safeText(line.workshopName) }}</text></view> |
| 64 | 64 | </view> |
| ... | ... | @@ -141,6 +141,9 @@ export default { |
| 141 | 141 | } |
| 142 | 142 | }, |
| 143 | 143 | computed: { |
| 144 | + isAnyBuyout() { | |
| 145 | + return this.form.commodityBuyout || this.form.qualityBuyout || this.form.quantityBuyout | |
| 146 | + }, | |
| 144 | 147 | productMap() { |
| 145 | 148 | var list = Array.isArray(this.productOptions) ? this.productOptions : [] |
| 146 | 149 | var m = {} | ... | ... |
| ... | ... | @@ -246,6 +246,7 @@ |
| 246 | 246 | :workshop-options="workshopOptions" |
| 247 | 247 | @change="onLineChange" |
| 248 | 248 | @invoice-name-change="onInvoiceNameChange" |
| 249 | + :isAnyBuyout="isAnyBuyout" | |
| 249 | 250 | /> |
| 250 | 251 | </uni-list> |
| 251 | 252 | |
| ... | ... | @@ -360,6 +361,9 @@ export default { |
| 360 | 361 | } |
| 361 | 362 | }, |
| 362 | 363 | computed: { |
| 364 | + isAnyBuyout() { | |
| 365 | + return this.detail.commodityBuyout || this.detail.qualityBuyout || this.detail.quantityBuyout | |
| 366 | + }, | |
| 363 | 367 | companyNameDisplay() { |
| 364 | 368 | var d = this.detail || {} |
| 365 | 369 | return d.companyShortName != null ? d.companyShortName : (d.companyName != null ? d.companyName : '') | ... | ... |
| ... | ... | @@ -99,7 +99,7 @@ |
| 99 | 99 | </view> |
| 100 | 100 | </template> |
| 101 | 101 | <template v-slot:footer> |
| 102 | - <text class="lock-value">{{ formatTextNumber(item.estimatedLoss) }}</text> | |
| 102 | + <text class="lock-value">{{ isAnyBuyout ? formatTextNumber(item.estimatedLoss) : null }}</text> | |
| 103 | 103 | </template> |
| 104 | 104 | </uni-list-item> |
| 105 | 105 | <uni-list-item> |
| ... | ... | @@ -176,7 +176,8 @@ export default { |
| 176 | 176 | list: { type: Array, default: function () { return [] } }, |
| 177 | 177 | max: { type: Number, default: 50 }, |
| 178 | 178 | productOptions: { type: Array, default: function () { return [] } }, |
| 179 | - workshopOptions: { type: Array, default: function () { return [] } } | |
| 179 | + workshopOptions: { type: Array, default: function () { return [] } }, | |
| 180 | + isAnyBuyout: { type: Boolean, default: false } | |
| 180 | 181 | }, |
| 181 | 182 | data() { |
| 182 | 183 | return { |
| ... | ... | @@ -207,6 +208,14 @@ export default { |
| 207 | 208 | } |
| 208 | 209 | }, |
| 209 | 210 | watch: { |
| 211 | + isAnyBuyout: { | |
| 212 | + handler(newVal, oldVal) { | |
| 213 | + if (newVal !== oldVal) { | |
| 214 | + self.recalcAllItems() | |
| 215 | + } | |
| 216 | + }, | |
| 217 | + immediate: false | |
| 218 | + }, | |
| 210 | 219 | items: { |
| 211 | 220 | handler() { |
| 212 | 221 | this.emitChange(); |
| ... | ... | @@ -467,6 +476,7 @@ export default { |
| 467 | 476 | delete c._selected |
| 468 | 477 | delete c.fixedLossRate |
| 469 | 478 | if (!c.itemId) c.itemId = key |
| 479 | + if (!this.isAnyBuyout) c.estimatedLoss = null | |
| 470 | 480 | return c |
| 471 | 481 | }) |
| 472 | 482 | this.$emit('change', list) | ... | ... |
| ... | ... | @@ -301,7 +301,7 @@ |
| 301 | 301 | </uni-list-item> |
| 302 | 302 | <uni-list-item title="买断料预计损耗"> |
| 303 | 303 | <template v-slot:footer> |
| 304 | - <uni-easyinput :value="lineNumberDisplay(line.estimatedLoss)" :inputBorder="false" disabled placeholder="-" /> | |
| 304 | + <uni-easyinput :value="isAnyBuyout ? lineNumberDisplay(line.estimatedLoss) : null" :inputBorder="false" disabled placeholder="-" /> | |
| 305 | 305 | </template> |
| 306 | 306 | </uni-list-item> |
| 307 | 307 | <uni-list-item title="申请损耗(%)"> | ... | ... |
| ... | ... | @@ -245,6 +245,7 @@ |
| 245 | 245 | :price-map="priceMap" |
| 246 | 246 | @change="onLineChange" |
| 247 | 247 | @invoice-name-change="onInvoiceNameChange" |
| 248 | + :isAnyBuyout="isAnyBuyout" | |
| 248 | 249 | /> |
| 249 | 250 | </uni-list> |
| 250 | 251 | |
| ... | ... | @@ -378,6 +379,9 @@ export default { |
| 378 | 379 | } |
| 379 | 380 | }, |
| 380 | 381 | computed: { |
| 382 | + isAnyBuyout() { | |
| 383 | + return this.detail.commodityBuyout || this.detail.qualityBuyout || this.detail.quantityBuyout | |
| 384 | + }, | |
| 381 | 385 | companyNameDisplay() { |
| 382 | 386 | var d = this.detail || {} |
| 383 | 387 | return d.companyShortName != null ? d.companyShortName : (d.companyName != null ? d.companyName : '') | ... | ... |
| ... | ... | @@ -58,7 +58,7 @@ |
| 58 | 58 | <view class="row"><text class="label">含运到厂价</text><text class="value">{{ formatNumber(line.includingShippingPrice) }}</text></view> |
| 59 | 59 | <view class="row"><text class="label">价格表价格</text><text class="value">{{ formatNumber(line.priceListPrices) }}</text></view> |
| 60 | 60 | <view class="row"><text class="label">协调幅度</text><text class="value">{{ formatNumber(line.coordinationRange) }}</text></view> |
| 61 | - <view class="row"><text class="label">买断料预计损耗</text><text class="value">{{ formatNumber(line.estimatedLoss) }}</text></view> | |
| 61 | + <view class="row"><text class="label">买断料预计损耗</text><text class="value">{{ isAnyBuyout ? formatNumber(line.estimatedLoss) : '' }}</text></view> | |
| 62 | 62 | <view class="row"><text class="label">申请损耗(%)</text><text class="value">{{ formatNumber(line.applicationAttrition) }}</text></view> |
| 63 | 63 | <view class="row"><text class="label">选择分厂</text><text class="value">{{ safeText(line.workshopName) }}</text></view> |
| 64 | 64 | </view> |
| ... | ... | @@ -142,6 +142,9 @@ export default { |
| 142 | 142 | } |
| 143 | 143 | }, |
| 144 | 144 | computed: { |
| 145 | + isAnyBuyout() { | |
| 146 | + return this.form.commodityBuyout || this.form.qualityBuyout || this.form.quantityBuyout | |
| 147 | + }, | |
| 145 | 148 | productMap() { |
| 146 | 149 | var list = Array.isArray(this.productOptions) ? this.productOptions : [] |
| 147 | 150 | var m = {} | ... | ... |
| ... | ... | @@ -251,6 +251,7 @@ |
| 251 | 251 | :price-map="priceMap" |
| 252 | 252 | @change="onLineChange" |
| 253 | 253 | @invoice-name-change="onInvoiceNameChange" |
| 254 | + :isAnyBuyout="isAnyBuyout" | |
| 254 | 255 | /> |
| 255 | 256 | </uni-list> |
| 256 | 257 | |
| ... | ... | @@ -366,6 +367,9 @@ export default { |
| 366 | 367 | } |
| 367 | 368 | }, |
| 368 | 369 | computed: { |
| 370 | + isAnyBuyout() { | |
| 371 | + return this.detail.commodityBuyout || this.detail.qualityBuyout || this.detail.quantityBuyout | |
| 372 | + }, | |
| 369 | 373 | companyNameDisplay() { |
| 370 | 374 | var d = this.detail || {} |
| 371 | 375 | return d.companyShortName != null ? d.companyShortName : (d.companyName != null ? d.companyName : '') | ... | ... |
| ... | ... | @@ -114,7 +114,7 @@ |
| 114 | 114 | |
| 115 | 115 | <uni-list-item title="买断料预计损耗"> |
| 116 | 116 | <template v-slot:footer> |
| 117 | - <text class="lock-value">{{ formatTextNumber(item.estimatedLoss) }}</text> | |
| 117 | + <text class="lock-value">{{isAnyBuyout ? formatTextNumber(item.estimatedLoss) : null }} </text> | |
| 118 | 118 | </template> |
| 119 | 119 | </uni-list-item> |
| 120 | 120 | |
| ... | ... | @@ -238,7 +238,8 @@ export default { |
| 238 | 238 | productOptions: { type: Array, default: function () { return [] } }, |
| 239 | 239 | workshopOptions: { type: Array, default: function () { return [] } }, |
| 240 | 240 | shippingCost: { type: [String, Number], default: '' }, |
| 241 | - priceMap: { type: Object, default: function () { return {} } } | |
| 241 | + priceMap: { type: Object, default: function () { return {} } }, | |
| 242 | + isAnyBuyout: { type: Boolean, default: false } | |
| 242 | 243 | }, |
| 243 | 244 | data() { |
| 244 | 245 | return { |
| ... | ... | @@ -306,6 +307,12 @@ export default { |
| 306 | 307 | this.recalcAllItems() |
| 307 | 308 | }, |
| 308 | 309 | immediate: false |
| 310 | + }, | |
| 311 | + isAnyBuyout: { | |
| 312 | + handler() { | |
| 313 | + this.recalcAllItems() | |
| 314 | + }, | |
| 315 | + immediate: false | |
| 309 | 316 | } |
| 310 | 317 | }, |
| 311 | 318 | created() { |
| ... | ... | @@ -616,6 +623,7 @@ export default { |
| 616 | 623 | delete c._selected |
| 617 | 624 | delete c.fixedLossRate |
| 618 | 625 | if (!c.itemId) c.itemId = key |
| 626 | + if (!this.isAnyBuyout) c.estimatedLoss = null | |
| 619 | 627 | return c |
| 620 | 628 | }) |
| 621 | 629 | var sig = list.length + '|' + list.map(function (r) { | ... | ... |
| ... | ... | @@ -422,6 +422,7 @@ |
| 422 | 422 | :workshop-options="workshopOptions" |
| 423 | 423 | :shipping-cost="form.shippingCost" |
| 424 | 424 | :price-map="priceMap" |
| 425 | + :isAnyBuyout="isAnyBuyout" | |
| 425 | 426 | /> |
| 426 | 427 | |
| 427 | 428 | <view class="title-header"> |
| ... | ... | @@ -552,6 +553,9 @@ export default { |
| 552 | 553 | } |
| 553 | 554 | }, |
| 554 | 555 | computed: { |
| 556 | + isAnyBuyout() { | |
| 557 | + return this.form.commodityBuyout || this.form.qualityBuyout || this.form.quantityBuyout | |
| 558 | + }, | |
| 555 | 559 | isEditLayout() { |
| 556 | 560 | return this.canEdit || this.canEditWorkshop |
| 557 | 561 | }, | ... | ... |