周宾
3 天以前 3806a7b94bc2b069d22743c22f8d3dc54101850e
src/views/inventoryManagement/receiptManagement/components/formDiaManual.vue
@@ -29,7 +29,7 @@
              accept="image/*"
              :data="{ type: 9 }"
            >
              <img v-if="scope.row.url" :src="javaApiUrl+scope.row.url"></img>
              <img class="upload-img" v-if="scope.row.url" :src="javaApiUrl+scope.row.url"></img>
              <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
            </el-upload>
          </template>
@@ -51,7 +51,7 @@
        </el-table-column>
        <el-table-column label="纸箱规格" prop="cartonSpecifications" width="200">
          <template #default="scope">
            <el-input v-model="scope.row.cartonSpecifications" placeholder="请输入产品高度" />
            <el-input v-model="scope.row.cartonSpecifications" placeholder="请输入纸箱规格" />
          </template>
        </el-table-column>
        <!-- <el-table-column label="供应商" prop="supplierName" width="200">
@@ -81,9 +81,14 @@
            <el-input-number :step="1" :min="0" style="width: 100%" v-model="scope.row.boxNum" @change="() => calculateTotalPrice(scope.row)" />
          </template>
        </el-table-column>
        <el-table-column label="单价(元)/支" prop="taxInclusiveUnitPrice" width="150">
        <el-table-column label="单价(元)/件" prop="taxInclusiveUnitPrice" width="150">
         <template #default="scope">
           <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.taxInclusiveUnitPrice" @change="() => calculateTotalPrice(scope.row)" />
         </template>
       </el-table-column>
       <el-table-column label="单价(美元)/件" prop="dollarPrice" width="150">
         <template #default="scope">
           <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.dollarPrice"/>
         </template>
       </el-table-column>
        <el-table-column label="入库日期" prop="inboundDate" width="180">
@@ -219,7 +224,8 @@
    taxInclusiveTotalPrice: 0,
    taxRate: null,
    taxExclusiveTotalPrice: 0,
    boxNum: 0
    boxNum: 0,
    dollarPrice: 0
  });
};
@@ -257,17 +263,21 @@
    for (let i = 0; i < productList.value.length; i++) {
      const product = productList.value[i];
      if (!product.productCategory || !product.specificationModel || !product.unit) {
        proxy.$modal.msgError(`第${i + 1}行产品数据未填写完整(产品大类、规格型号、单位为必填)`)
        proxy.$modal.msgError(`第${i + 1}行产品数据未填写完整(产品、产品高度、高度单位为必填)`)
        return
      }
      if (!product.url) {
        proxy.$modal.msgError(`第${i + 1}行产品未上传产品图片`)
        return
      }
      if (!product.cartonSpecifications) {
        proxy.$modal.msgError(`第${i + 1}行产品未填写纸箱规格`)
        return
      }
      // if (!product.itemType) {
      //   proxy.$modal.msgError(`第${i + 1}行请选择物品类型`)
      //   return
      // }
      if (!product.inboundDate) {
        proxy.$modal.msgError(`第${i + 1}行请选择入库日期`)
        return
      }
      const stock = Number(product?.inboundNum ?? 0);
      if (!Number.isFinite(stock) || stock <= 0) {
        proxy.$modal.msgError(`第${i + 1}行本次入库数量需大于0`)
@@ -275,7 +285,21 @@
      }
      const boxNum = Number(product?.boxNum ?? 0);
      if (!Number.isFinite(boxNum) || boxNum <= 0) {
        proxy.$modal.msgError(`第${i + 1}每盒数量需大于0`)
        proxy.$modal.msgError(`第${i + 1}行每件数量/支需大于0`)
        return
      }
      const taxInclusiveUnitPrice = Number(product?.taxInclusiveUnitPrice ?? 0);
      if (!Number.isFinite(taxInclusiveUnitPrice) || taxInclusiveUnitPrice <= 0) {
        proxy.$modal.msgError(`第${i + 1}行单价(元)需大于0`)
        return
      }
      const dollarPrice = Number(product?.dollarPrice ?? 0);
      if (!Number.isFinite(dollarPrice) || dollarPrice <= 0) {
        proxy.$modal.msgError(`第${i + 1}行单价(美元)需大于0`)
        return
      }
      if (!product.inboundDate) {
        proxy.$modal.msgError(`第${i + 1}行请选择入库日期`)
        return
      }
      
@@ -296,7 +320,8 @@
         taxInclusiveTotalPrice: Number(product.taxInclusiveTotalPrice || 0),
      boxNum:Number(product.boxNum),
      cartonSpecifications: product.cartonSpecifications,
      url: product.url||'/src/assets/logo/logo.png',
      url: product.url||'',
      dollarPrice: Number(product.dollarPrice || 0),
    }));
    loading.value = true
    if (operationType.value === 'edit') {
@@ -391,6 +416,10 @@
      taxInclusiveUnitPrice: Number(row?.taxInclusiveUnitPrice ?? 0),
      taxInclusiveTotalPrice: Number(row?.taxInclusiveTotalPrice ?? 0),
      taxExclusiveTotalPrice: Number(row?.taxExclusiveTotalPrice ?? 0),
      boxNum: Number(row?.boxNum ?? 0),
      cartonSpecifications: row?.cartonSpecifications ?? '',
      url: row?.url ?? '',
      dollarPrice: Number(row?.dollarPrice ?? 0),
    }]
  }
}
@@ -400,5 +429,11 @@
})
</script>
<style scoped lang="scss"></style>
<style scoped lang="scss">
  .upload-img{
    width: 80px;
    height: 80px;
    object-fit: contain;
  }
</style>