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

157 lines
4.5 KiB

  1. G<template>
  2. <div >
  3. <!-- 解档弹窗 -->
  4. <el-dialog :title="$t('page.business.zykgl.mjy.jiedang')" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false">
  5. <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  6. <div :style="isBatch ? 'display:block' : 'display:none'">
  7. <el-alert :title="$t('page.business.zykgl.mjy.jdts') " type="error" :closable="false">
  8. </el-alert>
  9. <el-row style="margin:10px 0px;">
  10. <el-col :span="24">
  11. <SelectList :value="selectList"/>
  12. </el-col>
  13. </el-row>
  14. </div>
  15. <div :style="!isBatch ? 'display:block' : 'display:none'">
  16. <el-row>
  17. <el-col :span="24">
  18. <el-form-item :label="$t('page.business.zykgl.mjy.mc')" prop="mc">
  19. <el-input type="text" v-model="form.mc" maxlength="50" disabled
  20. :placeholder="$t('form.placeholderInput')" />
  21. </el-form-item>
  22. </el-col>
  23. </el-row>
  24. <el-row>
  25. <el-col :span="24">
  26. <el-form-item :label="$t('page.business.zykgl.mjy.bh')" prop="glyj">
  27. <el-input type="text" v-model="form.bh" maxlength="50" disabled
  28. :placeholder="$t('form.placeholderInput')" />
  29. </el-form-item>
  30. </el-col>
  31. </el-row>
  32. </div>
  33. <el-row>
  34. <el-col :span="24">
  35. <el-form-item :label="$t('form.qmyy')" prop="qmyy">
  36. <el-input type="text" :value="form.qmyy" maxlength="50" disabled
  37. :placeholder="$t('form.placeholderInput')" />
  38. </el-form-item>
  39. </el-col>
  40. </el-row>
  41. <el-row>
  42. <el-col :span="24">
  43. <el-form-item :label="$t('form.remark')" prop="remark">
  44. <el-input type="textarea" v-model="form.remark" :rows="2" maxlength="500"
  45. :placeholder="$t('form.placeholderInput')">
  46. </el-input>
  47. </el-form-item>
  48. </el-col>
  49. </el-row>
  50. <el-row>
  51. <el-col :span="24">
  52. <el-form-item :label="$t('form.signer')">
  53. <el-input type="text" v-model="nickName" maxlength="50" disabled
  54. :placeholder="$t('form.placeholderInput')" />
  55. </el-form-item>
  56. </el-col>
  57. </el-row>
  58. <el-row>
  59. <el-col :span="24">
  60. <el-form-item :label="$t('form.password')" prop="sdrmm">
  61. <el-input type="password" v-model="form.sdrmm" maxlength="20" :placeholder="$t('form.placeholderInput')" />
  62. </el-form-item>
  63. </el-col>
  64. </el-row>
  65. </el-form>
  66. <div slot="footer" class="dialog-footer">
  67. <el-button type="primary" @click="save">{{ $t('form.confirm') }}</el-button>
  68. <el-button @click="cancel">{{ $t('form.cancel') }}</el-button>
  69. </div>
  70. </el-dialog>
  71. </div>
  72. </template>
  73. <script>
  74. import { mjy_jd, mjy_jdBatch } from "@/api/business/mjy/mjy"
  75. import { mapGetters } from 'vuex'
  76. import SelectList from "./SelectList";
  77. export default {
  78. name: "MjyJd",
  79. components: { SelectList },
  80. data() {
  81. return {
  82. isBatch: false,
  83. ids: [],
  84. selectList: [],
  85. open: false,
  86. form: {},
  87. rules: {
  88. sdrmm: [{
  89. required: true,
  90. message: ' ',
  91. trigger: 'blur'
  92. }]
  93. }
  94. }
  95. },
  96. computed: {
  97. ...mapGetters([
  98. 'nickName'
  99. ]),
  100. },
  101. created() {
  102. },
  103. methods: {
  104. showBatch(val) {
  105. this.reset()
  106. this.isBatch = true
  107. this.form.ids = val.map(item => item.id)
  108. this.selectList = val
  109. this.open = true
  110. },
  111. cancel() {
  112. this.open = false
  113. },
  114. reset() {
  115. this.form = {
  116. id: null,
  117. ids: null,
  118. mc: null,
  119. bh: null,
  120. qmyy: '申请解档',
  121. sdrmm: null
  122. }
  123. this.resetForm("form")
  124. },
  125. show(row) {
  126. this.reset()
  127. this.isBatch = false
  128. this.form.ids = []
  129. this.selectList = []
  130. this.form.id = row.id
  131. this.form.mc = row.mc
  132. this.form.bh = row.bh
  133. this.open = true
  134. },
  135. save() {
  136. this.$refs["form"].validate(valid => {
  137. if (valid) {
  138. if (this.isBatch) {
  139. mjy_jdBatch(this.form).then(response => {
  140. this.open = false
  141. this.$emit('callback')
  142. })
  143. } else {
  144. mjy_jd(this.form).then(response => {
  145. this.open = false
  146. this.$emit('callback')
  147. })
  148. }
  149. }
  150. })
  151. }
  152. }
  153. }
  154. </script>