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

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