Commit 31863eb1ea74287f5a0ec930f32931de912ecb0b

Authored by gesilong
1 parent 9ab7040c

Changes:修复合同相关Bug

... ... @@ -59,7 +59,9 @@
59 59 <view class="row"><text class="label">备注</text><text class="value">{{ detail.remarks || '-'
60 60 }}</text></view>
61 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 65 <view class="row"><text class="label">规范性合同</text><text class="value act" @click="downloadFile(detail.standardFileId, detail.standardFileName)">{{
64 66 detail.standardFileName || '-' }}</text></view>
65 67 <view class="row"><text class="label">合同是否规范</text><text class="value">{{
... ...
... ... @@ -41,7 +41,7 @@
41 41 </template>
42 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 46 <uni-list-item title="合计金额(大写)">
47 47 <template v-slot:footer>
... ... @@ -494,12 +494,12 @@ export default {
494 494 }
495 495 const strEmpty = (v) => (v === undefined || v === null || (typeof v === 'string' && v.trim() === ''))
496 496 const numEmpty = (v) => (v === undefined || v === null || v === '' || (typeof v === 'number' && isNaN(v)))
  497 + console.log('list11', list)
497 498 for (const [idx, it] of list.entries()) {
498 499 if (
499 500 strEmpty(it.productName) ||
500 501 strEmpty(it.industry) ||
501 502 strEmpty(it.quality) ||
502   - strEmpty(it.brand) ||
503 503 numEmpty(it.productQuantity) ||
504 504 strEmpty(it.unitPrice) ||
505 505 strEmpty(it.deliveryDate)
... ...
... ... @@ -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 = ''
... ...