gaoluyang
2 天以前 bbee93d4b4b6960d75188a4becc0d29bbf71a66d
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>
@@ -250,12 +250,14 @@
          <el-col :span="12">
            <el-form-item label="含税单价(元):" prop="taxInclusiveUnitPrice">
              <el-input-number :step="0.01" :min="0" v-model="productForm.taxInclusiveUnitPrice" style="width: 100%"
                                              :precision="2"
                                              placeholder="请输入" clearable @change="calculateFromUnitPrice" />
            </el-form-item>
          </el-col>
               <el-col :span="12">
                  <el-form-item label="数量:" prop="quantity">
                     <el-input-number  :step="0.1" :min="0" v-model="productForm.quantity" placeholder="请输入" clearable
                                                :precision="2"
                                                @change="calculateFromQuantity" style="width: 100%" />
                  </el-form-item>
               </el-col>
@@ -661,13 +663,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 +684,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();
      }
    }