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

247 lines
8.0 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" v-if="form.bdzt === 5 && (fromNon || isMatchSubject)" @click="openApprove = true">{{
  14. $t('page.business.study.studyFormPre.tb') }}</el-button>
  15. </div>
  16. </div>
  17. <div class="edit-content ">
  18. <div class="content-left">
  19. <TemplateTable ref="templateTable" :sn="form.templateSn" :templateData="form" fillType="audit" />
  20. <div class="content-title">
  21. <div class="line"></div>
  22. <div class="subtitle"> {{ $t('page.business.study.studyFormPre.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.studyFormPre.qmr')" align="center" prop="qmrMc"
  27. width="150px" />
  28. <el-table-column :label="$t('page.business.study.studyFormPre.qmyy')" align="center" prop="qmyy"
  29. width="150px" />
  30. <el-table-column :label="$t('page.business.study.studyFormPre.qmsj')" align="center" prop="createTime"
  31. width="150px" />
  32. <el-table-column :label="$t('page.business.study.studyFormPre.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.studyFormPre.jcgj') }}</div>
  45. </div>
  46. <JcgjList ref="jcgjList" @handleQuery="getJjcgjList" :showBj="false" :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. <!-- 填报 -->
  53. <el-dialog :title="$t('page.business.study.studyFormPre.cjjl')" :visible.sync="openApprove" width="500px"
  54. append-to-body :close-on-click-modal="false">
  55. <el-form ref="formApprove" :model="formApprove" :rules="rulesApprove" label-width="120px">
  56. <el-alert :title="$t('page.business.study.studyFormPre.ts')" :closable="false" type="success">
  57. </el-alert>
  58. <el-row>
  59. <el-col :span="24">
  60. <el-form-item :label="$t('form.qmyy')" prop="qmyy">
  61. <el-input type="text" :value="formApprove.qmyy" maxlength="50" disabled
  62. :placeholder="$t('form.placeholderInput')" />
  63. </el-form-item>
  64. </el-col>
  65. </el-row>
  66. <el-row>
  67. <el-col :span="24">
  68. <el-form-item :label="$t('form.remark')" prop="remark">
  69. <el-input type="textarea" v-model="formApprove.remark" :rows="5" maxlength="500"
  70. :placeholder="$t('form.placeholderInput')">
  71. </el-input>
  72. </el-form-item>
  73. </el-col>
  74. </el-row>
  75. <el-row>
  76. <el-col :span="24">
  77. <el-form-item :label="$t('form.signer')">
  78. <el-input type="text" v-model="nickName" maxlength="50" disabled
  79. :placeholder="$t('form.placeholderInput')" />
  80. </el-form-item>
  81. </el-col>
  82. </el-row>
  83. <el-row>
  84. <el-col :span="24">
  85. <el-form-item :label="$t('form.password')" prop="qmrmm">
  86. <el-input type="password" v-model="formApprove.qmrmm" maxlength="20"
  87. :placeholder="$t('form.placeholderInput')" />
  88. </el-form-item>
  89. </el-col>
  90. </el-row>
  91. </el-form>
  92. <div slot="footer" class="dialog-footer">
  93. <el-button type="primary" @click="approve">{{ $t('form.confirm') }}</el-button>
  94. <el-button @click="openApprove = false">{{ $t('form.cancel') }}</el-button>
  95. </div>
  96. </el-dialog>
  97. </div>
  98. </template>
  99. <script>
  100. import { studySubject_isMatchSubject } from "@/api/business/study/studySubject"
  101. import { studyFormPre_tb, studyFormPre_info, studyFormPre_jcgj, studyFormPre_qmxx } from "@/api/business/study/studyFormPre"
  102. import { mapGetters } from 'vuex'
  103. import JcgjList from "@/views/business/comps/common/JcgjList";
  104. import TemplateTable from '@/views/business/comps/template/TemplateTable';
  105. export default {
  106. name: "Xq",
  107. components: { JcgjList, TemplateTable },
  108. data() {
  109. return {
  110. isMatchSubject: false,
  111. openApprove: false,
  112. formApprove: {
  113. id: null,
  114. qmyy: '创建记录',
  115. remark: '',
  116. qmrmm: '',
  117. },
  118. rulesApprove: {
  119. qmrmm: [{
  120. required: true,
  121. message: ' ',
  122. trigger: 'blur'
  123. }]
  124. },
  125. qmxxList: [],
  126. totalQmxx: 0,
  127. loadingQmxx: true,
  128. queryParamsQmxx: {
  129. formId: null,
  130. pageNum: 1,
  131. pageSize: 10
  132. },
  133. open: false,
  134. showIndex: 1,
  135. form: {},
  136. rules: {
  137. bdmc: [{
  138. required: true,
  139. message: ' ',
  140. trigger: 'blur'
  141. }],
  142. templateId: [{
  143. required: true,
  144. message: ' ',
  145. trigger: 'blur'
  146. }]
  147. },
  148. jcgjTotal: 0,
  149. jcgjList: [],
  150. queryParamsJcgj: {
  151. pageNum: 1,
  152. formId: null,
  153. pageSize: 10,
  154. },
  155. fromNon: false//是否是从非试验+麻精药
  156. }
  157. },
  158. computed: {
  159. ...mapGetters([
  160. 'nickName',
  161. 'id'
  162. ]),
  163. },
  164. created() {
  165. },
  166. methods: {
  167. getIsMatchSubject() {
  168. studySubject_isMatchSubject({ studySubjectId: this.form.studySubjectId }).then(response => {
  169. this.isMatchSubject = response.data
  170. })
  171. },
  172. getJjcgjList(val) {
  173. studyFormPre_jcgj(_.merge({}, this.queryParamsJcgj, val)).then(response => {
  174. this.jcgjList = response.rows
  175. this.jcgjTotal = response.total
  176. this.$refs.jcgjList.init(this.jcgjList)
  177. })
  178. },
  179. getQmxxList() {
  180. this.loadingQmxx = true
  181. studyFormPre_qmxx(this.queryParamsQmxx).then(response => {
  182. this.qmxxList = response.rows
  183. this.totalQmxx = response.total
  184. this.loadingQmxx = false
  185. })
  186. },
  187. cancel() {
  188. this.$emit('close')
  189. },
  190. reset() {
  191. this.form = {
  192. id: null,
  193. studyId: null,
  194. bdbh: null,
  195. bdmc: null,
  196. bdsm: null,
  197. templateId: null,
  198. templateMc: null,
  199. bdnr: null
  200. }
  201. this.resetForm("form")
  202. },
  203. show(row, fromNon) {
  204. this.fromNon = fromNon
  205. this.reset()
  206. this.$modal.loading()
  207. this.formApprove.id = row.id
  208. this.queryParamsJcgj.formId = row.id
  209. this.queryParamsQmxx.formId = row.id
  210. studyFormPre_info({ id: row.id }).then(response => {
  211. this.form = response.data
  212. this.open = true
  213. this.getQmxxList()
  214. this.getJjcgjList()
  215. this.getIsMatchSubject()
  216. }).finally(() => {
  217. this.$modal.closeLoading()
  218. })
  219. },
  220. approve() {
  221. this.$refs["formApprove"].validate(valid => {
  222. if (valid) {
  223. this.$modal.loading()
  224. studyFormPre_tb(this.formApprove).then(response => {
  225. let key = 'formFillReturnUrl' + response.data.studyId
  226. localStorage.setItem(key, JSON.stringify({
  227. url: this.$route.fullPath
  228. }))
  229. this.$tab.openPage(response.data.bdmc, '/study/formFillBj/' + response.data.id + "/10/" + key+'/'+response.data.studyId)
  230. this.$emit('close')
  231. this.openApprove = false
  232. this.$modal.closeLoading()
  233. }).finally(() => {
  234. this.$modal.closeLoading()
  235. })
  236. }
  237. })
  238. }
  239. }
  240. }
  241. </script>