Commit 69351e05 authored by wanglianghe's avatar wanglianghe

路线新增其他服务

parent 2ddc53ac
......@@ -125,5 +125,13 @@ export function deptList(data) {
})
}
/** 修改其他服务 */
export function serviceConfig(data) {
return request({
url: '/ecw/warehouse/serviceConfig',
method: 'post',
data: data
})
}
......@@ -173,13 +173,6 @@
<el-checkbox v-for="dict in transportDatas" :label="dict.value" :key="dict.value" :value="dict.value" name="freight"> {{dict.label}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="其他服务" prop="otherServiceList">
<el-checkbox-group v-model="form.otherServiceList">
<el-checkbox v-for="item in serviceGroup" :label="item.id" :key="item.id" :value="item.id"> {{item.text}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="网点详情" prop="contentZh">
<editor v-model="form.contentZh" :min-height="150"/>
......@@ -264,11 +257,6 @@ export default {
pageSize: 10
},
serviceGroup: [
{id: '1', text: '送货上门'},
{id: '2', text: '非控货订单代收货款'}
],
dateRangeCreateTime: [],
// 查询参数
queryParams: {
......@@ -278,7 +266,6 @@ export default {
// 表单参数
form: {
checkList:[],
otherServiceList:[],
},
// 表单校验
rules: {
......@@ -475,8 +462,7 @@ export default {
worktime: undefined,
adminId: undefined,
aorder: undefined,
checkList: [],
otherServiceList: []
checkList: []
};
this.resetForm("form");
......@@ -504,7 +490,6 @@ export default {
const id = row.id;
getNode(id).then(response => {
this.form = response.data;
this.form.otherServiceList = [];
this.changeContinents(response.data.zhou);
this.changeCountry(response.data.guojia);
......@@ -513,13 +498,6 @@ export default {
let ckList = response.data.freight.split(',');
this.$set(this.form, 'checkList', ckList);
// console.log('11111111');
if(response.data.otherService) {
let otherService = response.data.otherService.split(",");
this.$set(this.form, 'otherServiceList', otherService);
}
this.open = true;
this.title = "修改服务网点";
});
......@@ -542,11 +520,6 @@ export default {
freight = freight.substring(0, freight.length - 1);
this.form.freight = freight;
var otherService = this.form.otherServiceList.join(',');
this.form.otherService= otherService;
// console.log(otherService);
// return;
// 修改的提交
if (this.form.id != null) {
updateNode(this.form).then(response => {
......
......@@ -122,12 +122,21 @@
</template>
</el-table-column>
<el-table-column label="路线服务" align="center" prop="otherService">
<template slot-scope="scope">
<div>{{ serviceNames(scope.row.otherService) }}</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>
<el-button size="mini" type="primary" @click="templateClick(scope.row)" v-if="scope.row.lineId != null"
v-hasPermi="['ecw:warehouse:routerQuery']">设置路线提单模板</el-button>
<el-button size="mini" type="primary" @click="serviceClick(scope.row)" v-if="scope.row.lineId != null"
v-hasPermi="['ecw:warehouse:routerQuery']">开通服务</el-button>
</template>
</el-table-column>
</el-table>
......@@ -266,6 +275,22 @@
</div>
</el-dialog>
<!--设置服务-->
<el-dialog title="设置服务" :visible.sync="serviceOpen" width="1000px" append-to-body>
<el-form ref="form" :model="lineform" :rules="rules" label-width="80px">
<el-form-item label="其他服务" prop="otherServiceList">
<el-checkbox-group v-model="lineform.serviceList">
<el-checkbox v-for="item in serviceGroup" :label="item.id" :key="item.id" :value="item.id"> {{item.text}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitLineForm">保 存</el-button>
</div>
</el-dialog>
<!-- 对话框(添加 / 修改) -->
<el-dialog title="设置路线提单模板" :visible.sync="templateOpen" width="1000px" @close="ladingFormClose()" append-to-body>
<el-form ref="form" :model="ladingform" :rules="rules" label-width="80px">
......@@ -340,7 +365,7 @@
<script>
import { createWarehouse, updateWarehouse, deleteWarehouse, getWarehouse, getWarehousePage,createTemplate,getLadingTemplate,
exportWarehouseExcel,routerList,changeRouteStatus,deptBind,deptList } from "@/api/ecw/warehouse";
exportWarehouseExcel,routerList,changeRouteStatus,deptBind,deptList,serviceConfig } from "@/api/ecw/warehouse";
import { getNodePage } from "@/api/ecw/node";
import { getListTree } from "@/api/ecw/region";
import { getDictDatas, DICT_TYPE } from '@/utils/dict'
......@@ -404,6 +429,11 @@ export default {
//市信息列表
cityList: [],
serviceGroup: [
{id: '1', text: '送货上门'},
{id: '2', text: '非控货订单代收货款'}
],
// 总条数
total: 0,
// 仓库列表
......@@ -414,6 +444,8 @@ export default {
open: false,
templateOpen:false,
dateRangeCreateTime: [],
serviceOpen: false,
isUpdate: false,
......@@ -457,6 +489,8 @@ export default {
// 表单参数
form: {checkList:[],},
ladingform: {prefixCounter:null,titleZh:null,contentZh:null,account:null,acctArr:[]},
lineform: {serviceList:[]},
// 表单校验
rules: {
nodeId: [{ required: true, message: "服务网点不能为空", trigger: "blur" }],
......@@ -521,6 +555,25 @@ export default {
}
}
},
serviceNames() {
return otherService => {
if(!otherService) return '';
let serviceList = otherService.split(",");
let names = [];
for(let index in serviceList) {
let item = serviceList[index];
for(let dictIndex in this.serviceGroup) {
let dictItem = this.serviceGroup[dictIndex];
if(dictItem.id == item) {
names.push(dictItem.text);
break;
}
}
}
return names.join(',');
}
}
},
watch: {
......@@ -712,6 +765,33 @@ export default {
this.templateOpen = true;
},
serviceClick(row) {
if(row.otherService) {
this.lineform.serviceList = row.otherService.split(",");
} else {
this.lineform.serviceList = [];
}
this.serviceOpen = true;
this.lineform.lineId = row.lineId;
},
submitLineForm() {
let otherService = this.lineform.serviceList.join(',');
this.lineform.otherService = otherService;
serviceConfig(this.lineform).then(res => {
this.$modal.msgSuccess("操作成功");
for(let index in this.routeList) {
let routeItem = this.routeList[index];
if(routeItem.lineId && routeItem.lineId == this.lineform.lineId) {
// routeItem.otherService = otherService;
this.$set(routeItem, 'otherService', otherService);
}
}
this.serviceOpen = false;
})
},
routeStatusClick(row) {
this.routeQueryParam.transportType = row.transportType;
this.routeQueryParam.warehouseId = row.id;
......
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