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

0510

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