|
...
|
...
|
@@ -58,7 +58,7 @@ |
|
58
|
58
|
<uni-easyinput v-model="item.supplyTime" :inputBorder="false" placeholder="请输入原材料提供时间" />
|
|
59
|
59
|
</template>
|
|
60
|
60
|
</uni-list-item>
|
|
61
|
|
- <uni-list-item class="select-item" :class="item.rawToProdRatioName ? 'is-filled' : 'is-empty'" clickable @click="openRawToProdRatioSheet(idx)" :rightText="item.rawToProdRatioName || '请选择原材料与产品数量比'" showArrow>
|
|
|
61
|
+ <uni-list-item class="select-item" :class="item.materialProductRatioName ? 'is-filled' : 'is-empty'" clickable @click="openRawToProdRatioSheet(idx)" :rightText="item.materialProductRatioName || '请选择原材料与产品数量比'" showArrow>
|
|
62
|
62
|
<template v-slot:body>
|
|
63
|
63
|
<view class="item-title"><text>原材料与产品数量比</text></view>
|
|
64
|
64
|
</template>
|
|
...
|
...
|
@@ -175,9 +175,9 @@ |
|
175
|
175
|
<view v-else class="view-list" v-show="!collapsedView">
|
|
176
|
176
|
<view v-for="(item, idx) in items" :key="'v-' + idx" class="card">
|
|
177
|
177
|
<view class="row"><text class="label">原材料名称</text><text class="value">{{ item.rawProductName }}</text></view>
|
|
178
|
|
- <view class="row"><text class="label">原材料牌号</text><text class="value">{{ item.rawProductGrade }}</text></view>
|
|
179
|
|
- <view class="row"><text class="label">原材料提供时间</text><text class="value">{{ item.rawProductProvideDate }}</text></view>
|
|
180
|
|
- <view class="row"><text class="label">原材料产品数量比</text><text class="value">{{ item.rawToProdRatioName }}</text></view>
|
|
|
178
|
+ <view class="row"><text class="label">原材料牌号</text><text class="value">{{ item.rawProductGradeName }}</text></view>
|
|
|
179
|
+ <view class="row"><text class="label">原材料提供时间</text><text class="value">{{ item.supplyTime }}</text></view>
|
|
|
180
|
+ <view class="row"><text class="label">原材料产品数量比</text><text class="value">{{ item.materialProductRatioName }}</text></view>
|
|
181
|
181
|
<view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view>
|
|
182
|
182
|
<view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view>
|
|
183
|
183
|
<!-- 厚(公差) * 宽(公差) * 长(公差) -->
|
|
...
|
...
|
@@ -256,6 +256,7 @@ export default { |
|
256
|
256
|
},
|
|
257
|
257
|
ratioOptions() {
|
|
258
|
258
|
const list = Array.isArray(this.rawToProdRatioList) ? this.rawToProdRatioList : []
|
|
|
259
|
+ console.log('list', list)
|
|
259
|
260
|
return list.map(o => ({
|
|
260
|
261
|
label: o.label != null ? o.label : (o.text != null ? o.text : (o.name != null ? o.name : '')),
|
|
261
|
262
|
value: o.value != null ? o.value : (o.id != null ? o.id : o.code)
|
|
...
|
...
|
@@ -290,9 +291,7 @@ export default { |
|
290
|
291
|
},
|
|
291
|
292
|
list: {
|
|
292
|
293
|
handler(v) {
|
|
293
|
|
- // const arr = Array.isArray(v) ? v : []
|
|
294
|
|
- // this.items = arr.map(x => ({ ...this.defaultItem(), ...x, collapsed: true }))
|
|
295
|
|
- this.items = v.map(x => ({ ...this.defaultItem(), ...x, collapsed: true }))
|
|
|
294
|
+ this.items = v.map(x => ({ ...this.defaultItem(), ...x, productName: this.selectOptions.find(o => o.value === x.productId)?.label || '', collapsed: true }))
|
|
296
|
295
|
console.log('v', v)
|
|
297
|
296
|
},
|
|
298
|
297
|
deep: true
|
|
...
|
...
|
@@ -301,11 +300,12 @@ export default { |
|
301
|
300
|
created() {
|
|
302
|
301
|
const init = Array.isArray(this.list) && this.list.length > 0 ? this.list.map(v => ({ ...this.defaultItem(), ...v, collapsed: true })) : [{ ...this.defaultItem(), collapsed: false }]
|
|
303
|
302
|
this.items = init
|
|
|
303
|
+ console.log('init', init)
|
|
304
|
304
|
this.recalculateAll()
|
|
305
|
305
|
},
|
|
306
|
306
|
methods: {
|
|
307
|
307
|
defaultItem() {
|
|
308
|
|
- return { productId:'', productName:'', productGrade:'', productStatus:'', 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: '' }
|
|
|
308
|
+ return { productId:'', productName:'', productGrade:'', productStatus:'', rawProductId: '', rawProductName: '', rawProductGrade: '', industry: '',materialProductRatioRemarks:'', supplyTime: '存料加工', materialProductRatio: '', materialProductRatioName: '', quality: '', thickness: '', thicknessTolPos: '', thicknessTolNeg: '', width: '', widthTolPos: '', widthTolNeg: '', length: '', lengthTolPos: '', lengthTolNeg: '', productQuantity: '', unitPrice: '', amountExcludingTax: 0, totalAmount: 0, deliveryDate: '' }
|
|
309
|
309
|
},
|
|
310
|
310
|
onNumberInput(idx, field) {
|
|
311
|
311
|
const it = this.items[idx]
|
|
...
|
...
|
@@ -454,7 +454,7 @@ export default { |
|
454
|
454
|
if (!it) { this.sheet.visible = false; return }
|
|
455
|
455
|
if (this.sheet.mode === 'ratio') {
|
|
456
|
456
|
it.materialProductRatio = value
|
|
457
|
|
- it.rawToProdRatioName = label || ''
|
|
|
457
|
+ it.materialProductRatioName = label || ''
|
|
458
|
458
|
} else if (this.sheet.mode === 'product') {
|
|
459
|
459
|
if (it.rawProductId !== value) {
|
|
460
|
460
|
it.rawProductGrade = ''
|
...
|
...
|
|