瀏覽代碼

福达销售单票毛利计算 2023-12-12

caojunjie 1 年之前
父節點
當前提交
55bab65421
共有 1 個文件被更改,包括 8 次插入6 次删除
  1. 8 6
      src/views/exportTrade/salesContract/detailsPage.vue

+ 8 - 6
src/views/exportTrade/salesContract/detailsPage.vue

@@ -1229,8 +1229,6 @@ export default {
     goodsInfo
   },
   async created() {
-      const pricebank = await getPricebankAll({ billType: "CG", statusTime: dateFormat(new Date(), "yyyy-MM-dd") })
-      this.goodsoptions = pricebank.data.data
       // 获取运输方式数据
       this.getDictionaryfun()
     if (this.detailData.id) {
@@ -2190,6 +2188,10 @@ export default {
       this.showBut = false;
       this.pageLoading = true;
       if (this.detailData.status == "copy") {
+          // 获取商品数据,保存查询
+        getPricebankAll({ billType: "CG", statusTime: dateFormat(new Date(), "yyyy-MM-dd") }).then(res=>{
+            this.goodsoptions = res.data.data
+        })
         getCopy(id).then(res => {
             delete res.data.data.id;
             delete res.data.data.sysNo;
@@ -2296,10 +2298,6 @@ export default {
     },
     //修改提交触发
     editCustomer(status) {
-      if (this.goodsoptions.length == 0) {
-          this.$message.warning('数据正在加载,请稍后重试!!');
-          return
-      }
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
@@ -2313,6 +2311,10 @@ export default {
                 return this.$message.error(`请输入第${i + 1}行的供应商`);
               }
               if (this.detailData.status == 'copy') {
+                  if (this.goodsoptions.length == 0) {
+                      this.$message.warning('数据正在加载,请稍后重试!!');
+                      return
+                  }
                   // 复制的重新进行计算
                   for (let item of this.goodsoptions) {
                       if (item.itemId == this.data[i].itemId) {