华西海圻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.

269 lines
9.0 KiB

  1. G<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="showApprove('复核拒绝')">{{ $t('page.business.study.studyFormPlan.fhjj')
  14. }}</el-button>
  15. <el-button type="primary" @click="showApprove('复核通过')">{{ $t('page.business.study.studyFormPlan.fhtg')
  16. }}</el-button>
  17. <el-button type="primary" @click="showApprove('通过')">{{ $t('page.business.study.studyFormPlan.tongguo')
  18. }}</el-button>
  19. </div>
  20. </div>
  21. <div class="edit-content">
  22. <div class="content-left">
  23. <TemplateTable ref="templateTable" :sn="form.templateSn" fillType="readonly" :templateData="form.bdnr"/>
  24. <div class="content-title">
  25. <div class="line"></div>
  26. <div class="subtitle"> {{ $t('page.business.study.studyFormPlan.qmxx') }}</div>
  27. </div>
  28. <div class="pal">
  29. <el-table :data="qmxxList" v-loading="loadingQmxx">
  30. <el-table-column :label="$t('page.business.study.studyFormPlan.qmr')" align="center" prop="qmrMc"
  31. width="150px" />
  32. <el-table-column :label="$t('page.business.study.studyFormPlan.qmyy')" align="center" prop="qmyy"
  33. width="150px" />
  34. <el-table-column :label="$t('page.business.study.studyFormPlan.qmsj')" align="center" prop="createTime"
  35. width="150px" />
  36. <el-table-column :label="$t('page.business.study.studyFormPlan.bzyy')" align="center" prop="remark"
  37. :show-overflow-tooltip="true" />
  38. </el-table>
  39. </div>
  40. <div class="pal">
  41. <pagination v-show="totalQmxx > 0" :total="totalQmxx" :page.sync="queryParamsQmxx.pageNum"
  42. :limit.sync="queryParamsQmxx.pageSize" @pagination="getQmxxList" />
  43. </div>
  44. </div>
  45. <div class="content-right">
  46. <div class="content-title">
  47. <div class="line"></div>
  48. <div class="subtitle"> {{ $t('page.business.study.studyFormPlan.jcgj') }}</div>
  49. </div>
  50. <JcgjList ref="jcgjList" @handleQuery="getJjcgjList" />
  51. <pagination v-show="jcgjTotal > 0" small layout="prev, pager, next" :total="jcgjTotal"
  52. @pagination="getJjcgjList" />
  53. </div>
  54. </div>
  55. </div>
  56. <el-dialog :title="$t(openTitle)" :visible.sync="openApprove" width="500px" append-to-body
  57. :close-on-click-modal="false">
  58. <el-form ref="formApprove" :model="formApprove" :rules="rulesApprove" label-width="120px">
  59. <el-row>
  60. <el-col :span="24">
  61. <el-form-item :label="$t('form.qmyy')" prop="qmyy">
  62. <el-input type="text" :value="formApprove.qmyy" maxlength="50" disabled
  63. :placeholder="$t('form.placeholderInput')" />
  64. </el-form-item>
  65. </el-col>
  66. </el-row>
  67. <el-row v-if="formApprove.qmyy == '复核拒绝'">
  68. <el-col :span="24">
  69. <el-form-item :label="$t('page.business.study.studyFormPlan.reason')" prop="reason">
  70. <el-input type="textarea" v-model="formApprove.reason" :rows="5" maxlength="500"
  71. :placeholder="$t('form.placeholderInput')">
  72. </el-input>
  73. </el-form-item>
  74. </el-col>
  75. </el-row>
  76. <el-row v-else>
  77. <el-col :span="24">
  78. <el-form-item :label="$t('form.remark')">
  79. <el-input type="textarea" v-model="formApprove.remark" :rows="5" maxlength="500"
  80. :placeholder="$t('form.placeholderInput')">
  81. </el-input>
  82. </el-form-item>
  83. </el-col>
  84. </el-row>
  85. <el-row>
  86. <el-col :span="24">
  87. <el-form-item :label="$t('form.signer')">
  88. <el-input type="text" v-model="nickName" maxlength="50" disabled
  89. :placeholder="$t('form.placeholderInput')" />
  90. </el-form-item>
  91. </el-col>
  92. </el-row>
  93. <el-row>
  94. <el-col :span="24">
  95. <el-form-item :label="$t('form.password')" prop="qmrmm">
  96. <el-input type="password" v-model="formApprove.qmrmm" maxlength="20"
  97. :placeholder="$t('form.placeholderInput')" />
  98. </el-form-item>
  99. </el-col>
  100. </el-row>
  101. </el-form>
  102. <div slot="footer" class="dialog-footer">
  103. <el-button type="primary" @click="approve">{{ $t('form.confirm') }}</el-button>
  104. <el-button @click="openApprove = false">{{ $t('form.cancel') }}</el-button>
  105. </div>
  106. </el-dialog>
  107. </div>
  108. </template>
  109. <script>
  110. import { studyFormPlan_fhtg, studyFormPlan_fhjj, studyFormPlan_tg, studyFormPlan_info, studyFormPlan_jcgj, studyFormPlan_qmxx } from "@/api/business/study/studyFormPlan"
  111. import { mapGetters } from 'vuex'
  112. import JcgjList from "@/views/business/comps/common/JcgjList";
  113. import TemplateTable from '@/views/business/comps/template/TemplateTable';
  114. export default {
  115. name: "Fh",
  116. components: { TemplateTable, JcgjList },
  117. data() {
  118. return {
  119. form: {},
  120. qmxxList: [],
  121. totalQmxx: 0,
  122. loadingQmxx: true,
  123. queryParamsQmxx: {
  124. formId: null,
  125. pageNum: 1,
  126. pageSize: 10
  127. },
  128. jcgjList: [],
  129. jcgjTotal: 0,
  130. queryParamsJcgj: {
  131. pageNum: 1,
  132. formId: null,
  133. pageSize: 10,
  134. },
  135. openTitle: '',
  136. openApprove: false,
  137. formApprove: {},
  138. rulesApprove: {
  139. qmrmm: [{
  140. required: true,
  141. message: ' ',
  142. trigger: 'blur'
  143. }],
  144. reason: [{
  145. required: true,
  146. message: ' ',
  147. trigger: 'blur'
  148. }],
  149. }
  150. }
  151. },
  152. computed: {
  153. ...mapGetters([
  154. 'nickName'
  155. ]),
  156. },
  157. created() {
  158. },
  159. methods: {
  160. getJjcgjList(val) {
  161. this.$modal.loading()
  162. studyFormPlan_jcgj(_.merge({}, this.queryParamsJcgj, val)).then(response => {
  163. this.jcgjList = response.rows
  164. this.jcgjTotal = response.total
  165. this.$refs.jcgjList.init(this.jcgjList)
  166. this.$modal.closeLoading()
  167. }).finally(() => {
  168. this.$modal.closeLoading()
  169. })
  170. },
  171. getQmxxList() {
  172. this.loadingQmxx = true
  173. studyFormPlan_qmxx(this.queryParamsQmxx).then(response => {
  174. this.qmxxList = response.rows
  175. this.totalQmxx = response.total
  176. this.loadingQmxx = false
  177. })
  178. },
  179. cancel() {
  180. this.$emit('close')
  181. },
  182. reset() {
  183. this.form = {}
  184. this.resetForm("form")
  185. },
  186. show(row) {
  187. this.reset()
  188. this.$modal.loading()
  189. this.queryParamsJcgj.formId = row.id
  190. this.queryParamsQmxx.formId = row.id
  191. studyFormPlan_info({ id: row.id }).then(response => {
  192. this.form = response.data
  193. this.getQmxxList()
  194. this.getJjcgjList()
  195. this.$modal.closeLoading()
  196. }).finally(() => {
  197. this.$modal.closeLoading()
  198. })
  199. },
  200. showApprove(qmyy) {
  201. this.openApprove = true
  202. this.resetApprove()
  203. this.formApprove.id = this.form.id
  204. this.formApprove.qmyy = qmyy
  205. if (qmyy == '复核通过') {
  206. this.openTitle = 'page.business.study.studyFormPlan.fhtg'
  207. } else if (qmyy == '复核拒绝') {
  208. this.openTitle = 'page.business.study.studyFormPlan.fhjj'
  209. } else if (qmyy == '通过') {
  210. this.openTitle = 'page.business.study.studyFormPlan.tongguo'
  211. }
  212. },
  213. resetApprove() {
  214. this.resetForm("formApprove")
  215. this.formApprove = {
  216. id: null,
  217. qmyy: '',
  218. bdnr: '',
  219. remark: '',
  220. reason: '',
  221. qmrmm: '',
  222. }
  223. },
  224. approve() {
  225. this.$refs["formApprove"].validate(valid => {
  226. if (valid) {
  227. this.doapprove()
  228. }
  229. })
  230. },
  231. async doapprove() {
  232. let content = await this.$refs.templateTable.getFormData()
  233. this.formApprove.bdnr = JSON.stringify(content)
  234. this.$modal.loading()
  235. if (this.formApprove.qmyy == '复核通过') {
  236. studyFormPlan_fhtg(this.formApprove).then(response => {
  237. this.openApprove = false
  238. this.$modal.closeLoading()
  239. this.$emit('close')
  240. }).finally(() => {
  241. this.$modal.closeLoading()
  242. })
  243. } else if (this.formApprove.qmyy == '复核拒绝') {
  244. this.formApprove.remark=this.formApprove.reason
  245. studyFormPlan_fhjj(this.formApprove).then(response => {
  246. this.openApprove = false
  247. this.$modal.closeLoading()
  248. this.$emit('close')
  249. }).finally(() => {
  250. this.$modal.closeLoading()
  251. })
  252. } else {
  253. studyFormPlan_tg(this.formApprove).then(response => {
  254. this.openApprove = false
  255. this.$modal.closeLoading()
  256. this.$emit('close')
  257. }).finally(() => {
  258. this.$modal.closeLoading()
  259. })
  260. }
  261. }
  262. }
  263. }
  264. </script>