diff --git a/klp-ui/src/views/crm/contract/components/ProductContent.vue b/klp-ui/src/views/crm/contract/components/ProductContent.vue index e62428e0..1768a3b3 100644 --- a/klp-ui/src/views/crm/contract/components/ProductContent.vue +++ b/klp-ui/src/views/crm/contract/components/ProductContent.vue @@ -6,7 +6,7 @@
产品名称: - +
@@ -50,7 +50,7 @@
- +
@@ -148,28 +148,31 @@ export default { remark: '', productName: '', previousProductName: '', - productMaterialMap: { - '冷硬钢卷': 'SPCC', - '镀锌钢卷': 'DX51D+Z', - '冷轧钢卷': 'DC01', - '冷轧卷(花纹)': 'DC01-H', - '镀铬钢卷': 'SPCC', - }, - productOptions: [ - { label: '冷硬钢卷', value: '冷硬钢卷' }, - { label: '镀锌钢卷', value: '镀锌钢卷' }, - { label: '冷轧钢卷', value: '冷轧钢卷' }, - { label: '冷轧卷(花纹)', value: '冷轧卷(花纹)' }, - { label: '镀铬钢卷', value: '镀铬钢卷' }, - ], - materialOptions: [ - { label: 'SPCC', value: 'SPCC' }, - { label: 'DX51D+Z', value: 'DX51D+Z' }, - { label: 'DC01', value: 'DC01' }, - { label: 'DC01-H', value: 'DC01-H' } - ] + // productMaterialMap: { + // '冷硬钢卷': 'SPCC', + // '镀锌钢卷': 'DX51D+Z', + // '冷轧钢卷': 'DC01', + // '冷轧卷(花纹)': 'DC01-H', + // '镀铬钢卷': 'SPCC', + // '镀锌管料带钢': 'DX51D+Z' + // }, + // productOptions: [ + // { label: '冷硬钢卷', value: '冷硬钢卷' }, + // { label: '镀锌钢卷', value: '镀锌钢卷' }, + // { label: '冷轧钢卷', value: '冷轧钢卷' }, + // { label: '冷轧卷(花纹)', value: '冷轧卷(花纹)' }, + // { label: '镀铬钢卷', value: '镀铬钢卷' }, + // { label: '镀锌管料带钢', value: '镀锌管料带钢' }, + // ], + // materialOptions: [ + // { label: 'SPCC', value: 'SPCC' }, + // { label: 'DX51D+Z', value: 'DX51D+Z' }, + // { label: 'DC01', value: 'DC01' }, + // { label: 'DC01-H', value: 'DC01-H' } + // ] } }, + dicts: ['contract_product_material'], computed: { // 计算总数量 totalQuantity() { @@ -213,6 +216,27 @@ export default { }; return JSON.stringify(data, null, 2); }, + productMaterialMap() { + const o = {}; + this.dict.type.contract_product_material.forEach(item => { + o[item.label] = item.value; + }); + return o; + }, + productOptions() { + return this.dict.type.contract_product_material.map(item => ({ + label: item.label, + value: item.label + })); + }, + materialOptions() { + // 先去重 + const uniqueMaterials = new Set(this.dict.type.contract_product_material.map(item => item.value)); + return Array.from(uniqueMaterials).map(material => ({ + label: material, + value: material + })); + } }, watch: { // 监听jsonContent变化,触发update事件 @@ -258,6 +282,7 @@ export default { if (item.taxDivisor === undefined || item.taxDivisor === null) { item.taxDivisor = 1.13; } + if (item.material === undefined) item.material = ''; if (item.noTaxPrice === undefined) item.noTaxPrice = 0; if (item.noTaxTotal === undefined) item.noTaxTotal = 0; if (item.taxAmount === undefined) item.taxAmount = 0;