NoiseTemplate.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <div class="NoiseTemplateWrapper TemplateWrapper">
  3. <div class="groupTitle"><i
  4. class="el-icon-back"
  5. @click="back"
  6. ></i> 标签组维护--添加标签组</div>
  7. <PubTagGroup
  8. @changeVal="changeVal"
  9. @changeSex="changeSex"
  10. @changeType="changeType"
  11. @validatePass="validatePass"
  12. ref="submitForm"
  13. ></PubTagGroup>
  14. <div class="main">
  15. <p class="title"> <i>*</i> 标签明细:</p>
  16. <PubTagPartDetail
  17. :pool="dataPub.tagPool"
  18. :type="dataPub.region1"
  19. :sign="dataPub.region2"
  20. :order="dataPub.order"
  21. :tipLis="dataPub.tipLis"
  22. :choose="dataPub.region2 == 6?'multiple':'single'"
  23. v-show="dataPub.region2 == 2 || dataPub.region2 == 6"
  24. @changeActionData="changeActionData"
  25. ></PubTagPartDetail>
  26. <SymptomTagGroup
  27. v-if="dataPub.region2 == 4"
  28. :pool="dataPub.tagPool"
  29. :type="dataPub.region1">
  30. </SymptomTagGroup>
  31. <el-form
  32. v-if="dataPub.region2 == 2"
  33. class="order"
  34. :rules="rules"
  35. :model="form"
  36. label-width="150px"
  37. >
  38. <el-form-item
  39. label="选择标签成文顺序:"
  40. prop="currentOrder"
  41. >
  42. <el-select
  43. v-model="form.currentOrder"
  44. placeholder="选择标签成文顺序"
  45. >
  46. <el-option
  47. v-for="item in dataPub.order"
  48. :label="item.name"
  49. :value="item.val"
  50. :key="item.id"
  51. ></el-option>
  52. </el-select>
  53. </el-form-item>
  54. </el-form>
  55. <div class="btn">
  56. <el-button
  57. type="primary"
  58. @click="submitForm"
  59. >确 定</el-button>
  60. </div>
  61. </div>
  62. </div>
  63. </template>
  64. <script>
  65. /**
  66. * dataPub.region2 判断底部显示哪些
  67. */
  68. import PubTagGroup from './PubTagGroup';
  69. import PubTagPartDetail from './PubTagPartDetail';
  70. import SymptomTagGroup from './SymptomTagGroup';
  71. import api from '@api/icss.js';
  72. import utils from '@api/utils.js';
  73. export default {
  74. name: 'NoiseTemplateWrapper',
  75. data() {
  76. return {
  77. dataPub: {}, //公用组件传的值都在这
  78. form: {
  79. currentOrder: '0', //标签成文顺序
  80. },
  81. rules: {
  82. currentOrder: [
  83. { required: true, message: '选择标签成文顺序', trigger: 'change' }
  84. ]
  85. },
  86. sendIds: [[], [], [], [], [], []], //标签明细右侧操作数据
  87. }
  88. },
  89. computed: {
  90. newSign() {
  91. return this.dataPub.region2;
  92. },
  93. },
  94. watch: {
  95. newSign(nextVal, prevVal) {
  96. if (nextVal != prevVal) {
  97. this.form.currentOrder = '0'
  98. }
  99. },
  100. },
  101. methods: {
  102. back() { this.$router.go(-1) },
  103. changeVal(val) { //子组件数据改变传递到父组件
  104. this.dataPub = val
  105. console.log('公用组件传的值都在这', val)
  106. },
  107. changeSex(sex) { //性别改变,清空标签明细
  108. console.log(sex)
  109. },
  110. changeType(type) { //填写单类型改变,标签明细左侧更新,右侧清空
  111. console.log(type)
  112. },
  113. changeActionData(arr) { //标签明细右侧数据id
  114. this.sendIds = arr
  115. },
  116. submitForm() { // 调用子组件的方法验证公用部分
  117. this.$refs.submitForm.submitForm('groups');
  118. },
  119. validatePass() { //验证成功回调,调取接口
  120. //仍需验证标签明细是否选择
  121. if (JSON.stringify(this.sendIds) == '[[],[],[],[],[],[]]') {
  122. this.$message({
  123. message: '请选择标签明细',
  124. type: 'warning'
  125. });
  126. return;
  127. }
  128. let detailLis = utils.dataRecombination(this.sendIds,this.dataPub.region2)
  129. let param = {
  130. "questionWrapper": {
  131. "controlType": 0, //控件类型(0:默认值 1:下拉单选 2:下拉多选 6:文本框 7:数字键盘文本框 99:联合推送)
  132. "id": "", //新增id置空
  133. "type": this.dataPub.region1, //标签归属
  134. "tagType": this.dataPub.region2, //标签类型
  135. "tagName": this.dataPub.region3, //系统名称
  136. "name": this.dataPub.region4, //界面名称
  137. "joint": this.dataPub.region5, //标签间的连接符
  138. "subType": this.dataPub.region6, //0:可以,1:不可以(当项目检索)
  139. "sexType": this.dataPub.region7, //1:男,2:女,3:通用
  140. "ageBegin": this.dataPub.region8, //最小年龄
  141. "ageEnd": this.dataPub.region9, //最大年龄
  142. "textGenerate": this.form.currentOrder, //成文顺序 默认0
  143. "copyType": this.dataPub.region2 == 6 ? this.dataPub.region10 : (this.dataPub.region2 == 3 ? this.dataPub.region11 : ''), //是否复制
  144. "showAdd": 0, //是否显示加号血压
  145. "showInfo": 0,
  146. "questionDetails": [],
  147. "questionMappings": detailLis //映射关系,
  148. }
  149. }
  150. console.log(param)
  151. // return api.saveOrUpdate(param).then((res) => {
  152. // if (res.data.code === '0') {
  153. // this.$message({
  154. // message: res.data.msg,
  155. // type: 'success'
  156. // });
  157. // }else{
  158. // this.$message({
  159. // message: res.data.msg,
  160. // type: 'error'
  161. // });
  162. // }
  163. // })
  164. },
  165. },
  166. components: {
  167. PubTagGroup,
  168. PubTagPartDetail,
  169. SymptomTagGroup,
  170. }
  171. }
  172. </script>
  173. <style lang="less">
  174. @import "../../less/common.less";
  175. .NoiseTemplateWrapper {
  176. .groupTitle {
  177. background-color: #fff;
  178. height: 40px;
  179. line-height: 40px;
  180. padding-left: 20px;
  181. }
  182. .main {
  183. background-color: #fff;
  184. margin: 0 20px 20px;
  185. padding: 20px;
  186. border-top: 1px solid @icssBorder;
  187. box-sizing: border-box;
  188. font-size: 14px;
  189. color: #606266;
  190. .title {
  191. margin-bottom: 20px;
  192. i {
  193. color: #f56c6c;
  194. }
  195. }
  196. }
  197. .btn {
  198. text-align: right;
  199. }
  200. .order {
  201. margin-bottom: 20px;
  202. .el-input__inner {
  203. line-height: 30px;
  204. height: 30px;
  205. }
  206. }
  207. }
  208. </style>