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

172 lines
5.4 KiB

  1. <template>
  2. <div>
  3. <!-- 编辑弹窗 -->
  4. <el-dialog :title="$t('form.edit')" :visible.sync="open" width="700px" append-to-body :close-on-click-modal="false">
  5. <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  6. <template>
  7. <el-row>
  8. <!-- 名称 -->
  9. <el-col :span="12">
  10. <el-form-item :label="$t('page.business.resource.sj.mc')" prop="mc">
  11. <el-input type="text" v-model="form.mc" maxlength="50" :placeholder="$t('form.placeholderInput')" />
  12. </el-form-item>
  13. </el-col>
  14. <!-- 编号 -->
  15. <el-col :span="12">
  16. <el-form-item :label="$t('page.business.resource.sj.bh')" prop="bh">
  17. <el-input type="text" v-model="form.bh" maxlength="50" disabled
  18. :placeholder="$t('form.placeholderInput')" />
  19. </el-form-item>
  20. </el-col>
  21. </el-row>
  22. <el-row>
  23. <!-- 浓度 -->
  24. <el-col :span="8">
  25. <el-form-item :label="$t('page.business.resource.sj.nd')" prop="nd">
  26. <el-input type="text" v-model="form.nd" maxlength="50" :placeholder="$t('form.placeholderInput')" />
  27. </el-form-item>
  28. </el-col>
  29. <el-col :span="4">
  30. <BusinessSelect dictType="system_business_zldw" v-model="form.nndw" />
  31. </el-col>
  32. <el-col :span="12">
  33. <!-- 失效日 -->
  34. <el-form-item :label="$t('page.business.resource.sj.sxr')" prop="sxr">
  35. <el-date-picker v-model="form.sxr" type="datetime" format="yyyy-MM-dd HH:mm"
  36. value-format="yyyy-MM-dd HH:mm:ss" :placeholder="$t('form.placeholderInput')">
  37. </el-date-picker>
  38. </el-form-item>
  39. </el-col>
  40. </el-row>
  41. </template>
  42. <el-row>
  43. <el-col :span="12">
  44. <!-- 存储条件 -->
  45. <el-form-item :label="$t('page.business.resource.sj.cctj')" prop="cctj">
  46. <BusinessSelect dictType="system_business_cctj" v-model="form.cctj" />
  47. </el-form-item>
  48. </el-col>
  49. <el-col :span="12">
  50. <!-- 存储位置 -->
  51. <el-form-item :label="$t('page.business.resource.sj.ccwz')" prop="ccwz">
  52. <BusinessSelect dictType="system_business_ccwz" v-model="form.ccwz" />
  53. </el-form-item>
  54. </el-col>
  55. </el-row>
  56. <el-row>
  57. <el-col :span="12">
  58. <el-form-item :label="$t('form.qmyy')">
  59. <el-input type="text" v-model="form.qmyy" maxlength="50" disabled
  60. :placeholder="$t('form.placeholderInput')" />
  61. </el-form-item>
  62. </el-col>
  63. <el-col :span="12">
  64. <el-form-item :label="$t('form.signer')">
  65. <el-input type="text" v-model="nickName" maxlength="50" disabled
  66. :placeholder="$t('form.placeholderInput')" />
  67. </el-form-item>
  68. </el-col>
  69. </el-row>
  70. <el-row>
  71. <el-col :span="24">
  72. <el-form-item :label="$t('form.password')" prop="sdrmm">
  73. <el-input type="text" v-model="form.sdrmm" maxlength="20" :placeholder="$t('form.placeholderInput')" />
  74. </el-form-item>
  75. </el-col>
  76. </el-row>
  77. <el-row>
  78. <el-col :span="24">
  79. <el-form-item :label="$t('form.remark')" prop="qmbz">
  80. <el-input type="textarea" v-model="form.qmbz" :rows="2" maxlength="500"
  81. :placeholder="$t('form.placeholderInput')">
  82. </el-input>
  83. </el-form-item>
  84. </el-col>
  85. </el-row>
  86. </el-form>
  87. <div slot="footer" class="dialog-footer">
  88. <el-button type="primary" @click="save">{{ $t('form.confirm') }}</el-button>
  89. <el-button @click="cancel">{{ $t('form.cancel') }}</el-button>
  90. </div>
  91. </el-dialog>
  92. </div>
  93. </template>
  94. <script>
  95. import { sj_bj } from "@/api/business/sj/sj"
  96. import { mapGetters } from 'vuex'
  97. import SelectList from "./SelectList";
  98. import BusinessSelect from '@/views/business/comps/select/BusinessSelect';
  99. export default {
  100. name: "SjBj",
  101. components: { SelectList, BusinessSelect },
  102. data() {
  103. return {
  104. isBatch: false,
  105. ids: [],
  106. selectList: [],
  107. open: false,
  108. form: {},
  109. rules: {
  110. sdrmm: [{
  111. required: true,
  112. message: ' ',
  113. trigger: 'blur'
  114. }]
  115. }
  116. }
  117. },
  118. computed: {
  119. ...mapGetters([
  120. 'nickName','name'
  121. ]),
  122. },
  123. created() {
  124. },
  125. methods: {
  126. showBatch(val) {
  127. this.reset()
  128. this.isBatch = true
  129. this.form.ids = val.map(item => item.id)
  130. this.selectList = val
  131. this.open = true
  132. },
  133. cancel() {
  134. this.open = false
  135. },
  136. reset() {
  137. this.form = {
  138. id: null,
  139. ids: null,
  140. mc: null,
  141. bh: null,
  142. qmyy: this.$t('form.edit'),
  143. sdrmm: null
  144. }
  145. this.resetForm("form")
  146. },
  147. show(row) {
  148. this.reset()
  149. this.isBatch = false
  150. this.form.ids = []
  151. this.selectList = []
  152. this.form.id = row.id
  153. this.form.mc = row.mc
  154. this.form.bh = row.bh
  155. this.open = true
  156. },
  157. save() {
  158. this.$refs["form"].validate(valid => {
  159. if (valid) {
  160. sj_bj(this.form).then(response => {
  161. this.open = false
  162. this.$emit('callback')
  163. })
  164. }
  165. })
  166. }
  167. }
  168. }
  169. </script>