|
|
@@ -20,7 +20,9 @@
|
|
|
@refresh-change="refreshChange"
|
|
|
@resetColumn="resetColumn('crud', 'option', 'optionBack', 459)"
|
|
|
@saveColumn="saveColumn('crud', 'option', 'optionBack', 459)"
|
|
|
+ :row-style="rowStyle"
|
|
|
@on-load="onLoad"
|
|
|
+ :summary-method="summaryMethod"
|
|
|
>
|
|
|
<template slot="menuLeft">
|
|
|
<el-tabs v-model="query.whetherDisplay" type="card" @tab-click="handleClick">
|
|
|
@@ -40,6 +42,26 @@
|
|
|
<el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)" :disabled="row.whetherManuallyCreate == 1"
|
|
|
>删 除</el-button
|
|
|
>
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-turn-off"
|
|
|
+ v-if="row.whetherDeactivate == 1"
|
|
|
+ type="text"
|
|
|
+ style="color: #67C23A"
|
|
|
+ size="small"
|
|
|
+ @click.stop="rowEnable(row, 0)"
|
|
|
+ >
|
|
|
+ 启用
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-turn-off"
|
|
|
+ v-if="row.whetherDeactivate == 0"
|
|
|
+ type="text"
|
|
|
+ style="color: #F56C6C"
|
|
|
+ size="small"
|
|
|
+ @click.stop="rowEnable(row, 1)"
|
|
|
+ >
|
|
|
+ 停用
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
<template slot="sysNo" slot-scope="{ row }">
|
|
|
<span style="color: #1e9fff;cursor: pointer;" @click="rowEdit(row)">{{ row.sysNo }}</span>
|
|
|
@@ -59,8 +81,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getList, remove } from "@/api/boxManagement/containerNumber/index.js";
|
|
|
+import { getList, remove, whetherDeactivate } from "@/api/boxManagement/containerNumber/index.js";
|
|
|
import { getWorkDicts } from "@/api/system/dictbiz";
|
|
|
+import { micrometerFormat2 } from "@/util/validate";
|
|
|
import detailsPage from "./detailsPage";
|
|
|
import { getToken } from "@/util/auth";
|
|
|
import batchPod from "./components/batchPod.vue";
|
|
|
@@ -86,7 +109,7 @@ export default {
|
|
|
optionBack: {
|
|
|
height: "auto",
|
|
|
calcHeight: 30,
|
|
|
- menuWidth: 140,
|
|
|
+ menuWidth: 180,
|
|
|
tip: false,
|
|
|
searchShow: true,
|
|
|
searchMenuSpan: 6,
|
|
|
@@ -102,23 +125,23 @@ export default {
|
|
|
searchIndex: 3,
|
|
|
summaryText: "合计",
|
|
|
showSummary: true,
|
|
|
- sumColumnList: [
|
|
|
- {
|
|
|
- name: "remainingNum",
|
|
|
- type: "sum",
|
|
|
- decimals: 0
|
|
|
- },
|
|
|
- {
|
|
|
- name: "occupyNum",
|
|
|
- type: "sum",
|
|
|
- decimals: 0
|
|
|
- },
|
|
|
- {
|
|
|
- name: "storageNum",
|
|
|
- type: "sum",
|
|
|
- decimals: 0
|
|
|
- }
|
|
|
- ],
|
|
|
+ // sumColumnList: [
|
|
|
+ // {
|
|
|
+ // name: "remainingNum",
|
|
|
+ // type: "sum",
|
|
|
+ // decimals: 0
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // name: "occupyNum",
|
|
|
+ // type: "sum",
|
|
|
+ // decimals: 0
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // name: "storageNum",
|
|
|
+ // type: "sum",
|
|
|
+ // decimals: 0
|
|
|
+ // }
|
|
|
+ // ],
|
|
|
column: [
|
|
|
{
|
|
|
label: "箱东",
|
|
|
@@ -264,7 +287,7 @@ export default {
|
|
|
overHidden: true,
|
|
|
search: true,
|
|
|
searchOrder: 5,
|
|
|
- searchLabelWidth: 120,
|
|
|
+ searchLabelWidth: 130,
|
|
|
type: "select",
|
|
|
filterable: true,
|
|
|
remote: true,
|
|
|
@@ -317,18 +340,35 @@ export default {
|
|
|
label: "目的港",
|
|
|
prop: "podCname",
|
|
|
width: 90,
|
|
|
+ overHidden: true
|
|
|
+ // search: true,
|
|
|
+ // searchOrder: 4,
|
|
|
+ // type: "select",
|
|
|
+ // filterable: true,
|
|
|
+ // remote: true,
|
|
|
+ // dicUrl: "/api/blade-los/bports/list?status=0&size=5¤t=1&cnName={{key}}",
|
|
|
+ // props: {
|
|
|
+ // label: "cnName",
|
|
|
+ // value: "cnName",
|
|
|
+ // desc: "code",
|
|
|
+ // res: "data.records"
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "目的港",
|
|
|
+ prop: "podId",
|
|
|
+ width: 90,
|
|
|
overHidden: true,
|
|
|
+ hide: true,
|
|
|
search: true,
|
|
|
searchOrder: 4,
|
|
|
type: "select",
|
|
|
filterable: true,
|
|
|
- remote: true,
|
|
|
- dicUrl: "/api/blade-los/bports/list?status=0&size=5¤t=1&cnName={{key}}",
|
|
|
+ dicUrl: "/api/blade-los/bports/listAll?status=0",
|
|
|
props: {
|
|
|
label: "cnName",
|
|
|
- value: "cnName",
|
|
|
- desc: "code",
|
|
|
- res: "data.records"
|
|
|
+ value: "id",
|
|
|
+ desc: "code"
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
@@ -532,7 +572,7 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
addButton() {
|
|
|
- this.pageIds = []
|
|
|
+ this.pageIds = [];
|
|
|
this.isShow = false;
|
|
|
},
|
|
|
copyButton() {
|
|
|
@@ -542,7 +582,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
fixPod() {
|
|
|
- if (this.selectionList.length==0) {
|
|
|
+ if (this.selectionList.length == 0) {
|
|
|
return this.$message.error("请选择数据");
|
|
|
}
|
|
|
let ids = [];
|
|
|
@@ -551,11 +591,21 @@ export default {
|
|
|
}
|
|
|
this.$refs.batchPod.openDialog(ids.join(","));
|
|
|
},
|
|
|
+ rowEnable(row, type) {
|
|
|
+ let obj = {
|
|
|
+ id: row.id,
|
|
|
+ type: type
|
|
|
+ };
|
|
|
+ whetherDeactivate(obj).then(res => {
|
|
|
+ this.$message.success("操作成功!");
|
|
|
+ this.refreshChange();
|
|
|
+ });
|
|
|
+ },
|
|
|
rowEdit(row) {
|
|
|
- this.pageIds = []
|
|
|
+ this.pageIds = [];
|
|
|
this.data.forEach(item => {
|
|
|
- this.pageIds.push(item.id)
|
|
|
- })
|
|
|
+ this.pageIds.push(item.id);
|
|
|
+ });
|
|
|
this.detailData = {
|
|
|
id: row.id
|
|
|
};
|
|
|
@@ -577,6 +627,36 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ summaryMethod({ columns, data }) {
|
|
|
+ const sums = [];
|
|
|
+ if (columns.length > 0) {
|
|
|
+ columns.forEach((item, index) => {
|
|
|
+ sums[0] = "合计";
|
|
|
+ if (item.property == "remainingNum" || item.property == "occupyNum" || item.property == "storageNum") {
|
|
|
+ let remainingNumSum = 0;
|
|
|
+ let occupyNumSum = 0;
|
|
|
+ let storageNumSum = 0;
|
|
|
+ data.forEach(e => {
|
|
|
+ if (e.whetherDeactivate == 0) {
|
|
|
+ remainingNumSum = _.add(remainingNumSum, Number(e.remainingNum));
|
|
|
+ occupyNumSum = _.add(occupyNumSum, Number(e.occupyNum));
|
|
|
+ storageNumSum = _.add(storageNumSum, Number(e.storageNum));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (item.property == "remainingNum") {
|
|
|
+ sums[index] = micrometerFormat2(remainingNumSum);
|
|
|
+ }
|
|
|
+ if (item.property == "occupyNum") {
|
|
|
+ sums[index] = micrometerFormat2(occupyNumSum);
|
|
|
+ }
|
|
|
+ if (item.property == "storageNum") {
|
|
|
+ sums[index] = micrometerFormat2(storageNumSum);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return sums;
|
|
|
+ },
|
|
|
searchReset() {
|
|
|
this.query = this.$options.data().query;
|
|
|
this.onLoad(this.page);
|
|
|
@@ -628,7 +708,7 @@ export default {
|
|
|
},
|
|
|
// 详情的返回列表
|
|
|
goBack() {
|
|
|
- this.pageIds = []
|
|
|
+ this.pageIds = [];
|
|
|
// 初始化数据
|
|
|
if (JSON.stringify(this.$route.query) != "{}") {
|
|
|
this.$router.$avueRouter.closeTag();
|
|
|
@@ -702,6 +782,13 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
return back;
|
|
|
+ },
|
|
|
+ rowStyle({ row, column, rowIndex }) {
|
|
|
+ if (row.whetherDeactivate == 1) {
|
|
|
+ return {
|
|
|
+ color: "#f56c6c"
|
|
|
+ };
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -726,4 +813,7 @@ export default {
|
|
|
::v-deep .el-col-md-8 {
|
|
|
width: 24.33333%;
|
|
|
}
|
|
|
+.error-row {
|
|
|
+ color: #f56c6c;
|
|
|
+}
|
|
|
</style>
|