NoiseTemplate.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 :pool="dataPub.tagPool" :type="dataPub.region1" :sign="dataPub.region2" v-show="dataPub.region2 == 2"></PubTagPartDetail>
  17. <SymptomTagGroup v-if="dataPub.region2 == 4" :dataPub ="this.dataPub"></SymptomTagGroup>
  18. <div class="btn">
  19. <el-button
  20. type="primary"
  21. @click="submitForm"
  22. >确 定</el-button>
  23. </div>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. /**
  29. * dataPub.region2 判断底部显示哪些
  30. */
  31. import PubTagGroup from './PubTagGroup';
  32. import PubTagPartDetail from './PubTagPartDetail';
  33. import SymptomTagGroup from './SymptomTagGroup';
  34. export default {
  35. name: 'NoiseTemplateWrapper',
  36. data() {
  37. return {
  38. dataPub: {}, //公用组件传的值都在这
  39. }
  40. },
  41. methods: {
  42. back() { this.$router.go(-1) },
  43. changeVal(val) { //子组件数据改变传递到父组件
  44. this.dataPub = val
  45. console.log('公用组件传的值都在这', val)
  46. },
  47. changeSex(sex) { //性别改变,清空标签明细
  48. console.log(sex)
  49. },
  50. changeType(type){ //填写单类型改变,标签明细左侧更新,右侧清空
  51. console.log(type)
  52. },
  53. submitForm() { // 调用子组件的方法验证公用部分
  54. this.$refs.submitForm.submitForm('groups');
  55. },
  56. validatePass() { //验证成功回调,调取接口
  57. //仍需验证标签明细是否选择
  58. },
  59. },
  60. components: {
  61. PubTagGroup,
  62. PubTagPartDetail,
  63. SymptomTagGroup,
  64. }
  65. }
  66. </script>
  67. <style lang="less">
  68. @import "../../less/common.less";
  69. .NoiseTemplateWrapper {
  70. .groupTitle {
  71. background-color: #fff;
  72. height: 40px;
  73. line-height: 40px;
  74. padding-left: 20px;
  75. }
  76. .main {
  77. background-color: #fff;
  78. margin: 0 20px 20px;
  79. padding: 20px;
  80. border-top: 1px solid @icssBorder;
  81. box-sizing: border-box;
  82. font-size: 14px;
  83. color: #606266;
  84. .title {
  85. margin-bottom: 20px;
  86. i {
  87. color: #f56c6c;
  88. }
  89. }
  90. }
  91. .btn {
  92. text-align: right;
  93. }
  94. }
  95. </style>