华西海圻ELN前端工程
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

244 lines
7.5 KiB

  1. <template>
  2. <div>
  3. <div class="edit-container">
  4. <div class="edit-top">
  5. <div class="left-top">
  6. <img src="@/assets/images/back.png" @click="cancel()" />
  7. <div class="left-title"></div>
  8. </div>
  9. <div class="center-top">
  10. </div>
  11. <div class="right-top">
  12. <el-button @click="cancel()">{{ $t('form.cancel') }}</el-button>
  13. <el-button type="danger" @click="showReject">{{ $t('page.business.study.studyFormPre.reject') }}</el-button>
  14. <el-button type="primary" @click="showApprove">{{ $t('page.business.study.studyFormPre.approve')
  15. }}</el-button>
  16. </div>
  17. </div>
  18. <div class="edit-content ">
  19. <TemplateTable ref="templateTable" :sn="form.templateSn" :templateData="form" fillType="audit" />
  20. </div>
  21. </div>
  22. <!-- 通过 -->
  23. <el-dialog :title="$t('page.business.study.studyFormPre.shtg')" :visible.sync="openApprove" width="500px"
  24. append-to-body :close-on-click-modal="false">
  25. <el-form ref="formApprove" :model="formApprove" :rules="rulesApprove" label-width="120px">
  26. <div class="sbzdtcma"> <input type="text"> <input type="password"> </div>
  27. <el-row>
  28. <el-col :span="24">
  29. <el-form-item :label="$t('form.qmyy')" prop="qmyy">
  30. <el-input type="text" :value="formApprove.qmyy" maxlength="50" disabled
  31. :placeholder="$t('form.placeholderInput')" />
  32. </el-form-item>
  33. </el-col>
  34. </el-row>
  35. <el-row>
  36. <el-col :span="24">
  37. <el-form-item :label="$t('form.remark')" prop="remark">
  38. <el-input type="textarea" v-model="formApprove.remark" :rows="5" maxlength="500"
  39. :placeholder="$t('form.placeholderInput')">
  40. </el-input>
  41. </el-form-item>
  42. </el-col>
  43. </el-row>
  44. <el-row>
  45. <el-col :span="24">
  46. <el-form-item :label="$t('form.signer')">
  47. <el-input type="text" v-model="nickName" maxlength="50" disabled
  48. :placeholder="$t('form.placeholderInput')" />
  49. </el-form-item>
  50. </el-col>
  51. </el-row>
  52. <el-row>
  53. <el-col :span="24">
  54. <el-form-item :label="$t('form.password')" prop="qmrmm">
  55. <el-input type="password" v-model="formApprove.qmrmm" maxlength="20"
  56. :placeholder="$t('form.placeholderInput')" />
  57. </el-form-item>
  58. </el-col>
  59. </el-row>
  60. </el-form>
  61. <div slot="footer" class="dialog-footer">
  62. <el-button type="primary" @click="approve">{{ $t('form.confirm') }}</el-button>
  63. <el-button @click="openApprove = false">{{ $t('form.cancel') }}</el-button>
  64. </div>
  65. </el-dialog>
  66. <!-- 拒绝 -->
  67. <el-dialog :title="$t('page.business.study.studyFormPre.shjj')" :visible.sync="openReject" width="500px"
  68. append-to-body :close-on-click-modal="false">
  69. <el-form ref="formReject" :model="formReject" :rules="rulesReject" label-width="120px">
  70. <div class="sbzdtcma"> <input type="text"> <input type="password"> </div>
  71. <el-row>
  72. <el-col :span="24">
  73. <el-form-item :label="$t('form.qmyy')" prop="qmyy">
  74. <el-input type="text" :value="formReject.qmyy" maxlength="50" disabled
  75. :placeholder="$t('form.placeholderInput')" />
  76. </el-form-item>
  77. </el-col>
  78. </el-row>
  79. <el-row>
  80. <el-col :span="24">
  81. <el-form-item :label="$t('form.remark')" prop="remark">
  82. <el-input type="textarea" v-model="formReject.remark" :rows="5" maxlength="500"
  83. :placeholder="$t('form.placeholderInput')">
  84. </el-input>
  85. </el-form-item>
  86. </el-col>
  87. </el-row>
  88. <el-row>
  89. <el-col :span="24">
  90. <el-form-item :label="$t('form.signer')">
  91. <el-input type="text" v-model="nickName" maxlength="50" disabled
  92. :placeholder="$t('form.placeholderInput')" />
  93. </el-form-item>
  94. </el-col>
  95. </el-row>
  96. <el-row>
  97. <el-col :span="24">
  98. <el-form-item :label="$t('form.password')" prop="qmrmm">
  99. <el-input type="password" v-model="formReject.qmrmm" maxlength="20"
  100. :placeholder="$t('form.placeholderInput')" />
  101. </el-form-item>
  102. </el-col>
  103. </el-row>
  104. </el-form>
  105. <div slot="footer" class="dialog-footer">
  106. <el-button type="primary" @click="reject">{{ $t('form.confirm') }}</el-button>
  107. <el-button @click="openReject = false">{{ $t('form.cancel') }}</el-button>
  108. </div>
  109. </el-dialog>
  110. </div>
  111. </template>
  112. <script>
  113. import { studyFormPre_tg, studyFormPre_jj, studyFormPre_info } from "@/api/business/study/studyFormPre"
  114. import TemplateTable from '@/views/business/comps/template/TemplateTable';
  115. import { mapGetters } from 'vuex'
  116. export default {
  117. name: "Sh",
  118. components: { TemplateTable },
  119. data() {
  120. return {
  121. showIndex: 1,
  122. form: {},
  123. rules: {
  124. bdmc: [{
  125. required: true,
  126. message: ' ',
  127. trigger: 'blur'
  128. }],
  129. templateId: [{
  130. required: true,
  131. message: ' ',
  132. trigger: 'blur'
  133. }]
  134. },
  135. openApprove: false,
  136. formApprove: {
  137. id: null,
  138. qmyy: this.$t('page.business.study.studyFormPre.shtg'),
  139. remark: '',
  140. qmrmm: '',
  141. },
  142. rulesApprove: {
  143. qmrmm: [{
  144. required: true,
  145. message: ' ',
  146. trigger: 'blur'
  147. }]
  148. },
  149. openReject: false,
  150. formReject: {
  151. id: null,
  152. qmyy: this.$t('page.business.study.studyFormPre.shjj'),
  153. remark: '',
  154. qmrmm: '',
  155. },
  156. rulesReject: {
  157. qmrmm: [{
  158. required: true,
  159. message: ' ',
  160. trigger: 'blur'
  161. }],
  162. remark: [{
  163. required: true,
  164. message: ' ',
  165. trigger: 'blur'
  166. }]
  167. }
  168. }
  169. },
  170. computed: {
  171. ...mapGetters([
  172. 'nickName','name'
  173. ]),
  174. },
  175. created() {
  176. },
  177. methods: {
  178. cancel() {
  179. this.$emit('close')
  180. },
  181. reset() {
  182. this.form = {
  183. id: null,
  184. studyId: null,
  185. qmyy: null,
  186. remark: null,
  187. qmrmm: null
  188. }
  189. this.resetForm("form")
  190. },
  191. show(row) {
  192. this.reset()
  193. this.$modal.loading()
  194. studyFormPre_info({ id: row.id }).then(response => {
  195. this.form = response.data
  196. this.open = true
  197. this.$modal.closeLoading()
  198. }).finally(() => {
  199. this.$modal.closeLoading()
  200. })
  201. },
  202. showApprove() {
  203. this.formApprove.id = this.form.id
  204. this.openApprove = true
  205. },
  206. approve() {
  207. this.$refs["formApprove"].validate(valid => {
  208. if (valid) {
  209. this.$modal.loading()
  210. studyFormPre_tg(this.formApprove).then(response => {
  211. this.openApprove = false
  212. this.$modal.closeLoading()
  213. this.$emit('close')
  214. }).finally(() => {
  215. this.$modal.closeLoading()
  216. })
  217. }
  218. })
  219. },
  220. showReject() {
  221. this.formReject.id = this.form.id
  222. this.openReject = true
  223. },
  224. reject() {
  225. this.$refs["formReject"].validate(valid => {
  226. if (valid) {
  227. this.$modal.loading()
  228. studyFormPre_jj(this.formReject).then(response => {
  229. this.openReject = false
  230. this.$modal.closeLoading()
  231. this.$emit('close')
  232. }).finally(() => {
  233. this.$modal.closeLoading()
  234. })
  235. }
  236. })
  237. }
  238. }
  239. }
  240. </script>