Browse Source

提交箱档案和买箱

caojunjie 2 years ago
parent
commit
78bdece754

+ 48 - 0
src/api/box/archives.js

@@ -0,0 +1,48 @@
+import request from '@/router/axios';
+//查询列表
+export const getList = (params) => {
+  return request({
+    url: '/api/blade-box-tube/archives/list',
+    method: 'get',
+    params: params
+  })
+}
+//查询详情
+export const getDetail = (id) => {
+  return request({
+    url: '/api/blade-box-tube/archives/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
+//删除
+export const remove = (ids) => {
+  return request({
+    url: '/api/blade-box-tube/archives/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+//删除
+export const boxRemove = (ids) => {
+  return request({
+    url: '/api/blade-box-tube/archivesFiles/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+//新增修改
+export const addUpdate = (row) => {
+  return request({
+    url: '/api/blade-box-tube/archives/submit',
+    method: 'post',
+    data: row
+  })
+}
+

+ 45 - 0
src/api/boxManagement/buyContainer/index.js

@@ -0,0 +1,45 @@
+import request from '@/router/axios';
+//查询列表
+export const getList = (params) => {
+  return request({
+    url: '/api/blade-box-tube/tradingBox/list',
+    method: 'get',
+    params: params
+  })
+}
+//查询明细
+export const detail = (params) => {
+  return request({
+    url: '/api/blade-box-tube/tradingBox/detail',
+    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 function submit(data){
+  return request({
+    url:'/api/blade-box-tube/tradingBox/submit',
+    method:'post',
+    data
+  })
+}

+ 3 - 1
src/components/upload/index.vue

@@ -441,8 +441,10 @@ export default {
     }else {
       this.option = await this.getColumnData(this.getColumnName(this.enumerationValue),this.originalOptions);
       this.getWorkDicts("picture_type").then(res => {
+        if (this.findObject(this.option.column, "version").dicData){
           this.findObject(this.option.column, "version").dicData = res.data.data;
-        });
+        }
+      });
     }
     this.key++
   },

+ 15 - 0
src/enums/column-name.js

@@ -958,6 +958,21 @@ const columnName = [{
 },{
   code: 233,
   name: '配件系统-付费明细'
+},{
+  code: 234,
+  name: '基础资料-箱档案'
+},{
+  code: 235,
+  name: '箱管理-买箱'
+},{
+  code: 235.1,
+  name: '箱管理-买箱-明细列表'
+},{
+  code: 235.2,
+  name: '箱管理-买箱-费用'
+},{
+  code: 235.3,
+  name: '箱管理-买箱-附件'
 }
 ]
 export const getColumnName = (key) => {

+ 13 - 0
src/router/views/index.js

@@ -2064,5 +2064,18 @@ export default [{
     },
     component: () => import( /* webpackChunkName: "views" */ '@/views/supplier/index')
   }]
+}, {
+  path: '/boxManagement/buyContainer/index',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/boxManagement/buyContainer/index',
+    name: '买箱',
+    meta: {
+      i18n: '/boxManagement/buyContainer/index',
+      keepAlive: true,
+    },
+    component: () => import( /* webpackChunkName: "views" */ '@/views/boxManagement/buyContainer/index')
+  }]
 }
 ]

+ 262 - 49
src/views/basicData/container/archives.vue

@@ -4,18 +4,41 @@
         :option="option"
         :search.sync="search"
         v-model="form"
+        :table-loading="loading"
         :data="dataList"
         ref="crud"
-        :page.sync="page">
+        @on-load="onLoad"
+        @row-save="rowSave"
+        @row-update="(row,index,done,loading)=>{rowSave(row,done,loading,index)}"
+        @search-change="searchChange"
+        :upload-delete="uploadDelete"
+        :before-close="beforeClose"
+        @row-del="rowDel"
+        @refresh-change="refreshChange"
+        @resetColumn="resetColumnTwo('crud','option','optionList',234)"
+        @saveColumn="saveColumnTwo('crud','option','optionList',234)"
+      :page.sync="page">
+      <template slot="leasingCompanyIdForm">
+        <crop-select v-model="form.leasingCompanyId" @getCorpData="getGSData" corpType="GS"/>
+      </template>
+      <template slot="leasingCompanyIdSearch">
+        <crop-select v-model="search.leasingCompanyId" corpType="GS"/>
+      </template>
+      <template slot="leasingCompanyId" slot-scope="{row}">
+        {{row.leasingCompany}}
+      </template>
     </avue-crud>
   </basic-container>
 </template>
 
 <script>
+import {addUpdate, boxRemove, getList, remove} from "@/api/box/archives";
+
 export default {
   name: "archives",
   data() {
     return {
+      loading: false,
       search: {},
       form: {},
       dataList: [],
@@ -25,104 +48,190 @@ export default {
         total: 0,
         pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
       },
-      option: {
-        index:true,
-        span:8,
+      option:{},
+      optionList: {
+        index: true,
+        span: 8,
+        border: true,
         searchMenuPosition: "right",
+        align:"center",
         searchSpan: 8,
         searchIcon: true,
         searchIndex: 2,
         highlightCurrentRow: true,
-        dialogWidth:"70%",
+        dialogWidth: "70%",
         column: [{
           label: '合同号',
-          prop: 'name',
+          prop: 'contractNo',
+          width: 100,
           search: true,
-        },{
+        }, {
           label: '箱号',
-          prop: 'name',
+          prop: 'code',
+          width: 100,
           search: true,
-        },{
+        }, {
           label: '箱类型',
           prop: 'name',
+          width: 100,
           search: true,
-        },{
+          filterable: true,
+          type: 'select',
+          props: {
+            label: 'name',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-client/container/listMessage'
+        }, {
           label: '最新地点',
-          prop: 'name',
+          prop: 'addressId',
+          width: 100,
           search: true,
-        },{
+        }, {
           label: '最新日期',
-          prop: 'name',
+          prop: 'newDate',
+          width: 100,
+          searchProp: 'newDateList',
+          overHidden: true,
           search: true,
-        },{
+          type: "date",
+          searchRange: true,
+          searchDefaultTime: ["00:00:00", "23:59:59"],
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }, {
           label: '租赁公司',
-          prop: 'name',
+          prop: 'leasingCompanyId',
+          width: 100,
           search: true,
-        },{
+        }, {
           label: '箱来源',
-          prop: 'name',
+          prop: 'boxSource',
+          width: 100,
           search: true,
-        },{
+          filterable: true,
+          type: 'select',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_source",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          }
+        }, {
           label: '箱状态',
-          prop: 'name',
+          prop: 'boxStatus',
+          width: 100,
           search: true,
-        },{
+          filterable: true,
+          type: 'select',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_status",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          }
+        }, {
           label: '租赁方式',
-          prop: 'name'
-        },{
+          prop: 'leaseMethod',
+          width: 100,
+          filterable: true,
+          type: 'select',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=lease_method",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          }
+        }, {
           label: '空重',
-          prop: 'name'
-        },{
+          prop: 'emptyWeight',
+          width: 100,
+        }, {
           label: '毛重',
-          prop: 'name'
-        },{
+          prop: 'gorssweight',
+          width: 100,
+        }, {
           label: '皮重',
-          prop: 'name'
-        },{
+          prop: 'tare',
+          width: 100,
+        }, {
           label: '装载重量',
-          prop: 'name'
-        },{
+          prop: 'loadingWeight',
+          width: 100
+        }, {
           label: '容积',
-          prop: 'name'
-        },{
+          prop: 'volume',
+          width: 100
+        }, {
           label: '状态',
-          prop: 'name'
-        },{
+          disabled: true,
+          width: 100,
+          filterable: true,
+          prop: 'status',
+          type: 'select',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_archives_status",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          }
+        }, {
           label: '造箱公司',
-          prop: 'name',
+          prop: 'boxMakingCompanyId',
+          width: 100,
           search: true,
-        },{
+        }, {
           label: '造箱日期',
-          prop: 'name',
+          prop: 'boxMakingDateList',
+          width: 100,
+          overHidden: true,
           search: true,
-        },{
+          type: "date",
+          searchRange: true,
+          searchDefaultTime: ["00:00:00", "23:59:59"],
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }, {
           label: '起租日期',
-          prop: 'name',
+          prop: 'leaseCommencementDateList',
+          width: 100,
+          overHidden: true,
           search: true,
-        },{
+          type: "date",
+          searchRange: true,
+          searchDefaultTime: ["00:00:00", "23:59:59"],
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }, {
           label: '购入日期',
-          prop: 'name'
-        },{
+          prop: 'purchaseDateList',
+          width: 100,
+          overHidden: true,
+          type: "date",
+          searchRange: true,
+          searchDefaultTime: ["00:00:00", "23:59:59"],
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }, {
           label: '箱龄',
-          prop: 'name'
+          prop: 'boxAge',
+          width: 100,
         }, {
           label: '照片',
-          prop: 'imgUrl4',
+          prop: 'filesList',
+          width: 200,
           type: 'upload',
           span: 24,
           listType: 'picture-card',
           tip: '只能上传jpg/png文件,且不超过500kb',
           propsHttp: {
-            url:'url',
-            name:'name',
+            url: 'link',
+            name: 'originalName',
             res: 'data'
           },
-          action: 'https://api.avuejs.com/imgupload'
+          action: '/api/blade-resource/oss/endpoint/put-file'
         }]
       }
     }
   },
-  created() {
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(234), this.optionList);
     let i = 0;
     this.option.column.forEach(item => {
       if (item.search) i++
@@ -133,7 +242,111 @@ export default {
       this.option.searchMenuPosition = "right";
     }
   },
-  methods: {}
+  methods: {
+    getGSData(row) {
+      this.form.leasingCompany = row.cname
+    },
+    //关闭弹窗前
+    beforeClose(done,type){
+      this.onLoad(this.page,this.search)
+      done()
+    },
+    //刷新
+    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(() => {
+      });
+    },
+    uploadDelete(file, column) {
+      return new Promise((resolve, reject)=>{
+        this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          if (this.form.filesList[file.uid].id){
+            boxRemove(this.form.filesList[file.uid].id).then(res => {
+              this.$message({
+                type: 'success',
+                message: '删除成功!'
+              });
+              resolve();
+            })
+          }else {
+            resolve();
+          }
+        }).catch(()=>{
+          reject();
+          this.$message({
+            type: "info",
+            message: "已取消删除"
+          });
+        })
+      })
+    },
+    rowSave(form, done, loading, index) {
+      done()
+      addUpdate(form).then(res => {
+        this.onLoad(this.page, this.search)
+      })
+    },
+    searchChange(params, done) {
+      done();
+      this.onLoad(this.page, params)
+    },
+    onLoad(page, params = {}) {
+      params = {
+        ...params,
+        current: page.currentPage,
+        size: page.pageSize,
+      }
+      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
+      })
+    },
+
+//自定义列保存
+    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>
 

+ 12 - 19
src/views/basicData/customerInformation/detailsPageEdit.vue

@@ -4,7 +4,7 @@
       <div class="customer-back">
         <!--        <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
         <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
-          @click="backToList">返回列表
+          @click="backToList()">返回列表
         </el-button>
       </div>
       <div class="add-customer-btn">
@@ -12,7 +12,7 @@
         </el-button>
         <el-button type="primary" @click="openFlow" size="small" :disabled="!form.id">审 核
         </el-button>
-        <el-button type="primary" :disabled="disabled" @click="editCustomer" size="small">{{  form.id ? "确认修改" : "确认新增"
+        <el-button type="primary" :disabled="disabled" @click="editCustomer(null)" size="small">{{  form.id ? "确认修改" : "确认新增"
           }}
         </el-button>
       </div>
@@ -1397,34 +1397,27 @@ export default {
       });
     },
     backToList(value) {
-      console.log(value)
-      if (value == '0') {
-        this.$emit("goBack");
-      } else {
-        console.log(this.form, this.oldform)
-        if (
+      if (
           contrastObj(this.form, this.oldform) ||
           contrastList(this.contactsData, this.oldcontactsData) ||
           contrastList(this.bankOfDepositData, this.oldbankOfDepositData) ||
           contrastList(this.advantageProjectData, this.oldadvantageProjectData) ||
-          contrastList(this.addressLatLng, this.oldaddressLatLng) ||
+          contrastList(this.addressLatLng || [], this.oldaddressLatLng || []) ||
           contrastList(this.addressData, this.oldaddressData)
-        ) {
-          this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning"
-          })
+      ) {
+        this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
             .then(() => {
               this.editCustomer("goBack");
             })
             .catch(() => {
               this.$emit("goBack", true);
             });
-        }else{
-          this.$emit("goBack", true);
-        }
-
+      }else{
+        this.$emit("goBack", true);
       }
     },
     openFlow() {

+ 1 - 2
src/views/bidingDocument/issueTender/detailsPageEdit.vue

@@ -763,9 +763,7 @@ export default {
     },
     //确认导出触发
     confirmSelection() {
-      console.log(this.selection);
       for (let item of this.selection){
-        console.log(item)
         this.dataListAgent.push({
           $cellEdit: true,
           agentId:item.id,
@@ -955,6 +953,7 @@ export default {
             type: 'success',
             message: '确认中标!'
           });
+          this.refreshData(this.id)
         })
       }).catch(() => {
         this.$message({

+ 451 - 0
src/views/boxManagement/buyContainer/detailsPage.vue

@@ -0,0 +1,451 @@
+<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">返回列表
+        </el-button>
+      </div>
+      <div class="add-customer-btn">
+        <el-button class="el-button--small-yh" type="primary" size="small" @click="editCustomer">
+          {{ form.id ? "确认修改" : "确认新增" }}
+        </el-button>
+      </div>
+    </div>
+    <trade-card title="基础资料" style="margin-top: 50px">
+      <avue-form :option="optionForm" v-model="form" ref="form">
+        <template slot="purchaseCompanyId">
+          <crop-select v-model="form.purchaseCompanyId" @getCorpData="getGSData" corpType="GS"/>
+        </template>
+      </avue-form>
+    </trade-card>
+    <trade-card title="箱信息">
+      <avue-crud
+          :option="option"
+          :data="dataList"
+          v-model="formTwo"
+          ref="crud"
+          :upload-delete="uploadDelete"
+          @row-save="rowSave"
+          @row-update="(row,index,done,loading)=>{rowSave(row,done,loading,index)}"
+          @resetColumn="resetColumnTwo('crud','option','optionList',235.1)"
+          @saveColumn="saveColumnTwo('crud','option','optionList',235.1)">
+        <template slot-scope="{type,size,row,$index}" slot="menu">
+          <el-button icon="el-icon-edit" :size="size" :type="type" @click="$refs.crud.rowEdit(row,$index)">编辑</el-button>
+          <el-button icon="el-icon-delete" :size="size" :type="type">删除</el-button>
+        </template>
+        <template slot="addressIdForm">
+          <port-info v-model="formTwo.addressId" type="id"/>
+        </template>
+        <template slot="boxMakingCompanyIdForm">
+          <crop-select v-model="formTwo.boxMakingCompanyId" :refresh="false" @getCorpData="getGSData" corpType="GS"/>
+        </template>
+      </avue-crud>
+    </trade-card>
+    <trade-card title="费用信息">
+      <avue-crud
+          :option="optionTwo"
+          :data="dataListTwo"
+          v-model="formThree"
+          ref="crudTwo"
+          @row-save="rowSave"
+          @row-update="(row,index,done,loading)=>{rowSave(row,done,loading,index)}"
+          @resetColumn="resetColumnTwo('crudTwo','option','optionList',235.2)"
+          @saveColumn="saveColumnTwo('crudTwo','option','optionList',235.2)">
+        <template slot-scope="{type,size,row,$index}" slot="menu">
+          <el-button icon="el-icon-edit" :size="size" :type="type" @click="$refs.crudTwo.rowEdit(row,$index)">编辑</el-button>
+          <el-button icon="el-icon-delete" :size="size" :type="type">删除</el-button>
+        </template>
+        <template slot="itemIdForm">
+          <breakdown-select v-model="formThree.itemId" @selectValue="selectValue(value)"
+                            :configuration="breakConfiguration"></breakdown-select>
+        </template>
+      </avue-crud>
+    </trade-card>
+    <trade-card title="附件明细">
+      <c-upload
+          basic
+          :data="tradingBoxFilesList"
+          deleteUrl="/api/blade-box-tube/tradingBoxFiles/remove"
+          :enumerationValue="235.3"
+          display
+      />
+    </trade-card>
+  </div>
+</template>
+
+<script>
+import {detail, submit, tradingBoxFiles} from "@/api/boxManagement/buyContainer";
+
+export default {
+  name: "detailsPage",
+  props: {
+    onLoad: Object
+  },
+  data() {
+    return {
+      breakConfiguration: {
+        multipleChoices: false,
+        multiple: false,
+        disabled: false,
+        searchShow: true,
+        collapseTags: false,
+        clearable: true,
+        placeholder: "请点击右边按钮选择",
+        dicData: []
+      },
+      form: {},
+      formTwo: {},
+      formThree: {},
+      optionForm: {
+        menuBtn: false,
+        span: 6,
+        column: [{
+          label: '系统号',
+          prop: 'sysNo'
+        }, {
+          label: '合同号',
+          prop: 'contractNo'
+        }, {
+          label: '买入公司',
+          prop: 'purchaseCompanyId'
+        }, {
+          label: '买入日期',
+          prop: 'purchaseDate',
+          type: "date",
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }, {
+          label: '备注',
+          prop: 'remarks',
+          type: 'textarea',
+          minRows: 3,
+          span: 24
+        }]
+      },
+      option: {
+        align: 'center',
+        index: true,
+        addBtnText:"录入明细",
+        refreshBtn: false,
+        addBtn: true,
+        span: 8,
+        addRowBtn: false,
+        cellBtn: false,
+        editBtn: false,
+        delBtn: false,
+        menuWidth: 140,
+        dialogTop:25,
+        dialogWidth:"80%",
+        column: [{
+          label: '箱号',
+          prop: 'code',
+          width: 100
+        }, {
+          label: '币别',
+          prop: 'currency',
+          width: 100,
+          filterable: true,
+          type: "select",
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          },
+        }, {
+          label: '金额',
+          prop: 'amount',
+          width: 100
+        }, {
+          label: '箱类型',
+          prop: 'boxTypeId',
+          width: 100,
+          filterable: true,
+          type: 'select',
+          props: {
+            label: 'name',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-client/container/listMessage'
+        }, {
+          label: '最新地点',
+          prop: 'addressId',
+          width: 100
+        }, {
+          label: '最新日期',
+          prop: 'newDate',
+          width: 100,
+          type: "date",
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }, {
+          label: '箱来源',
+          prop: 'boxSource',
+          width: 100,
+          filterable: true,
+          type: 'select',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_source",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          }
+        }, {
+          label: '箱状态',
+          prop: 'boxStatus',
+          width: 100,
+          filterable: true,
+          type: 'select',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_status",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          }
+        }, {
+          label: '空重',
+          prop: 'emptyWeight',
+          width: 100
+        }, {
+          label: '毛重',
+          prop: 'grossWeight',
+          width: 100
+        }, {
+          label: '皮重',
+          prop: 'tare',
+          width: 100
+        }, {
+          label: '装载重量',
+          prop: 'loadingWeight',
+          width: 100
+        }, {
+          label: '容积',
+          prop: 'volume',
+          width: 100
+        }, {
+          label: '状态',
+          prop: 'status',
+          width: 100,
+          dataType:'number',
+          filterable: true,
+          type: 'select',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=approval_status",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          }
+        }, {
+          label: '造箱公司',
+          prop: 'boxMakingCompanyId',
+          width: 100
+        }, {
+          label: '造箱日期',
+          prop: 'boxMakingDate',
+          width: 100,
+          type: "date",
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }, {
+          label: '起租日期',
+          prop: 'leaseCommencementDate',
+          width: 100,
+          type: "date",
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }, {
+          label: '箱龄',
+          prop: 'boxAge',
+          width: 100
+        }, {
+          label: '照片',
+          prop: 'tradingBoxFilesList',
+          width: 200,
+          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',
+          type: 'textarea',
+          minRows: 3,
+          span: 24,
+          width: 100
+        }]
+      },
+      optionBack: {},
+      optionTwo:{
+        align: 'center',
+        index: true,
+        addBtnText:"录入明细",
+        refreshBtn: false,
+        addBtn: true,
+        span: 6,
+        dialogTop:"25%",
+        addRowBtn: false,
+        cellBtn: false,
+        editBtn: false,
+        delBtn: false,
+        menuWidth: 140,
+        dialogDrag:true,
+        dialogWidth:"80%",
+        column: [{
+          label: '收款对象',
+          prop: 'corpId',
+          width: 100
+        }, {
+          label: '箱号',
+          prop: 'code',
+          width: 100
+        }, {
+          label: '费用名称',
+          prop: 'itemId',
+          width: 100
+        }, {
+          label: '币别',
+          prop: 'currency',
+          width: 100,
+          filterable: true,
+          type: "select",
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          },
+        }, {
+          label: '单价',
+          prop: 'price',
+          width: 100
+        }, {
+          label: '数量',
+          prop: 'quantity',
+          width: 100
+        }, {
+          label: '金额',
+          prop: 'amount',
+          width: 100
+        }, {
+          label: '备注',
+          prop: 'remarks',
+          type: 'textarea',
+          minRows: 3,
+          span: 24,
+          width: 100
+        }]
+      },
+      optionTwoBack:{},
+      dataListTwo:[],
+      dataList: [],
+      tradingBoxFilesList:[]
+    }
+  },
+  created() {
+    if (this.onLoad.id){
+      this.refresh(this.onLoad.id)
+    }
+  },
+  methods: {
+    //选择费用名称
+    selectValue(value){
+      console.log(value)
+    },
+    refresh(id){
+      console.log(id)
+      detail({id:id}).then(res=>{
+        console.log(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
+      })
+    },
+    //新增修改
+    editCustomer(){
+      let data = {
+        ...this.form,
+        tradingBoxItemsList:this.dataList,
+        tradingBoxFeesList:this.dataListTwo,
+        tradingBoxFilesList:this.tradingBoxFilesList,
+        type:"buy"
+      }
+      submit(data).then(res=>{
+        console.log(res)
+      })
+    },
+    rowSave(form, done, loading, index) {
+      console.log(form)
+      done(form)
+    },
+    //删除图片
+    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){
+      this.form.purchaseCompanyName = row.cname
+    },
+    backToList() {
+      this.$emit("backToList");
+    },
+    //自定义列保存
+    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>
+::v-deep .el-form-item {
+  margin-bottom: 8px;
+}
+</style>

+ 198 - 0
src/views/boxManagement/buyContainer/index.vue

@@ -0,0 +1,198 @@
+<template>
+  <div>
+    <basic-container v-show="!detailsOpen">
+      <avue-crud
+          :option="option"
+          :search.sync="search"
+          v-model="form"
+          :table-loading="loading"
+          :data="dataList"
+          ref="crud"
+          @on-load="onLoad"
+          @search-change="searchChange"
+          @row-del="rowDel"
+          @refresh-change="refreshChange"
+          @resetColumn="resetColumnTwo('crud','option','optionList',235)"
+          @saveColumn="saveColumnTwo('crud','option','optionList',235)"
+          :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" :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>
+        </template>
+      </avue-crud>
+    </basic-container>
+    <detailsPage v-if="detailsOpen" :onLoad="form" @backToList="backToList"></detailsPage>
+  </div>
+</template>
+
+<script>
+import {getList, remove} from "@/api/boxManagement/buyContainer/index.js";
+import detailsPage from "./detailsPage"
+import {addUpdate} from "@/api/box/archives";
+
+export default {
+  name: "index",
+  components: {
+    detailsPage
+  },
+  data() {
+    return {
+      detailsOpen: false,
+      loading: false,
+      search: {},
+      form: {},
+      dataList: [],
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      option: {},
+      optionList: {
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        addBtn: false,
+        index: true,
+        span: 8,
+        border: true,
+        searchMenuPosition: "right",
+        align: "center",
+        menuWidth:140,
+        searchSpan: 8,
+        searchIcon: true,
+        searchIndex: 2,
+        highlightCurrentRow: true,
+        dialogWidth: "70%",
+        column: [{
+          label: '系统号',
+          prop: 'sysNo',
+          width: 100,
+          search: true,
+        }, {
+          label: '合同号',
+          prop: 'contractNo',
+          width: 100,
+          search: true,
+        }, {
+          label: '买入公司',
+          prop: 'purchaseCompanyId',
+          width: 100,
+          search: true,
+        }, {
+          label: '买入日期',
+          prop: 'purchaseDate',
+          width: 100,
+          search: true,
+        }, {
+          label: '备注',
+          prop: 'remarks',
+          width: 100,
+          search: true,
+        }]
+      }
+    }
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(235), this.optionList);
+    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() {
+      this.form = {}
+      this.detailsOpen = false
+      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: "buy"
+      }
+      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
+      })
+    },
+
+//自定义列保存
+    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>

+ 2 - 2
vue.config.js

@@ -32,10 +32,10 @@ module.exports = {
       '/api': {
         //本地服务接口地址
         // target: 'http://192.168.3.64:1080',
-        // target: 'http://192.168.1.120:1080',
+        target: 'http://192.168.1.120:1080',
         // target: 'http://124.222.119.174:1080',
         // 打包地址
-        target: 'http://121.37.83.47:10004',//服务器ip
+        // target: 'http://121.37.83.47:10004',//服务器ip
         // target: 'http://trade.tubaosoft.com:10004',//服务器域名
         ws: true,
         pathRewrite: {