buhuazhen
3 天以前 bc92c5b9f6c432667dcaf43fdca588f889d65f53
src/views/salesManagement/salesQuotation/index.vue
@@ -185,7 +185,7 @@
                </el-form-item>
              </template>
            </el-table-column>
            <el-table-column prop="ProductModel" label="规格型号" width="200">
            <el-table-column prop="specification" label="规格型号" width="200">
              <template #default="scope">
                <el-form-item :prop="`products.${scope.$index}.productModelId`" class="product-table-form-item">
                  <el-select
@@ -275,7 +275,7 @@
        <h4>产品明细</h4>
        <el-table :data="currentQuotation.products" border style="width: 100%">
          <el-table-column prop="product" label="产品名称" />
          <el-table-column prop="ProductModel" label="规格型号" />
          <el-table-column prop="specification" label="规格型号" />
          <el-table-column prop="unit" label="单位" />
          <el-table-column prop="unitPrice" label="单价">
            <template #default="scope">
@@ -458,7 +458,7 @@
      row.product = '';
      row.modelOptions = [];
      row.productModelId = '';
      row.ProductModel = '';
      row.specification = '';
      row.unit = '';
      return;
   }
@@ -479,7 +479,7 @@
   // 如果清空选择,则清空相关字段
   if (!value) {
      row.productModelId = '';
      row.ProductModel = '';
      row.specification = '';
      row.unit = '';
      return;
   }
@@ -488,10 +488,10 @@
   const modelOptions = row.modelOptions || [];
   const index = modelOptions.findIndex((item) => item.id === value);
   if (index !== -1) {
      row.ProductModel = modelOptions[index].model;
      row.specification = modelOptions[index].model;
      row.unit = modelOptions[index].unit;
   } else {
      row.ProductModel = '';
      row.specification = '';
      row.unit = '';
   }
};
@@ -524,7 +524,7 @@
      productId: product.productId || '',
      product: product.product || product.productName || '',
      productModelId: product.productModelId || '',
      ProductModel: product.ProductModel || '',
      specification: product.specification || '',
      quantity: product.quantity || 0,
      unit: product.unit || '',
      unitPrice: product.unitPrice || 0,
@@ -570,9 +570,9 @@
        const res = await modelList({ id: resolvedProductId });
        modelOptions = res || [];
        // 如果返回的数据没有 productModelId,但有 ProductModel 名称,根据名称查找 ID
        if (!resolvedProductModelId && product.ProductModel) {
          const foundModel = modelOptions.find(item => item.model === product.ProductModel);
        // 如果返回的数据没有 productModelId,但有 specification 名称,根据名称查找 ID
        if (!resolvedProductModelId && product.specification) {
          const foundModel = modelOptions.find(item => item.model === product.specification);
          if (foundModel) {
            resolvedProductModelId = foundModel.id;
          }
@@ -586,7 +586,7 @@
      productId: resolvedProductId,
      product: productName,
      productModelId: resolvedProductModelId,
      ProductModel: product.ProductModel || '',
      specification: product.specification || '',
      quantity: product.quantity || 0,
      unit: product.unit || '',
      unitPrice: product.unitPrice || 0,
@@ -755,7 +755,7 @@
          productId: product.productId || '',
          product: product.product || product.productName || '',
          productModelId: product.productModelId || '',
          ProductModel: product.ProductModel || '',
          specification: product.specification || '',
          quantity: product.quantity || 0,
          unit: product.unit || '',
          unitPrice: product.unitPrice || 0,