Browse Source

提交中电、箱管

caojunjie 2 years ago
parent
commit
8e91307afd

+ 8 - 0
src/api/boxManagement/exportShipment/index.js

@@ -42,6 +42,14 @@ export function submit(data){
         data
     })
 }
+// 堆存
+export function generateStack(data){
+    return request({
+        url:'/api/blade-box-tube/transfer/submit',
+        method:'post',
+        data
+    })
+}
 //修改轨迹
 export function update(data){
     return request({

+ 131 - 0
src/api/boxManagement/stockpilingManage/index.js

@@ -0,0 +1,131 @@
+import request from '@/router/axios';
+//查询箱号
+export const selectArchivesList = (params) => {
+  return request({
+    url: '/api/blade-box-tube/archives/selectArchivesList',
+    method: 'get',
+    params: params
+  })
+}
+//查询列表
+export const getList = (params) => {
+  return request({
+    url: '/api/blade-box-tube/transfer/list',
+    method: 'get',
+    params: params
+  })
+}
+//查询明细
+export const detail = (params) => {
+  return request({
+    url: '/api/blade-box-tube/transfer/detail',
+    method: 'get',
+    params: params
+  })
+}
+//查询明细表单
+export const itemDetails = (params) => {
+  return request({
+    url: '/api/blade-box-tube/tradingBoxRent/itemDetails',
+    method: 'get',
+    params: params
+  })
+}
+//删除
+export const remove = (ids) => {
+  return request({
+    url: '/api/blade-box-tube/tradingBox/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+//删除图片
+export const tradingBoxFiles = (ids) => {
+  return request({
+    url: '/api/blade-box-tube/tradingBoxFiles/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+//删除明细
+export const tradingBoxItem = (ids) => {
+  return request({
+    url: '/api/blade-box-tube/tradingBoxItem/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+//删除费用明细
+export const tradingBoxFees = (ids) => {
+  return request({
+    url: '/api/blade-box-tube/tradingBoxFees/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+//新增删除
+export function submit(data){
+  return request({
+    url:'/api/blade-box-tube/transfer/submit',
+    method:'post',
+    data
+  })
+}
+
+// 请核
+export function pleaseCheck(data) {
+  return request({
+    url: '/api/blade-box-tube/tradingBox/checkTradingBox',
+    method: 'post',
+    data: data
+  })
+}
+// 撤销
+export function repealCancel(data) {
+  return request({
+    url: '/api/blade-box-tube/tradingBox/withdrawTradingBox',
+    method: 'post',
+    data: data
+  })
+}
+
+// 起租退租
+export function statusUpdate(data) {
+  return request({
+    url: '/api/blade-box-tube/tradingBoxRent/startingRent',
+    method: 'post',
+    data:data
+  })
+}
+// 计算
+export function calculateRent(data) {
+  return request({
+    url: '/api/blade-box-tube/transfer/rentCalculation',
+    method: 'post',
+    data:data
+  })
+}
+// 撤销计算
+export function revokeRent(data) {
+  return request({
+    url: '/api/blade-box-tube/transfer/revokeRentCalculation',
+    method: 'post',
+    data:data
+  })
+}
+// 撤销退租
+export function revokeRentingOut(data) {
+  return request({
+    url: '/api/blade-box-tube/tradingBoxRent/revokeRentingOut',
+    method: 'post',
+    data:data
+  })
+}

+ 16 - 3
src/enums/column-name.js

@@ -1122,12 +1122,12 @@ const columnName = [{
     code: 248.2,
     name: '出口-出口报关-集装箱'
   }, {
-    code: 248.21,
-    name: '出口-出口报关-单证'
-  }, {
     code: 248.3,
     name: '出口-出口报关-附件'
   }, {
+    code: 248.21,
+    name: '出口-出口报关-单证'
+  }, {
     code: 249,
     name: '产品上架'
   },
@@ -1138,6 +1138,19 @@ const columnName = [{
   {
     code: 251,
     name: '收款结算(Z)'
+  },
+  {
+    code: 252,
+    name: '箱管理-堆存管理'
+  }, {
+    code: 252.1,
+    name: '箱管理-堆存管理-商品'
+  }, {
+    code: 252.2,
+    name: '出箱管理-堆存管理-集装箱'
+  }, {
+    code: 252.3,
+    name: '箱管理-堆存管理-附件'
   }
 ]
 export const getColumnName = (key) => {

+ 7 - 0
src/option/system/dictbiz.js

@@ -206,6 +206,13 @@ export const optionChild = {
       label: "字典备注",
       prop: "remark",
       hide: true
+    },{
+      label: '颜色',
+      prop: 'colour',
+      type: 'color',
+      hide: true,
+      colorFormat:"hex",
+      showAlpha:false
     }
   ]
 };

+ 101 - 22
src/views/boxManagement/exportShipment/detailsPage.vue

@@ -101,6 +101,10 @@
               <el-dropdown-item @click.native="statusUpdate('2','空箱入场')">空箱入场</el-dropdown-item>
             </el-dropdown-menu>
           </el-dropdown>
+          <el-button style="margin-left: 0" type="success" size="small"
+                     :disabled="option.disabled || (selectionList.findIndex(function(item){return item.status == '待使用' && item.stockpilingStatus == '1'}) == -1?true:false)"
+                     @click="stockpiling()">堆存
+          </el-button>
         </template>
         <template slot="addressForm" slot-scope="scope">
           <port-info v-model="formTwo.addressId" type="id" :disabled="scope.disabled"
@@ -188,7 +192,19 @@
         v-if="dialogVisible"
         width="60%">
       <span>
-        <avue-form :option="optionState" v-model="formState" ref="formState">
+        <avue-form v-if="title == '堆存'" :option="optionStateTwo" v-model="formState" ref="formState">
+          <template slot="addressId" slot-scope="scope">
+            <port-info v-model="formState.addressId" type="id" :disabled="scope.disabled"
+                       @balabalaTow="(val)=>{balabala(val,['formState','address'])}"/>
+          </template>
+          <template slot="purchaseCompanyId" slot-scope="scope">
+          <crop-select v-model="formState.purchaseCompanyId"
+                       @getCorpData="(row)=>{getGSData(row,['formState','purchaseCompanyName'])}"
+                       :disabled="scope.disabled"
+                       corpType="KH"/>
+        </template>
+        </avue-form>
+        <avue-form v-else :option="optionState" v-model="formState" ref="formState">
           <template slot="addressId" slot-scope="scope">
             <port-info v-model="formState.addressId" type="id" :disabled="scope.disabled"
                        @balabalaTow="(val)=>{balabala(val,['formState','address'])}"/>
@@ -244,6 +260,7 @@
 import {
   detail,
   submit,
+  generateStack,
   tradingBoxItem,
   tradingBoxFees,
   pleaseCheck,
@@ -393,6 +410,27 @@ export default {
       },
       dataTrackList: [],
       formSearch: {},
+      optionStateTwo: {
+        menuBtn: false,
+        span: 12,
+        column: [{
+          label: '堆存地点',
+          prop: 'addressId',
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '付费对象',
+          prop: 'purchaseCompanyId',
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }]
+      },
       optionState: {
         menuBtn: false,
         span: 12,
@@ -791,6 +829,11 @@ export default {
     this.key++
   },
   methods: {
+    //堆存
+    stockpiling() {
+      this.title = "堆存"
+      this.dialogVisible = true
+    },
     //关闭审核
     choceCheckFun() {
       this.checkDialog = false;
@@ -905,28 +948,64 @@ export default {
       }
     },
     confirmChange() {
-      let data = []
-      for (let item of this.selectionList) {
-        data.push(item.id)
-      }
-      this.$refs["formState"].validate((valid, done) => {
-        done()
-        if (valid) {
-          this.disabledVisible = true
-          statusUpdate({
-            ...this.formState,
-            ids: data.join(',')
-          }).then(res => {
-            this.$message.success("操作成功")
-            this.dialogVisible = false
-            this.disabledVisible = false
-            this.formState = {}
-            this.refresh(this.form.id)
-          }).catch(()=>{
-            this.disabledVisible = false
-          })
+      if (this.title == "堆存") {
+        this.$refs["formState"].validate((valid, done) => {
+          done()
+          if (valid) {
+            let data = {
+              ...this.form,
+              type:"DCF",
+              source:"CKZY",
+              ...this.formState,
+              purchaseCompanyId:this.form.corpId,
+              purchaseCompanyName:this.form.corpName,
+              tradingBoxItemsList: this.dataList,
+            }
+            // data.tradingBoxItemsList.forEach(item=> delete item.id)
+            delete data.id
+            const loading = this.$loading({
+              lock: true,
+              text: '加载中',
+              spinner: 'el-icon-loading',
+              background: 'rgba(255,255,255,0.7)'
+            });
+            generateStack(data).then(res => {
+              this.$message.success("生成堆存成功")
+              this.dialogVisible = false
+              this.disabledVisible = false
+              this.formState = {}
+              this.selectionList = []
+              loading.close();
+              this.refresh(this.form.id)
+            }).catch(()=>{
+              loading.close();
+            })
+          }
+        })
+      } else {
+        let data = []
+        for (let item of this.selectionList) {
+          data.push(item.id)
         }
-      })
+        this.$refs["formState"].validate((valid, done) => {
+          done()
+          if (valid) {
+            this.disabledVisible = true
+            statusUpdate({
+              ...this.formState,
+              ids: data.join(',')
+            }).then(res => {
+              this.$message.success("操作成功")
+              this.dialogVisible = false
+              this.disabledVisible = false
+              this.formState = {}
+              this.refresh(this.form.id)
+            }).catch(() => {
+              this.disabledVisible = false
+            })
+          }
+        })
+      }
     },
     statusUpdate(status, type) {
       if (this.form.id) {

+ 101 - 23
src/views/boxManagement/importReturnTrip/detailsPage.vue

@@ -100,6 +100,10 @@
               <el-dropdown-item @click.native="statusUpdate('2','空箱入场')">空箱入场</el-dropdown-item>
             </el-dropdown-menu>
           </el-dropdown>
+          <el-button style="margin-left: 0" type="success" size="small"
+                     :disabled="option.disabled || (selectionList.findIndex(function(item){return item.status == '待使用' && item.stockpilingStatus == '1'}) == -1?true:false)"
+                     @click="stockpiling()">堆存
+          </el-button>
         </template>
         <template slot="addressForm" slot-scope="scope">
           <port-info v-model="formTwo.addressId" type="id" :disabled="scope.disabled"
@@ -187,7 +191,19 @@
         v-if="dialogVisible"
         width="60%">
       <span>
-        <avue-form :option="optionState" v-model="formState" ref="formState">
+        <avue-form v-if="title == '堆存'" :option="optionStateTwo" v-model="formState" ref="formState">
+          <template slot="addressId" slot-scope="scope">
+            <port-info v-model="formState.addressId" type="id" :disabled="scope.disabled"
+                       @balabalaTow="(val)=>{balabala(val,['formState','address'])}"/>
+          </template>
+          <template slot="purchaseCompanyId" slot-scope="scope">
+          <crop-select v-model="formState.purchaseCompanyId"
+                       @getCorpData="(row)=>{getGSData(row,['formState','purchaseCompanyName'])}"
+                       :disabled="scope.disabled"
+                       corpType="KH"/>
+        </template>
+        </avue-form>
+        <avue-form v-else :option="optionState" v-model="formState" ref="formState">
           <template slot="addressId" slot-scope="scope">
             <port-info v-model="formState.addressId" type="id" :disabled="scope.disabled"
                        @balabalaTow="(val)=>{balabala(val,['formState','address'])}"/>
@@ -246,7 +262,7 @@ import {
   tradingBoxItem,
   tradingBoxFees,
   pleaseCheck,
-  repealCancel, statusUpdate, archivestrajectory, update, tradingBoxGJ
+  repealCancel, statusUpdate, archivestrajectory, update, tradingBoxGJ, generateStack
 } from "@/api/boxManagement/exportShipment/index.js";
 
 import checkSchedule from "@/components/check/checkSchedule";
@@ -392,6 +408,27 @@ export default {
       },
       dataTrackList: [],
       formSearch: {},
+      optionStateTwo: {
+        menuBtn: false,
+        span: 12,
+        column: [{
+          label: '堆存地点',
+          prop: 'addressId',
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '付费对象',
+          prop: 'purchaseCompanyId',
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }]
+      },
       optionState: {
         menuBtn: false,
         span: 12,
@@ -795,6 +832,11 @@ export default {
     this.key++
   },
   methods: {
+    //堆存
+    stockpiling() {
+      this.title = "堆存"
+      this.dialogVisible = true
+    },
     //关闭审核
     choceCheckFun() {
       this.checkDialog = false;
@@ -909,28 +951,64 @@ export default {
       }
     },
     confirmChange() {
-      let data = []
-      for (let item of this.selectionList) {
-        data.push(item.id)
-      }
-      this.$refs["formState"].validate((valid, done) => {
-        done()
-        if (valid) {
-          this.disabledVisible = true
-          statusUpdate({
-            ...this.formState,
-            ids: data.join(',')
-          }).then(res => {
-            this.$message.success("操作成功")
-            this.dialogVisible = false
-            this.disabledVisible = false
-            this.formState = {}
-            this.refresh(this.form.id)
-          }).catch(()=>{
-            this.disabledVisible = false
-          })
+      if (this.title == "堆存") {
+        this.$refs["formState"].validate((valid, done) => {
+          done()
+          if (valid) {
+            let data = {
+              ...this.form,
+              type: "DCF",
+              source: "JKFZ",
+              ...this.formState,
+              purchaseCompanyId: this.form.corpId,
+              purchaseCompanyName: this.form.corpName,
+              tradingBoxItemsList: this.dataList,
+            }
+            // data.tradingBoxItemsList.forEach(item=> delete item.id)
+            delete data.id
+            const loading = this.$loading({
+              lock: true,
+              text: '加载中',
+              spinner: 'el-icon-loading',
+              background: 'rgba(255,255,255,0.7)'
+            });
+            generateStack(data).then(res => {
+              this.$message.success("生成堆存成功")
+              this.dialogVisible = false
+              this.disabledVisible = false
+              this.formState = {}
+              this.selectionList = []
+              loading.close();
+              this.refresh(this.form.id)
+            }).catch(() => {
+              loading.close();
+            })
+          }
+        })
+      } else {
+        let data = []
+        for (let item of this.selectionList) {
+          data.push(item.id)
         }
-      })
+        this.$refs["formState"].validate((valid, done) => {
+          done()
+          if (valid) {
+            this.disabledVisible = true
+            statusUpdate({
+              ...this.formState,
+              ids: data.join(',')
+            }).then(res => {
+              this.$message.success("操作成功")
+              this.dialogVisible = false
+              this.disabledVisible = false
+              this.formState = {}
+              this.refresh(this.form.id)
+            }).catch(() => {
+              this.disabledVisible = false
+            })
+          }
+        })
+      }
     },
     statusUpdate(status, type) {
       if (this.form.id) {

+ 105 - 26
src/views/boxManagement/leaseIn/detailsPage.vue

@@ -96,7 +96,13 @@
           <el-button :disabled="option.disabled" type="success" size="small" icon="el-icon-bottom"
                      @click="excelBox = true">导入
           </el-button>
-          <el-button class="el-icon-download" type="info" size="small" :disabled="!form.id" @click="openReport">报表打印</el-button>
+          <el-button class="el-icon-download" type="info" size="small" :disabled="!form.id" @click="openReport">
+            报表打印
+          </el-button>
+          <el-button style="margin-left: 0" type="success" size="small"
+                     :disabled="option.disabled || (selectionList.findIndex(function(item){return item.status == '待使用' && item.stockpilingStatus == '1'}) == -1?true:false)"
+                     @click="stockpiling()">堆存
+          </el-button>
         </template>
       </avue-crud>
     </trade-card>
@@ -129,7 +135,19 @@
         v-if="dialogVisible"
         width="60%">
             <span>
-              <avue-form :option="optionState" v-model="formState" ref="formState">
+              <avue-form v-if="title == '堆存'" :option="optionStateTwoTwo" v-model="formState" ref="formState">
+                  <template slot="addressId" slot-scope="scope">
+                    <port-info v-model="formState.addressId" type="id" :disabled="scope.disabled"
+                               @balabalaTow="(val)=>{balabala(val,['formState','address'])}"/>
+                  </template>
+                  <template slot="purchaseCompanyId" slot-scope="scope">
+                  <crop-select v-model="formState.purchaseCompanyId"
+                               @getCorpData="(row)=>{getGSData(row,['formState','purchaseCompanyName'])}"
+                               :disabled="scope.disabled"
+                               corpType="KH"/>
+                  </template>
+              </avue-form>
+              <avue-form v-else :option="optionState" v-model="formState" ref="formState">
                 <template slot="addressId" slot-scope="scope">
                   <port-info v-model="formState.addressId" type="id" :disabled="scope.disabled"
                              @balabalaTow="(val)=>{balabala(val,['formState','address'])}"/>
@@ -193,6 +211,7 @@ import {selectByName} from "@/api/boxManagement";
 import {getToken} from "@/util/auth";
 import {dateFormat, defaultDate} from "@/util/date";
 import reportDialog from "@/components/report-dialog/main.vue";
+import {generateStack} from "@/api/boxManagement/exportShipment";
 export default {
   name: "detailsPage",
   props: {
@@ -238,6 +257,27 @@ export default {
       optionState: {},
       formState: {},
       selectionList: [],
+      optionStateTwoTwo: {
+        menuBtn: false,
+        span: 12,
+        column: [{
+          label: '堆存地点',
+          prop: 'addressId',
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '付费对象',
+          prop: 'purchaseCompanyId',
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }]
+      },
       optionStateTwo: {
         menuBtn: false,
         span: 24,
@@ -744,6 +784,11 @@ export default {
     }
   },
   methods: {
+    //堆存
+    stockpiling() {
+      this.title = "堆存"
+      this.dialogVisible = true
+    },
     // 报表
     openReport() {
       this.switchDialog = !this.switchDialog;
@@ -849,40 +894,54 @@ export default {
       }
     },
     confirmChange() {
-      this.$refs["formState"].validate((valid, done) => {
-        done()
-        if (valid) {
-          if (this.title === "起租" || this.title === "退租") {
-            if (this.title === "退租") {
-              if (Number(new Date(this.selectionList[0].rentEndDate)) > Number(new Date(this.formState.rentDate))) {
-                return this.$message.error("退租日期不能小于当前租金期间")
-              }
-            }
-            this.disabledVisible = true
-            statusUpdate({
+      if (this.title == "堆存") {
+        this.$refs["formState"].validate((valid, done) => {
+          done()
+          if (valid) {
+            let data = {
               ...this.form,
+              type: "DCF",
+              source: "ZR",
               ...this.formState,
-              tradingBoxItemsList: this.selectionList,
-              rentType: this.title === "起租" ? 1 : 2
-            }).then(res => {
-              this.$message.success("操作成功")
+              tradingBoxItemsList: this.dataList,
+            }
+            // data.tradingBoxItemsList.forEach(item=> delete item.id)
+            delete data.id
+            const loading = this.$loading({
+              lock: true,
+              text: '加载中',
+              spinner: 'el-icon-loading',
+              background: 'rgba(255,255,255,0.7)'
+            });
+            generateStack(data).then(res => {
+              this.$message.success("生成堆存成功")
               this.dialogVisible = false
               this.disabledVisible = false
               this.formState = {}
+              this.selectionList = []
+              loading.close();
               this.refresh(this.form.id)
             }).catch(() => {
-              this.disabledVisible = false
+              loading.close();
             })
-          }else {
-            if (this.title === "计算租金"){
-              if (Number(new Date(this.selectionList[0].leaseCommencementDate)) > Number(new Date(this.formState.rentStartDate))) {
-                return this.$message.error("起始日期不能小于起租日期")
+          }
+        })
+      } else {
+        this.$refs["formState"].validate((valid, done) => {
+          done()
+          if (valid) {
+            if (this.title === "起租" || this.title === "退租") {
+              if (this.title === "退租") {
+                if (Number(new Date(this.selectionList[0].rentEndDate)) > Number(new Date(this.formState.rentDate))) {
+                  return this.$message.error("退租日期不能小于当前租金期间")
+                }
               }
               this.disabledVisible = true
-              calculateRent({
+              statusUpdate({
                 ...this.form,
                 ...this.formState,
-                tradingBoxItemsList:this.selectionList
+                tradingBoxItemsList: this.selectionList,
+                rentType: this.title === "起租" ? 1 : 2
               }).then(res => {
                 this.$message.success("操作成功")
                 this.dialogVisible = false
@@ -892,10 +951,30 @@ export default {
               }).catch(() => {
                 this.disabledVisible = false
               })
+            }else {
+              if (this.title === "计算租金"){
+                if (Number(new Date(this.selectionList[0].leaseCommencementDate)) > Number(new Date(this.formState.rentStartDate))) {
+                  return this.$message.error("起始日期不能小于起租日期")
+                }
+                this.disabledVisible = true
+                calculateRent({
+                  ...this.form,
+                  ...this.formState,
+                  tradingBoxItemsList:this.selectionList
+                }).then(res => {
+                  this.$message.success("操作成功")
+                  this.dialogVisible = false
+                  this.disabledVisible = false
+                  this.formState = {}
+                  this.refresh(this.form.id)
+                }).catch(() => {
+                  this.disabledVisible = false
+                })
+              }
             }
           }
-        }
-      })
+        })
+      }
     },
     selectionChange(list) {
       this.selectionList = list

+ 117 - 32
src/views/boxManagement/leaseOut/detailsPage.vue

@@ -79,14 +79,26 @@
               type="primary" size="small"
               @click="statusUpdate('1','撤销退租')">撤销退租
           </el-button>
-          <el-button :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '使用'}) == -1?true:false)" type="primary" size="small"
-                     @click="statusUpdate('2','计算租金')">计算租金
+          <el-button
+              :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '使用'}) == -1?true:false)"
+              type="primary" size="small"
+              @click="statusUpdate('2','计算租金')">计算租金
+          </el-button>
+          <el-button
+              :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '使用' && item.count > 0}) == -1?true:false)"
+              type="primary" size="small"
+              @click="statusUpdate('3','撤销租金')">撤销租金
+          </el-button>
+          <el-button :disabled="option.disabled" type="success" size="small" icon="el-icon-bottom" @click="importBox">
+            导入
+          </el-button>
+          <el-button class="el-icon-download" type="info" size="small" :disabled="!form.id" @click="openReport">
+            报表打印
           </el-button>
-          <el-button :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '使用' && item.count > 0}) == -1?true:false)" type="primary" size="small"
-                     @click="statusUpdate('3','撤销租金')">撤销租金
+          <el-button style="margin-left: 0" type="success" size="small"
+                     :disabled="option.disabled || (selectionList.findIndex(function(item){return item.status == '待使用' && item.stockpilingStatus == '1'}) == -1?true:false)"
+                     @click="stockpiling()">堆存
           </el-button>
-          <el-button :disabled="option.disabled" type="success" size="small" icon="el-icon-bottom" @click="importBox">导入</el-button>
-          <el-button class="el-icon-download" type="info" size="small" :disabled="!form.id" @click="openReport">报表打印</el-button>
         </template>
       </avue-crud>
     </trade-card>
@@ -119,7 +131,19 @@
         v-if="dialogVisible"
         width="60%">
             <span>
-              <avue-form :option="optionState" v-model="formState" ref="formState">
+              <avue-form v-if="title == '堆存'" :option="optionStateTwoTwo" v-model="formState" ref="formState">
+                  <template slot="addressId" slot-scope="scope">
+                    <port-info v-model="formState.addressId" type="id" :disabled="scope.disabled"
+                               @balabalaTow="(val)=>{balabala(val,['formState','address'])}"/>
+                  </template>
+                  <template slot="purchaseCompanyId" slot-scope="scope">
+                  <crop-select v-model="formState.purchaseCompanyId"
+                               @getCorpData="(row)=>{getGSData(row,['formState','purchaseCompanyName'])}"
+                               :disabled="scope.disabled"
+                               corpType="KH"/>
+                  </template>
+              </avue-form>
+              <avue-form v-else :option="optionState" v-model="formState" ref="formState">
                 <template slot="addressId" slot-scope="scope">
                   <port-info v-model="formState.addressId" type="id" :disabled="scope.disabled"
                              @balabalaTow="(val)=>{balabala(val,['formState','address'])}"/>
@@ -183,6 +207,7 @@ import {selectByName} from "@/api/boxManagement";
 import {getToken} from "@/util/auth";
 import {dateFormat} from "@/util/date";
 import reportDialog from "@/components/report-dialog/main.vue";
+import {generateStack} from "@/api/boxManagement/exportShipment";
 export default {
   name: "detailsPage",
   props: {
@@ -218,11 +243,32 @@ export default {
           }
         ]
       },
-      excelForm:{},
+      excelForm: {},
       title: '',
       dialogVisible: false,
       excelBox: false,
       formSearch: {},
+      optionStateTwoTwo: {
+        menuBtn: false,
+        span: 12,
+        column: [{
+          label: '堆存地点',
+          prop: 'addressId',
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '付费对象',
+          prop: 'purchaseCompanyId',
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }]
+      },
       optionState: {},
       formState: {},
       selectionList: [],
@@ -735,6 +781,11 @@ export default {
     }
   },
   methods: {
+    //堆存
+    stockpiling() {
+      this.title = "堆存"
+      this.dialogVisible = true
+    },
     // 报表
     openReport() {
       this.switchDialog = !this.switchDialog;
@@ -848,40 +899,54 @@ export default {
       }
     },
     confirmChange() {
-      this.$refs["formState"].validate((valid, done) => {
-        done()
-        if (valid) {
-          if (this.title === "起租" || this.title === "退租"){
-            if (this.title === "退租") {
-              if (Number(new Date(this.selectionList[0].rentEndDate)) > Number(new Date(this.formState.rentDate))) {
-                return this.$message.error("退租日期不能小于当前租金期间")
-              }
-            }
-            this.disabledVisible = true
-            statusUpdate({
+      if (this.title == "堆存") {
+        this.$refs["formState"].validate((valid, done) => {
+          done()
+          if (valid) {
+            let data = {
               ...this.form,
+              type: "DCF",
+              source: "ZC",
               ...this.formState,
-              tradingBoxItemsList:this.selectionList,
-              rentType:this.title === "起租"?1:2
-            }).then(res => {
-              this.$message.success("操作成功")
+              tradingBoxItemsList: this.dataList,
+            }
+            // data.tradingBoxItemsList.forEach(item=> delete item.id)
+            delete data.id
+            const loading = this.$loading({
+              lock: true,
+              text: '加载中',
+              spinner: 'el-icon-loading',
+              background: 'rgba(255,255,255,0.7)'
+            });
+            generateStack(data).then(res => {
+              this.$message.success("生成堆存成功")
               this.dialogVisible = false
               this.disabledVisible = false
               this.formState = {}
+              this.selectionList = []
+              loading.close();
               this.refresh(this.form.id)
             }).catch(() => {
-              this.disabledVisible = false
+              loading.close();
             })
-          }else {
-            if (this.title === "计算租金"){
-              if (Number(new Date(this.selectionList[0].leaseCommencementDate)) > Number(new Date(this.formState.rentStartDate))) {
-                return this.$message.error("起始日期不能小于起租日期")
+          }
+        })
+      } else {
+        this.$refs["formState"].validate((valid, done) => {
+          done()
+          if (valid) {
+            if (this.title === "起租" || this.title === "退租") {
+              if (this.title === "退租") {
+                if (Number(new Date(this.selectionList[0].rentEndDate)) > Number(new Date(this.formState.rentDate))) {
+                  return this.$message.error("退租日期不能小于当前租金期间")
+                }
               }
               this.disabledVisible = true
-              calculateRent({
+              statusUpdate({
                 ...this.form,
                 ...this.formState,
-                tradingBoxItemsList:this.selectionList
+                tradingBoxItemsList:this.selectionList,
+                rentType:this.title === "起租"?1:2
               }).then(res => {
                 this.$message.success("操作成功")
                 this.dialogVisible = false
@@ -891,10 +956,30 @@ export default {
               }).catch(() => {
                 this.disabledVisible = false
               })
+            }else {
+              if (this.title === "计算租金"){
+                if (Number(new Date(this.selectionList[0].leaseCommencementDate)) > Number(new Date(this.formState.rentStartDate))) {
+                  return this.$message.error("起始日期不能小于起租日期")
+                }
+                this.disabledVisible = true
+                calculateRent({
+                  ...this.form,
+                  ...this.formState,
+                  tradingBoxItemsList:this.selectionList
+                }).then(res => {
+                  this.$message.success("操作成功")
+                  this.dialogVisible = false
+                  this.disabledVisible = false
+                  this.formState = {}
+                  this.refresh(this.form.id)
+                }).catch(() => {
+                  this.disabledVisible = false
+                })
+              }
             }
           }
-        }
-      })
+        })
+      }
     },
     selectionChange(list) {
       this.selectionList = list

+ 1316 - 0
src/views/boxManagement/stockpilingManage/detailsPage.vue

@@ -0,0 +1,1316 @@
+<template>
+  <div>
+    <div class="customer-head">
+      <div class="customer-back">
+        <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+                   @click="backToList(0)">返回列表
+        </el-button>
+        <el-button v-if="detailData.id" type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+                   @click="backToList(1)">返回审核列表
+        </el-button>
+      </div>
+      <div class="add-customer-btn">
+        <el-button class="el-button--small-yh" style="margin-right: 10px" type="primary" size="small" :disabled="form.status>0"
+                   @click="confirmEdit" v-if="optionForm.disabled === true">编辑
+        </el-button>
+        <el-dropdown style="margin-right: 10px" v-if="false">
+          <el-button type="primary" size="small">
+            审核处理<i class="el-icon-arrow-down el-icon--right"></i>
+          </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">审核进度</el-dropdown-item>
+            <el-dropdown-item @click.native="repealCancel" :disabled="form.status === 0 || !form.status" 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>
+      </div>
+    </div>
+    <trade-card title="基础资料" style="margin-top: 50px">
+      <avue-form :option="optionForm" v-model="form" ref="form">
+        <template slot="purchaseCompanyId" slot-scope="scope">
+          <crop-select v-model="form.purchaseCompanyId" @getCorpData="(row)=>{getGSData(row,['form','purchaseCompanyName'])}" :disabled="scope.disabled"
+                       corpType="KH"/>
+        </template>
+        <template slot="addressId" slot-scope="scope">
+          <port-info :disabled="scope.disabled" v-model="form.addressId" type="id"
+                     @balabalaTow="(val)=>{balabala(val,['form','address'])}"/>
+        </template>
+      </avue-form>
+    </trade-card>
+    <trade-card title="箱信息">
+      <avue-crud
+          :option="option"
+          :data="dataList"
+          v-model="formTwo"
+          ref="crud"
+          :key="key"
+          :before-open="beforeOpen"
+          :upload-delete="uploadDelete"
+          @row-save="rowSave"
+          @row-update="rowUpdate"
+          @selection-change="selectionChange"
+          @resetColumn="resetColumnTwo('crud','option','optionBack',252.1)"
+          @saveColumn="saveColumnTwo('crud','option','optionBack',252.1)">
+        <template slot-scope="{type,size,row,index,disabled}" slot="menu">
+          <el-button icon="el-icon-edit" :size="size" :disabled="disabled" :type="type"
+                     @click="$refs.crud.rowEdit(row,index)">编辑
+          </el-button>
+          <el-button icon="el-icon-delete" :size="size" :disabled="disabled || row.count > 0" :type="type"
+                     @click="rowDel(row,index,'MX')">删除
+          </el-button>
+        </template>
+        <template slot="addressForm" slot-scope="scope">
+          <port-info v-model="formTwo.addressId" type="id" :disabled="scope.disabled" @balabalaTow="(val)=>{balabala(val,['formTwo','address'])}"/>
+        </template>
+        <!--        <template slot="boxMakingCompanyForm" slot-scope="scope">-->
+        <!--          <crop-select v-model="formTwo.boxMakingCompanyId" :disabled="scope.disabled" :refresh="false"-->
+        <!--                       @getCorpData="(row)=>{getGSData(row,['formTwo','boxMakingCompany'])}" corpType="GS"/>-->
+        <!--        </template>-->
+        <template slot="menuLeft" slot-scope="scope">
+<!--          <el-button :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '录入'}) == -1?true:false)" type="primary" size="small"-->
+<!--                     @click="statusUpdate('0','起租')">起租-->
+<!--          </el-button>-->
+<!--          <el-button :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '使用'}) == -1?true:false)" type="primary" size="small"-->
+<!--                     @click="statusUpdate('1','退租')">退租-->
+<!--          </el-button>-->
+<!--          <el-button-->
+<!--              :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '退租'}) == -1?true:false)"-->
+<!--              type="primary" size="small"-->
+<!--              @click="statusUpdate('1','撤销退租')">撤销退租-->
+<!--          </el-button>-->
+          <el-button :disabled="selectionList.length === 0 || option.disabled" type="primary" size="small"
+                     @click="statusUpdate('2','计算租金')">计算堆存费
+          </el-button>
+          <el-button :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.count > 0}) == -1?true:false)" type="primary" size="small"
+                     @click="statusUpdate('3','撤销租金')">撤销堆存费
+          </el-button>
+<!--          <el-button :disabled="option.disabled" type="success" size="small" icon="el-icon-bottom" @click="importBox">导入</el-button>-->
+<!--          <el-button class="el-icon-download" type="info" size="small" :disabled="!form.id" @click="openReport">报表打印</el-button>-->
+        </template>
+      </avue-crud>
+    </trade-card>
+    <!--    报表-->
+    <report-dialog
+        :switchDialog="switchDialog"
+        :reportId="form.id"
+        reportName="堆箱"
+        @onClose="onClose()"
+    />
+<!--    费用信息组件-->
+    <box-cost v-model="dataListTwo" type="ZC" activeName="first" :codeValue="252.2" ref="boxCost"
+              @resetTrigger="resetTrigger"></box-cost>
+    <trade-card title="附件明细">
+      <c-upload
+          basic
+          :data="tradingBoxFilesList"
+          :disabled="disabled"
+          deleteUrl="/api/blade-box-tube/tradingBoxFiles/remove"
+          :enumerationValue="252.3"
+          display
+      />
+    </trade-card>
+    <el-dialog
+        :title="title"
+        :visible.sync="dialogVisible"
+        :append-to-body="true"
+        :destroy-on-close="true"
+        :close-on-click-modal="false"
+        v-if="dialogVisible"
+        width="60%">
+            <span>
+              <avue-form :option="optionState" v-model="formState" ref="formState">
+                <template slot="addressId" slot-scope="scope">
+                  <port-info v-model="formState.addressId" type="id" :disabled="scope.disabled"
+                             @balabalaTow="(val)=>{balabala(val,['formState','address'])}"/>
+                </template>
+              </avue-form>
+            </span>
+      <span slot="footer" class="dialog-footer">
+              <el-button @click="dialogVisible = false">取 消</el-button>
+              <el-button type="primary" :disabled="disabledVisible" @click="confirmChange">确 定</el-button>
+            </span>
+    </el-dialog>
+    <el-dialog title="导入箱档案" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
+               v-dialog-drag>
+      <avue-form v-if="excelBox" :option="excelOption" v-model="excelForm" table-loading="excelLoading"
+                 :upload-before="uploadBefore" :upload-after="uploadAfter">
+        <template slot="excelTemplate">
+          <el-button type="primary" @click="derivation">
+            点击下载<i class="el-icon-download el-icon--right"></i>
+          </el-button>
+        </template>
+      </avue-form>
+      <p style="text-align: center;color: #DC0505">
+        温馨提示 第一次导入时请先下载模板
+      </p>
+    </el-dialog>
+    <el-dialog
+        append-to-body
+        title="审批进度"
+        class="el-dialogDeep"
+        :visible.sync="checkScheduleDialog"
+        width="40%"
+        :close-on-click-modal="false"
+        :destroy-on-close="true"
+        :close-on-press-escape="false"
+        v-dialog-drag
+    >
+      <check-schedule
+          :checkId="checkId"
+          :batchNo="batchNo"
+          @choceScheduleFun="choceScheduleFun"
+      ></check-schedule>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  detail,
+  submit,
+  tradingBoxFiles,
+  selectArchivesList,
+  tradingBoxItem,
+  tradingBoxFees,
+  pleaseCheck,
+  repealCancel,
+  statusUpdate, calculateRent, revokeRent, itemDetails, revokeRentingOut
+} from "@/api/boxManagement/stockpilingManage/index.js";
+
+import checkSchedule from "@/components/check/checkSchedule";
+import {selectByName} from "@/api/boxManagement";
+import {getToken} from "@/util/auth";
+import {dateFormat} from "@/util/date";
+import reportDialog from "@/components/report-dialog/main.vue";
+export default {
+  name: "detailsPage",
+  props: {
+    onLoad: Object,
+    detailData: Object
+  },
+  components:{checkSchedule,reportDialog},
+  data() {
+    return {
+      switchDialog:false,
+      excelOption: {
+        submitBtn: false,
+        emptyBtn: false,
+        column: [
+          {
+            label: "模板下载",
+            prop: "excelTemplate",
+            formslot: true,
+            span: 24
+          },
+          {
+            label: "模板上传",
+            prop: "excelFile",
+            type: "upload",
+            drag: true,
+            loadText: "模板上传中,请稍等",
+            span: 24,
+            propsHttp: {
+              res: "data"
+            },
+            tip: "请上传 .xls,.xlsx 标准格式文件",
+            action: "/api/blade-box-tube/tradingBoxRent/import-tradingBox-info"
+          }
+        ]
+      },
+      excelForm:{},
+      title: '',
+      dialogVisible: false,
+      excelBox: false,
+      formSearch: {},
+      optionState: {},
+      formState: {},
+      selectionList: [],
+      optionStateTwo: {
+        menuBtn: false,
+        span: 12,
+        column: [{
+          label: '起租日期',
+          prop: 'rentDate',
+          width: 100,
+          search: true,
+          overHidden: true,
+          type: "date",
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss",
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }]
+      },
+      optionStateFour: {
+        menuBtn: false,
+        span: 12,
+        column: [{
+          label: '起始日期',
+          prop: 'rentStartDate',
+          width: 100,
+          type: "date",
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss",
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        },{
+          label: '结束日期',
+          prop: 'rentCalculationDate',
+          width: 100,
+          type: "date",
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss",
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }]
+      },
+      optionStateThree: {
+        menuBtn: false,
+        span: 12,
+        column: [{
+          label: '地点',
+          prop: 'addressId',
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '退租日期',
+          prop: 'rentDate',
+          width: 100,
+          search: true,
+          overHidden: true,
+          type: "date",
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss",
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }]
+      },
+      key: 0,
+      checkScheduleDialog: false,
+      checkId: '',
+      batchNo: '',
+      breakConfiguration: {
+        multipleChoices: false,
+        multiple: false,
+        disabled: false,
+        searchShow: true,
+        collapseTags: false,
+        clearable: true,
+        placeholder: "请点击右边按钮选择",
+        dicData: []
+      },
+      form: {},
+      formTwo: {},
+      optionForm: {
+        menuBtn: false,
+        span: 6,
+        column: [{
+          label: '系统号',
+          prop: 'sysNo',
+          disabled: true
+        }, {
+          label: '合同号',
+          prop: 'contractNo',
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '箱数',
+          prop: 'boxNumber',
+          width: 170,
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '付费对象',
+          prop: 'purchaseCompanyId',
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        },{
+          label: '堆存地点',
+          prop: 'addressId',
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        },{
+          label: '备注',
+          prop: 'remarks',
+          type: 'textarea',
+          minRows: 1,
+          span: 18
+        }]
+      },
+      option: {},
+      optionBack: {
+        align: 'center',
+        index: true,
+        addBtnText: "录入明细",
+        refreshBtn: false,
+        dialogDrag: true,
+        addBtn: false,
+        span: 8,
+        selection: true,
+        addRowBtn: false,
+        cellBtn: false,
+        editBtn: false,
+        delBtn: false,
+        menuWidth: 140,
+        dialogTop: 25,
+        height:600,
+        dialogWidth: "80%",
+        showSummary: true,
+        sumColumnList: [{
+          name: 'emptyWeight',
+          type: 'sum',
+          decimals: 2
+        },{
+          name: 'grossWeight',
+          type: 'sum',
+          decimals: 2
+        },{
+          name: 'tare',
+          type: 'sum',
+          decimals: 2
+        },{
+          name: 'loadingWeight',
+          type: 'sum',
+          decimals: 2
+        },{
+          name: 'volume',
+          type: 'sum',
+          decimals: 2
+        }],
+        column: [{
+          label: '箱号',
+          prop: 'code',
+          width: 100,
+          overHidden: true,
+          filterable: true,
+          remote: true,
+          allowCreate: true,
+          type: "select",
+          dicUrl: "/api/blade-box-tube/archives/selectArchivesList?size=10&current=1&code={{key}}",
+          props: {
+            label: "code",
+            value: "code"
+          },
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '币别',
+          prop: 'currency',
+          width: 100,
+          overHidden: true,
+          filterable: true,
+          type: "select",
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          },
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '租金/天',
+          prop: 'price',
+          type: 'number',
+          controls: false,
+          overHidden: true,
+          width: 100,
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '堆存起',
+          prop: 'leaseCommencementDate',
+          overHidden: true,
+          type: "date",
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss",
+          width: 100,
+        }, {
+          label: '堆存止',
+          prop: 'rentingOutDate',
+          overHidden: true,
+          type: "date",
+          display: false,
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss",
+          width: 100,
+        }, {
+          label: '当前堆存日期',
+          prop: 'rentEndDate',
+          overHidden: true,
+          display: false,
+          type: "date",
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss",
+          width: 160
+        }, {
+          label: '箱类型',
+          prop: 'boxTypeId',
+          width: 100,
+          overHidden: true,
+          filterable: true,
+          type: 'select',
+          props: {
+            label: 'name',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-client/container/listMessage'
+        }, {
+          label: '最新地点',
+          prop: 'address',
+          overHidden: true,
+          formProp: 'addressId',
+          width: 100,
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '最新日期',
+          prop: 'newDate',
+          overHidden: true,
+          width: 100,
+          type: "date",
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss",
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '箱来源',
+          prop: 'boxSource',
+          width: 100,
+          overHidden: true,
+          filterable: true,
+          type: 'select',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_source",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          },
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '箱状态',
+          prop: 'boxStatus',
+          width: 100,
+          overHidden: true,
+          filterable: true,
+          type: 'select',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_status",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          },
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '空重(kg)',
+          prop: 'emptyWeight',
+          type: 'number',
+          overHidden: true,
+          controls: false,
+          width: 100,
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '毛重(kg)',
+          prop: 'grossWeight',
+          type: 'number',
+          overHidden: true,
+          controls: false,
+          width: 100,
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '皮重(kg)',
+          prop: 'tare',
+          overHidden: true,
+          type: 'number',
+          controls: false,
+          width: 100
+        }, {
+          label: '装载重量(kg)',
+          prop: 'loadingWeight',
+          type: 'number',
+          overHidden: true,
+          controls: false,
+          width: 100
+        }, {
+          label: '容积(m³)',
+          prop: 'volume',
+          type: 'number',
+          overHidden: true,
+          controls: false,
+          width: 100
+        }, {
+          label: '状态',
+          prop: 'status',
+          width: 100,
+          overHidden: true,
+          filterable: true,
+          disabled: true,
+          type: 'select',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_archives_status",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          }
+        }, {
+          label: '造箱公司',
+          prop: 'boxMakingCompany',
+          overHidden: true,
+          width: 100,
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '造箱日期',
+          prop: 'boxMakingDate',
+          width: 100,
+          overHidden: true,
+          type: "date",
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss",
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '箱来源日期',
+          prop: 'leaseCommencementDate',
+          width: 100,
+          overHidden: true,
+          type: "date",
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }, {
+          label: '箱龄',
+          prop: 'boxAge',
+          type: 'number',
+          controls: false,
+          overHidden: true,
+          width: 100,
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: '照片',
+          prop: 'tradingBoxFilesList',
+          width: 200,
+          overHidden: true,
+          type: 'upload',
+          span: 24,
+          listType: 'picture-card',
+          tip: '只能上传jpg/png文件,且不超过500kb',
+          propsHttp: {
+            url: 'link',
+            name: 'originalName',
+            res: 'data'
+          },
+          action: '/api/blade-resource/oss/endpoint/put-file'
+        }, {
+          label: '备注',
+          prop: 'remarks',
+          overHidden: true,
+          type: 'textarea',
+          minRows: 3,
+          span: 24,
+          width: 200
+        }]
+      },
+      dataList: [],
+      dataListTwo:[],
+      tradingBoxFilesList: [],
+      disabled: false,
+      disabledVisible: false,
+      costData:{}
+    }
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(252.1), this.optionBack);
+    selectByName("买箱费").then(res => {
+      this.costData = res.data.data
+    })
+    //下拉箱号带出对应信息
+    this.findObject(this.option.column, "code").change = ({value, column}) => {
+      selectArchivesList({code: value}).then(res => {
+        console.log(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,
+              boxMakingCompany: item.boxMakingCompany,
+              boxMakingDate: item.boxMakingDate,
+              leaseCommencementDate: item.leaseCommencementDate,
+              boxAge: item.boxAge,
+              tare: item.tare,
+              loadingWeight: item.loadingWeight,
+              volume: item.volume,
+            }
+          }
+        }
+      })
+    }
+    this.key++
+    if (this.onLoad.id && this.detailData.id) {
+      this.refresh(this.onLoad.id,true)
+    }else if (this.onLoad.id){
+      this.refresh(this.onLoad.id,true)
+    }
+  },
+  methods: {
+    // 报表
+    openReport() {
+      this.switchDialog = !this.switchDialog;
+    },
+    // 报表关闭
+    onClose(val) {
+      this.switchDialog = val;
+    },
+    importBox() {
+      this.findObject(this.excelOption.column, "excelFile").data = {
+        billtype: "DCF"
+      }
+      this.excelBox = true
+    },
+    derivation() {
+      window.open(`/api/blade-box-tube/tradingBoxRent/export-tradingBox-info?${this.website.tokenHeader}=${getToken()}`);
+    },
+    uploadBefore(file, done, loading) {
+      loading = true;
+      done();
+    },
+    uploadAfter(res, done, loading, column) {
+      this.excelBox = false;
+      if (typeof res.message === "string") return
+      for (let item of this.dataList){
+        for (let li of res){
+         if (item.code === li.code){
+           return this.$message.error(`箱号:${item.code}重复!`);
+         }
+        }
+      }
+      this.dataList = this.dataList.concat(res)
+      this.$message.success("导入成功!");
+      loading = false;
+      done();
+    },
+    statusUpdate(status, type) {
+      if (this.form.id) {
+        this.title = type == "计算租金"?"计算堆存费":type
+        if (type === '起租') {
+          this.optionState = this.optionStateTwo
+        }else if (type === '退租') {
+          this.optionState = this.optionStateThree
+          this.formState.rentDate = dateFormat(new Date(), "yyyy-MM-dd") + " 23:59:59"
+        } else if (type === '计算租金'){
+          this.optionState = this.optionStateFour
+          for (let item of this.selectionList) {
+            for (let li of this.selectionList) {
+              if (item.rentEndDate !== li.rentEndDate) {
+                  return this.$message.error(`${item.code} - ${item.rentEndDate},当前租金期间不相同,禁止选择`)
+              }
+            }
+          }
+          const date = new Date(this.selectionList[0].rentEndDate);
+          const endDate = new Date(date.getFullYear(), date.getMonth() + 1, 0);
+          this.formState.rentStartDate = this.selectionList[0].rentEndDate
+          this.formState.rentCalculationDate = dateFormat(endDate, "yyyy-MM-dd") + " 23:59:59"
+          if (this.selectionList[0].rentEndDate){
+            let curDate = new Date(this.selectionList[0].rentEndDate);
+            let endDateTime = new Date((curDate/1000+86400)*1000)
+            this.formState.rentStartDate = dateFormat(endDateTime, "yyyy-MM-dd") + " 00:00:00"
+            const endDateTwo = new Date(endDateTime.getFullYear(), endDateTime.getMonth() + 1, 0);
+            this.formState.rentCalculationDate = dateFormat(endDateTwo, "yyyy-MM-dd") + " 23:59:59"
+          }
+        }else if(type === '撤销租金'){
+          return this.$confirm('此操作将撤销堆存费并删除费用, 是否继续?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            revokeRent({
+              ...this.form,
+              tradingBoxItemsList:this.selectionList
+            }).then(res => {
+              this.$message.success("操作成功")
+              this.formState = {}
+              this.selectionList = []
+              this.refresh(this.form.id)
+            })
+          }).catch(() => {
+            this.$message({
+              type: 'info',
+              message: '已取消删除'
+            });
+          });
+        } else if (type === '撤销退租'){
+          return this.$confirm('此操作将撤销退租并删除费用, 是否继续?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            revokeRentingOut({
+              ...this.form,
+              tradingBoxItemsList:this.selectionList
+            }).then(res => {
+              this.$message.success("操作成功")
+              this.formState = {}
+              this.refresh(this.form.id)
+            })
+          }).catch(() => {
+            this.$message({
+              type: 'info',
+              message: '已取消删除'
+            });
+          });
+        }else {
+          this.optionState = this.optionStateThree
+        }
+        this.dialogVisible = true
+      } else {
+        this.$message.error('请保存后操作')
+      }
+    },
+    confirmChange() {
+      this.$refs["formState"].validate((valid, done) => {
+        done()
+        if (valid) {
+          if (this.title === "起租" || this.title === "退租"){
+            if (this.title === "退租") {
+              if (Number(new Date(this.selectionList[0].rentEndDate)) > Number(new Date(this.formState.rentDate))) {
+                return this.$message.error("退租日期不能小于当前租金期间")
+              }
+            }
+            this.disabledVisible = true
+            statusUpdate({
+              ...this.form,
+              ...this.formState,
+              tradingBoxItemsList:this.selectionList,
+              rentType:this.title === "起租"?1:2
+            }).then(res => {
+              this.$message.success("操作成功")
+              this.dialogVisible = false
+              this.disabledVisible = false
+              this.formState = {}
+              this.refresh(this.form.id)
+            }).catch(() => {
+              this.disabledVisible = false
+            })
+          }else {
+            if (this.title === "计算堆存费"){
+              if (Number(new Date(this.selectionList[0].leaseCommencementDate)) > Number(new Date(this.formState.rentStartDate))) {
+                return this.$message.error("起始日期不能小于起租日期")
+              }
+              this.disabledVisible = true
+              calculateRent({
+                ...this.form,
+                ...this.formState,
+                tradingBoxItemsList:this.selectionList
+              }).then(res => {
+                this.$message.success("操作成功")
+                this.dialogVisible = false
+                this.disabledVisible = false
+                this.formState = {}
+                this.selectionList = []
+                this.refresh(this.form.id)
+              }).catch(() => {
+                this.disabledVisible = false
+              })
+            }
+          }
+        }
+      })
+    },
+    selectionChange(list) {
+      this.selectionList = list
+    },
+    confirmEdit() {
+      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.$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.$refs.boxCost.option,"disabled",false)
+        this.$set(this.$refs.boxCost.option,"addBtn",true)
+        this.$set(this.$refs.boxCost.option,"menu",true)
+        //附件和顶部按钮
+        this.disabled = false
+      }
+      this.key++
+    },
+    // 明细删除
+    rowDel(row, index, type) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+            if (row.id) {
+              tradingBoxItem(row.id).then(res => {
+                if (res.data.success) {
+                  this.$message.success("操作成功!");
+                  this.dataList.splice(index, 1);
+                  if (this.dataListTwo.length > 0) {
+                    for (let item in this.dataListTwo) {
+                      if (this.dataListTwo[item].code == row.code) {
+                        if (this.dataListTwo[item].autoGenerate == 1) {
+                          if (this.dataListTwo[item].id) {
+                            tradingBoxFees(this.dataListTwo[item].id).then(res => {
+                              if (res.data.success) {
+                                this.dataListTwo.splice(index, 1);
+                              }
+                            });
+                          } else {
+                            this.dataListTwo.splice(Number(item), 1);
+                          }
+                        }
+                      }
+                    }
+                  }
+                }
+              });
+            } else {
+              this.dataList.splice(index, 1);
+              this.$message.success("操作成功!");
+              if (this.dataListTwo.length > 0) {
+                for (let item in this.dataListTwo) {
+                  if (this.dataListTwo[item].code == row.code) {
+                    if (this.dataListTwo[item].autoGenerate == 1) {
+                      this.dataListTwo.splice(Number(item), 1);
+                    }
+                  }
+                }
+              }
+            }
+          }
+      )
+      ;
+    },
+    balabala(row,type) {
+      this[type[0]][type[1]] = row.name
+    },
+    //撤销
+    repealCancel(){
+      this.$confirm("您确定撤回此次申请吗?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        const data = {
+          id : this.form.id,
+          pageLabel:"买箱",
+          checkFlag: 1,
+        }
+        const loading = this.$loading({
+          lock: true,
+          text: '加载中',
+          spinner: 'el-icon-loading',
+          background: 'rgba(255,255,255,0.7)'
+        });
+        repealCancel(data).then(res => {
+          loading.close();
+          this.$message.success('撤回成功')
+          this.refresh(this.form.id)
+        }).catch(()=>{
+          loading.close();
+        })
+      })
+    },
+    // 请核
+    pleaseCheck() {
+      this.$confirm("您确定提交请核申请吗?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.$refs["form"].validate((valid,done) => {
+          done()
+          if (valid) {
+            if (this.dataList.length === 0) {
+              return this.$message.error("箱信息不能为空")
+            }
+            if (this.$refs.boxCost.dataList.length === 0) {
+              return this.$message.error("费用信息不能为空")
+            }else {
+              for (let item of this.$refs.boxCost.dataList){
+                if (!item.id){
+                  return this.$message.error("费用信息未保存")
+                }
+              }
+            }
+            let data = {
+              ...this.form,
+              tradingBoxItemsList: this.dataList,
+              tradingBoxFeesList: this.dataListTwo,
+              tradingBoxFilesList: this.tradingBoxFilesList,
+              type: "DCF"
+            }
+            const loading = this.$loading({
+              lock: true,
+              text: '加载中',
+              spinner: 'el-icon-loading',
+              background: 'rgba(255,255,255,0.7)'
+            });
+            submit(data).then(res => {
+              const data = {
+                id: res.data.data.id,
+                url: '/boxManagement/buyContainer/index',
+                pageStatus: "this.$store.getters.domSaleStatus",
+                pageLabel: "买箱",
+                checkFlag: 1,
+              }
+              pleaseCheck({
+                ...data,
+                type: "DCF"
+              }).then(rest => {
+                loading.close();
+                this.$message.success('请核成功')
+                this.refresh(res.data.data.id)
+              }).catch(()=>{
+                loading.close();
+              })
+            }).catch(()=>{
+              loading.close();
+            })
+          }
+        });
+      })
+    },
+    //审核关闭
+    choceScheduleFun(){
+      this.checkScheduleDialog = false
+    },
+    refresh(id,type) {
+      const loading = this.$loading({
+        lock: true,
+        text: '加载中',
+        spinner: 'el-icon-loading',
+        background: 'rgba(255,255,255,0.7)'
+      });
+      detail({id: id}).then(res => {
+        this.form = res.data.data
+        this.dataList = res.data.data.tradingBoxItemsList
+        this.dataListTwo = res.data.data.tradingBoxFeesList
+        this.tradingBoxFilesList = res.data.data.tradingBoxFilesList
+        delete this.form.tradingBoxItemsList
+        delete this.form.tradingBoxFeesList
+        delete this.form.tradingBoxFilesList
+        this.$refs.boxCost.code = this.form.code
+        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.$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.$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.$refs.boxCost.option, "disabled", false)
+            this.$set(this.$refs.boxCost.option, "addBtn", true)
+            this.$set(this.$refs.boxCost.option, "menu", true)
+            //附件和顶部按钮
+            this.disabled = false
+          }
+        }
+        this.key++
+      })
+    },
+    //新增修改
+    editCustomer() {
+      this.$refs["form"].validate((valid,done) => {
+        done()
+        if (valid) {
+          let data = {
+            ...this.form,
+            tradingBoxItemsList: this.dataList,
+            tradingBoxFeesList: this.dataListTwo,
+            tradingBoxFilesList: this.tradingBoxFilesList,
+            type: "DCF"
+          }
+          const loading = this.$loading({
+            lock: true,
+            text: '加载中',
+            spinner: 'el-icon-loading',
+            background: 'rgba(255,255,255,0.7)'
+          });
+          submit(data).then(res => {
+            if (this.form.id) {
+              this.$message.success("修改成功")
+            } else {
+              this.$message.success("新增成功")
+            }
+            loading.close();
+            this.refresh(res.data.data.id)
+          }).catch(()=>{
+            loading.close();
+          })
+        }
+      });
+    },
+    rowSave(form,done,loading) {
+      let result = this.dataList.some((item) => {
+        if (item.code == form.code) {
+          return true
+        }
+      })
+      if (result === true) {
+        this.$message.error("已存在此箱号");
+        return loading();
+      }
+      done(form)
+    },
+    rowUpdate(form, index, done, loading) {
+      form.boxType = form.$boxTypeId
+      done(form)
+    },
+    //打开表单前
+    beforeOpen(done,type){
+      if (this.formTwo.count > 0){
+        this.findObject(this.option.column, "price").disabled = true
+        // this.findObject(this.option.column, "amount").disabled = true
+      }else {
+        this.findObject(this.option.column, "price").disabled = false
+        // this.findObject(this.option.column, "amount").disabled = false
+      }
+      if(['view','edit'].includes(type)){
+        itemDetails({id:this.formTwo.id,type: "DCF"}).then(res=>{
+          if (this.formTwo.tradingBoxFilesList.length === 0){
+            this.formTwo.tradingBoxFilesList = res.data.data.tradingBoxFilesList
+          }
+        })
+        // 查看和编辑逻辑
+      }
+      done();
+    },
+    //删除图片
+    uploadDelete(file, column) {
+      return new Promise((resolve, reject) => {
+        this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          if (this.formTwo.tradingBoxFilesList[file.uid].id) {
+            tradingBoxFiles(this.formTwo.tradingBoxFilesList[file.uid].id).then(res => {
+              this.$message({
+                type: 'success',
+                message: '删除成功!'
+              });
+              resolve();
+            })
+          } else {
+            resolve();
+          }
+        }).catch(()=>{
+          reject();
+          this.$message({
+            type: "info",
+            message: "已取消删除"
+          });
+        })
+      })
+    },
+    getGSData(row,type) {
+      this[type[0]][type[1]] = row.cname
+    },
+    backToList(type) {
+      if (type == 0){
+        if (this.detailData.id){
+          this.$router.push({
+            path: '/boxManagement/buyContainer/index'
+          });
+        }
+        this.$emit("backToList",type);
+      }else if (type == 1){
+        this.$router.push({
+          path: '/approveData/index'
+        });
+        this.$emit("backToList",type);
+      }
+    },
+    //自定义列保存
+    async saveColumnTwo(ref, option, optionBack, code) {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+    resetTrigger(){
+      if (this.optionForm.disabled == true) {
+        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.$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.$refs.boxCost.option, "disabled", false)
+          this.$set(this.$refs.boxCost.option, "addBtn", true)
+          this.$set(this.$refs.boxCost.option, "menu", true)
+          //附件和顶部按钮
+          this.disabled = false
+        }
+      }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.$refs.boxCost.option, "disabled", false)
+        this.$set(this.$refs.boxCost.option, "addBtn", true)
+        this.$set(this.$refs.boxCost.option, "menu", true)
+        //附件和顶部按钮
+        this.disabled = false
+      }
+      this.key++
+    },
+    //自定义列重置
+    async resetColumnTwo(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+      if (inSave) {
+        this.resetTrigger()
+        this.$message.success("重置成功");
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+::v-deep .el-form-item {
+  margin-bottom: 8px;
+}
+</style>

+ 346 - 0
src/views/boxManagement/stockpilingManage/index.vue

@@ -0,0 +1,346 @@
+<template>
+  <div>
+    <basic-container v-show="!detailsOpen">
+      <avue-crud
+          :option="option"
+          :search.sync="search"
+          v-model="form"
+          :table-loading="loading"
+          :data="dataList"
+          ref="crud"
+          :key="key"
+          @on-load="onLoad"
+          @search-change="searchChange"
+          @row-del="rowDel"
+          @refresh-change="refreshChange"
+          @resetColumn="resetColumnTwo('crud','option','optionList',252)"
+          @saveColumn="saveColumnTwo('crud','option','optionList',252)"
+          :page.sync="page">
+        <template slot="purchaseCompanyIdSearch">
+          <crop-select v-model="search.purchaseCompanyId" corpType="GS"/>
+        </template>
+        <template slot="purchaseCompanyId" slot-scope="{row}">
+          {{ row.purchaseCompanyName }}
+        </template>
+        <template slot-scope="{type,size,row,$index}" slot="menu">
+          <el-button icon="el-icon-view" :size="size" :type="type" @click="check(row)">查看</el-button>
+          <el-button icon="el-icon-delete" :size="size" v-if="row.status == 0" :type="type" @click="$refs.crud.rowDel(row,$index)">删除
+          </el-button>
+        </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" @click="outExport">导出</el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+    <detailsPage v-if="detailsOpen" :onLoad="form" :detailData="detailData" @backToList="backToList"></detailsPage>
+  </div>
+</template>
+
+<script>
+import {getList, remove} from "@/api/boxManagement/stockpilingManage/index.js";
+import detailsPage from "./detailsPage"
+import {getToken} from "@/util/auth";
+
+export default {
+  name: "index",
+  components: {
+    detailsPage
+  },
+  data() {
+    return {
+      detailsOpen: false,
+      loading: false,
+      search: {},
+      form: {},
+      dataList: [],
+      detailData: {},
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      key:0,
+      option: {},
+      optionList: {
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        addBtn: false,
+        index: true,
+        span: 8,
+        border: true,
+        height:"auto",
+        searchMenuPosition: "right",
+        align: "center",
+        menuWidth:140,
+        searchSpan: 8,
+        searchIcon: true,
+        searchIndex: 2,
+        highlightCurrentRow: true,
+        dialogWidth: "70%",
+        showSummary: true,
+        sumColumnList: [{
+          name: 'boxNumber',
+          type: 'sum',
+          decimals:0
+        }],
+        column: [{
+          label: '系统号',
+          prop: 'sysNo',
+          width: 220,
+          search: true,
+          searchOrder:2
+        }, {
+          label: '合同号',
+          prop: 'contractNo',
+          width: 170,
+          search: true,
+          searchOrder:1,
+        }, {
+          label: '箱数',
+          prop: 'boxNumber',
+          width: 170
+        }, {
+          label: '箱形箱量',
+          prop: 'boxTypeNumber',
+          overHidden: true,
+          width: 170
+        }, {
+          label: '付费对象',
+          prop: 'purchaseCompanyId',
+          width: 200,
+          searchOrder:1,
+          search: true,
+        }, {
+          label: '堆存地点',
+          prop: 'purchaseCompanyId',
+          width: 200
+        }, {
+          label: '状态',
+          prop: 'status',
+          width: 140,
+          overHidden: true,
+          filterable: true,
+          type: 'select',
+          dataType: 'number',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=approval_status",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          }
+        }, {
+          label: '备注',
+          prop: 'remarks',
+          width: 500
+        }, {
+          label: '合同日期',
+          prop: 'effectiveDateList',
+          width: 100,
+          search: true,
+          hide:true,
+          showColumn:false,
+          overHidden: true,
+          type: "date",
+          searchOrder:1,
+          searchRange: true,
+          searchDefaultTime: ["00:00:00", "23:59:59"],
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }, {
+          label: "制单人",
+          prop: "createUserName",
+          searchProp:"createUser",
+          overHidden: true,
+          width: 100,
+          searchOrder:1,
+          search: true,
+          filterable: true,
+          remote: true,
+          type: "select",
+          dicUrl: "/api/blade-user/page?size=20&current=1&account={{key}}",
+          props: {
+            label: "account",
+            value: "id",
+            res: 'data.records'
+          }
+        }, {
+          label: "制单日期",
+          prop: "createTime",
+          searchProp:"createTimeList",
+          type: "date",
+          overHidden: true,
+          width: 200,
+          searchRange: true,
+          searchDefaultTime: ["00:00:00", "23:59:59"],
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }, {
+          label: "更新人",
+          prop: "updateUserName",
+          searchProp:"updateUser",
+          overHidden: true,
+          width: 100,
+          search: true,
+          searchOrder:1,
+          filterable: true,
+          remote: true,
+          type: "select",
+          dicUrl: "/api/blade-user/page?size=20&current=1&account={{key}}",
+          props: {
+            label: "account",
+            value: "id",
+            res: 'data.records'
+          }
+        }, {
+          label: "更新日期",
+          prop: "updateTime",
+          searchProp:"updateTimeList",
+          type: "date",
+          overHidden: true,
+          width: 200,
+          searchRange: true,
+          searchDefaultTime: ["00:00:00", "23:59:59"],
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }]
+      }
+    }
+  },
+  activated() {
+    if (this.$route.query.check) {
+      this.detailsOpen = false
+      this.detailData = {
+        id: this.$route.query.check.billId,
+        check: this.$route.query.check,
+      };
+      this.form = {
+        id:this.$route.query.check.billId
+      }
+      this.detailsOpen = true
+      this.$router.$avueRouter.closeTag(window.location.hash.slice(1))
+    }
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(252), this.optionList);
+    this.key++
+    let i = 0;
+    this.option.column.forEach(item => {
+      if (item.search) i++
+    })
+    if (i % 3 !== 0) {
+      const num = 3 - Number(i % 3)
+      this.option.searchMenuSpan = num * 8;
+      this.option.searchMenuPosition = "right";
+    }
+  },
+  methods: {
+    check(row){
+      this.form = row
+      this.detailsOpen = true
+    },
+    backToList(type) {
+      this.form = {}
+      this.detailsOpen = false
+      if (type === 0){
+        this.detailData = {}
+      }
+      this.onLoad(this.page,this.search)
+    },
+    //刷新
+    refreshChange() {
+      this.onLoad(this.page, this.search)
+    },
+    rowDel(form, index) {
+      this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        remove(form.id).then(res => {
+          this.$message({
+            type: 'success',
+            message: '删除成功!'
+          });
+        })
+      }).catch(() => {
+      });
+    },
+    searchChange(params, done) {
+      done();
+      this.onLoad(this.page, params)
+    },
+    onLoad(page, params = {}) {
+      params = {
+        ...params,
+        current: page.currentPage,
+        size: page.pageSize,
+        type: "DCF",
+        ...Object.assign(params, this.search)
+      }
+      this.loading = true
+      getList(params).then(res => {
+        this.dataList = res.data.data.records
+        this.page.total = res.data.data.total
+        this.loading = false
+      }).finally(() => {
+        this.loading = false
+      })
+    },
+    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/tradingBox/exportTradingBoxOut',      //跳转目标窗口的地址
+        query: {
+          ...config.params,    //括号内是要传递给新窗口的参数
+          type:"ZC"
+        }
+      })
+      window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
+    },
+//自定义列保存
+    async saveColumnTwo(ref, option, optionBack, code) {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+//自定义列重置
+    async resetColumnTwo(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 1
vue.config.js

@@ -32,7 +32,7 @@ module.exports = {
       '/api': {
         //本地服务接口地址
         // target: 'http://192.168.3.64:1080',
-        target: 'http://192.168.0.101:1080',
+        target: 'http://192.168.0.103:1080',
         // target: 'http://124.222.119.174:1080',
         // 打包地址
         // target: 'http://121.37.83.47:10004',//服务器ip