优化
This commit is contained in:
@@ -24,10 +24,11 @@ export function edit(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getHeader() {
|
||||
export function getHeader(params) {
|
||||
return request({
|
||||
url: 'api/powderOrderQuery/getHeader',
|
||||
method: 'get'
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,16 @@
|
||||
|
||||
<el-form-item label="日期">
|
||||
<label slot="label">日 期:</label>
|
||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@input="onInput()"
|
||||
@change="mytoQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="产品批次">
|
||||
@@ -35,7 +44,7 @@
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入批次"
|
||||
placeholder="请输入产品编码"
|
||||
style="width: 230px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
@@ -87,11 +96,11 @@
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="100" align="center" fixed />
|
||||
<el-table-column prop="0" label="日期" min-width="150" fixed />
|
||||
<el-table-column prop="1" label="产品编码" min-width="100" fixed />
|
||||
<el-table-column prop="0" label="日期" min-width="140" fixed />
|
||||
<el-table-column prop="1" label="产品编码" min-width="120" fixed />
|
||||
<el-table-column prop="2" label="批号" min-width="100" fixed />
|
||||
<template v-for="(col,index) in cols">
|
||||
<el-table-column v-if="col" :prop="col.prop" :label="col.label" width="120px" />
|
||||
<el-table-column v-if="col" :prop="col.prop" :label="col.label" min-width="120px" />
|
||||
</template>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
@@ -105,16 +114,15 @@ import crudPowderorder from '@/api/wms/statistics/powderorder'
|
||||
import CRUD, { presenter, header, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import {download} from "@/api/data";
|
||||
import {downloadFile} from "@/utils";
|
||||
import Date from '@/utils/datetime'
|
||||
|
||||
export default {
|
||||
name: 'Powderorder',
|
||||
dicts: ['workorder_status'],
|
||||
components: { pagination, crudOperation, rrOperation, DateRangePicker },
|
||||
components: { pagination, crudOperation, rrOperation },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -139,19 +147,44 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
cols: [],
|
||||
query_flag: true,
|
||||
statusList: [],
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
}}
|
||||
},
|
||||
created() {
|
||||
this.crud.query.createTime = [new Date().daysAgo(7), new Date()]
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
crudPowderorder.getHeader().then(res => {
|
||||
this.crud.data = []
|
||||
this.cols = []
|
||||
if (this.query_flag) {
|
||||
this.crud.query.begin_time = (new Date().daysAgo(7)).strftime('%F', 'zh')
|
||||
this.crud.query.end_time = (new Date()).strftime('%F', 'zh')
|
||||
this.query_flag = false
|
||||
}
|
||||
const now = this.crud.query
|
||||
crudPowderorder.getHeader(now).then(res => {
|
||||
this.cols = res
|
||||
})
|
||||
},
|
||||
onInput() {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
mytoQuery(array1) {
|
||||
if (array1 === null) {
|
||||
this.crud.query.begin_time = ''
|
||||
this.crud.query.end_time = ''
|
||||
} else {
|
||||
this.crud.query.begin_time = array1[0]
|
||||
this.crud.query.end_time = array1[1]
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user