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

304 lines
11 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="danger" @click="showApprove('复核拒绝')">{{ $t('page.business.study.studyFormFill.fhjj')
  14. }}</el-button>
  15. <el-button type="primary" @click="showApprove('复核通过')">{{ $t('page.business.study.studyFormFill.fhtg')
  16. }}</el-button>
  17. <el-button type="primary" @click="showApprove('通过')">{{ $t('page.business.study.studyFormFill.tongguo')
  18. }}</el-button>
  19. </div>
  20. </div>
  21. <div class="edit-content">
  22. <div class="content-left">
  23. <TemplateTable emitName="onFhCallback" @onFhCallback="onFhCallback" ref="templateTable" :sn="form.templateSn"
  24. :templateData="form" fillType="qc" />
  25. <div class="content-title">
  26. <div class="line"></div>
  27. <div class="subtitle"> {{ $t('page.business.study.studyFormFill.qmxx') }}</div>
  28. </div>
  29. <div class="pal">
  30. <el-table :data="qmxxList" v-loading="loadingQmxx">
  31. <el-table-column :label="$t('page.business.study.studyFormFill.qmr')" align="center" prop="qmrMc"
  32. width="150px" />
  33. <el-table-column :label="$t('page.business.study.studyFormFill.qmyy')" align="center" prop="qmyy"
  34. width="150px" />
  35. <el-table-column :label="$t('page.business.study.studyFormFill.qmsj')" align="center" prop="createTime"
  36. width="150px" />
  37. <el-table-column :label="$t('page.business.study.studyFormFill.bzyy')" align="center" prop="remark"
  38. :show-overflow-tooltip="true" />
  39. </el-table>
  40. </div>
  41. <div class="pal">
  42. <pagination v-show="totalQmxx > 0" :total="totalQmxx" :page.sync="queryParamsQmxx.pageNum"
  43. :limit.sync="queryParamsQmxx.pageSize" @pagination="getQmxxList" />
  44. </div>
  45. </div>
  46. <div class="content-right">
  47. <div class="content-title">
  48. <div class="line"></div>
  49. <div class="subtitle"> {{ $t('page.business.study.studyFormFill.jcgj') }}</div>
  50. </div>
  51. <JcgjList ref="jcgjList" @handleQuery="getJjcgjList" />
  52. <pagination v-show="jcgjTotal > 0" small layout="prev, pager, next" :total="jcgjTotal"
  53. @pagination="getJjcgjList" />
  54. </div>
  55. </div>
  56. </div>
  57. <el-dialog :title="$t(openTitle)" :visible.sync="openApprove" width="500px" append-to-body
  58. :close-on-click-modal="false">
  59. <el-form ref="formApprove" :model="formApprove" :rules="rulesApprove" label-width="120px">
  60. <div class="sbzdtcma"> <input type="text"> <input type="password"> </div>
  61. <el-row>
  62. <el-col :span="24">
  63. <el-form-item :label="$t('form.qmyy')" prop="qmyy">
  64. <el-input type="text" :value="formApprove.qmyy" maxlength="50" disabled
  65. :placeholder="$t('form.placeholderInput')" />
  66. </el-form-item>
  67. </el-col>
  68. </el-row>
  69. <el-row v-if="formApprove.qmyy == '复核拒绝'">
  70. <el-col :span="24">
  71. <el-form-item :label="$t('page.business.study.studyFormFill.reason')" prop="reason">
  72. <el-input type="textarea" v-model="formApprove.reason" :rows="5" maxlength="500"
  73. :placeholder="$t('form.placeholderInput')">
  74. </el-input>
  75. </el-form-item>
  76. </el-col>
  77. </el-row>
  78. <el-row v-else>
  79. <el-col :span="24">
  80. <el-form-item :label="$t('form.remark')">
  81. <el-input type="textarea" v-model="formApprove.remark" :rows="5" maxlength="500"
  82. :placeholder="$t('form.placeholderInput')">
  83. </el-input>
  84. </el-form-item>
  85. </el-col>
  86. </el-row>
  87. <el-row>
  88. <el-col :span="24">
  89. <el-form-item :label="$t('form.signer')">
  90. <el-input type="text" v-model="nickName" maxlength="50" disabled
  91. :placeholder="$t('form.placeholderInput')" />
  92. </el-form-item>
  93. </el-col>
  94. </el-row>
  95. <el-row>
  96. <el-col :span="24">
  97. <el-form-item :label="$t('form.password')" prop="qmrmm">
  98. <el-input type="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 { studyFormFill_fhtg, studyFormFill_fhjj,studyFormFill_updateZdgxjl,studyFormFill_updateFhyjjl, studyFormFill_tg, studyFormFill_info, studyFormFill_jcgj, studyFormFill_qmxx } from "@/api/business/study/studyFormFill"
  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. 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. onFhCallback(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. studyFormFill_updateZdgxjl(
  168. {
  169. id:this.form.id,
  170. zdxgjl:JSON.stringify(data.fieldCheckObj)
  171. }
  172. ).then(response => {
  173. })
  174. }
  175. else if (data.type == 'content') {
  176. // {"type":"content","newRecord":{"userNameCn":"谭飞","userNameEn":"tf","key":"_versionNum","field":"试验基本信息-版本号","title":"复核意见","time":"2026-01-14 20:23:30","content":"qweqe"},"resourceList":[{"userNameCn":"谭飞","userNameEn":"tf","key":"_versionNum","field":"试验基本信息-版本号","title":"复核意见","time":"2026-01-14 20:23:30","content":"qweqe"},{"userNameCn":"谭飞","userNameEn":"tf","key":"_methodCode","field":"试验基本信息-方法编号","title":"复核意见","time":"2026-01-14 20:23:28","content":"qweqw"}]}
  177. studyFormFill_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. else if (data.type == 'reply') {
  187. // {"type":"reply","newRecord":{"userNameCn":"谭飞","userNameEn":"tf","key":"_versionNum","field":"试验基本信息-版本号","title":"复核意见","time":"2026-01-14 20:23:30","content":"qweqe"},"resourceList":[{"userNameCn":"谭飞","userNameEn":"tf","key":"_versionNum","field":"试验基本信息-版本号","title":"复核意见","time":"2026-01-14 20:23:30","content":"qweqe"},{"userNameCn":"谭飞","userNameEn":"tf","key":"_methodCode","field":"试验基本信息-方法编号","title":"复核意见","time":"2026-01-14 20:23:28","content":"qweqw"}]}
  188. studyFormFill_updateFhyjjl(
  189. {
  190. id:this.form.id,
  191. replay:JSON.stringify(data.newRecord),
  192. fhyjjl:JSON.stringify(data.resourceList)
  193. }
  194. ).then(response => {
  195. })
  196. }
  197. },
  198. getJjcgjList(val) {
  199. this.$modal.loading()
  200. studyFormFill_jcgj(_.merge({}, this.queryParamsJcgj, val)).then(response => {
  201. this.jcgjList = response.rows
  202. this.jcgjTotal = response.total
  203. this.$refs.jcgjList.init(this.jcgjList)
  204. this.$modal.closeLoading()
  205. }).finally(() => {
  206. this.$modal.closeLoading()
  207. })
  208. },
  209. getQmxxList() {
  210. this.loadingQmxx = true
  211. studyFormFill_qmxx(this.queryParamsQmxx).then(response => {
  212. this.qmxxList = response.rows
  213. this.totalQmxx = response.total
  214. this.loadingQmxx = false
  215. })
  216. },
  217. cancel() {
  218. this.$emit('close')
  219. },
  220. reset() {
  221. this.form = {}
  222. this.resetForm("form")
  223. },
  224. show(row) {
  225. this.reset()
  226. this.$modal.loading()
  227. this.queryParamsJcgj.formId = row.id
  228. this.queryParamsQmxx.formId = row.id
  229. studyFormFill_info({ id: row.id }).then(response => {
  230. this.form = response.data
  231. this.getQmxxList()
  232. this.getJjcgjList()
  233. this.$modal.closeLoading()
  234. }).finally(() => {
  235. this.$modal.closeLoading()
  236. })
  237. },
  238. async showApprove(qmyy) {
  239. let content = await this.$refs.templateTable.getFormData()
  240. if (content) {
  241. this.openApprove = true
  242. this.resetApprove()
  243. this.formApprove.id = this.form.id
  244. this.formApprove.bdnr = JSON.stringify(content)
  245. this.formApprove.qmyy = qmyy
  246. if (qmyy == '复核通过') {
  247. this.openTitle = 'page.business.study.studyFormFill.fhtg'
  248. } else if (qmyy == '复核拒绝') {
  249. this.openTitle = 'page.business.study.studyFormFill.fhjj'
  250. } else if (qmyy == '通过') {
  251. this.openTitle = 'page.business.study.studyFormFill.tongguo'
  252. }
  253. }
  254. },
  255. resetApprove() {
  256. this.formApprove = {
  257. id: null,
  258. qmyy: '',
  259. bdnr: '',
  260. remark: '',
  261. reason: '',
  262. qmrmm: '',
  263. }
  264. this.resetForm("formApprove")
  265. },
  266. approve() {
  267. this.$refs["formApprove"].validate(valid => {
  268. if (valid) {
  269. this.$modal.loading()
  270. if (this.formApprove.qmyy == '复核通过') {
  271. studyFormFill_fhtg(this.formApprove).then(response => {
  272. this.openApprove = false
  273. this.$modal.closeLoading()
  274. this.$emit('close')
  275. }).finally(() => {
  276. this.$modal.closeLoading()
  277. })
  278. } else if (this.formApprove.qmyy == '复核拒绝') {
  279. this.formApprove.remark = this.formApprove.reason
  280. studyFormFill_fhjj(this.formApprove).then(response => {
  281. this.openApprove = false
  282. this.$modal.closeLoading()
  283. this.$emit('close')
  284. }).finally(() => {
  285. this.$modal.closeLoading()
  286. })
  287. } else {
  288. studyFormFill_tg(this.formApprove).then(response => {
  289. this.openApprove = false
  290. this.$modal.closeLoading()
  291. this.$emit('close')
  292. }).finally(() => {
  293. this.$modal.closeLoading()
  294. })
  295. }
  296. }
  297. })
  298. }
  299. }
  300. }
  301. </script>