Просмотр исходного кода

报价管理详情新增类型判断显示字段

hezhanp 10 месяцев назад
Родитель
Сommit
ca2cac9859

+ 110 - 151
src/BIZComponents/inventoryTable.vue

@@ -612,7 +612,7 @@
         <el-form-item
           :prop="'datasource.' + scope.$index + '.' + countObj.countKey"
           :rules="{
-            required: isTotalCount ? true : false,
+            required: quoteType !== 2 && isTotalCount ? true : false,
             message: '请输入数量',
             trigger: 'change'
           }"
@@ -622,7 +622,8 @@
             placeholder="请输入"
             type="number"
             :min="0"
-            @input="changeCount(scope.row, scope.$index)"
+            :disabled="quoteType === 2"
+            @input="handleCountChange(scope.row, scope.$index)"
           >
           </el-input>
         </el-form-item>
@@ -681,11 +682,7 @@
       <!-- 生产加工类型特有列的模板 -->
       <template v-slot:thickNess="{ row, $index }">
         <el-form-item :prop="'datasource.' + $index + '.thickNess'">
-          <el-input
-            v-model="row.thickNess"
-            placeholder="请输入"
-            @input="calculateIncludingTaxPrice(row, $index)"
-          >
+          <el-input v-model="row.thickNess" placeholder="请输入">
             <template slot="append">mm</template></el-input
           >
         </el-form-item>
@@ -693,11 +690,7 @@
 
       <template v-slot:squareNumber="{ row, $index }">
         <el-form-item :prop="'datasource.' + $index + '.squareNumber'">
-          <el-input
-            v-model="row.squareNumber"
-            placeholder="请输入"
-            @input="calculateIncludingTaxPrice(row, $index)"
-          >
+          <el-input v-model="row.squareNumber" placeholder="请输入">
             <template slot="append">m²</template></el-input
           >
         </el-form-item>
@@ -746,19 +739,17 @@
         </el-form-item>
       </template>
 
-      <!-- 未税小计列模板 -->
+      <!-- 新增未税小记列模板 -->
       <template v-slot:untaxedSubtotal="{ row, $index }">
-        <el-form-item
-          :prop="'datasource.' + $index + '.quotationSubtotalBeforeTax'"
-        >
-          {{ (Number(row.quotationSubtotalBeforeTax) || 0).toFixed(2) }}元
+        <el-form-item :prop="'datasource.' + $index + '.untaxedSubtotal'">
+          {{ (Number(row.untaxedSubtotal) || 0).toFixed(2) }}元
         </el-form-item>
       </template>
 
-      <template v-slot:extraTax="{ row, $index }">
-        <el-form-item :prop="'datasource.' + $index + '.extraTax'">
+      <template v-slot:additionalTaxRate="{ row, $index }">
+        <el-form-item :prop="'datasource.' + $index + '.additionalTaxRate'">
           <el-input
-            v-model="row.extraTax"
+            v-model="row.additionalTaxRate"
             type="number"
             placeholder="请输入"
             @input="calculateIncludingTaxPrice(row, $index)"
@@ -768,14 +759,13 @@
         </el-form-item>
       </template>
 
-      <!-- 含税小计模板 -->
-      <template v-slot:quotationSubtotalTax="{ row, $index }">
-        <el-form-item :prop="'datasource.' + $index + '.quotationSubtotalTax'">
+      <!-- 含税单价改为含税小计 -->
+      <template v-slot:includingTaxPrice="{ row, $index }">
+        <el-form-item :prop="'datasource.' + $index + '.includingTaxPrice'">
           <el-input
-            v-model="row.quotationSubtotalTax"
+            v-model="row.includingTaxPrice"
             type="number"
             placeholder="请输入"
-            @input="onQuotationSubtotalTaxChange(row, $index)"
           >
             <template slot="append">元</template>
           </el-input>
