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

288 lines
10 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" :page.sync="queryParamsJcgj.pageNum"
  52. :limit.sync="queryParamsJcgj.pageSize"/>
  53. </div>
  54. </div>
  55. </div>
  56. <el-dialog :title="$t(openTitle)" :visible.sync="openApprove" width="500px" append-to-body
  57. :close-on-click-modal="false">
  58. <el-form ref="formApprove" :model="formApprove" :rules="rulesApprove" label-width="120px" v-if="openApprove">
  59. <div class="sbzdtcma"> <input type="text"> <input type="password" show-password > </div>
  60. <el-row>
  61. <el-col :span="24">
  62. <el-form-item :label="$t('form.qmyy')" prop="qmyy">
  63. <el-input type="text" :value="formApprove.qmyyMc" maxlength="50" disabled
  64. :placeholder="$t('form.placeholderInput')" />
  65. </el-form-item>
  66. </el-col>
  67. </el-row>
  68. <el-row v-if="formApprove.qmyy == '复核拒绝'">
  69. <el-col :span="24">
  70. <el-form-item :label="$t('page.business.study.studyFormApply.reason')" prop="reason">
  71. <el-input type="textarea" v-model="formApprove.reason" :rows="5" maxlength="500"
  72. :placeholder="$t('form.placeholderInput')">
  73. </el-input>
  74. </el-form-item>
  75. </el-col>
  76. </el-row>
  77. <el-row v-else>
  78. <el-col :span="24">
  79. <el-form-item :label="$t('form.remark')">
  80. <el-input type="textarea" v-model="formApprove.remark" :rows="5" maxlength="500"
  81. :placeholder="$t('form.placeholderInput')">
  82. </el-input>
  83. </el-form-item>
  84. </el-col>
  85. </el-row>
  86. <el-row>
  87. <el-col :span="24">
  88. <el-form-item :label="$t('form.signer')">
  89. <el-input type="text" v-model="nickName" maxlength="50" disabled
  90. :placeholder="$t('form.placeholderInput')" />
  91. </el-form-item>
  92. </el-col>
  93. </el-row>
  94. <el-row>
  95. <el-col :span="24">
  96. <el-form-item :label="$t('form.password')" prop="qmrmm">
  97. <div class="sbzdtcma"> <input type="text"></div>
  98. <el-input type="password" show-password v-model="formApprove.qmrmm" maxlength="20"
  99. :placeholder="$t('form.placeholderInput')" />
  100. </el-form-item>
  101. </el-col>
  102. </el-row>
  103. </el-form>
  104. <div slot="footer" class="dialog-footer">
  105. <el-button type="primary" @click="approve">{{ $t('form.confirm') }}</el-button>
  106. <el-button @click="openApprove = false">{{ $t('form.cancel') }}</el-button>
  107. </div>
  108. </el-dialog>
  109. </div>
  110. </template>
  111. <script>
  112. import { studyFormApply_updateFhyjjl, studyFormApply_updateZdgxjl, studyFormApply_fhtg, studyFormApply_fhjj, studyFormApply_info, studyFormApply_jcgj, studyFormApply_qmxx } from "@/api/business/study/studyFormApply"
  113. import { mapGetters } from 'vuex'
  114. import JcgjList from "@/views/business/comps/common/JcgjList";
  115. import TemplateTable from '@/views/business/comps/template/TemplateTable';
  116. export default {
  117. name: "Fh",
  118. components: { TemplateTable, JcgjList },
  119. data() {
  120. return {
  121. form: {},
  122. qmxxList: [],
  123. totalQmxx: 0,
  124. open: false,
  125. loadingQmxx: true,
  126. queryParamsQmxx: {
  127. formId: null,
  128. pageNum: 1,
  129. pageSize: 10
  130. },
  131. jcgjList: [],
  132. jcgjTotal: 0,
  133. queryParamsJcgj: {
  134. pageNum: 1,
  135. formId: null,
  136. pageSize: 10,
  137. },
  138. openTitle: '',
  139. openApprove: false,
  140. formApprove: {},
  141. rulesApprove: {
  142. qmrmm: [{
  143. required: true,
  144. message: ' ',
  145. trigger: 'blur'
  146. }],
  147. reason: [{
  148. required: true,
  149. message: ' ',
  150. trigger: 'blur'
  151. }],
  152. }
  153. }
  154. },
  155. computed: {
  156. ...mapGetters([
  157. 'nickName', 'name'
  158. ]),
  159. },
  160. created() {
  161. },
  162. methods: {
  163. onApplyFhCallback(data) {
  164. console.log("data:" + JSON.stringify(data))
  165. console.log("formdata:" + JSON.stringify(this.$refs.templateTable.getFilledFormData()))
  166. if (data.type == 'checkbox') {
  167. // {"type":"checkbox","fieldCheckObj":"{\"_methodCode\":{\"checked\":false}}"}
  168. studyFormApply_updateZdgxjl(
  169. {
  170. id: this.form.id,
  171. zdgxjl: data.fieldCheckObj
  172. }
  173. ).then(response => {
  174. })
  175. }
  176. else if (data.type == 'content') {
  177. studyFormApply_updateFhyjjl(
  178. {
  179. id: this.form.id,
  180. content: JSON.stringify(data.newRecord),
  181. fhyjjl: JSON.stringify(data.resourceList)
  182. }
  183. ).then(response => {
  184. })
  185. }
  186. },
  187. getJjcgjList(val) {
  188. this.$modal.loading()
  189. studyFormApply_jcgj(_.merge({}, this.queryParamsJcgj, val)).then(response => {
  190. this.jcgjList = response.rows
  191. this.jcgjTotal = response.total
  192. this.$refs.jcgjList.init(this.jcgjList)
  193. this.$modal.closeLoading()
  194. }).finally(() => {
  195. this.$modal.closeLoading()
  196. })
  197. },
  198. getQmxxList() {
  199. this.loadingQmxx = true
  200. studyFormApply_qmxx(this.queryParamsQmxx).then(response => {
  201. this.qmxxList = response.rows
  202. this.totalQmxx = response.total
  203. this.loadingQmxx = false
  204. })
  205. },
  206. cancel() {
  207. this.$emit('close')
  208. this.open = false
  209. },
  210. reset() {
  211. this.form = {}
  212. this.resetForm("form")
  213. },
  214. show(row) {
  215. this.reset()
  216. this.$modal.loading()
  217. this.queryParamsJcgj.formId = row.id
  218. this.queryParamsQmxx.formId = row.id
  219. studyFormApply_info({ id: row.id }).then(response => {
  220. this.form = response.data
  221. this.getQmxxList()
  222. this.getJjcgjList()
  223. this.open = true
  224. }).finally(() => {
  225. this.$modal.closeLoading()
  226. })
  227. },
  228. async showApprove(qmyy) {
  229. let content = await this.$refs.templateTable.getFormData()
  230. if (content) {
  231. this.openApprove = true
  232. this.resetApprove()
  233. this.formApprove.bdnr = JSON.stringify(content)
  234. this.formApprove.id = this.form.id
  235. this.formApprove.qmyy = qmyy
  236. if (qmyy == '复核通过') {
  237. this.openTitle = 'page.business.study.studyFormApply.fhtg'
  238. this.formApprove.qmyyMc = this.$t('page.business.study.studyFormApply.fhtg')
  239. } else if (qmyy == '复核拒绝') {
  240. this.openTitle = 'page.business.study.studyFormApply.fhjj'
  241. this.formApprove.qmyyMc = this.$t('page.business.study.studyFormApply.fhjj')
  242. }
  243. }
  244. },
  245. resetApprove() {
  246. this.formApprove = {
  247. id: null,
  248. qmyy: '',
  249. qmyyMc: '',
  250. bdnr: '',
  251. remark: '',
  252. reason: '',
  253. qmrmm: '',
  254. }
  255. this.resetForm("formApprove")
  256. },
  257. approve() {
  258. this.$refs["formApprove"].validate(valid => {
  259. if (valid) {
  260. this.$modal.loading()
  261. if (this.formApprove.qmyy == '复核通过') {
  262. studyFormApply_fhtg(this.formApprove).then(response => {
  263. this.openApprove = false
  264. this.$emit('close')
  265. this.open = false
  266. }).finally(() => {
  267. this.$modal.closeLoading()
  268. })
  269. } else if (this.formApprove.qmyy == '复核拒绝') {
  270. this.formApprove.remark = this.formApprove.reason
  271. studyFormApply_fhjj(this.formApprove).then(response => {
  272. this.openApprove = false
  273. this.$emit('close')
  274. this.open = false
  275. }).finally(() => {
  276. this.$modal.closeLoading()
  277. })
  278. }
  279. }
  280. })
  281. }
  282. }
  283. }
  284. </script>