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

131 lines
3.5 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. <div class="sbzdtcma"> <input type="text"></div>
  35. <el-input type="password" v-model="form.qmrmm" autocomplete="off" auto-complete="new-password" show-password maxlength="20" :placeholder="$t('form.placeholderInput')" />
  36. </el-form-item>
  37. </el-col>
  38. </el-row>
  39. </el-form>
  40. <div slot="footer" class="dialog-footer">
  41. <el-button type="primary" @click="save">{{ $t('form.confirm') }}</el-button>
  42. <el-button @click="cancel">{{ $t('form.cancel') }}</el-button>
  43. </div>
  44. </el-dialog>
  45. </div>
  46. </template>
  47. <script>
  48. import { sj_gd, sj_plgd } from "@/api/business/sj/sj"
  49. import { mapGetters } from 'vuex'
  50. import SelectList from "./SelectList";
  51. export default {
  52. name: "SjGd",
  53. components: { SelectList },
  54. data() {
  55. return {
  56. isBatch: false,
  57. ids: [],
  58. selectList: [],
  59. open: false,
  60. form: {},
  61. rules: {
  62. qmrmm: [{
  63. required: true,
  64. message: ' ',
  65. trigger: 'blur'
  66. }]
  67. }
  68. }
  69. },
  70. computed: {
  71. ...mapGetters([
  72. 'nickName','name'
  73. ]),
  74. },
  75. created() {
  76. },
  77. methods: {
  78. showBatch(val) {
  79. this.reset()
  80. this.isBatch = true
  81. this.form.ids = val.map(item => item.id)
  82. this.selectList = val
  83. this.open = true
  84. },
  85. cancel() {
  86. this.open = false
  87. },
  88. reset() {
  89. this.form = {
  90. id: null,
  91. ids: null,
  92. mc: null,
  93. bh: null,
  94. qmyy: this.$t('page.business.resource.sj.sqgd'),
  95. sdrmm: null
  96. }
  97. this.resetForm("form")
  98. },
  99. show(row) {
  100. this.reset()
  101. this.isBatch = false
  102. this.form.ids = []
  103. this.selectList = []
  104. this.form.id = row.id
  105. this.form.mc = row.mc
  106. this.form.bh = row.bh
  107. this.open = true
  108. },
  109. save() {
  110. this.$refs["form"].validate(valid => {
  111. if (valid) {
  112. if (this.isBatch) {
  113. sj_plgd(this.form).then(response => {
  114. this.open = false
  115. this.$emit('callback')
  116. })
  117. } else {
  118. sj_gd(this.form).then(response => {
  119. this.open = false
  120. this.$emit('callback')
  121. })
  122. }
  123. }
  124. })
  125. }
  126. }
  127. }
  128. </script>