@@ -1022,10 +1012,10 @@ export default {
       processingFeeBeforeTax: '',
       packagingFeeNotTaxed: '',
       transportationFeeWithoutTax: '',
-      extraTax: '', // 税率(%)
-      quotationSubtotalTax: '', // 含税小计
-      // 未税小记字段
-      quotationSubtotalBeforeTax: '' // 未税小计
+      additionalTaxRate: '',
+      includingTaxPrice: '',
+      // 新增未税小记字段
+      untaxedSubtotal: ''
     };
     return {
       levelList,
@@ -1081,6 +1071,7 @@ export default {
           fixed: 'left'
         },
         {
+          label: '选择',
           width: 45,
           type: 'selection',
           columnKey: 'selection',
@@ -1187,23 +1178,23 @@ export default {
           },
           {
             width: 150,
-            prop: 'quotationSubtotalBeforeTax',
+            prop: 'untaxedSubtotal',
             label: '未税小计',
-            slot: 'untaxedSubtotal',
+            slot: 'additionalTaxRate_untaxed',
             align: 'center'
           },
           {
             width: 150,
-            prop: 'extraTax',
+            prop: 'additionalTaxRate',
             label: '税率(%)',
-            slot: 'extraTax',
+            slot: 'additionalTaxRate',
             align: 'center'
           },
           {
             width: 150,
-            prop: 'quotationSubtotalTax',
+            prop: 'includingTaxPrice',
             label: '含税小计',
-            slot: 'quotationSubtotalTax',
+            slot: 'includingTaxPrice',
             align: 'center'
           }
         );
@@ -1220,22 +1211,22 @@ export default {
             this.isDate == 1 ? 'headerCustomerExpectDeliveryDeadline' : '',
           align: 'center'
         },
-        
-          {
-            width: 120,
-            prop: 'singleWeight',
-            label: '单重',
-            slot: 'singleWeight',
-            headerSlot: 'headerSingleWeight',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'weightUnit',
-            label: '重量单位',
-            slot: 'weightUnit',
-            align: 'center'
-          },
+
+        {
+          width: 120,
+          prop: 'singleWeight',
+          label: '单重',
+          slot: 'singleWeight',
+          headerSlot: 'headerSingleWeight',
+          align: 'center'
+        },
+        {
+          width: 120,
+          prop: 'weightUnit',
+          label: '重量单位',
+          slot: 'weightUnit',
+          align: 'center'
+        },
         {
           minWidth: 120,
           prop: 'goodsLevel',
@@ -1579,20 +1570,20 @@ export default {
       'form.datasource',
       (newVal) => {
         newVal.forEach((row, index) => {
+          // 为每个行项目添加监听器
           this.$watch(
             () => [
               row.processingFeeBeforeTax,
               row.packagingFeeNotTaxed,
               row.transportationFeeWithoutTax,
-              row.extraTax,
-              row[this.countObj.countKey], // 显式监听数量字段
-              row.quotationSubtotalTax // 监听手动修改的含税小计
+              row.additionalTaxRate,
+              row[this.countObj.countKey]
             ],
             () => {
               this.calculateIncludingTaxPrice(row, index);
-              this.changeAll();
+              this.changeAll(); // 更新总价
             },
-            { deep: true, immediate: true } // 立即执行一次
+            { deep: true }
           );
         });
       },
@@ -1600,6 +1591,14 @@ export default {
     );
   },
   methods: {
+    handleCountChange(row, index) {
+      // 数量变化时,若为生产加工类型,触发含税小计计算
+      if (this.quoteType === 2) {
+        this.calculateIncludingTaxPrice(row, index);
+      } else {
+        this.changeCount(row, index);
+      }
+    },
     packingChange(item, index) {
       this.$set(
         this.form.datasource[index],
@@ -1727,16 +1726,6 @@ export default {
         v.customerReqFiles = v.customerReqFiles || [];
         v.industryArtFiles = v.industryArtFiles || [];
         v.otherFiles = v.otherFiles || [];
-
-        // 确保接口所需字段存在
-        v.quotationSubtotalBeforeTax = v.quotationSubtotalBeforeTax || '0.00';
-        v.quotationSubtotalTax = v.quotationSubtotalTax || '0.00';
-        v.extraTax = v.extraTax || 0;
-
-        // 删除旧字段
-        delete v.untaxedSubtotal;
-        delete v.includingTaxPrice;
-        delete v.additionalTaxRate;
       });
       return comitDatasource;
     },
@@ -1746,72 +1735,51 @@ export default {
     //改变数量
     changeCount(row, index) {
       if (!row) {
-        this.form.datasource.forEach((item, index) => {
-          this.$set(
-            this.form,
-            'datasource[' + index + ']',
-            changeCount(item, this.countObj)
-          );
+        this.form.datasource = this.form.datasource.map((item, i) => {
+          // 传入quoteType参数
+          return changeCount(item, this.countObj, false, this.quoteType);
         });
       } else {
-        this.$set(
-          this.form,
-          'datasource[' + index + ']',
-          changeCount(row, this.countObj)
+        const updatedRow = changeCount(
+          row,
+          this.countObj,
+          false,
+          this.quoteType
         );
+        // 关键:用this.$set更新,确保响应式
+        this.$set(this.form.datasource, index, updatedRow);
       }
 
-      // 生产加工类型时计算含税小计
-      if (this.quoteType === 2) {
-        this.calculateIncludingTaxPrice(row, index);
-      }
-
-      this.getNotaxSinglePrice();
-      this.changeAll();
-      this.$forceUpdate();
-    },
-
-    // 含税小计手动修改时触发
-    onQuotationSubtotalTaxChange(row, index) {
-      // 计算总价
-      if (row[this.countObj.countKey]) {
-        const totalPrice =
-          Number(row.quotationSubtotalTax) *
-          Number(row[this.countObj.countKey]);
-        this.$set(row, 'totalPrice', totalPrice.toFixed(2));
-      }
-      this.changeAll(); // 更新总价
+      this.$nextTick(() => {
+        // 生产加工类型不需要计算不含税单价,跳过
+        if (this.quoteType !== 2) {
+          this.getNotaxSinglePrice();
+        }
+        this.changeAll();
+        this.$forceUpdate();
+      });
     },
 
-    // 计算含税小计
+    // 计算含税小计(原含税单价逻辑)
     calculateIncludingTaxPrice(row, index) {
       if (!row) return;
 
-      // 计算各项费用总和(加工费 + 包装费 + 运输费)作为未税小记
-      const quotationSubtotalBeforeTax =
+      // 计算未税小记
+      const untaxedSubtotal =
         (Number(row.processingFeeBeforeTax) || 0) +
         (Number(row.packagingFeeNotTaxed) || 0) +
         (Number(row.transportationFeeWithoutTax) || 0);
+      this.$set(row, 'untaxedSubtotal', untaxedSubtotal.toFixed(2));
 
-      // 设置未税小记的值
-      this.$set(
-        row,
-        'quotationSubtotalBeforeTax',
-        quotationSubtotalBeforeTax.toFixed(2)
-      );
-
-      // 计算额外税率(将百分比转换为小数)
-      const taxRate = (Number(row.extraTax) || 0) / 100;
+      // 计算含税小计
+      const taxRate = (Number(row.additionalTaxRate) || 0) / 100;
+      const includingTaxPrice = untaxedSubtotal * (1 + taxRate);
+      this.$set(row, 'includingTaxPrice', includingTaxPrice.toFixed(2));
 
-      // 计算含税小计 = 未税小记 * (1 + 额外税率)
-      const quotationSubtotalTax = quotationSubtotalBeforeTax * (1 + taxRate);
-
-      this.$set(row, 'quotationSubtotalTax', quotationSubtotalTax.toFixed(2));
-
-      // 更新总价
-      if (row[this.countObj.countKey]) {
-        const totalPrice =
-          quotationSubtotalTax * Number(row[this.countObj.countKey]);
+      // 生产加工类型:使用转换后的总数量(totalCount)计算总价
+      if (this.quoteType === 2 && row.totalCount) {
+        // 关键修改:用totalCount替代this.countObj.countKey
+        const totalPrice = includingTaxPrice * Number(row.totalCount);
         this.$set(row, 'totalPrice', totalPrice.toFixed(2));
       }
     },
@@ -1944,7 +1912,7 @@ export default {
             item[this.countObj.countKey] = 1;
           }
 
-          // 初始化生产加工特有字段及未税小记、含税小计和税率
+          // 初始化生产加工特有字段及未税小记
           if (this.quoteType === 2) {
             item.thickNess = item.thickNess || '';
             item.squareNumber = item.squareNumber || '';
@@ -1952,23 +1920,14 @@ export default {
             item.packagingFeeNotTaxed = item.packagingFeeNotTaxed || '';
             item.transportationFeeWithoutTax =
               item.transportationFeeWithoutTax || '';
-            // 映射旧税率字段到新字段
-            item.extraTax = item.additionalTaxRate || 13;
-            this.calculateIncludingTaxPrice(item, index);
+            item.additionalTaxRate = item.additionalTaxRate || '';
             // 计算未税小记
-            const quotationSubtotalBeforeTax =
+            const untaxedSubtotal =
               (Number(item.processingFeeBeforeTax) || 0) +
               (Number(item.packagingFeeNotTaxed) || 0) +
               (Number(item.transportationFeeWithoutTax) || 0);
-            item.quotationSubtotalBeforeTax =
-              quotationSubtotalBeforeTax.toFixed(2);
-            // 映射旧含税单价字段到新含税小计字段
-            item.quotationSubtotalTax = item.includingTaxPrice || '';
-
-            // 删除旧字段
-            delete item.untaxedSubtotal;
-            delete item.includingTaxPrice;
-            delete item.additionalTaxRate;
+            item.untaxedSubtotal = untaxedSubtotal.toFixed(2);
+            item.includingTaxPrice = item.includingTaxPrice || '';
           }
         });
         this.form.datasource = productList;
@@ -2127,18 +2086,6 @@ export default {
           this.$set(parasm, this.countObj.countKey, 1);
         }
 
-        // 初始化生产加工特有字段及未税小记、含税小计和税率
-        if (this.quoteType === 2) {
-          parasm.thickNess = '';
-          parasm.squareNumber = '';
-          parasm.processingFeeBeforeTax = '';
-          parasm.packagingFeeNotTaxed = '';
-          parasm.transportationFeeWithoutTax = '';
-          parasm.extraTax = 13;
-          parasm.quotationSubtotalBeforeTax = '0.00';
-          parasm.quotationSubtotalTax = '';
-        }
-
         if (this.isSupplier) {
           this.$set(
             parasm,
@@ -2163,6 +2110,18 @@ export default {
         }
         this.$set(parasm, 'provenance', item.purchaseOrigins || []);
 
+        // 初始化生产加工特有字段及未税小记
+        if (this.quoteType === 2) {
+          parasm.thickNess = '';
+          parasm.squareNumber = '';
+          parasm.processingFeeBeforeTax = '';
+          parasm.packagingFeeNotTaxed = '';
+          parasm.transportationFeeWithoutTax = '';
+          parasm.additionalTaxRate = 13;
+          parasm.untaxedSubtotal = '0.00';
+          parasm.includingTaxPrice = '';
+        }
+
         if (idx == -1) {
           this.form.datasource.push(row);
         }
@@ -2264,16 +2223,16 @@ export default {
           this.$set(parasm, this.countObj.countKey, 1);
         }
 
-        // 初始化生产加工特有字段及未税小记、含税小计和税率
+        // 初始化生产加工特有字段及未税小记
         if (this.quoteType === 2) {
           parasm.thickNess = '';
           parasm.squareNumber = '';
           parasm.processingFeeBeforeTax = '';
           parasm.packagingFeeNotTaxed = '';
           parasm.transportationFeeWithoutTax = '';
-          parasm.extraTax = '';
-          parasm.quotationSubtotalBeforeTax = '0.00';
-          parasm.quotationSubtotalTax = '';
+          parasm.additionalTaxRate = '';
+          parasm.untaxedSubtotal = '0.00';
+          parasm.includingTaxPrice = '';
         }
 
         if (idx == -1) {
@@ -2304,16 +2263,16 @@ export default {
         item[this.countObj.countKey] = 1;
       }
 
-      // 初始化生产加工特有字段及未税小记、含税小计和税率
+      // 初始化生产加工特有字段及未税小记
       if (this.quoteType === 2) {
         item.thickNess = '';
         item.squareNumber = '';
         item.processingFeeBeforeTax = '';
         item.packagingFeeNotTaxed = '';
         item.transportationFeeWithoutTax = '';
-        item.extraTax = '';
-        item.quotationSubtotalBeforeTax = '0.00';
-        item.quotationSubtotalTax = '';
+        item.additionalTaxRate = '';
+        item.untaxedSubtotal = '0.00';
+        item.includingTaxPrice = '';
       }
 
       this.form.datasource.push(item);

+ 850 - 816
src/BIZComponents/inventoryTableDetails.vue

@@ -70,14 +70,6 @@
           {{ scope.row[countObj.countKey] }}{{ scope.row[countObj.unitKey] }}
         </el-form-item>
       </template>
-      <!-- <template v-slot:saleUnit="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.' + countObj.unitKey"
-        >
-          {{ scope.row[countObj.unitKey] }}
-        </el-form-item>
-      </template> -->
 
       <!-- 新增字段插槽 -->
       <template v-slot:thickNess="scope">
@@ -125,16 +117,45 @@
         </el-form-item>
       </template>
 
-      <template v-slot:quotationSubtotalBeforeTax="scope">
+      <!-- 新增的未税小计插槽 -->
+      <template v-slot:additionalTaxRate_untaxed="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.untaxedSubtotal'"
+        >
+          {{
+            (
+              Number(scope.row.processingFeeBeforeTax || 0) +
+              Number(scope.row.packagingFeeNotTaxed || 0) +
+              Number(scope.row.transportationFeeWithoutTax || 0)
+            ).toFixed(2)
+          }}
+          元
+        </el-form-item>
+      </template>
+
+      <!-- 新增的税率插槽 -->
+      <template v-slot:additionalTaxRate="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.additionalTaxRate'"
+        >
+          {{ scope.row.additionalTaxRate || 0 }}%
+        </el-form-item>
+      </template>
+
+      <!-- 新增的含税小计插槽 -->
+      <template v-slot:includingTaxPrice="scope">
         <el-form-item
           style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.quotationSubtotalBeforeTax'"
+          :prop="'datasource.' + scope.$index + '.includingTaxPrice'"
         >
           {{
             (
-              Number(scope.row.processingFeeBeforeTax) +
-              Number(scope.row.packagingFeeNotTaxed) +
-              Number(scope.row.transportationFeeWithoutTax)
+              (Number(scope.row.processingFeeBeforeTax || 0) +
+                Number(scope.row.packagingFeeNotTaxed || 0) +
+                Number(scope.row.transportationFeeWithoutTax || 0)) *
+              (1 + Number(scope.row.additionalTaxRate || 0) / 100)
             ).toFixed(2)
           }}
           元
@@ -187,869 +208,882 @@
   </el-form>
 </template>
 <script>
-  import dictMixins from '@/mixins/dictMixins';
-  import { lbjtList } from '@/enum/dict.js';
-  import { contactQueryByCategoryIdsAPI } from '@/api/saleManage/contact';
-  import timeDialog from '@/components/timeDialog/index.vue';
-  import tabMixins from '@/mixins/tableColumnsMixin';
-  import { levelList } from '@/enum/dict.js';
-  import { getInventoryTotalAPI } from '@/api/wms';
+import dictMixins from '@/mixins/dictMixins';
+import { lbjtList } from '@/enum/dict.js';
+import { contactQueryByCategoryIdsAPI } from '@/api/saleManage/contact';
+import timeDialog from '@/components/timeDialog/index.vue';
+import tabMixins from '@/mixins/tableColumnsMixin';
+import { levelList } from '@/enum/dict.js';
+import { getInventoryTotalAPI } from '@/api/wms';
 
-  const dayjs = require('dayjs');
+const dayjs = require('dayjs');
 
-  export default {
-    mixins: [dictMixins, tabMixins],
-    components: {
-      timeDialog
+export default {
+  mixins: [dictMixins, tabMixins],
+  components: {
+    timeDialog
+  },
+  props: {
+    isDiscountTotalPrice: {
+      default: false,
+      type: Boolean
     },
-    props: {
-      isDiscountTotalPrice: {
-        default: false,
-        type: Boolean
-      },
 
-      isDiscount: {
-        //折让
-        type: Boolean,
-        default: true
-      },
-      isCustomerMark: {
-        //客户代号必填
-        type: Boolean,
-        default: false
-      },
-      pageName: {
-        default: ''
-      },
-      isChangeCount: {
-        //默认计算
-        type: Boolean,
-        default: true
-      },
-      contractBookType: {
-        //合同类型 1销售 2采购
-        type: [String, Number],
-        default: 1
-      },
-      isArrivalWay: {
-        //分批到货时间
-        type: Boolean,
-        default: false
-      },
-      cacheKeyUrl: '',
-      //是否显示订单编码
-      isOrderNo: {
-        type: Boolean,
-        default: false
-      },
-      //显示库存
-      isWms: {
-        type: Boolean,
-        default: false
-      },
-      //
-      isAllPrice: {
-        type: Boolean,
-        default: true
-      },
-      maxHeight: {
-        default: 350
-      },
-      countObj: {
-        type: Object,
-        default: () => {
-          return {
-            countKey: 'saleCount',
-            unitKey: 'saleUnit',
-            unitIdKey: 'saleUnitId'
-          };
-        }
-      },
-      //是否显示生产要求
-      isProductionRequirements: {
-        type: Boolean,
-        default: false
+    isDiscount: {
+      //折让
+      type: Boolean,
+      default: true
+    },
+    isCustomerMark: {
+      //客户代号必填
+      type: Boolean,
+      default: false
+    },
+    pageName: {
+      default: ''
+    },
+    isChangeCount: {
+      //默认计算
+      type: Boolean,
+      default: true
+    },
+    contractBookType: {
+      //合同类型 1销售 2采购
+      type: [String, Number],
+      default: 1
+    },
+    isArrivalWay: {
+      //分批到货时间
+      type: Boolean,
+      default: false
+    },
+    cacheKeyUrl: '',
+    //是否显示订单编码
+    isOrderNo: {
+      type: Boolean,
+      default: false
+    },
+    //显示库存
+    isWms: {
+      type: Boolean,
+      default: false
+    },
+    //
+    isAllPrice: {
+      type: Boolean,
+      default: true
+    },
+    maxHeight: {
+      default: 350
+    },
+    countObj: {
+      type: Object,
+      default: () => {
+        return {
+          countKey: 'saleCount',
+          unitKey: 'saleUnit',
+          unitIdKey: 'saleUnitId'
+        };
       }
     },
-    data() {
-      return {
-        allPrice: 0,
-        supplierObj: [],
-        form: {
-          discountTotalPrice: 0,
-          datasource: []
-        },
-        columnsVersion: 1
+    //是否显示生产要求
+    isProductionRequirements: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      allPrice: 0,
+      supplierObj: [],
+      form: {
+        discountTotalPrice: 0,
+        datasource: []
+      },
+      columnsVersion: 1,
+      // 新增:存储data中的type值,用于控制新增字段显示
+      dataType: null
+    };
+  },
+  computed: {
+    columns() {
+      let columnsVersion = this.columnsVersion;
+      let orderColumn = {
+        width: 1,
+        show: false
       };
-    },
-    computed: {
-      columns() {
-        let columnsVersion = this.columnsVersion;
-        let orderColumn = {
-          width: 1,
-          show: false
+      let wmsColumn = {
+        width: 1,
+        show: false
+      };
+      if (this.isOrderNo) {
+        orderColumn = {
+          minWidth: 200,
+          prop: 'orderNo',
+          label: '订单编码',
+          showOverflowTooltip: true,
+          align: 'center'
         };
-        let wmsColumn = {
-          width: 1,
-          show: false
+      }
+      if (this.isWms) {
+        wmsColumn = {
+          minWidth: 160,
+          prop: 'availableCountBase',
+          label: '库存数量',
+          showOverflowTooltip: true,
+          align: 'center'
         };
-        if (this.isOrderNo) {
-          orderColumn = {
-            minWidth: 200,
-            prop: 'orderNo',
-            label: '订单编码',
-            showOverflowTooltip: true,
-            align: 'center'
-          };
+      }
+
+      // 基础列(新增字段之前的列)
+      const baseColumns = [
+        {
+          width: 45,
+          type: 'index',
+          columnKey: 'index',
+          align: 'center'
+        },
+        orderColumn,
+        {
+          width: 280,
+          prop: 'productName',
+          label: '名称',
+          slot: 'productName',
+          headerSlot: 'headerProductName',
+          align: 'center'
+        },
+        {
+          width: 120,
+          prop: 'productCode',
+          label: '编码',
+          slot: 'productCode',
+          align: 'center'
+        },
+        {
+          width: 200,
+          prop: 'productCategoryName',
+          label: '类型',
+          slot: 'productCategoryName',
+          align: 'center'
+        },
+        {
+          width: 120,
+          prop: 'specification',
+          label: '规格',
+          slot: 'specification',
+          align: 'center'
         }
-        if (this.isWms) {
-          wmsColumn = {
-            minWidth: 160,
-            prop: 'availableCountBase',
-            label: '库存数量',
-            showOverflowTooltip: true,
-            align: 'center'
-          };
+      ];
+
+      // 条件显示的新增字段列(仅当dataType为2时显示)
+      const additionalColumns = this.dataType === 2 ? [
+        // 新增字段:厚度
+        {
+          width: 150,
+          prop: 'thickNess',
+          label: '厚度',
+          slot: 'thickNess',
+          align: 'center'
+        },
+        // 新增字段:平方数
+        {
+          width: 150,
+          prop: 'squareNumber',
+          label: '平方数',
+          slot: 'squareNumber',
+          align: 'center'
+        },
+        // 新增字段:加工费(未税)
+        {
+          width: 150,
+          prop: 'processingFeeBeforeTax',
+          label: '加工费(未税)',
+          slot: 'processingFeeBeforeTax',
+          align: 'center'
+        },
+        // 新增字段:包装费(未税)
+        {
+          width: 150,
+          prop: 'packagingFeeNotTaxed',
+          label: '包装费(未税)',
+          slot: 'packagingFeeNotTaxed',
+          align: 'center'
+        },
+        // 新增字段:运输费(未税)
+        {
+          width: 150,
+          prop: 'transportationFeeWithoutTax',
+          label: '运输费(未税)',
+          slot: 'transportationFeeWithoutTax',
+          align: 'center'
+        },
+        // 新增字段:未税小计
+        {
+          width: 150,
+          prop: 'untaxedSubtotal',
+          label: '未税小计',
+          slot: 'additionalTaxRate_untaxed',
+          align: 'center'
+        },
+        // 新增字段:税率(%)
+        {
+          width: 150,
+          prop: 'additionalTaxRate',
+          label: '税率(%)',
+          slot: 'additionalTaxRate',
+          align: 'center'
+        },
+        // 新增字段:含税小计
+        {
+          width: 150,
+          prop: 'includingTaxPrice',
+          label: '含税小计',
+          slot: 'includingTaxPrice',
+          align: 'center'
         }
-        return [
-          {
-            width: 45,
-            type: 'index',
-            columnKey: 'index',
-            align: 'center'
-          },
-          orderColumn,
-          {
-            width: 280,
-            prop: 'productName',
-            label: '名称',
-            slot: 'productName',
-            headerSlot: 'headerProductName',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'productCode',
-            label: '编码',
-            slot: 'productCode',
-            align: 'center'
-          },
-          {
-            width: 200,
-            prop: 'productCategoryName',
-            label: '类型',
-            slot: 'productCategoryName',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'specification',
-            label: '规格',
-            slot: 'specification',
-            align: 'center'
-          },
-          // 新增字段:厚度
-          {
-            width: 150,
-            prop: 'thickNess',
-            label: '厚度',
-            slot: 'thickNess',
-            align: 'center'
-          },
-          // 新增字段:平方数
-          {
-            width: 150,
-            prop: 'squareNumber',
-            label: '平方数',
-            slot: 'squareNumber',
-            align: 'center'
-          },
-          // 新增字段:加工费(未税)
-          {
-            width: 150,
-            prop: 'processingFeeBeforeTax',
-            label: '加工费(未税)',
-            slot: 'processingFeeBeforeTax',
-            align: 'center'
-          },
-          // 新增字段:包装费(未税)
-          {
-            width: 150,
-            prop: 'packagingFeeNotTaxed',
-            label: '包装费(未税)',
-            slot: 'packagingFeeNotTaxed',
-            align: 'center'
-          },
-          // 新增字段:运输费(未税)
-          {
-            width: 150,
-            prop: 'transportationFeeWithoutTax',
-            label: '运输费(未税)',
-            slot: 'transportationFeeWithoutTax',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'quotationSubtotalBeforeTax',
-            label: '报价小计(未税)',
-            slot: 'quotationSubtotalBeforeTax',
-            align: 'center'
-          },
-          {
-            width: 200,
-            prop: 'customerMark',
-            label: this.contractBookType == 1 ? '客户代号' : '供应商代号',
-            slot: 'customerMark',
-            headerSlot: 'headerCustomerMark',
-            align: 'center'
-          },
-          {
-            minWidth: 240,
-            prop: 'taskName',
-            label: '工序',
-            slot: 'taskName',
-            align: 'center'
-          },
-          {
-            minWidth: 160,
-            prop: 'productionCodes',
-            label: '生产编号',
-            align: 'center'
-          },
-          this.isProductionRequirements
-            ? {
-                minWidth: 280,
-                prop: 'productionRequirements',
-                label: '生产要求',
-                align: 'center'
-              }
-            : {
-                width: 1
-              },
-          this.isCustomerMark
-            ? {
-                minWidth: 120,
-                prop: 'entrustedEnterpriseId',
-                label: '受托企业',
-                slot: 'entrustedEnterpriseId',
-                show: this.isCustomerMark,
-                align: 'center',
-                showOverflowTooltip: true,
-                formatter: (row, column) => {
-                  return (
-                    this.supplierObj[row.productId]?.find(
-                      (item) => item.id === row.entrustedEnterpriseId
-                    )?.name || ''
-                  );
-                }
-              }
-            : {
-                width: 1
-              },
-          {
-            width: 180,
-            prop: 'saleCount',
-            label: '数量',
-            slot: 'saleCount',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          // {
-          //   width: 150,
-          //   prop: 'saleUnit',
-          //   label: '单位',
-          //   slot: 'saleUnit',
-          //   headerSlot: 'headerTotalCount',
-          //   align: 'center'
-          // },
-          {
-            width: 120,
-            prop: 'packingSpecification',
-            align: 'center',
-            label: '包装规格',
-            showOverflowTooltip: true
-          },
-          {
-            width: 150,
-            prop: 'totalCount',
-            label: '计量数量',
-            slot: 'totalCount',
-            headerSlot: 'headerTotalCount',
-            formatter: (row, column) => {
-              if (row.totalCount) {
-                return row.totalCount + ' ' + row.measuringUnit;
+      ] : [];
+
+      // 剩余列(新增字段之后的列)
+      const remainingColumns = [
+        {
+          width: 200,
+          prop: 'customerMark',
+          label: this.contractBookType == 1 ? '客户代号' : '供应商代号',
+          slot: 'customerMark',
+          headerSlot: 'headerCustomerMark',
+          align: 'center'
+        },
+        {
+          minWidth: 240,
+          prop: 'taskName',
+          label: '工序',
+          slot: 'taskName',
+          align: 'center'
+        },
+        {
+          minWidth: 160,
+          prop: 'productionCodes',
+          label: '生产编号',
+          align: 'center'
+        },
+        this.isProductionRequirements
+          ? {
+              minWidth: 280,
+              prop: 'productionRequirements',
+              label: '生产要求',
+              align: 'center'
+            }
+          : {
+              width: 1
+            },
+        this.isCustomerMark
+          ? {
+              minWidth: 120,
+              prop: 'entrustedEnterpriseId',
+              label: '受托企业',
+              slot: 'entrustedEnterpriseId',
+              show: this.isCustomerMark,
+              align: 'center',
+              showOverflowTooltip: true,
+              formatter: (row, column) => {
+                return (
+                  this.supplierObj[row.productId]?.find(
+                    (item) => item.id === row.entrustedEnterpriseId
+                  )?.name || ''
+                );
               }
+            }
+          : {
+              width: 1
             },
-            align: 'center'
+        {
+          width: 180,
+          prop: 'saleCount',
+          label: '数量',
+          slot: 'saleCount',
+          headerSlot: 'headerTotalCount',
+          align: 'center'
+        },
+        {
+          width: 120,
+          prop: 'packingSpecification',
+          align: 'center',
+          label: '包装规格',
+          showOverflowTooltip: true
+        },
+        {
+          width: 150,
+          prop: 'totalCount',
+          label: '计量数量',
+          slot: 'totalCount',
+          headerSlot: 'headerTotalCount',
+          formatter: (row, column) => {
+            if (row.totalCount) {
+              return row.totalCount + ' ' + row.measuringUnit;
+            }
           },
-          // {
-          //   width: 120,
-          //   prop: 'measuringUnit',
-          //   label: '计量单位',
-          //   slot: 'measuringUnit',
-          //   align: 'center'
-          // },
-          wmsColumn,
-          this.pageName == 'send'
-            ? {
-                minWidth: 140,
-                prop: 'sendTotalCount',
-                label: '已发货数量',
-                slot: 'sendTotalCount',
-                align: 'center',
-                formatter: (row, column) => {
-                  if (row.sendTotalCount) {
-                    return row.sendTotalCount + ' ' + row.measuringUnit;
-                  }
-                }
-              }
-            : {
-                width: 1
-              },
-          this.pageName == 'send'
-            ? {
-                minWidth: 140,
-                prop: 'notSendTotalCount',
-                label: '未发货数量',
-                slot: 'notSendTotalCount',
-                align: 'center',
-                formatter: (row, column) => {
-                  if (row.notSendTotalCount) {
-                    return row.notSendTotalCount + ' ' + row.measuringUnit;
-                  }
+          align: 'center'
+        },
+        wmsColumn,
+        this.pageName == 'send'
+          ? {
+              minWidth: 140,
+              prop: 'sendTotalCount',
+              label: '已发货数量',
+              slot: 'sendTotalCount',
+              align: 'center',
+              formatter: (row, column) => {
+                if (row.sendTotalCount) {
+                  return row.sendTotalCount + ' ' + row.measuringUnit;
                 }
               }
-            : {
-                width: 1
-              },
-
-          {
-            width: 140,
-            prop: 'singleWeight',
-            label: '单重',
-            slot: 'singleWeight',
-            headerSlot: 'headerSingleWeight',
-            formatter: (row, column) => {
-              if (row.singleWeight) {
-                return row.singleWeight + ' ' + row.weightUnit;
-              }
+            }
+          : {
+              width: 1
             },
-            align: 'center'
-          },
-          {
-            width: 140,
-            prop: 'totalWeight',
-            label: '总重',
-            slot: 'totalWeight',
-            formatter: (row, column) => {
-              if (row.totalWeight) {
-                return row.totalWeight + ' ' + row.weightUnit;
+        this.pageName == 'send'
+          ? {
+              minWidth: 140,
+              prop: 'notSendTotalCount',
+              label: '未发货数量',
+              slot: 'notSendTotalCount',
+              align: 'center',
+              formatter: (row, column) => {
+                if (row.notSendTotalCount) {
+                  return row.notSendTotalCount + ' ' + row.measuringUnit;
+                }
               }
+            }
+          : {
+              width: 1
             },
-            align: 'center'
-          },
-          // {
-          //   width: 120,
-          //   prop: 'weightUnit',
-          //   label: '重量单位',
-          //   slot: 'weightUnit',
-          //   align: 'center'
-          // },
 
-          {
-            width: 160,
-            prop: 'goodsPriceType',
-            label: '价格类型',
-            formatter: (row, column) => {
-              return this.getDictValue('商品价格类型', row.goodsPriceType);
-            },
-            align: 'center'
+        {
+          width: 140,
+          prop: 'singleWeight',
+          label: '单重',
+          slot: 'singleWeight',
+          headerSlot: 'headerSingleWeight',
+          formatter: (row, column) => {
+            if (row.singleWeight) {
+              return row.singleWeight + ' ' + row.weightUnit;
+            }
           },
-          {
-            width: 200,
-            prop: 'singlePrice',
-            label: '单价',
-            slot: 'singlePrice',
-            headerSlot: 'headerSinglePrice',
-            align: 'center'
+          align: 'center'
+        },
+        {
+          width: 140,
+          prop: 'totalWeight',
+          label: '总重',
+          slot: 'totalWeight',
+          formatter: (row, column) => {
+            if (row.totalWeight) {
+              return row.totalWeight + ' ' + row.weightUnit;
+            }
           },
+          align: 'center'
+        },
 
-          {
-            width: 160,
-            prop: 'taxRate',
-            label: '税率',
-            formatter: (_row, _column, cellValue) => {
-              return _row.taxRate ? _row.taxRate + '%' : '';
-            },
-            align: 'center'
+        {
+          width: 160,
+          prop: 'goodsPriceType',
+          label: '价格类型',
+          formatter: (row, column) => {
+            return this.getDictValue('商品价格类型', row.goodsPriceType);
           },
-          {
-            width: 150,
-            prop: 'notaxSinglePrice',
-            label: '不含税单价',
-            slot: 'notaxSinglePrice',
-            align: 'center'
+          align: 'center'
+        },
+        {
+          width: 200,
+          prop: 'singlePrice',
+          label: '单价',
+          slot: 'singlePrice',
+          headerSlot: 'headerSinglePrice',
+          align: 'center'
+        },
+
+        {
+          width: 160,
+          prop: 'taxRate',
+          label: '税率',
+          formatter: (_row, _column, cellValue) => {
+            return _row.taxRate ? _row.taxRate + '%' : '';
           },
-          this.isDiscount
-            ? {
-                width: 160,
-                prop: 'discountSinglePrice',
-                label: '折让单价',
-                align: 'center',
-                show: this.isDiscount,
-                formatter: (_row, _column, cellValue) => {
-                  return _row.discountSinglePrice
-                    ? Number(_row.discountSinglePrice).toFixed(2)
-                    : '';
-                }
+          align: 'center'
+        },
+        {
+          width: 150,
+          prop: 'notaxSinglePrice',
+          label: '不含税单价',
+          slot: 'notaxSinglePrice',
+          align: 'center'
+        },
+        this.isDiscount
+          ? {
+              width: 160,
+              prop: 'discountSinglePrice',
+              label: '折让单价',
+              align: 'center',
+              show: this.isDiscount,
+              formatter: (_row, _column, cellValue) => {
+                return _row.discountSinglePrice
+                  ? Number(_row.discountSinglePrice).toFixed(2)
+                  : '';
               }
-            : {
-                width: 1
-              },
-          {
-            width: 120,
-            prop: 'totalPrice',
-            label: '合计',
-            slot: 'totalPrice',
-            align: 'center'
-          },
-          this.isDiscount
-            ? {
-                width: 160,
-                prop: 'discountTotalPrice',
-                label: '折让合计',
-                align: 'center',
-                show: this.isDiscount,
-                formatter: (_row, _column, cellValue) => {
-                  return _row.discountTotalPrice
-                    ? Number(_row.discountTotalPrice).toFixed(2)
-                    : '';
-                }
+            }
+          : {
+              width: 1
+            },
+        {
+          width: 120,
+          prop: 'totalPrice',
+          label: '合计',
+          slot: 'totalPrice',
+          align: 'center'
+        },
+        this.isDiscount
+          ? {
+              width: 160,
+              prop: 'discountTotalPrice',
+              label: '折让合计',
+              align: 'center',
+              show: this.isDiscount,
+              formatter: (_row, _column, cellValue) => {
+                return _row.discountTotalPrice
+                  ? Number(_row.discountTotalPrice).toFixed(2)
+                  : '';
               }
-            : {
-                width: 1
-              },
-          {
-            minWidth: 120,
-            prop: 'goodsLevel',
-            label: '物品级别',
-            formatter: (_row, _column, cellValue) => {
-              return levelList.find((item) => item.value == _row.goodsLevel)
-                ?.label;
+            }
+          : {
+              width: 1
             },
-            align: 'center'
-          },
-          {
-            width: 110,
-            prop: 'batchNo',
-            label: '批次号',
-            slot: 'batchNo',
-            align: 'center'
+        {
+          minWidth: 120,
+          prop: 'goodsLevel',
+          label: '物品级别',
+          formatter: (_row, _column, cellValue) => {
+            return levelList.find((item) => item.value == _row.goodsLevel)
+              ?.label;
           },
-          {
-            width: 160,
-            prop: 'productBrand',
-            label: '牌号',
-            slot: 'productBrand',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'modelType',
-            label: '型号',
-            slot: 'modelType',
-            align: 'center'
-          },
-          {
-            minWidth: 120,
-            prop: 'modelKey',
-            label: '机型',
-            slot: 'modelKey',
-            showOverflowTooltip: true,
-            align: 'center'
-          },
-          {
-            minWidth: 120,
-            prop: 'colorKey',
-            slot: 'colorKey',
-            showOverflowTooltip: true,
-            label: '颜色',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'imgCode',
-            align: 'center',
-            label: '图号/件号',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'provenance',
-            label: '产地',
-            slot: 'provenance',
-            align: 'center',
-            minWidth: 200,
-            showOverflowTooltip: true,
-            formatter: (row, column) => {
-              return row.provenance && row.provenance.length
-                ? row.provenance
-                    .map((item) => this.getDictValue('产地', item))
-                    .join(',')
-                : '';
+          align: 'center'
+        },
+        {
+          width: 110,
+          prop: 'batchNo',
+          label: '批次号',
+          slot: 'batchNo',
+          align: 'center'
+        },
+        {
+          width: 160,
+          prop: 'productBrand',
+          label: '牌号',
+          slot: 'productBrand',
+          align: 'center'
+        },
+        {
+          width: 120,
+          prop: 'modelType',
+          label: '型号',
+          slot: 'modelType',
+          align: 'center'
+        },
+        {
+          minWidth: 120,
+          prop: 'modelKey',
+          label: '机型',
+          slot: 'modelKey',
+          showOverflowTooltip: true,
+          align: 'center'
+        },
+        {
+          minWidth: 120,
+          prop: 'colorKey',
+          slot: 'colorKey',
+          showOverflowTooltip: true,
+          label: '颜色',
+          align: 'center'
+        },
+        {
+          width: 120,
+          prop: 'imgCode',
+          align: 'center',
+          label: '图号/件号',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'provenance',
+          label: '产地',
+          slot: 'provenance',
+          align: 'center',
+          minWidth: 200,
+          showOverflowTooltip: true,
+          formatter: (row, column) => {
+            return row.provenance && row.provenance.length
+              ? row.provenance
+                  .map((item) => this.getDictValue('产地', item))
+                  .join(',')
+              : '';
+          }
+        },
+        {
+          width: 120,
+          prop: 'produceType',
+          align: 'center',
+          label: '属性类型',
+          showOverflowTooltip: true,
+          formatter: (row, column) => {
+            if (row.produceType) {
+              return row.produceType
+                .map((item) => {
+                  return lbjtList[item];
+                })
+                .toString();
             }
-          },
-          {
-            width: 120,
-            prop: 'produceType',
-            align: 'center',
-            label: '属性类型',
-            showOverflowTooltip: true,
-            formatter: (row, column) => {
-              if (row.produceType) {
-                return row.produceType
-                  .map((item) => {
-                    return lbjtList[item];
-                  })
-                  .toString();
+          }
+        },
+        this.isArrivalWay
+          ? {
+              width: 160,
+              prop: 'arrivalWay',
+              label: '到货方式',
+              align: 'center',
+              formatter: (_row, _column, cellValue) => {
+                return _row.arrivalWay == 1
+                  ? '一次性到货'
+                  : _row.arrivalWay == 2
+                  ? '分批到货'
+                  : '';
               }
             }
-          },
-          this.isArrivalWay
-            ? {
-                width: 160,
-                prop: 'arrivalWay',
-                label: '到货方式',
-                align: 'center',
-                formatter: (_row, _column, cellValue) => {
-                  return _row.arrivalWay == 1
-                    ? '一次性到货'
-                    : _row.arrivalWay == 2
-                    ? '分批到货'
-                    : '';
-                }
-              }
-            : {
-                width: 1
-              },
-          {
-            width: 160,
-            prop: 'customerExpectDeliveryDeadline',
-            label: this.contractBookType == 1 ? '客户期望交期' : '交付日期',
-            slot: 'customerExpectDeliveryDeadline',
-            align: 'center'
-          },
-          this.contractBookType == 1
-            ? {
-                width: 160,
-                prop: 'produceDeliveryDeadline',
-                label: '生产交付交期',
-                slot: 'produceDeliveryDeadline',
-                headerSlot: 'headerProduceDeliveryDeadline',
-                align: 'center'
-              }
-            : {
-                width: 1
-              },
-
-          {
-            width: 200,
-            prop: 'guaranteePeriod',
-            label: '有效期',
-            slot: 'guaranteePeriod',
-            align: 'center',
-            formatter: (_row, _column, cellValue) => {
-              return (
-                (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
-              );
+          : {
+              width: 1
+            },
+        {
+          width: 160,
+          prop: 'customerExpectDeliveryDeadline',
+          label: this.contractBookType == 1 ? '客户期望交期' : '交付日期',
+          slot: 'customerExpectDeliveryDeadline',
+          align: 'center'
+        },
+        this.contractBookType == 1
+          ? {
+              width: 160,
+              prop: 'produceDeliveryDeadline',
+              label: '生产交付交期',
+              slot: 'produceDeliveryDeadline',
+              headerSlot: 'headerProduceDeliveryDeadline',
+              align: 'center'
             }
-          },
-          {
-            width: 200,
-            prop: 'guaranteePeriodDeadline',
-            label: '有效期截止日期',
-            slot: 'guaranteePeriodDeadline',
-            align: 'center'
-          },
+          : {
+              width: 1
+            },
 
-          {
-            width: 220,
-            prop: 'customerReqFiles',
-            label: '客户需求',
-            slot: 'customerReqFiles',
-            align: 'center'
-          },
-          {
-            width: 100,
-            prop: 'density',
-            label: '密度',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'productType',
-            label: '生产加工方式',
-            align: 'center',
-            formatter: (_row, _column, cellValue) => {
-              return _row.productType == 2
-                ? '加工'
-                : _row.productType == 3
-                ? '装配'
-                : '';
-            }
-          },
-          {
-            width: 130,
-            prop: 'technicalAnswerName',
-            label: '技术答疑人',
-            slot: 'technicalAnswerName',
-            align: 'center'
-          },
-          {
-            width: 220,
-            prop: 'technicalParams',
-            label: '技术参数',
-            slot: 'technicalParams',
-            align: 'center'
-          },
-          {
-            width: 240,
-            prop: 'technicalDrawings',
-            label: '技术图纸',
-            slot: 'technicalDrawings',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'drawingVersion',
-            label: '图纸版本',
-            align: 'center'
-          },
-          {
-            width: 240,
-            prop: 'technologyRouteName',
-            label: '工艺路线',
-            slot: 'technologyRouteName',
-            align: 'center'
-          },
-          {
-            width: 240,
-            prop: 'industryArtFiles',
-            label: '工艺附件',
-            slot: 'industryArtFiles',
-            align: 'center'
-          },
-          {
-            width: 240,
-            prop: 'otherFiles',
-            label: '其他附件',
-            slot: 'otherFiles',
-            align: 'center'
-          },
-          {
-            width: 220,
-            prop: 'remark',
-            label: '备注',
-            slot: 'remark',
-            align: 'center'
+        {
+          width: 200,
+          prop: 'guaranteePeriod',
+          label: '有效期',
+          slot: 'guaranteePeriod',
+          align: 'center',
+          formatter: (_row, _column, cellValue) => {
+            return (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName;
           }
-        ];
-      }
-    },
+        },
+        {
+          width: 200,
+          prop: 'guaranteePeriodDeadline',
+          label: '有效期截止日期',
+          slot: 'guaranteePeriodDeadline',
+          align: 'center'
+        },
 
-    created() {
-      this.requestDict('产地');
-      this.requestDict('商品价格类型');
-    },
-    methods: {
-      async getSupplierObj(productList, queryName) {
-        try {
-          let categoryIds = productList
-            .filter((item) => item[queryName])
-            .map((item) => item[queryName]);
-          return await contactQueryByCategoryIdsAPI({
-            categoryIds,
-            isQueryEE: 1
-          });
-        } catch (e) {
-          return Promise.resolve({});
+        {
+          width: 220,
+          prop: 'customerReqFiles',
+          label: '客户需求',
+          slot: 'customerReqFiles',
+          align: 'center'
+        },
+        {
+          width: 100,
+          prop: 'density',
+          label: '密度',
+          align: 'center'
+        },
+        {
+          width: 150,
+          prop: 'productType',
+          label: '生产加工方式',
+          align: 'center',
+          formatter: (_row, _column, cellValue) => {
+            return _row.productType == 2
+              ? '加工'
+              : _row.productType == 3
+              ? '装配'
+              : '';
+          }
+        },
+        {
+          width: 130,
+          prop: 'technicalAnswerName',
+          label: '技术答疑人',
+          slot: 'technicalAnswerName',
+          align: 'center'
+        },
+        {
+          width: 220,
+          prop: 'technicalParams',
+          label: '技术参数',
+          slot: 'technicalParams',
+          align: 'center'
+        },
+        {
+          width: 240,
+          prop: 'technicalDrawings',
+          label: '技术图纸',
+          slot: 'technicalDrawings',
+          align: 'center'
+        },
+        {
+          width: 120,
+          prop: 'drawingVersion',
+          label: '图纸版本',
+          align: 'center'
+        },
+        {
+          width: 240,
+          prop: 'technologyRouteName',
+          label: '工艺路线',
+          slot: 'technologyRouteName',
+          align: 'center'
+        },
+        {
+          width: 240,
+          prop: 'industryArtFiles',
+          label: '工艺附件',
+          slot: 'industryArtFiles',
+          align: 'center'
+        },
+        {
+          width: 240,
+          prop: 'otherFiles',
+          label: '其他附件',
+          slot: 'otherFiles',
+          align: 'center'
+        },
+        {
+          width: 220,
+          prop: 'remark',
+          label: '备注',
+          slot: 'remark',
+          align: 'center'
         }
-      },
+      ];
 
-      // 返回列表数据
-      getTableValue() {
-        let comitDatasource = this.form.datasource;
-        if (comitDatasource.length === 0) return [];
-        comitDatasource.forEach((v) => {
-          if (v.guaranteePeriodUnitCode) {
-            v.guaranteePeriodUnitName = this.getDictValue(
-              '保质期单位',
-              v.guaranteePeriodUnitCode
-            );
-          }
-          v.technicalDrawings = v.technicalDrawings ? v.technicalDrawings : [];
-          v.customerReqFiles = v.customerReqFiles || [];
-          v.industryArtFiles = v.industryArtFiles || [];
-          v.otherFiles = v.otherFiles || [];
-          // 处理新增字段
-          v.thickNess = v.thickNess || '';
-          v.squareNumber = v.squareNumber || '';
-          v.processingFeeBeforeTax = v.processingFeeBeforeTax || '';
-          v.packagingFeeNotTaxed = v.packagingFeeNotTaxed || '';
-          v.transportationFeeWithoutTax = v.transportationFeeWithoutTax || '';
+      // 合并所有列
+      return [...baseColumns, ...additionalColumns, ...remainingColumns];
+    }
+  },
+
+  created() {
+    this.requestDict('产地');
+    this.requestDict('商品价格类型');
+  },
+  methods: {
+    async getSupplierObj(productList, queryName) {
+      try {
+        let categoryIds = productList
+          .filter((item) => item[queryName])
+          .map((item) => item[queryName]);
+        return await contactQueryByCategoryIdsAPI({
+          categoryIds,
+          isQueryEE: 1
         });
-        return comitDatasource;
-      },
-      handleMethod(row) {
-        this.$refs.timeDialogRef.open(row);
-      },
-      setDeliveryDays() {
-        console.log(this.form.datasource, 'this.form.datasource');
-        this.form.datasource.forEach((item, i) => {
-          let guaranteePeriodUnitName = this.guaranteePeriodUnit(
-            item.guaranteePeriodUnitCode
-          );
+      } catch (e) {
+        return Promise.resolve({});
+      }
+    },
 
-          this.$set(
-            this.form.datasource[i],
-            'guaranteePeriodDeadline',
-            guaranteePeriodUnitName != 'second'
-              ? this.setDay(item.guaranteePeriod, guaranteePeriodUnitName)
-              : ''
+    // 返回列表数据
+    getTableValue() {
+      let comitDatasource = this.form.datasource;
+      if (comitDatasource.length === 0) return [];
+      comitDatasource.forEach((v) => {
+        if (v.guaranteePeriodUnitCode) {
+          v.guaranteePeriodUnitName = this.getDictValue(
+            '保质期单位',
+            v.guaranteePeriodUnitCode
           );
-        });
-      },
-      guaranteePeriodUnit(code) {
-        return code == 3
-          ? 'day'
-          : code == 4
-          ? 'month'
-          : code == 5
-          ? 'year'
-          : 'second';
-      },
-      setDay(addDay, dateType = 'day') {
-        console.log(addDay);
-        return dayjs(this.contractStartDate || new Date())
-          .add(addDay, dateType)
-          .format('YYYY-MM-DD');
-      },
-      //修改回显
-      async putTableValue(data) {
-        console.log(data, 'data');
-        let productList =
-          (data &&
-            (data.redressProductList ||
-              data.quoteProductList ||
-              data.productList ||
-              data.detailList)) ||
-          [];
-        if (productList) {
-          // 处理新增字段
-          productList.forEach((item) => {
-            item.thickNess = item.thickNess || '';
-            item.squareNumber = item.squareNumber || '';
-            item.processingFeeBeforeTax = item.processingFeeBeforeTax || '';
-            item.packagingFeeNotTaxed = item.packagingFeeNotTaxed || '';
-            item.transportationFeeWithoutTax =
-              item.transportationFeeWithoutTax || '';
+        }
+        v.technicalDrawings = v.technicalDrawings ? v.technicalDrawings : [];
+        v.customerReqFiles = v.customerReqFiles || [];
+        v.industryArtFiles = v.industryArtFiles || [];
+        v.otherFiles = v.otherFiles || [];
+        // 处理新增字段
+        v.thickNess = v.thickNess || '';
+        v.squareNumber = v.squareNumber || '';
+        v.processingFeeBeforeTax = v.processingFeeBeforeTax || '';
+        v.packagingFeeNotTaxed = v.packagingFeeNotTaxed || '';
+        v.transportationFeeWithoutTax = v.transportationFeeWithoutTax || '';
+        v.untaxedSubtotal = v.untaxedSubtotal || '';
+        v.additionalTaxRate = v.additionalTaxRate || '';
+        v.includingTaxPrice = v.includingTaxPrice || '';
+      });
+      return comitDatasource;
+    },
+    handleMethod(row) {
+      this.$refs.timeDialogDialogRef.open(row);
+    },
+    setDeliveryDays() {
+      console.log(this.form.datasource, 'this.form.datasource');
+      this.form.datasource.forEach((item, i) => {
+        let guaranteePeriodUnitName = this.guaranteePeriodUnit(
+          item.guaranteePeriodUnitCode
+        );
 
-            // 处理机型/颜色
-            if (item.modelKey && typeof item.modelKey === 'string') {
-              item.modelKey = item.modelKey.split(',');
-            }
-            if (item.colorKey && typeof item.colorKey === 'string') {
-              item.colorKey = item.colorKey.split(',');
-            }
-          });
+        this.$set(
+          this.form.datasource[i],
+          'guaranteePeriodDeadline',
+          guaranteePeriodUnitName != 'second'
+            ? this.setDay(item.guaranteePeriod, guaranteePeriodUnitName)
+            : ''
+        );
+      });
+    },
+    guaranteePeriodUnit(code) {
+      return code == 3
+        ? 'day'
+        : code == 4
+        ? 'month'
+        : code == 5
+        ? 'year'
+        : 'second';
+    },
+    setDay(addDay, dateType = 'day') {
+      console.log(addDay);
+      return dayjs(this.contractStartDate || new Date())
+        .add(addDay, dateType)
+        .format('YYYY-MM-DD');
+    },
+    //修改回显
+    async putTableValue(data) {
+      console.log(data, 'data');
+      // 存储data中的type值,用于控制新增字段显示
+      this.dataType = data.type;
+      
+      let productList =
+        (data &&
+          (data.redressProductList ||
+            data.quoteProductList ||
+            data.productList ||
+            data.detailList)) ||
+        [];
+      if (productList) {
+        productList.forEach((item) => {
+          item.thickNess = item.thickNess || '';
+          item.squareNumber = item.squareNumber || '';
+          item.processingFeeBeforeTax = item.processingFeeBeforeTax || '';
+          item.packagingFeeNotTaxed = item.packagingFeeNotTaxed || '';
+          item.transportationFeeWithoutTax =
+            item.transportationFeeWithoutTax || '';
+          item.untaxedSubtotal = item.untaxedSubtotal || '';
+          item.additionalTaxRate = item.additionalTaxRate || '';
+          item.includingTaxPrice = item.includingTaxPrice || '';
 
-          this.form.datasource = productList;
-          this.allPrice =
-            data.totalAmount || data.totalPrice || data?.contractVO?.totalPrice;
-          if (this.isDiscountTotalPrice) {
-            this.form.discountTotalPrice =
-              data.payAmount ||
-              data.discountTotalPrice ||
-              data?.contractVO?.discountTotalPrice;
+          // 处理机型/颜色
+          if (item.modelKey && typeof item.modelKey === 'string') {
+            item.modelKey = item.modelKey.split(',');
           }
-          if (this.isWms) {
-            let codeList = this.form.datasource
-              .filter((item) => item.productCode)
-              .map((item) => item.productCode);
-            //获取仓库库存
-            let inventoryTotalList = await getInventoryTotalAPI(codeList);
-            this.form.datasource
-              .filter((item) => item.productCode)
-              .forEach((item, index) => {
-                let find =
-                  inventoryTotalList.find(
-                    (key) => key.code == item.productCode
-                  ) || {};
-                this.form.datasource;
-                this.$set(
-                  this.form.datasource[index],
-                  'availableCountBase',
-                  find.availableCountBase
-                );
-              });
+          if (item.colorKey && typeof item.colorKey === 'string') {
+            item.colorKey = item.colorKey.split(',');
           }
+        });
 
-          this.supplierObj = await this.getSupplierObj(
-            productList,
-            'productId'
-          );
-          this.$refs.table && this.$refs.table.reload();
+        this.form.datasource = productList;
+        this.allPrice =
+          data.totalAmount || data.totalPrice || data?.contractVO?.totalPrice;
+        if (this.isDiscountTotalPrice) {
+          this.form.discountTotalPrice =
+            data.payAmount ||
+            data.discountTotalPrice ||
+            data?.contractVO?.discountTotalPrice;
         }
+        if (this.isWms) {
+          let codeList = this.form.datasource
+            .filter((item) => item.productCode)
+            .map((item) => item.productCode);
+          //获取仓库库存
+          let inventoryTotalList = await getInventoryTotalAPI(codeList);
+          this.form.datasource
+            .filter((item) => item.productCode)
+            .forEach((item, index) => {
+              let find =
+                inventoryTotalList.find(
+                  (key) => key.code == item.productCode
+                ) || {};
+              this.form.datasource;
+              this.$set(
+                this.form.datasource[index],
+                'availableCountBase',
+                find.availableCountBase
+              );
+            });
+        }
+
+        this.supplierObj = await this.getSupplierObj(productList, 'productId');
+        this.$refs.table && this.$refs.table.reload();
       }
     }
-  };
+  }
+};
 </script>
 <style lang="scss" scoped>
-  .headbox {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
+.headbox {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
 
-    .amount {
-      font-size: 14px;
-      font-weight: bold;
-      padding-right: 30px;
-    }
+  .amount {
+    font-size: 14px;
+    font-weight: bold;
+    padding-right: 30px;
   }
+}
 
-  .time-form .el-form-item {
-    margin-bottom: 0 !important;
-  }
+.time-form .el-form-item {
+  margin-bottom: 0 !important;
+}
 
-  ::v-deep .period {
-    display: flex;
+::v-deep .period {
+  display: flex;
 
-    .borderleftnone {
-      .el-input--medium .el-input__inner {
-        border-top-right-radius: 0;
-        border-bottom-right-radius: 0;
-      }
+  .borderleftnone {
+    .el-input--medium .el-input__inner {
+      border-top-right-radius: 0;
+      border-bottom-right-radius: 0;
     }
+  }
 
-    .borderrightnone {
-      .el-input--medium .el-input__inner {
-        border-top-left-radius: 0;
-        border-bottom-left-radius: 0;
-      }
+  .borderrightnone {
+    .el-input--medium .el-input__inner {
+      border-top-left-radius: 0;
+      border-bottom-left-radius: 0;
     }
   }
+}
 
-  ::v-deep .time-form tbody > tr:hover > td {
-    background-color: transparent !important;
-  }
+::v-deep .time-form tbody > tr:hover > td {
+  background-color: transparent !important;
+}
 
-  ::v-deep .time-form .el-table tr {
-    background-color: #ffffff;
-  }
+::v-deep .time-form .el-table tr {
+  background-color: #ffffff;
+}
 
-  .pricebox {
-    display: flex;
-    justify-content: flex-start;
-    align-items: center;
-    font-weight: bold;
-  }
-</style>
+.pricebox {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  font-weight: bold;
+}
+</style>

+ 43 - 28
src/BIZComponents/setProduct.js

@@ -2,50 +2,64 @@ import Vue from 'vue';
 import _ from 'lodash';
 
 //改变数量
-export function changeCount(row, countObj, noDiscountSingle) {
-  console.log('改变数量~~~~', row, countObj, noDiscountSingle);
+export function changeCount(row, countObj, noDiscountSingle, quoteType) {
   let total = row[countObj.countKey] || 0;
-  let data = row;
+  let data = { ...row };
+
+  // 计算总数量(包装规格转换)
   if (row.packageDispositionList) {
     let endIndex = row.packageDispositionList.findIndex(
       (ite) => row[countObj.unitIdKey] == ite.id
     );
-    for (; 0 < endIndex; endIndex--) {
-      total = Vue.prototype.$math.format(
-        row.packageDispositionList[endIndex].packageCell * total,
-        14
+    // 修正包装规格转换逻辑(确保层级相乘正确)
+    for (let i = 1; i <= endIndex; i++) {
+      // 从1开始,避免重复计算
+      total = Vue.prototype.$math.multiply(
+        row.packageDispositionList[i].packageCell,
+        total
       );
     }
   }
+  data['totalCount'] = total; // 转换后的总数量
 
-  data['totalCount'] = total;
-  data['discountSinglePrice'] = !noDiscountSingle
-    ? data.singlePrice
-    : data.discountSinglePrice;
-
+  // 计算重量(通用逻辑)
   setWeight(data);
-  if (row[countObj.countKey] && row.singlePrice) {
-    data['totalPrice'] = row[countObj.countKey] * row.singlePrice;
-    data['discountTotalPrice'] = !noDiscountSingle
-      ? data.totalPrice
-      : data.discountTotalPrice;
-  } else {
-    data['totalPrice'] = 0;
-    data['discountTotalPrice'] = 0;
+
+  // 仅非生产加工类型(quoteType≠2)执行基于singlePrice的计算
+  if (quoteType !== 2) {
+    data['discountSinglePrice'] = !noDiscountSingle
+      ? data.singlePrice
+      : data.discountSinglePrice;
+
+    // 关键修复:用转换后的totalCount计算总价,而非原始数量
+    if (data.totalCount && data.singlePrice) {
+      const count = Number(data.totalCount) || 0; // 使用转换后的总数量
+      const price = Number(data.singlePrice) || 0;
+      data['totalPrice'] = Vue.prototype.$math.round(
+        Vue.prototype.$math.multiply(count, price),
+        2
+      );
+      data['discountTotalPrice'] = !noDiscountSingle
+        ? data.totalPrice
+        : Vue.prototype.$math.round(Number(data.discountTotalPrice) || 0, 2);
+    } else {
+      data['totalPrice'] = 0;
+      data['discountTotalPrice'] = 0;
+    }
   }
-  // getNotaxSinglePrice(data);
+
   return data;
-  // if (row) {
-  //   singleWeightChange(row, index);
-  // }
-  // return getNumTotalPrice(arr, noDiscountSingle);
 }
 function setWeight(row) {
   if (row.weightUnit == row.measuringUnit) {
     row['totalWeight'] = row.totalCount;
   } else if (row.totalCount && row.singleWeight) {
     // 使用lodash的round函数保留4位小数并向上舍入
-    row['totalWeight'] = _.round(row.totalCount * row.singleWeight, 4, Math.ceil);
+    row['totalWeight'] = _.round(
+      row.totalCount * row.singleWeight,
+      4,
+      Math.ceil
+    );
   } else {
     row['totalWeight'] = 0;
   }
@@ -54,10 +68,11 @@ export function getAllPrice(arr) {
   let sum = 0;
   arr.forEach((item) => {
     if (item.totalPrice) {
-      sum += Number(item.totalPrice);
+      // 使用加法并保持精度
+      sum = Vue.prototype.$math.add(sum, Number(item.totalPrice) || 0);
     }
   });
-  return isNaN(sum) ? 0 : sum.toFixed(2);
+  return Vue.prototype.$math.round(sum, 2);
 }
 // //计算不含税单价
 // function getNotaxSinglePrice(row) {

+ 13 - 0
src/views/saleManage/quotation/index.vue

@@ -292,6 +292,19 @@ export default {
           showOverflowTooltip: true,
           minWidth: 140
         },
+        {
+          prop: 'type',
+          label: '报价类型',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120,
+          formatter: (_row, _column, cellValue) => {
+            // 根据type值转换显示文本
+            if (_row.type === 1) return '产品销售';
+            if (_row.type === 2) return '生产加工';
+            return ''; // 其他情况显示空
+          }
+        },
         {
           prop: 'quoteName',
           label: '报价方名称',