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

158 lines
4.5 KiB

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