Commit 31863eb1ea74287f5a0ec930f32931de912ecb0b

Authored by gesilong
1 parent 9ab7040c

Changes:修复合同相关Bug

@@ -59,7 +59,9 @@ @@ -59,7 +59,9 @@
59 <view class="row"><text class="label">备注</text><text class="value">{{ detail.remarks || '-' 59 <view class="row"><text class="label">备注</text><text class="value">{{ detail.remarks || '-'
60 }}</text></view> 60 }}</text></view>
61 </view> 61 </view>
62 - <view class="section" v-if="status === 'STANDARD'"> 62 + <view class="section" v-if="detail.status === 'STANDARD'">
  63 + <view class="row"><text class="label">双方盖章合同</text><text class="value" style="color: #3D48A3;">{{
  64 + detail.signedContractFileName || '-' }}</text></view>
63 <view class="row"><text class="label">规范性合同</text><text class="value act" @click="downloadFile(detail.standardFileId, detail.standardFileName)">{{ 65 <view class="row"><text class="label">规范性合同</text><text class="value act" @click="downloadFile(detail.standardFileId, detail.standardFileName)">{{
64 detail.standardFileName || '-' }}</text></view> 66 detail.standardFileName || '-' }}</text></view>
65 <view class="row"><text class="label">合同是否规范</text><text class="value">{{ 67 <view class="row"><text class="label">合同是否规范</text><text class="value">{{
@@ -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" :deliveryDate="form.orderDate" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" :rawProductList="rawProductList" :rawProductGradeList="rawProductGradeList" /> 44 + <ProductRel mode="add" :deliveryDate="form.orderDate" :deliveryDateBase="form.deliveryDate" :rawToProdRatioList="rawToProdRatioList" :list="productLineList" @change="onProductsChange" :options="productList" :rawProductList="rawProductList" :rawProductGradeList="rawProductGradeList" />
45 45
46 <uni-list-item title="合计金额(大写)"> 46 <uni-list-item title="合计金额(大写)">
47 <template v-slot:footer> 47 <template v-slot:footer>
@@ -494,12 +494,12 @@ export default { @@ -494,12 +494,12 @@ export default {
494 } 494 }
495 const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === '')) 495 const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === ''))
496 const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v))) 496 const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v)))
  497 + console.log('list11', list)
497 for (const [idx, it] of list.entries()) { 498 for (const [idx, it] of list.entries()) {
498 if ( 499 if (
499 strEmpty(it.productName) || 500 strEmpty(it.productName) ||
500 strEmpty(it.industry) || 501 strEmpty(it.industry) ||
501 strEmpty(it.quality) || 502 strEmpty(it.quality) ||
502 - strEmpty(it.brand) ||  
503 numEmpty(it.productQuantity) || 503 numEmpty(it.productQuantity) ||
504 strEmpty(it.unitPrice) || 504 strEmpty(it.unitPrice) ||
505 strEmpty(it.deliveryDate) 505 strEmpty(it.deliveryDate)
@@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
58 <uni-easyinput v-model="item.supplyTime" :inputBorder="false" placeholder="请输入原材料提供时间" /> 58 <uni-easyinput v-model="item.supplyTime" :inputBorder="false" placeholder="请输入原材料提供时间" />
59 </template> 59 </template>
60 </uni-list-item> 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 <template v-slot:body> 62 <template v-slot:body>
63 <view class="item-title"><text>原材料与产品数量比</text></view> 63 <view class="item-title"><text>原材料与产品数量比</text></view>
64 </template> 64 </template>
@@ -175,9 +175,9 @@ @@ -175,9 +175,9 @@
175 <view v-else class="view-list" v-show="!collapsedView"> 175 <view v-else class="view-list" v-show="!collapsedView">
176 <view v-for="(item, idx) in items" :key="'v-' + idx" class="card"> 176 <view v-for="(item, idx) in items" :key="'v-' + idx" class="card">
177 <view class="row"><text class="label">原材料名称</text><text class="value">{{ item.rawProductName }}</text></view> 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 <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view> 181 <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view>
182 <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view> 182 <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view>
183 <!-- 厚(公差) * 宽(公差) * 长(公差) --> 183 <!-- 厚(公差) * 宽(公差) * 长(公差) -->
@@ -256,6 +256,7 @@ export default { @@ -256,6 +256,7 @@ export default {
256 }, 256 },
257 ratioOptions() { 257 ratioOptions() {
258 const list = Array.isArray(this.rawToProdRatioList) ? this.rawToProdRatioList : [] 258 const list = Array.isArray(this.rawToProdRatioList) ? this.rawToProdRatioList : []
  259 + console.log('list', list)
259 return list.map(o => ({ 260 return list.map(o => ({
260 label: o.label != null ? o.label : (o.text != null ? o.text : (o.name != null ? o.name : '')), 261 label: o.label != null ? o.label : (o.text != null ? o.text : (o.name != null ? o.name : '')),
261 value: o.value != null ? o.value : (o.id != null ? o.id : o.code) 262 value: o.value != null ? o.value : (o.id != null ? o.id : o.code)
@@ -290,9 +291,7 @@ export default { @@ -290,9 +291,7 @@ export default {
290 }, 291 },
291 list: { 292 list: {
292 handler(v) { 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 console.log('v', v) 295 console.log('v', v)
297 }, 296 },
298 deep: true 297 deep: true
@@ -301,11 +300,12 @@ export default { @@ -301,11 +300,12 @@ export default {
301 created() { 300 created() {
302 const init = Array.isArray(this.list) && this.list.length > 0 ? this.list.map(v => ({ ...this.defaultItem(), ...v, collapsed: true })) : [{ ...this.defaultItem(), collapsed: false }] 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 this.items = init 302 this.items = init
  303 + console.log('init', init)
304 this.recalculateAll() 304 this.recalculateAll()
305 }, 305 },
306 methods: { 306 methods: {
307 defaultItem() { 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 onNumberInput(idx, field) { 310 onNumberInput(idx, field) {
311 const it = this.items[idx] 311 const it = this.items[idx]
@@ -454,7 +454,7 @@ export default { @@ -454,7 +454,7 @@ export default {
454 if (!it) { this.sheet.visible = false; return } 454 if (!it) { this.sheet.visible = false; return }
455 if (this.sheet.mode === 'ratio') { 455 if (this.sheet.mode === 'ratio') {
456 it.materialProductRatio = value 456 it.materialProductRatio = value
457 - it.rawToProdRatioName = label || '' 457 + it.materialProductRatioName = label || ''
458 } else if (this.sheet.mode === 'product') { 458 } else if (this.sheet.mode === 'product') {
459 if (it.rawProductId !== value) { 459 if (it.rawProductId !== value) {
460 it.rawProductGrade = '' 460 it.rawProductGrade = ''