1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <template>
- <a-modal
- v-model="opened"
- :title="title"
- centered
- :maskClosable="false"
- :confirmLoading="confirmLoading"
- width="36%"
- :footer="null"
- @cancel="cancel"
- >
- <a-spin :spinning="spinning" tip="Loading...">
- <a-form-model
- id="chooseCustom-form"
- ref="ruleForm"
- :model="form"
- :rules="rules"
- :label-col="formItemLayout.labelCol"
- :wrapper-col="formItemLayout.wrapperCol">
- <a-form-model-item label="出库仓库" prop="warehouseSn">
- <chooseWarehouse ref="warehouse" v-model="form.warehouseSn"></chooseWarehouse>
- </a-form-model-item>
- <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;margin-top:60px;">
- <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
- <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">确定</a-button>
- </a-form-model-item>
- </a-form-model>
- </a-spin>
- </a-modal>
- </template>
- <script>
- import { commonMixin } from '@/utils/mixin'
- import { VSelect } from '@/components'
- import chooseWarehouse from '@/views/common/chooseWarehouse'
- export default {
- name: 'SetWarehouse',
- mixins: [commonMixin],
- components: { VSelect, chooseWarehouse },
- props: {
- show: [Boolean]
- },
- data () {
- return {
- opened: this.show,
- spinning: false,
- title: '批量设置出库仓库',
- confirmLoading: false,
- formItemLayout: {
- labelCol: { span: 4 },
- wrapperCol: { span: 18 }
- },
- form: {
- warehouseSn: undefined
- },
- rules: {
- warehouseSn: [ { required: true, message: '请选择出库仓库', trigger: ['change', 'blur'] } ]
- }
- }
- },
- methods: {
- // 保存
- handleSubmit (e) {
- e.preventDefault()
- const _this = this
- this.$refs.ruleForm.validate(valid => {
- if (valid) {
- _this.$emit('ok', this.form.warehouseSn)
- } else {
- console.log('error submit!!')
- return false
- }
- })
- },
- cancel () {
- this.opened = false
- this.$emit('cancel')
- this.$refs.ruleForm.resetFields()
- }
- },
- watch: {
- show (newValue, oldValue) {
- this.opened = newValue
- if (!newValue) {
- this.$refs.dealerSubareaScopeList.resetForm()
- this.$refs.ruleForm.resetFields()
- this.verifyFun(this.addressId)
- }
- }
- }
- }
- </script>
|