|
@@ -11,8 +11,23 @@
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="16">
|
|
|
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
|
|
|
- <el-form-item label="医院名称" prop="hoipitalName">
|
|
|
+ <!-- <el-form-item label="医院名称" prop="hoipitalName">
|
|
|
<el-input v-model="form.planName" placeholder="2-30位,可输入汉字、字母、数字和下划线"></el-input>
|
|
|
+ </el-form-item>-->
|
|
|
+ <el-form-item label="医院名称" class="selectMedicine" prop="hospitalId">
|
|
|
+ <el-select
|
|
|
+ v-model="form.hospitalId"
|
|
|
+ placeholder="请选择"
|
|
|
+ clearable
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in HospitalInfoList"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ :key="item.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="方案名称" prop="planName">
|
|
|
<el-input v-model="form.planName" placeholder="2-30位,可输入汉字、字母、数字和下划线"></el-input>
|
|
@@ -175,6 +190,7 @@ export default {
|
|
|
};
|
|
|
return {
|
|
|
form: {
|
|
|
+ hospitalId: '',
|
|
|
planName: '',
|
|
|
planCode: ''
|
|
|
},
|
|
@@ -185,10 +201,10 @@ export default {
|
|
|
{ min: 2, max: 30, message: '长度2-30位', trigger: 'blur' },
|
|
|
{ required: true, validator: validatePass, trigger: 'blur' }
|
|
|
],
|
|
|
- hoipitalName: [
|
|
|
- { required: true, message: '方案名称不能为空', trigger: 'change' },
|
|
|
- { min: 2, max: 30, message: '长度2-30位', trigger: 'blur' },
|
|
|
- { required: true, validator: validatePass, trigger: 'blur' }
|
|
|
+ hospitalId: [
|
|
|
+ { required: true, message: '医院名称不能为空', trigger: 'change' }
|
|
|
+ // { min: 2, max: 30, message: '长度2-30位', trigger: 'blur' },
|
|
|
+ // { required: true, validator: validatePass, trigger: 'blur' }
|
|
|
],
|
|
|
planCode: [
|
|
|
{ required: true, message: '方案编码不能为空', trigger: 'change' },
|
|
@@ -197,7 +213,7 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
planDefaultList: [],
|
|
|
- hospitalId: '',
|
|
|
+ // hospitalId: '',
|
|
|
isEdit: false, // 是否处于编辑页面 false--新增 true--编辑
|
|
|
switchSubStatus: 0, // 辅助信息
|
|
|
switchMedStatus: 0, // 医学知识
|
|
@@ -207,12 +223,14 @@ export default {
|
|
|
isTopLight: -1,
|
|
|
flag: 1,
|
|
|
editCount: -1, // 页面会否被编辑 >0被编辑 =0 未编辑
|
|
|
- isSaveSuccess: false // 是否保存成功
|
|
|
+ isSaveSuccess: false, // 是否保存成功
|
|
|
+ HospitalInfoList: []
|
|
|
};
|
|
|
},
|
|
|
beforeRouteLeave(to, from, next) {
|
|
|
+ console.log(this.editCount,'this.editCount');
|
|
|
if (
|
|
|
- (this.editCount > 2 && !this.isSaveSuccess && this.isEdit) ||
|
|
|
+ (this.editCount > 3 && !this.isSaveSuccess && this.isEdit) ||
|
|
|
(this.editCount > 1 && !this.isSaveSuccess && !this.isEdit)
|
|
|
) {
|
|
|
// console.log('页面被编辑了');
|
|
@@ -252,13 +270,15 @@ export default {
|
|
|
async created() {
|
|
|
const { isEdit, data } = this.$route.params;
|
|
|
console.log(data, '编辑页传递的data');
|
|
|
- let res = await api.getHospitalInfo(); // 同步获取医院信息
|
|
|
- this.hospitalId = res.data.data.id;
|
|
|
+ this._getHospitalInfo(); // 获取医院下拉列表
|
|
|
+ // let res = await api.getHospitalInfo(); // 同步获取医院信息
|
|
|
+ // this.hospitalId = res.data.data.id;
|
|
|
if (isEdit) {
|
|
|
// 编辑页面
|
|
|
this.isEdit = true;
|
|
|
+ this.form.hospitalId = data.hospitalId
|
|
|
let params = {
|
|
|
- hospitalId: res.data.data.id,
|
|
|
+ hospitalId: data.hospitalId,
|
|
|
id: data.id
|
|
|
};
|
|
|
this._getPlanInfoIds(params);
|
|
@@ -269,7 +289,14 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
close() {},
|
|
|
-
|
|
|
+ // 获取医院下拉列表
|
|
|
+ _getHospitalInfo() {
|
|
|
+ api.getHospitalInfo().then(res => {
|
|
|
+ if (res.data.code === '0') {
|
|
|
+ this.HospitalInfoList = res.data.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
// 方案配置排序
|
|
|
sortPlan(item, index, type) {
|
|
|
// console.log('排序', item, index, type);
|
|
@@ -353,7 +380,7 @@ export default {
|
|
|
// 获取默认方案配置
|
|
|
_getDefaultPlans() {
|
|
|
api.getDefaultPlans().then(res => {
|
|
|
- // console.log(res, '获取默认的方案配置');
|
|
|
+ console.log(res, '获取默认的方案配置');
|
|
|
if (res.data.code === '0') {
|
|
|
this.planDefaultList =
|
|
|
res.data.data &&
|
|
@@ -388,6 +415,7 @@ export default {
|
|
|
res.data.data.planDetailDefault[0].planDetails;
|
|
|
}
|
|
|
let res1 = await api.getPlanInfoIds(params);
|
|
|
+ console.log(res1, '==================');
|
|
|
if (res1.data.code === '0') {
|
|
|
newPlan = res1.data.data[0].sysSetInfo[0].planDetails;
|
|
|
this.form.planName = res1.data.data[0].planName;
|
|
@@ -430,7 +458,8 @@ export default {
|
|
|
TempPlanDetail = this.planDefaultList.map((item, index) => {
|
|
|
return {
|
|
|
code: item.code,
|
|
|
- hospitalId: this.hospitalId,
|
|
|
+ hospitalId: this.form.hospitalId,
|
|
|
+ // hospitalId: this.hospitalId,
|
|
|
name: item.name,
|
|
|
number: item.number,
|
|
|
orderNo: item.orderNo,
|
|
@@ -447,12 +476,12 @@ export default {
|
|
|
// 处理保存活动信息参数
|
|
|
_getParams() {
|
|
|
let params = {
|
|
|
- hospitalId: this.hospitalId,
|
|
|
+ hospitalId: this.form.hospitalId,
|
|
|
planCode: this.form.planCode,
|
|
|
planDetailParent: [
|
|
|
{
|
|
|
code: 'auxiliary',
|
|
|
- hospitalId: this.hospitalId,
|
|
|
+ hospitalId: this.form.hospitalId,
|
|
|
name: '辅助信息',
|
|
|
number: 0,
|
|
|
orderNo: 1,
|
|
@@ -461,7 +490,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
code: 'medical',
|
|
|
- hospitalId: this.hospitalId,
|
|
|
+ hospitalId: this.form.hospitalId,
|
|
|
name: '医学知识',
|
|
|
orderNo: 3,
|
|
|
planDetailSub: [{}],
|
|
@@ -469,7 +498,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
code: 'followup',
|
|
|
- hospitalId: this.hospitalId,
|
|
|
+ hospitalId: this.form.hospitalId,
|
|
|
name: '随访计划',
|
|
|
orderNo: 4,
|
|
|
planDetailSub: [{}],
|
|
@@ -492,6 +521,8 @@ export default {
|
|
|
if (valid) {
|
|
|
this.saveDisable = true;
|
|
|
let params = this._getParams();
|
|
|
+ // console.log(params, 'params');
|
|
|
+ // return;
|
|
|
api.savePlanInfoDatas(params).then(res => {
|
|
|
if (res.data.code === '0') {
|
|
|
this.$message({
|
|
@@ -649,4 +680,14 @@ export default {
|
|
|
border-color: transparent;
|
|
|
}
|
|
|
}
|
|
|
+.selectMedicine {
|
|
|
+ /deep/ .el-input__suffix-inner {
|
|
|
+ position: relative;
|
|
|
+ top: -1px;
|
|
|
+ }
|
|
|
+ /deep/ .el-icon-circle-close {
|
|
|
+ position: relative;
|
|
|
+ top: -2px;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|