|
@@ -28,12 +28,12 @@
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="itemLabel clearfix">
|
|
<div class="itemLabel clearfix">
|
|
- <label class="itemLabelName">已选择化验大项:</label>
|
|
|
|
- <span>{{form.mealName}}</span>
|
|
|
|
|
|
+ <label class="itemLabelName isRequired">已选择化验大项:</label>
|
|
|
|
+ <span class="selectItemName">{{form.mealName}}</span>
|
|
</div>
|
|
</div>
|
|
<div class="itemLabel clearfix">
|
|
<div class="itemLabel clearfix">
|
|
<label class="itemLabelName">选择化验小项:</label>
|
|
<label class="itemLabelName">选择化验小项:</label>
|
|
- <input class="searchInput" type="text" v-model = "itemText">
|
|
|
|
|
|
+ <input class="searchInput" @focus="focuInput" type="text" v-model = "itemText">
|
|
<span class="searchName" @click="searchMealItem(2)">搜索</span>
|
|
<span class="searchName" @click="searchMealItem(2)">搜索</span>
|
|
<ul class="itemList itemNameList" ref="itemNameList">
|
|
<ul class="itemList itemNameList" ref="itemNameList">
|
|
<li
|
|
<li
|
|
@@ -48,7 +48,7 @@
|
|
</div>
|
|
</div>
|
|
<div class="itemLabel">
|
|
<div class="itemLabel">
|
|
<label class="itemLabelName">已选择化验小项:</label>
|
|
<label class="itemLabelName">已选择化验小项:</label>
|
|
- <span>{{form.itemName}}</span>
|
|
|
|
|
|
+ <span class="selectItemName">{{form.itemName}}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="midBox">
|
|
<div class="midBox">
|
|
@@ -57,26 +57,32 @@
|
|
<div class="rightBox">
|
|
<div class="rightBox">
|
|
<div class="itemLabel">
|
|
<div class="itemLabel">
|
|
<label class="itemLabelName">选择公表项:</label>
|
|
<label class="itemLabelName">选择公表项:</label>
|
|
- <input class="searchInput" type="text" v-model = "uniqueText">
|
|
|
|
- <span class="searchName" @click="searchMealItem">搜索</span>
|
|
|
|
|
|
+ <input class="searchInput" @focus="focuInput" type="text" v-model = "uniqueText">
|
|
|
|
+ <span class="searchName" @click="searchMealItem(3)">搜索</span>
|
|
<ul class="itemList uniqueNameList" ref="uniqueNameList">
|
|
<ul class="itemList uniqueNameList" ref="uniqueNameList">
|
|
<li
|
|
<li
|
|
v-for="item in uniqueNameList"
|
|
v-for="item in uniqueNameList"
|
|
class="mealNameItem ellipsis"
|
|
class="mealNameItem ellipsis"
|
|
- :title="item.tagName"
|
|
|
|
|
|
+ :title="item.conceptName"
|
|
@click="selectUniqueName(item)"
|
|
@click="selectUniqueName(item)"
|
|
- :key="item.id">
|
|
|
|
- {{item.tagName}}
|
|
|
|
|
|
+ :key="item.conceptName">
|
|
|
|
+ {{item.conceptName}}
|
|
</li>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="itemLabel">
|
|
<div class="itemLabel">
|
|
- <label class="itemLabelName">已选择公表项:</label>
|
|
|
|
- <span>{{form.uniqueName}}</span>
|
|
|
|
|
|
+ <label class="itemLabelName isRequired">已选择公表项:</label>
|
|
|
|
+ <span class="selectItemName">{{form.uniqueName}}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="sumbitBox"><span class="sumbit">建立关联</span></div>
|
|
|
|
|
|
+ <div class="sumbitBox">
|
|
|
|
+ <!-- <span class="sumbit" @click="submitForm">建立关联</span> -->
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="submitForm"
|
|
|
|
+ >建立关联</el-button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</template>
|
|
</template>
|
|
@@ -90,6 +96,7 @@ export default {
|
|
mealText: '', //化验大项搜索文字内容
|
|
mealText: '', //化验大项搜索文字内容
|
|
itemText: '', //化验小项搜索文字内容
|
|
itemText: '', //化验小项搜索文字内容
|
|
uniqueText: '', //公表项搜索文字内容
|
|
uniqueText: '', //公表项搜索文字内容
|
|
|
|
+ isEdit: false,
|
|
mealNameList:[],
|
|
mealNameList:[],
|
|
itemNameList: [],
|
|
itemNameList: [],
|
|
uniqueNameList:[],
|
|
uniqueNameList:[],
|
|
@@ -101,12 +108,27 @@ export default {
|
|
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ created() {
|
|
|
|
+ //修改(不需要)
|
|
|
|
+ // const { isEdit, data } = this.$route.params
|
|
|
|
+ // if(isEdit) {
|
|
|
|
+ // this.isEdit = isEdit;
|
|
|
|
+ // this.form.mealName = data.mealName
|
|
|
|
+ // this.form.itemName = data.itemName
|
|
|
|
+ // this.form.uniqueName = data.uniqueName
|
|
|
|
+ // }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
back() {
|
|
back() {
|
|
this.$router.go(-1)
|
|
this.$router.go(-1)
|
|
},
|
|
},
|
|
searchMealItem(type) {
|
|
searchMealItem(type) {
|
|
- this.getTagList(type)
|
|
|
|
|
|
+ if( type == '1' || type == '2') {
|
|
|
|
+ this.getTagList(type)
|
|
|
|
+ } else if ( type == '3') {
|
|
|
|
+ this.getAllLisConcept()
|
|
|
|
+ }
|
|
|
|
+
|
|
},
|
|
},
|
|
getTagList(type) {
|
|
getTagList(type) {
|
|
let param = {}
|
|
let param = {}
|
|
@@ -130,6 +152,17 @@ export default {
|
|
})
|
|
})
|
|
|
|
|
|
},
|
|
},
|
|
|
|
+ getAllLisConcept() {
|
|
|
|
+ const param = {
|
|
|
|
+ conceptName: this.uniqueText
|
|
|
|
+ }
|
|
|
|
+ api.getAllLisConcept(param).then((res) => {
|
|
|
|
+ if(res.data.code === '0') {
|
|
|
|
+ this.$refs['uniqueNameList'].style.display='block'
|
|
|
|
+ this.uniqueNameList = res.data.data
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
focuInput() {
|
|
focuInput() {
|
|
this.$refs['mealNameList'].style.display='none'
|
|
this.$refs['mealNameList'].style.display='none'
|
|
this.$refs['itemNameList'].style.display='none'
|
|
this.$refs['itemNameList'].style.display='none'
|
|
@@ -148,17 +181,88 @@ export default {
|
|
this.itemNameList = []
|
|
this.itemNameList = []
|
|
},
|
|
},
|
|
selectUniqueName(item) {
|
|
selectUniqueName(item) {
|
|
- this.form.uniqueName = item.tagName
|
|
|
|
|
|
+ this.form.uniqueName = item.conceptName
|
|
this.$refs['uniqueNameList'].style.display='none'
|
|
this.$refs['uniqueNameList'].style.display='none'
|
|
this.uniqueText = ''
|
|
this.uniqueText = ''
|
|
this.uniqueNameList = []
|
|
this.uniqueNameList = []
|
|
|
|
+ },
|
|
|
|
+ initForm() {
|
|
|
|
+ this.form.mealName = ''
|
|
|
|
+ this.form.itemName = ''
|
|
|
|
+ this.form.uniqueName = ''
|
|
|
|
+ },
|
|
|
|
+ submitForm() {
|
|
|
|
+ const { mealName, itemName, uniqueName } = this.form
|
|
|
|
+ if (!mealName || !uniqueName) {
|
|
|
|
+ this.warning('请填写相关数据')
|
|
|
|
+ return
|
|
}
|
|
}
|
|
|
|
+ //通过必填验证,提交保存
|
|
|
|
+ const param = {
|
|
|
|
+ "itemName": itemName,
|
|
|
|
+ "mealName": mealName,
|
|
|
|
+ "uniqueName": uniqueName
|
|
|
|
+ }
|
|
|
|
+ console.log(param);
|
|
|
|
+ this.showSaveDialog(param);
|
|
|
|
+ },
|
|
|
|
+ addLisMapping(param, msg, type) {
|
|
|
|
+ api.addLisMapping(param).then((res) => {
|
|
|
|
+ if (res.data.code === '0') {
|
|
|
|
+ this.warning(res.data.msg || msg, type);
|
|
|
|
+ // this.$router.push({name: 'ChemicalAndCommonMapping'});
|
|
|
|
+ this.initForm();
|
|
|
|
+ } else {
|
|
|
|
+ this.warning(res.data.msg)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ showSaveDialog(param) {
|
|
|
|
+ // 修改(不需要)
|
|
|
|
+ // if(this.isEdit) {
|
|
|
|
+ // this.addLisMapping(param)
|
|
|
|
+ // } else {
|
|
|
|
+ api.hasLisMapping(param).then((res) => {
|
|
|
|
+ if (!res.data.data) {
|
|
|
|
+ this.addLisMapping(param, '关联建立成功', 'success' )
|
|
|
|
+ } else {
|
|
|
|
+ this.showConfirmDialog('该关联已存在是否替换旧的关系信息', () => {
|
|
|
|
+ this.addLisMapping(param, '关联建立成功', 'success' )
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }).catch((err) => {
|
|
|
|
+ this.warning(err);
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ // }
|
|
|
|
+ },
|
|
|
|
+ showConfirmDialog(msg, resolve) {
|
|
|
|
+ this.$confirm(msg, '提示', {
|
|
|
|
+ customClass: 'confirmRealation',
|
|
|
|
+ confirmButtonText: '是',
|
|
|
|
+ cancelButtonText: '否',
|
|
|
|
+ cancelButtonClass: 'cancelButton',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ resolve();
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ this.warning('建立失败','error')
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ warning(msg, type) {
|
|
|
|
+ this.$message({
|
|
|
|
+ showClose: true,
|
|
|
|
+ message: msg,
|
|
|
|
+ type: type || 'warning'
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
<style lang="less">
|
|
<style lang="less">
|
|
.AddChemicalAndCommonMappingWrapper {
|
|
.AddChemicalAndCommonMappingWrapper {
|
|
|
|
+ min-width: 980px;
|
|
background: #fff;
|
|
background: #fff;
|
|
.groupTitle {
|
|
.groupTitle {
|
|
width: calc(100% - 50px);
|
|
width: calc(100% - 50px);
|
|
@@ -203,6 +307,10 @@ export default {
|
|
.itemLabelName {
|
|
.itemLabelName {
|
|
width: 150px;
|
|
width: 150px;
|
|
}
|
|
}
|
|
|
|
+ .isRequired::before {
|
|
|
|
+ content: '*';
|
|
|
|
+ color: red;
|
|
|
|
+ }
|
|
.searchInput, .mealNameItem {
|
|
.searchInput, .mealNameItem {
|
|
padding: 0 5px;
|
|
padding: 0 5px;
|
|
}
|
|
}
|
|
@@ -237,10 +345,20 @@ export default {
|
|
.mealNameItem:hover {
|
|
.mealNameItem:hover {
|
|
border: 1px solid #22ccc8;
|
|
border: 1px solid #22ccc8;
|
|
}
|
|
}
|
|
|
|
+ .selectItemName {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ width: calc(100% - 160px);
|
|
|
|
+ }
|
|
.sumbitBox {
|
|
.sumbitBox {
|
|
- position: relative;
|
|
|
|
- width: 100%;
|
|
|
|
- height: 80px;
|
|
|
|
|
|
+ position: relative;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ margin: 0px 20px;
|
|
|
|
+ padding: 20px;
|
|
|
|
+ .el-button {
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 80px;
|
|
|
|
+ top: -20px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.sumbit {
|
|
.sumbit {
|
|
position: absolute;
|
|
position: absolute;
|
|
@@ -250,7 +368,29 @@ export default {
|
|
line-height: 30px;
|
|
line-height: 30px;
|
|
border: 1px solid #000;
|
|
border: 1px solid #000;
|
|
text-align: center;
|
|
text-align: center;
|
|
- right: 30px;
|
|
|
|
|
|
+ right: 100px;
|
|
}
|
|
}
|
|
|
|
+ .confirmRealation {
|
|
|
|
+ .cancelButton{
|
|
|
|
+ span {
|
|
|
|
+ border: 1px solid #000;
|
|
|
|
+ color: #000 !important;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ .el-message-box__btns .el-button--default {
|
|
|
|
+ color: #000;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.confirmRealation {
|
|
|
|
+ .cancelButton{
|
|
|
|
+ border-color: #000;
|
|
|
|
+ color: #000 !important;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|