AddMedicalName.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <div>
  3. <crumbs :title="minTitle" linkTo="/admin/LT-YXSYKWH-YXSYMMWH"></crumbs>
  4. <div class="contents">
  5. <div class="content">
  6. <h3>添加术语:</h3>
  7. <p class="titl">标准术语:</p>
  8. <table class="deptbox">
  9. <tr>
  10. <td class="ind">序号</td>
  11. <td>标准词</td>
  12. <td>类型</td>
  13. <td class="desc">说明</td>
  14. </tr>
  15. <tr>
  16. <td class="ind">1</td>
  17. <td>
  18. <el-input v-model="data.name" placeholder="请输入术语" maxlength="30"></el-input>
  19. </td>
  20. <td>
  21. <el-select v-model="data.type" clearable placeholder="请选择">
  22. <el-option
  23. v-for="item in data.typeList"
  24. :key="item.key"
  25. :label="item.name"
  26. :value="item.key">
  27. </el-option>
  28. </el-select>
  29. </td>
  30. <td class="desc">
  31. <el-input v-model="data.mark" placeholder="请输入术语说明" maxlength="120"></el-input>
  32. </td>
  33. </tr>
  34. </table>
  35. <p class="titl">同义词:</p>
  36. <table class="deptbox">
  37. <tr>
  38. <td class="ind">序号</td>
  39. <td>术语</td>
  40. <td>类型</td>
  41. <td class="desc">说明</td>
  42. <td v-if="id">操作</td>
  43. </tr>
  44. <tr v-for="(item,index) in synonymous">
  45. <td class="ind">{{index+1}}</td>
  46. <td>
  47. <el-input v-model="item.term" placeholder="请输入术语" maxlength="30"></el-input>
  48. </td>
  49. <td>
  50. <el-select v-model="item.type" clearable placeholder="请选择">
  51. <el-option
  52. v-for="item in data.typeList"
  53. :key="item.key"
  54. :label="item.name"
  55. :value="item.key">
  56. </el-option>
  57. </el-select>
  58. </td>
  59. <td class="desc">
  60. <el-input v-model="item.mark" placeholder="请输入术语说明" maxlength="120"></el-input>
  61. </td>
  62. <td v-if="id">
  63. <span @click="deleLine(index)">删除</span>
  64. </td>
  65. </tr>
  66. <tr @click="addSpan">
  67. <td :colspan="colspan" class="addSpan">+</td>
  68. </tr>
  69. </table>
  70. <div class="btn">
  71. <el-button
  72. type="primary"
  73. @click="comfirn"
  74. >确 定</el-button>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </template>
  80. <script type="text/javascript">
  81. export default {
  82. name:'AddMedicalName',
  83. data(){
  84. return{
  85. minTitle:'医学术语命名维护-添加',
  86. data:{
  87. name:'',
  88. type:'',
  89. mark:'',
  90. type:'',
  91. typeList:[
  92. {
  93. name:'类型1',
  94. id:1,
  95. key:1
  96. },
  97. {
  98. name:'类型2',
  99. id:2,
  100. key:2
  101. },
  102. {
  103. name:'类型3',
  104. id:3,
  105. key:3
  106. },
  107. ]
  108. },
  109. id:null,
  110. synonymous:[//同义词
  111. {
  112. term:'',
  113. id:1,
  114. type:'',
  115. mark:''
  116. },
  117. {
  118. term:'',
  119. id:2,
  120. type:'',
  121. mark:''
  122. },
  123. {
  124. term:'',
  125. id:3,
  126. type:'',
  127. mark:''
  128. },
  129. ],
  130. colspan:4
  131. }
  132. },
  133. created(){
  134. const info = this.$route.params.info;
  135. if(info){
  136. this.minTitle = '医学术语命名维护-修改';
  137. this.id = info.id;
  138. this.colspan = 5;
  139. }
  140. },
  141. methods:{
  142. handleInput(){//限制输入类型
  143. },
  144. addSpan(){
  145. // let index = this.synIndex;
  146. // index++
  147. let singleSpan = {
  148. // index:index,
  149. term:'',
  150. id:null,
  151. type:'',
  152. mark:''
  153. }
  154. this.synonymous.push(singleSpan);
  155. // this.synIndex = index;
  156. },
  157. deleLine(index){
  158. this.synonymous.splice(index,1);
  159. console.log(123,index,this.synonymous);
  160. },
  161. comfirn(){
  162. }
  163. }
  164. }
  165. </script>
  166. <style lang="less" scoped>
  167. @import "../../less/admin.less";
  168. .content{
  169. background: #fff;
  170. padding: 20px 20px 30px;
  171. color: #545455;
  172. }
  173. .titl{
  174. margin: 25px 0 10px;
  175. }
  176. .deptbox{
  177. // width: 100%;
  178. background: #fff;
  179. padding: 20px 10px 30px;
  180. font-size: 14px;
  181. text-align: left;
  182. border-collapse: collapse;
  183. >tr{
  184. height: 30px;
  185. text-align: center;
  186. td{
  187. width: 135px;
  188. border: 1px solid #666;
  189. padding:5px;
  190. }
  191. input{
  192. border:none;
  193. width: 100%;
  194. }
  195. .ind{
  196. width: 55px;
  197. }
  198. .desc{
  199. width: 280px;
  200. }
  201. }
  202. .addSpan{
  203. text-align: center;
  204. cursor: pointer;
  205. }
  206. }
  207. .btn {
  208. text-align: right;
  209. margin-top: 20px;
  210. }
  211. </style>