Commit 61ac96b7 authored by lixy's avatar lixy

分公司管理

parent a28199bb
...@@ -141,3 +141,13 @@ export function delVehicleModel(id) { ...@@ -141,3 +141,13 @@ export function delVehicleModel(id) {
method: 'delete' method: 'delete'
}); });
} }
/**
* 上架、下架
* */
export function upStatusChange(query) {
return fetch({
url: '/vehicle/vehicleModel/setStatus/' + query.id + '/' + query.status,
method: 'put'
});
}
...@@ -2,6 +2,18 @@ ...@@ -2,6 +2,18 @@
<div class="app-container calendar-list-container"> <div class="app-container calendar-list-container">
<div class="filter-container" ref="filter-container"> <div class="filter-container" ref="filter-container">
<el-form :rules="rules4Query" ref="queryForm" :inline="inline" :model="listQuery"> <el-form :rules="rules4Query" ref="queryForm" :inline="inline" :model="listQuery">
<el-form-item label="所属地区" prop="zoneId">
<el-select class="filter-item" v-model="listQuery.zoneId" placeholder="请选择" @change="getProvinceRegions">
<el-option :key="undefined" label="无" :value="undefined"></el-option>
<el-option v-for="val in getAllZoneList" :key="val.id" :label="val.name" :value="val.id"> </el-option>
</el-select>
</el-form-item>
<!--<el-form-item label="片区" prop="addrCity">-->
<!--<el-select class="filter-item" v-model="listQuery.addrCity" placeholder="请选择片区">-->
<!--<el-option :key="undefined" label="无" :value="undefined"></el-option>-->
<!--<el-option v-for="item in cityRegions4Query" :key="item.id" :label="item.name" :value="item.id"></el-option>-->
<!--</el-select>-->
<!--</el-form-item>-->
<el-form-item label="省份"> <el-form-item label="省份">
<el-select class="filter-item" v-model="listQuery.addrProvince" placeholder="请选择省份(直辖市)" @change='getValue'> <el-select class="filter-item" v-model="listQuery.addrProvince" placeholder="请选择省份(直辖市)" @change='getValue'>
<el-option :key="undefined" label="无" :value="undefined"></el-option> <el-option :key="undefined" label="无" :value="undefined"></el-option>
...@@ -18,10 +30,10 @@ ...@@ -18,10 +30,10 @@
<el-button class="filter-item" v-if="branchCompany_btn_add" style="margin-left: 10px;" @click="handleCreate" <el-button class="filter-item" v-if="branchCompany_btn_add" style="margin-left: 10px;" @click="handleCreate"
type="primary" icon="edit">添加 type="primary" icon="edit">添加
</el-button> </el-button>
<form methods="post" enctype="multipart/form-data" style="display:inline-block;margin-left:10px;;"> <form methods="post" enctype="multipart/form-data" style="display:inline-block;margin-left:10px;;">
<el-button class="filter-item" type="primary" v-waves @click="choiceImg">导入</el-button> <el-button class="filter-item" type="primary" v-waves @click="choiceImg">导入</el-button>
<input ref="filElem" type="file" name="file" class="upload-file" @change="getFile($event)" style="display:none;"> <input ref="filElem" type="file" name="file" class="upload-file" @change="getFile($event)" style="display:none;">
</form> </form>
</el-form> </el-form>
</div> </div>
...@@ -92,7 +104,7 @@ ...@@ -92,7 +104,7 @@
<el-table-column align="center" label="操作" width="150" fixed="right"> <el-table-column align="center" label="操作" width="150" fixed="right">
<template scope="scope"> <template scope="scope">
<el-button size="small" class="el-button el-button--text el-button--small" @click="handleUpdate(scope.row)">{{branchCompany_btn_edit?'编辑':'查看'}} <el-button v-if="branchCompany_btn_edit" size="small" class="el-button el-button--text el-button--small" @click="handleUpdate(scope.row)">编辑
</el-button> </el-button>
<el-button v-if="branchCompany_btn_del" size="small" class="el-button el-button--text el-button--small" style="color: red;" @click="handleDelete(scope.row)">删除 <el-button v-if="branchCompany_btn_del" size="small" class="el-button el-button--text el-button--small" style="color: red;" @click="handleDelete(scope.row)">删除
</el-button> </el-button>
...@@ -174,13 +186,13 @@ ...@@ -174,13 +186,13 @@
</el-form-item> </el-form-item>
<!-- <el-form-item >--> <!-- <el-form-item >-->
<!-- <el-input value="1" v-model="form.type" disabled="true" type="hidden"></el-input>--> <!-- <el-input value="1" v-model="form.type" disabled="true" type="hidden"></el-input>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cancel('form')">取 消</el-button> <el-button @click="cancel('form')">取 消</el-button>
<el-button v-if="dialogStatus=='create'" type="primary" @click="create('form')">确 定</el-button> <el-button v-if="dialogStatus=='create'" type="primary" @click="create('form')">确 定</el-button>
<el-button type="primary" @click="update('form')" v-if="branchCompany_btn_edit&&dialogStatus=='update'">确 定</el-button> <el-button v-else type="primary" @click="update('form')">确 定</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
...@@ -363,6 +375,7 @@ ...@@ -363,6 +375,7 @@
listQuery: { listQuery: {
page: 1, page: 1,
limit: 20, limit: 20,
zoneId: undefined,
addrProvince: undefined, addrProvince: undefined,
addrCity: undefined, addrCity: undefined,
addrTown: undefined addrTown: undefined
...@@ -424,19 +437,25 @@ ...@@ -424,19 +437,25 @@
} }
}, },
methods: { methods: {
/**
* 改变省份,清空城市
* */
changeProvince(){
this.form.addrCity = undefined;
this.form.addrTown = undefined;
},
/** /**
* 根据片区获取省份数据 * 根据片区获取省份数据
* */ * */
getProvinceRegions() { getProvinceRegions() {
let that = this; let that = this;
this.form.addrCity = undefined; this.listQuery.addrCity = undefined;
this.form.addrProvince = undefined; this.listQuery.addrProvince = undefined;
this.form.addrTown = undefined; if (!this.$utils.isInteger(this.listQuery.zoneId)) {
if (!this.$utils.isInteger(this.form.zoneId)) {
return null; return null;
} }
this.allZoneArr.map(function(item){ this.allZoneArr.map(function(item){
if(item.id == that.form.zoneId){ if(item.id == that.listQuery.zoneId){
getSysRegionByIds(item.provinceIds).then(response => { getSysRegionByIds(item.provinceIds).then(response => {
let listRs = undefined; let listRs = undefined;
if (!that.$utils.isEmpty(response.data)) { if (!that.$utils.isEmpty(response.data)) {
...@@ -447,12 +466,8 @@ ...@@ -447,12 +466,8 @@
} }
}); });
}, },
/** getValue(e){
* 改变省份,清空城市 this.listQuery.addrCity = undefined;
* */
changeProvince(){
this.form.addrCity = undefined;
this.form.addrTown = undefined;
}, },
/** /**
* 改变城市,清空城镇 * 改变城市,清空城镇
...@@ -460,9 +475,6 @@ ...@@ -460,9 +475,6 @@
changeCity(){ changeCity(){
this.form.addrTown = undefined; this.form.addrTown = undefined;
}, },
getValue(e){
this.listQuery.addrCity = undefined;
},
getStatusName(code) { getStatusName(code) {
if (!this.$utils.isInteger(code)) { if (!this.$utils.isInteger(code)) {
return '未知'; return '未知';
...@@ -590,23 +602,23 @@ ...@@ -590,23 +602,23 @@
} }
}); });
}, },
choiceImg(){ choiceImg(){
this.$refs.filElem.dispatchEvent(new MouseEvent('click')) this.$refs.filElem.dispatchEvent(new MouseEvent('click'))
}, },
getFile(event){ getFile(event){
let formData = new FormData(); let formData = new FormData();
formData.append('file',event.target.files[0]); formData.append('file',event.target.files[0]);
let config = { let config = {
headers: { headers: {
'Content-Type': 'multipart/form-data' 'Content-Type': 'multipart/form-data'
} }
} }
axios.post('/vehicle/branchCompany/importExcel', formData, config).then(function (res) { axios.post('/vehicle/branchCompany/importExcel', formData, config).then(function (res) {
if (res.status === 2000) { if (res.status === 2000) {
/*这里做处理*/ /*这里做处理*/
} }
}) })
}, },
resetTemp() { resetTemp() {
this.form = { this.form = {
id: undefined, id: undefined,
......
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