Commit 61ac96b7 authored by lixy's avatar lixy

分公司管理

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