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

236 lines
7.5 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="primary" v-if="form.bdzt === 5 && form.tbzt === 1" @click="openApprove = true">{{
  14. $t('page.business.study.studyFormPre.tb') }}</el-button>
  15. </div>
  16. </div>
  17. <div class="edit-content ">
  18. <div class="content-left">
  19. <TemplateTable ref="templateTable" :sn="form.templateSn" :templateData="form.bdnr" fillType="readonly" />
  20. <div class="content-title">
  21. <div class="line"></div>
  22. <div class="subtitle"> {{ $t('page.business.study.studyFormPre.qmxx') }}</div>
  23. </div>
  24. <div class="pal">
  25. <el-table :data="qmxxList" v-loading="loadingQmxx">
  26. <el-table-column :label="$t('page.business.study.studyFormPre.qmr')" align="center" prop="qmrMc"
  27. width="150px" />
  28. <el-table-column :label="$t('page.business.study.studyFormPre.qmyy')" align="center" prop="qmyy"
  29. width="150px" />
  30. <el-table-column :label="$t('page.business.study.studyFormPre.qmsj')" align="center" prop="createTime"
  31. width="150px" />
  32. <el-table-column :label="$t('page.business.study.studyFormPre.bzyy')" align="center" prop="remark"
  33. :show-overflow-tooltip="true" />
  34. </el-table>
  35. </div>
  36. <div class="pal">
  37. <pagination v-show="totalQmxx > 0" :total="totalQmxx" :page.sync="queryParamsQmxx.pageNum"
  38. :limit.sync="queryParamsQmxx.pageSize" @pagination="getQmxxList" />
  39. </div>
  40. </div>
  41. <div class="content-right">
  42. <div class="content-title">
  43. <div class="line"></div>
  44. <div class="subtitle"> {{ $t('page.business.study.studyFormPre.jcgj') }}</div>
  45. </div>
  46. <JcgjList ref="jcgjList" @handleQuery="getJjcgjList" :showBj="false" :showXg="true"/>
  47. <pagination v-show="jcgjTotal > 0" small layout="prev, pager, next" :total="jcgjTotal"
  48. @pagination="getJjcgjList" />
  49. </div>
  50. </div>
  51. </div>
  52. <!-- 填报 -->
  53. <el-dialog :title="$t('page.business.study.studyFormPre.cjjl')" :visible.sync="openApprove" width="500px"
  54. append-to-body :close-on-click-modal="false">
  55. <el-form ref="formApprove" :model="formApprove" :rules="rulesApprove" label-width="120px">
  56. <el-alert :title="$t('page.business.study.studyFormPre.ts')" :closable="false" type="success">
  57. </el-alert>
  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>
  67. <el-col :span="24">
  68. <el-form-item :label="$t('form.remark')" prop="remark">
  69. <el-input type="textarea" v-model="formApprove.remark" :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>
  76. <el-col :span="24">
  77. <el-form-item :label="$t('form.signer')">
  78. <el-input type="text" v-model="nickName" maxlength="50" disabled
  79. :placeholder="$t('form.placeholderInput')" />
  80. </el-form-item>
  81. </el-col>
  82. </el-row>
  83. <el-row>
  84. <el-col :span="24">
  85. <el-form-item :label="$t('form.password')" prop="qmrmm">
  86. <el-input type="password" v-model="formApprove.qmrmm" maxlength="20"
  87. :placeholder="$t('form.placeholderInput')" />
  88. </el-form-item>
  89. </el-col>
  90. </el-row>
  91. </el-form>
  92. <div slot="footer" class="dialog-footer">
  93. <el-button type="primary" @click="approve">{{ $t('form.confirm') }}</el-button>
  94. <el-button @click="openApprove = false">{{ $t('form.cancel') }}</el-button>
  95. </div>
  96. </el-dialog>
  97. </div>
  98. </template>
  99. <script>
  100. import { studyFormPre_tb, studyFormPre_info, studyFormPre_jcgj, studyFormPre_qmxx } from "@/api/business/study/studyFormPre"
  101. import { mapGetters } from 'vuex'
  102. import JcgjList from "@/views/business/comps/common/JcgjList";
  103. import TemplateTable from '@/views/business/comps/template/TemplateTable';
  104. export default {
  105. name: "Xq",
  106. components: { JcgjList, TemplateTable },
  107. data() {
  108. return {
  109. openApprove: false,
  110. formApprove: {
  111. id: null,
  112. qmyy: '创建记录',
  113. remark: '',
  114. qmrmm: '',
  115. },
  116. rulesApprove: {
  117. qmrmm: [{
  118. required: true,
  119. message: ' ',
  120. trigger: 'blur'
  121. }]
  122. },
  123. qmxxList: [],
  124. totalQmxx: 0,
  125. loadingQmxx: true,
  126. queryParamsQmxx: {
  127. formId: null,
  128. pageNum: 1,
  129. pageSize: 10
  130. },
  131. open: false,
  132. showIndex: 1,
  133. form: {},
  134. rules: {
  135. bdmc: [{
  136. required: true,
  137. message: ' ',
  138. trigger: 'blur'
  139. }],
  140. templateId: [{
  141. required: true,
  142. message: ' ',
  143. trigger: 'blur'
  144. }]
  145. },
  146. jcgjTotal: 0,
  147. jcgjList: [],
  148. queryParamsJcgj: {
  149. pageNum: 1,
  150. formId: null,
  151. pageSize: 10,
  152. }
  153. }
  154. },
  155. computed: {
  156. ...mapGetters([
  157. 'nickName'
  158. ]),
  159. },
  160. created() {
  161. },
  162. methods: {
  163. getJjcgjList(val) {
  164. this.$modal.loading()
  165. studyFormPre_jcgj(_.merge({}, this.queryParamsJcgj, val)).then(response => {
  166. this.jcgjList = response.rows
  167. this.jcgjTotal = response.total
  168. this.$refs.jcgjList.init(this.jcgjList)
  169. this.$modal.closeLoading()
  170. }).finally(() => {
  171. this.$modal.closeLoading()
  172. })
  173. },
  174. getQmxxList() {
  175. this.loadingQmxx = true
  176. studyFormPre_qmxx(this.queryParamsQmxx).then(response => {
  177. this.qmxxList = response.rows
  178. this.totalQmxx = response.total
  179. this.loadingQmxx = false
  180. })
  181. },
  182. cancel() {
  183. this.$emit('close')
  184. },
  185. reset() {
  186. this.form = {
  187. id: null,
  188. studyId: null,
  189. bdbh: null,
  190. bdmc: null,
  191. bdsm: null,
  192. templateId: null,
  193. templateMc: null,
  194. bdnr: null
  195. }
  196. this.resetForm("form")
  197. },
  198. show(row) {
  199. this.reset()
  200. this.$modal.loading()
  201. this.formApprove.id = row.id
  202. this.queryParamsJcgj.formId = row.id
  203. this.queryParamsQmxx.formId = row.id
  204. studyFormPre_info({ id: row.id }).then(response => {
  205. this.form = response.data
  206. this.open = true
  207. this.getQmxxList()
  208. this.getJjcgjList()
  209. this.$modal.closeLoading()
  210. }).finally(() => {
  211. this.$modal.closeLoading()
  212. })
  213. },
  214. approve() {
  215. this.$refs["formApprove"].validate(valid => {
  216. if (valid) {
  217. this.$modal.loading()
  218. studyFormPre_tb(this.formApprove).then(response => {
  219. this.$emit('close')
  220. this.openApprove = false
  221. this.$modal.closeLoading()
  222. }).finally(() => {
  223. this.$modal.closeLoading()
  224. })
  225. }
  226. })
  227. }
  228. }
  229. }
  230. </script>