AdminMedicalHistoryForm2.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <a-spin :spinning="confirmLoading">
  3. <j-form-container :disabled="formDisabled">
  4. <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
  5. <a-row>
  6. <a-col :span="24">
  7. <a-form-model-item label="提交人账号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phone">
  8. <a-input v-model="model.phone" placeholder="请输入提交人账号" ></a-input>
  9. </a-form-model-item>
  10. </a-col>
  11. <a-col :span="24">
  12. <a-form-model-item label="提交人姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="submitterName">
  13. <a-input v-model="model.submitterName"></a-input>
  14. </a-form-model-item>
  15. </a-col>
  16. <a-col :span="24">
  17. <a-form-model-item label="分类名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="uploadingName">
  18. <a-input v-model="model.uploadingName" placeholder="请输入分类名称" ></a-input>
  19. </a-form-model-item>
  20. </a-col>
  21. <a-col :span="24">
  22. <a-form-model-item label="审核人账号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="auditor">
  23. <a-input v-model="model.auditor" placeholder="请输入审核人账号" ></a-input>
  24. </a-form-model-item>
  25. </a-col>
  26. <a-col :span="24">
  27. <a-form-model-item label="审核时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="auditorTime">
  28. <j-date placeholder="请选择审核时间" v-model="model.auditorTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
  29. </a-form-model-item>
  30. </a-col>
  31. <a-col :span="24">
  32. <a-form-model-item label="审核备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="picWordRecognition">
  33. <a-textarea v-model="model.remark" rows="4" placeholder="" />
  34. </a-form-model-item>
  35. </a-col>
  36. <a-col :span="24">
  37. <a-form-model-item label="标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title">
  38. <a-input v-model="model.title" placeholder="请输入标题" ></a-input>
  39. </a-form-model-item>
  40. </a-col>
  41. <a-col :span="24">
  42. <a-form-model-item label="姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
  43. <a-input v-model="model.name" placeholder="请输入姓名" ></a-input>
  44. </a-form-model-item>
  45. </a-col>
  46. <a-col :span="24">
  47. <a-form-model-item label="省份" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="province">
  48. <a-input v-model="model.province" placeholder="请输入省份" ></a-input>
  49. </a-form-model-item>
  50. </a-col>
  51. <a-col :span="24">
  52. <a-form-model-item label="城市" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="city">
  53. <a-input v-model="model.city" placeholder="请输入城市" ></a-input>
  54. </a-form-model-item>
  55. </a-col>
  56. <a-col :span="24">
  57. <a-form-model-item label="医院" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hospital">
  58. <a-input v-model="model.hospital" placeholder="请输入医院" ></a-input>
  59. </a-form-model-item>
  60. </a-col>
  61. <a-col :span="24">
  62. <a-form-model-item label="病例类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="caseName">
  63. <a-input v-model="model.caseName" placeholder="请输入病例类型" ></a-input>
  64. </a-form-model-item>
  65. </a-col>
  66. <a-col :span="24">
  67. <a-form-model-item label="拍照图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pic">
  68. <j-image-upload isMultiple v-model="model.pic" ></j-image-upload>
  69. </a-form-model-item>
  70. </a-col>
  71. <a-col :span="24">
  72. <a-form-model-item label="打码前图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="picTwo">
  73. <j-image-upload isMultiple v-model="model.picTwo" ></j-image-upload>
  74. </a-form-model-item>
  75. </a-col>
  76. <a-col :span="24">
  77. <a-form-model-item label="图片识别文字" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="picWordRecognition">
  78. <a-textarea v-model="model.picWordRecognition" rows="4" placeholder="请输入图片识别文字" />
  79. </a-form-model-item>
  80. </a-col>
  81. <a-col :span="24">
  82. <a-form-model-item label="文件" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mhFile">
  83. <j-upload v-model="model.mhFile" ></j-upload>
  84. </a-form-model-item>
  85. </a-col>
  86. <a-col :span="24">
  87. <a-form-model-item label="是否通过初审" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="firstTrial">
  88. <j-dict-select-tag type="list" v-model="model.firstTrial" dictCode="sftgcs" placeholder="" />
  89. </a-form-model-item>
  90. </a-col>
  91. <!-- <a-col :span="24">-->
  92. <!-- <a-form-model-item label="是否二次上传 1没上传 2上传了" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="secondaryUpload">-->
  93. <!-- <j-dict-select-tag type="list" v-model="model.secondaryUpload" dictCode="" placeholder="请选择是否二次上传 1没上传 2上传了" />-->
  94. <!-- </a-form-model-item>-->
  95. <!-- </a-col>-->
  96. <!-- <a-col :span="24">-->
  97. <!-- <a-form-model-item label="专家是否通过 0未审理 1没通过 2通过了" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">-->
  98. <!-- <j-dict-select-tag type="list" v-model="model.type" dictCode="" placeholder="请选择专家是否通过 0未审理 1没通过 2通过了" />-->
  99. <!-- </a-form-model-item>-->
  100. <!-- </a-col>-->
  101. <!-- <a-col :span="24">-->
  102. <!-- <a-form-model-item label="创建人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="createBy">-->
  103. <!-- <a-input v-model="model.createBy" placeholder="请输入创建人" ></a-input>-->
  104. <!-- </a-form-model-item>-->
  105. <!-- </a-col>-->
  106. <a-col :span="24">
  107. <a-form-model-item label="创建时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="createTime">
  108. <j-date placeholder="请选择创建时间" v-model="model.createTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
  109. </a-form-model-item>
  110. </a-col>
  111. <!-- <a-col :span="24">-->
  112. <!-- <a-form-model-item label="更新人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="updateBy">-->
  113. <!-- <a-input v-model="model.updateBy" placeholder="请输入更新人" ></a-input>-->
  114. <!-- </a-form-model-item>-->
  115. <!-- </a-col>-->
  116. <!-- <a-col :span="24">-->
  117. <!-- <a-form-model-item label="更新时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="updateTime">-->
  118. <!-- <j-date placeholder="请选择更新时间" v-model="model.updateTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />-->
  119. <!-- </a-form-model-item>-->
  120. <!-- </a-col>-->
  121. </a-row>
  122. </a-form-model>
  123. </j-form-container>
  124. </a-spin>
  125. </template>
  126. <script>
  127. import { httpAction, getAction } from '@/api/manage'
  128. import { validateDuplicateValue } from '@/utils/util'
  129. export default {
  130. name: 'AdminMedicalHistoryForm',
  131. components: {
  132. },
  133. props: {
  134. //表单禁用
  135. disabled: {
  136. type: Boolean,
  137. default: false,
  138. required: false
  139. }
  140. },
  141. data () {
  142. return {
  143. model:{
  144. },
  145. labelCol: {
  146. xs: { span: 24 },
  147. sm: { span: 5 },
  148. },
  149. wrapperCol: {
  150. xs: { span: 24 },
  151. sm: { span: 16 },
  152. },
  153. confirmLoading: false,
  154. validatorRules: {
  155. },
  156. url: {
  157. add: "/admincasehistory/adminMedicalHistory/add",
  158. edit: "/admincasehistory/adminMedicalHistory/edit",
  159. queryById: "/admincasehistory/adminMedicalHistory/queryById"
  160. }
  161. }
  162. },
  163. computed: {
  164. formDisabled(){
  165. return this.disabled
  166. },
  167. },
  168. created () {
  169. //备份model原始值
  170. this.modelDefault = JSON.parse(JSON.stringify(this.model));
  171. },
  172. methods: {
  173. add () {
  174. this.edit(this.modelDefault);
  175. },
  176. edit (record) {
  177. this.model = Object.assign({}, record);
  178. this.visible = true;
  179. },
  180. submitForm () {
  181. const that = this;
  182. // 触发表单验证
  183. this.$refs.form.validate(valid => {
  184. if (valid) {
  185. that.confirmLoading = true;
  186. let httpurl = '';
  187. let method = '';
  188. if(!this.model.id){
  189. httpurl+=this.url.add;
  190. method = 'post';
  191. }else{
  192. httpurl+=this.url.edit;
  193. method = 'put';
  194. }
  195. httpAction(httpurl,this.model,method).then((res)=>{
  196. if(res.success){
  197. that.$message.success(res.message);
  198. that.$emit('ok');
  199. }else{
  200. that.$message.warning(res.message);
  201. }
  202. }).finally(() => {
  203. that.confirmLoading = false;
  204. })
  205. }
  206. })
  207. },
  208. }
  209. }
  210. </script>