Browse Source

海运出口

caojunjie 2 years ago
parent
commit
a1be678367

+ 9 - 0
src/views/oceanShipping/maritimeExport/components/appendix.vue

@@ -52,11 +52,20 @@ export default {
       deep: true
     }
   },
+  model: {
+    prop: "value",
+    event: "callBack"
+  },
   async created() {
     this.$nextTick(() => {
       this.formCreate = true;
     })
   },
+  methods:{
+    setVal() {
+      this.$emit("callBack", this.form);
+    }
+  }
 }
 </script>
 

+ 40 - 13
src/views/oceanShipping/maritimeExport/components/businessBill.vue

@@ -21,7 +21,8 @@
       </avue-form>
     </trade-card>
     <trade-card title="箱型箱量">
-      <avue-crud :option="optionBox" v-model="formBox" ref="formBox" :data="form.shippingMatchBoxList" @row-save="rowSave"
+      <avue-crud :option="optionBox" v-model="formBox" ref="formBox" :data="form.shippingMatchBoxList"
+                 @row-save="rowSave"
                  @row-update="rowUpdate"
                  @resetColumn="resetColumnTwo('formBox','optionBox','optionBoxBack',254.1)"
                  @saveColumn="saveColumnTwo('formBox','optionBox','optionBoxBack',254.1)">>
@@ -50,13 +51,15 @@
 </template>
 
 <script>
