Commit f5190767a053c2fb84601adc1f5265b0c2be8d46

Authored by gesilong
2 parents 4b017388 38089a51

Merge branch 'cjerp-2.0-contract' into test_cjerp

... ... @@ -140,15 +140,9 @@
140 140 <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" />
141 141 </template>
142 142 </uni-list-item>
143   - <uni-list-item v-if="this.customerRemarks.length" class="select-item" :class="defaultRemark ? 'is-filled' : 'is-empty'" clickable
144   - @click="openSheet('historyRemarks')" :rightText="defaultRemark || '请选择'" showArrow>
145   - <template v-slot:body>
146   - <view class="item-title"><text>历史备注</text></view>
147   - </template>
148   - </uni-list-item>
149 143 <uni-list-item title="备注">
150 144 <template v-slot:footer>
151   - <uni-easyinput type="textarea" v-model="form.remarks" placeholder="请输入备注" :inputBorder="false" maxlength="2000"/>
  145 + <uni-easyinput type="textarea" v-model="form.remarks" placeholder="请输入备注" :inputBorder="false" maxlength="2000" />
152 146 </template>
153 147 </uni-list-item>
154 148 <view class="quality">
... ... @@ -233,7 +227,7 @@
233 227 import SingleSelectSheet from '@/components/single-select/index.vue'
234 228 import RelateSelectSheet from '@/components/relate-select/index.vue'
235 229 import ProductRel from './productRel.vue'
236   -import { getRetailCodeApi, createContractApi, getCustomerRemarks, getCustomerSpecificQualityRequirements, getDeptApi, getContractApi } from '@/api/contract'
  230 +import { getRetailCodeApi, createContractApi, getDeptApi, getContractApi } from '@/api/contract'
