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

221 lines
7.2 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.cancel') }}</el-button>
  13. <el-button type="primary" @click="showApprove">{{ $t('page.business.study.studyFormPlan.shenyue')
  14. }}</el-button>
  15. </div>
  16. </div>
  17. <div class="edit-content">
  18. <div class="content-left">
  19. <TemplateTable ref="templateTable" :sn="form.templateSn" fillType="review" :templateData="form" />
  20. <div class="content-title">
  21. <div class="line"></div>
  22. <div class="subtitle"> {{ $t('page.business.study.studyFormPlan.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.studyFormPlan.qmr')" align="center" prop="qmrMc"
  27. width="150px" />
  28. <el-table-column :label="$t('page.business.study.studyFormPlan.qmyy')" align="center" prop="qmyy"
  29. width="150px" />
  30. <el-table-column :label="$t('page.business.study.studyFormPlan.qmsj')" align="center" prop="createTime"
  31. width="150px" />
  32. <el-table-column :label="$t('page.business.study.studyFormPlan.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.studyFormPlan.jcgj') }}</div>
  45. </div>
  46. <JcgjList ref="jcgjList" @handleQuery="getJjcgjList" :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. <el-dialog :title="$t('page.business.study.studyFormPlan.shenyue')" :visible.sync="openApprove" width="500px"
  53. append-to-body :close-on-click-modal="false">
  54. <el-form ref="formApprove" :model="formApprove" :rules="rulesApprove" label-width="120px">
  55. <div class="sbzdtcma"> <input type="text"> <input type="password"> </div>
  56. <el-row>
  57. <el-col :span="24">
  58. <el-form-item :label="$t('form.qmyy')" prop="qmyy">
  59. <el-input type="text" :value="formApprove.qmyy" maxlength="50" disabled
  60. :placeholder="$t('form.placeholderInput')" />
  61. </el-form-item>
  62. </el-col>
  63. </el-row>
  64. <el-row>
  65. <el-col :span="24">
  66. <el-form-item :label="$t('form.remark')" prop="remark">
  67. <el-input type="textarea" v-model="formApprove.remark" :rows="5" maxlength="500"
  68. :placeholder="$t('form.placeholderInput')">
  69. </el-input>
  70. </el-form-item>
  71. </el-col>
  72. </el-row>
  73. <el-row>
  74. <el-col :span="24">
  75. <el-form-item :label="$t('form.signer')">
  76. <el-input type="text" v-model="nickName" maxlength="50" disabled
  77. :placeholder="$t('form.placeholderInput')" />
  78. </el-form-item>
  79. </el-col>
  80. </el-row>
  81. <el-row>
  82. <el-col :span="24">
  83. <el-form-item :label="$t('form.password')" prop="qmrmm">
  84. <el-input type="password" v-model="formApprove.qmrmm" maxlength="20"
  85. :placeholder="$t('form.placeholderInput')" />
  86. </el-form-item>
  87. </el-col>
  88. </el-row>
  89. </el-form>
  90. <div slot="footer" class="dialog-footer">
  91. <el-button type="primary" @click="approve">{{ $t('form.confirm') }}</el-button>
  92. <el-button @click="openApprove = false">{{ $t('form.cancel') }}</el-button>
  93. </div>
  94. </el-dialog>
  95. </div>
  96. </template>
  97. <script>
  98. import { studyFormPlan_sy, studyFormPlan_info, studyFormPlan_jcgj, studyFormPlan_qmxx } from "@/api/business/study/studyFormPlan"
  99. import { mapGetters } from 'vuex'
  100. import JcgjList from "@/views/business/comps/common/JcgjList";
  101. import TemplateTable from '@/views/business/comps/template/TemplateTable';
  102. export default {
  103. name: "Sy",
  104. components: { TemplateTable, JcgjList },
  105. data() {
  106. return {
  107. form: {},
  108. qmxxList: [],
  109. totalQmxx: 0,
  110. loadingQmxx: true,
  111. queryParamsQmxx: {
  112. formId: null,
  113. pageNum: 1,
  114. pageSize: 10
  115. },
  116. jcgjList: [],
  117. jcgjTotal: 0,
  118. queryParamsJcgj: {
  119. pageNum: 1,
  120. formId: null,
  121. pageSize: 10,
  122. },
  123. openApprove: false,
  124. formApprove: {},
  125. rulesApprove: {
  126. qmrmm: [{
  127. required: true,
  128. message: ' ',
  129. trigger: 'blur'
  130. }]
  131. }
  132. }
  133. },
  134. computed: {
  135. ...mapGetters([
  136. 'nickName', 'name'
  137. ]),
  138. },
  139. created() {
  140. },
  141. methods: {
  142. getJjcgjList(val) {
  143. this.$modal.loading()
  144. studyFormPlan_jcgj(_.merge({}, this.queryParamsJcgj, val)).then(response => {
  145. this.jcgjList = response.rows
  146. this.jcgjTotal = response.total
  147. this.$refs.jcgjList.init(this.jcgjList)
  148. this.$modal.closeLoading()
  149. }).finally(() => {
  150. this.$modal.closeLoading()
  151. })
  152. },
  153. getQmxxList() {
  154. this.loadingQmxx = true
  155. studyFormPlan_qmxx(this.queryParamsQmxx).then(response => {
  156. this.qmxxList = response.rows
  157. this.totalQmxx = response.total
  158. this.loadingQmxx = false
  159. })
  160. },
  161. cancel() {
  162. this.$emit('close')
  163. },
  164. reset() {
  165. this.form = {}
  166. this.resetForm("form")
  167. },
  168. show(row) {
  169. this.reset()
  170. this.$modal.loading()
  171. this.queryParamsJcgj.formId = row.id
  172. this.queryParamsQmxx.formId = row.id
  173. studyFormPlan_info({ id: row.id }).then(response => {
  174. this.form = response.data
  175. this.getQmxxList()
  176. this.getJjcgjList()
  177. this.$modal.closeLoading()
  178. }).finally(() => {
  179. this.$modal.closeLoading()
  180. })
  181. },
  182. async showApprove() {
  183. let content = await this.$refs.templateTable.getFormData()
  184. if (content) {
  185. this.openApprove = true
  186. this.resetApprove()
  187. this.formApprove.bdnr = JSON.stringify(content)
  188. this.formApprove.id = this.form.id
  189. }
  190. },
  191. resetApprove() {
  192. this.formApprove = {
  193. id: null,
  194. qmyy: '已审阅',
  195. remark: '',
  196. qmrmm: '',
  197. }
  198. this.resetForm("formApprove")
  199. },
  200. approve() {
  201. this.$refs["formApprove"].validate(valid => {
  202. if (valid) {
  203. this.$modal.loading()
  204. studyFormPlan_sy(this.formApprove).then(response => {
  205. this.openApprove = false
  206. this.$modal.closeLoading()
  207. this.$emit('close')
  208. }).finally(() => {
  209. this.$modal.closeLoading()
  210. })
  211. }
  212. })
  213. }
  214. }
  215. }
  216. </script>