|
@@ -1,182 +1,208 @@
|
|
|
<template>
|
|
|
- <div class="NoiseTemplateWrapper TemplateWrapper">
|
|
|
- <crumbs
|
|
|
- :title="txt"
|
|
|
- class="topBack"
|
|
|
- linkTo="/admin/LT-YWZSJWH-DLTXDWH"
|
|
|
- ></crumbs>
|
|
|
- <PubIndeptQa
|
|
|
- @changeVal="changeVal"
|
|
|
- @changeSex="changeSex"
|
|
|
- @changeType="changeType"
|
|
|
- @validatePass="validatePass"
|
|
|
- :editData="editData"
|
|
|
- ref="submitForm"
|
|
|
- ></PubIndeptQa>
|
|
|
- <div class="main">
|
|
|
- <p class="title" v-if="dataPub.region2==1||dataPub.region2==2|| dataPub.region2==11">
|
|
|
- <i>*</i> 填写单明细:
|
|
|
- <i v-if='dataPub.region2==2' style="margin-left:70px;color: #22ccc8; font-size: 12px;">所有选项必须都有或者都没有同“伴”/“无”标记</i>
|
|
|
- </p>
|
|
|
- <PubSelect v-if="dataPub.region2==1 || dataPub.region2==2 || dataPub.region2==11" :ascription="dataPub.region1" :sexType="dataPub.region7" :type="dataPub.region2" @pushValues="pushValues" :options="editData.questionDetailList"></PubSelect>
|
|
|
- <div class="btn">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="submitForm"
|
|
|
- >确 定</el-button>
|
|
|
- </div>
|
|
|
+ <div>
|
|
|
+ <crumbs title="独立填写单维护">
|
|
|
+ <el-form :inline="true" class="demo-form-inline">
|
|
|
+ <el-form-item label="归属:">
|
|
|
+ <el-select size="mini" v-model="filter.tagAdscription" @change="getValue" placeholder="归属" clearable>
|
|
|
+ <el-option v-if="item.val!=6&&item.val!=7&&item.val!=8&&item.val!=9&&item.val!=10&&item.val!=21&&item.val!=22" v-for="item in Adscriptions" :label="item.name" :value="item.val" :key="item.id" ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="类型:">
|
|
|
+ <el-select size="mini" v-model="filter.controlType[0]" placeholder="类型" clearable>
|
|
|
+ <el-option v-for="item in tagTypes" :label="item.name" :value="item.val" :key="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="填写单系统名称:">
|
|
|
+ <el-input size="mini" v-model="filter.tagSysName" placeholder="填写单系统名称" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button size="mini" @click="filterDatas">确认</el-button>
|
|
|
+ <el-button size="mini" type="warning" @click="addIndeptTag">添加独立填写单</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </crumbs>
|
|
|
+ <div class="contents">
|
|
|
+ <el-table
|
|
|
+ :data="list"
|
|
|
+ border
|
|
|
+ style="width: 100%">
|
|
|
+ <el-table-column
|
|
|
+ :resizable = "false"
|
|
|
+ type="index"
|
|
|
+ :index = 'indexMethod'
|
|
|
+ label="编号"
|
|
|
+ width="60">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ :resizable = "false"
|
|
|
+ prop="gmtModified"
|
|
|
+ label="操作时间"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ :resizable = "false"
|
|
|
+ prop="tagName"
|
|
|
+ label="填写单系统名称">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ :resizable = "false"
|
|
|
+ prop="typeCn"
|
|
|
+ label="归属"
|
|
|
+ width="80">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ :resizable = "false"
|
|
|
+ prop="tagTypeCn"
|
|
|
+ label="类型">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ :resizable = "false"
|
|
|
+ prop="modifier"
|
|
|
+ label="操作人"
|
|
|
+ width="120">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ :resizable = "false"
|
|
|
+ prop="operate"
|
|
|
+ label="操作"
|
|
|
+ width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button @click="modifyIndeptTag(scope.row)" type="text" size="small">修改</el-button>
|
|
|
+ <span style="margin:0 3px;">|</span>
|
|
|
+ <el-button @click="showDelDialog(scope.row)" class="delete" type="text" size="small">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-pagination v-if="total>pageSize"
|
|
|
+ :current-page.sync="currentPage"
|
|
|
+ @current-change="currentChange"
|
|
|
+ background
|
|
|
+ :page-size="pageSize"
|
|
|
+ layout="total,prev, pager, next, jumper"
|
|
|
+ :total="total">
|
|
|
+ </el-pagination>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
<script>
|
|
|
- /**
|
|
|
- * dataPub.region2 判断底部显示哪些
|
|
|
- */
|
|
|
- import PubIndeptQa from './PubIndeptQa';
|
|
|
- import PubSelect from './PubSelect';
|
|
|
- import api from '@api/icss.js';
|
|
|
- import utils from '@api/utils.js';
|
|
|
+ import api from '@api/preTreat.js';
|
|
|
|
|
|
export default {
|
|
|
- name: 'addSimpleQuestion',
|
|
|
- data() {
|
|
|
+ name: 'simpleQuestion',
|
|
|
+ data: function() {
|
|
|
return {
|
|
|
- txt:'独立填写单维护-添加独立填写单',
|
|
|
- dataPub: {}, //公用组件传的值都在这
|
|
|
- itemsTypes:[1,2], //有明细的类型
|
|
|
- editData:{}, //编辑数据
|
|
|
- form: {
|
|
|
- currentOrder: '0', //标签成文顺序
|
|
|
- },
|
|
|
- rules: {
|
|
|
- currentOrder: [
|
|
|
- { required: true, message: '选择标签成文顺序', trigger: 'change' }
|
|
|
- ]
|
|
|
+ list: [],
|
|
|
+ tagTypes: [],
|
|
|
+ Adscriptions: [],
|
|
|
+ tagTypesList:[],
|
|
|
+ filter: {
|
|
|
+ tagType: [], //标签类型
|
|
|
+ controlType: [],
|
|
|
+ tagAdscription: '', //标签归属
|
|
|
+ tagSysName: '', //标签系统名称
|
|
|
},
|
|
|
- options: [], //标签明细右侧操作数据
|
|
|
- }
|
|
|
- },
|
|
|
- beforeMount:function(){
|
|
|
- const {isEdit,data} = this.$route.params;
|
|
|
- if(isEdit){
|
|
|
- this.txt = '独立填写单维护-修改独立填写单'
|
|
|
- this.editData = data;
|
|
|
+ currentPage: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ total: 0,
|
|
|
}
|
|
|
},
|
|
|
- computed: {
|
|
|
- newSign() {
|
|
|
- return this.dataPub.region2;
|
|
|
- },
|
|
|
- },
|
|
|
- watch: {
|
|
|
- newSign(nextVal, prevVal) {
|
|
|
- if (nextVal != prevVal) {
|
|
|
- this.form.currentOrder = '0'
|
|
|
- }
|
|
|
- },
|
|
|
+ created() {
|
|
|
+ this.getDropList();
|
|
|
},
|
|
|
methods: {
|
|
|
- back() { this.$router.go(-1) },
|
|
|
- changeVal(val) { //子组件数据改变传递到父组件
|
|
|
- this.dataPub = val
|
|
|
- console.log('公用组件传的值都在这', val)
|
|
|
+ getValue(val) {
|
|
|
+ console.log('changeVal', val, this.filter.tagAdscription)
|
|
|
},
|
|
|
- changeSex(sex) { //性别改变,清空填写单明细
|
|
|
- //console.log(sex)
|
|
|
+ getDropList() {
|
|
|
+ api.getPreTypeList().then((res) =>{
|
|
|
+ this.getDataList();
|
|
|
+ if(res.data.code === '0') {
|
|
|
+ this.Adscriptions = res.data.data[1];
|
|
|
+ this.tagTypes = res.data.data[2];
|
|
|
+ this.tagTypes = this.tagTypes.filter(item => item.val != 0) //去掉名称为默认值的填写单类型
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
},
|
|
|
- changeType(type) { //填写单类型改变,标签明细左侧更新,右侧清空
|
|
|
- // console.log('type',type)
|
|
|
- this.options = [];
|
|
|
+ getDataList() {
|
|
|
+ const param = this.getFilterItems();
|
|
|
+ api.getQuestionList(param).then((res) => {
|
|
|
+ const list = [...res.data.data.records];
|
|
|
+ for (var i = 0; i < list.length; i++) {
|
|
|
+ for (var j = 0; j < this.tagTypes.length; j++) {
|
|
|
+ if(list[i].controlType == this.tagTypes[j].val) {
|
|
|
+ list[i].tagTypeCn = this.tagTypes[j].name;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //后台数据typeCn转换为筛选中对应的字段名称
|
|
|
+ for (var z = 0; z < this.Adscriptions.length; z++) {
|
|
|
+ if(list[i].type == this.Adscriptions[z].val) {
|
|
|
+ list[i].typeCn = this.Adscriptions[z].name;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.list = list;
|
|
|
+ this.total = res.data.data.total;
|
|
|
+ })
|
|
|
},
|
|
|
- pushValues(its){
|
|
|
- this.options = its;
|
|
|
+ filterDatas() {
|
|
|
+ this.currentPage = 1;
|
|
|
+ this.getDataList();
|
|
|
},
|
|
|
- submitForm() { // 调用子组件的方法验证公用部分
|
|
|
- this.$refs.submitForm.submitForm('groups');
|
|
|
+ addIndeptTag() {
|
|
|
+ this.$router.push({path:'LT-YWZSJWH-TJDLTXD'})
|
|
|
},
|
|
|
- validatePass() { //验证成功回调,调取接口
|
|
|
- //仍需验证填写单明细是否选择
|
|
|
- let isNull = true
|
|
|
- let options2 = []
|
|
|
- const opts = this.options;
|
|
|
- for (let i = 0; i < this.options.length; i++) {
|
|
|
- if(this.options[i].name.trim() != '') {
|
|
|
- isNull = false
|
|
|
- options2.push(this.options[i])
|
|
|
- }
|
|
|
- }
|
|
|
- this.options = options2;
|
|
|
- if(this.itemsTypes.includes(+this.dataPub.region2)&&isNull) {
|
|
|
- this.warning('至少填一个选项')
|
|
|
- return;
|
|
|
- }
|
|
|
- let flag=true;
|
|
|
- if(opts[0] && opts[0].code){
|
|
|
- flag=opts.findIndex((it)=>{
|
|
|
- return !it.code;
|
|
|
- })==-1;
|
|
|
- }else{
|
|
|
- flag=opts.findIndex((it)=>{
|
|
|
- return it.code;
|
|
|
- })==-1;
|
|
|
- }
|
|
|
- if(!flag){
|
|
|
- this.warning('所有选项必须都有或者都没有同“伴”/“无”标记')
|
|
|
- return;
|
|
|
- }
|
|
|
- if(parseFloat(this.dataPub.region8) >= parseFloat(this.dataPub.region9)) {
|
|
|
- this.warning('最小年龄不能大于或等于最大年龄')
|
|
|
- return;
|
|
|
- }
|
|
|
- if(parseFloat(this.dataPub.minNormalVal) >= parseFloat(this.dataPub.maxNormalVal)) {
|
|
|
- this.warning('最小正常值不能大于或等于最大正常值')
|
|
|
- return;
|
|
|
- }
|
|
|
- const {isEdit,data} = this.$route.params;
|
|
|
- let param = {
|
|
|
- "questionWrapper": {
|
|
|
- "controlType": this.dataPub.region2, //控件类型(0:默认值 1:下拉单选 2:下拉多选 6:文本框 7:数字键盘文本框 99:联合推送)
|
|
|
- "id": isEdit?data.id:'', //新增id置空
|
|
|
- "type": this.dataPub.region1, //填写单归属
|
|
|
- "tagType": 1, //填写单类型
|
|
|
- "tagName": this.dataPub.region3, //系统名称
|
|
|
- "name": this.dataPub.region4, //界面名称
|
|
|
- "joint": this.dataPub.region5, //标签间的连接符
|
|
|
- // "subType": this.dataPub.region6, //0:可以,1:不可以(当项目检索) //这个字段暂时不用
|
|
|
- "sexType": this.dataPub.region7, //1:男,2:女,3:通用
|
|
|
- "ageBegin": this.dataPub.region8, //最小年龄
|
|
|
- "ageEnd": this.dataPub.region9, //最大年龄
|
|
|
- "textGenerate": this.form.currentOrder, //成文顺序 默认0
|
|
|
- "copyType": this.dataPub.region2 == 6 ? this.dataPub.region10 : (this.dataPub.region2 == 3 ? this.dataPub.region11 : ''), //是否复制
|
|
|
- "showAdd": 0, //是否显示加号血压
|
|
|
- "itemType" :this.dataPub.region12,
|
|
|
- "showInfo": 0,
|
|
|
- "labelPrefix":this.dataPub.prefix, //前缀
|
|
|
- "labelSuffix":this.dataPub.suffix, //后缀
|
|
|
- "minValue": this.dataPub.minNormalVal, //化验最小正常值
|
|
|
- "maxValue": this.dataPub.maxNormalVal, //化验最大正常值
|
|
|
- "questionDetails": this.options,
|
|
|
- "questionMappings": [], //映射关系,
|
|
|
- "formulaCode": isEdit?data.formulaCode : ''
|
|
|
+ modifyIndeptTag(row) {
|
|
|
+ api.detailsTag({id:row.id}).then((res)=>{
|
|
|
+ const {code,data,msg} = res.data;
|
|
|
+ if(code=='0'){
|
|
|
+ const item = Object.assign({},row,data);
|
|
|
+ this.$router.push({name:'addSimpleQuestion',params:{isEdit:true,data:item}});
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: msg,
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
}
|
|
|
+ });
|
|
|
+ //this.$router.push({name:'AddIndeptLabel',params:{isEdit:true,data:row}});
|
|
|
+ },
|
|
|
+ currentChange(next) {
|
|
|
+ this.currentPage = next;
|
|
|
+ this.getDataList();
|
|
|
+ // if (this.cacheData[next]) { //如果已请求过该页数据,则使用缓存不重复请求
|
|
|
+ // this.list = this.cacheData[next];
|
|
|
+ // } else {
|
|
|
+ // this.getDataList();
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ getFilterItems() {
|
|
|
+ const param = {
|
|
|
+ tagTypeList: [1],
|
|
|
+ current: this.currentPage,
|
|
|
+ size: this.pageSize,
|
|
|
+ type: this.filter.tagAdscription,
|
|
|
+ tagName: this.filter.tagSysName,
|
|
|
+ controlTypeList: this.filter.controlType[0] ? this.filter.controlType: []
|
|
|
};
|
|
|
- this.showSaveDialog(param);
|
|
|
+ return param;
|
|
|
},
|
|
|
- showSaveDialog(param) {
|
|
|
- this.showConfirmDialog('是否保存该填写单?', () => {
|
|
|
- api.saveOrUpdate(param).then((res) => {
|
|
|
- if (res.data.code === '0') {
|
|
|
- this.warning(res.data.msg || '保存成功', 'success');
|
|
|
- this.$router.push("/admin/LT-YXSJWH-DLLXBQWH");
|
|
|
- } else {
|
|
|
- this.warning(res.data.msg)
|
|
|
- }
|
|
|
- }).catch((err) => {
|
|
|
- this.warning(err);
|
|
|
- })
|
|
|
- });
|
|
|
+ indexMethod(index) {
|
|
|
+ return ((this.currentPage - 1) * this.pageSize) + index + 1;
|
|
|
+ },
|
|
|
+ getTagType(val) {
|
|
|
+ return val
|
|
|
},
|
|
|
- showConfirmDialog(msg, resolve) {
|
|
|
+ warning(msg,type){
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message:msg,
|
|
|
+ type:type||'warning'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showConfirmDialog(msg,resolve){
|
|
|
this.$alert(msg, '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
type: 'warning'
|
|
@@ -184,58 +210,41 @@
|
|
|
resolve();
|
|
|
}).catch(() => {});
|
|
|
},
|
|
|
- warning(msg, type) {
|
|
|
- this.$message({
|
|
|
- showClose: true,
|
|
|
- message: msg,
|
|
|
- type: type || 'warning'
|
|
|
- })
|
|
|
- },
|
|
|
- },
|
|
|
- components: {
|
|
|
- PubIndeptQa,
|
|
|
- PubSelect
|
|
|
+ showDelDialog(row){
|
|
|
+ const param = {
|
|
|
+ "ids": row.id,
|
|
|
+ "type": row.type
|
|
|
+ };
|
|
|
+ this.showConfirmDialog('是否删除该填写单?',()=>{
|
|
|
+ api.questionDel(param).then((res)=>{
|
|
|
+ if(res.data.code=='0'){
|
|
|
+ this.getDataList();
|
|
|
+ this.warning(res.data.msg || '操作成功','success');
|
|
|
+ }else{
|
|
|
+ this.warning(res.data.msg);
|
|
|
+ }
|
|
|
+ }).catch((error)=>{
|
|
|
+ this.warning(error);
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
+
|
|
|
+
|
|
|
<style lang="less">
|
|
|
- @import "../../less/common.less";
|
|
|
- .NoiseTemplateWrapper {
|
|
|
- .groupTitle {
|
|
|
- background-color: #fff;
|
|
|
- height: 40px;
|
|
|
- line-height: 40px;
|
|
|
- padding-left: 20px;
|
|
|
- }
|
|
|
- .main {
|
|
|
- background-color: #fff;
|
|
|
- margin: 0 20px 20px;
|
|
|
- padding: 20px;
|
|
|
- border-top: 1px solid @icssBorder;
|
|
|
- box-sizing: border-box;
|
|
|
- font-size: 14px;
|
|
|
- color: #606266;
|
|
|
- .title {
|
|
|
- margin-bottom: 20px;
|
|
|
- i {
|
|
|
- color: #f56c6c;
|
|
|
+ @import "../../less/admin.less";
|
|
|
+ .delete{
|
|
|
+ color: red
|
|
|
}
|
|
|
+ .delete:hover {
|
|
|
+ color: red;
|
|
|
}
|
|
|
+ .el-select .el-input .el-icon-arrow-up{
|
|
|
+ display: inline-block!important;
|
|
|
}
|
|
|
- .btn {
|
|
|
- text-align: right;
|
|
|
+ .el-select .el-input .el-icon-circle-close{
|
|
|
+ float:left;
|
|
|
}
|
|
|
- .order {
|
|
|
- margin-bottom: 20px;
|
|
|
- .el-input__inner {
|
|
|
- line-height: 30px;
|
|
|
- height: 30px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .toast-cancel{
|
|
|
- color: #22ccc8 !important;
|
|
|
- // background: #22ccc8;
|
|
|
- }
|
|
|
-</style>
|
|
|
-
|
|
|
+</style>
|