opt:优化包装关系查询和导出

This commit is contained in:
DESKTOP-5DIJMF9\admin
2025-02-20 14:58:47 +08:00
parent 2d1ff9127a
commit c32e12a4c4
3 changed files with 81 additions and 38 deletions

View File

@@ -87,16 +87,6 @@
@change="hand"
/>
</el-form-item>
<el-form-item label="业务日期">
<el-date-picker
v-model="query.date_of_FG_inbound"
type="date"
placeholder="选择日期时间"
style="width: 185px"
value-format="yyyy-MM-dd"
@change="hand"
/>
</el-form-item>
<el-form-item label="状态">
<el-select
v-model="query.status"
@@ -159,23 +149,17 @@
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="满轴位状态">
<el-select
v-model="query.full_point_status"
clearable
filterable
size="mini"
class="filter-item"
style="width: 185px;"
@change="hand"
>
<el-option
v-for="item in dict.sch_full_point_status"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>-->
<el-form-item label="业务日期" prop="createTime">
<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']"
@change="crud.toQuery"
/>
</el-form-item>
<rrOperation :crud="crud" />
</el-form>
</div>
@@ -187,6 +171,7 @@
type="success"
icon="el-icon-check"
size="mini"
:loading="showDtlLoading"
@click="downdtl"
>
导出Excel
@@ -610,6 +595,7 @@ import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import { download } from '@/api/data'
import { downloadFile } from '@/utils'
import crudUserStor from "@/views/wms/basedata/st/userStor/userStor";
const defaultForm = {
workorder_id: null,
@@ -669,6 +655,7 @@ export default {
edit: ['admin', 'sub:edit'],
del: ['admin', 'sub:del']
},
showDtlLoading: false,
isPlanProducList: [
{ 'label': '是', 'value': '1' },
{ 'label': '否', 'value': '0' }
@@ -744,23 +731,53 @@ export default {
}
}
},
created() {
this.initQuery()
},
methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() {
return true
},
initQuery() {
const end = new Date()
const start = new Date()
const endYear = end.getFullYear()
var endMonth = end.getMonth() + 1
if (end.getMonth() + 1 < 10) {
endMonth = '0' + endMonth.toString()
}
var endDay = end.getDate()
if (end.getDate() < 10) {
endDay = '0' + endDay.toString()
}
const endDate = endYear + '-' + endMonth + '-' + endDay + ' 23:59:59'
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
const startYear = start.getFullYear()
var startMonth = start.getMonth() + 1
if (start.getMonth() + 1 < 10) {
startMonth = '0' + startMonth.toString()
}
var startDay = start.getDate()
if (start.getDate() < 10) {
startDay = '0' + startDay.toString()
}
const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00'
this.$set(this.query, 'createTime', [startDate, endDate])
this.crud.toQuery()
},
hand(value) {
this.crud.toQuery()
},
downdtl() {
if (this.currentRow !== null) {
crud.downloadLoading = true
this.showDtlLoading = true
download('/api/subpackagerelation/download', this.crud.query).then(result => {
debugger
downloadFile(result, '子卷包装', 'xlsx')
crud.downloadLoading = false
this.showDtlLoading = false
}).catch(() => {
crud.downloadLoading = false
this.showDtlLoading = false
})
}
}