This commit is contained in:
zds
2022-12-01 18:59:08 +08:00
parent 238a61ccad
commit 70fe17b48c
15 changed files with 215 additions and 66 deletions

View File

@@ -15,7 +15,16 @@
<el-form-item label="日期">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</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="单据编号">
@@ -124,13 +133,13 @@
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="index" label="序号" width="100" align="center" fixed />
<el-table-column prop="0" label="质检单号" min-width="100" show-overflow-tooltip fixed />
<el-table-column prop="1" label="物料编码" min-width="100" show-overflow-tooltip fixed />
<el-table-column prop="20" label="物料名称" min-width="100" show-overflow-tooltip fixed />
<el-table-column prop="2" label="批号" min-width="100" show-overflow-tooltip fixed />
<el-table-column type="index" label="序号" width="60" align="center" fixed />
<el-table-column prop="0" label="质检单号" min-width="130" fixed />
<el-table-column prop="1" label="物料编码" min-width="130" fixed />
<el-table-column prop="20" label="物料名称" min-width="130" fixed />
<el-table-column prop="2" label="批号" min-width="130" fixed />
<template v-for="(col,index) in cols">
<el-table-column v-if="col" :prop="col.prop" :label="col.label" width="120px" show-overflow-tooltip />
<el-table-column v-if="col" :prop="col.prop" :label="col.label" width="140" />
</template>
</el-table>
<!--分页组件-->
@@ -150,10 +159,11 @@ import DateRangePicker from '@/components/DateRangePicker'
import crudInspectionsheetmst from '@/api/wms/ql/inspectionsheetmst'
import { download } from '@/api/data'
import { downloadFile } from '@/utils'
import Date from '@/utils/datetime'
export default {
name: 'PhySicalQuery',
components: { pagination, crudOperation, rrOperation, udOperation, DateRangePicker },
components: { pagination, crudOperation, rrOperation },
mixins: [presenter(), header(), crud()],
cruds() {
return CRUD({
@@ -179,6 +189,7 @@ export default {
return {
cols: [],
statusList: [],
query_flag: true,
permission: {
},
rules: {
@@ -187,10 +198,16 @@ export default {
beforeCreate() {
},
created() {
this.crud.query.createTime = [new Date().daysAgo(30), new Date()]
},
methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() {
if (this.query_flag) {
this.crud.query.begin_time = (new Date().daysAgo(30)).strftime('%F', 'zh')
this.crud.query.end_time = (new Date()).strftime('%F', 'zh')
this.query_flag = false
}
crudPhySicalQuery.getHeader().then(res => {
this.cols = res
})
@@ -198,6 +215,19 @@ export default {
this.statusList = 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()
},