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

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