Commit 86de414a authored by yanglilong's avatar yanglilong

'增加搜搜'

parent 27c96e5a
...@@ -61,9 +61,10 @@ ...@@ -61,9 +61,10 @@
allow-clear allow-clear
@filterOption="filterCode" @filterOption="filterCode"
@change="corpChange" @change="corpChange"
@search="corpSearch"
> >
<a-select-option <a-select-option
v-for="item in corpCode" v-for="item in comCorpCode"
:key="item.id" :key="item.id"
:value="item.id + '$_' + item.longName" :value="item.id + '$_' + item.longName"
> >
...@@ -119,10 +120,11 @@ ...@@ -119,10 +120,11 @@
show-search show-search
allow-clear allow-clear
@filterOption="filterCode" @filterOption="filterCode"
@search="codeSearch"
> >
<a-select-option <a-select-option
v-for="item in planCode" v-for="item in comPlanCode"
:key="item.id" :key="item.id + '_' + item.longName"
:vlaue="item.longName" :vlaue="item.longName"
> >
{{ item.longName }} {{ item.longName }}
...@@ -151,16 +153,6 @@ ...@@ -151,16 +153,6 @@
</a-radio-group> </a-radio-group>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xl="4" :lg="6" :sm="12">
<a-form-model-item label="等待期时间" prop="waitingPeriodTime">
<a-date-picker
allow-clear
v-model="form.waitingPeriodTime"
placeholder="请选择等待期时间"
value-format="YYYY-MM-DD 00:00:00"
></a-date-picker>
</a-form-model-item>
</a-col>
<a-col :xl="4" :lg="6" :sm="12"> <a-col :xl="4" :lg="6" :sm="12">
<a-form-model-item label="是否承担既往症" prop="isUndertakeAnamnesis"> <a-form-model-item label="是否承担既往症" prop="isUndertakeAnamnesis">
<a-radio-group <a-radio-group
...@@ -173,6 +165,8 @@ ...@@ -173,6 +165,8 @@
</a-radio-group> </a-radio-group>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row>
<a-row>
<a-col :xl="9" :sm="12"> <a-col :xl="9" :sm="12">
<a-form-model-item label="保卡复印件" prop="medCardCopeFiles"> <a-form-model-item label="保卡复印件" prop="medCardCopeFiles">
<div class="upload-print"> <div class="upload-print">
...@@ -214,6 +208,8 @@ ...@@ -214,6 +208,8 @@
</div> </div>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row>
<a-row>
<a-col :xl="24" :lg="18" :sm="12" class="none-label clearfix"> <a-col :xl="24" :lg="18" :sm="12" class="none-label clearfix">
<a-form-model-item label="button"> <a-form-model-item label="button">
<a-button type="primary"> <a-button type="primary">
...@@ -257,7 +253,9 @@ export default { ...@@ -257,7 +253,9 @@ export default {
previewImage: "", previewImage: "",
companyCode: [], companyCode: [],
corpCode: [], corpCode: [],
comCorpCode: [],
planCode: [], planCode: [],
comPlanCode: [],
formRules: {}, formRules: {},
}; };
}, },
...@@ -299,16 +297,56 @@ export default { ...@@ -299,16 +297,56 @@ export default {
} }
this._getCorporateCode(val); this._getCorporateCode(val);
}, },
corpSearch(val) {
if (!val) {
this.comCorpCode = this.corpCode;
return;
}
let noOne = this.corpCode.every((item) => {
return item.longName.indexOf(val) == -1;
});
if (noOne) {
this.comCorpCode = [
...this.corpCode,
{
longName: val,
id: "",
},
];
}
},
codeSearch(val) {
if (!val) {
this.comPlanCode = this.planCode;
return;
}
let noOne = this.planCode.every((item) => {
return item.longName.indexOf(val) == -1;
});
if (noOne) {
this.comPlanCode = [
...this.planCode,
{
longName: val,
id: "",
},
];
}
},
corpChange(val) { corpChange(val) {
// 因为接口要name 但是查计划要用id // 因为接口要name 但是查计划要用id
this.form.planName = undefined; this.form.planName = undefined;
if (!val) { if (!val) {
return false; return false;
} }
console.log(val);
this.form.corpName = val.split("$_")[1]; this.form.corpName = val.split("$_")[1];
val = val.split("$_")[0]; val = val.split("$_")[0];
if (val) {
this._getPlanCode(val); this._getPlanCode(val);
} else {
this.planCode = [];
this.comPlanCode = [];
}
}, },
uploadMedImg(file) { uploadMedImg(file) {
console.log(file); console.log(file);
...@@ -393,6 +431,7 @@ export default { ...@@ -393,6 +431,7 @@ export default {
}) })
.then((res) => { .then((res) => {
this.corpCode = res.content || []; this.corpCode = res.content || [];
this.comCorpCode = res.content || [];
}); });
}, },
_getPlanCode(val) { _getPlanCode(val) {
...@@ -403,6 +442,7 @@ export default { ...@@ -403,6 +442,7 @@ export default {
}) })
.then((res) => { .then((res) => {
this.planCode = res.content || []; this.planCode = res.content || [];
this.comPlanCode = res.content || [];
}); });
}, },
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment