Commit 3f68be88 authored by wanglianghe's avatar wanglianghe

始发港,目的港绑定

parent a00800f8
...@@ -52,3 +52,21 @@ export function exportWarehouseExcel(query) { ...@@ -52,3 +52,21 @@ export function exportWarehouseExcel(query) {
responseType: 'blob' responseType: 'blob'
}) })
} }
export function routerList(data) {
return request({
url: '/ecw/warehouse/routerList',
method: 'post',
data: data
})
}
export function changeRouteStatus(data) {
return request({
url: '/ecw/warehouse/changeRouteStatus',
method: 'post',
data: data
})
}
...@@ -59,6 +59,12 @@ ...@@ -59,6 +59,12 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" @click="toRouteList(scope.row, '2')" :disabled="scope.row.tradeType=='2'"
v-hasPermi="['ecw:warehouse:routerQuery']">相关始发港</el-button>
<el-button size="mini" type="text" @click="toRouteList(scope.row, '1')" :disabled="scope.row.tradeType=='1'"
v-hasPermi="['ecw:warehouse:routerQuery']">相关目的港</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ecw:warehouse:update']">修改</el-button> v-hasPermi="['ecw:warehouse:update']">修改</el-button>
</template> </template>
...@@ -68,6 +74,45 @@ ...@@ -68,6 +74,45 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/> @pagination="getList"/>
<el-dialog :visible.sync="showRouteList" width="900px" append-to-body>
<el-table v-loading="routeLoadig" :data="routeList">
<el-table-column label="序号" type="index" width="50" />
<el-table-column prop="tansportType" label="运输方式" align="center">
<template slot-scope="scope">
<div>
{{ transportName(scope.row.transportType) }}
</div>
</template>
</el-table-column>
<el-table-column label="仓库编号" align="center" prop="number" />
<el-table-column label="仓库名称" align="center" prop="titleZh" />
<el-table-column label="仓库容量(m)³" align="center" prop="volume" />
<el-table-column label="仓库地址" align="center" prop="addressZh" />
<el-table-column prop="head" label="负责人" align="center">
<template slot-scope="scope">
<div>
<span>{{ scope.row.head }}</span>
<br>
<span>{{ scope.row.tell }}</span>
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="routeStatusClick(scope.row)"
v-hasPermi="['ecw:warehouse:routerQuery']">{{scope.row.lineId ? '关闭线路' : '开通线路'}}</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="routeCount > 0" :total="routeCount" :page.sync="routeQueryParam.pageNo" :limit.sync="routeQueryParam.pageSize"
@pagination="getRouteList"/>
</el-dialog>
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="90px"> <el-form ref="form" :model="form" :rules="rules" label-width="90px">
...@@ -176,7 +221,8 @@ ...@@ -176,7 +221,8 @@
</template> </template>
<script> <script>
import { createWarehouse, updateWarehouse, deleteWarehouse, getWarehouse, getWarehousePage, exportWarehouseExcel } from "@/api/ecw/warehouse"; import { createWarehouse, updateWarehouse, deleteWarehouse, getWarehouse, getWarehousePage,
exportWarehouseExcel,routerList,changeRouteStatus } from "@/api/ecw/warehouse";
import { getNodePage } from "@/api/ecw/node"; import { getNodePage } from "@/api/ecw/node";
import { getListTree } from "@/api/ecw/region"; import { getListTree } from "@/api/ecw/region";
import { getDictDatas, DICT_TYPE } from '@/utils/dict'; import { getDictDatas, DICT_TYPE } from '@/utils/dict';
...@@ -231,6 +277,17 @@ export default { ...@@ -231,6 +277,17 @@ export default {
nodeList: [], nodeList: [],
routeLoadig: false,
showRouteList: false,
routeList: [],
routeCount:0,
routeQueryParam: {
pageNo: 1,
pageSize: 10,
id: null,
tradeType: null
},
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
...@@ -284,6 +341,20 @@ export default { ...@@ -284,6 +341,20 @@ export default {
}; };
}, },
computed: {
transportName() {
return transportType => {
for(let index in this.transportDatas) {
let transportItem = this.transportDatas[index];
if(transportItem.value == transportType) {
return transportItem.label;
}
}
}
},
},
watch: { watch: {
'form.zhou'(newV, oldV) { 'form.zhou'(newV, oldV) {
if(oldV && oldV != newV) { if(oldV && oldV != newV) {
...@@ -344,6 +415,34 @@ export default { ...@@ -344,6 +415,34 @@ export default {
}); });
}, },
routeStatusClick(row) {
this.routeQueryParam.transportType = row.transportType;
this.routeQueryParam.warehouseId = row.id;
this.routeQueryParam.lineId = row.lineId;
changeRouteStatus(this.routeQueryParam).then(response => {
let lineId = response.data;
this.$set(row, "lineId", lineId);
row.lineId = lineId;
this.$modal.msgSuccess("操作成功");
})
},
toRouteList(row, tradeType) {
this.routeQueryParam.id = row.id;
this.routeQueryParam.tradeType = tradeType;
this.showRouteList = true;
this.routeLoadig = true;
this.getRouteList();
},
getRouteList() {
routerList(this.routeQueryParam).then(response => {
this.routeList = response.data.list;
this.routeLoadig = false;
});
},
//获取网点列表 //获取网点列表
getNodeList() { getNodeList() {
let params = {pageNo:1, pageSize:100}; let params = {pageNo:1, pageSize:100};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment