|
@@ -3,7 +3,6 @@
|
|
|
<avue-crud :option="option"
|
|
|
:table-loading="loading"
|
|
|
:data="assemblyForm.containersList"
|
|
|
- :page.sync="page"
|
|
|
:permission="permissionList"
|
|
|
:before-open="beforeOpen"
|
|
|
v-model="form"
|
|
@@ -16,22 +15,14 @@
|
|
|
@selection-change="selectionChange"
|
|
|
@current-change="currentChange"
|
|
|
@size-change="sizeChange"
|
|
|
- @refresh-change="refreshChange"
|
|
|
- @on-load="onLoad">
|
|
|
+ @refresh-change="refreshChange">
|
|
|
<template slot="menuLeft">
|
|
|
- <!-- <el-button type="danger"-->
|
|
|
- <!-- size="small"-->
|
|
|
- <!-- icon="el-icon-delete"-->
|
|
|
- <!-- plain-->
|
|
|
- <!-- v-if="permission.containers_delete"-->
|
|
|
- <!-- @click="handleDelete">删 除-->
|
|
|
- <!--</el-button>-->
|
|
|
<div style="display: flex;align-items: center;justify-content: space-between">
|
|
|
<div>
|
|
|
- <el-button type="primary" size="small" @click="DistributionBox">配箱</el-button>
|
|
|
- <el-button type="danger" size="small">撤销</el-button>
|
|
|
- <el-button type="danger" size="small">全部撤销</el-button>
|
|
|
- <el-button type="warning" size="small">清除箱号</el-button>
|
|
|
+ <!--<el-button type="primary" size="small" @click="DistributionBox">配箱</el-button>-->
|
|
|
+ <el-button type="danger" size="small" @click="revokefun">撤销</el-button>
|
|
|
+ <el-button type="danger" size="small" @click="wholeRevokefun">全部撤销</el-button>
|
|
|
+ <el-button type="warning" size="small" @click="cleanCntrNofun">清除箱号</el-button>
|
|
|
</div>
|
|
|
<div>
|
|
|
<el-button size="small">Copy</el-button>
|
|
@@ -40,21 +31,39 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <template slot-scope="{type,disabled,row}" slot="polCnNameForm">
|
|
|
- <search-query ref="SearchQuery" :disabled="extendedDisabled" :selectValue="form.polCnName"
|
|
|
- :datalist="polData" title="装货港" :filterable="true" :clearable="true"
|
|
|
- :remote="true" :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
|
|
|
- @remoteMethod="polListfun"
|
|
|
- @corpChange="polCorpChange">
|
|
|
- <bports></bports>
|
|
|
- </search-query>
|
|
|
- </template>
|
|
|
+ <template slot-scope="scope" slot="menu">
|
|
|
+ <el-button v-if="scope.row.edit" :type="scope.type" :size="scope.size" icon="el-icon-edit"
|
|
|
+ @click.stop="rowSavefun(scope.row, scope.index)">保存
|
|
|
+ </el-button>
|
|
|
+ <el-button v-else :type="scope.type" :size="scope.size" icon="el-icon-edit"
|
|
|
+ @click.stop="rowCellfun(scope.row, scope.index)">编辑
|
|
|
+ </el-button>
|
|
|
+ <el-button :type="scope.type" :size="scope.size" icon="el-icon-delete"
|
|
|
+ @click.stop="rowDel(scope.row, scope.index)">删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope" slot="cntrNo">
|
|
|
+ <el-input v-if="scope.row.edit" v-model="scope.row.cntrNo"
|
|
|
+ size="small" clearable placeholder="请输入箱号"></el-input>
|
|
|
+ <span v-else>{{scope.row.cntrNo}}</span>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope" slot="sealNo">
|
|
|
+ <el-input v-if="scope.row.edit" v-model="scope.row.sealNo"
|
|
|
+ size="small" clearable placeholder="请输入封号"></el-input>
|
|
|
+ <span v-else>{{scope.row.sealNo}}</span>
|
|
|
+ </template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {containersList, containersDetail, containersSubmit, containersRemove} from "@/api/iosBasicData/containers";
|
|
|
+import {
|
|
|
+ containersList,
|
|
|
+ containersDetail,
|
|
|
+ containersSubmit,
|
|
|
+ containersRemove,
|
|
|
+ containersCleanBoxNo, containersRevoke
|
|
|
+} from "@/api/iosBasicData/containers";
|
|
|
import {mapGetters} from "vuex";
|
|
|
import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
|
|
|
import bports from "@/views/iosBasicData/bports/index.vue";
|
|
@@ -74,12 +83,12 @@
|
|
|
|
|
|
form: {},
|
|
|
query: {},
|
|
|
- loading: true,
|
|
|
- page: {
|
|
|
- pageSize: 10,
|
|
|
- currentPage: 1,
|
|
|
- total: 0
|
|
|
- },
|
|
|
+ loading: false,
|
|
|
+ // page: {
|
|
|
+ // pageSize: 10,
|
|
|
+ // currentPage: 1,
|
|
|
+ // total: 0
|
|
|
+ // },
|
|
|
selectionList: [],
|
|
|
option: {
|
|
|
height:'250',
|
|
@@ -503,30 +512,75 @@
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.polListfun()
|
|
|
},
|
|
|
methods: {
|
|
|
- // 配箱
|
|
|
- DistributionBox(){
|
|
|
- this.$emit('DistributionBox')
|
|
|
+ // 编辑
|
|
|
+ rowCellfun(row,index){
|
|
|
+ this.$delete(row, 'edit')
|
|
|
+ this.$set(row, 'edit', true)
|
|
|
+ },
|
|
|
+ // 保存
|
|
|
+ rowSavefun(row){
|
|
|
+ this.$delete(row, 'edit')
|
|
|
+ this.$set(row,'edit',false)
|
|
|
+ this.$emit('rowSavefun',row)
|
|
|
+ },
|
|
|
+ // 清除箱号
|
|
|
+ cleanCntrNofun(){
|
|
|
+ this.$confirm("确定将数据清除全部箱号?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(()=>{
|
|
|
+ let arr = this.assemblyForm.containersList.map(item=>{
|
|
|
+ return item.id
|
|
|
+ })
|
|
|
+ // 清除箱号接口
|
|
|
+ containersCleanBoxNo(arr.join(',')).then(res=>{
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "清除箱号成功!"
|
|
|
+ });
|
|
|
+ this.$emit('billsDetailfun')
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 全部撤销
|
|
|
+ wholeRevokefun(){
|
|
|
+ this.$confirm("确定将数据撤销全部?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(()=>{
|
|
|
+ let arr = this.assemblyForm.containersList.map(item=>{
|
|
|
+ return item.id
|
|
|
+ })
|
|
|
+ containersRevoke(arr.join(',')).then(res=>{
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "全部撤销成功!"
|
|
|
+ });
|
|
|
+ this.$emit('billsDetailfun')
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 撤销
|
|
|
+ revokefun(){
|
|
|
+ if (this.selectionList.length > 0) {
|
|
|
+ containersRevoke(this.selectionList[0].id).then(res=>{
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "撤销成功!"
|
|
|
+ });
|
|
|
+ this.$emit('billsDetailfun')
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请选选择要撤销的数据!"
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
- // 装货港接口请求数据
|
|
|
- polListfun(cnName){
|
|
|
- bportsList(1,2,{cnName}).then(res=>{
|
|
|
- this.polData = res.data.data.records
|
|
|
- })
|
|
|
- },
|
|
|
- // 装货港回调
|
|
|
- polCorpChange(value){
|
|
|
- for(let item of this.polData) {
|
|
|
- if (item.cnName == value) {
|
|
|
- this.$set(this.form, 'polId', item.id)
|
|
|
- this.$set(this.form, 'polCode', item.code)
|
|
|
- this.$set(this.form, 'polCnName', item.cnName)
|
|
|
- this.$set(this.form, 'polEnName', item.enName)
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
|
|
|
rowSave(row, done, loading) {
|
|
|
containersSubmit(row).then(() => {
|
|
@@ -554,6 +608,7 @@
|
|
|
console.log(error);
|
|
|
});
|
|
|
},
|
|
|
+ // 删除
|
|
|
rowDel(row) {
|
|
|
this.$confirm("确定将选择数据删除?", {
|
|
|
confirmButtonText: "确定",
|
|
@@ -621,6 +676,7 @@
|
|
|
arr = list
|
|
|
}
|
|
|
this.selectionList = arr
|
|
|
+ this.$emit('selectionChange',this.selectionList)
|
|
|
},
|
|
|
selectionClear() {
|
|
|
this.selectionList = [];
|
|
@@ -633,19 +689,19 @@
|
|
|
this.page.pageSize = pageSize;
|
|
|
},
|
|
|
refreshChange() {
|
|
|
- this.onLoad(this.page, this.query);
|
|
|
+ console.log('刷新')
|
|
|
+ // this.onLoad(this.page, this.query);
|
|
|
},
|
|
|
- onLoad(page, params = {}) {
|
|
|
- this.loading = true;
|
|
|
-
|
|
|
- containersList(page.currentPage, page.pageSize, {...Object.assign(params, this.query),pid:this.pid}).then(res => {
|
|
|
- const data = res.data.data;
|
|
|
- this.page.total = data.total;
|
|
|
- this.data = data.records;
|
|
|
- this.loading = false;
|
|
|
- this.selectionClear();
|
|
|
- });
|
|
|
- }
|
|
|
+ // onLoad(page, params = {}) {
|
|
|
+ // this.loading = true;
|
|
|
+ // containersList(page.currentPage, page.pageSize, {...Object.assign(params, this.query),pid:this.pid}).then(res => {
|
|
|
+ // const data = res.data.data;
|
|
|
+ // this.page.total = data.total;
|
|
|
+ // this.data = data.records
|
|
|
+ // this.loading = false;
|
|
|
+ // this.selectionClear();
|
|
|
+ // });
|
|
|
+ // }
|
|
|
}
|
|
|
};
|
|
|
</script>
|