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

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