Browse Source

国内贸易修改完善

lichao 3 years ago
parent
commit
40d9c7e2dd

+ 12 - 9
src/views/businessManagement/deliveryNotice/detailsPageEdit.vue

@@ -104,8 +104,8 @@
               @saveColumn="saveColumn('goods')"
           >
             <template slot="code" slot-scope="{row,index}">
+              <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="commodityChoice(row)" :disabled="detailData.seeDisabled || !row.$cellEdit">选择</el-button>
               <span>{{ row.code }}</span>
-              <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="commodityChoice(row)" :disabled="detailData.seeDisabled">选择</el-button>
             </template>
             <template slot-scope="{row,index}" slot="menu">
               <el-button
@@ -165,8 +165,8 @@
               @saveColumn="saveColumn('fees')"
           >
             <template slot="code" slot-scope="{row,index}">
+              <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="choice(row)" :disabled="detailData.seeDisabled || !row.$cellEdit">选择</el-button>
               <span>{{ row.code }}</span>
-              <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="choice(row)" :disabled="detailData.seeDisabled">选择</el-button>
             </template>
             <template slot="corpId" slot-scope="{ row }">
               <selectComponent v-if="row.$cellEdit" v-model="row.corpId"
@@ -573,7 +573,7 @@ export default {
             prop: 'srcOrderNo',
             rules: [
               {
-                required: true,
+                required: false,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -581,10 +581,10 @@ export default {
           }, {
             label: '出库金额',
             prop: 'deliveryAmount',
-            disabled: true,
+            disabled: false,
             rules: [
               {
-                required: true,
+                required: false,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -592,10 +592,10 @@ export default {
           }, {
             label: '出库数量',
             prop: 'totalQuantity',
-            disabled: true,
+            disabled: false,
             rules: [
               {
-                required: true,
+                required: false,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -628,7 +628,7 @@ export default {
             prop: 'totalCost',
             rules: [
               {
-                required: true,
+                required: false,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -760,6 +760,7 @@ export default {
       this.configuration.dicData = this.form.corpName
       delete this.form.corpName
       this.$set(this.form, 'deliveryStatus', '录入')
+      this.$set(this.form, 'srcOrderNo', this.form.orgOrderNo)
       if (this.form.belongToCorpList) {
         this.$set(this.form, 'salesCompany', this.form.belongToCorpId)
         delete this.form.belongToCorpId
@@ -956,6 +957,7 @@ export default {
         this.contactsData[this.choiceIndexT].typeno = this.tableData[0].typeno
         this.contactsData[this.choiceIndexT].specificationAndModel = this.tableData[0].specificationAndModel
         this.contactsData[this.choiceIndexT].itemId = this.tableData[0].id
+        this.contactsData[this.choiceIndexT].priceCategory = this.tableData[0].goodsTypeName
         selectGoodsNum({
           goodsId: this.tableData[0].id,
           typeno: this.tableData[0].typeno
@@ -1342,13 +1344,14 @@ export default {
     importMarket(list) {
       console.log(list)
       list.forEach(item => {
-        item.cname = item.priceCategoryNames
+        item.cname = item.cname
         delete item.id
         delete item.createTime
         delete item.createUser
         delete item.pid
         this.$refs.crudContact.rowCellAdd(item);
       })
+      console.log(this.contactsData)
       this.marketDialog = false;
     },
     // 关闭销售弹窗

+ 48 - 28
src/views/businessManagement/purchaseOrder/detailsPageEdit.vue

@@ -109,8 +109,8 @@
               <span v-else>{{ row.actualQuantity }}</span>
             </template>
             <template slot="code" slot-scope="{row,index}">
+              <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="commodityChoice(row)" :disabled="detailData.seeDisabled || !row.$cellEdit">选择</el-button>
               <span>{{ row.code }}</span>
-              <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="commodityChoice(row)" :disabled="detailData.seeDisabled">选择</el-button>
             </template>
             <template slot-scope="{row,index}" slot="menu">
               <el-button
@@ -160,8 +160,8 @@
               @saveColumn="saveColumn('fees')"
           >
             <template slot="code" slot-scope="{row,index}">
+              <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="choice(row)" :disabled="detailData.seeDisabled || !row.$cellEdit">选择</el-button>
               <span>{{ row.code }}</span>
-              <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="choice(row)" :disabled="detailData.seeDisabled">选择</el-button>
             </template>
             <template slot="corpId" slot-scope="{ row }">
               <selectComponent v-if="row.$cellEdit" v-model="row.corpId"
@@ -734,35 +734,55 @@ export default {
     //生成收货单
     generateShipmentC() {
       let lsit = []
-      for (let item in this.selection) {
-        if (!this.selection[item].id) {
-          return this.$confirm('商品信息有未保存数据, 是否立即保存?', '提示', {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning'
-          }).then(() => {
-            this.editCustomer(false)
-          }).catch(() => {
-            this.$message({
-              type: 'info',
-              message: '已取消'
+      if (contrastObj(this.form, this.oldForm) ||
+        contrastList(this.contactsData, this.oldGoodsList) ||
+        contrastList(this.advantageProjectData, this.oldFeesList) ||
+        contrastList(this.bankOfDepositData, this.oldUploadList)
+      ) {
+        this.$confirm("数据发生变化未有提交记录, 是否保存?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.editCustomer(false)
+        }).catch(() => {
+          // this.$message({
+          //   type: 'info',
+          //   message: '已取消'
+          // });
+          this.selection.forEach(item => {
+            lsit.push(item.id)
+          })
+          // lsit.push(this.selection[item].id)
+          let data = {
+            id: this.form.id,
+            orderItemIds: lsit
+          }
+          generateShipment(data).then(res => {
+            this.$router.$avueRouter.closeTag("/businessManagement/receipt/index");
+            this.$router.push({
+              path: "/businessManagement/receipt/index",
+              query: {form: JSON.stringify(res.data.data)},
             });
-          });
-        } else {
-          lsit.push(this.selection[item].id)
+          })
+        })
+      } else {
+        // lsit.push(this.selection[item].id)
+        this.selection.forEach(item => {
+          lsit.push(item.id)
+        })
+        let data = {
+          id: this.form.id,
+          orderItemIds: lsit
         }
+        generateShipment(data).then(res => {
+          this.$router.$avueRouter.closeTag("/businessManagement/receipt/index");
+          this.$router.push({
+            path: "/businessManagement/receipt/index",
+            query: {form: JSON.stringify(res.data.data)},
+          });
+        })
       }
-      let data = {
-        id: this.form.id,
-        orderItemIds: lsit
-      }
-      generateShipment(data).then(res => {
-        this.$router.$avueRouter.closeTag("/businessManagement/receipt/index");
-        this.$router.push({
-          path: "/businessManagement/receipt/index",
-          query: {form: JSON.stringify(res.data.data)},
-        });
-      })
     },
     //点击行可编辑
     handleRowClick(row, event, column) {

+ 5 - 5
src/views/businessManagement/receipt/detailsPageEdit.vue

@@ -104,8 +104,8 @@
               @saveColumn="saveColumn('goods')"
           >
             <template slot="code" slot-scope="{row,index}">
+              <el-button type="text" size="mini" style="padding:4px 10px;float:left" :disabled="detailData.seeDisabled || !row.$cellEdit" @click="commodityChoice(row)">选择</el-button>
               <span>{{ row.code }}</span>
-              <el-button type="text" size="mini" style="padding:4px 10px;float:left" :disabled="detailData.seeDisabled" @click="commodityChoice(row)">选择</el-button>
             </template>
             <template slot-scope="{row,index}" slot="menu">
               <el-button
@@ -158,8 +158,8 @@
               @saveColumn="saveColumn('fees')"
           >
             <template slot="code" slot-scope="{row,index}">
+              <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="choice(row)" :disabled="detailData.seeDisabled || !row.$cellEdit">选择</el-button>
               <span>{{ row.code }}</span>
-              <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="choice(row)" :disabled="detailData.seeDisabled">选择</el-button>
             </template>
             <template slot="corpId" slot-scope="{ row }">
               <selectComponent v-if="row.$cellEdit" v-model="row.corpId"
@@ -554,7 +554,7 @@ export default {
             disabled: true,
             rules: [
               {
-                required: true,
+                required: false,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -565,7 +565,7 @@ export default {
             disabled: true,
             rules: [
               {
-                required: true,
+                required: false,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -576,7 +576,7 @@ export default {
             disabled: true,
             rules: [
               {
-                required: true,
+                required: false,
                 message: ' ',
                 trigger: 'blur'
               }

+ 92 - 39
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -10,14 +10,22 @@
       <div class="add-customer-btn">
         <el-button
           class="el-button--small-yh"
-          style="right: 245px;"
           type="primary"
           :disabled="detailData.seeDisabled"
+          size="small"
+          @click="applySettlement"
+        >申请结算</el-button>
+        <el-button
+          class="el-button--small-yh"
+          type="primary"
+          :disabled="detailData.seeDisabled"
+          size="small"
           @click="saveSell"
         >生成采购单</el-button>
         <el-button
           class="el-button--small-yh"
-          type="success" style="right: 140px;" @click="copyOrder"
+          type="success" @click="copyOrder"
+          size="small"
           :disabled="detailData.seeDisabled || !this.form.id">
           复制新单
         </el-button>
@@ -26,6 +34,7 @@
           type="primary"
           :disabled="disabled || detailData.seeDisabled"
           :loading="saveLoading"
+          size="small"
           @click="editCustomer(false)"
         >{{ form.id ? '确认修改' : '确认新增' }}
         </el-button>
@@ -229,8 +238,8 @@
               @saveColumn="saveColumn('fees')"
           >
             <template slot="code" slot-scope="{row,index}">
+              <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="choice(row)" :disabled="detailData.seeDisabled || !row.$cellEdit">选择</el-button>
               <span>{{ row.code }}</span>
-              <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="choice(row)" :disabled="detailData.seeDisabled">选择</el-button>
             </template>
             <template slot="corpId" slot-scope="{ row }">
               <selectComponent v-if="row.$cellEdit" v-model="row.corpId"
@@ -869,7 +878,6 @@ export default {
             label: '制单人',
             prop: 'createUserName',
             disabled: true,
-            span: 24,
             rules: [
               {
                 required: false,
@@ -1269,35 +1277,71 @@ export default {
     //生成发货单
     generateShipmentD() {
       let lsit = []
-      for (let item in this.selection) {
-        if (!this.selection[item].id) {
-          return this.$confirm('商品信息有未保存数据, 是否立即保存?', '提示', {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning'
-          }).then(() => {
-            this.editCustomer(false)
-          }).catch(() => {
-            this.$message({
-              type: 'info',
-              message: '已取消'
+      if (contrastObj(this.form, this.oldForm) ||
+        contrastList(this.contactsData, this.oldGoodsList) ||
+        contrastList(this.advantageProjectData, this.oldFeesList) ||
+        contrastList(this.bankOfDepositData, this.oldUploadList)
+      ) {
+        this.$confirm("数据发生变化未有提交记录, 是否保存?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.editCustomer(false)
+        }).catch(() => {
+          // this.$message({
+          //   type: 'info',
+          //   message: '已取消'
+          // });
+          this.selection.forEach(item => {
+            lsit.push(item.id)
+          })
+          let data = {
+            id: this.form.id,
+            orderItemIds: lsit
+          }
+          generateShipment(data).then(res => {
+            this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
+            this.$router.push({
+              path: "/businessManagement/deliveryNotice/index",
+              query: {form: JSON.stringify(res.data.data)},
             });
-          });
-        } else {
-          lsit.push(this.selection[item].id)
+          })
+        })
+      } else {
+        // lsit.push(this.selection[item].id)
+        this.selection.forEach(item => {
+          lsit.push(item.id)
+        })
+        let data = {
+          id: this.form.id,
+          orderItemIds: lsit
         }
+        generateShipment(data).then(res => {
+          this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
+          this.$router.push({
+            path: "/businessManagement/deliveryNotice/index",
+            query: {form: JSON.stringify(res.data.data)},
+          });
+        })
       }
-      let data = {
-        id: this.form.id,
-        orderItemIds: lsit
-      }
-      generateShipment(data).then(res => {
-        this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
-        this.$router.push({
-          path: "/businessManagement/deliveryNotice/index",
-          query: {form: JSON.stringify(res.data.data)},
-        });
-      })
+    },
+    // 生成结算
+    applySettlement() {
+      if (contrastObj(this.form, this.oldForm) ||
+        contrastList(this.contactsData, this.oldGoodsList) ||
+        contrastList(this.advantageProjectData, this.oldFeesList) ||
+        contrastList(this.bankOfDepositData, this.oldUploadList)
+      ) {
+        this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.editCustomer(true)
+        }).catch(() => {
+        })
+      } else {}
     },
     //商品选中触发
     productSelection(selection) {
@@ -1528,7 +1572,9 @@ export default {
           typeno: list[item].typeno
         }).then(res => {
           this.$set(list[item], 'storageQuantity', res.data.data)
-          this.$set(buyFree[item], 'storageQuantity', res.data.data)
+          if (this.policyDataTwo.length > 0) {
+            this.$set(buyFree[item], 'storageQuantity', res.data.data)
+          }
         })
         if (this.policyData.length > 0) {
           this.$set(list[item], 'price', list[item].specialOffer)
@@ -1546,13 +1592,16 @@ export default {
         this.$set(list[item], 'sort', this.maxGoodsNum + 1)
         this.$set(list[item], 'purchaseAmount', list[item].purchasePrice)
 
-        this.$set(buyFree[item], 'actualQuantity', 0)
-        this.$set(buyFree[item], 'amount', 0)
-        this.$set(buyFree[item], 'priceCategory', list[item].productCategory)
-        this.$set(buyFree[item], 'priceType', this.policyForm.cname)
-        this.$set(buyFree[item], 'cname', list[item].productCategory)
-        this.$set(buyFree[item], 'sort', this.maxGoodsNum + 1)
-        this.$set(buyFree[item], 'purchaseAmount', list[item].purchasePrice)
+        if (this.policyDataTwo.length > 0) {
+          this.$set(buyFree[item], 'actualQuantity', 0)
+          this.$set(buyFree[item], 'amount', 0)
+          this.$set(buyFree[item], 'priceCategory', list[item].productCategory)
+          this.$set(buyFree[item], 'priceType', this.policyForm.cname)
+          this.$set(buyFree[item], 'cname', list[item].productCategory)
+          this.$set(buyFree[item], 'sort', this.maxGoodsNum + 2)
+          this.$set(buyFree[item], 'purchaseAmount', list[item].purchasePrice)
+          this.maxGoodsNum++
+        }
         delete list[item].id
         delete list[item].pid
         delete list[item].isDeleted
@@ -1564,7 +1613,9 @@ export default {
         this.maxGoodsNum++
         this.$refs.crudContact.rowCellAdd(list[item]);
         // this.$refs.crudContact.rowCell(list[item], this.contactsData.length - 1)
-        this.$refs.crudContact.rowCellAdd(buyFree[item]);
+        if (this.policyDataTwo.length > 0) {
+          this.$refs.crudContact.rowCellAdd(buyFree[item]);
+        }
         // this.$refs.crudContact.rowCell(buyFree[item], this.contactsData.length - 1)
       }
       this.policyDialog = false
@@ -1799,6 +1850,8 @@ export default {
             } else {
               this.queryData(res.data.data.id)
             }
+          }).finally(() => {
+            this.saveLoading = false
           })
         } else {
           return false;