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

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