Kaynağa Gözat

解决发货单的问题

QuKatie 3 yıl önce
ebeveyn
işleme
f3dc4b74c6

+ 9 - 1
src/page/index/tags.vue

@@ -119,12 +119,20 @@
       //激活当前选项
       setActive() {
         this.data = this.active
-        // console.log(this.active)
         this.active = this.tag.value;
       },
       menuTag(value, action) {
         if (action === "remove") {
           let {tag, key} = this.findTag(value);
+          if(tag.label=="出口发货单"){
+            this.$store.commit("OUT_OUT_DETAIL");
+          }
+            if(tag.label=="国内发货单"){
+            this.$store.commit("IN_OUT_DETAIL");
+          }
+            if(tag.label=="进口发货单"){
+            this.$store.commit("GO_OUT_DETAIL");
+          }
           this.$store.commit("DEL_TAG", tag);
           if (tag.value === this.tag.value) {
             tag = this.tagList[key === 0 ? key : key - 1]; //如果关闭本标签让前推一个

+ 7 - 7
src/router/views/index.js

@@ -307,7 +307,7 @@ export default [{
     children: [
       {
         path: '/exportTrade/customerInquiry/index',
-        name:'报价单',
+        name:'出口报价单',
         meta: {
           keepAlive: true,
         },
@@ -323,7 +323,7 @@ export default [{
       children: [
         {
           path: '/exportTrade/purchaseInquiry/index',
-          name:'采购询价',
+          name:'出口采购询价',
           meta: {
             keepAlive: true,
           },
@@ -339,7 +339,7 @@ export default [{
           children: [
             {
               path: '/exportTrade/shippingInquiry/index',
-              name:'船务询价',
+              name:'出口船务询价',
               meta: {
                 keepAlive: true,
               },
@@ -355,7 +355,7 @@ export default [{
     children: [
       {
         path: '/exportTrade/salesContract/index',
-        name:'销售订单',
+        name:'出口销售订单',
         meta: {
           keepAlive: true,
         },
@@ -371,7 +371,7 @@ export default [{
     children: [
       {
         path: '/exportTrade/purchaseContract/index',
-        name:'采购订单',
+        name:'出口采购订单',
         meta: {
           keepAlive: true,
         },
@@ -404,7 +404,7 @@ export default [{
     children: [
       {
         path: '/exportTrade/receipt/index',
-        name:"收货单",
+        name:"出口收货单",
         meta: {
           keepAlive:true,
         },
@@ -420,7 +420,7 @@ export default [{
     children: [
       {
         path: '/exportTrade/invoice/index',
-        name:"发货单",
+        name:"出口发货单",
         meta: {
           keepAlive:true,
         },

+ 3 - 0
src/store/getters.js

@@ -25,5 +25,8 @@ const getters = {
   logsLen: state => state.logs.logsList.length || 0,
   logsFlag: (state, getters) => getters.logsLen === 0,
   flowRoutes: state => state.dict.flowRoutes,
+  inStatus: state => state.ifdetail.inStatus,
+  goStatus: state => state.ifdetail.goStatus,
+  outStatus: state => state.ifdetail.outStatus,
 }
 export default getters

+ 3 - 2
src/store/index.js

@@ -5,8 +5,8 @@ import common from './modules/common'
 import tags from './modules/tags'
 import logs from './modules/logs'
 import dict from './modules/dict'
+import ifdetail from './modules/ifdetail'
 import getters from './getters'
-
 Vue.use(Vuex)
 const store = new Vuex.Store({
   modules: {
@@ -14,7 +14,8 @@ const store = new Vuex.Store({
     common,
     logs,
     tags,
-    dict
+    dict,
+    ifdetail
   },
   getters,
 })

+ 40 - 0
src/store/modules/ifdetail.js

@@ -0,0 +1,40 @@
+const ifdetail = {
+  state: {
+    inStatus: false, //国内
+    goStatus: false, //进口
+    outStatus: false //出口
+  },
+  actions: {},
+  mutations: {
+    //国内状态
+    // 进入详情页
+    IN_IN_DETAIL(state) {
+      state.inStatus = true;
+    },
+    //退出详情页
+    IN_OUT_DETAIL(state) {
+      state.inStatus = false;
+    },
+    //进口状态
+    // 进入详情页
+    GO_IN_DETAIL(state) {
+      state.goStatus = true;
+    },
+    //退出详情页
+    GO_OUT_DETAIL(state) {
+      state.goStatus = false;
+    },
+    //出口状态
+    // 进入详情页
+    OUT_IN__DETAIL(state) {
+      state.outStatus = true;
+    },
+    //退出详情页
+    OUT_OUT_DETAIL(state) {
+      state.outStatus = false;
+    }
+  }
+
+};
+
+export default ifdetail;

+ 1 - 0
src/views/exportTrade/customerInquiry/config/customerContact.json

@@ -6,6 +6,7 @@
   "viewBtn": false,
   "editBtn": false,
   "addBtn": false,
+  "delBtn":false,
   "align": "center",
   "menuWidth": 80,
   "refreshBtn": false,

+ 42 - 11
src/views/exportTrade/customerInquiry/detailsPage.vue

@@ -99,11 +99,11 @@
           </template>
           <template slot="menu" slot-scope="scope">
             <el-button
-              v-if="scope.row.$cellEdit"
               size="small"
               icon="el-icon-edit"
               type="text"
               @click="rowDel(scope.row, scope.index)"
+              :disabled="detailData.status == 1"
               >删 除</el-button
             >
           </template>
@@ -252,7 +252,7 @@ import {
 } from "@/api/basicData/customerInquiry";
 import reportDialog from "@/components/report-dialog/main";
 import { isDiscount, isPercentage, micrometerFormat } from "@/util/validate";
-import { contrastObj,contrastList } from "@/util/contrastData";
+import { contrastObj, contrastList } from "@/util/contrastData";
 import _ from "lodash";
 export default {
   name: "detailsPageEdit",
@@ -460,7 +460,8 @@ export default {
       treeDeptId: null,
       orderFeesList: [],
       oldform: {},
-      olddata:[]
+      olddata: [],
+      oldorderFeesList: []
     };
   },
   props: {
@@ -524,6 +525,9 @@ export default {
       }
     },
     saveShipping() {
+      if (!this.form.id) {
+        return this.$message.error("此单据没有提交记录,请先提交");
+      }
       this.$confirm("是否生成船务询价单?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -537,6 +541,9 @@ export default {
       });
     },
     savePurchase() {
+      if (!this.form.id) {
+        return this.$message.error("此单据没有提交记录,请先提交");
+      }
       this.$confirm("是否生成采购询价单?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -646,15 +653,16 @@ export default {
     getDetail(id) {
       detail(id).then(res => {
         this.form = res.data.data;
-        this.oldform = res.data.data;
         this.data = res.data.data.orderItemsList;
-        this.olddata= this.deepClone(res.data.data.orderFeesList);
         this.orderFeesList = res.data.data.orderFeesList;
         this.configuration.dicData = this.form.corpName;
+        this.oldform = res.data.data;
+        this.olddata = this.deepClone(res.data.data.orderItemsList);
+        this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
       });
     },
     //修改提交触发
-    editCustomer() {
+    editCustomer(status) {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
@@ -678,10 +686,16 @@ export default {
             if (res.data.code == 200) {
               this.$message.success(this.form.id ? "修改成功" : "提交成功");
               this.form = res.data.data;
-              this.oldform = res.data.data;
               this.data = res.data.data.orderItemsList;
               this.orderFeesList = res.data.data.orderFeesList;
-              this.olddata= this.deepClone(res.data.data.orderFeesList);
+              this.oldform = res.data.data;
+              this.olddata = this.deepClone(res.data.data.orderItemsList);
+              this.oldorderFeesList = this.deepClone(
+                res.data.data.orderFeesList
+              );
+              if(status=='goBack'){
+                this.$emit("goBack");
+              }
             }
           });
         } else {
@@ -691,9 +705,26 @@ export default {
     },
     //返回列表
     backToList() {
-      console.log(contrastObj(this.form,this.oldform))
-      console.log(contrastList(this.orderFeesList,this.olddata))
-      this.$emit("goBack");
+      let orderFeesList = this.$refs.feeInfo.submitData();
+      if (
+        contrastObj(this.form, this.oldform) ||
+        contrastList(this.data, this.olddata) ||
+        contrastList(orderFeesList, this.oldorderFeesList)
+      ) {
+        this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            this.editCustomer('goBack');
+          })
+          .catch(() => {
+            this.$emit("goBack");
+          });
+      } else {
+        this.$emit("goBack");
+      }
     },
     openReport() {
       this.switchDialog = !this.switchDialog;

+ 11 - 5
src/views/exportTrade/invoice/index.vue

@@ -176,6 +176,7 @@ export default {
         status: status
       };
       this.show = false;
+      this.$store.commit("OUT_IN__DETAIL");
     },
     editOpen(row, status) {
       this.detailData = {
@@ -183,6 +184,7 @@ export default {
         status: status
       };
       this.show = false;
+      this.$store.commit("OUT_IN__DETAIL");
     },
     //点击搜索按钮触发
     searchChange(params, done) {
@@ -195,7 +197,7 @@ export default {
         params.createEndTime = params.createTime[1];
       }
       delete params.businessDate;
-      delete params.createTime
+      delete params.createTime;
       this.page.currentPage = 1;
       this.onLoad(this.page, params);
       done();
@@ -228,14 +230,18 @@ export default {
     },
     newAdd() {
       this.show = false;
+      this.$store.commit("OUT_IN__DETAIL");
     },
     goBack() {
-      this.$router.$avueRouter.closeTag();
       this.detailData = this.$options.data().detailData;
-      this.$router.push({
-        path: "/exportTrade/invoice/index"
-      });
+      if (this.$route.query.pageType == "Generate") {
+        this.$router.$avueRouter.closeTag();
+        this.$router.push({
+          path: "/exportTrade/invoice/index"
+        });
+      }
       this.show = true;
+      this.$store.commit("OUT_OUT_DETAIL");
     }
   }
 };

+ 14 - 0
src/views/exportTrade/salesContract/detailsPage.vue

@@ -736,6 +736,19 @@ export default {
       this.switchDialog = val;
     },
     getInvoice() {
+      if (this.$store.getters.outStatus) {
+        this.$alert("出口发货单存在,请保存发货单再进行操作", "温馨提示", {
+          confirmButtonText: "确定",
+          type: 'warning',
+          callback: action => {
+           console.log(action)
+          }
+        });
+      } else {
+        this.inInvoice()
+      }
+    },
+    inInvoice() {
       const data = { id: this.form.id, orderItemIds: this.orderItemIds };
       deliverGoods(data).then(res => {
         if (res.data.code == 200) {
@@ -763,6 +776,7 @@ export default {
             delete data.updateTime;
             delete data.isDeleted;
             delete data.orderStatus;
+            this.$router.$avueRouter.closeTag('/exportTrade/invoice/index');
             this.$router.push({
               path: "/exportTrade/invoice/index",
               query: {