This commit is contained in:
shidongli 2024-03-28 10:02:08 +08:00
parent f930a80d79
commit c8e471065b

View File

@ -405,7 +405,7 @@
<el-select <el-select
v-model="aitem.serviceWayName" v-model="aitem.serviceWayName"
placeholder="请选择服务方式" placeholder="请选择服务方式"
@change="changeway($event,index)" @change="changeway($event, index)"
> >
<el-option <el-option
v-for="item in optionsway" v-for="item in optionsway"
@ -424,7 +424,7 @@
style="margin-left: 10px" style="margin-left: 10px"
v-model="aitem.serviceContent" v-model="aitem.serviceContent"
placeholder="请选择服务内容" placeholder="请选择服务内容"
@change="changcontent($event,index)" @change="changcontent($event, index)"
> >
<el-option <el-option
v-for="item in optionscontent[index]" v-for="item in optionscontent[index]"
@ -443,9 +443,7 @@
<el-select <el-select
v-model="aitem.serviceFrequencyText" v-model="aitem.serviceFrequencyText"
placeholder="请选择服务频次" placeholder="请选择服务频次"
> >
<el-option <el-option
v-for="item in optionsfrequency[index]" v-for="item in optionsfrequency[index]"
:key="item.id" :key="item.id"
@ -663,11 +661,9 @@
:inline="true" :inline="true"
> >
<el-form-item label="病种名称:" prop="packageVersion"> <el-form-item label="病种名称:" prop="packageVersion">
<span style=" <span style="display: inline-block; width: 80px">{{
display: inline-block; formdetail.diseaseTypeName
width: 80px; }}</span>
">{{ formdetail.diseaseTypeName }}</span>
</el-form-item> </el-form-item>
<el-form-item label="服务包名称:" prop="packageVersion"> <el-form-item label="服务包名称:" prop="packageVersion">
<span <span
@ -689,13 +685,11 @@
<el-form-item label="价格:" prop="packageVersion"> <el-form-item label="价格:" prop="packageVersion">
<span>{{ formdetail.packagePrice }}</span> <span>{{ formdetail.packagePrice }}</span>
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="服务期限:" prop="packageVersion"> <el-form-item label="服务期限:" prop="packageVersion">
<span style=" <span style="display: inline-block; width: 80px">{{
display: inline-block; formdetail.packageTermAndUnit
width: 80px; }}</span>
">{{ formdetail.packageTermAndUnit }}</span>
</el-form-item> </el-form-item>
<el-form-item label="硬件类型:" prop="packageVersion"> <el-form-item label="硬件类型:" prop="packageVersion">
<span>{{ <span>{{
@ -807,25 +801,25 @@ export default {
// //
optionscontent: { optionscontent: {
'0':[], '0': [],
'1':[], '1': [],
'2':[], '2': [],
'3':[], '3': [],
'4':[], '4': [],
}, },
// //
optionsfrequency:{ optionsfrequency: {
'0':[], '0': [],
'1':[], '1': [],
'2':[], '2': [],
'3':[], '3': [],
'4':[], '4': [],
}, },
// optionsfrequency: [ // optionsfrequency: [
// { // {
// value: '', // value: '',
// label: '' // label: ''
// } // }
// ], // ],
optionstype: [{ optionstype: [{
@ -893,7 +887,7 @@ export default {
hardwareType: null, hardwareType: null,
whetherRelease: null, whetherRelease: null,
}, },
// //
form: {}, form: {},
formdetail: {}, formdetail: {},
@ -947,7 +941,7 @@ export default {
}, },
}, },
serviceWayId:'', serviceWayId: '',
}; };
}, },
@ -1027,38 +1021,38 @@ export default {
// console.log(this.optionscontent) // console.log(this.optionscontent)
var optionscontentPlus = [] var optionscontentPlus = []
this.optionscontent[index] = [] this.optionscontent[index] = []
for(var i = 0;i<5;i++){ for (var i = 0; i < 5; i++) {
if(this.optionscontent[i] != []){ if (this.optionscontent[i] != []) {
optionscontentPlus.push(this.optionscontent[i]) optionscontentPlus.push(this.optionscontent[i])
} }
} }
// console.log(optionscontentPlus,'optionscontentPlus') // console.log(optionscontentPlus,'optionscontentPlus')
// console.log(this.optionscontent,'optionscontent') // console.log(this.optionscontent,'optionscontent')
this.optionscontent = { this.optionscontent = {
'0':[], '0': [],
'1':[], '1': [],
'2':[], '2': [],
'3':[], '3': [],
'4':[], '4': [],
} }
for(var j = 0 ; j<optionscontentPlus.length;j++){ for (var j = 0; j < optionscontentPlus.length; j++) {
this.optionscontent[j] = optionscontentPlus[j] this.optionscontent[j] = optionscontentPlus[j]
} }
var optionsfrequencyPlus = [] var optionsfrequencyPlus = []
this.optionsfrequency[index] = [] this.optionsfrequency[index] = []
for(var i = 0;i<5;i++){ for (var i = 0; i < 5; i++) {
if(this.optionsfrequency[i] != []){ if (this.optionsfrequency[i] != []) {
optionsfrequencyPlus.push(this.optionsfrequency[i]) optionsfrequencyPlus.push(this.optionsfrequency[i])
} }
} }
this.optionsfrequency = { this.optionsfrequency = {
'0':[], '0': [],
'1':[], '1': [],
'2':[], '2': [],
'3':[], '3': [],
'4':[], '4': [],
} }
for(var j = 0 ; j<optionsfrequencyPlus.length;j++){ for (var j = 0; j < optionsfrequencyPlus.length; j++) {
this.optionsfrequency[j] = optionsfrequencyPlus[j] this.optionsfrequency[j] = optionsfrequencyPlus[j]
} }
}, },
@ -1068,7 +1062,7 @@ export default {
var obj = { var obj = {
serviceWayName: null, serviceWayName: null,
serviceContent: null, serviceContent: null,
serviceFrequencyText:null, serviceFrequencyText: null,
idd: this.idd idd: this.idd
}; };
if (this.form.voList.length == 5) { if (this.form.voList.length == 5) {
@ -1094,18 +1088,18 @@ export default {
}); });
}, },
// //
changeway(e,index) { changeway(e, index) {
this.serviceWayId = this.optionsway.find(f => f.serviceWayName == e).id this.serviceWayId = this.optionsway.find(f => f.serviceWayName == e).id
serviccontent(this.serviceWayId).then(response => { serviccontent(this.serviceWayId).then(response => {
this.optionscontent[index] = response.rows; this.optionscontent[index] = response.rows;
}); });
this.form.voList[index].serviceContent = null this.form.voList[index].serviceContent = null
this.form.voList[index].serviceFrequencyText = null this.form.voList[index].serviceFrequencyText = null
}, },
// //
changcontent(e,index) { changcontent(e, index) {
var id = null var id = null
this.form.voList[index].serviceFrequencyText = null this.form.voList[index].serviceFrequencyText = null
id = this.optionscontent[index].find(f => f.serviceContent == e).id id = this.optionscontent[index].find(f => f.serviceContent == e).id
@ -1113,7 +1107,7 @@ export default {
this.optionsfrequency[index].forEach(el => { this.optionsfrequency[index].forEach(el => {
if (el.serviceFrequencyType == "DIGIT") { if (el.serviceFrequencyType == "DIGIT") {
el.serviceFrequencyText = el.serviceFrequencyStart + '~' + el.serviceFrequencyEnd el.serviceFrequencyText = el.serviceFrequencyStart + '~' + el.serviceFrequencyEnd
} }
else if (el.serviceFrequencyType == "serviceFrequencyType") { else if (el.serviceFrequencyType == "serviceFrequencyType") {
this.optionsfrequency[index] = this.optionscontent[index].find(f => f.id == e).serviceWayFrequencyList this.optionsfrequency[index] = this.optionscontent[index].find(f => f.id == e).serviceWayFrequencyList
} }
@ -1260,27 +1254,27 @@ export default {
// this.optionscontent = [], // this.optionscontent = [],
this.optionscontent = { this.optionscontent = {
'0':[], '0': [],
'1':[], '1': [],
'2':[], '2': [],
'3':[], '3': [],
'4':[], '4': [],
}, },
this.optionsfrequency={ this.optionsfrequency = {
'0':[], '0': [],
'1':[], '1': [],
'2':[], '2': [],
'3':[], '3': [],
'4':[], '4': [],
} }
// //
// this.optionsfrequency = [ // this.optionsfrequency = [
// { // {
// value: '', // value: '',
// label: '' // label: ''
// } // }
// ], // ],
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
@ -1308,7 +1302,7 @@ export default {
{ {
serviceWayName: null, serviceWayName: null,
serviceContent: null, serviceContent: null,
serviceFrequencyText:null, serviceFrequencyText: null,
serviceFrequencyStart: null, serviceFrequencyStart: null,
serviceFrequencyEnd: null, serviceFrequencyEnd: null,
idd: this.idd, idd: this.idd,
@ -1415,51 +1409,63 @@ export default {
// return // return
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.voList) { if (this.form.id != null) {
var obj = JSON.parse(JSON.stringify(this.form)) this.form.departmentName = this.departmentName
obj.voList.forEach(e => { this.form.diseaseTypeName = this.diseaseTypeName
if (e.serviceFrequencyText.includes('~')) { if (this.form.voList) {
const str = e.serviceFrequencyText; var obj = JSON.parse(JSON.stringify(this.form))
const parts = str.split('~'); obj.voList.forEach(e => {
e.serviceFrequencyStart = parts[0]; if (e.serviceFrequencyText.includes('~')) {
e.serviceFrequencyEnd = parts[1]; const str = e.serviceFrequencyText;
e.serviceFrequencyText = null const parts = str.split('~');
} else { e.serviceFrequencyStart = parts[0];
e.serviceFrequencyText = e.serviceFrequencyText e.serviceFrequencyEnd = parts[1];
} e.serviceFrequencyText = null
} else {
if (this.form.id != null) { e.serviceFrequencyText = e.serviceFrequencyText
this.form.departmentName = this.departmentName }
this.form.diseaseTypeName = this.diseaseTypeName })
updateServicepackage(obj).then(response => { updateServicepackage(obj).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
}
} else {
if (this.diseaseTypeName == "请选择病种") {
this.form.diseaseTypeName == null
} else { } else {
this.form.diseaseTypeName = this.diseaseTypeName
if (this.diseaseTypeName == "请选择病种") {
this.form.diseaseTypeName == null
} else {
this.form.diseaseTypeName = this.diseaseTypeName
}
if (this.itemname) {
this.form.departmentName = this.departmentName
this.form.departmentId = this.itemname
} else {
this.form.departmentName = this.departmentName
}
addServicepackage(obj).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
this.Departmentlist()
});
} }
}) if (this.itemname) {
this.form.departmentName = this.departmentName
this.form.departmentId = this.itemname
} else {
this.form.departmentName = this.departmentName
}
if (this.form.voList) {
var obj = JSON.parse(JSON.stringify(this.form))
obj.voList.forEach(e => {
if (e.serviceFrequencyText.includes('~')) {
const str = e.serviceFrequencyText;
const parts = str.split('~');
e.serviceFrequencyStart = parts[0];
e.serviceFrequencyEnd = parts[1];
e.serviceFrequencyText = null
} else {
e.serviceFrequencyText = e.serviceFrequencyText
}
})
addServicepackage(obj).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
this.Departmentlist()
});
}
} }
} }
}); });