Browse Source

修改bug

QuKatie 4 years ago
parent
commit
b4aaaaaa35

+ 20 - 0
src/api/basicData/invoice.js

@@ -74,4 +74,24 @@ export function getSpecification(query) {
     method: 'get',
     params: query
   })
+}
+/**
+ * 确认发货
+ */
+ export function save(data) {
+  return request({
+    url: '/api/blade-deliver-goods/exportDelivery/save',
+    method: 'post',
+    data: data
+  })
+}
+/**
+ * 撤销发货
+ */
+ export function repeal(data) {
+  return request({
+    url: '/api/blade-deliver-goods/exportDelivery/repeal',
+    method: 'post',
+    data: data
+  })
 }

+ 21 - 1
src/api/exportTrade/receipt.js

@@ -48,7 +48,7 @@ export function remove(data) {
 //获取商品
 export const getGoods = (current, size,goodsTypeId) => {
   return request({
-      url: '/api//blade-client/goodsdesc/selectGoods',
+      url: '/api/blade-client/goodsdesc/selectGoods',
       method: 'get',
       params: {
           current,
@@ -74,4 +74,24 @@ export function getSpecification(query) {
     method: 'get',
     params: query
   })
+}
+/**
+ * 确认发货
+ */
+ export function save(data) {
+  return request({
+    url: '/api/blade-deliver-goods/exportDelivery/comfire',
+    method: 'post',
+    data: data
+  })
+}
+/**
+ * 撤销发货
+ */
+ export function repeal(data) {
+  return request({
+    url: '/api/blade-deliver-goods/exportDelivery/repeal',
+    method: 'post',
+    data: data
+  })
 }

+ 2 - 2
src/components/selectComponent/customerSelect.vue

@@ -1,10 +1,10 @@
 <template>
-  <span class="select-component" style="display:inline-flex;">
+  <span class="select-component" style="display:inline-flex;width: 100%;">
     <el-select
         v-model="value"
         size="small"
         :placeholder="configuration.placeholder"
-        style="width: 90%;border-right: none;"
+        style="border-right: none;"
         :disabled="disabled?disabled:false"
         :multiple="configuration.multiple?configuration.multiple:false"
         :collapse-tags="configuration.collapseTags?configuration.collapseTags:false">

+ 158 - 153
src/page/index/tags.vue

@@ -60,170 +60,175 @@
   </div>
 </template>
 <script>
-import {mapGetters, mapState} from "vuex";
-import {clearCache} from "@/api/user";
+import { mapGetters, mapState } from "vuex";
+import { clearCache } from "@/api/user";
 
-  export default {
-    name: "tags",
-    data() {
-      return {
-        active: "",
-        contentmenuX: "",
-        contentmenuY: "",
-        contextmenuFlag: false,
-        data:''
-      };
-    },
-    created() {
-    },
-    mounted() {
+export default {
+  name: "tags",
+  data() {
+    return {
+      active: "",
+      contentmenuX: "",
+      contentmenuY: "",
+      contextmenuFlag: false,
+      data: ""
+    };
+  },
+  created() {},
+  mounted() {
+    this.setActive();
+    this.data = this.active;
+  },
+  watch: {
+    tag() {
       this.setActive();
-      this.data = this.active
     },
-    watch: {
-      tag() {
-        this.setActive();
-      },
-      contextmenuFlag() {
-        window.addEventListener("mousedown", this.watchContextmenu);
+    contextmenuFlag() {
+      window.addEventListener("mousedown", this.watchContextmenu);
+    }
+  },
+  computed: {
+    ...mapGetters(["tagWel", "tagList", "tag", "website"]),
+    ...mapState({
+      showTag: state => state.common.showTag
+    }),
+    tagLen() {
+      return this.tagList.length || 0;
+    }
+  },
+  methods: {
+    generateTitle(item) {
+      return this.$router.$avueRouter.generateTitle(
+        item.label,
+        (item.meta || {}).i18n
+      );
+    },
+    watchContextmenu(event) {
+      if (!this.$el.contains(event.target) || event.button !== 0) {
+        this.contextmenuFlag = false;
       }
+      window.removeEventListener("mousedown", this.watchContextmenu);
     },
-    computed: {
-      ...mapGetters(["tagWel", "tagList", "tag", "website"]),
-      ...mapState({
-        showTag: state => state.common.showTag
-      }),
-      tagLen() {
-        return this.tagList.length || 0;
+    handleContextmenu(event) {
+      let target = event.target;
+      // 解决 https://github.com/d2-projects/d2-admin/issues/54
+      let flag = false;
+      if (target.className.indexOf("el-tabs__item") > -1) flag = true;
+      else if (target.parentNode.className.indexOf("el-tabs__item") > -1) {
+        target = target.parentNode;
+        flag = true;
+      }
+      if (flag) {
+        event.preventDefault();
+        event.stopPropagation();
+        this.contentmenuX = event.clientX;
+        this.contentmenuY = event.clientY;
+        this.tagName = target.getAttribute("aria-controls").slice(5);
+        this.contextmenuFlag = true;
       }
     },
-    methods: {
-      generateTitle(item) {
-        return this.$router.$avueRouter.generateTitle(
-          item.label,
-          (item.meta || {}).i18n
-        );
-      },
-      watchContextmenu(event) {
-        if (!this.$el.contains(event.target) || event.button !== 0) {
-          this.contextmenuFlag = false;
+    //激活当前选项
+    setActive() {
+      this.data = this.active;
+      this.active = this.tag.value;
+    },
+    menuTag(value, action) {
+      if (action === "remove") {
+        let { tag, key } = this.findTag(value);
+        if (tag.label == "发货单(E)") {
+          this.$store.commit("OUT_OUT_DETAIL");
         }
-        window.removeEventListener("mousedown", this.watchContextmenu);
-      },
-      handleContextmenu(event) {
-        let target = event.target;
-        // 解决 https://github.com/d2-projects/d2-admin/issues/54
-        let flag = false;
-        if (target.className.indexOf("el-tabs__item") > -1) flag = true;
-        else if (target.parentNode.className.indexOf("el-tabs__item") > -1) {
-          target = target.parentNode;
-          flag = true;
+        if (tag.label == "收货单(E)") {
+          this.$store.commit("REC_OUT_DETAIL");
         }
-        if (flag) {
-          event.preventDefault();
-          event.stopPropagation();
-          this.contentmenuX = event.clientX;
-          this.contentmenuY = event.clientY;
-          this.tagName = target.getAttribute("aria-controls").slice(5);
-          this.contextmenuFlag = true;
+        if (tag.label == "国内发货单") {
+          this.$store.commit("IN_OUT_DETAIL");
         }
-      },
-      //激活当前选项
-      setActive() {
-        this.data = this.active
-        this.active = this.tag.value;
-      },
-      menuTag(value, action) {
-        if (action === "remove") {
-          let {tag, key} = this.findTag(value);
-          if(tag.label=="发货单(E)"){
-            this.$store.commit("OUT_OUT_DETAIL");
-          }
-            if(tag.label=="国内发货单"){
-            this.$store.commit("IN_OUT_DETAIL");
-          }
-            if(tag.label=="发货单"){
-            this.$store.commit("GO_OUT_DETAIL");
-          }
-          if(tag.label=="收货单"){
-            this.$store.commit("TAKE_OUT_DETAIL");
-          }
-          if(tag.label=="付款管理"){
-            this.$store.commit("PAY_OUT_DETAIL");
-          }
-          this.$store.commit("DEL_TAG", tag);
-          if (tag.value === this.tag.value) {
-            tag = this.tagList[key === 0 ? key : key - 1]; //如果关闭本标签让前推一个
-            this.openTag(tag);
-          }
+        if (tag.label == "发货单") {
+          this.$store.commit("GO_OUT_DETAIL");
+        }
+        if (tag.label == "收货单") {
+          this.$store.commit("TAKE_OUT_DETAIL");
+        }
+        if (tag.label == "付款管理") {
+          this.$store.commit("PAY_OUT_DETAIL");
+        }
+        this.$store.commit("DEL_TAG", tag);
+        if (tag.value === this.tag.value) {
+          tag = this.tagList[key === 0 ? key : key - 1]; //如果关闭本标签让前推一个
+          this.openTag(tag);
         }
-      },
-      openTag(item) {
-        // this.$confirm('未保存数据是否确认, 是否继续?', '提示', {
-        //   confirmButtonText: '确定',
-        //   cancelButtonText: '取消',
-        //   type: 'warning'
-        // }).then(() => {
-          let tag;
-          if (item.name) {
-            tag = this.findTag(item.name).tag;
-          } else {
-            tag = item;
-          }
-          this.$router.push({
-            path: this.$router.$avueRouter.getPath({
-              name: tag.label,
-              src: tag.value
-            }, tag.meta),
-            query: tag.query
-          });
-        // }).catch(() => {
-        //   this.active = this.data
-        //   console.log(this.data)
-        //   this.$message({
-        //     type: 'info',
-        //     message: '已取消删除'
-        //   });
-        // });
-      },
-      closeOthersTags() {
-        this.contextmenuFlag = false;
-        this.$store.commit("DEL_TAG_OTHER");
-        this.$store.commit("DEL_OTHER_DETAIL",this.$store.getters.tag);
-     },
-      findTag(value) {
-        let tag, key;
-        this.tagList.map((item, index) => {
-          if (item.value === value) {
-            tag = item;
-            key = index;
-          }
-        });
-        return {tag: tag, key: key};
-      },
-      closeAllTags() {
-        this.contextmenuFlag = false;
-        this.$store.commit("DEL_ALL_TAG");
-        this.$router.push({
-          path: this.$router.$avueRouter.getPath({
-            src: this.tagWel.value
-          }),
-          query: this.tagWel.query
-        });
-        this.$store.commit("DEL_ALL_DETAIL");
-      },
-      clearCacheTags() {
-        this.$confirm("是否需要清除缓存?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          clearCache().then(() => {
-            this.contextmenuFlag = false;
-            this.$message.success('清除完毕');
-          })
-        });
       }
+    },
+    openTag(item) {
+      // this.$confirm('未保存数据是否确认, 是否继续?', '提示', {
+      //   confirmButtonText: '确定',
+      //   cancelButtonText: '取消',
+      //   type: 'warning'
+      // }).then(() => {
+      let tag;
+      if (item.name) {
+        tag = this.findTag(item.name).tag;
+      } else {
+        tag = item;
+      }
+      this.$router.push({
+        path: this.$router.$avueRouter.getPath(
+          {
+            name: tag.label,
+            src: tag.value
+          },
+          tag.meta
+        ),
+        query: tag.query
+      });
+      // }).catch(() => {
+      //   this.active = this.data
+      //   console.log(this.data)
+      //   this.$message({
+      //     type: 'info',
+      //     message: '已取消删除'
+      //   });
+      // });
+    },
+    closeOthersTags() {
+      this.contextmenuFlag = false;
+      this.$store.commit("DEL_TAG_OTHER");
+      this.$store.commit("DEL_OTHER_DETAIL", this.$store.getters.tag);
+    },
+    findTag(value) {
+      let tag, key;
+      this.tagList.map((item, index) => {
+        if (item.value === value) {
+          tag = item;
+          key = index;
+        }
+      });
+      return { tag: tag, key: key };
+    },
+    closeAllTags() {
+      this.contextmenuFlag = false;
+      this.$store.commit("DEL_ALL_TAG");
+      this.$router.push({
+        path: this.$router.$avueRouter.getPath({
+          src: this.tagWel.value
+        }),
+        query: this.tagWel.query
+      });
+      this.$store.commit("DEL_ALL_DETAIL");
+    },
+    clearCacheTags() {
+      this.$confirm("是否需要清除缓存?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        clearCache().then(() => {
+          this.contextmenuFlag = false;
+          this.$message.success("清除完毕");
+        });
+      });
     }
-  };
+  }
+};
 </script>

+ 1 - 0
src/store/getters.js

@@ -30,5 +30,6 @@ const getters = {
   takeStatus: state => state.ifdetail.takeStatus,
   outStatus: state => state.ifdetail.outStatus,
   payStatus: state => state.ifdetail.payStatus,
+  outtaskStatus: state => state.ifdetail.outtaskStatus
 }
 export default getters

+ 14 - 1
src/store/modules/ifdetail.js

@@ -3,7 +3,8 @@ const ifdetail = {
     inStatus: false, //国内
     goStatus: false, //进口发货单
     takeStatus: false, //进口发货单
-    outStatus: false, //出口
+    outStatus: false, //出口发货单
+    outtaskStatus: false, //出口收货单
     payStatus: false //付款
   },
   actions: {},
@@ -44,6 +45,15 @@ const ifdetail = {
     OUT_OUT_DETAIL(state) {
       state.outStatus = false;
     },
+    //出口状态
+    // 进入详情页
+    REC_IN_DETAIL(state) {
+      state.outtaskStatus = true;
+    },
+    //退出详情页
+    REC_OUT_DETAIL(state) {
+      state.outtaskStatus = false;
+    },
     //付款管理
     // 进入详情
     PAY_IN_DETAIL(state) {
@@ -76,6 +86,9 @@ const ifdetail = {
       if (tag.label == '发货单(E)') {
         state.takeStatus = true;
       }
+      if (tag.label == '收货单(E)') {
+        state.outtaskStatus = true;
+      }
       if (tag.label == '付款管理') {
         state.payStatus = true;
       }

+ 105 - 59
src/views/exportTrade/invoice/detailsPage.vue

@@ -11,6 +11,20 @@
           >返回列表
         </el-button>
       </div>
+      <el-button
+        type="info"
+        @click.stop="editCustomer('save')"
+        v-if="form.deliveryStatus == '录入'"
+        class="receipt-customer-btn"
+        >确认发货</el-button
+      >
+      <el-button
+        type="info"
+        @click.stop="editCustomer('repeal')"
+        v-if="form.deliveryStatus != '录入'"
+        class="receipt-customer-btn"
+        >撤销发货</el-button
+      >
       <el-button type="success" class="copy-customer-btn" disabled>
         复制新单
       </el-button>
@@ -18,7 +32,7 @@
         class="el-button--small-yh add-customer-btn"
         type="primary"
         :disabled="disabled"
-        @click="editCustomer"
+        @click="editCustomer('submit')"
         >{{ form.id ? "确认修改" : "确认新增" }}
       </el-button>
     </div>
@@ -215,43 +229,17 @@ import {
   delItem,
   getDeptLazyTree,
   getGoods,
-  getSpecification
+  getSpecification,
+  save,
+  repeal
 } from "@/api/basicData/invoice";
 import uploadFile from "@/components/upload-file/main";
 import reportDialog from "@/components/report-dialog/main";
-import {
-  isvalidatemobile,
-  validatename,
-  micrometerFormat
-} from "@/util/validate";
+import { micrometerFormat } from "@/util/validate";
 import _ from "lodash";
 export default {
   name: "detailsPageEdit",
   data() {
-    const validatePhone = (rule, value, callback) => {
-      if (value != "") {
-        if (isvalidatemobile(value)[0]) {
-          this.$message.error("手机号码格式不正确");
-          callback(new Error(isvalidatemobile(value)[1]));
-        } else {
-          callback();
-        }
-      } else {
-        callback();
-      }
-    };
-    const validateName = (rule, value, callback) => {
-      if (value != "") {
-        if (validatename(value)) {
-          this.$message.error("联系人格式不正确");
-          callback(new Error(validatename(value)));
-        } else {
-          callback();
-        }
-      } else {
-        callback();
-      }
-    };
     return {
       configuration: {
         multipleChoices: false,
@@ -261,7 +249,9 @@ export default {
         dicData: []
       },
       switchDialog: false,
-      form: {},
+      form: {
+        deliveryStatus: "录入"
+      },
       disabled: false,
       dialogVisible: false,
       tableOption: {},
@@ -289,13 +279,20 @@ export default {
           },
           {
             label: "销售订单号",
-            prop: "orderNo",
+            prop: "srcOrderNo",
             span: 8
           },
           {
             label: "订单状态",
             prop: "deliveryStatus",
-            span: 8
+            span: 8,
+            type: "select",
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=order_status",
+            props: {
+              label: "dictValue",
+              value: "dictValue"
+            },
+            disabled: true
           },
           {
             label: "仓库名称",
@@ -316,14 +313,16 @@ export default {
             valueFormat: "yyyy-MM-dd 00:00:00"
           },
           {
-            label: "出库金额",
-            prop: "deliveryAmount",
-            span: 8
-          },
-          {
             label: "出库数量",
             prop: "totalQuantity",
-            span: 8
+            span: 8,
+            disabled: true
+          },
+          {
+            label: "出库金额",
+            prop: "deliveryAmount",
+            span: 8,
+            disabled: true
           },
           {
             label: "费用合计",
@@ -331,21 +330,19 @@ export default {
             span: 8
           },
           {
-            label: "货地址",
+            label: "货地址",
             prop: "arrivalAddress",
             span: 8
           },
           {
             label: "联系人",
             prop: "arrivalContact",
-            span: 8,
-            rules: [{ validator: validateName, trigger: "blur" }]
+            span: 8
           },
           {
             label: "电话",
             prop: "arrivalTel",
-            span: 8,
-            rules: [{ validator: validatePhone, trigger: "blur" }]
+            span: 8
           },
           {
             label: "制单时间",
@@ -396,7 +393,7 @@ export default {
         total: 0
       },
       loading: false,
-      goodsOption:{},
+      goodsOption: {},
       data: [],
       goodsList: [],
       selectionList: [],
@@ -595,7 +592,7 @@ export default {
       this.configuration.dicData = data.corpName;
     },
     //修改提交触发
-    editCustomer() {
+    editCustomer(status) {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
@@ -612,18 +609,60 @@ export default {
             }
           }
           const orderFilesList = this.$refs.uploadFile.submitData();
-          submit({
-            ...this.form,
-            deliveryItemsList: this.data,
-            deliveryFeesList: orderFeesList,
-            deliveryFilesList: orderFilesList
-          }).then(res => {
-            this.$message.success(this.form.id ? "修改成功" : "提交成功");
-            this.form = res.data.data;
-            this.data = res.data.data.deliveryItemsList;
-            this.orderFeesList = res.data.data.deliveryFeesList;
-            this.orderFilesList = res.data.data.deliveryFilesList;
-          });
+          if (status == "submit") {
+            submit({
+              ...this.form,
+              deliveryItemsList: this.data,
+              deliveryFeesList: orderFeesList,
+              deliveryFilesList: orderFilesList
+            }).then(res => {
+              this.$message.success(this.form.id ? "修改成功" : "提交成功");
+              this.form = res.data.data;
+              this.data = res.data.data.deliveryItemsList;
+              this.orderFeesList = res.data.data.deliveryFeesList;
+              this.orderFilesList = res.data.data.deliveryFilesList;
+            });
+          }
+          if (status == "save") {
+            this.$confirm("此操作将确认发货, 是否继续?", "提示", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            }).then(() => {
+              save({
+                ...this.form,
+                deliveryItemsList: this.data,
+                deliveryFeesList: orderFeesList,
+                deliveryFilesList: orderFilesList
+              }).then(res => {
+                this.form = res.data.data;
+                this.data = res.data.data.deliveryItemsList;
+                this.orderFeesList = res.data.data.deliveryFeesList;
+                this.orderFilesList = res.data.data.deliveryFilesList;
+                this.$message.success("提交成功");
+              });
+            });
+          }
+          if (status == "repeal") {
+            this.$confirm("此操作将撤销发货, 是否继续?", "提示", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            }).then(() => {
+              repeal({
+                ...this.form,
+                deliveryItemsList: this.data,
+                deliveryFeesList: orderFeesList,
+                deliveryFilesList: orderFilesList
+              }).then(res => {
+                this.form = res.data.data;
+                this.data = res.data.data.deliveryItemsList;
+                this.orderFeesList = res.data.data.deliveryFeesList;
+                this.orderFilesList = res.data.data.deliveryFilesList;
+                this.$message.success("撤销成功");
+              });
+            });
+          }
         } else {
           return false;
         }
@@ -653,6 +692,8 @@ export default {
             data.forEach(e => {
               qtySum = _.add(qtySum, Number(e.actualQuantity));
               amountSum = _.add(amountSum, Number(e.contractAmount));
+              this.form.totalQuantity = qtySum;
+              this.form.deliveryAmount = amountSum;
             });
             //数量总计
             if (item.property == "actualQuantity") {
@@ -718,6 +759,11 @@ export default {
   font-size: 20px;
   margin-right: 8px;
 }
+.receipt-customer-btn {
+  position: fixed;
+  right: 244px;
+  top: 115px;
+}
 .copy-customer-btn {
   position: fixed;
   right: 140px;

+ 78 - 5
src/views/exportTrade/purchaseContract/detailsPage.vue

@@ -113,6 +113,14 @@
                 @click.stop="openReport()"
                 >报 表</el-button
               >
+              <el-button
+                type="warning"
+                icon="el-icon-plus"
+                size="small"
+                :disabled="detailData.status == 1 || orderItemIds.length == 0"
+                @click="getInvoice"
+                >生成收货单
+              </el-button>
             </template>
             <template slot="menu" slot-scope="{ row, index }">
               <el-button
@@ -479,7 +487,7 @@ export default {
         total: 0
       },
       loading: false,
-      goodsOption:{},
+      goodsOption: {},
       data: [],
       goodsList: [],
       selectionList: [],
@@ -487,7 +495,8 @@ export default {
       orderFeesList: [],
       orderFilesList: [],
       orderItemIds: [],
-      itemtypeList: []
+      itemtypeList: [],
+      goodsSelections: []
     };
   },
   props: {
@@ -505,7 +514,7 @@ export default {
       this.getColumnName(3),
       tableOption
     );
-        this.goodsOption = await this.getColumnData(
+    this.goodsOption = await this.getColumnData(
       this.getColumnName(27),
       goodsOption
     );
@@ -635,11 +644,11 @@ export default {
       this.treeDeptId = "";
     },
     goodsSelectionChange(list) {
+      this.goodsSelections = list;
       this.orderItemIds = [];
       list.map(e => {
         this.orderItemIds.push(e.id);
       });
-      console.log(this.orderItemIds);
     },
     selectionChange(list) {
       this.selectionList = list;
@@ -742,7 +751,7 @@ export default {
             });
             //数量总计
             if (item.property == "orderQuantity") {
-              sums[index] = qtySum ? qtySum.toFixed(2) : '0.00';
+              sums[index] = qtySum ? qtySum.toFixed(2) : "0.00";
             }
             //金额总计
             if (item.property == "amount") {
@@ -753,6 +762,70 @@ export default {
       }
       return sums;
     },
+    getInvoice() {
+      if (!this.form.id) {
+        return this.$message.error("数据未提交,请提交数据");
+      }
+      for (let i = 0; i < this.goodsSelections.length; i++) {
+        if (!this.goodsSelections[i].id) {
+          return this.$message.error("明细表未提交数据,请提交数据");
+        }
+      }
+      if (this.$store.getters.outtaskStatus) {
+        this.$alert("出口发货单存在,请保存发货单再进行操作", "温馨提示", {
+          confirmButtonText: "确定",
+          type: "warning",
+          callback: action => {
+            console.log(action);
+          }
+        });
+      } else {
+        this.inInvoice();
+      }
+    },
+    inInvoice() {
+      const data = this.deepClone(this.form);
+      data.orderItemsList = this.deepClone(this.goodsSelections);
+      data.orderItemsList.forEach(e => {
+        e.actualQuantity = e.orderQuantity;
+        e.contractAmount = e.amount;
+        e.srcId = e.id;
+        e.packageRemarks = e.itemProp;
+        e.productDesc = e.itemDescription;
+        e.specificationAndModele = e.itemType;
+        delete e.id;
+        delete e.version;
+        delete e.status;
+        delete e.createUser;
+        delete e.createTime;
+        delete e.updateUser;
+        delete e.updateTime;
+        delete e.isDeleted;
+      });
+      delete data.id;
+      delete data.version;
+      delete data.status;
+      delete data.createUser;
+      delete data.createTime;
+      delete data.updateUser;
+      delete data.updateTime;
+      delete data.isDeleted;
+      delete data.orderStatus;
+      data.deliveryStatus = "录入";
+      data.srcOrderNo = data.sysNo;
+      delete data.sysNo;
+      data.corpName = data.corpsName;
+      delete data.corpsName;
+      this.$refs.crud.toggleSelection();
+      this.$router.$avueRouter.closeTag("/exportTrade/receipt/index");
+      this.$router.push({
+        path: "/exportTrade/receipt/index",
+        query: {
+          pageType: "Generate",
+          data: JSON.stringify(data)
+        }
+      });
+    },
     async saveColumn() {
       const inSave = await this.saveColumnData(
         this.getColumnName(3),

+ 0 - 7
src/views/exportTrade/receipt/config/customerContact.json

@@ -14,13 +14,6 @@
   "showSummary": true,
   "column": [
     {
-      "label": "销售订单号",
-      "prop": "orgOrderNo",
-      "index": 1,
-      "width": 100,
-      "overHidden": true
-    },
-    {
       "label": "产品类别",
       "prop": "priceCategory",
       "index": 2,

+ 99 - 12
src/views/exportTrade/receipt/detailsPage.vue

@@ -11,6 +11,20 @@
           >返回列表
         </el-button>
       </div>
+      <el-button
+        type="info"
+        @click.stop="editCustomer('save')"
+        v-if="form.deliveryStatus == '录入'"
+        class="receipt-customer-btn"
+        >确认收货</el-button
+      >
+      <el-button
+        type="info"
+        @click.stop="editCustomer('repeal')"
+        v-if="form.deliveryStatus != '录入'"
+        class="receipt-customer-btn"
+        >撤销收货</el-button
+      >
       <el-button type="success" class="copy-customer-btn" disabled>
         复制新单
       </el-button>
@@ -18,7 +32,7 @@
         class="el-button--small-yh add-customer-btn"
         type="primary"
         :disabled="disabled"
-        @click="editCustomer"
+        @click="editCustomer('submit')"
         >{{ form.id ? "确认修改" : "确认新增" }}
       </el-button>
     </div>
@@ -215,7 +229,9 @@ import {
   delItem,
   getDeptLazyTree,
   getGoods,
-  getSpecification
+  getSpecification,
+  save,
+  repeal
 } from "@/api/exportTrade/receipt";
 import uploadFile from "@/components/upload-file/main";
 import reportDialog from "@/components/report-dialog/main";
@@ -295,7 +311,14 @@ export default {
           {
             label: "订单状态",
             prop: "deliveryStatus",
-            span: 8
+            span: 8,
+            type: "select",
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=order_status",
+            props: {
+              label: "dictValue",
+              value: "dictValue"
+            },
+            disabled: true
           },
           {
             label: "仓库名称",
@@ -408,6 +431,9 @@ export default {
       this.getColumnName(29),
       goodsOption
     );
+    if (this.$route.query.pageType == "Generate") {
+      this.getGenerate(JSON.parse(this.$route.query.data));
+    }
     if (this.detailData.id) {
       this.getDetail(this.detailData.id);
     }
@@ -435,6 +461,12 @@ export default {
     });
   },
   methods: {
+    getGenerate(data) {
+      this.form = data;
+      this.data = data.orderItemsList;
+      this.orderFeesList = data.deliveryFeesList ? data.deliveryFeesList : [];
+      this.configuration.dicData = data.corpName;
+    },
     itemTypeFocus(row) {
       this.itemtypeList = [];
       getSpecification({ goodId: row.itemId }).then(res => {
@@ -569,7 +601,7 @@ export default {
       });
     },
     //修改提交触发
-    editCustomer() {
+    editCustomer(status) {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
@@ -586,14 +618,64 @@ export default {
             }
           }
           const orderFilesList = this.$refs.uploadFile.submitData();
-          submit({
-            ...this.form,
-            deliveryItemsList: this.data,
-            deliveryFeesList: orderFeesList,
-            deliveryFilesList: orderFilesList
-          }).then(res => {
-            this.$message.success(this.form.id ? "修改成功" : "提交成功");
-          });
+          if (status == "submit") {
+            submit({
+              ...this.form,
+              deliveryItemsList: this.data,
+              deliveryFeesList: orderFeesList,
+              deliveryFilesList: orderFilesList
+            }).then(res => {
+              this.form = res.data.data;
+              this.data = res.data.data.deliveryItemsList;
+              this.orderFeesList = res.data.data.deliveryFeesList;
+              this.orderFilesList = res.data.data.deliveryFilesList;
+              this.configuration.dicData = this.form.corpName;
+              this.$message.success(this.form.id ? "修改成功" : "提交成功");
+            });
+          }
+          if (status == "save") {
+            console.log("111111");
+            this.$confirm("此操作将确认收货, 是否继续?", "提示", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            }).then(() => {
+              save({
+                ...this.form,
+                deliveryItemsList: this.data,
+                deliveryFeesList: orderFeesList,
+                deliveryFilesList: orderFilesList
+              }).then(res => {
+                this.form = res.data.data;
+                this.data = res.data.data.deliveryItemsList;
+                this.orderFeesList = res.data.data.deliveryFeesList;
+                this.orderFilesList = res.data.data.deliveryFilesList;
+                this.configuration.dicData = this.form.corpName;
+                this.$message.success("提交成功");
+              });
+            });
+          }
+          if (status == "repeal") {
+            this.$confirm("此操作将撤销收货, 是否继续?", "提示", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            }).then(() => {
+              repeal({
+                ...this.form,
+                deliveryItemsList: this.data,
+                deliveryFeesList: orderFeesList,
+                deliveryFilesList: orderFilesList
+              }).then(res => {
+                this.form = res.data.data;
+                this.data = res.data.data.deliveryItemsList;
+                this.orderFeesList = res.data.data.deliveryFeesList;
+                this.orderFilesList = res.data.data.deliveryFilesList;
+                this.configuration.dicData = this.form.corpName;
+                this.$message.success("撤销成功");
+              });
+            });
+          }
         } else {
           return false;
         }
@@ -688,6 +770,11 @@ export default {
   font-size: 20px;
   margin-right: 8px;
 }
+.receipt-customer-btn {
+  position: fixed;
+  right: 244px;
+  top: 115px;
+}
 .copy-customer-btn {
   position: fixed;
   right: 140px;

+ 22 - 1
src/views/exportTrade/receipt/index.vue

@@ -98,6 +98,9 @@ export default {
   components: { detailPage },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(6), option);
+    if (this.$route.query.pageType == "Generate") {
+      this.newAdd();
+    }
     let _this = this;
     this.option.column.forEach(e => {
       if (e.prop == "exchangeRate") {
@@ -118,6 +121,14 @@ export default {
       }
     });
   },
+  activated() {
+    //当页面已打开并无法重新渲染时,用activated重新激活keepalive组件
+    setTimeout(() => {
+      if (this.$route.query.pageType == "Generate" && this.show) {
+        this.newAdd();
+      }
+    }, 100);
+  },
   methods: {
     //删除列表后面的删除按钮触发触发(row, index, done)
     rowDel(row, index, done) {
@@ -142,6 +153,7 @@ export default {
         status: status
       };
       this.show = false;
+      this.$store.commit("REC_IN_DETAIL");
     },
     editOpen(row, status) {
       this.detailData = {
@@ -149,6 +161,7 @@ export default {
         status: status
       };
       this.show = false;
+      this.$store.commit("REC_IN_DETAIL");
     },
     //点击搜索按钮触发
     searchChange(params, done) {
@@ -183,10 +196,18 @@ export default {
     },
     newAdd() {
       this.show = false;
+      this.$store.commit("REC_IN_DETAIL");
     },
     goBack() {
       this.detailData = this.$options.data().detailData;
+      if (this.$route.query.pageType == "Generate") {
+        this.$router.$avueRouter.closeTag();
+        this.$router.push({
+          path: "/exportTrade/receipt/index"
+        });
+      }
       this.show = true;
+      this.$store.commit("REC_OUT_DETAIL");
     },
     summaryMethod({ columns, data }) {
       const sums = [];
@@ -204,7 +225,7 @@ export default {
             data.forEach(e => {
               qtySum = _.add(qtySum, Number(e.totalQuantity));
               instoreSum = _.add(instoreSum, Number(e.deliveryAmount));
-              totalSum= _.add(totalSum, Number(e.totalCost));
+              totalSum = _.add(totalSum, Number(e.totalCost));
             });
             //数量总计
             if (item.property == "totalQuantity") {

+ 11 - 4
src/views/exportTrade/salesContract/config/customerContact.json

@@ -78,9 +78,16 @@
       "overHidden":true
     },
     {
+      "label": "发货数量",
+      "prop": "actualQuantity",
+      "index": 9,
+      "width": 120,
+      "overHidden":true
+    },
+    {
       "label": "计价单位",
       "prop": "unit",
-      "index": 9,
+      "index": 10,
       "width": 120,
       "overHidden":true,
       "cell": true,
@@ -94,21 +101,21 @@
     {
       "label": "单价",
       "prop": "price",
-      "index": 10,
+      "index": 11,
       "width": 120,
       "overHidden":true
     },
     {
       "label": "金额",
       "prop": "amount",
-      "index": 11,
+      "index": 12,
       "width": 120,
       "overHidden":true
     },
     {
       "label": "备注",
       "prop": "remarks",
-      "index": 12,
+      "index": 13,
       "width": 120,
       "overHidden":true,
       "cell": true

+ 13 - 30
src/views/exportTrade/salesContract/detailsPage.vue

@@ -265,34 +265,10 @@ import {
 } from "@/api/basicData/salesContract";
 import _ from "lodash";
 import reportDialog from "@/components/report-dialog/main";
-import { isvalidatemobile, validatename,micrometerFormat } from "@/util/validate";
+import { micrometerFormat } from "@/util/validate";
 export default {
   name: "detailsPageEdit",
   data() {
-    const validatePhone = (rule, value, callback) => {
-      if (value != "") {
-        if (isvalidatemobile(value)[0]) {
-          this.$message.error("手机号码格式不正确");
-          callback(new Error(isvalidatemobile(value)[1]));
-        } else {
-          callback();
-        }
-      } else {
-        callback();
-      }
-    };
-    const validateName = (rule, value, callback) => {
-      if (value != "") {
-        if (validatename(value)) {
-          this.$message.error("联系人格式不正确");
-          callback(new Error(validatename(value)));
-        } else {
-          callback();
-        }
-      } else {
-        callback();
-      }
-    };
     return {
       configuration: {
         multipleChoices: false,
@@ -353,14 +329,12 @@ export default {
           {
             label: "联系人",
             prop: "corpAttn",
-            span: 8,
-            rules: [{ validator: validateName, trigger: "blur" }]
+            span: 8
           },
           {
             label: "电话",
             prop: "corpTel",
-            span: 8,
-            rules: [{ validator: validatePhone, trigger: "blur" }]
+            span: 8
           },
           {
             label: "起运港",
@@ -572,7 +546,7 @@ export default {
       this.getColumnName(5),
       tableOption
     );
-    console.log(this.tableOption)
+    console.log(this.tableOption);
     this.goodsOption = await this.getColumnData(
       this.getColumnName(28),
       goodsOption
@@ -640,6 +614,11 @@ export default {
       }
     },
     quantityChange(row) {
+      console.log(row.orderQuantity, row.actualQuantity);
+      if (Number(row.orderQuantity) < Number(row.actualQuantity)) {
+        row.orderQuantity = row.actualQuantity;
+        this.$message.error("修改的数量不能低于发货数量");
+      }
       if (!row.orderQuantity) {
         row.orderQuantity = 0;
       } else {
@@ -821,6 +800,7 @@ export default {
             data.orderItemsList.forEach(e => {
               e.actualQuantity = e.orderQuantity;
               e.contractAmount = e.amount;
+              e.srcId = e.id;
               delete e.id;
               delete e.version;
               delete e.status;
@@ -839,6 +819,9 @@ export default {
             delete data.updateTime;
             delete data.isDeleted;
             delete data.orderStatus;
+            data.deliveryStatus = "录入";
+            data.srcOrderNo = data.sysNo;
+            delete data.sysNo;
             this.$router.$avueRouter.closeTag("/exportTrade/invoice/index");
             this.$router.push({
               path: "/exportTrade/invoice/index",

+ 16 - 127
src/views/exportTrade/shippingInquiry/detailsPage.vue

@@ -22,26 +22,7 @@
     <div style="margin-top: 60px;margin-bottom:35px">
       <containerTitle title="基础信息"></containerTitle>
       <basic-container style="margin-bottom: 10px">
-        <avue-form ref="form" v-model="form" :option="option">
-          <template slot="corpId">
-            <select-component
-              v-model="form.corpId"
-              :configuration="configuration"
-              :disabled="true"
-            ></select-component>
-          </template>
-          <template slot="exchangeRate">
-            <el-input
-              size="mini"
-              v-model="form.exchangeRate"
-              oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
-              @change="rateChange"
-              placeholder="请输入 汇率"
-              disabled
-              ><template slot="append">%</template></el-input
-            >
-          </template>
-        </avue-form>
+        <avue-form ref="form" v-model="form" :option="option" />
       </basic-container>
       <containerTitle title="商品信息"></containerTitle>
       <basic-container>
@@ -64,6 +45,16 @@
           </template> -->
         </avue-crud>
       </basic-container>
+      <containerTitle title="运费明细"></containerTitle>
+      <basic-container>
+        <avue-crud
+          ref="freightCrud"
+          :data="freightData"
+          :option="freightOption"
+          @row-del="rowDel"
+          @saveColumn="saveFreightColumn"
+        />
+      </basic-container>
       <fee-info
         ref="feeInfo"
         :orderFeesList="orderFeesList"
@@ -132,6 +123,7 @@
 <script>
 import tableOption from "./config/customerContact.json";
 import goodsOption from "./config/commodity.json";
+import freightOption from "./config/commodity.json";
 import feeInfo from "@/components/fee-info/main";
 import {
   detail,
@@ -186,54 +178,19 @@ export default {
       form: {},
       disabled: false,
       dialogVisible: false,
-      tableOption: tableOption,
+      freightOption:freightOption,
+      tableOption:{},
       option: {
         menuBtn: false,
         labelWidth: 100,
         disabled: true,
         column: [
           {
-            label: "客户名称",
-            prop: "corpId",
-            rules: [
-              {
-                required: true,
-                message: "",
-                trigger: "blur"
-              }
-            ],
-            span: 8,
-            slot: true
-          },
-          {
             label: "系统号",
             prop: "sysNo",
             span: 8
           },
           {
-            label: "订单状态",
-            prop: "orderStatus",
-            span: 8,
-            type: "select",
-            dicUrl: "/api/blade-system/dict-biz/dictionary?code=order_status",
-            props: {
-              label: "dictValue",
-              value: "dictValue"
-            }
-          },
-          {
-            label: "联系人",
-            prop: "corpAttn",
-            span: 8,
-            rules: [{ validator: validateName, trigger: "blur" }]
-          },
-          {
-            label: "电话",
-            prop: "corpTel",
-            span: 8,
-            rules: [{ validator: validatePhone, trigger: "blur" }]
-          },
-          {
             label: "起运港",
             prop: "portOfLoad",
             span: 8,
@@ -258,42 +215,7 @@ export default {
             }
           },
           {
-            label: "运输方式",
-            prop: "transport",
-            span: 8,
-            type: "select",
-            dicUrl: "/api/blade-system/dict-biz/dictionary?code=mode_transport",
-            props: {
-              label: "dictValue",
-              value: "dictValue"
-            }
-          },
-          {
-            label: "价格条款",
-            prop: "priceTerms",
-            span: 8,
-            type: "select",
-            dicUrl: "/api/blade-system/dict-biz/dictionary?code=pricing_terms",
-            props: {
-              label: "dictValue",
-              value: "dictValue"
-            }
-          },
-          {
-            label: "条款说明",
-            prop: "priceTermsDescription",
-            span: 8
-          },
-          {
-            label: "订单日期",
-            prop: "businesDate",
-            span: 8,
-            type: "date",
-            format: "yyyy-MM-dd",
-            valueFormat: "yyyy-MM-dd 00:00:00"
-          },
-          {
-            label: "有效日期",
+            label: "计划交期",
             prop: "dateValidity",
             span: 8,
             type: "date",
@@ -301,40 +223,7 @@ export default {
             valueFormat: "yyyy-MM-dd 00:00:00"
           },
           {
-            label: "收款方式",
-            prop: "paymentType",
-            span: 8,
-            type: "select",
-            dicUrl: "/api/blade-system/dict-biz/dictionary?code=payment_term",
-            props: {
-              label: "dictValue",
-              value: "dictValue"
-            }
-          },
-          {
-            label: "收款说明",
-            prop: "paymentTypeDescription",
-            span: 8
-          },
-          {
-            label: "币别",
-            prop: "currency",
-            span: 8,
-            type: "select",
-            dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
-            props: {
-              label: "dictValue",
-              value: "dictValue"
-            }
-          },
-          {
-            label: "汇率",
-            prop: "exchangeRate",
-            span: 8,
-            slot: true
-          },
-          {
-            label: "备注",
+            label: "销售指示",
             prop: "orderRemark",
             type: "textarea",
             minRows: 2,