123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293 |
- <template>
- <div class="NoiseTemplateWrapper TemplateWrapper">
- <div class="groupTitle"><i
- class="el-icon-back"
- @click="back"
- ></i> {{txt}}</div>
- <PubTagGroup
- :editData="editData"
- @changeVal="changeVal"
- @changeSex="changeSex"
- @changeType="changeType"
- @validatePass="validatePass"
- ref="submitForm"
- ></PubTagGroup>
- <div class="main">
- <p v-if="dataPub.region1 != 6 && dataPub.region1 != 7 && dataPub.region1 != 8 && dataPub.region1 != 9" class="title"> <i>*</i> 标签明细:</p>
- <PubTagPartDetail
- :pool="dataPub.tagPool"
- :type="dataPub.region1"
- :sign="dataPub.region2"
- :order="dataPub.order"
- :sexType="dataPub.region7"
- :tipLis="dataPub.tipLis"
- :choose="dataPub.region2 == 6?'multiple':'single'"
- :options="editData.questionMapping"
- v-if="dataPub.region2 == 2 || dataPub.region2 == 6"
- @changeActionData="changeActionData"
- ></PubTagPartDetail>
- <SymptomTagGroup
- v-if="dataPub.region2 == 4"
- :pool="dataPub.tagPool"
- :type="dataPub.region1"
- :sexType="dataPub.region7"
- :options="editData.questionMapping"
- @changeActionData="changeActionData"
- >
- </SymptomTagGroup>
- <InspactTagGroup
- v-if="dataPub.region2 == 7"
- :pool="dataPub.tagPool"
- :type="dataPub.region1"
- :sexType="dataPub.region7"
- :options="editData.questionMapping"
- @changeActionData="changeActionData"
- >
- </InspactTagGroup>
- <BloodPressTagGroup
- v-if="dataPub.region2 == 3"
- :pool="dataPub.tagPool"
- :type="dataPub.region1"
- :sexType="dataPub.region7"
- :options="editData.questionMapping"
- @changeActionData="changeActionData"
- >
- </BloodPressTagGroup>
- <SymptomPush
- v-if="dataPub.region2 == 11"
- :pool="dataPub.tagPool"
- :type="dataPub.region1"
- :sexType="dataPub.region7"
- :options="editData.questionMapping"
- :tipLis="dataPub.tipLis"
- @changeActionData="changeActionData"
- >
- </SymptomPush>
- <el-form
- v-if="dataPub.region2 == 2"
- class="order"
- :rules="rules"
- :model="form"
- label-width="150px"
- >
- <el-form-item
- label="选择标签成文顺序:"
- prop="currentOrder"
- >
- <el-select
- v-model="form.currentOrder"
- placeholder="选择标签成文顺序"
- >
- <el-option
- v-for="item in dataPub.order"
- :label="item.name"
- :value="item.val"
- :key="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <div class="btn">
- <el-button
- type="primary"
- @click="submitForm"
- >确 定</el-button>
- </div>
- </div>
- </div>
- </template>
- <script>
- /**
- * dataPub.region2 判断底部显示哪些
- */
- import PubTagGroup from './PubTagGroup';
- import PubTagPartDetail from './PubTagPartDetail';
- import SymptomTagGroup from './SymptomTagGroup';
- import InspactTagGroup from './InspactTagGroup';
- import BloodPressTagGroup from './BloodPressTagGroup';
- import SymptomPush from './SymptomPush';
- import api from '@api/icss.js';
- import utils from '@api/utils.js';
- export default {
- name: 'NoiseTemplateWrapper',
- data() {
- return {
- txt:'标签组维护--添加标签组',
- dataPub: {}, //公用组件传的值都在这
- editData:{}, //编辑数据
- form: {
- currentOrder: '0', //标签成文顺序
- },
- rules: {
- currentOrder: [
- { required: true, message: '选择标签成文顺序', trigger: 'change' }
- ]
- },
- sendIds: [[], [], [], [], [], []], //标签明细右侧操作数据
- }
- },
- beforeMount:function(){
- const {isEdit,data} = this.$route.params;
- if(isEdit){
- this.txt = '标签组维护--修改标签组';
- this.editData = data;
- // console.log('回读数据', this.editData)
- }
- },
- computed: {
- newSign() {
- return this.dataPub.region2;
- },
- },
- watch: {
- newSign(nextVal, prevVal) {
- if (nextVal != prevVal) {
- this.form.currentOrder = '0'
- }
- },
- },
- methods: {
- back() { this.$router.go(-1) },
- changeVal(val) { //子组件数据改变传递到父组件
- this.dataPub = val
- // console.log('公用组件传的值都在这', val)
- },
- changeSex(sex) { //性别改变,清空标签明细
- // console.log(sex)
- },
- changeType(type) { //填写单类型改变,标签明细左侧更新,右侧清空
- // console.log(type)
- },
- changeActionData(arr) { //标签明细右侧数据id
- console.log(44254165456)
- this.sendIds = arr
- },
- submitForm() { // 调用子组件的方法验证公用部分
- this.$refs.submitForm.submitForm('groups');
- },
- validatePass() { //验证成功回调,调取接口
- //仍需验证标签明细是否选择
- let type = this.dataPub.region1;
- if (JSON.stringify(this.sendIds) == '[[],[],[],[],[],[]]' && type != 6 && type != 7 && type != 8 && type != 9) {
- this.$message({
- message: '请选择标签明细',
- type: 'warning'
- });
- return;
- }
- if(this.dataPub.region8 > this.dataPub.region9) {
- this.$message({
- message: '最小年龄不能大于最大年龄',
- type: 'warning'
- });
- return;
- }
- let detailLis = utils.dataRecombination(this.sendIds, this.dataPub.region2)
- let param = {
- "questionWrapper": {
- "controlType": 0, //控件类型(0:默认值 1:下拉单选 2:下拉多选 6:文本框 7:数字键盘文本框 99:联合推送)
- "id": this.editData.id || '', //新增id空
- "type": this.dataPub.region1, //标签归属
- // "itemType":0, //0:是症状,1:不是症状
- "tagType": this.dataPub.region2, //标签类型
- "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.region10, //是否复制
- "showAdd": this.dataPub.region11, //是否显示加号血压
- "showInfo": 0,
- "questionDetails": [],
- "questionMappings": detailLis //映射关系,
- }
- }
- this.showDelDialog(param)
- },
- showDelDialog(param) {
- this.showConfirmDialog('是否保存该标签组?', () => {
- api.saveOrUpdate(param).then((res) => {
- if (res.data.code === '0') {
- this.warning(res.data.msg || '保存成功', 'success','1000')
- setTimeout(() => {
- this.$router.push({
- path:'/admin/LT-YXSJWH-BQZWH'
- })
- }, 1000);
- } else {
- this.warning(res.data.msg)
- }
- }).catch((err) => {
- this.warning(err);
- })
- });
- },
- showConfirmDialog(msg, resolve) {
- this.$alert(msg, '提示', {
- confirmButtonText: '确定',
- type: 'warning'
- }).then(() => {
- resolve();
- }).catch(() => {});
- },
- warning(msg, type,time) {
- this.$message({
- showClose: true,
- message: msg,
- type: type || 'warning',
- duration:time || '3000'
- })
- },
- },
- components: {
- PubTagGroup,
- PubTagPartDetail,
- SymptomTagGroup,
- BloodPressTagGroup,
- SymptomPush,
- InspactTagGroup,
- }
- }
- </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;
- }
- }
- }
- .btn {
- text-align: right;
- margin-top: 10px;
- }
- .order {
- margin-bottom: 20px;
- .el-input__inner {
- line-height: 30px;
- height: 30px;
- }
- }
- }
- </style>
|