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

277 lines
9.4 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.close') }}</el-button>
  13. <el-button type="primary" v-if="form.bdzt === 5 && form.tbzt === 1" @click="openApprove = true">{{
  14. $t('page.business.study.studyFormFill.tb') }}</el-button>
  15. </div>
  16. </div>
  17. <el-button type="primary" @click="exportExcel">后台导出
  18. </el-button>
  19. <el-button type="primary" @click="dcqbjcgj">{{ $t('page.business.study.studyFormFill.dcqbjcgj') }}
  20. </el-button>
  21. <el-button type="primary" @click="dcqbjcgj">{{ $t('page.business.study.studyFormFill.dcqbjcgj') }}
  22. </el-button>
  23. <el-button type="primary" @click="dclcjcgj">{{ $t('page.business.study.studyFormFill.dclcjcgj') }}
  24. </el-button>
  25. <el-button type="primary" @click="dcbjjcgj">{{ $t('page.business.study.studyFormFill.dcbjjcgj') }}
  26. </el-button>
  27. <el-button type="primary" @click="dcxgjcgj">{{ $t('page.business.study.studyFormFill.dcxgjcgj') }}
  28. </el-button>
  29. <el-button type="primary" @click="dcbhsjgj">{{ $t('page.business.study.studyFormFill.dcbhsjgj') }}
  30. </el-button>
  31. <div class="edit-content ">
  32. <div class="content" style="width: 100%;">
  33. <vue-html2pdf :show-layout="false" pdf-content-width="100%" :float-layout="false"
  34. pdf-orientation="landscape" :enable-download="true" :preview-modal="true" ref="html2Pdf">
  35. <section slot="pdf-content">
  36. <TemplateTable ref="templateTable" :sn="form.templateSn" :templateData="form" fillType="detail" />
  37. <div class="content-title">
  38. <div class="line"></div>
  39. <div class="subtitle"> {{ $t('page.business.study.studyFormFill.qmxx') }}</div>
  40. </div>
  41. <div class="pal">
  42. <el-table :data="qmxxList" v-loading="loadingQmxx">
  43. <el-table-column :label="$t('page.business.study.studyFormFill.qmr')" align="center" prop="qmrMc"
  44. width="150px" />
  45. <el-table-column :label="$t('page.business.study.studyFormFill.qmyy')" align="center"
  46. :prop="$i18n.locale === 'zh_CN' ? 'qmyy' : 'qmyyEn'" width="150px" />
  47. <el-table-column :label="$t('page.business.study.studyFormFill.qmsj')" align="center"
  48. prop="createTime" width="150px" />
  49. <el-table-column :label="$t('page.business.study.studyFormFill.bzyy')" align="center" prop="remark"
  50. :show-overflow-tooltip="true" />
  51. </el-table>
  52. </div>
  53. <!-- <div class="pal">
  54. <pagination v-show="totalQmxx > 0" :total="totalQmxx" :page.sync="queryParamsQmxx.pageNum"
  55. :limit.sync="queryParamsQmxx.pageSize" @pagination="getQmxxList" />
  56. </div> -->
  57. <div class="content-title">
  58. <div class="line"></div>
  59. <div class="subtitle"> {{ $t('page.business.study.studyFormFill.jcgj') }}</div>
  60. </div>
  61. <JcgjList ref="jcgjList" @handleQuery="getJjcgjList" :showXg="true" />
  62. <!--
  63. <pagination v-show="jcgjTotal > 0" small layout="prev, pager, next" :total="jcgjTotal"
  64. @pagination="getJjcgjList" /> -->
  65. </section>
  66. </vue-html2pdf>
  67. </div>
  68. </div>
  69. </div>
  70. <!-- 填报 -->
  71. <el-dialog :title="$t('page.business.study.studyFormFill.cjjl')" :visible.sync="openApprove" width="500px"
  72. append-to-body :close-on-click-modal="false">
  73. <el-form ref="formApprove" :model="formApprove" :rules="rulesApprove" label-width="120px">
  74. <el-alert :title="$t('page.business.study.studyFormFill.ts')" :closable="false" type="success">
  75. </el-alert>
  76. <el-row>
  77. <el-col :span="24">
  78. <el-form-item :label="$t('form.qmyy')" prop="qmyy">
  79. <el-input type="text" :value="formApprove.qmyy" maxlength="50" disabled
  80. :placeholder="$t('form.placeholderInput')" />
  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.remark')" prop="remark">
  87. <el-input type="textarea" v-model="formApprove.remark" :rows="5" maxlength="500"
  88. :placeholder="$t('form.placeholderInput')">
  89. </el-input>
  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.signer')">
  96. <el-input type="text" v-model="nickName" maxlength="50" disabled
  97. :placeholder="$t('form.placeholderInput')" />
  98. </el-form-item>
  99. </el-col>
  100. </el-row>
  101. <el-row>
  102. <el-col :span="24">
  103. <el-form-item :label="$t('form.password')" prop="qmrmm">
  104. <el-input type="password" v-model="formApprove.qmrmm" maxlength="20"
  105. :placeholder="$t('form.placeholderInput')" />
  106. </el-form-item>
  107. </el-col>
  108. </el-row>
  109. </el-form>
  110. <div slot="footer" class="dialog-footer">
  111. <el-button type="primary" @click="approve">{{ $t('form.confirm') }}</el-button>
  112. <el-button @click="openApprove = false">{{ $t('form.cancel') }}</el-button>
  113. </div>
  114. </el-dialog>
  115. </div>
  116. </template>
  117. <script>
  118. import { studyFormFill_tb, studyFormFill_info, studyFormFill_jcgj, studyFormFill_qmxx, studyFormFill_exportDetail } from "@/api/business/study/studyFormFill"
  119. import { mapGetters } from 'vuex'
  120. import JcgjList from "@/views/business/comps/common/JcgjList";
  121. import TemplateTable from '@/views/business/comps/template/TemplateTable';
  122. import VueHtml2pdf from 'vue-html2pdf'
  123. export default {
  124. name: "Xq",
  125. components: { JcgjList, TemplateTable, VueHtml2pdf },
  126. data() {
  127. return {
  128. openApprove: false,
  129. formApprove: {
  130. id: null,
  131. qmyy: this.$t('page.business.study.studyFormFill.cjjl'),
  132. remark: '',
  133. qmrmm: '',
  134. },
  135. rulesApprove: {
  136. qmrmm: [{
  137. required: true,
  138. message: ' ',
  139. trigger: 'blur'
  140. }]
  141. },
  142. qmxxList: [],
  143. totalQmxx: 0,
  144. loadingQmxx: true,
  145. queryParamsQmxx: {
  146. formId: null,
  147. pageNum: 1,
  148. pageSize: 9999
  149. },
  150. open: false,
  151. showIndex: 1,
  152. form: {},
  153. rules: {
  154. bdmc: [{
  155. required: true,
  156. message: ' ',
  157. trigger: 'blur'
  158. }],
  159. templateId: [{
  160. required: true,
  161. message: ' ',
  162. trigger: 'blur'
  163. }]
  164. },
  165. jcgjTotal: 0,
  166. jcgjList: [],
  167. queryParamsJcgj: {
  168. pageNum: 1,
  169. formId: null,
  170. pageSize: 9999,
  171. }
  172. }
  173. },
  174. computed: {
  175. ...mapGetters([
  176. 'nickName', 'name'
  177. ]),
  178. },
  179. created() {
  180. },
  181. methods: {
  182. exportExcel() {
  183. this.$modal.loading()
  184. studyFormFill_exportDetail(this.queryParamsJcgj).then(response => {
  185. window.open(this.baseUrl + response.msg)
  186. this.$modal.closeLoading()
  187. }).finally(() => {
  188. this.$modal.closeLoading()
  189. })
  190. },
  191. dcqbjcgj() {
  192. this.$refs.html2Pdf.generatePdf()
  193. },
  194. dclcjcgj() {
  195. this.$refs.html2Pdf.generatePdf()
  196. },
  197. dcbjjcgj() {
  198. this.$refs.html2Pdf.generatePdf()
  199. },
  200. dcxgjcgj() {
  201. this.$refs.html2Pdf.generatePdf()
  202. },
  203. dcbhsjgj() {
  204. this.$refs.html2Pdf.generatePdf()
  205. },
  206. getJjcgjList(val) {
  207. this.$modal.loading()
  208. studyFormFill_jcgj(_.merge({}, this.queryParamsJcgj, val)).then(response => {
  209. this.jcgjList = response.rows
  210. this.jcgjTotal = response.total
  211. this.$refs.jcgjList.init(this.jcgjList)
  212. this.$modal.closeLoading()
  213. }).finally(() => {
  214. this.$modal.closeLoading()
  215. })
  216. },
  217. getQmxxList() {
  218. this.loadingQmxx = true
  219. studyFormFill_qmxx(this.queryParamsQmxx).then(response => {
  220. this.qmxxList = response.rows
  221. this.totalQmxx = response.total
  222. this.loadingQmxx = false
  223. })
  224. },
  225. cancel() {
  226. this.$emit('close')
  227. },
  228. reset() {
  229. this.form = {
  230. id: null,
  231. studyId: null,
  232. bdbh: null,
  233. bdmc: null,
  234. bdsm: null,
  235. templateId: null,
  236. templateMc: null,
  237. bdnr: null
  238. }
  239. this.resetForm("form")
  240. },
  241. show(row) {
  242. this.reset()
  243. this.$modal.loading()
  244. debugger
  245. this.formApprove.id = row.id
  246. this.queryParamsJcgj.formId = row.id
  247. this.queryParamsQmxx.formId = row.id
  248. studyFormFill_info({ id: row.id }).then(response => {
  249. this.form = response.data
  250. this.getQmxxList()
  251. this.getJjcgjList()
  252. this.$modal.closeLoading()
  253. }).finally(() => {
  254. this.$modal.closeLoading()
  255. })
  256. },
  257. approve() {
  258. this.$refs["formApprove"].validate(valid => {
  259. if (valid) {
  260. this.$modal.loading()
  261. studyFormFill_tb(this.formApprove).then(response => {
  262. this.$emit('close')
  263. this.openApprove = false
  264. this.$modal.closeLoading()
  265. }).finally(() => {
  266. this.$modal.closeLoading()
  267. })
  268. }
  269. })
  270. }
  271. }
  272. }
  273. </script>