diagnoseOtherDialog.vue 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <el-dialog width="854px" :title="titles" :visible.sync="visibility" :close-on-click-modal="isClose"
  3. :close-on-press-escape="isClose">
  4. <el-form :model="formValue" :rules="rules" ref="formValue" class="demo-form-inline"
  5. :label-position="labelPosition"
  6. label-width="100px">
  7. <el-row>
  8. <el-col :span="8">
  9. <el-form-item label="诊断名称" prop="class_name">
  10. <el-input v-model="formValue.class_name"></el-input>
  11. </el-form-item>
  12. </el-col>
  13. <el-col :span="8">
  14. <el-form-item label="拼音" prop="pinyin">
  15. <el-input v-model="formValue.pinyin"></el-input>
  16. </el-form-item>
  17. </el-col>
  18. <el-col :span="8">
  19. <el-form-item label="五笔" prop="wubi">
  20. <el-input v-model="formValue.wubi"></el-input>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :span="8">
  24. <el-form-item label="目录代码" prop="content_code">
  25. <el-input v-model="formValue.content_code"></el-input>
  26. </el-form-item>
  27. </el-col>
  28. <el-col :span="8">
  29. <el-form-item label="国家编码" prop="country_code">
  30. <el-input v-model="formValue.country_code"></el-input>
  31. </el-form-item>
  32. </el-col>
  33. <el-col :span="8">
  34. <el-form-item label="国家目录名称" prop="country_content_name">
  35. <el-input v-model="formValue.country_content_name"></el-input>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :span="8">
  39. <el-form-item label="排序" prop="">
  40. <el-input v-model="formValue.sort"></el-input>
  41. </el-form-item>
  42. </el-col>
  43. </el-row>
  44. <el-col>
  45. <el-form-item label="备注">
  46. <el-input type="textarea" :row="5" v-model="formValue.remark"
  47. placeholder="请输入内容">
  48. </el-input>
  49. </el-form-item>
  50. </el-col>
  51. </el-form>
  52. <span slot="footer" class="dialog-footer">
  53. <el-button v-if="isCreated == 3" @click="cancle('formValue')">取 消</el-button>
  54. <el-button v-if="isCreated != 3 " @click="cancle('formValue')">取 消</el-button>
  55. <el-button v-if="isCreated != 3" type="primary" @click="comfirm('formValue')">保 存</el-button>
  56. </span>
  57. </el-dialog>
  58. </template>
  59. <script>
  60. export default {
  61. name: 'diagnoseOtherDialog',
  62. data() {
  63. return {
  64. visibility: false,
  65. labelPosition: 'right',
  66. isClose: false,
  67. form: {
  68. class_name: '',
  69. content_code: '',
  70. country_code: '',
  71. country_content_name: '',
  72. remark: '',
  73. pinyin: '',
  74. wubi: '',
  75. sort:0,
  76. },
  77. resetForm: {
  78. class_name: '',
  79. content_code: '',
  80. country_code: '',
  81. country_content_name: '',
  82. remark: '',
  83. pinyin: '',
  84. wubi: ''
  85. },
  86. rules: {
  87. class_name: [
  88. { required: true, message: '请输入大类名称', trigger: 'blur' }
  89. ],
  90. content_code: [
  91. { required: true, message: '请输入目录代码', trigger: 'blur' }
  92. ]
  93. }
  94. }
  95. },
  96. props: {
  97. titles: {
  98. type: String,
  99. default: ''
  100. },
  101. formValue: {
  102. type: Object
  103. },
  104. type: {
  105. type: Number,
  106. default: 1
  107. },
  108. isCreated: {
  109. type: Number,
  110. default: 1
  111. }
  112. },
  113. methods: {
  114. show: function() {
  115. this.visibility = true
  116. }, hide: function() {
  117. this.visibility = false
  118. },
  119. cancle: function(formName) {
  120. this.$emit('dialog-cancle', this.getValue())
  121. this.$refs['formValue'].resetFields()
  122. },
  123. comfirm: function(formName) {
  124. this.$refs['formValue'].validate((valid) => {
  125. if (valid) {
  126. let value = {}
  127. value = this.getValue()
  128. this.$emit('dialog-comfirm', value)
  129. this.form = Object.assign({}, this.resetForm)
  130. }
  131. })
  132. },
  133. getValue: function() {
  134. let form = {}
  135. form = this.formValue
  136. form['title'] = this.titles
  137. form['type'] = this.type
  138. form['isCreated'] = this.isCreated
  139. return form
  140. }
  141. }
  142. }
  143. </script>
  144. <style scoped>
  145. </style>