Files
wms1.0/mes/qd/src/views/wms/pcs/saleorder/Dialog.vue

126 lines
3.5 KiB
Vue
Raw Normal View History

2023-03-24 16:57:57 +08:00
<template>
<el-dialog
v-loading.fullscreen.lock="fullscreenLoading"
:show-close="true"
2023-03-24 16:57:57 +08:00
:visible.sync="dialogVisible"
append-to-body
2023-03-24 16:57:57 +08:00
destroy-on-close
title="aps提交"
2023-03-24 16:57:57 +08:00
width="500px"
@close="close"
>
<div class="head-container">
<div>
<!-- 搜索 -->
<el-form ref="form" :model="form1" :rules="rules" label-width="110px" size="mini">
2023-09-18 13:26:48 +08:00
<el-form-item label="订单阶段:" prop="bill_code">
<el-select v-model="form.bill_type" style="width: 350px;">
<el-option label="前段" value="2"/>
<el-option label="后段" value="3"/>
</el-select>
</el-form-item>
<el-form-item label="订单交期:" prop="createTime">
2023-03-24 16:57:57 +08:00
<el-date-picker
v-model="form.createTime"
end-placeholder="结束日期"
start-placeholder="开始日期"
2023-03-24 16:57:57 +08:00
type="daterange"
value-format="yyyy-MM-dd"
/>
</el-form-item>
2023-09-18 13:26:48 +08:00
<!-- <el-form-item label="销售订单号:" prop="bill_code">
2023-03-24 16:57:57 +08:00
<el-input v-model="form.bill_code" style="width: 350px;"/>
2023-09-18 13:26:48 +08:00
</el-form-item> -->
2023-03-24 16:57:57 +08:00
</el-form>
<el-button class="filter-item" icon="el-icon-search" size="mini" type="success" @click="queryStruct">确认
2023-03-24 16:57:57 +08:00
</el-button>
</div>
</div>
</el-dialog>
</template>
<script>
2023-09-18 13:26:48 +08:00
import CRUD, { header, presenter } from '@crud/crud'
2023-03-24 16:57:57 +08:00
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker/index'
2023-09-18 13:26:48 +08:00
import crudSaleOrder from '@/views/wms/pcs/saleorder/saleOrder'
2023-03-24 16:57:57 +08:00
export default {
name: 'importOrder',
2023-09-18 13:26:48 +08:00
components: { rrOperation, pagination, DateRangePicker },
2023-03-24 16:57:57 +08:00
cruds() {
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
}
},
data() {
return {
fullscreenLoading: false,
dialogVisible: false,
2023-09-18 13:26:48 +08:00
form: { bill_type: '2' }
2023-03-24 16:57:57 +08:00
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
close() {
this.form = {}
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.rows)
},
queryStruct() {
2023-09-18 13:26:48 +08:00
// 校验开始日期和结束日期是否为空
if (!this.form.createTime || !this.form.createTime[0] || !this.form.createTime[1]) {
this.showErrorNotification('请选择订单交期')
2023-09-18 13:26:48 +08:00
return
}
// 校验销售订单号值是否为空
if (!this.form.bill_type) {
this.showErrorNotification('请选择订单阶段')
return
}
2023-03-24 16:57:57 +08:00
this.fullscreenLoading = true
if (this.form.createTime) {
this.form.date_begin = this.form.createTime[0]
this.form.date_end = this.form.createTime[1]
}
2023-09-18 13:26:48 +08:00
crudSaleOrder.submit(this.form).then(res => {
this.crud.notify('提交成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
2023-03-24 16:57:57 +08:00
this.fullscreenLoading = false
2023-09-18 13:26:48 +08:00
this.dialogVisible = false
this.form = {} // 清空表单数据
2023-03-24 16:57:57 +08:00
}).catch(() => {
this.fullscreenLoading = false
})
2023-09-18 13:26:48 +08:00
},
showErrorNotification: function(message) {
this.crud.notify(message, CRUD.NOTIFICATION_TYPE.ERROR)
this.fullscreenLoading = false
},
showSuccessNotification: function(message) {
this.crud.notify(message, CRUD.NOTIFICATION_TYPE.SUCCESS)
this.fullscreenLoading = false
2023-03-24 16:57:57 +08:00
}
}
}
</script>