1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <template>
- <a-modal
- :title="modalTitle"
- :width="800"
- :visible="visible"
- :confirmLoading="confirmLoading"
- class="ant-modal2"
- @cancel="handleCancel"
- >
- <a-form :form="form">
- <row-list :col="1">
- <row-item>
- <a-form-item
- label="说明"
- :labelCol="BaseTool.Constant.labelCol2"
- :wrapperCol="BaseTool.Constant.wrapperCol2"
- >
- <a-textarea
- :rows="4"
- v-decorator="['handleRemark',{initialValue: model.remark}]"/>
- </a-form-item>
- </row-item>
- </row-list>
- </a-form>
- <template slot="footer">
- <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
- </template>
- </a-modal>
- </template>
- <script>
- import { updateOilSbOilList } from '@/api/sb/oil'
- export default {
- name: 'BaseSbOil',
- components: {
- },
- data () {
- return {
- confirmLoading: false,
- modalTitle: null,
- form: this.$form.createForm(this),
- status: 2,
- model: {},
- visible: false,
- // 下拉框map
- statusMap: {},
- ids: []
- }
- },
- props: {},
- created () {
- // 下拉框map
- this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_OIL_STATUS)
- },
- methods: {
- base (ids) {
- this.visible = true
- // 如果是空标识添加
- this.modalTitle = '批量加油'
- this.ids = ids
- },
- statusChange (val) {
- console.log(val)
- this.status = val
- },
- save () {
- const { form: { validateFieldsAndScroll } } = this
- this.confirmLoading = true
- validateFieldsAndScroll((errors, values) => {
- if (errors) {
- this.confirmLoading = false
- return
- }
- values.ids = this.ids
- updateOilSbOilList(values)
- .then(() => {
- this.handleCancel(values)
- }).catch(() => {
- this.confirmLoading = false
- })
- })
- },
- handleCancel (values) {
- this.visible = false
- this.confirmLoading = false
- this.form.resetFields()
- if (this.BaseTool.Object.isNotBlank(values)) {
- this.$emit('ok', values)
- }
- }
- }
- }
- </script>
|