+import {tradingBox} from "@/api/oceanShipping/maritimeExport";
+
 export default {
   name: "entrustmentInformation",
-  data(){
-    return{
+  data() {
+    return {
       form: {
-        shippingMatchBoxList:[],
-        shippingFeesList:[]
+        shippingMatchBoxList: [],
+        shippingFeesList: []
       },
       optionForm: {
         menuBtn: false,
@@ -64,7 +67,12 @@ export default {
         column: [{
           label: '客户名称',
           span: 12,
-          prop: 'corpId'
+          prop: 'corpId',
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
         }, {
           label: '客户电话',
           prop: 'telephone'
@@ -95,7 +103,7 @@ export default {
           label: '船名',
           prop: 'shipId',
           type: "select",
-          span:12,
+          span: 12,
           cascader: ['voyageNumberId'],
           dicUrl: "/api/blade-box-tube/shippingvessel/listAll",
           props: {
@@ -120,7 +128,7 @@ export default {
               }
             }
           }
-        },{
+        }, {
           label: '提单号',
           prop: 'mainBillNo'
         }, {
@@ -129,7 +137,7 @@ export default {
         }, {
           label: '目的港',
           prop: 'destinationName'
-        },{
+        }, {
           label: '起运地',
           prop: 'deliverGoodsAddressName'
         }, {
@@ -160,8 +168,8 @@ export default {
           valueFormat: "yyyy-MM-dd HH:mm:ss",
         }]
       },
-      formBox:{},
-      shippingMatchBoxList:[],
+      formBox: {},
+      shippingMatchBoxList: [],
       optionBox: {},
       optionBoxBack: {
         align: 'center',
@@ -273,7 +281,7 @@ export default {
         }
         ]
       },
-      formCreate:false
+      formCreate: false
     }
   },
   model: {
@@ -314,7 +322,7 @@ export default {
     })
     this.optionBox = await this.getColumnData(this.getColumnName(254.1), this.optionBoxBack);
   },
-  methods:{
+  methods: {
     setVal() {
       this.$emit("callBack", this.form);
     },
@@ -324,6 +332,25 @@ export default {
     rowUpdate(form, index, done, loading) {
       done(form)
     },
+    rowDelBox(row, index) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+          if (row.id) {
+            tradingBox(row.id).then(res => {
+              this.shippingBoxTypeList.splice(index, 1);
+              this.$message.success("操作成功!");
+            });
+          } else {
+            this.shippingBoxTypeList.splice(index, 1);
+            this.$message.success("操作成功!");
+          }
+        }
+      )
+      ;
+    },
     //自定义列保存
     async saveColumnTwo(ref, option, optionBack, code) {
       /**

+ 14 - 14
src/views/oceanShipping/maritimeExport/components/entrustmentInformation.vue

@@ -70,10 +70,10 @@ export default {
       form: {
         shippingFeesList: [],
         shippingFileList: [],
-        shippingMatchBoxList:[]
+        shippingMatchBoxList: []
       },
-      disabled:false,
-      formBox:{},
+      disabled: false,
+      formBox: {},
       optionBox: {},
       optionBoxBack: {
         align: 'center',
@@ -357,7 +357,7 @@ export default {
       handler(val) {
         if (this.formCreate) {
           this.form = Object.assign(this.value, {});
-        }else {
+        } else {
           this.form = Object.assign(this.value, val || {});
         }
       },
@@ -365,7 +365,7 @@ export default {
       immediate: true
     },
     form: {
-      handler (val) {
+      handler(val) {
         if (this.formCreate) this.setVal();
       },
       deep: true
@@ -377,8 +377,8 @@ export default {
     })
     this.optionBox = await this.getColumnData(this.getColumnName(254.1), this.optionBoxBack);
   },
-  methods:{
-    setVal(){
+  methods: {
+    setVal() {
       this.$emit("callBack", this.form);
     },
     rowDelBox(row, index) {
@@ -387,16 +387,16 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(() => {
-            if (row.id) {
-              tradingBox(row.id).then(res => {
-                this.shippingBoxTypeList.splice(index, 1);
-                this.$message.success("操作成功!");
-              });
-            } else {
+          if (row.id) {
+            tradingBox(row.id).then(res => {
               this.shippingBoxTypeList.splice(index, 1);
               this.$message.success("操作成功!");
-            }
+            });
+          } else {
+            this.shippingBoxTypeList.splice(index, 1);
+            this.$message.success("操作成功!");
           }
+        }
       )
       ;
     },

+ 4 - 0
src/views/oceanShipping/maritimeExport/components/packingDetails.vue

@@ -121,6 +121,10 @@ export default {
       }
     }
   },
+  model: {
+    prop: "value",
+    event: "callBack"
+  },
   watch: {
     value: {
       handler(val) {

+ 21 - 0
src/views/oceanShipping/maritimeExport/components/splitContent.vue

@@ -43,6 +43,8 @@
 </template>
 
 <script>
+import {tradingBox} from "@/api/oceanShipping/maritimeExport";
+
 export default {
   name: "bookingInformation",
   data() {
@@ -267,6 +269,25 @@ export default {
     rowUpdate(form, index, done, loading) {
       done(form)
     },
+    rowDelBox(row, index) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+            if (row.id) {
+              tradingBox(row.id).then(res => {
+                this.shippingBoxTypeList.splice(index, 1);
+                this.$message.success("操作成功!");
+              });
+            } else {
+              this.shippingBoxTypeList.splice(index, 1);
+              this.$message.success("操作成功!");
+            }
+          }
+      )
+      ;
+    },
     //自定义列保存
     async saveColumnTwo(ref, option, optionBack, code) {
       /**

+ 7 - 0
src/views/oceanShipping/maritimeExport/components/ticketDistribution.vue

@@ -136,6 +136,10 @@ export default {
       }
     }
   },
+  model: {
+    prop: "value",
+    event: "callBack"
+  },
   watch: {
     value: {
       handler(val) {
@@ -162,6 +166,9 @@ export default {
     this.optionBox = await this.getColumnData(this.getColumnName(254.5), this.optionBoxBack);
   },
   methods: {
+    setVal() {
+      this.$emit("callBack", this.form);
+    },
     rowSave(form, done, loading) {
       done(form)
     },

+ 65 - 83
src/views/oceanShipping/maritimeExport/detailsPage.vue

@@ -7,9 +7,9 @@
         </el-button>
       </div>
       <div class="add-customer-btn">
-<!--        <el-button class="el-button&#45;&#45;small-yh" style="margin-right: 10px" type="primary" size="small" v-if="!editButton"-->
-<!--                   @click="confirmEditing">编辑-->
-<!--        </el-button>-->
+        <!--        <el-button class="el-button&#45;&#45;small-yh" style="margin-right: 10px" type="primary" size="small" v-if="!editButton"-->
+        <!--                   @click="confirmEditing">编辑-->
+        <!--        </el-button>-->
         <el-button
             class="el-button--small-yh"
             type="primary"
@@ -21,16 +21,16 @@
     <el-tabs style="height: 0;top: 84px" class="customer-head" type="border-card" v-model="activeName">
       <el-tab-pane label="委托信息" name="entrust"></el-tab-pane>
       <el-tab-pane label="订舱信息" name="booking"></el-tab-pane>
-      <el-tab-pane label="业务账单" name="business_bill"></el-tab-pane>
-<!--      <el-tab-pane label="分单内容" name="split_content"></el-tab-pane>-->
-<!--      <el-tab-pane label="分箱明细" name="packing_details"></el-tab-pane>-->
-<!--      <el-tab-pane label="分票列表" name="ticket_distribution"></el-tab-pane>-->
-<!--      <el-tab-pane label="附件" name="appendix"></el-tab-pane>-->
-<!--      <el-tab-pane label="财务账单" name="fourth"></el-tab-pane>-->
-<!--      <el-tab-pane label="提单管理" name="fourth"></el-tab-pane>-->
-<!--      <el-tab-pane label="EDI" name="fourth"></el-tab-pane>-->
-<!--      <el-tab-pane label="场站数据" name="fourth"></el-tab-pane>-->
-<!--      <el-tab-pane label="危险品申报" name="fourth"></el-tab-pane>-->
+      <!--<el-tab-pane label="业务账单" name="business_bill"></el-tab-pane>-->
+      <!--<el-tab-pane label="分单内容" name="split_content"></el-tab-pane>-->
+      <!--<el-tab-pane label="分箱明细" name="packing_details"></el-tab-pane>-->
+      <!--<el-tab-pane label="分票列表" name="ticket_distribution"></el-tab-pane>-->
+      <!--<el-tab-pane label="附件" name="appendix"></el-tab-pane>-->
+      <!--<el-tab-pane label="财务账单" name="fourth"></el-tab-pane>-->
+      <!--<el-tab-pane label="提单管理" name="fourth"></el-tab-pane>-->
+      <!--<el-tab-pane label="EDI" name="fourth"></el-tab-pane>-->
+      <!--<el-tab-pane label="场站数据" name="fourth"></el-tab-pane>-->
+      <!--<el-tab-pane label="危险品申报" name="fourth"></el-tab-pane>-->
     </el-tabs>
     <div style="margin-top: 90px">
       <div v-if="activeName === 'entrust'">
@@ -288,13 +288,7 @@ export default {
             }
           }
         ]
-      },
-      // shippingMatchBoxList:[],
-      // shippingMatchBoxFollowList:[],
-      // shippingFeesList:[],
-      // shippingFileList:[],
-      // shippingBillList:[],
-      // shippingBillDetails:{},
+      }
     }
   },
   async created() {
@@ -302,8 +296,8 @@ export default {
       this.refresh(this.onLoad.id, true)
     } else if (this.onLoad.id) {
       this.refresh(this.onLoad.id, true)
-    }else {
-      found({billType:"HYCK"}).then(res=>{
+    } else {
+      found({billType: "HYCK"}).then(res => {
         this.form = res.data.data
       })
     }
@@ -327,63 +321,51 @@ export default {
     },
     //保存数据
     editCustomer() {
-      this.$refs[this.activeName].$refs["form"].validate((valid, done) => {
-        done()
-        if (valid) {
-          let form = {
-            ...this.form,
-            billType: "HYCK",
-            tradeType: "HY"
-          }
-          const loading = this.$loading({
-            lock: true,
-            text: '加载中',
-            spinner: 'el-icon-loading',
-            background: 'rgba(255,255,255,0.7)'
-          });
-          submit(form).then(res => {
-            this.$message.success("保存成功")
-            loading.close()
-            this.refresh(res.data.data.id)
-          }).catch(() => {
-            loading.close()
-          })
-        }
-      })
-      return
-      this.$refs["form"].validate((valid, done) => {
-        done()
-        if (valid) {
-          this.$refs["formTwo"].validate((valid, done) => {
-            done()
-            if (valid) {
-              let form = {
-                ...this.form,
-                shippingBillDetails: this.shippingBillDetails,
-                shippingBoxTypeList: this.shippingBoxTypeList,
-                shippingMatchBoxList: this.shippingMatchBoxList,
-                shippingFeesList: this.shippingFeesList,
-                shippingFileList: this.shippingFileList,
-                billType: "HYCK",
-                tradeType: "HY"
-              }
-              const loading = this.$loading({
-                lock: true,
-                text: '加载中',
-                spinner: 'el-icon-loading',
-                background: 'rgba(255,255,255,0.7)'
-              });
-              submit(form).then(res => {
-                this.$message.success("保存成功")
-                loading.close()
-                this.refresh(res.data.data.id)
-              }).catch(() => {
-                loading.close()
-              })
+      let data = ["entrust", "booking", "business_bill", "split_content"]
+      if (data.includes(this.activeName)) {
+        this.$refs[this.activeName].$refs["form"].validate((valid, done) => {
+          done()
+          if (valid) {
+            let form = {
+              ...this.form,
+              billType: "HYCK",
+              tradeType: "HY"
             }
-          })
+            const loading = this.$loading({
+              lock: true,
+              text: '加载中',
+              spinner: 'el-icon-loading',
+              background: 'rgba(255,255,255,0.7)'
+            });
+            submit(form).then(res => {
+              this.$message.success("保存成功")
+              loading.close()
+              this.refresh(res.data.data.id)
+            }).catch(() => {
+              loading.close()
+            })
+          }
+        })
+      } else {
+        let form = {
+          ...this.form,
+          billType: "HYCK",
+          tradeType: "HY"
         }
-      })
+        const loading = this.$loading({
+          lock: true,
+          text: '加载中',
+          spinner: 'el-icon-loading',
+          background: 'rgba(255,255,255,0.7)'
+        });
+        submit(form).then(res => {
+          this.$message.success("保存成功")
+          loading.close()
+          this.refresh(res.data.data.id)
+        }).catch(() => {
+          loading.close()
+        })
+      }
     },
     //自定义列保存
     async saveColumnTwo(ref, option, optionBack, code) {
@@ -418,26 +400,26 @@ export default {
 
 <style scoped>
 ::v-deep .el-form-item {
-  margin-bottom: 5px !important;
+    margin-bottom: 5px !important;
 }
 
 ::v-deep .el-tabs__content {
-  display: none !important;
+    display: none !important;
 }
 
 ::v-deep .el-tabs__item {
-  font-size: 12px;
+    font-size: 12px;
 }
 
 ::v-deep .el-tabs__item {
-  color: #000 !important;
+    color: #000 !important;
 }
 
 ::v-deep .el-tabs__item .is-active {
-  color: #409EFF !important;
+    color: #409EFF !important;
 }
 
 ::v-deep .el-form-item__label {
-  color: #409EFF !important;
+    color: #409EFF !important;
 }
 </style>