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

130 lines
3.4 KiB

  1. <template>
  2. <div >
  3. <!-- 归档弹窗 -->
  4. <el-dialog :title="$t('page.business.resource.sj.guidang')" :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. <el-row>
  7. <el-col :span="24">
  8. <el-form-item :label="$t('form.qmyy')" prop="qmyy">
  9. <el-input type="text" :value="form.qmyy" maxlength="50" disabled
  10. :placeholder="$t('form.placeholderInput')" />
  11. </el-form-item>
  12. </el-col>
  13. </el-row>
  14. <el-row>
  15. <el-col :span="24">
  16. <el-form-item :label="$t('form.remark')" prop="remark">
  17. <el-input type="textarea" v-model="form.remark" :rows="2" maxlength="500"
  18. :placeholder="$t('form.placeholderInput')">
  19. </el-input>
  20. </el-form-item>
  21. </el-col>
  22. </el-row>
  23. <el-row>
  24. <el-col :span="24">
  25. <el-form-item :label="$t('form.signer')">
  26. <el-input type="text" v-model="nickName" maxlength="50" disabled
  27. :placeholder="$t('form.placeholderInput')" />
  28. </el-form-item>
  29. </el-col>
  30. </el-row>
  31. <el-row>
  32. <el-col :span="24">
  33. <el-form-item :label="$t('form.password')" prop="qmrmm">
  34. <el-input type="password" v-model="form.qmrmm" maxlength="20" :placeholder="$t('form.placeholderInput')" />
  35. </el-form-item>
  36. </el-col>
  37. </el-row>
  38. </el-form>
  39. <div slot="footer" class="dialog-footer">
  40. <el-button type="primary" @click="save">{{ $t('form.confirm') }}</el-button>
  41. <el-button @click="cancel">{{ $t('form.cancel') }}</el-button>
  42. </div>
  43. </el-dialog>
  44. </div>
  45. </template>
  46. <script>
  47. import { sj_gd, sj_plgd } from "@/api/business/sj/sj"
  48. import { mapGetters } from 'vuex'
  49. import SelectList from "./SelectList";
  50. export default {
  51. name: "SjGd",
  52. components: { SelectList },
  53. data() {
  54. return {
  55. isBatch: false,
  56. ids: [],
  57. selectList: [],
  58. open: false,
  59. form: {},
  60. rules: {
  61. qmrmm: [{
  62. required: true,
  63. message: ' ',
  64. trigger: 'blur'
  65. }]
  66. }
  67. }
  68. },
  69. computed: {
  70. ...mapGetters([
  71. 'nickName'
  72. ]),
  73. },
  74. created() {
  75. },
  76. methods: {
  77. showBatch(val) {
  78. this.reset()
  79. this.isBatch = true
  80. this.form.ids = val.map(item => item.id)
  81. this.selectList = val
  82. this.open = true
  83. },
  84. cancel() {
  85. this.open = false
  86. },
  87. reset() {
  88. this.form = {
  89. id: null,
  90. ids: null,
  91. mc: null,
  92. bh: null,
  93. qmyy: '申请归档',
  94. sdrmm: null
  95. }
  96. this.resetForm("form")
  97. },
  98. show(row) {
  99. this.reset()
  100. this.isBatch = false
  101. this.form.ids = []
  102. this.selectList = []
  103. this.form.id = row.id
  104. this.form.mc = row.mc
  105. this.form.bh = row.bh
  106. this.open = true
  107. },
  108. save() {
  109. this.$refs["form"].validate(valid => {
  110. if (valid) {
  111. if (this.isBatch) {
  112. sj_plgd(this.form).then(response => {
  113. this.open = false
  114. this.$emit('callback')
  115. })
  116. } else {
  117. sj_gd(this.form).then(response => {
  118. this.open = false
  119. this.$emit('callback')
  120. })
  121. }
  122. }
  123. })
  124. }
  125. }
  126. }
  127. </script>