提交 040424db authored 作者: chenweiping's avatar chenweiping

0510

上级 b334dcec
...@@ -53,10 +53,10 @@ export function exportHospital(query) { ...@@ -53,10 +53,10 @@ export function exportHospital(query) {
} }
// 状态修改 // 状态修改
export function changeStatus(id, status) { export function changeStatus(id, isEnable) {
const data = { const data = {
id, id,
status isEnable
} }
return request({ return request({
url: '/backstage/hospital/changeStatus', url: '/backstage/hospital/changeStatus',
......
...@@ -10,18 +10,18 @@ ...@@ -10,18 +10,18 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="isEnable">
<el-select <el-select
v-model="queryParams.status" v-model="queryParams.isEnable"
placeholder="状态" placeholder="状态"
clearable clearable
size="small" size="small"
> >
<el-option <el-option
v-for="dict in statusOptions" v-for="item in isEnableOptions"
:key="dict.dictValue" :key="item.value"
:label="dict.dictLabel" :label="item.label"
:value="dict.dictValue" :value="item.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -41,6 +41,14 @@ ...@@ -41,6 +41,14 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="省市区" >
<el-cascader
size="large"
:options="options"
ref="cascader"
@change="handleProvinceChange">
</el-cascader>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
...@@ -111,9 +119,9 @@ ...@@ -111,9 +119,9 @@
<el-table-column label="状态" align="center" > <el-table-column label="状态" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.status" v-model="scope.row.isEnable"
active-value="0" :active-value="1"
inactive-value="1" :inactive-value="0"
@change="handleStatusChange(scope.row)" @change="handleStatusChange(scope.row)"
></el-switch> ></el-switch>
</template> </template>
...@@ -209,7 +217,6 @@ ...@@ -209,7 +217,6 @@
ref="cascader" ref="cascader"
@change="handleChange"> @change="handleChange">
</el-cascader> </el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="医院地址" prop="addr"> <el-form-item label="医院地址" prop="addr">
<el-input v-model="form.addr" placeholder="请输入医院地址" /> <el-input v-model="form.addr" placeholder="请输入医院地址" />
...@@ -234,13 +241,13 @@ ...@@ -234,13 +241,13 @@
<el-form-item label="微信号" prop="wechat"> <el-form-item label="微信号" prop="wechat">
<el-input v-model="form.wechat" placeholder="请输入微信号" /> <el-input v-model="form.wechat" placeholder="请输入微信号" />
</el-form-item> </el-form-item>
<el-form-item label="状态"> <el-form-item label="状态" prop="isEnable">
<el-radio-group v-model="form.status"> <el-radio-group v-model="form.isEnable">
<el-radio <el-radio
v-for="dict in statusOptions" v-for="item in isEnableOptions"
:key="dict.dictValue" :key="item.value"
:label="dict.dictValue" :label="item.value"
>{{dict.dictLabel}}</el-radio> >{{item.label}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -290,12 +297,19 @@ export default { ...@@ -290,12 +297,19 @@ export default {
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
// 状态数据字典 // 状态数据字典
statusOptions: [], isEnableOptions: [{
value: 1,
label: '上架'
}, {
value: 0,
label: '停用'
}],
//医院分类数据字典 //医院分类数据字典
dataTypeOptions: [], dataTypeOptions: [],
options: regionDataPlus, options: regionDataPlus,
selectedOptions: [], selectedOptions: [],
selectedLabelOptions: [], selectedLabelOptions: [],
provinceOptions: [],
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
...@@ -328,10 +342,15 @@ export default { ...@@ -328,10 +342,15 @@ export default {
days: null, days: null,
isSaturday: null, isSaturday: null,
isSunday: null, isSunday: null,
dataType: null dataType: null,
provinceCode:'',
cityNameCode:'',
districtCode:'',
}, },
// 表单参数 // 表单参数
form: {}, form: {
isEnable: 1
},
// 表单校验 // 表单校验
rules: { rules: {
name:[ name:[
...@@ -360,9 +379,6 @@ export default { ...@@ -360,9 +379,6 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.getDicts("sys_normal_disable").then(response => {
this.statusOptions = response.data;
});
this.getDicts("data_type").then(response => { this.getDicts("data_type").then(response => {
this.dataTypeOptions = response.data; this.dataTypeOptions = response.data;
}); });
...@@ -374,9 +390,17 @@ export default { ...@@ -374,9 +390,17 @@ export default {
this.selectedOptions=value; this.selectedOptions=value;
this.selectedLabelOptions=this.$refs["cascader"].getCheckedNodes()[0].pathLabels; this.selectedLabelOptions=this.$refs["cascader"].getCheckedNodes()[0].pathLabels;
}, },
handleProvinceChange (value) {
this.provinceOptions=value;
},
/** 查询【请填写功能名称】列表 */ /** 查询【请填写功能名称】列表 */
getList() { getList() {
this.loading = true; this.loading = true;
if(JSON.stringify(this.provinceOptions)!='[]'){
this.queryParams.provinceCode=this.provinceOptions[0];
this.queryParams.cityNameCode=this.provinceOptions[1];
this.queryParams.districtCode=this.provinceOptions[2];
}
listHospital(this.queryParams).then(response => { listHospital(this.queryParams).then(response => {
this.hospitalList = response.rows; this.hospitalList = response.rows;
this.total = response.total; this.total = response.total;
...@@ -420,8 +444,7 @@ export default { ...@@ -420,8 +444,7 @@ export default {
days: null, days: null,
isSaturday: null, isSaturday: null,
isSunday: null, isSunday: null,
dataType: null, dataType: null
status: "0"
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -475,6 +498,8 @@ export default { ...@@ -475,6 +498,8 @@ export default {
}) })
this.images1 = iList this.images1 = iList
} }
this.selectedOptions=[];
this.selectedLabelOptions=[];
this.selectedOptions.push(this.form.provinceCode); this.selectedOptions.push(this.form.provinceCode);
this.selectedOptions.push(this.form.cityNameCode); this.selectedOptions.push(this.form.cityNameCode);
this.selectedOptions.push(this.form.districtCode); this.selectedOptions.push(this.form.districtCode);
...@@ -587,17 +612,17 @@ export default { ...@@ -587,17 +612,17 @@ export default {
}, },
// 状态修改 // 状态修改
handleStatusChange(row) { handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用"; let text = row.isEnable === 1 ? "启用" : "停用";
this.$confirm('确认要"' + text + '"该医院吗?', "警告", { this.$confirm('确认要"' + text + '"该医院吗?', "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(function() { }).then(function() {
return changeStatus(row.id, row.status); return changeStatus(row.id, row.isEnable);
}).then(() => { }).then(() => {
this.msgSuccess(text + "成功"); this.msgSuccess(text + "成功");
}).catch(function() { }).catch(function() {
row.status = row.status === "0" ? "1" : "0"; row.isEnable = row.isEnable === 1 ? 1 : 0;
}); });
}, },
//删除上传文件 //删除上传文件
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论