zss
17 小时以前 c788f899bc154c212ba9657fdc5dd530ca0516e0
src/views/salesManagement/salesLedger/index.vue
@@ -171,7 +171,7 @@
          <el-table-column label="不含税总价(元)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" />
          <el-table-column fixed="right" label="操作" min-width="60" align="center" v-if="operationType !== 'view'">
            <template #default="scope">
              <el-button link type="primary" size="small" @click="openProductForm('edit', scope.row)">编辑</el-button>
              <el-button link type="primary" size="small" @click="openProductForm('edit', scope.row,scope.$index)">编辑</el-button>
            </template>
          </el-table-column>
        </el-table>
@@ -661,13 +661,16 @@
  proxy.resetForm("formRef");
  dialogFormVisible.value = false;
};
const productIndex = ref(0);
// 打开产品弹框
const openProductForm = (type, row) => {
const openProductForm = (type, row,index) => {
  productOperationType.value = type;
  productForm.value = {};
  proxy.resetForm("productFormRef");
  if (type === "edit") {
    productForm.value = { ...row };
    productIndex.value = index;
  }
  productFormVisible.value = true;
  getProductOptions();
@@ -679,7 +682,11 @@
      if (operationType.value === "edit") {
        submitProductEdit();
      } else {
        productData.value.push({ ...productForm.value });
        if(productOperationType.value === "add"){
          productData.value.push({ ...productForm.value });
        }else{
          productData.value[productIndex.value] = { ...productForm.value }
        }
        closeProductDia();
      }
    }