237 231 import { getDicByCodes } from '@/utils/dic'
238 232 import { formatCurrencyToChinese } from '@/utils/common'
239 233 import { workshopQueryApi } from '@/api/devManage'
... ... @@ -295,10 +289,7 @@ export default {
295 289 totalAmountIncludingTax: 0,
296 290 productLineList: [],
297 291 productList: [],
298   - customerRemarks: [],
299   - defaultRemark: '',
300 292 regionOptions: [],
301   - qualityReqSeq: 0,
302 293 }
303 294 },
304 295 onLoad(query) {
... ... @@ -319,45 +310,6 @@ export default {
319 310 if (this.copyId) this.loadCopyDetail(this.copyId)
320 311 },
321 312 watch: {
322   - 'form.buyer': {
323   - handler(newVal, oldVal) {
324   - if (newVal) {
325   - getCustomerRemarks(newVal).then(res => {
326   - const remarksData = res.data || [];
327   - this.customerRemarks = remarksData.map((item, index) => ({
328   - label: `客户备注${index + 1}`,
329   - value: item,
330   - }));
331   - if (remarksData.length > 0) {
332   - this.defaultRemark = this.customerRemarks[0].label || '';
333   - this.form.remarks = remarksData[0];
334   - } else {
335   - this.form.remarks = '';
336   - this.defaultRemark = '';
337   - }
338   - })
339   - this.getHistory()
340   - }
341   - }
342   - },
343   - productLineList: {
344   - deep: true,
345   - handler(newVal, oldVal) {
346   - const n = Array.isArray(newVal) ? newVal : []
347   - const o = Array.isArray(oldVal) ? oldVal : []
348   - const changed = []
349   - for (let i = 0; i < n.length; i++) {
350   - const ni = n[i] && n[i].productId
351   - const oi = o[i] && o[i].productId
352   - if (ni !== oi && ni !== undefined) changed.push(ni)
353   - }
354   - console.log('changed', changed)
355   - if (changed.length && this.form.buyer) {
356   - const id = changed.join('')
357   - this.fetchCustomerQualityRequirements(id)
358   - }
359   - }
360   - },
361 313 },
362 314 methods: {
363 315 async loadCopyDetail(id) {
... ... @@ -454,47 +406,6 @@ export default {
454 406 }
455 407 })
456 408 },
457   - getHistory() {
458   - if (!this.productLineList.length || !this.productLineList[0].productId) {
459   - return;
460   - }
461   - const id = this.productLineList.map(it => it.productId).join('')
462   - this.fetchCustomerQualityRequirements(id)
463   - },
464   - async fetchCustomerQualityRequirements(id) {
465   - if (!this.form.buyer || !id) {
466   - return;
467   - }
468   - this.qualityReqSeq = (Number(this.qualityReqSeq) || 0) + 1
469   - const seq = this.qualityReqSeq
470   - try {
471   - const result = await getCustomerSpecificQualityRequirements({
472   - customerId: this.form.buyer,
473   - productIdList:id,
474   - });
475   - if (seq !== this.qualityReqSeq) return
476   - this.updateFormData(result.data || {});
477   - } catch (error) {
478   - if (seq !== this.qualityReqSeq) return
479   - console.error('获取客户质量要求失败:', error);
480   - // 可以根据需要添加错误提示逻辑
481   - this.$message.error('获取历史数据失败,请稍后重试');
482   - }
483   - },
484   - // 提取公共的字段更新方法
485   - updateFormData(result) {
486   - const fields = [
487   - 'component',
488   - 'packaging',
489   - 'performance',
490   - 'pieceWeightHead',
491   - 'surface',
492   - 'tolerance',
493   - ];
494   - fields.forEach((field) => {
495   - this.form[field] = result[field] != null ? String(result[field]) : ''
496   - });
497   - },
498 409 onProductsChange(products) {
499 410 const list = Array.isArray(products) ? products : []
500 411 const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0)
... ... @@ -572,8 +483,6 @@ export default {
572 483 setSheet('单价中是否已包含包装费', this.yesNoList)
573 484 } else if (field === 'includesTransportFee') {
574 485 setSheet('单价中是否已包含运费', this.yesNoList)
575   - } else if (field === 'historyRemarks') {
576   - setSheet('历史备注', this.customerRemarks)
577 486 }else if (field === 'region') {
578 487 setSheet('区域', this.regionOptions)
579 488 }
... ... @@ -582,13 +491,8 @@ export default {
582 491 const field = this.sheet.field
583 492 if (!field) return
584 493 const v = (value === undefined || value === null) ? '' : value
585   - if (field === 'historyRemarks') {
586   - this.defaultRemark = label || ''
587   - this.form.remarks = v
588   - }else{
589   - this.form[field] = v
590   - this.form[field + 'Name'] = label || ''
591   - }
  494 + this.form[field] = v
  495 + this.form[field + 'Name'] = label || ''
592 496 },
593 497 openRelate(fieldKey) {
594 498 let config = {}
... ...
... ... @@ -143,12 +143,6 @@
143 143 <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" />
144 144 </template>
145 145 </uni-list-item>
146   - <uni-list-item v-if="this.customerRemarks.length" class="select-item" :class="defaultRemark ? 'is-filled' : 'is-empty'" clickable
147   - @click="openSheet('historyRemarks')" :rightText="defaultRemark || '请选择'" showArrow>
148   - <template v-slot:body>
149   - <view class="item-title"><text>历史备注</text></view>
150   - </template>
151   - </uni-list-item>
152 146 <uni-list-item title="备注">
153 147 <template v-slot:footer>
154 148 <uni-easyinput type="textarea" v-model="form.remarks" placeholder="请输入备注" :inputBorder="false" maxlength="2000" />
... ... @@ -236,7 +230,7 @@
236 230 import SingleSelectSheet from '@/components/single-select/index.vue'
237 231 import RelateSelectSheet from '@/components/relate-select/index.vue'
238 232 import ProductRel from './productRel.vue'
239   -import { getRetailCodeApi, createContractApi, getCustomerSpecificQualityRequirements, getCustomerRemarks, getDeptApi, getContractApi } from '@/api/contract'
  233 +import { getRetailCodeApi, createContractApi, getDeptApi, getContractApi } from '@/api/contract'
240 234 import { getDicByCodes } from '@/utils/dic'
241 235 import { formatCurrencyToChinese } from '@/utils/common'
242 236 import { workshopQueryApi } from '@/api/devManage'
... ... @@ -297,10 +291,7 @@ export default {
297 291 totalAmountIncludingTax: 0,
298 292 productLineList: [],
299 293 productList: [],
300   - customerRemarks: [],
301   - defaultRemark: '',
302 294 regionOptions: [],
303   - qualityReqSeq: 0,
304 295 }
305 296 },
306 297 onLoad(query) {
... ... @@ -321,45 +312,6 @@ export default {
321 312 if (this.copyId) this.loadCopyDetail(this.copyId)
322 313 },
323 314 watch: {
324   - 'form.buyer': {
325   - handler(newVal, oldVal) {
326   - if (newVal) {
327   - getCustomerRemarks(newVal).then(res => {
328   - const remarksData = res.data || [];
329   - this.customerRemarks = remarksData.map((item, index) => ({
330   - label: `客户备注${index + 1}`,
331   - value: item,
332   - }));
333   - if (remarksData.length > 0) {
334   - this.defaultRemark = this.customerRemarks[0].label || '';
335   - this.form.remarks = remarksData[0];
336   - } else {
337   - this.form.remarks = '';
338   - this.defaultRemark = '';
339   - }
340   - })
341   - this.getHistory()
342   - }
343   - }
344   - },
345   - productLineList: {
346   - deep: true,
347   - handler(newVal, oldVal) {
348   - const n = Array.isArray(newVal) ? newVal : []
349   - const o = Array.isArray(oldVal) ? oldVal : []
350   - const changed = []
351   - for (let i = 0; i < n.length; i++) {
352   - const ni = n[i] && n[i].productId
353   - const oi = o[i] && o[i].productId
354   - if (ni !== oi && ni !== undefined) changed.push(ni)
355   - }
356   - console.log('changed', changed)
357   - if (changed.length && this.form.buyer) {
358   - const id = changed.join('')
359   - this.fetchCustomerQualityRequirements(id)
360   - }
361   - }
362   - },
363 315 },
364 316 methods: {
365 317 async loadCopyDetail(id) {
... ... @@ -455,49 +407,6 @@ export default {
455 407 }
456 408 })
457 409 },
458   - getHistory() {
459   - console.log('this.productLineList', this.productLineList[0].productId)
460   - if (!this.productLineList.length || !this.productLineList[0].productId) {
461   - return;
462   - }
463   - const id = this.productLineList.map(it => it.productId).join('')
464   - this.fetchCustomerQualityRequirements(id)
465   - },
466   - async fetchCustomerQualityRequirements(id) {
467   - if (!this.form.buyer || !id) {
468   - return;
469   - }
470   - this.qualityReqSeq = (Number(this.qualityReqSeq) || 0) + 1
471   - const seq = this.qualityReqSeq
472   - try {
473   - const result = await getCustomerSpecificQualityRequirements({
474   - customerId: this.form.buyer,
475   - productIdList:id,
476   - });
477   - if (seq !== this.qualityReqSeq) return
478   - this.updateFormData(result.data || {});
479   - } catch (error) {
480   - if (seq !== this.qualityReqSeq) return
481   - console.error('获取客户质量要求失败:', error);
482   - // 可以根据需要添加错误提示逻辑
483   - this.$message.error('获取历史数据失败,请稍后重试');
484   - }
485   - },
486   - // 提取公共的字段更新方法
487   - updateFormData(result) {
488   - console.log('result', result)
489   - const fields = [
490   - 'component',
491   - 'packaging',
492   - 'performance',
493   - 'pieceWeightHead',
494   - 'surface',
495   - 'tolerance',
496   - ];
497   - fields.forEach((field) => {
498   - this.form[field] = result[field] != null ? String(result[field]) : ''
499   - });
500   - },
501 410 onProductsChange(products) {
502 411 const list = Array.isArray(products) ? products : []
503 412 const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0)
... ... @@ -575,9 +484,7 @@ export default {
575 484 setSheet('单价中是否已包含包装费', this.yesNoList)
576 485 } else if (field === 'includesTransportFee') {
577 486 setSheet('单价中是否已包含运费', this.yesNoList)
578   - } else if (field === 'historyRemarks') {
579   - setSheet('历史备注', this.customerRemarks)
580   - }else if (field === 'region') {
  487 + } else if (field === 'region') {
581 488 setSheet('区域', this.regionOptions)
582 489 }
583 490 },
... ... @@ -585,13 +492,8 @@ export default {
585 492 const field = this.sheet.field
586 493 if (!field) return
587 494 const v = (value === undefined || value === null) ? '' : value
588   - if (field === 'historyRemarks') {
589   - this.defaultRemark = label || ''
590   - this.form.remarks = v
591   - }else{
592   - this.form[field] = v
593   - this.form[field + 'Name'] = label || ''
594   - }
  495 + this.form[field] = v
  496 + this.form[field + 'Name'] = label || ''
595 497 },
596 498 openRelate(fieldKey) {
597 499 let config = {}
... ...
... ... @@ -141,12 +141,6 @@
141 141 <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" />
142 142 </template>
143 143 </uni-list-item>
144   - <uni-list-item v-if="this.customerRemarks.length" class="select-item" :class="defaultRemark ? 'is-filled' : 'is-empty'" clickable
145   - @click="openSheet('historyRemarks')" :rightText="defaultRemark || '请选择'" showArrow>
146   - <template v-slot:body>
147   - <view class="item-title"><text>历史备注</text></view>
148   - </template>
149   - </uni-list-item>
150 144 <uni-list-item title="备注">
151 145 <template v-slot:footer>
152 146 <uni-easyinput type="textarea" v-model="form.remarks" placeholder="请输入备注" :inputBorder="false" maxlength="2000" />
... ... @@ -234,7 +228,7 @@
234 228 import SingleSelectSheet from '@/components/single-select/index.vue'
235 229 import RelateSelectSheet from '@/components/relate-select/index.vue'
236 230 import ProductRel from './productRel.vue'
237   -import { getRetailCodeApi, createContractApi, getCustomerRemarks, getCustomerSpecificQualityRequirements, getDeptApi, getContractApi } from '@/api/contract'
  231 +import { getRetailCodeApi, createContractApi, getDeptApi, getContractApi } from '@/api/contract'
238 232 import { getDicByCodes } from '@/utils/dic'
239 233 import { formatCurrencyToChinese } from '@/utils/common'
240 234 import { workshopQueryApi } from '@/api/devManage'
... ... @@ -295,10 +289,7 @@ export default {
295 289 totalAmountIncludingTax: 0,
296 290 productLineList: [],
297 291 productList: [],
298   - customerRemarks: [],
299   - defaultRemark: '',
300 292 regionOptions: [],
301   - qualityReqSeq: 0,
302 293 }
303 294 },
304 295 onLoad(query) {
... ... @@ -319,44 +310,6 @@ export default {
319 310 if (this.copyId) this.loadCopyDetail(this.copyId)
320 311 },
321 312 watch: {
322   - 'form.buyer': {
323   - handler(newVal, oldVal) {
324   - if (newVal) {
325   - getCustomerRemarks(newVal).then(res => {
326   - const remarksData = res.data || [];
327   - this.customerRemarks = remarksData.map((item, index) => ({
328   - label: `客户备注${index + 1}`,
329   - value: item,
330   - }));
331   - if (remarksData.length > 0) {
332   - this.defaultRemark = this.customerRemarks[0].label || '';
333   - this.form.remarks = remarksData[0];
334   - } else {
335   - this.form.remarks = '';
336   - this.defaultRemark = '';
337   - }
338   - })
339   - this.getHistory()
340   - }
341   - }
342   - },
343   - productLineList: {
344   - deep: true,
345   - handler(newVal, oldVal) {
346   - const n = Array.isArray(newVal) ? newVal : []
347   - const o = Array.isArray(oldVal) ? oldVal : []
348   - const changed = []
349   - for (let i = 0; i < n.length; i++) {
350   - const ni = n[i] && n[i].productId
351   - const oi = o[i] && o[i].productId
352   - if (ni !== oi && ni !== undefined) changed.push(ni)
353   - }
354   - if (changed.length && this.form.buyer) {
355   - const id = changed.join('')
356   - this.fetchCustomerQualityRequirements(id)
357   - }
358   - }
359   - },
360 313 },
361 314 methods: {
362 315 async loadCopyDetail(id) {
... ... @@ -453,49 +406,6 @@ export default {
453 406 }
454 407 })
455 408 },
456   - getHistory() {
457   - console.log('this.productLineList', this.productLineList[0].productId)
458   - if (!this.productLineList.length || !this.productLineList[0].productId) {
459   - return;
460   - }
461   - const id = this.productLineList.map(it => it.productId).join('')
462   - this.fetchCustomerQualityRequirements(id)
463   - },
464   - async fetchCustomerQualityRequirements(id) {
465   - if (!this.form.buyer || !id) {
466   - return;
467   - }
468   - this.qualityReqSeq = (Number(this.qualityReqSeq) || 0) + 1
469   - const seq = this.qualityReqSeq
470   - try {
471   - const result = await getCustomerSpecificQualityRequirements({
472   - customerId: this.form.buyer,
473   - productIdList:id,
474   - });
475   - if (seq !== this.qualityReqSeq) return
476   - this.updateFormData(result.data || {});
477   - } catch (error) {
478   - if (seq !== this.qualityReqSeq) return
479   - console.error('获取客户质量要求失败:', error);
480   - // 可以根据需要添加错误提示逻辑
481   - this.$message.error('获取历史数据失败,请稍后重试');
482   - }
483   - },
484   - // 提取公共的字段更新方法
485   - updateFormData(result) {
486   - console.log('result', result)
487   - const fields = [
488   - 'component',
489   - 'packaging',
490   - 'performance',
491   - 'pieceWeightHead',
492   - 'surface',
493   - 'tolerance',
494   - ];
495   - fields.forEach((field) => {
496   - this.form[field] = result[field] != null ? String(result[field]) : ''
497   - });
498   - },
499 409 onProductsChange(products) {
500 410 const list = Array.isArray(products) ? products : []
501 411 const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0)
... ... @@ -573,9 +483,7 @@ export default {
573 483 setSheet('单价中是否已包含包装费', this.yesNoList)
574 484 } else if (field === 'includesTransportFee') {
575 485 setSheet('单价中是否已包含运费', this.yesNoList)
576   - } else if (field === 'historyRemarks') {
577   - setSheet('历史备注', this.customerRemarks)
578   - }else if (field === 'region') {
  486 + } else if (field === 'region') {
579 487 setSheet('区域', this.regionOptions)
580 488 }
581 489 },
... ... @@ -583,13 +491,8 @@ export default {
583 491 const field = this.sheet.field
584 492 if (!field) return
585 493 const v = (value === undefined || value === null) ? '' : value
586   - if (field === 'historyRemarks') {
587   - this.defaultRemark = label || ''
588   - this.form.remarks = v
589   - }else{
590   - this.form[field] = v
591   - this.form[field + 'Name'] = label || ''
592   - }
  494 + this.form[field] = v
  495 + this.form[field + 'Name'] = label || ''
593 496 },
594 497 openRelate(fieldKey) {
595 498 let config = {}
... ...
... ... @@ -143,12 +143,6 @@
143 143 <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" />
144 144 </template>
145 145 </uni-list-item>
146   - <uni-list-item v-if="this.customerRemarks.length" class="select-item" :class="defaultRemark ? 'is-filled' : 'is-empty'" clickable
147   - @click="openSheet('historyRemarks')" :rightText="defaultRemark || '请选择'" showArrow>
148   - <template v-slot:body>
149   - <view class="item-title"><text>历史备注</text></view>
150   - </template>
151   - </uni-list-item>
152 146 <uni-list-item title="备注">
153 147 <template v-slot:footer>
154 148 <uni-easyinput type="textarea" v-model="form.remarks" placeholder="请输入备注" :inputBorder="false" maxlength="2000" />
... ... @@ -237,7 +231,7 @@ import SingleSelectSheet from '@/components/single-select/index.vue'
237 231 import RelateSelectSheet from '@/components/relate-select/index.vue'
238 232 import ProductRel from './productRel.vue'
239 233 import CitySelector from '@/components/city-selector/index.vue'
240   -import { getRetailCodeApi, createContractApi, getCustomerRemarks, getCustomerSpecificQualityRequirements, getDeptApi, getContractApi } from '@/api/contract'
  234 +import { getRetailCodeApi, createContractApi, getDeptApi, getContractApi } from '@/api/contract'
241 235 import { getDicByCodes } from '@/utils/dic'
242 236 import { formatCurrencyToChinese } from '@/utils/common'
243 237 import { workshopQueryApi } from '@/api/devManage'
... ... @@ -300,13 +294,10 @@ export default {
300 294 totalAmountIncludingTax: 0,
301 295 productLineList: [],
302 296 productList: [],
303   - customerRemarks: [],
304   - defaultRemark: '',
305 297 regionOptions: [],
306 298 rawToProdRatioList: [],
307 299 rawProductList: [],
308 300 rawProductGradeList: [],
309   - qualityReqSeq: 0,
310 301 }
311 302 },
312 303 onLoad(query) {
... ... @@ -332,44 +323,6 @@ export default {
332 323 })
333 324 },
334 325 watch: {
335   - 'form.buyer': {
336   - handler(newVal, oldVal) {
337   - if (newVal) {
338   - getCustomerRemarks(newVal).then(res => {
339   - const remarksData = res.data || [];
340   - this.customerRemarks = remarksData.map((item, index) => ({
341   - label: `客户备注${index + 1}`,
342   - value: item,
343   - }));
344   - if (remarksData.length > 0) {
345   - this.defaultRemark = this.customerRemarks[0].label || '';
346   - this.form.remarks = remarksData[0];
347   - } else {
348   - this.form.remarks = '';
349   - this.defaultRemark = '';
350   - }
351   - })
352   - this.getHistory()
353   - }
354   - }
355   - },
356   - productLineList: {
357   - deep: true,
358   - handler(newVal, oldVal) {
359   - const n = Array.isArray(newVal) ? newVal : []
360   - const o = Array.isArray(oldVal) ? oldVal : []
361   - const changed = []
362   - for (let i = 0; i < n.length; i++) {
363   - const ni = n[i] && n[i].rawProductId
364   - const oi = o[i] && o[i].rawProductId
365   - if (ni !== oi && ni !== undefined) changed.push(ni)
366   - }
367   - if (changed.length && this.form.buyer) {
368   - const id = changed.join('')
369   - this.fetchCustomerQualityRequirements(id)
370   - }
371   - }
372   - },
373 326 },
374 327 methods: {
375 328 async loadCopyDetail(id) {
... ... @@ -489,49 +442,6 @@ export default {
489 442 }
490 443 })
491 444 },
492   - getHistory() {
493   - console.log('this.productLineList', this.productLineList[0].rawProductId)
494   - if (!this.productLineList.length || !this.productLineList[0].rawProductId) {
495   - return;
496   - }
497   - const id = this.productLineList.map(it => it.rawProductId).join('')
498   - this.fetchCustomerQualityRequirements(id)
499   - },
500   - async fetchCustomerQualityRequirements(id) {
501   - if (!this.form.buyer || !id) {
502   - return;
503   - }
504   - this.qualityReqSeq = (Number(this.qualityReqSeq) || 0) + 1
505   - const seq = this.qualityReqSeq
506   - try {
507   - const result = await getCustomerSpecificQualityRequirements({
508   - customerId: this.form.buyer,
509   - productIdList:id,
510   - });
511   - if (seq !== this.qualityReqSeq) return
512   - this.updateFormData(result.data || {});
513   - } catch (error) {
514   - if (seq !== this.qualityReqSeq) return
515   - console.error('获取客户质量要求失败:', error);
516   - // 可以根据需要添加错误提示逻辑
517   - this.$message.error('获取历史数据失败,请稍后重试');
518   - }
519   - },
520   - // 提取公共的字段更新方法
521   - updateFormData(result) {
522   - console.log('result', result)
523   - const fields = [
524   - 'component',
525   - 'packaging',
526   - 'performance',
527   - 'pieceWeightHead',
528   - 'surface',
529   - 'tolerance',
530   - ];
531   - fields.forEach((field) => {
532   - this.form[field] = result[field] != null ? String(result[field]) : ''
533   - });
534   - },
535 445 onProductsChange(products) {
536 446 const list = Array.isArray(products) ? products : []
537 447 const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.productQuantity) || 0), 0)
... ... @@ -618,8 +528,6 @@ export default {
618 528 setSheet('单价中是否已包含包装费', this.yesNoList)
619 529 } else if (field === 'includesTransportFee') {
620 530 setSheet('单价中是否已包含运费', this.yesNoList)
621   - } else if (field === 'historyRemarks') {
622   - setSheet('历史备注', this.customerRemarks)
623 531 }else if (field === 'region') {
624 532 setSheet('区域', this.regionOptions)
625 533 }
... ... @@ -628,13 +536,8 @@ export default {
628 536 const field = this.sheet.field
629 537 if (!field) return
630 538 const v = (value === undefined || value === null) ? '' : value
631   - if (field === 'historyRemarks') {
632   - this.defaultRemark = label || ''
633   - this.form.remarks = v
634   - }else{
635   - this.form[field] = v
636   - this.form[field + 'Name'] = label || ''
637   - }
  539 + this.form[field] = v
  540 + this.form[field + 'Name'] = label || ''
638 541 },
639 542 openRelate(fieldKey) {
640 543 let config = {}
... ...
... ... @@ -139,12 +139,6 @@
139 139 <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" />
140 140 </template>
141 141 </uni-list-item>
142   - <uni-list-item v-if="this.customerRemarks.length" class="select-item" :class="defaultRemark ? 'is-filled' : 'is-empty'" clickable
143   - @click="openSheet('historyRemarks')" :rightText="defaultRemark || '请选择'" showArrow>
144   - <template v-slot:body>
145   - <view class="item-title"><text>历史备注</text></view>
146   - </template>
147   - </uni-list-item>
148 142 <uni-list-item title="备注">
149 143 <template v-slot:footer>
150 144 <uni-easyinput type="textarea" v-model="form.remarks" placeholder="请输入备注" :inputBorder="false" maxlength="2000" />
... ... @@ -233,7 +227,7 @@ import SingleSelectSheet from '@/components/single-select/index.vue'
233 227 import RelateSelectSheet from '@/components/relate-select/index.vue'
234 228 import ProductRel from './productRel.vue'
235 229 import CitySelector from '@/components/city-selector/index.vue'
236   -import { getRetailCodeApi, createContractApi, getCustomerRemarks, getCustomerSpecificQualityRequirements, getDeptApi, getContractApi } from '@/api/contract'
  230 +import { getRetailCodeApi, createContractApi, getDeptApi, getContractApi } from '@/api/contract'
237 231 import { getDicByCodes } from '@/utils/dic'
238 232 import { formatCurrencyToChinese } from '@/utils/common'
239 233 import { workshopQueryApi } from '@/api/devManage'
... ... @@ -295,10 +289,7 @@ export default {
295 289 totalAmountIncludingTax: 0,
296 290 productLineList: [],
297 291 productList: [],
298   - customerRemarks: [],
299   - defaultRemark: '',
300 292 regionOptions: [],
301   - qualityReqSeq: 0,
302 293 }
303 294 },
304 295 onLoad(query) {
... ... @@ -324,45 +315,6 @@ export default {
324 315 })
325 316 },
326 317 watch: {
327   - 'form.buyer': {
328   - handler(newVal, oldVal) {
329   - if (newVal) {
330   - getCustomerRemarks(newVal).then(res => {
331   - const remarksData = res.data || [];
332   - this.customerRemarks = remarksData.map((item, index) => ({
333   - label: `客户备注${index + 1}`,
334   - value: item,
335   - }));
336   - if (remarksData.length > 0) {
337   - this.defaultRemark = this.customerRemarks[0].label || '';
338   - this.form.remarks = remarksData[0];
339   - } else {
340   - this.form.remarks = '';
341   - this.defaultRemark = '';
342   - }
343   - })
344   - this.getHistory()
345   - }
346   - }
347   - },
348   - productLineList: {
349   - deep: true,
350   - handler(newVal, oldVal) {
351   - const n = Array.isArray(newVal) ? newVal : []
352   - const o = Array.isArray(oldVal) ? oldVal : []
353   - const changed = []
354   - for (let i = 0; i < n.length; i++) {
355   - const ni = n[i] && n[i].productId
356   - const oi = o[i] && o[i].productId
357   - if (ni !== oi && ni !== undefined) changed.push(ni)
358   - }
359   - console.log('changed', changed)
360   - if (changed.length && this.form.buyer) {
361   - const id = changed.join('')
362   - this.fetchCustomerQualityRequirements(id)
363   - }
364   - }
365   - },
366 318 },
367 319 methods: {
368 320 async loadCopyDetail(id) {
... ... @@ -460,49 +412,6 @@ export default {
460 412 }
461 413 })
462 414 },
463   - getHistory() {
464   - console.log('this.productLineList', this.productLineList[0].productId)
465   - if (!this.productLineList.length || !this.productLineList[0].productId) {
466   - return;
467   - }
468   - const id = this.productLineList.map(it => it.productId).join('')
469   - this.fetchCustomerQualityRequirements(id)
470   - },
471   - async fetchCustomerQualityRequirements(id) {
472   - if (!this.form.buyer || !id) {
473   - return;
474   - }
475   - this.qualityReqSeq = (Number(this.qualityReqSeq) || 0) + 1
476   - const seq = this.qualityReqSeq
477   - try {
478   - const result = await getCustomerSpecificQualityRequirements({
479   - customerId: this.form.buyer,
480   - productIdList:id,
481   - });
482   - if (seq !== this.qualityReqSeq) return
483   - this.updateFormData(result.data || {});
484   - } catch (error) {
485   - if (seq !== this.qualityReqSeq) return
486   - console.error('获取客户质量要求失败:', error);
487   - // 可以根据需要添加错误提示逻辑
488   - this.$message.error('获取历史数据失败,请稍后重试');
489   - }
490   - },
491   - // 提取公共的字段更新方法
492   - updateFormData(result) {
493   - console.log('result', result)
494   - const fields = [
495   - 'component',
496   - 'packaging',
497   - 'performance',
498   - 'pieceWeightHead',
499   - 'surface',
500   - 'tolerance',
501   - ];
502   - fields.forEach((field) => {
503   - this.form[field] = result[field] != null ? String(result[field]) : ''
504   - });
505   - },
506 415 onProductsChange(products) {
507 416 const list = Array.isArray(products) ? products : []
508 417 const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0)
... ... @@ -594,8 +503,6 @@ export default {
594 503 setSheet('单价中是否已包含包装费', this.yesNoList)
595 504 } else if (field === 'includesTransportFee') {
596 505 setSheet('单价中是否已包含运费', this.yesNoList)
597   - } else if (field === 'historyRemarks') {
598   - setSheet('历史备注', this.customerRemarks)
599 506 }else if (field === 'region') {
600 507 setSheet('区域', this.regionOptions)
601 508 }
... ... @@ -604,13 +511,8 @@ export default {
604 511 const field = this.sheet.field
605 512 if (!field) return
606 513 const v = (value === undefined || value === null) ? '' : value
607   - if (field === 'historyRemarks') {
608   - this.defaultRemark = label || ''
609   - this.form.remarks = v
610   - }else{
611   - this.form[field] = v
612   - this.form[field + 'Name'] = label || ''
613   - }
  514 + this.form[field] = v
  515 + this.form[field + 'Name'] = label || ''
614 516 },
615 517 openRelate(fieldKey) {
616 518 let config = {}
... ...
... ... @@ -137,12 +137,6 @@
137 137 <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" />
138 138 </template>
139 139 </uni-list-item>
140   - <uni-list-item v-if="this.customerRemarks.length" class="select-item" :class="defaultRemark ? 'is-filled' : 'is-empty'" clickable
141   - @click="openSheet('historyRemarks')" :rightText="defaultRemark || '请选择'" showArrow>
142   - <template v-slot:body>
143   - <view class="item-title"><text>历史备注</text></view>
144   - </template>
145   - </uni-list-item>
146 140 <uni-list-item title="备注">
147 141 <template v-slot:footer>
148 142 <uni-easyinput type="textarea" v-model="form.remarks" placeholder="请输入备注" :inputBorder="false" maxlength="2000" />
... ... @@ -231,7 +225,7 @@ import SingleSelectSheet from '@/components/single-select/index.vue'
231 225 import RelateSelectSheet from '@/components/relate-select/index.vue'
232 226 import ProductRel from './productRel.vue'
233 227 import CitySelector from '@/components/city-selector/index.vue'
234   -import { getRetailCodeApi, createContractApi,getCustomerRemarks,getCustomerSpecificQualityRequirements, getDeptApi,getContractApi } from '@/api/contract'
  228 +import { getRetailCodeApi, createContractApi, getDeptApi,getContractApi } from '@/api/contract'
235 229 import { getDicByCodes } from '@/utils/dic'
236 230 import { formatCurrencyToChinese } from '@/utils/common'
237 231 import { workshopQueryApi } from '@/api/devManage'
... ... @@ -293,10 +287,7 @@ export default {
293 287 totalAmountIncludingTax: 0,
294 288 productLineList: [],
295 289 productList: [],
296   - customerRemarks: [],
297   - defaultRemark: '',
298 290 regionOptions: [],
299   - qualityReqSeq: 0,
300 291 }
301 292 },
302 293 onLoad(query) {
... ... @@ -322,44 +313,6 @@ export default {
322 313 })
323 314 },
324 315 watch: {
325   - 'form.buyer': {
326   - handler(newVal, oldVal) {
327   - if (newVal) {
328   - getCustomerRemarks(newVal).then(res => {
329   - const remarksData = res.data || [];
330   - this.customerRemarks = remarksData.map((item, index) => ({
331   - label: `客户备注${index + 1}`,
332   - value: item,
333   - }));
334   - if (remarksData.length > 0) {
335   - this.defaultRemark = this.customerRemarks[0].label || '';
336   - this.form.remarks = remarksData[0];
337   - } else {
338   - this.form.remarks = '';
339   - this.defaultRemark = '';
340   - }
341   - })
342   - this.getHistory()
343   - }
344   - }
345   - },
346   - productLineList: {
347   - deep: true,
348   - handler(newVal, oldVal) {
349   - const n = Array.isArray(newVal) ? newVal : []
350   - const o = Array.isArray(oldVal) ? oldVal : []
351   - const changed = []
352   - for (let i = 0; i < n.length; i++) {
353   - const ni = n[i] && n[i].productId
354   - const oi = o[i] && o[i].productId
355   - if (ni !== oi && ni !== undefined) changed.push(ni)
356   - }
357   - if (changed.length && this.form.buyer) {
358   - const id = changed.join('')
359   - this.fetchCustomerQualityRequirements(id)
360   - }
361   - }
362   - },
363 316 },
364 317 methods: {
365 318 async loadCopyDetail(id) {
... ... @@ -457,49 +410,6 @@ export default {
457 410 }
458 411 })
459 412 },
460   - getHistory() {
461   - console.log('this.productLineList', this.productLineList[0].productId)
462   - if (!this.productLineList.length || !this.productLineList[0].productId) {
463   - return;
464   - }
465   - const id = this.productLineList.map(it => it.productId).join('')
466   - this.fetchCustomerQualityRequirements(id)
467   - },
468   - async fetchCustomerQualityRequirements(id) {
469   - if (!this.form.buyer || !id) {
470   - return;
471   - }
472   - this.qualityReqSeq = (Number(this.qualityReqSeq) || 0) + 1
473   - const seq = this.qualityReqSeq
474   - try {
475   - const result = await getCustomerSpecificQualityRequirements({
476   - customerId: this.form.buyer,
477   - productIdList:id,
478   - });
479   - if (seq !== this.qualityReqSeq) return
480   - this.updateFormData(result.data || {});
481   - } catch (error) {
482   - if (seq !== this.qualityReqSeq) return
483   - console.error('获取客户质量要求失败:', error);
484   - // 可以根据需要添加错误提示逻辑
485   - this.$message.error('获取历史数据失败,请稍后重试');
486   - }
487   - },
488   - // 提取公共的字段更新方法
489   - updateFormData(result) {
490   - console.log('result', result)
491   - const fields = [
492   - 'component',
493   - 'packaging',
494   - 'performance',
495   - 'pieceWeightHead',
496   - 'surface',
497   - 'tolerance',
498   - ];
499   - fields.forEach((field) => {
500   - this.form[field] = result[field] != null ? String(result[field]) : ''
501   - });
502   - },
503 413 onProductsChange(products) {
504 414 const list = Array.isArray(products) ? products : []
505 415 const sumQ = list.reduce((acc, it) => acc + (parseFloat(it.quantity) || 0), 0)
... ... @@ -591,8 +501,6 @@ export default {
591 501 setSheet('单价中是否已包含包装费', this.yesNoList)
592 502 } else if (field === 'includesTransportFee') {
593 503 setSheet('单价中是否已包含运费', this.yesNoList)
594   - } else if (field === 'historyRemarks') {
595   - setSheet('历史备注', this.customerRemarks)
596 504 } else if (field === 'region') {
597 505 setSheet('区域', this.regionOptions)
598 506 }
... ... @@ -601,13 +509,8 @@ export default {
601 509 const field = this.sheet.field
602 510 if (!field) return
603 511 const v = (value === undefined || value === null) ? '' : value
604   - if (field === 'historyRemarks') {
605   - this.defaultRemark = label || ''
606   - this.form.remarks = v
607   - }else{
608   - this.form[field] = v
609   - this.form[field + 'Name'] = label || ''
610   - }
  512 + this.form[field] = v
  513 + this.form[field + 'Name'] = label || ''
611 514 },
612 515 openRelate(fieldKey) {
613 516 let config = {}
... ...
... ... @@ -139,12 +139,6 @@
139 139 <uni-easyinput v-model="form.specialInstructions" placeholder="请输入特别说明" :inputBorder="false" />
140 140 </template>
141 141 </uni-list-item>
142   - <uni-list-item v-if="this.customerRemarks.length" class="select-item" :class="defaultRemark ? 'is-filled' : 'is-empty'" clickable
143   - @click="openSheet('historyRemarks')" :rightText="defaultRemark || '请选择'" showArrow>
144   - <template v-slot:body>
145   - <view class="item-title"><text>历史备注</text></view>
146   - </template>
147   - </uni-list-item>
148 142 <uni-list-item title="备注">
149 143 <template v-slot:footer>
150 144 <uni-easyinput type="textarea" v-model="form.remarks" placeholder="请输入备注" :inputBorder="false" maxlength="2000" />
... ... @@ -233,7 +227,7 @@ import SingleSelectSheet from '@/components/single-select/index.vue'
233 227 import RelateSelectSheet from '@/components/relate-select/index.vue'
234 228 import ProductRel from './productRel.vue'
235 229 import CitySelector from '@/components/city-selector/index.vue'
236   -import { getRetailCodeApi, createContractApi, getCustomerRemarks, getCustomerSpecificQualityRequirements, getDeptApi, getContractApi } from '@/api/contract'
  230 +import { getRetailCodeApi, createContractApi, getDeptApi, getContractApi } from '@/api/contract'
237 231 import { getDicByCodes } from '@/utils/dic'
238 232 import { formatCurrencyToChinese } from '@/utils/common'
239 233 import { workshopQueryApi } from '@/api/devManage'
... ... @@ -295,10 +289,7 @@ export default {
295 289 totalAmountIncludingTax: 0,
296 290 productLineList: [],
297 291 productList: [],
298   - customerRemarks: [],
299   - defaultRemark: '',
300 292 regionOptions: [],
301   - qualityReqSeq: 0,
302 293 }
303 294 },
304 295 onLoad(query) {
... ... @@ -324,46 +315,6 @@ export default {
324 315 })
325 316 },
326 317 watch: {
327   - 'form.buyer': {
328   - handler(newVal, oldVal) {
329   - if (newVal) {
330   - getCustomerRemarks(newVal).then(res => {
331   - const remarksData = res.data || [];
332   - this.customerRemarks = remarksData.map((item, index) => ({
333   - label: `客户备注${index + 1}`,
334   - value: item,
335   - }));
336   - if (remarksData.length > 0) {
337   - this.defaultRemark = this.customerRemarks[0].label || '';
338   - this.form.remarks = remarksData[0];
339   - } else {
340   - this.form.remarks = '';
341   - this.defaultRemark = '';
342   - }
343   - })
344   - this.getHistory()
345   - }
346   - }
347   - },
348   - productLineList: {
349   - deep: true,
350   - handler(newVal, oldVal) {
351   - console.log('newVal', newVal)
352   - console.log('oldVal', oldVal)
353   - const n = Array.isArray(newVal) ? newVal : []
354   - const o = Array.isArray(oldVal) ? oldVal : []
355   - const changed = []
356   - for (let i = 0; i < n.length; i++) {
357   - const ni = n[i] && n[i].productId
358   - const oi = o[i] && o[i].productId
359   - if (ni !== oi && ni !== undefined) changed.push(ni)
360   - }
361   - if (changed.length && this.form.buyer) {
362   - const id = changed.join('')
363   - this.fetchCustomerQualityRequirements(id)
364   - }
365   - }
366   - },
367 318 },
368 319 methods: {
369 320 async loadCopyDetail(id) {
... ... @@ -461,49 +412,6 @@ export default {
461 412 }
462 413 })
463 414 },
464   - getHistory() {
465   - console.log('this.productLineList', this.productLineList[0].productId)
466   - if (!this.productLineList.length || !this.productLineList[0].productId) {
467   - return;
468   - }
469   - const id = this.productLineList.map(it => it.productId).join('')
470   - this.fetchCustomerQualityRequirements(id)
471   - },
472   - async fetchCustomerQualityRequirements(id) {
473   - if (!this.form.buyer || !id) {
474   - return;
475   - }
476   - this.qualityReqSeq = (Number(this.qualityReqSeq) || 0) + 1
477   - const seq = this.qualityReqSeq
478   - try {
479   - const result = await getCustomerSpecificQualityRequirements({
480   - customerId: this.form.buyer,
481   - productIdList:id,
482   - });
483   - if (seq !== this.qualityReqSeq) return
484   - this.updateFormData(result.data || {});
485   - } catch (error) {
486   - if (seq !== this.qualityReqSeq) return
487   - console.error('获取客户质量要求失败:', error);
488   - // 可以根据需要添加错误提示逻辑
489   - this.$message.error('获取历史数据失败,请稍后重试');
490   - }
491   - },
492   - // 提取公共的字段更新方法
493   - updateFormData(result) {
494   - console.log('result', result)
495   - const fields = [
496   - 'component',
497   - 'packaging',
498   - 'performance',
499   - 'pieceWeightHead',
500   - 'surface',
501   - 'tolerance',
502   - ];
503   - fields.forEach((field) => {
504   - this.form[field] = result[field] != null ? String(result[field]) : ''
505   - });
506   - },
507 415 onProductsChange(products) {
508 416 console.log('products', products)
509 417 const list = Array.isArray(products) ? products : []
... ... @@ -596,8 +504,6 @@ export default {
596 504 setSheet('单价中是否已包含包装费', this.yesNoList)
597 505 } else if (field === 'includesTransportFee') {
598 506 setSheet('单价中是否已包含运费', this.yesNoList)
599   - } else if (field === 'historyRemarks') {
600   - setSheet('历史备注', this.customerRemarks)
601 507 } else if (field === 'region') {
602 508 setSheet('区域', this.regionOptions)
603 509 }
... ... @@ -606,13 +512,8 @@ export default {
606 512 const field = this.sheet.field
607 513 if (!field) return
608 514 const v = (value === undefined || value === null) ? '' : value
609   - if (field === 'historyRemarks') {
610   - this.defaultRemark = label || ''
611   - this.form.remarks = v
612   - }else{
613   - this.form[field] = v
614   - this.form[field + 'Name'] = label || ''
615   - }
  515 + this.form[field] = v
  516 + this.form[field + 'Name'] = label || ''
616 517 },
617 518 openRelate(fieldKey) {
618 519 let config = {}
... ...
... ... @@ -24,7 +24,7 @@
24 24 <view class="row"><text class="label">是否送货上门</text><text class="value">{{ boolText(form.doorDelivery) }}</text></view>
25 25 <view class="row"><text class="label">另付运费</text><text class="value">{{ formatNumber(form.shippingCost) }}</text></view>
26 26 <view class="row"><text class="label">装车费</text><text class="value">{{ formatNumber(form.loadingFee) }}</text></view>
27   - <view class="row"><text class="label">开票品名</text><text class="value">{{ safeText(form.invoiceProductName) }}</text></view>
  27 + <view class="row"><text class="label">开票品名(汇总)</text><text class="value">{{ safeText(form.invoiceProductName) }}</text></view>
28 28 <view class="row"><text class="label">交货日期</text><text class="value">{{ formatDateOnly(form.deliveryDate) }}</text></view>
29 29 <view class="row"><text class="label">结算方式</text><text class="value">{{ safeText(form.settlementMethod) }}</text></view>
30 30 <view class="row"><text class="label">结算比例(%)</text><text class="value">{{ formatNumber(form.settlementRatio) }}</text></view>
... ... @@ -47,6 +47,7 @@
47 47 :list="lineListWithName"
48 48 :product-options="productOptions"
49 49 :workshop-options="workshopOptions"
  50 + @invoice-name-change="handleInvoiceNameChange"
50 51 />
51 52
52 53 <view class="title-header">
... ... @@ -241,6 +242,9 @@ export default {
241 242 this.loadDetail()
242 243 },
243 244 methods: {
  245 + handleInvoiceNameChange(name) {
  246 + this.form.invoiceProductName = name
  247 + },
244 248 hasPerm(code) {
245 249 try {
246 250 return !!(this.$auth && this.$auth.hasPermi && this.$auth.hasPermi(code))
... ...
... ... @@ -23,7 +23,7 @@
23 23 <view class="row"><text class="label">是否送货上门</text><text class="value">{{ boolText(form.doorDelivery) }}</text></view>
24 24 <view class="row"><text class="label">另付运费</text><text class="value">{{ formatNumber(form.shippingCost) }}</text></view>
25 25 <view class="row"><text class="label">装车费</text><text class="value">{{ formatNumber(form.loadingFee) }}</text></view>
26   - <view class="row"><text class="label">开票品名</text><text class="value">{{ safeText(form.invoiceProductName) }}</text></view>
  26 + <view class="row"><text class="label">开票品名(汇总)</text><text class="value">{{ safeText(form.invoiceProductName) }}</text></view>
27 27 <view class="row"><text class="label">交货日期</text><text class="value">{{ formatDateOnly(form.deliveryDate) }}</text></view>
28 28 <view class="row"><text class="label">结算方式</text><text class="value">{{ safeText(form.settlementMethod) }}</text></view>
29 29 <view class="row"><text class="label">结算比例(%)</text><text class="value">{{ formatNumber(form.settlementRatio) }}</text></view>
... ... @@ -46,6 +46,7 @@
46 46 :list="lineListWithName"
47 47 :product-options="productOptions"
48 48 :workshop-options="workshopOptions"
  49 + @invoice-name-change="handleInvoiceNameChange"
49 50 />
50 51
51 52 <view class="title-header">
... ... @@ -161,6 +162,9 @@ export default {
161 162 }
162 163 },
163 164 methods: {
  165 + handleInvoiceNameChange(name) {
  166 + this.form.invoiceProductName = name
  167 + },
164 168 async loadDictData() {
165 169 var self = this
166 170 var codes = [].concat(
... ...
... ... @@ -35,6 +35,12 @@
35 35 <text v-else class="lock-value">{{ safeText(item.materialType) }}</text>
36 36 </template>
37 37 </uni-list-item>
  38 + <uni-list-item title="开票品名">
  39 + <template v-slot:footer>
  40 + <!-- <uni-easyinput v-if="!isSelectWorkshop && !isSupplement" v-model="item.invoiceProductName" :inputBorder="false" placeholder="请输入开票品名" /> -->
  41 + <text class="lock-value">{{ safeText(item.invoiceProductName) }}</text>
  42 + </template>
  43 + </uni-list-item>
38 44 <uni-list-item title="数量(吨)">
39 45 <template v-slot:footer>
40 46 <template v-if="!isSelectWorkshop && !isSupplement">
... ... @@ -160,6 +166,7 @@
160 166 <view v-for="(item, idx) in items" :key="'v-' + (item._key || item.itemId || idx)" class="card">
161 167 <view class="row"><text class="label">品种</text><text class="value">{{ safeText(item.productName || item.productId) }}</text></view>
162 168 <view class="row"><text class="label">料型</text><text class="value">{{ safeText(item.materialType) }}</text></view>
  169 + <view class="row"><text class="label">开票品名</text><text class="value">{{ safeText(item.invoiceProductName) }}</text></view>
163 170 <view class="row"><text class="label">数量(吨)</text><text class="value">{{ formatNumber(item.quantity) }}</text></view>
164 171 <view class="row"><text class="label">实际采购价</text><text class="value">{{ formatNumber(item.actualPurchasePrice) }}</text></view>
165 172 <view class="row"><text class="label">含运到厂价</text><text class="value">{{ formatNumber(item.includingShippingPrice) }}</text></view>
... ... @@ -228,7 +235,10 @@ export default {
228 235 },
229 236 watch: {
230 237 items: {
231   - handler() { this.emitChange() },
  238 + handler() {
  239 + this.emitChange();
  240 + this.$emit('invoice-name-change', this.getSummaryInvoiceProductName());
  241 + },
232 242 deep: true
233 243 },
234 244 list: {
... ... @@ -287,11 +297,19 @@ export default {
287 297 newKey() {
288 298 return Date.now() + '-' + Math.random().toString(16).slice(2)
289 299 },
  300 + getSummaryInvoiceProductName() {
  301 + const list = Array.isArray(this.items) ? this.items : [];
  302 + const names = list
  303 + .map((item) => item.invoiceProductName)
  304 + .filter((name) => !!name && name.trim() !== '');
  305 + return [...new Set(names.map((n) => n.trim()))].join('、');
  306 + },
290 307 defaultItem() {
291 308 return {
292 309 productId: '',
293 310 productName: '',
294 311 materialType: '',
  312 + invoiceProductName: '',
295 313 quantity: '',
296 314 actualPurchasePrice: '',
297 315 includingShippingPrice: '',
... ...
... ... @@ -224,6 +224,7 @@
224 224 :product-options="productOptions"
225 225 :workshop-options="workshopOptions"
226 226 @change="onLineChange"
  227 + @invoice-name-change="handleInvoiceNameChange"
227 228 />
228 229 </uni-list>
229 230
... ... @@ -389,6 +390,9 @@ export default {
389 390 }
390 391 },
391 392 methods: {
  393 + handleInvoiceNameChange(name) {
  394 + this.form.invoiceProductName = name
  395 + },
392 396 toNumber(v) {
393 397 if (v == null || v === '') return 0
394 398 var n = Number(v)
... ... @@ -673,6 +677,7 @@ export default {
673 677 procurementPlanId: (r.procurementPlanId != null ? r.procurementPlanId : (self.id || d.id || '')),
674 678 productId: self.pickId(r.productId),
675 679 materialType: r.materialType != null ? String(r.materialType) : '',
  680 + invoiceProductName: r.invoiceProductName != null ? String(r.invoiceProductName) : '',
676 681 quantity: self.toNumber(r.quantity),
677 682 actualPurchasePrice: self.toNumber(r.actualPurchasePrice),
678 683 includingShippingPrice: self.toNumber(r.includingShippingPrice),
... ...
... ... @@ -174,7 +174,7 @@
174 174 </template>
175 175 </uni-list-item>
176 176
177   - <uni-list-item title="开票品名">
  177 + <uni-list-item title="开票品名(汇总)">
178 178 <template v-slot:footer>
179 179 <uni-easyinput v-model="detail.invoiceProductName" :inputBorder="false" disabled placeholder="-" />
180 180 </template>
... ... @@ -236,6 +236,7 @@
236 236 :product-options="productOptions"
237 237 :workshop-options="workshopOptions"
238 238 @change="onLineChange"
  239 + @invoice-name-change="handleInvoiceNameChange"
239 240 />
240 241 </uni-list>
241 242
... ... @@ -428,6 +429,9 @@ export default {
428 429 }
429 430 },
430 431 methods: {
  432 + handleInvoiceNameChange(name) {
  433 + this.form.invoiceProductName = name
  434 + },
431 435 toNumber(v) {
432 436 if (v == null || v === '') return 0
433 437 var n = Number(v)
... ... @@ -890,6 +894,7 @@ export default {
890 894 procurementPlanId: (r.procurementPlanId != null ? r.procurementPlanId : (self.form.id || d.id || '')),
891 895 productId: self.pickId(r.productId),
892 896 materialType: r.materialType != null ? String(r.materialType) : '',
  897 + invoiceProductName: r.invoiceProductName != null ? String(r.invoiceProductName) : '',
893 898 quantity: self.toNumber(r.quantity),
894 899 actualPurchasePrice: self.toNumber(r.actualPurchasePrice),
895 900 includingShippingPrice: self.toNumber(r.includingShippingPrice),
... ...
... ... @@ -428,6 +428,7 @@ export default {
428 428 includingShippingPrice: includingShippingPrice,
429 429 priceListPrices: priceListPrices,
430 430 coordinationRange: coordinationRange,
  431 + invoiceProductName: self.pickValue(row, ['invoiceProductName'], ''),
431 432 buyoutPrice: buyoutPrice,
432 433 estimatedLoss: estimatedLoss,
433 434 applicationAttrition: applicationAttrition,
... ...
... ... @@ -152,12 +152,9 @@
152 152 </uni-list-item>
153 153
154 154 <!-- 开票品种 -->
155   - <uni-list-item>
156   - <template v-slot:body>
157   - <view class="item-title"><text class="required">*</text><text>开票品种</text></view>
158   - </template>
  155 + <uni-list-item title="开票品名(汇总)">
159 156 <template v-slot:footer>
160   - <uni-easyinput v-model="form.invoiceProductName" :inputBorder="false" placeholder="请输入开票品种" />
  157 + <uni-easyinput v-model="form.invoiceProductName" :inputBorder="false" disabled />
161 158 </template>
162 159 </uni-list-item>
163 160
... ... @@ -206,7 +203,7 @@
206 203 </uni-list-item>
207 204
208 205 <!-- 明细信息 -->
209   - <ProductRel ref="productRel" mode="add" :options="productList" :priced="form.priced" @change="onProductsChange" />
  206 + <ProductRel ref="productRel" mode="add" :options="productList" :priced="form.priced" @change="onProductsChange" @invoice-name-change="onInvoiceNameChange" />
210 207 </uni-list>
211 208
212 209 <!-- 料质状况模块(明细下方) -->
... ... @@ -354,6 +351,9 @@ export default {
354 351 this.loadDictData()
355 352 },
356 353 methods: {
  354 + onInvoiceNameChange(name) {
  355 + this.form.invoiceProductName = name
  356 + },
357 357 async loadDictData() {
358 358 try {
359 359 const codes = [...this.materialConditionConfigs.map(mc => mc.dictCode), 'DELIVERY_METHOD']
... ...
... ... @@ -152,12 +152,9 @@
152 152 </uni-list-item>
153 153
154 154 <!-- 开票品种 -->
155   - <uni-list-item>
156   - <template v-slot:body>
157   - <view class="item-title"><text class="required">*</text><text>开票品种</text></view>
158   - </template>
  155 + <uni-list-item title="开票品名(汇总)">
159 156 <template v-slot:footer>
160   - <uni-easyinput v-model="form.invoiceProductName" :inputBorder="false" placeholder="请输入开票品种" />
  157 + <uni-easyinput v-model="form.invoiceProductName" :inputBorder="false" disabled />
161 158 </template>
162 159 </uni-list-item>
163 160
... ... @@ -206,7 +203,7 @@
206 203 </uni-list-item>
207 204
208 205 <!-- 明细信息 -->
209   - <ProductRel ref="productRel" mode="add" :options="productList" :priced="form.priced" :list="productLineList" @change="onProductsChange" />
  206 + <ProductRel ref="productRel" mode="add" :options="productList" :priced="form.priced" :list="productLineList" @change="onProductsChange" @invoice-name-change="onInvoiceNameChange"/>
210 207 </uni-list>
211 208
212 209 <!-- 料质状况模块(明细下方) -->
... ... @@ -355,6 +352,9 @@ export default {
355 352 this.initCode()
356 353 },
357 354 methods: {
  355 + onInvoiceNameChange(name) {
  356 + this.form.invoiceProductName = name
  357 + },
358 358 async loadDictData() {
359 359 try {
360 360 const codes = [...this.materialConditionConfigs.map(mc => mc.dictCode), 'DELIVERY_METHOD']
... ... @@ -522,7 +522,6 @@ export default {
522 522 { key: 'supplierId', msg: '请选择供应商' },
523 523 { key: 'validityPeriod', msg: '请输入报价时效' },
524 524 { key: 'deliveryMode', msg: '请选择交提货方式' },
525   - { key: 'invoiceProductName', msg: '请输入开票品种' },
526 525 { key: 'deliveryDate', msg: '请选择交货日期' },
527 526 { key: 'settlementMethod', msg: '请输入结算方式' },
528 527 { key: 'settlementRatio', msg: '请输入结算比例' }
... ...
... ... @@ -22,7 +22,7 @@
22 22 <view class="row"><text class="label">是否数量买断</text><text class="value">{{ boolText(form.quantityBuyout) }}</text></view>
23 23 <view class="row"><text class="label">是否送货上门</text><text class="value">{{ boolText(form.doorDelivery) }}</text></view>
24 24 <view class="row"><text class="label">装车费</text><text class="value">{{ safeText(form.loadingFee) }}</text></view>
25   - <view class="row"><text class="label">开票品种</text><text class="value">{{ safeText(form.invoiceProductName) }}</text></view>
  25 + <view class="row"><text class="label">开票品名(汇总)</text><text class="value">{{ safeText(form.invoiceProductName) }}</text></view>
26 26 <view class="row"><text class="label">交货日期</text><text class="value">{{ formatDateOnly(form.deliveryDate) }}</text></view>
27 27 <view class="row"><text class="label">结算方式</text><text class="value">{{ safeText(form.settlementMethod) }}</text></view>
28 28 <view class="row"><text class="label">结算比例(%)</text><text class="value">{{ safeText(form.settlementRatio) }}</text></view>
... ... @@ -31,7 +31,7 @@
31 31 </view>
32 32
33 33 <!-- 明细信息 -->
34   - <ProductRel mode="view" :list="productLineList" />
  34 + <ProductRel mode="view" :list="productLineList" @invoiceNameChange="onInvoiceNameChange" />
35 35
36 36 <!-- 料质状况 -->
37 37 <view class="title-header">
... ... @@ -127,6 +127,9 @@ export default {
127 127 this.getUserInfo();
128 128 },
129 129 methods: {
  130 + onInvoiceNameChange(name) {
  131 + this.form.invoiceProductName = name
  132 + },
130 133 // 获取当前用户信息
131 134 async getUserInfo() {
132 135 getInfo()
... ...
... ... @@ -151,12 +151,9 @@
151 151 </uni-list-item>
152 152
153 153 <!-- 开票品种 -->
154   - <uni-list-item>
155   - <template v-slot:body>
156   - <view class="item-title"><text class="required">*</text><text>开票品种</text></view>
157   - </template>
  154 + <uni-list-item title="开票品名(汇总)">
158 155 <template v-slot:footer>
159   - <uni-easyinput v-model="form.invoiceProductName" :inputBorder="false" placeholder="请输入开票品种" />
  156 + <uni-easyinput v-model="form.invoiceProductName" :inputBorder="false" disabled />
160 157 </template>
161 158 </uni-list-item>
162 159
... ... @@ -205,7 +202,7 @@
205 202 </uni-list-item>
206 203
207 204 <!-- 明细信息 -->
208   - <ProductRel ref="productRel" mode="edit" :options="productList" :priced="form.priced" :list="productLineList" @change="onProductsChange" />
  205 + <ProductRel ref="productRel" mode="edit" :options="productList" :priced="form.priced" :list="productLineList" @change="onProductsChange" @invoice-name-change="onInvoiceNameChange"/>
209 206 </uni-list>
210 207
211 208 <!-- 料质状况模块(明细下方) -->
... ... @@ -353,6 +350,9 @@ export default {
353 350 this.loadDetail()
354 351 },
355 352 methods: {
  353 + onInvoiceNameChange(name) {
  354 + this.form.invoiceProductName = name
  355 + },
356 356 async loadDictData() {
357 357 try {
358 358 const codes = [...this.materialConditionConfigs.map(mc => mc.dictCode), 'DELIVERY_METHOD']
... ... @@ -503,7 +503,6 @@ export default {
503 503 { key: 'supplierId', msg: '请选择供应商' },
504 504 { key: 'validityPeriod', msg: '请输入报价时效' },
505 505 { key: 'deliveryMode', msg: '请选择交提货方式' },
506   - { key: 'invoiceProductName', msg: '请输入开票品种' },
507 506 { key: 'deliveryDate', msg: '请选择交货日期' },
508 507 { key: 'settlementMethod', msg: '请输入结算方式' },
509 508 { key: 'settlementRatio', msg: '请输入结算比例' }
... ...
... ... @@ -25,6 +25,11 @@
25 25 <uni-easyinput v-model="item.materialType" :inputBorder="false" placeholder="请输入料型" />
26 26 </template>
27 27 </uni-list-item>
  28 + <uni-list-item title="开票品名">
  29 + <template v-slot:footer>
  30 + <uni-easyinput v-model="item.invoiceProductName" :inputBorder="false" placeholder="请输入开票品名" />
  31 + </template>
  32 + </uni-list-item>
28 33 <uni-list-item title="数量(吨)">
29 34 <template v-slot:footer>
30 35 <uni-easyinput v-model="item.quantity" type="digit" :inputBorder="false" placeholder="请输入数量" @input="onNonNegativeInput(idx, 'quantity')" @blur="onNonNegativeBlur(idx, 'quantity', 1)" />
... ... @@ -74,6 +79,7 @@
74 79 <view v-for="(item, idx) in items" :key="'v-' + (item._key || idx)" class="card">
75 80 <view class="row"><text class="label">品种</text><text class="value">{{ item.productName }}</text></view>
76 81 <view class="row"><text class="label">料型</text><text class="value">{{ item.materialType }}</text></view>
  82 + <view class="row"><text class="label">开票品名</text><text class="value">{{ item.invoiceProductName }}</text></view>
77 83 <view class="row"><text class="label">数量(吨)</text><text class="value">{{ item.quantity }}</text></view>
78 84 <view class="row"><text class="label">采购价</text><text class="value">{{ item.purchasePrice }}</text></view>
79 85 <view class="row"><text class="label">买断料预计损耗</text><text class="value">{{ item.estimatedLoss }}</text></view>
... ... @@ -117,7 +123,10 @@ export default {
117 123 },
118 124 watch: {
119 125 items: {
120   - handler() { this.emitChange() },
  126 + handler() {
  127 + this.emitChange(),
  128 + this.$emit('invoice-name-change', this.getSummaryInvoiceProductName());
  129 + },
121 130 deep: true
122 131 },
123 132 list: {
... ... @@ -134,6 +143,13 @@ export default {
134 143 this.$nextTick(() => { this._initialized = true })
135 144 },
136 145 methods: {
  146 + getSummaryInvoiceProductName() {
  147 + const list = Array.isArray(this.items) ? this.items : [];
  148 + const names = list
  149 + .map((item) => item.invoiceProductName)
  150 + .filter((name) => !!name && name.trim() !== '');
  151 + return [...new Set(names.map((n) => n.trim()))].join('、');
  152 + },
137 153 initItems() {
138 154 const src = Array.isArray(this.list) && this.list.length > 0 ? this.list : []
139 155 if (!src.length) {
... ... @@ -165,6 +181,7 @@ export default {
165 181 productId: '',
166 182 productName: '',
167 183 materialType: '',
  184 + invoiceProductName: '',
168 185 quantity: '',
169 186 purchasePrice: '',
170 187 estimatedLoss: '',
... ... @@ -287,6 +304,10 @@ export default {
287 304 uni.showToast({ title: `第${i + 1}条明细:请选择品种`, icon: 'none' })
288 305 return false
289 306 }
  307 + if (!it.invoiceProductName) {
  308 + uni.showToast({ title: `第${i + 1}条明细:请输入发票名称`, icon: 'none' })
  309 + return false
  310 + }
290 311 if (priced === false && (it.purchasePrice === '' || it.purchasePrice == null)) {
291 312 uni.showToast({ title: `第${i + 1}条明细:未点价为否时采购价必填`, icon: 'none' })
292 313 return false
... ...
... ... @@ -21,7 +21,7 @@
21 21 <view class="row"><text class="label">是否数量买断</text><text class="value">{{ boolText(form.quantityBuyout) }}</text></view>
22 22 <view class="row"><text class="label">是否送货上门</text><text class="value">{{ boolText(form.doorDelivery) }}</text></view>
23 23 <view class="row"><text class="label">装车费</text><text class="value">{{ safeText(form.loadingFee) }}</text></view>
24   - <view class="row"><text class="label">开票品种</text><text class="value">{{ safeText(form.invoiceProductName) }}</text></view>
  24 + <view class="row"><text class="label">开票品名(汇总)</text><text class="value">{{ safeText(form.invoiceProductName) }}</text></view>
25 25 <view class="row"><text class="label">交货日期</text><text class="value">{{ formatDateOnly(form.deliveryDate) }}</text></view>
26 26 <view class="row"><text class="label">结算方式</text><text class="value">{{ safeText(form.settlementMethod) }}</text></view>
27 27 <view class="row"><text class="label">结算比例(%)</text><text class="value">{{ safeText(form.settlementRatio) }}</text></view>
... ... @@ -30,7 +30,7 @@
30 30 </view>
31 31
32 32 <!-- 明细信息 -->
33   - <ProductRel mode="view" :list="productLineList" />
  33 + <ProductRel mode="view" :list="productLineList" @invoiceNameChange="onInvoiceNameChange" />
34 34
35 35 <!-- 料质状况 -->
36 36 <view class="title-header">
... ... @@ -104,6 +104,9 @@ export default {
104 104 }
105 105 },
106 106 methods: {
  107 + onInvoiceNameChange(name) {
  108 + this.form.invoiceProductName = name
  109 + },
107 110 async loadDictData() {
108 111 try {
109 112 const codes = [...this.materialConditionConfigs.map(mc => mc.dictCode), 'DELIVERY_METHOD']
... ...
... ... @@ -161,9 +161,9 @@
161 161 </template>
162 162 </uni-list-item>
163 163
164   - <uni-list-item title="开票品名">
  164 + <uni-list-item title="开票品名(汇总)">
165 165 <template v-slot:footer>
166   - <uni-easyinput v-model="detail.invoiceProductName" :inputBorder="false" placeholder="请输入开票品名" />
  166 + <uni-easyinput v-model="detail.invoiceProductName" :inputBorder="false" disabled />
167 167 </template>
168 168 </uni-list-item>
169 169
... ... @@ -242,6 +242,7 @@
242 242 :product-options="productOptions"
243 243 :workshop-options="workshopOptions"
244 244 @change="onLineChange"
  245 + @invoice-name-change="onInvoiceNameChange"
245 246 />
246 247 </uni-list>
247 248
... ... @@ -411,6 +412,9 @@ export default {
411 412 this.loadRefData()
412 413 },
413 414 methods: {
  415 + onInvoiceNameChange(name) {
  416 + this.detail.invoiceProductName = name
  417 + },
414 418 safeText(v) {
415 419 var s = v == null ? '' : String(v)
416 420 return s.trim() ? s : '-'
... ... @@ -751,7 +755,6 @@ export default {
751 755 { key: 'quoterName', title: '报价人' },
752 756 { key: 'deliveryMode', title: '交提货方式' },
753 757 { key: 'loadingFee', title: '装车费' },
754   - { key: 'invoiceProductName', title: '开票品名' },
755 758 { key: 'deliveryDate', title: '交货日期' },
756 759 { key: 'settlementMethod', title: '结算方式' },
757 760 { key: 'settlementRatio', title: '结算比例' },
... ... @@ -827,8 +830,11 @@ export default {
827 830 var itemId = r.itemId != null ? r.itemId : (r.id != null ? String(r.id) : (r._key != null ? r._key : ('line-' + Date.now() + '-' + i)))
828 831 if (!workshopId && r.workshopId != null) workshopId = r.workshopId
829 832 return {
  833 + procurementPlanLineId: r.id || '',
  834 + id: r.id || '',
830 835 productId: self.pickId(r.productId),
831 836 materialType: r.materialType != null ? String(r.materialType) : '',
  837 + invoiceProductName: r.invoiceProductName != null ? String(r.invoiceProductName) : '',
832 838 quantity: r.quantity != null ? String(r.quantity) : '',
833 839 actualPurchasePrice: r.actualPurchasePrice != null ? String(r.actualPurchasePrice) : '',
834 840 includingShippingPrice: r.includingShippingPrice != null ? String(r.includingShippingPrice) : '',
... ...
... ... @@ -24,7 +24,7 @@
24 24 <view class="row"><text class="label">是否送货上门</text><text class="value">{{ boolText(form.doorDelivery) }}</text></view>
25 25 <view class="row"><text class="label">另付运费</text><text class="value">{{ formatNumber(form.shippingCost) }}</text></view>
26 26 <view class="row"><text class="label">装车费</text><text class="value">{{ formatNumber(form.loadingFee) }}</text></view>
27   - <view class="row"><text class="label">开票品名</text><text class="value">{{ safeText(form.invoiceProductName) }}</text></view>
  27 + <view class="row"><text class="label">开票品名(汇总)</text><text class="value">{{ safeText(form.invoiceProductName) }}</text></view>
28 28 <view class="row"><text class="label">交货日期</text><text class="value">{{ formatDateOnly(form.deliveryDate) }}</text></view>
29 29 <view class="row"><text class="label">结算方式</text><text class="value">{{ safeText(form.settlementMethod) }}</text></view>
30 30 <view class="row"><text class="label">结算比例(%)</text><text class="value">{{ formatNumber(form.settlementRatio) }}</text></view>
... ... @@ -52,6 +52,7 @@
52 52 <view class="line-title">明细{{ idx + 1 }}</view>
53 53 <view class="row"><text class="label">品种</text><text class="value">{{ safeText(line.productName) }}</text></view>
54 54 <view class="row"><text class="label">料型</text><text class="value">{{ safeText(line.materialType) }}</text></view>
  55 + <view class="row"><text class="label">开票品种</text><text class="value">{{ safeText(line.invoiceProductName) }}</text></view>
55 56 <view class="row"><text class="label">数量(吨)</text><text class="value">{{ formatNumber(line.quantity) }}</text></view>
56 57 <view class="row"><text class="label">实际采购价</text><text class="value">{{ formatNumber(line.actualPurchasePrice) }}</text></view>
57 58 <view class="row"><text class="label">含运到厂价</text><text class="value">{{ formatNumber(line.includingShippingPrice) }}</text></view>
... ...
... ... @@ -163,12 +163,9 @@
163 163 </template>
164 164 </uni-list-item>
165 165
166   - <uni-list-item>
167   - <template v-slot:body>
168   - <view class="item-title"><text class="required">*</text><text>开票品名</text></view>
169   - </template>
  166 + <uni-list-item title="开票品名(汇总)">
170 167 <template v-slot:footer>
171   - <uni-easyinput v-model="detail.invoiceProductName" :inputBorder="false" placeholder="请输入开票品名" />
  168 + <uni-easyinput v-model="detail.invoiceProductName" :inputBorder="false" disabled />
172 169 </template>
173 170 </uni-list-item>
174 171
... ... @@ -248,6 +245,7 @@
248 245 :product-options="productOptions"
249 246 :workshop-options="workshopOptions"
250 247 @change="onLineChange"
  248 + @invoice-name-change="onInvoiceNameChange"
251 249 />
252 250 </uni-list>
253 251
... ... @@ -403,6 +401,9 @@ export default {
403 401 }
404 402 },
405 403 methods: {
  404 + onInvoiceNameChange(name) {
  405 + this.detail.invoiceProductName = name
  406 + },
406 407 safeText(v) {
407 408 var s = v == null ? '' : String(v)
408 409 return s.trim() ? s : '-'
... ... @@ -714,7 +715,6 @@ export default {
714 715 { key: 'quoterName', title: '报价人' },
715 716 { key: 'deliveryMode', title: '交提货方式' },
716 717 { key: 'loadingFee', title: '装车费' },
717   - { key: 'invoiceProductName', title: '开票品名' },
718 718 { key: 'deliveryDate', title: '交货日期' },
719 719 { key: 'settlementMethod', title: '结算方式' },
720 720 { key: 'settlementRatio', title: '结算比例' },
... ... @@ -792,6 +792,7 @@ export default {
792 792 return {
793 793 productId: self.pickId(r.productId),
794 794 materialType: r.materialType != null ? String(r.materialType) : '',
  795 + invoiceProductName: r.invoiceProductName != null ? String(r.invoiceProductName) : '',
795 796 quantity: r.quantity != null ? String(r.quantity) : '',
796 797 actualPurchasePrice: r.actualPurchasePrice != null ? String(r.actualPurchasePrice) : '',
797 798 includingShippingPrice: r.includingShippingPrice != null ? String(r.includingShippingPrice) : '',
... ...
... ... @@ -3,9 +3,6 @@
3 3 <view class="header">
4 4 <image class="opCollapse" src="/static/images/title.png" />
5 5 <text class="title">明细信息</text>
6   - <view class="ops">
7   - <image class="opAdd" @click="onAdd" src="/static/images/plus.png" />
8   - </view>
9 6 </view>
10 7
11 8 <view class="add-list">
... ... @@ -38,6 +35,16 @@
38 35 <uni-list-item>
39 36 <template v-slot:body>
40 37 <view class="item-title">
  38 + <text class="required">*</text><text>开票品名</text>
  39 + </view>
  40 + </template>
  41 + <template v-slot:footer>
  42 + <uni-easyinput v-model="item.invoiceProductName" :inputBorder="false" placeholder="请输入开票品名" />
  43 + </template>
  44 + </uni-list-item>
  45 + <uni-list-item>
  46 + <template v-slot:body>
  47 + <view class="item-title">
41 48 <text class="required">*</text><text>数量(吨)</text>
42 49 </view>
43 50 </template>
... ... @@ -202,7 +209,9 @@ export default {
202 209 watch: {
203 210 items: {
204 211 handler() {
205   - this.emitChange() },
  212 + this.emitChange();
  213 + this.$emit('invoice-name-change', this.getSummaryInvoiceProductName());
  214 + },
206 215 deep: true
207 216 },
208 217 list: {
... ... @@ -232,6 +241,13 @@ export default {
232 241 })
233 242 },
234 243 methods: {
  244 + getSummaryInvoiceProductName() {
  245 + const list = Array.isArray(this.items) ? this.items : [];
  246 + const names = list
  247 + .map((item) => item.invoiceProductName)
  248 + .filter((name) => !!name && name.trim() !== '');
  249 + return [...new Set(names.map((n) => n.trim()))].join('、');
  250 + },
235 251 initItems() {
236 252 var src = Array.isArray(this.list) && this.list.length > 0 ? this.list : []
237 253 if (!src.length) {
... ... @@ -267,6 +283,7 @@ export default {
267 283 productId: '',
268 284 productName: '',
269 285 materialType: '',
  286 + invoiceProductName: '',
270 287 quantity: '',
271 288 actualPurchasePrice: '',
272 289 includingShippingPrice: '',
... ... @@ -473,6 +490,7 @@ export default {
473 490 var fields = [
474 491 { key: 'productName', title: '品种' },
475 492 { key: 'materialType', title: '料型' },
  493 + { key: 'invoiceProductName', title: '开票品名' },
476 494 { key: 'quantity', title: '数量' },
477 495 { key: 'actualPurchasePrice', title: '实际采购价' },
478 496 { key: 'applicationAttrition', title: '申请损耗' }
... ...
... ... @@ -185,12 +185,7 @@
185 185 </template>
186 186 </uni-list-item>
187 187
188   - <uni-list-item>
189   - <template v-slot:body>
190   - <view class="item-title">
191   - <text class="required" v-if="canEdit">*</text><text>开票品名</text>
192   - </view>
193   - </template>
  188 + <uni-list-item title="开票品名(汇总)">
194 189 <template v-slot:footer>
195 190 <uni-easyinput
196 191 v-if="canEdit"
... ... @@ -274,6 +269,11 @@
274 269 <uni-easyinput :value="line.materialType" :inputBorder="false" disabled placeholder="-" />
275 270 </template>
276 271 </uni-list-item>
  272 + <uni-list-item title="开票品种">
  273 + <template v-slot:footer>
  274 + <uni-easyinput :value="line.invoiceProductName" :inputBorder="false" disabled placeholder="-" />
  275 + </template>
  276 + </uni-list-item>
277 277 <uni-list-item title="数量(吨)">
278 278 <template v-slot:footer>
279 279 <uni-easyinput :value="lineNumberDisplay(line.quantity)" :inputBorder="false" disabled placeholder="-" />
... ... @@ -396,7 +396,7 @@
396 396 <view class="row"><text class="label">是否送货上门</text><text class="value">{{ boolText(form.doorDelivery) }}</text></view>
397 397 <view class="row"><text class="label">另付运费</text><text class="value">{{ formatNumber(form.shippingCost) }}</text></view>
398 398 <view class="row"><text class="label">装车费</text><text class="value">{{ formatNumber(form.loadingFee) }}</text></view>
399   - <view class="row"><text class="label">开票品名</text><text class="value">{{ safeText(form.invoiceProductName) }}</text></view>
  399 + <view class="row"><text class="label">开票品名(汇总)</text><text class="value">{{ safeText(form.invoiceProductName) }}</text></view>
400 400 <view class="row"><text class="label">交货日期</text><text class="value">{{ formatDateOnly(form.deliveryDate) }}</text></view>
401 401 <view class="row"><text class="label">结算方式</text><text class="value">{{ safeText(form.settlementMethod) }}</text></view>
402 402 <view class="row"><text class="label">结算比例(%)</text><text class="value">{{ formatNumber(form.settlementRatio) }}</text></view>
... ... @@ -1356,9 +1356,11 @@ export default {
1356 1356 var itemId = r.itemId != null ? r.itemId : (r.id != null ? String(r.id) : (r._key != null ? r._key : ('line-' + Date.now() + '-' + i)))
1357 1357 return {
1358 1358 id: r.id != null ? r.id : '',
  1359 + procurementPlanLineId: r.id != null ? r.id : '',
1359 1360 itemId: itemId,
1360 1361 productId: self.pickId(r.productId),
1361 1362 materialType: r.materialType != null ? String(r.materialType) : '',
  1363 + invoiceProductName: r.invoiceProductName != null ? String(r.invoiceProductName) : '',
1362 1364 quantity: r.quantity != null ? (self.toNumber(r.quantity)) : '',
1363 1365 actualPurchasePrice: r.actualPurchasePrice != null ? (self.toNumber(r.actualPurchasePrice)) : '',
1364 1366 includingShippingPrice: r.includingShippingPrice != null ? (self.toNumber(r.includingShippingPrice)) : '',
... ...
... ... @@ -161,9 +161,9 @@
161 161 </template>
162 162 </uni-list-item>
163 163
164   - <uni-list-item title="开票品名">
  164 + <uni-list-item title="开票品名(汇总)">
165 165 <template v-slot:footer>
166   - <uni-easyinput v-model="detail.invoiceProductName" :inputBorder="false" placeholder="请输入开票品名" />
  166 + <uni-easyinput v-model="detail.invoiceProductName" :inputBorder="false" disabled />
167 167 </template>
168 168 </uni-list-item>
169 169
... ... @@ -244,6 +244,7 @@
244 244 :shipping-cost="detail.shippingCost"
245 245 :price-map="priceMap"
246 246 @change="onLineChange"
  247 + @invoice-name-change="onInvoiceNameChange"
247 248 />
248 249 </uni-list>
249 250
... ... @@ -414,6 +415,9 @@ export default {
414 415 this.loadRefData()
415 416 },
416 417 methods: {
  418 + onInvoiceNameChange(name) {
  419 + this.detail.invoiceProductName = name
  420 + },
417 421 safeText(v) {
418 422 var s = v == null ? '' : String(v)
419 423 return s.trim() ? s : '-'
... ... @@ -794,7 +798,6 @@ export default {
794 798 { key: 'quoterName', title: '报价人' },
795 799 { key: 'deliveryMode', title: '交提货方式' },
796 800 { key: 'loadingFee', title: '装车费' },
797   - { key: 'invoiceProductName', title: '开票品名' },
798 801 { key: 'deliveryDate', title: '交货日期' },
799 802 { key: 'settlementMethod', title: '结算方式' },
800 803 { key: 'settlementRatio', title: '结算比例' },
... ... @@ -872,6 +875,7 @@ export default {
872 875 return {
873 876 productId: self.pickId(r.productId),
874 877 materialType: r.materialType != null ? String(r.materialType) : '',
  878 + invoiceProductName: r.invoiceProductName != null ? String(r.invoiceProductName) : '',
875 879 quantity: r.quantity != null ? String(r.quantity) : '',
876 880 actualPurchasePrice: r.actualPurchasePrice != null ? String(r.actualPurchasePrice) : '',
877 881 includingShippingPrice: r.includingShippingPrice != null ? String(r.includingShippingPrice) : '',
... ...
... ... @@ -24,7 +24,7 @@
24 24 <view class="row"><text class="label">是否送货上门</text><text class="value">{{ boolText(form.doorDelivery) }}</text></view>
25 25 <view class="row"><text class="label">另付运费</text><text class="value">{{ formatNumber(form.shippingCost) }}</text></view>
26 26 <view class="row"><text class="label">装车费</text><text class="value">{{ formatNumber(form.loadingFee) }}</text></view>
27   - <view class="row"><text class="label">开票品名</text><text class="value">{{ safeText(form.invoiceProductName) }}</text></view>
  27 + <view class="row"><text class="label">开票品名(汇总)</text><text class="value">{{ safeText(form.invoiceProductName) }}</text></view>
28 28 <view class="row"><text class="label">交货日期</text><text class="value">{{ formatDateOnly(form.deliveryDate) }}</text></view>
29 29 <view class="row"><text class="label">结算方式</text><text class="value">{{ safeText(form.settlementMethod) }}</text></view>
30 30 <view class="row"><text class="label">结算比例(%)</text><text class="value">{{ formatNumber(form.settlementRatio) }}</text></view>
... ... @@ -52,6 +52,7 @@
52 52 <view class="line-title">明细{{ idx + 1 }}</view>
53 53 <view class="row"><text class="label">品种</text><text class="value">{{ safeText(line.productName) }}</text></view>
54 54 <view class="row"><text class="label">料型</text><text class="value">{{ safeText(line.materialType) }}</text></view>
  55 + <view class="row"><text class="label">开票品名</text><text class="value">{{ safeText(line.invoiceProductName) }}</text></view>
55 56 <view class="row"><text class="label">数量(吨)</text><text class="value">{{ formatNumber(line.quantity) }}</text></view>
56 57 <view class="row"><text class="label">实际采购价</text><text class="value">{{ formatNumber(line.actualPurchasePrice) }}</text></view>
57 58 <view class="row"><text class="label">含运到厂价</text><text class="value">{{ formatNumber(line.includingShippingPrice) }}</text></view>
... ...
... ... @@ -250,6 +250,7 @@
250 250 :shipping-cost="detail.shippingCost"
251 251 :price-map="priceMap"
252 252 @change="onLineChange"
  253 + @invoice-name-change="onInvoiceNameChange"
253 254 />
254 255 </uni-list>
255 256
... ... @@ -406,6 +407,9 @@ export default {
406 407 }
407 408 },
408 409 methods: {
  410 + onInvoiceNameChange(name) {
  411 + this.detail.invoiceProductName = name
  412 + },
409 413 safeText(v) {
410 414 var s = v == null ? '' : String(v)
411 415 return s.trim() ? s : '-'
... ... @@ -820,6 +824,7 @@ export default {
820 824 return {
821 825 productId: self.pickId(r.productId),
822 826 materialType: r.materialType != null ? String(r.materialType) : '',
  827 + invoiceProductName: r.invoiceProductName != null ? String(r.invoiceProductName) : '',
823 828 quantity: r.quantity != null ? String(r.quantity) : '',
824 829 actualPurchasePrice: r.actualPurchasePrice != null ? String(r.actualPurchasePrice) : '',
825 830 includingShippingPrice: r.includingShippingPrice != null ? String(r.includingShippingPrice) : '',
... ...
... ... @@ -47,6 +47,16 @@
47 47 <uni-easyinput v-else v-model="item.materialType" :inputBorder="false" placeholder="请输入料型" />
48 48 </template>
49 49 </uni-list-item>
  50 + <uni-list-item>
  51 + <template v-slot:body>
  52 + <view class="item-title">
  53 + <text class="required">*</text><text>开票品名</text>
  54 + </view>
  55 + </template>
  56 + <template v-slot:footer>
  57 + <uni-easyinput v-model="item.invoiceProductName" :inputBorder="false" placeholder="请输入开票品名" />
  58 + </template>
  59 + </uni-list-item>
50 60
51 61 <uni-list-item>
52 62 <template v-slot:body>
... ... @@ -268,7 +278,8 @@ export default {
268 278 watch: {
269 279 items: {
270 280 handler() {
271   - this.emitChange()
  281 + this.emitChange();
  282 + this.$emit('invoice-name-change', this.getSummaryInvoiceProductName());
272 283 },
273 284 deep: true
274 285 },
... ... @@ -310,6 +321,13 @@ export default {
310 321 })
311 322 },
312 323 methods: {
  324 + getSummaryInvoiceProductName() {
  325 + const list = Array.isArray(this.items) ? this.items : [];
  326 + const names = list
  327 + .map((item) => item.invoiceProductName)
  328 + .filter((name) => !!name && name.trim() !== '');
  329 + return [...new Set(names.map((n) => n.trim()))].join('、');
  330 + },
313 331 initItems() {
314 332 var src = Array.isArray(this.list) && this.list.length > 0 ? this.list : []
315 333 if (!src.length) {
... ... @@ -345,6 +363,7 @@ export default {
345 363 productId: '',
346 364 productName: '',
347 365 materialType: '',
  366 + invoiceProductName: '',
348 367 quantity: '',
349 368 actualPurchasePrice: '',
350 369 includingShippingPrice: '',
... ... @@ -600,7 +619,7 @@ export default {
600 619 return c
601 620 })
602 621 var sig = list.length + '|' + list.map(function (r) {
603   - return [r.itemId, r.productId, r.productName, r.materialType, r.quantity, r.actualPurchasePrice, r.includingShippingPrice, r.priceListPrices, r.coordinationRange, r.estimatedLoss, r.applicationAttrition, r.paintDamageRatio, r.workshopId, r.workshopName].join('~')
  622 + return [r.itemId, r.productId, r.productName, r.materialType, r.invoiceProductName, r.quantity, r.actualPurchasePrice, r.includingShippingPrice, r.priceListPrices, r.coordinationRange, r.estimatedLoss, r.applicationAttrition, r.paintDamageRatio, r.workshopId, r.workshopName].join('~')
604 623 }).join('||')
605 624 if (sig === this._lastEmitSignature) return
606 625 this._lastEmitSignature = sig
... ... @@ -626,6 +645,7 @@ export default {
626 645 if (x.productId !== y.productId) return false
627 646 if (x.productName !== y.productName) return false
628 647 if (x.materialType !== y.materialType) return false
  648 + if (x.invoiceProductName !== y.invoiceProductName) return false
629 649 if (x.quantity !== y.quantity) return false
630 650 if (x.actualPurchasePrice !== y.actualPurchasePrice) return false
631 651 if (x.includingShippingPrice !== y.includingShippingPrice) return false
... ... @@ -661,6 +681,10 @@ export default {
661 681 uni.showToast({ title: '请填写第' + (i + 1) + '条明细的品种', icon: 'none' })
662 682 return false
663 683 }
  684 + if (!it.invoiceProductName) {
  685 + uni.showToast({ title: '请填写第' + (i + 1) + '条明细的开票品名', icon: 'none' })
  686 + return false
  687 + }
664 688 if (it.quantity === '' || it.quantity === null || it.quantity === undefined) {
665 689 uni.showToast({ title: '请填写第' + (i + 1) + '条明细的数量', icon: 'none' })
666 690 return false
... ...