|
@@ -117,14 +117,13 @@ export default {
|
|
|
},
|
|
|
saveDisable: false, //保存按钮禁止点击
|
|
|
showDrop: false, //下拉框显示文字
|
|
|
- searchType: 2
|
|
|
+ searchType: 2 // 1:套餐 2: 细项
|
|
|
// queryText: ''
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
//修改
|
|
|
const { isEdit, data } = this.$route.params;
|
|
|
- console.log(data,'data');
|
|
|
if (isEdit) {
|
|
|
this.isEdit = isEdit;
|
|
|
this.editId = data.id;
|
|
@@ -133,6 +132,10 @@ export default {
|
|
|
this.form.hisDetailName = data.hisDetailName;
|
|
|
this.form.searchTextPre = data.uniqueName;
|
|
|
}
|
|
|
+ if (isEdit && data.hisName !== '' && data.hisDetailName === '') {
|
|
|
+ this.searchType = 1;
|
|
|
+ console.log('改变searchType为1');
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
// 搜索列表
|
|
@@ -172,7 +175,7 @@ export default {
|
|
|
handleclick() {},
|
|
|
|
|
|
handleChoose(val) {
|
|
|
- console.log('点击选中option', val);
|
|
|
+ // console.log('点击选中option', val);
|
|
|
this.form.searchTextPre = val;
|
|
|
this.form.searchText = val;
|
|
|
},
|
|
@@ -186,10 +189,28 @@ export default {
|
|
|
|
|
|
// 建立关联-参数处理
|
|
|
submitForm() {
|
|
|
- console.log(this.searchType,'searchType');
|
|
|
+ console.log(this.searchType, 'searchType');
|
|
|
+
|
|
|
this.$refs.relationForm.validate(valid => {
|
|
|
if (valid) {
|
|
|
const { searchText, hisName, hisDetailName } = this.form;
|
|
|
+ // 当标准术语是套餐时,细项必须为空
|
|
|
+ if (this.searchType === 1 && hisDetailName !== '') {
|
|
|
+ this.warning('医院术语与标准术语类型不匹配,请修改');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 当标准术语是细项时,医院术语套餐和细项均不能为空
|
|
|
+ if (this.searchType === 2) {
|
|
|
+ if (hisName === '') {
|
|
|
+ this.warning('医院术语与标准术语类型不匹配,请修改');
|
|
|
+ return;
|
|
|
+ } else if (hisDetailName === '') {
|
|
|
+ this.warning('医院术语与标准术语类型不匹配,请修改');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
let params = {
|
|
|
hisName: hisName,
|
|
|
uniqueName: searchText,
|