|
|
@@ -1,285 +1,302 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <avue-crud :table-loading="loading" :option="option" :data="data" @selection-change="selectionChange" id="out-table"
|
|
|
- ref="crud" :header-cell-class-name="headerClassName"
|
|
|
- @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 309.6)"
|
|
|
- @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 309.6)">
|
|
|
- <template slot-scope="scope" slot="menuLeft">
|
|
|
- <el-button v-if="!typeMenu && assemblyForm.billStatus != 3" type="danger" size="small" icon="el-icon-delete"
|
|
|
- plain :disabled="disabled" @click="batchWithdrawfun">{{ $t("btn118n.selectclearCtnrLlist") }}
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- <template slot-scope="scope" slot="menu" v-if="assemblyForm.billStatus != 3">
|
|
|
- <el-button :type="scope.type" :size="scope.size" icon="el-icon-edit"
|
|
|
- :disabled="disabled || assemblyForm.status == 1" @click.stop="withdrawfun(scope.row, scope.index)">{{ $t("btn118n.selectclearCtnrLlist") }}
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- <template slot-scope="scope" slot="billNo">
|
|
|
- <span class="textoverflow" :style="typeMenu ? 'color: #409EFF' : ''" @click.stop="corpfun(scope)">
|
|
|
- {{ scope.row.billNo }}
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- <template slot-scope="scope" slot="billDate">
|
|
|
- <span>{{ scope.row.billDate ? scope.row.billDate.slice(0, 10) : '' }}</span>
|
|
|
- </template>
|
|
|
- </avue-crud>
|
|
|
- </div>
|
|
|
+ <div>
|
|
|
+ <avue-crud
|
|
|
+ :table-loading="loading"
|
|
|
+ :option="option"
|
|
|
+ :data="data"
|
|
|
+ @selection-change="selectionChange"
|
|
|
+ id="out-table"
|
|
|
+ ref="crud"
|
|
|
+ :header-cell-class-name="headerClassName"
|
|
|
+ @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 309.6)"
|
|
|
+ @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 309.6)"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope" slot="menuLeft">
|
|
|
+ <el-button
|
|
|
+ v-if="!typeMenu && assemblyForm.billStatus != 3"
|
|
|
+ type="danger"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ plain
|
|
|
+ :disabled="disabled"
|
|
|
+ @click="batchWithdrawfun"
|
|
|
+ >{{ $t("btn118n.selectclearCtnrLlist") }}
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope" slot="menu" v-if="assemblyForm.billStatus != 3">
|
|
|
+ <el-button
|
|
|
+ :type="scope.type"
|
|
|
+ :size="scope.size"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ :disabled="disabled || assemblyForm.status == 1"
|
|
|
+ @click.stop="withdrawfun(scope.row, scope.index)"
|
|
|
+ >{{ $t("btn118n.selectclearCtnrLlist") }}
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope" slot="billNo">
|
|
|
+ <span class="textoverflow" :style="typeMenu ? 'color: #409EFF' : ''" @click.stop="corpfun(scope)">
|
|
|
+ {{ scope.row.billNo }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope" slot="billDate">
|
|
|
+ <span>{{ scope.row.billDate ? scope.row.billDate.slice(0, 10) : "" }}</span>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { billsRevokeReinsurancePolicy } from "@/api/iosBasicData/bills";
|
|
|
export default {
|
|
|
- props: {
|
|
|
- data: {
|
|
|
- type: Array,
|
|
|
- },
|
|
|
- assemblyForm: {
|
|
|
- type: Object,
|
|
|
- },
|
|
|
- typeMenu: {
|
|
|
- type: Boolean,
|
|
|
- default: false,
|
|
|
- },
|
|
|
- detailData: {},
|
|
|
- disabled: {
|
|
|
- type: Boolean,
|
|
|
- default: false,
|
|
|
- },
|
|
|
+ props: {
|
|
|
+ data: {
|
|
|
+ type: Array
|
|
|
},
|
|
|
- data() {
|
|
|
- return {
|
|
|
- selectionList: [],
|
|
|
- loading: false,
|
|
|
- option: {},
|
|
|
- optionBack: {
|
|
|
- calcHeight: 30,
|
|
|
- tip: false,
|
|
|
- searchShow: true,
|
|
|
- searchMenuSpan: 6,
|
|
|
- border: true,
|
|
|
- selection: true, // 多选
|
|
|
- index: true,
|
|
|
- stripe: true,
|
|
|
- addBtn: false,
|
|
|
- viewBtn: false,
|
|
|
- delBtn: false,
|
|
|
- editBtn: false,
|
|
|
- menu: true, // 操作栏
|
|
|
- menuWidth: 'auto',
|
|
|
- column: [
|
|
|
- {
|
|
|
- label: this.$t("sea118n.billNo"),
|
|
|
- prop: "billNo",
|
|
|
- width: "160",
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: this.$t("sea118n.billDate"),
|
|
|
- prop: "billDate",
|
|
|
- width: "160",
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: this.$t("sea118n.corpName"),
|
|
|
- prop: "corpCnName",
|
|
|
- width: "160",
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
-/* {
|
|
|
+ assemblyForm: {
|
|
|
+ type: Object
|
|
|
+ },
|
|
|
+ typeMenu: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ detailData: {},
|
|
|
+ disabled: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ selectionList: [],
|
|
|
+ loading: false,
|
|
|
+ option: {},
|
|
|
+ optionBack: {
|
|
|
+ calcHeight: 30,
|
|
|
+ tip: false,
|
|
|
+ searchShow: true,
|
|
|
+ searchMenuSpan: 6,
|
|
|
+ border: true,
|
|
|
+ selection: true, // 多选
|
|
|
+ index: true,
|
|
|
+ stripe: true,
|
|
|
+ addBtn: false,
|
|
|
+ viewBtn: false,
|
|
|
+ delBtn: false,
|
|
|
+ editBtn: false,
|
|
|
+ menu: true, // 操作栏
|
|
|
+ menuWidth: "auto",
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: this.$t("sea118n.billNo"),
|
|
|
+ prop: "billNo",
|
|
|
+ width: "160",
|
|
|
+ overHidden: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: this.$t("sea118n.billDate"),
|
|
|
+ prop: "billDate",
|
|
|
+ width: "160",
|
|
|
+ overHidden: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: this.$t("sea118n.corpName"),
|
|
|
+ prop: "corpCnName",
|
|
|
+ width: "160",
|
|
|
+ overHidden: true
|
|
|
+ },
|
|
|
+ /* {
|
|
|
label: "客户英文名",
|
|
|
prop: "corpEnName",
|
|
|
width: "160",
|
|
|
overHidden: true,
|
|
|
},*/
|
|
|
- {
|
|
|
- label: "MB/L NO",
|
|
|
- prop: "mblno",
|
|
|
- width: "160",
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "HB/L NO",
|
|
|
- prop: "hblno",
|
|
|
- width: "160",
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label:this.$t("sea118n.marks"),
|
|
|
- prop: "marks",
|
|
|
- width: "160",
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: this.$t("sea118n.QTY"),
|
|
|
- prop: "quantity",
|
|
|
- width: "100",
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: this.$t("sea118n.package"),
|
|
|
- prop: "packingUnit",
|
|
|
- width: "100",
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: this.$t("sea118n.GW"),
|
|
|
- prop: "grossWeight",
|
|
|
- width: "100",
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
-/* {
|
|
|
+ {
|
|
|
+ label: "MB/L NO",
|
|
|
+ prop: "mblno",
|
|
|
+ width: "160",
|
|
|
+ overHidden: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "HB/L NO",
|
|
|
+ prop: "hblno",
|
|
|
+ width: "160",
|
|
|
+ overHidden: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: this.$t("sea118n.marks"),
|
|
|
+ prop: "marks",
|
|
|
+ width: "160",
|
|
|
+ overHidden: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: this.$t("sea118n.QTY"),
|
|
|
+ prop: "quantity",
|
|
|
+ width: "100",
|
|
|
+ overHidden: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: this.$t("sea118n.package"),
|
|
|
+ prop: "packingUnit",
|
|
|
+ width: "100",
|
|
|
+ overHidden: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: this.$t("sea118n.GW"),
|
|
|
+ prop: "grossWeight",
|
|
|
+ width: "100",
|
|
|
+ overHidden: true
|
|
|
+ },
|
|
|
+ /* {
|
|
|
label: "净重 (KGM)",
|
|
|
prop: "netWeight",
|
|
|
width: "100",
|
|
|
overHidden: true,
|
|
|
},*/
|
|
|
- {
|
|
|
- label: this.$t("sea118n.CBM"),
|
|
|
- prop: "measurement",
|
|
|
- width: "100",
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
- ]
|
|
|
- },
|
|
|
- }
|
|
|
+ {
|
|
|
+ label: this.$t("sea118n.CBM"),
|
|
|
+ prop: "measurement",
|
|
|
+ width: "100",
|
|
|
+ overHidden: true
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ this.option = await this.getColumnData(this.getColumnName(309.6), this.optionBack);
|
|
|
+ if (this.typeMenu) {
|
|
|
+ this.option.menu = false;
|
|
|
+ this.option.selection = false;
|
|
|
+ // this.option.height = '200'
|
|
|
+ this.option.columnBtn = false;
|
|
|
+ this.option.refreshBtn = false;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // console.log(document.querySelector('.avue-crud__menu'),156)
|
|
|
+ document.querySelector(".avue-crud__menu").className = "avue-crud__menu_height";
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.option.menu = true;
|
|
|
+ this.option.selection = true;
|
|
|
+ // this.option.height = '450'
|
|
|
+ this.option.columnBtn = true;
|
|
|
+ this.option.refreshBtn = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 解决AVue表格错位问题
|
|
|
+ activated() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.crud.doLayout();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 点击进详情
|
|
|
+ corpfun(scope) {
|
|
|
+ this.$emit("corpfun", scope.row.id);
|
|
|
},
|
|
|
- async created() {
|
|
|
- this.option = await this.getColumnData(this.getColumnName(309.6), this.optionBack);
|
|
|
- if (this.typeMenu) {
|
|
|
- this.option.menu = false
|
|
|
- this.option.selection = false
|
|
|
- // this.option.height = '200'
|
|
|
- this.option.columnBtn = false
|
|
|
- this.option.refreshBtn = false
|
|
|
- this.$nextTick(() => {
|
|
|
- // console.log(document.querySelector('.avue-crud__menu'),156)
|
|
|
- document.querySelector('.avue-crud__menu').className = 'avue-crud__menu_height'
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.option.menu = true
|
|
|
- this.option.selection = true
|
|
|
- // this.option.height = '450'
|
|
|
- this.option.columnBtn = true
|
|
|
- this.option.refreshBtn = true
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+ // 批量撤回
|
|
|
+ batchWithdrawfun() {
|
|
|
+ if (this.selectionList.length === 0) {
|
|
|
+ this.$message.warning("请选择至少一条数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$confirm("确定将选择数据撤回?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ let arr = this.selectionList.map(item => {
|
|
|
+ return item.id;
|
|
|
+ });
|
|
|
+ this.billsRevokeReinsurancePolicyfun(arr.join(","), this.assemblyForm.id);
|
|
|
+ });
|
|
|
},
|
|
|
- // 解决AVue表格错位问题
|
|
|
- activated() {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.crud.doLayout()
|
|
|
- })
|
|
|
+ withdrawfun(row) {
|
|
|
+ this.$confirm("确定将选择数据撤回?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.billsRevokeReinsurancePolicyfun(row.id, this.assemblyForm.id);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 选择赋值
|
|
|
+ selectionChange(list) {
|
|
|
+ this.selectionList = list;
|
|
|
+ },
|
|
|
+ // 撤回接口
|
|
|
+ billsRevokeReinsurancePolicyfun(ids, id) {
|
|
|
+ billsRevokeReinsurancePolicy(ids, id).then(res => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ this.$emit("billsListAllfun");
|
|
|
+ this.$emit("billsDetailfun");
|
|
|
+ });
|
|
|
},
|
|
|
- methods: {
|
|
|
- // 点击进详情
|
|
|
- corpfun(scope) {
|
|
|
- this.$emit('corpfun', scope.row.id)
|
|
|
- },
|
|
|
- // 批量撤回
|
|
|
- batchWithdrawfun() {
|
|
|
- if (this.selectionList.length === 0) {
|
|
|
- this.$message.warning("请选择至少一条数据");
|
|
|
- return;
|
|
|
- }
|
|
|
- this.$confirm("确定将选择数据撤回?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- let arr = this.selectionList.map(item => {
|
|
|
- return item.id
|
|
|
- })
|
|
|
- this.billsRevokeReinsurancePolicyfun(arr.join(','), this.assemblyForm.id)
|
|
|
- })
|
|
|
- },
|
|
|
- withdrawfun(row) {
|
|
|
- this.$confirm("确定将选择数据撤回?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- this.billsRevokeReinsurancePolicyfun(row.id, this.assemblyForm.id)
|
|
|
- })
|
|
|
- },
|
|
|
- // 选择赋值
|
|
|
- selectionChange(list) {
|
|
|
- this.selectionList = list
|
|
|
- },
|
|
|
- // 撤回接口
|
|
|
- billsRevokeReinsurancePolicyfun(ids, id) {
|
|
|
- billsRevokeReinsurancePolicy(ids, id).then(res => {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- this.$emit('billsListAllfun')
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- //自定义列保存
|
|
|
- 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;
|
|
|
- }
|
|
|
- },
|
|
|
|
|
|
- // 更改表格颜色
|
|
|
- headerClassName(tab) {
|
|
|
- //颜色间隔
|
|
|
- let back = ""
|
|
|
- if (tab.columnIndex >= 0 && tab.column.level === 1) {
|
|
|
- if (tab.columnIndex % 2 === 0) {
|
|
|
- back = "back-one"
|
|
|
- } else if (tab.columnIndex % 2 === 1) {
|
|
|
- back = "back-two"
|
|
|
- }
|
|
|
- }
|
|
|
- return back;
|
|
|
- },
|
|
|
+ //自定义列保存
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
+ // 更改表格颜色
|
|
|
+ headerClassName(tab) {
|
|
|
+ //颜色间隔
|
|
|
+ let back = "";
|
|
|
+ if (tab.columnIndex >= 0 && tab.column.level === 1) {
|
|
|
+ if (tab.columnIndex % 2 === 0) {
|
|
|
+ back = "back-one";
|
|
|
+ } else if (tab.columnIndex % 2 === 1) {
|
|
|
+ back = "back-two";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return back;
|
|
|
}
|
|
|
-}
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
::v-deep#out-table .back-one {
|
|
|
- background: #ecf5ff !important;
|
|
|
- text-align: center;
|
|
|
- padding: 4px 0;
|
|
|
+ background: #ecf5ff !important;
|
|
|
+ text-align: center;
|
|
|
+ padding: 4px 0;
|
|
|
}
|
|
|
|
|
|
::v-deep#out-table .back-two {
|
|
|
- background: #ecf5ff !important;
|
|
|
- text-align: center;
|
|
|
- padding: 4px 0;
|
|
|
+ background: #ecf5ff !important;
|
|
|
+ text-align: center;
|
|
|
+ padding: 4px 0;
|
|
|
}
|
|
|
|
|
|
.textoverflow {
|
|
|
- width: 100%;
|
|
|
- overflow: hidden;
|
|
|
- white-space: nowrap;
|
|
|
- text-overflow: ellipsis;
|
|
|
+ width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
}
|
|
|
|
|
|
.avue-crud__menu_height {
|
|
|
- display: none;
|
|
|
+ display: none;
|
|
|
}
|
|
|
</style>
|