|
@@ -4,18 +4,41 @@
|
|
:option="option"
|
|
:option="option"
|
|
:search.sync="search"
|
|
:search.sync="search"
|
|
v-model="form"
|
|
v-model="form"
|
|
|
|
+ :table-loading="loading"
|
|
:data="dataList"
|
|
:data="dataList"
|
|
ref="crud"
|
|
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>
|
|
</avue-crud>
|
|
</basic-container>
|
|
</basic-container>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import {addUpdate, boxRemove, getList, remove} from "@/api/box/archives";
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
name: "archives",
|
|
name: "archives",
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ loading: false,
|
|
search: {},
|
|
search: {},
|
|
form: {},
|
|
form: {},
|
|
dataList: [],
|
|
dataList: [],
|
|
@@ -25,104 +48,190 @@ export default {
|
|
total: 0,
|
|
total: 0,
|
|
pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
|
|
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",
|
|
searchMenuPosition: "right",
|
|
|
|
+ align:"center",
|
|
searchSpan: 8,
|
|
searchSpan: 8,
|
|
searchIcon: true,
|
|
searchIcon: true,
|
|
searchIndex: 2,
|
|
searchIndex: 2,
|
|
highlightCurrentRow: true,
|
|
highlightCurrentRow: true,
|
|
- dialogWidth:"70%",
|
|
|
|
|
|
+ dialogWidth: "70%",
|
|
column: [{
|
|
column: [{
|
|
label: '合同号',
|
|
label: '合同号',
|
|
- prop: 'name',
|
|
|
|
|
|
+ prop: 'contractNo',
|
|
|
|
+ width: 100,
|
|
search: true,
|
|
search: true,
|
|
- },{
|
|
|
|
|
|
+ }, {
|
|
label: '箱号',
|
|
label: '箱号',
|
|
- prop: 'name',
|
|
|
|
|
|
+ prop: 'code',
|
|
|
|
+ width: 100,
|
|
search: true,
|
|
search: true,
|
|
- },{
|
|
|
|
|
|
+ }, {
|
|
label: '箱类型',
|
|
label: '箱类型',
|
|
prop: 'name',
|
|
prop: 'name',
|
|
|
|
+ width: 100,
|
|
search: true,
|
|
search: true,
|
|
- },{
|
|
|
|
|
|
+ filterable: true,
|
|
|
|
+ type: 'select',
|
|
|
|
+ props: {
|
|
|
|
+ label: 'name',
|
|
|
|
+ value: 'id'
|
|
|
|
+ },
|
|
|
|
+ dicUrl: '/api/blade-client/container/listMessage'
|
|
|
|
+ }, {
|
|
label: '最新地点',
|
|
label: '最新地点',
|
|
- prop: 'name',
|
|
|
|
|
|
+ prop: 'addressId',
|
|
|
|
+ width: 100,
|
|
search: true,
|
|
search: true,
|
|
- },{
|
|
|
|
|
|
+ }, {
|
|
label: '最新日期',
|
|
label: '最新日期',
|
|
- prop: 'name',
|
|
|
|
|
|
+ prop: 'newDate',
|
|
|
|
+ width: 100,
|
|
|
|
+ searchProp: 'newDateList',
|
|
|
|
+ overHidden: true,
|
|
search: 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: '租赁公司',
|
|
label: '租赁公司',
|
|
- prop: 'name',
|
|
|
|
|
|
+ prop: 'leasingCompanyId',
|
|
|
|
+ width: 100,
|
|
search: true,
|
|
search: true,
|
|
- },{
|
|
|
|
|
|
+ }, {
|
|
label: '箱来源',
|
|
label: '箱来源',
|
|
- prop: 'name',
|
|
|
|
|
|
+ prop: 'boxSource',
|
|
|
|
+ width: 100,
|
|
search: true,
|
|
search: true,
|
|
- },{
|
|
|
|
|
|
+ filterable: true,
|
|
|
|
+ type: 'select',
|
|
|
|
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_source",
|
|
|
|
+ props: {
|
|
|
|
+ label: "dictValue",
|
|
|
|
+ value: "dictKey"
|
|
|
|
+ }
|
|
|
|
+ }, {
|
|
label: '箱状态',
|
|
label: '箱状态',
|
|
- prop: 'name',
|
|
|
|
|
|
+ prop: 'boxStatus',
|
|
|
|
+ width: 100,
|
|
search: true,
|
|
search: true,
|
|
- },{
|
|
|
|
|
|
+ filterable: true,
|
|
|
|
+ type: 'select',
|
|
|
|
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_status",
|
|
|
|
+ props: {
|
|
|
|
+ label: "dictValue",
|
|
|
|
+ value: "dictKey"
|
|
|
|
+ }
|
|
|
|
+ }, {
|
|
label: '租赁方式',
|
|
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: '空重',
|
|
label: '空重',
|
|
- prop: 'name'
|
|
|
|
- },{
|
|
|
|
|
|
+ prop: 'emptyWeight',
|
|
|
|
+ width: 100,
|
|
|
|
+ }, {
|
|
label: '毛重',
|
|
label: '毛重',
|
|
- prop: 'name'
|
|
|
|
- },{
|
|
|
|
|
|
+ prop: 'gorssweight',
|
|
|
|
+ width: 100,
|
|
|
|
+ }, {
|
|
label: '皮重',
|
|
label: '皮重',
|
|
- prop: 'name'
|
|
|
|
- },{
|
|
|
|
|
|
+ prop: 'tare',
|
|
|
|
+ width: 100,
|
|
|
|
+ }, {
|
|
label: '装载重量',
|
|
label: '装载重量',
|
|
- prop: 'name'
|
|
|
|
- },{
|
|
|
|
|
|
+ prop: 'loadingWeight',
|
|
|
|
+ width: 100
|
|
|
|
+ }, {
|
|
label: '容积',
|
|
label: '容积',
|
|
- prop: 'name'
|
|
|
|
- },{
|
|
|
|
|
|
+ prop: 'volume',
|
|
|
|
+ width: 100
|
|
|
|
+ }, {
|
|
label: '状态',
|
|
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: '造箱公司',
|
|
label: '造箱公司',
|
|
- prop: 'name',
|
|
|
|
|
|
+ prop: 'boxMakingCompanyId',
|
|
|
|
+ width: 100,
|
|
search: true,
|
|
search: true,
|
|
- },{
|
|
|
|
|
|
+ }, {
|
|
label: '造箱日期',
|
|
label: '造箱日期',
|
|
- prop: 'name',
|
|
|
|
|
|
+ prop: 'boxMakingDateList',
|
|
|
|
+ width: 100,
|
|
|
|
+ overHidden: true,
|
|
search: 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: '起租日期',
|
|
label: '起租日期',
|
|
- prop: 'name',
|
|
|
|
|
|
+ prop: 'leaseCommencementDateList',
|
|
|
|
+ width: 100,
|
|
|
|
+ overHidden: true,
|
|
search: 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: '购入日期',
|
|
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: '箱龄',
|
|
label: '箱龄',
|
|
- prop: 'name'
|
|
|
|
|
|
+ prop: 'boxAge',
|
|
|
|
+ width: 100,
|
|
}, {
|
|
}, {
|
|
label: '照片',
|
|
label: '照片',
|
|
- prop: 'imgUrl4',
|
|
|
|
|
|
+ prop: 'filesList',
|
|
|
|
+ width: 200,
|
|
type: 'upload',
|
|
type: 'upload',
|
|
span: 24,
|
|
span: 24,
|
|
listType: 'picture-card',
|
|
listType: 'picture-card',
|
|
tip: '只能上传jpg/png文件,且不超过500kb',
|
|
tip: '只能上传jpg/png文件,且不超过500kb',
|
|
propsHttp: {
|
|
propsHttp: {
|
|
- url:'url',
|
|
|
|
- name:'name',
|
|
|
|
|
|
+ url: 'link',
|
|
|
|
+ name: 'originalName',
|
|
res: 'data'
|
|
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;
|
|
let i = 0;
|
|
this.option.column.forEach(item => {
|
|
this.option.column.forEach(item => {
|
|
if (item.search) i++
|
|
if (item.search) i++
|
|
@@ -133,7 +242,111 @@ export default {
|
|
this.option.searchMenuPosition = "right";
|
|
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>
|
|
</script>
|
|
|
|
|