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

140 lines
3.8 KiB

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