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

287 lines
9.9 KiB

  1. <template>
  2. <div>
  3. <div class="edit-container" v-if="open">
  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.studyFormApply.fhjj')
  14. }}</el-button>
  15. <el-button type="primary" @click="showApprove('复核通过')">{{ $t('page.business.study.studyFormApply.fhtg')
  16. }}</el-button>
  17. </div>
  18. </div>
  19. <div class="edit-content">
  20. <div class="content-left">
  21. <TemplateTable ref="templateTable" emitName="onApplyFhCallback" @onApplyFhCallback="onApplyFhCallback"
  22. :sn="form.templateSn" :templateData="form" fillType="qc" />
  23. <div class="content-title">
  24. <div class="line"></div>
  25. <div class="subtitle"> {{ $t('page.business.study.studyFormApply.qmxx') }}</div>
  26. </div>
  27. <div class="pal">
  28. <el-table :data="qmxxList" v-loading="loadingQmxx">
  29. <el-table-column :label="$t('page.business.study.studyFormApply.qmr')" align="center" prop="qmrMc"
  30. width="150px" />
  31. <el-table-column :label="$t('page.business.study.studyFormApply.qmyy')" align="center" prop="qmyy"
  32. width="150px" />
  33. <el-table-column :label="$t('page.business.study.studyFormApply.qmsj')" align="center" prop="createTime"
  34. width="150px" />
  35. <el-table-column :label="$t('page.business.study.studyFormApply.bzyy')" align="center" prop="remark"
  36. :show-overflow-tooltip="true" />
  37. </el-table>
  38. </div>
  39. <div class="pal">
  40. <pagination v-show="totalQmxx > 0" :total="totalQmxx" :page.sync="queryParamsQmxx.pageNum"
  41. :limit.sync="queryParamsQmxx.pageSize" @pagination="getQmxxList" />
  42. </div>
  43. </div>
  44. <div class="content-right">
  45. <div class="content-title">
  46. <div class="line"></div>
  47. <div class="subtitle"> {{ $t('page.business.study.studyFormApply.jcgj') }}</div>
  48. </div>
  49. <JcgjList ref="jcgjList" @handleQuery="getJjcgjList" />
  50. <pagination v-show="jcgjTotal > 0" small layout="prev, pager, next" :total="jcgjTotal"
  51. @pagination="getJjcgjList" />
  52. </div>
  53. </div>
  54. </div>
  55. <el-dialog :title="$t(openTitle)" :visible.sync="openApprove" width="500px" append-to-body
  56. :close-on-click-modal="false">
  57. <el-form ref="formApprove" :model="formApprove" :rules="rulesApprove" label-width="120px" v-if="openApprove">
  58. <div class="sbzdtcma"> <input type="text"> <input type="password" show-password > </div>
  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.qmyyMc" 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.studyFormApply.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. <div class="sbzdtcma"> <input type="text"></div>
  97. <el-input type="password" show-password v-model="formApprove.qmrmm" maxlength="20"
  98. :placeholder="$t('form.placeholderInput')" />
  99. </el-form-item>
  100. </el-col>
  101. </el-row>
  102. </el-form>
  103. <div slot="footer" class="dialog-footer">
  104. <el-button type="primary" @click="approve">{{ $t('form.confirm') }}</el-button>
  105. <el-button @click="openApprove = false">{{ $t('form.cancel') }}</el-button>
  106. </div>
  107. </el-dialog>
  108. </div>
  109. </template>
  110. <script>
  111. import { studyFormApply_updateFhyjjl, studyFormApply_updateZdgxjl, studyFormApply_fhtg, studyFormApply_fhjj, studyFormApply_info, studyFormApply_jcgj, studyFormApply_qmxx } from "@/api/business/study/studyFormApply"
  112. import { mapGetters } from 'vuex'
  113. import JcgjList from "@/views/business/comps/common/JcgjList";
  114. import TemplateTable from '@/views/business/comps/template/TemplateTable';
  115. export default {
  116. name: "Fh",
  117. components: { TemplateTable, JcgjList },
  118. data() {
  119. return {
  120. form: {},
  121. qmxxList: [],
  122. totalQmxx: 0,
  123. open: false,
  124. loadingQmxx: true,
  125. queryParamsQmxx: {
  126. formId: null,
  127. pageNum: 1,
  128. pageSize: 10
  129. },
  130. jcgjList: [],
  131. jcgjTotal: 0,
  132. queryParamsJcgj: {
  133. pageNum: 1,
  134. formId: null,
  135. pageSize: 10,
  136. },
  137. openTitle: '',
  138. openApprove: false,
  139. formApprove: {},
  140. rulesApprove: {
  141. qmrmm: [{
  142. required: true,
  143. message: ' ',
  144. trigger: 'blur'
  145. }],
  146. reason: [{
  147. required: true,
  148. message: ' ',
  149. trigger: 'blur'
  150. }],
  151. }
  152. }
  153. },
  154. computed: {
  155. ...mapGetters([
  156. 'nickName', 'name'
  157. ]),
  158. },
  159. created() {
  160. },
  161. methods: {
  162. onApplyFhCallback(data) {
  163. console.log("data:" + JSON.stringify(data))
  164. console.log("formdata:" + JSON.stringify(this.$refs.templateTable.getFilledFormData()))
  165. if (data.type == 'checkbox') {
  166. // {"type":"checkbox","fieldCheckObj":"{\"_methodCode\":{\"checked\":false}}"}
  167. studyFormApply_updateZdgxjl(
  168. {
  169. id: this.form.id,
  170. zdgxjl: data.fieldCheckObj
  171. }
  172. ).then(response => {
  173. })
  174. }
  175. else if (data.type == 'content') {
  176. studyFormApply_updateFhyjjl(
  177. {
  178. id: this.form.id,
  179. content: JSON.stringify(data.newRecord),
  180. fhyjjl: JSON.stringify(data.resourceList)
  181. }
  182. ).then(response => {
  183. })
  184. }
  185. },
  186. getJjcgjList(val) {
  187. this.$modal.loading()
  188. studyFormApply_jcgj(_.merge({}, this.queryParamsJcgj, val)).then(response => {
  189. this.jcgjList = response.rows
  190. this.jcgjTotal = response.total
  191. this.$refs.jcgjList.init(this.jcgjList)
  192. this.$modal.closeLoading()
  193. }).finally(() => {
  194. this.$modal.closeLoading()
  195. })
  196. },
  197. getQmxxList() {
  198. this.loadingQmxx = true
  199. studyFormApply_qmxx(this.queryParamsQmxx).then(response => {
  200. this.qmxxList = response.rows
  201. this.totalQmxx = response.total
  202. this.loadingQmxx = false
  203. })
  204. },
  205. cancel() {
  206. this.$emit('close')
  207. this.open = false
  208. },
  209. reset() {
  210. this.form = {}
  211. this.resetForm("form")
  212. },
  213. show(row) {
  214. this.reset()
  215. this.$modal.loading()
  216. this.queryParamsJcgj.formId = row.id
  217. this.queryParamsQmxx.formId = row.id
  218. studyFormApply_info({ id: row.id }).then(response => {
  219. this.form = response.data
  220. this.getQmxxList()
  221. this.getJjcgjList()
  222. this.open = true
  223. }).finally(() => {
  224. this.$modal.closeLoading()
  225. })
  226. },
  227. async showApprove(qmyy) {
  228. let content = await this.$refs.templateTable.getFormData()
  229. if (content) {
  230. this.openApprove = true
  231. this.resetApprove()
  232. this.formApprove.bdnr = JSON.stringify(content)
  233. this.formApprove.id = this.form.id
  234. this.formApprove.qmyy = qmyy
  235. if (qmyy == '复核通过') {
  236. this.openTitle = 'page.business.study.studyFormApply.fhtg'
  237. this.formApprove.qmyyMc = this.$t('page.business.study.studyFormApply.fhtg')
  238. } else if (qmyy == '复核拒绝') {
  239. this.openTitle = 'page.business.study.studyFormApply.fhjj'
  240. this.formApprove.qmyyMc = this.$t('page.business.study.studyFormApply.fhjj')
  241. }
  242. }
  243. },
  244. resetApprove() {
  245. this.formApprove = {
  246. id: null,
  247. qmyy: '',
  248. qmyyMc: '',
  249. bdnr: '',
  250. remark: '',
  251. reason: '',
  252. qmrmm: '',
  253. }
  254. this.resetForm("formApprove")
  255. },
  256. approve() {
  257. this.$refs["formApprove"].validate(valid => {
  258. if (valid) {
  259. this.$modal.loading()
  260. if (this.formApprove.qmyy == '复核通过') {
  261. studyFormApply_fhtg(this.formApprove).then(response => {
  262. this.openApprove = false
  263. this.$emit('close')
  264. this.open = false
  265. }).finally(() => {
  266. this.$modal.closeLoading()
  267. })
  268. } else if (this.formApprove.qmyy == '复核拒绝') {
  269. this.formApprove.remark = this.formApprove.reason
  270. studyFormApply_fhjj(this.formApprove).then(response => {
  271. this.openApprove = false
  272. this.$emit('close')
  273. this.open = false
  274. }).finally(() => {
  275. this.$modal.closeLoading()
  276. })
  277. }
  278. }
  279. })
  280. }
  281. }
  282. }
  283. </script>