Commit af41a71ffcf8e301047ba56418bee36dbc611ffd

Authored by gesilong
2 parents ccd503fc 9f425b55

Merge branch 'cjerp-2.0-fix' into publish_cjerp

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