opt:优化包装关系查询和导出
This commit is contained in:
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
@@ -94,9 +95,17 @@ public class SubpackagerelationServiceImpl implements SubpackagerelationService
|
|||||||
if (ObjectUtil.isNotEmpty(sap_pcsn)) {
|
if (ObjectUtil.isNotEmpty(sap_pcsn)) {
|
||||||
map.put("sap_pcsn", "%" + sap_pcsn + "%");
|
map.put("sap_pcsn", "%" + sap_pcsn + "%");
|
||||||
}
|
}
|
||||||
|
String begin_time = (String) whereJson.get("begin_time");
|
||||||
|
|
||||||
|
if (!StrUtil.isEmpty(begin_time)) {
|
||||||
|
map.put("begin_time", begin_time);
|
||||||
|
}
|
||||||
|
String end_time = (String) whereJson.get("end_time");
|
||||||
|
if (!StrUtil.isEmpty(end_time)) {
|
||||||
|
map.put("end_time", end_time);
|
||||||
|
}
|
||||||
map.put("is_un_plan_production", is_un_plan_production);
|
map.put("is_un_plan_production", is_un_plan_production);
|
||||||
map.put("date_of_production", date_of_production);
|
map.put("date_of_production", date_of_production);
|
||||||
map.put("date_of_FG_inbound", date_of_FG_inbound);
|
|
||||||
map.put("status", status);
|
map.put("status", status);
|
||||||
JSONObject json = WQL.getWO("PDM_BI_SUBPACKAGER01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page),"workorder_id desc");
|
JSONObject json = WQL.getWO("PDM_BI_SUBPACKAGER01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page),"workorder_id desc");
|
||||||
JSONArray content = json.getJSONArray("content");
|
JSONArray content = json.getJSONArray("content");
|
||||||
@@ -228,7 +237,15 @@ public class SubpackagerelationServiceImpl implements SubpackagerelationService
|
|||||||
}
|
}
|
||||||
map.put("is_un_plan_production", is_un_plan_production);
|
map.put("is_un_plan_production", is_un_plan_production);
|
||||||
map.put("date_of_production", date_of_production);
|
map.put("date_of_production", date_of_production);
|
||||||
map.put("date_of_FG_inbound", date_of_FG_inbound);
|
String begin_time = (String) whereJson.get("begin_time");
|
||||||
|
|
||||||
|
if (!StrUtil.isEmpty(begin_time)) {
|
||||||
|
map.put("begin_time", begin_time);
|
||||||
|
}
|
||||||
|
String end_time = (String) whereJson.get("end_time");
|
||||||
|
if (!StrUtil.isEmpty(end_time)) {
|
||||||
|
map.put("end_time", end_time);
|
||||||
|
}
|
||||||
map.put("status", status);
|
map.put("status", status);
|
||||||
map.put("limits", "10000");
|
map.put("limits", "10000");
|
||||||
JSONArray resultJSONArray = WQL.getWO("PDM_BI_SUBPACKAGER01").addParamMap(map).process().getResultJSONArray(0);
|
JSONArray resultJSONArray = WQL.getWO("PDM_BI_SUBPACKAGER01").addParamMap(map).process().getResultJSONArray(0);
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
输入.sap_pcsn TYPEAS s_string
|
输入.sap_pcsn TYPEAS s_string
|
||||||
输入.date_of_production TYPEAS s_string
|
输入.date_of_production TYPEAS s_string
|
||||||
输入.date_of_FG_inbound TYPEAS s_string
|
输入.date_of_FG_inbound TYPEAS s_string
|
||||||
|
输入.begin_time TYPEAS s_string
|
||||||
|
输入.end_time TYPEAS s_string
|
||||||
输入.status TYPEAS s_string
|
输入.status TYPEAS s_string
|
||||||
|
|
||||||
|
|
||||||
@@ -99,10 +101,13 @@
|
|||||||
date_of_production = 输入.date_of_production
|
date_of_production = 输入.date_of_production
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
|
||||||
OPTION 输入.date_of_FG_inbound <> ""
|
OPTION 输入.begin_time <> ""
|
||||||
date_of_FG_inbound = 输入.date_of_FG_inbound
|
date_of_FG_inbound>= 输入.begin_time
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.end_time <> ""
|
||||||
|
date_of_FG_inbound <= 输入.end_time
|
||||||
|
ENDOPTION
|
||||||
OPTION 输入.status <> ""
|
OPTION 输入.status <> ""
|
||||||
status = 输入.status
|
status = 输入.status
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
@@ -277,15 +282,19 @@
|
|||||||
date_of_production = 输入.date_of_production
|
date_of_production = 输入.date_of_production
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
|
||||||
OPTION 输入.date_of_FG_inbound <> ""
|
OPTION 输入.begin_time <> ""
|
||||||
date_of_FG_inbound = 输入.date_of_FG_inbound
|
date_of_FG_inbound>= 输入.begin_time
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.end_time <> ""
|
||||||
|
date_of_FG_inbound <= 输入.end_time
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
OPTION 输入.status <> ""
|
OPTION 输入.status <> ""
|
||||||
status = 输入.status
|
status = 输入.status
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
OPTION 输入.limits <> ""
|
OPTION 输入.limits <> ""
|
||||||
1=1 order by workorder_id desc limit 0,10000
|
1=1 order by date_of_FG_inbound desc limit 0,10000
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDQUERY
|
ENDQUERY
|
||||||
|
|||||||
@@ -87,16 +87,6 @@
|
|||||||
@change="hand"
|
@change="hand"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</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-form-item label="状态">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="query.status"
|
v-model="query.status"
|
||||||
@@ -159,23 +149,17 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="满轴位状态">
|
<el-form-item label="业务日期" prop="createTime">
|
||||||
<el-select
|
<el-date-picker
|
||||||
v-model="query.full_point_status"
|
v-model="query.createTime"
|
||||||
clearable
|
type="daterange"
|
||||||
filterable
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
size="mini"
|
start-placeholder="开始日期"
|
||||||
class="filter-item"
|
end-placeholder="结束日期"
|
||||||
style="width: 185px;"
|
:default-time="['00:00:00', '23:59:59']"
|
||||||
@change="hand"
|
@change="crud.toQuery"
|
||||||
>
|
/>
|
||||||
<el-option
|
</el-form-item>
|
||||||
v-for="item in dict.sch_full_point_status"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>-->
|
|
||||||
<rrOperation :crud="crud" />
|
<rrOperation :crud="crud" />
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -187,6 +171,7 @@
|
|||||||
type="success"
|
type="success"
|
||||||
icon="el-icon-check"
|
icon="el-icon-check"
|
||||||
size="mini"
|
size="mini"
|
||||||
|
:loading="showDtlLoading"
|
||||||
@click="downdtl"
|
@click="downdtl"
|
||||||
>
|
>
|
||||||
导出Excel
|
导出Excel
|
||||||
@@ -610,6 +595,7 @@ import udOperation from '@crud/UD.operation'
|
|||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination'
|
||||||
import { download } from '@/api/data'
|
import { download } from '@/api/data'
|
||||||
import { downloadFile } from '@/utils'
|
import { downloadFile } from '@/utils'
|
||||||
|
import crudUserStor from "@/views/wms/basedata/st/userStor/userStor";
|
||||||
|
|
||||||
const defaultForm = {
|
const defaultForm = {
|
||||||
workorder_id: null,
|
workorder_id: null,
|
||||||
@@ -669,6 +655,7 @@ export default {
|
|||||||
edit: ['admin', 'sub:edit'],
|
edit: ['admin', 'sub:edit'],
|
||||||
del: ['admin', 'sub:del']
|
del: ['admin', 'sub:del']
|
||||||
},
|
},
|
||||||
|
showDtlLoading: false,
|
||||||
isPlanProducList: [
|
isPlanProducList: [
|
||||||
{ 'label': '是', 'value': '1' },
|
{ 'label': '是', 'value': '1' },
|
||||||
{ 'label': '否', 'value': '0' }
|
{ 'label': '否', 'value': '0' }
|
||||||
@@ -744,23 +731,53 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.initQuery()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
[CRUD.HOOK.beforeRefresh]() {
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
return true
|
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) {
|
hand(value) {
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
},
|
},
|
||||||
downdtl() {
|
downdtl() {
|
||||||
if (this.currentRow !== null) {
|
if (this.currentRow !== null) {
|
||||||
crud.downloadLoading = true
|
this.showDtlLoading = true
|
||||||
download('/api/subpackagerelation/download', this.crud.query).then(result => {
|
download('/api/subpackagerelation/download', this.crud.query).then(result => {
|
||||||
debugger
|
debugger
|
||||||
downloadFile(result, '子卷包装', 'xlsx')
|
downloadFile(result, '子卷包装', 'xlsx')
|
||||||
crud.downloadLoading = false
|
this.showDtlLoading = false
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
crud.downloadLoading = false
|
this.showDtlLoading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user