Browse Source

提交箱管,报关

caojunjie 2 years ago
parent
commit
6da0f589c3

+ 8 - 0
src/api/importTrade/importDeclaration.js

@@ -28,6 +28,14 @@ export const detail = (params) => {
         params: params
     })
 }
+//复制单据查询明细
+export const copyDetail = (params) => {
+    return request({
+        url: '/api/blade-box-tube/declareCustoms/copyCustoms',
+        method:'post',
+        params
+    })
+}
 //新增修改
 export function submit(data){
     return request({

+ 94 - 22
src/views/purchase/exportDeclaration/detailsPage.vue

@@ -21,7 +21,7 @@
           </el-button>
           <el-dropdown-menu slot="dropdown">
             <el-dropdown-item @click.native="pleaseCheck" :disabled="!(form.status === 0)">请核数据</el-dropdown-item>
-            <el-dropdown-item @click.native="checkScheduleDialog = true,checkId = form.id,times = 1">审核进度</el-dropdown-item>
+            <el-dropdown-item @click.native="checkScheduleDialog = true,checkId = form.id,times = 1" :disabled="form.status < 1">审核进度</el-dropdown-item>
             <el-dropdown-item @click.native="repealCancel" :disabled="!(form.status === 1)"
                               v-if="!detailData.id">撤销请核
             </el-dropdown-item>
@@ -34,7 +34,7 @@
           </el-button>
           <el-dropdown-menu slot="dropdown">
             <el-dropdown-item @click.native="pleaseCheck" :disabled="!(form.status === 4)">请核数据</el-dropdown-item>
-            <el-dropdown-item @click.native="checkScheduleDialog = true,checkId = form.id,times = 2">审核进度</el-dropdown-item>
+            <el-dropdown-item @click.native="checkScheduleDialog = true,checkId = form.id,times = 2" :disabled="form.status < 5">审核进度</el-dropdown-item>
             <el-dropdown-item @click.native="repealCancel" :disabled="!(form.status === 5)"
                               v-if="!detailData.id">撤销请核
             </el-dropdown-item>
@@ -218,7 +218,7 @@ import {
   containerItem,
   documentsItem,
   pleaseCheck,
-  repealCancel
+  repealCancel, copyDetail
 } from "@/api/importTrade/importDeclaration.js";
 
 import checkSchedule from "@/components/check/checkSchedule";
@@ -865,26 +865,10 @@ export default {
     selectByName("买箱费").then(res => {
       this.costData = res.data.data
     })
-    //下拉箱号带出对应信息
-    // this.findObject(this.option.column, "code").change = ({value, column}) => {
-    //   selectArchivesList({code: value}).then(res => {
-    //     for (let item of res.data.data) {
-    //       if (value == item.code) {
-    //         this.formTwo = {
-    //           boxSource: item.boxSource,
-    //           boxStatus: item.boxStatus,
-    //           emptyWeight: item.emptyWeight,
-    //           grossWeight: item.gorssWeight,
-    //           tare: item.tare,
-    //           loadingWeight: item.loadingWeight,
-    //           volume: item.volume,
-    //         }
-    //       }
-    //     }
-    //   })
-    // }
     this.key++
-    if (this.onLoad.id && this.detailData.id) {
+    if (this.onLoad.id.slice(0, 2) === '复制'){
+      this.copyData(this.onLoad.id.slice(2, this.onLoad.id.length), false)
+    } else if (this.onLoad.id && this.detailData.id) {
       this.refresh(this.onLoad.id, true)
     } else if (this.onLoad.id) {
       this.refresh(this.onLoad.id, true)
@@ -1084,6 +1068,94 @@ export default {
     choceScheduleFun() {
       this.checkScheduleDialog = false
     },
+    copyData(id, type){
+      const loading = this.$loading({
+        lock: true,
+        text: '加载中',
+        spinner: 'el-icon-loading',
+        background: 'rgba(255,255,255,0.7)'
+      });
+      copyDetail({id: id}).then(res => {
+        this.form = res.data.data
+        this.dataList = res.data.data.itemList
+        this.dataListTwo = res.data.data.feesList
+        this.tradingBoxFilesList = res.data.data.fileList
+        this.containerList = res.data.data.containerList
+        this.documentsList = res.data.data.documentsList
+        delete this.form.containerList
+        delete this.form.documentsList
+        delete this.form.itemList
+        delete this.form.feesList
+        delete this.form.fileList
+        loading.close();
+        if (type) {
+          //基础资料
+          this.$set(this.optionForm, "disabled", true)
+          //箱信息
+          this.$set(this.option, "disabled", true)
+          this.$set(this.option, "addBtn", false)
+          this.$set(this.option, "menu", false)
+          //集装箱
+          this.$set(this.optionTwo, "disabled", true)
+          this.$set(this.optionTwo, "addBtn", false)
+          this.$set(this.optionTwo, "menu", false)
+          //单证
+          this.$set(this.optionThree, "disabled", true)
+          this.$set(this.optionThree, "addBtn", false)
+          this.$set(this.optionThree, "menu", false)
+          //费用信息
+          this.$set(this.$refs.boxCost.option, "disabled", true)
+          this.$set(this.$refs.boxCost.option, "addBtn", false)
+          this.$set(this.$refs.boxCost.option, "menu", false)
+          //附件和顶部按钮
+          this.disabled = true
+        } else {
+          if (this.form.status > 0) {
+            //基础资料
+            this.$set(this.optionForm, "disabled", true)
+            //箱信息
+            this.$set(this.option, "disabled", true)
+            this.$set(this.option, "addBtn", false)
+            this.$set(this.option, "menu", false)
+            //集装箱
+            this.$set(this.optionTwo, "disabled", true)
+            this.$set(this.optionTwo, "addBtn", false)
+            this.$set(this.optionTwo, "menu", false)
+            //单证
+            this.$set(this.optionThree, "disabled", true)
+            this.$set(this.optionThree, "addBtn", false)
+            this.$set(this.optionThree, "menu", false)
+            //费用信息
+            this.$set(this.$refs.boxCost.option, "disabled", true)
+            this.$set(this.$refs.boxCost.option, "addBtn", false)
+            this.$set(this.$refs.boxCost.option, "menu", false)
+            //附件和顶部按钮
+            this.disabled = true
+          } else {
+            //基础资料
+            this.$set(this.optionForm, "disabled", false)
+            //箱信息
+            this.$set(this.option, "disabled", false)
+            this.$set(this.option, "addBtn", true)
+            this.$set(this.option, "menu", true)
+            //集装箱
+            this.$set(this.optionTwo, "disabled", false)
+            this.$set(this.optionTwo, "addBtn", true)
+            this.$set(this.optionTwo, "menu", true)
+            //单证
+            this.$set(this.optionThree, "disabled", false)
+            this.$set(this.optionThree, "addBtn", true)
+            this.$set(this.optionThree, "menu", true)
+            //费用信息
+            this.$set(this.$refs.boxCost.option, "disabled", false)
+            this.$set(this.$refs.boxCost.option, "addBtn", true)
+            this.$set(this.$refs.boxCost.option, "menu", true)
+            //附件和顶部按钮
+            this.disabled = false
+          }
+        }
+      })
+    },
     refresh(id, type) {
       const loading = this.$loading({
         lock: true,

+ 38 - 2
src/views/purchase/exportDeclaration/index.vue

@@ -11,6 +11,7 @@
           :key="key"
           @on-load="onLoad"
           @search-change="searchChange"
+          @selection-change="selectionChange"
           @row-del="rowDel"
           @refresh-change="refreshChange"
           @resetColumn="resetColumnTwo('crud','option','optionList',248)"
@@ -23,8 +24,8 @@
         </template>
         <template slot-scope="{type,size,row,$index}" slot="menuLeft">
           <el-button icon="el-icon-plus" type="primary" :size="size" @click="detailsOpen = true">创建单据</el-button>
-          <el-button class="el-icon-document-copy" type="success" size="small">复制单据</el-button>
-          <el-button class="el-icon-download" type="warning" size="small">导出</el-button>
+          <el-button class="el-icon-document-copy" type="success" size="small" :disabled="!(selectionList.length === 1)" @click="copyData">复制单据</el-button>
+          <el-button class="el-icon-download" type="warning" size="small" @click="outExport">导出</el-button>
         </template>
       </avue-crud>
     </basic-container>
@@ -35,6 +36,7 @@
 <script>
 import {getList, remove} from "@/api/importTrade/importDeclaration.js";
 import detailsPage from "./detailsPage"
+import {getToken} from "@/util/auth";
 
 export default {
   name: "index",
@@ -48,6 +50,7 @@ export default {
       search: {},
       form: {},
       dataList: [],
+      selectionList: [],
       detailData: {},
       page: {
         pageSize: 20,
@@ -64,6 +67,7 @@ export default {
         addBtn: false,
         index: true,
         span: 8,
+        selection: true,
         border: true,
         height:"auto",
         searchMenuPosition: "right",
@@ -169,6 +173,38 @@ export default {
     }
   },
   methods: {
+    copyData(){
+      this.form = {id:`复制${this.selectionList[0].id}`}
+      this.detailsOpen = true
+    },
+    selectionChange(list){
+      this.selectionList = list
+    },
+    outExport() {
+      let config = {params: {...this.search}}
+      if (config.params) {
+        for (const propName of Object.keys(config.params)) {
+          const value = config.params[propName];
+          if (value !== null && typeof (value) !== "undefined") {
+            if (value instanceof Array) {
+              for (const key of Object.keys(value)) {
+                let params = propName + '[' + key + ']';
+                config.params[params] = value[key]
+              }
+              delete config.params[propName]
+            }
+          }
+        }
+      }
+      const routeData = this.$router.resolve({
+        path: '/api/blade-box-tube/declareCustoms/exort',      //跳转目标窗口的地址
+        query: {
+          ...config.params,    //括号内是要传递给新窗口的参数
+          importExportSigns: "BGCK"
+        }
+      })
+      window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
+    },
     check(row){
       this.form = row
       this.detailsOpen = true

+ 99 - 31
src/views/purchase/importDeclaration/detailsPage.vue

@@ -21,11 +21,9 @@
           </el-button>
           <el-dropdown-menu slot="dropdown">
             <el-dropdown-item @click.native="pleaseCheck" :disabled="!(form.status === 0)">请核数据</el-dropdown-item>
-            <el-dropdown-item @click.native="checkScheduleDialog = true,checkId = form.id,times = 1">审核进度</el-dropdown-item>
-            <el-dropdown-item @click.native="repealCancel" :disabled="!(form.status === 1)"
-                              v-if="!detailData.id">撤销请核
-            </el-dropdown-item>
-            <!--            <el-dropdown-item @click.native="changeApproveOpen">特殊审批</el-dropdown-item>-->
+            <el-dropdown-item @click.native="checkScheduleDialog = true,checkId = form.id,times = 1" :disabled="form.status < 1">审核进度</el-dropdown-item>
+            <el-dropdown-item @click.native="repealCancel" :disabled="!(form.status === 1)" v-if="!detailData.id">撤销请核</el-dropdown-item>
+            <!--             <el-dropdown-item @click.native="changeApproveOpen">特殊审批</el-dropdown-item>-->
           </el-dropdown-menu>
         </el-dropdown>
         <el-dropdown style="margin-right: 10px">
@@ -34,15 +32,13 @@
           </el-button>
           <el-dropdown-menu slot="dropdown">
             <el-dropdown-item @click.native="pleaseCheck" :disabled="!(form.status === 4)">请核数据</el-dropdown-item>
-            <el-dropdown-item @click.native="checkScheduleDialog = true,checkId = form.id,times = 2">审核进度</el-dropdown-item>
-            <el-dropdown-item @click.native="repealCancel" :disabled="!(form.status === 5)"
-                              v-if="!detailData.id">撤销请核
+            <el-dropdown-item @click.native="checkScheduleDialog = true,checkId = form.id,times = 2" :disabled="form.status < 5">审核进度</el-dropdown-item>
+            <el-dropdown-item @click.native="repealCancel" :disabled="!(form.status === 5)" v-if="!detailData.id">撤销请核
             </el-dropdown-item>
             <!--            <el-dropdown-item @click.native="changeApproveOpen">特殊审批</el-dropdown-item>-->
           </el-dropdown-menu>
         </el-dropdown>
-        <el-button class="el-button--small-yh" type="primary" size="small" :disabled="form.status>0"
-                   @click="editCustomer">
+        <el-button class="el-button--small-yh" type="primary" size="small" :disabled="form.status>0" @click="editCustomer">
           保存数据
         </el-button>
       </div>
@@ -52,7 +48,7 @@
         <!--        <template slot="purchaseCompanyId" slot-scope="scope">-->
         <!--          <crop-select v-model="form.purchaseCompanyId"-->
         <!--                       @getCorpData="(row)=>{getGSData(row,['form','purchaseCompanyName'])}" :disabled="scope.disabled"-->
-        <!--                       corpType="KH"/>-->
+        <!--         .              corpType="KH"/>-->
         <!--        </template>-->
         <template slot="domesticNo" slot-scope="scope">
           <crop-select v-model="form.domesticNo"
@@ -218,7 +214,7 @@ import {
   containerItem,
   documentsItem,
   pleaseCheck,
-  repealCancel
+  repealCancel, copyDetail
 } from "@/api/importTrade/importDeclaration.js";
 
 import checkSchedule from "@/components/check/checkSchedule";
@@ -873,26 +869,10 @@ export default {
     selectByName("买箱费").then(res => {
       this.costData = res.data.data
     })
-    //下拉箱号带出对应信息
-    // this.findObject(this.option.column, "code").change = ({value, column}) => {
-    //   selectArchivesList({code: value}).then(res => {
-    //     for (let item of res.data.data) {
-    //       if (value == item.code) {
-    //         this.formTwo = {
-    //           boxSource: item.boxSource,
-    //           boxStatus: item.boxStatus,
-    //           emptyWeight: item.emptyWeight,
-    //           grossWeight: item.gorssWeight,
-    //           tare: item.tare,
-    //           loadingWeight: item.loadingWeight,
-    //           volume: item.volume,
-    //         }
-    //       }
-    //     }
-    //   })
-    // }
     this.key++
-    if (this.onLoad.id && this.detailData.id) {
+    if (this.onLoad.id.slice(0, 2) === '复制'){
+      this.copyData(this.onLoad.id.slice(2, this.onLoad.id.length), false)
+    } else if (this.onLoad.id && this.detailData.id) {
       this.refresh(this.onLoad.id, true)
     } else if (this.onLoad.id) {
       this.refresh(this.onLoad.id, true)
@@ -1180,6 +1160,94 @@ export default {
         }
       })
     },
+    copyData(id, type){
+      const loading = this.$loading({
+        lock: true,
+        text: '加载中',
+        spinner: 'el-icon-loading',
+        background: 'rgba(255,255,255,0.7)'
+      });
+      copyDetail({id: id}).then(res => {
+        this.form = res.data.data
+        this.dataList = res.data.data.itemList
+        this.dataListTwo = res.data.data.feesList
+        this.tradingBoxFilesList = res.data.data.fileList
+        this.containerList = res.data.data.containerList
+        this.documentsList = res.data.data.documentsList
+        delete this.form.containerList
+        delete this.form.documentsList
+        delete this.form.itemList
+        delete this.form.feesList
+        delete this.form.fileList
+        loading.close();
+        if (type) {
+          //基础资料
+          this.$set(this.optionForm, "disabled", true)
+          //箱信息
+          this.$set(this.option, "disabled", true)
+          this.$set(this.option, "addBtn", false)
+          this.$set(this.option, "menu", false)
+          //集装箱
+          this.$set(this.optionTwo, "disabled", true)
+          this.$set(this.optionTwo, "addBtn", false)
+          this.$set(this.optionTwo, "menu", false)
+          //单证
+          this.$set(this.optionThree, "disabled", true)
+          this.$set(this.optionThree, "addBtn", false)
+          this.$set(this.optionThree, "menu", false)
+          //费用信息
+          this.$set(this.$refs.boxCost.option, "disabled", true)
+          this.$set(this.$refs.boxCost.option, "addBtn", false)
+          this.$set(this.$refs.boxCost.option, "menu", false)
+          //附件和顶部按钮
+          this.disabled = true
+        } else {
+          if (this.form.status > 0) {
+            //基础资料
+            this.$set(this.optionForm, "disabled", true)
+            //箱信息
+            this.$set(this.option, "disabled", true)
+            this.$set(this.option, "addBtn", false)
+            this.$set(this.option, "menu", false)
+            //集装箱
+            this.$set(this.optionTwo, "disabled", true)
+            this.$set(this.optionTwo, "addBtn", false)
+            this.$set(this.optionTwo, "menu", false)
+            //单证
+            this.$set(this.optionThree, "disabled", true)
+            this.$set(this.optionThree, "addBtn", false)
+            this.$set(this.optionThree, "menu", false)
+            //费用信息
+            this.$set(this.$refs.boxCost.option, "disabled", true)
+            this.$set(this.$refs.boxCost.option, "addBtn", false)
+            this.$set(this.$refs.boxCost.option, "menu", false)
+            //附件和顶部按钮
+            this.disabled = true
+          } else {
+            //基础资料
+            this.$set(this.optionForm, "disabled", false)
+            //箱信息
+            this.$set(this.option, "disabled", false)
+            this.$set(this.option, "addBtn", true)
+            this.$set(this.option, "menu", true)
+            //集装箱
+            this.$set(this.optionTwo, "disabled", false)
+            this.$set(this.optionTwo, "addBtn", true)
+            this.$set(this.optionTwo, "menu", true)
+            //单证
+            this.$set(this.optionThree, "disabled", false)
+            this.$set(this.optionThree, "addBtn", true)
+            this.$set(this.optionThree, "menu", true)
+            //费用信息
+            this.$set(this.$refs.boxCost.option, "disabled", false)
+            this.$set(this.$refs.boxCost.option, "addBtn", true)
+            this.$set(this.$refs.boxCost.option, "menu", true)
+            //附件和顶部按钮
+            this.disabled = false
+          }
+        }
+      })
+    },
     //新增修改
     editCustomer() {
       this.$refs["form"].validate((valid, done) => {

+ 38 - 2
src/views/purchase/importDeclaration/index.vue

@@ -11,6 +11,7 @@
           :key="key"
           @on-load="onLoad"
           @search-change="searchChange"
+          @selection-change="selectionChange"
           @row-del="rowDel"
           @refresh-change="refreshChange"
           @resetColumn="resetColumnTwo('crud','option','optionList',246)"
@@ -23,8 +24,8 @@
         </template>
         <template slot-scope="{type,size,row,$index}" slot="menuLeft">
           <el-button icon="el-icon-plus" type="primary" :size="size" @click="detailsOpen = true">创建单据</el-button>
-          <el-button class="el-icon-document-copy" type="success" size="small">复制单据</el-button>
-          <el-button class="el-icon-download" type="warning" size="small">导出</el-button>
+          <el-button class="el-icon-document-copy" type="success" size="small" :disabled="!(selectionList.length === 1)" @click="copyData">复制单据</el-button>
+          <el-button class="el-icon-download" type="warning" size="small" @click="outExport">导出</el-button>
         </template>
       </avue-crud>
     </basic-container>
@@ -35,6 +36,7 @@
 <script>
 import {getList, remove} from "@/api/importTrade/importDeclaration.js";
 import detailsPage from "./detailsPage"
+import {getToken} from "@/util/auth";
 
 export default {
   name: "index",
@@ -48,6 +50,7 @@ export default {
       search: {},
       form: {},
       dataList: [],
+      selectionList: [],
       detailData: {},
       page: {
         pageSize: 20,
@@ -65,6 +68,7 @@ export default {
         index: true,
         span: 8,
         border: true,
+        selection: true,
         height:"auto",
         searchMenuPosition: "right",
         align: "center",
@@ -169,6 +173,38 @@ export default {
     }
   },
   methods: {
+    copyData(){
+      this.form = {id:`复制${this.selectionList[0].id}`}
+      this.detailsOpen = true
+    },
+    selectionChange(list){
+      this.selectionList = list
+    },
+    outExport() {
+      let config = {params: {...this.search}}
+      if (config.params) {
+        for (const propName of Object.keys(config.params)) {
+          const value = config.params[propName];
+          if (value !== null && typeof (value) !== "undefined") {
+            if (value instanceof Array) {
+              for (const key of Object.keys(value)) {
+                let params = propName + '[' + key + ']';
+                config.params[params] = value[key]
+              }
+              delete config.params[propName]
+            }
+          }
+        }
+      }
+      const routeData = this.$router.resolve({
+        path: '/api/blade-box-tube/declareCustoms/exort',      //跳转目标窗口的地址
+        query: {
+          ...config.params,    //括号内是要传递给新窗口的参数
+          importExportSigns: "BGJK"
+        }
+      })
+      window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
+    },
     check(row){
       this.form = row
       this.detailsOpen = true