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

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