Commit 135de3ee authored by chicheng's avatar chicheng

报表相关调整

parent 1aaffa76
...@@ -29,6 +29,23 @@ ...@@ -29,6 +29,23 @@
<el-form-item :label="$t('产品图号')" prop="customerDrawingNo"> <el-form-item :label="$t('产品图号')" prop="customerDrawingNo">
<el-input v-model="queryParams.customerDrawingNo" clearable @keyup.enter.native="handleQuery" /> <el-input v-model="queryParams.customerDrawingNo" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('排产次数')" prop="taskBatch">
<el-input v-model="queryParams.taskBatch" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('工序')" prop="processName">
<el-input v-model="queryParams.processName" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('报工时间')" prop="feedbackTimeRange">
<el-date-picker
v-model="feedbackTimeRange"
type="datetimerange"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 360px"
/>
</el-form-item>
<el-form-item :label="$t('销售订单号')" prop="orderCode"> <el-form-item :label="$t('销售订单号')" prop="orderCode">
<el-input v-model="queryParams.orderCode" clearable @keyup.enter.native="handleQuery" /> <el-input v-model="queryParams.orderCode" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
...@@ -78,6 +95,8 @@ ...@@ -78,6 +95,8 @@
<el-table-column :label="$t('外协单号')" width="150" align="center" prop="assistProcessCode" /> <el-table-column :label="$t('外协单号')" width="150" align="center" prop="assistProcessCode" />
<el-table-column :label="$t('生产工单编号')" width="150" align="center" prop="workorderCode" /> <el-table-column :label="$t('生产工单编号')" width="150" align="center" prop="workorderCode" />
<el-table-column :label="$t('产品图号')" width="150" align="center" prop="customerDrawingNo" /> <el-table-column :label="$t('产品图号')" width="150" align="center" prop="customerDrawingNo" />
<el-table-column :label="$t('排产次数')" width="100" align="center" prop="taskBatch" />
<el-table-column :label="$t('工序')" width="120" align="center" prop="processName" show-overflow-tooltip />
<el-table-column :label="$t('销售订单号')" width="150" align="center" prop="orderCode" /> <el-table-column :label="$t('销售订单号')" width="150" align="center" prop="orderCode" />
<el-table-column :label="$t('销售序号')" width="150" align="center" prop="orderSerial" /> <el-table-column :label="$t('销售序号')" width="150" align="center" prop="orderSerial" />
<el-table-column :label="$t('产品物料编码')" width="120" align="center" prop="itemCode" /> <el-table-column :label="$t('产品物料编码')" width="120" align="center" prop="itemCode" />
...@@ -283,6 +302,7 @@ export default { ...@@ -283,6 +302,7 @@ export default {
feedbackList: [], feedbackList: [],
selectRow: [], selectRow: [],
feedbackTimeRange: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
...@@ -306,6 +326,10 @@ export default { ...@@ -306,6 +326,10 @@ export default {
itemCode: null, itemCode: null,
itemName: null, itemName: null,
customerDrawingNo: null, customerDrawingNo: null,
taskBatch: null,
processName: null,
feedbackTimeStart: null,
feedbackTimeEnd: null,
orderCode: null, orderCode: null,
orderSerial: null, orderSerial: null,
unitOfMeasure: null, unitOfMeasure: null,
...@@ -363,6 +387,13 @@ export default { ...@@ -363,6 +387,13 @@ export default {
/** 查询生产报工记录列表 */ /** 查询生产报工记录列表 */
getList() { getList() {
this.loading = true; this.loading = true;
if (this.feedbackTimeRange && this.feedbackTimeRange.length === 2) {
this.queryParams.feedbackTimeStart = this.feedbackTimeRange[0]
this.queryParams.feedbackTimeEnd = this.feedbackTimeRange[1]
} else {
this.queryParams.feedbackTimeStart = null
this.queryParams.feedbackTimeEnd = null
}
listFeedback(this.queryParams).then(response => { listFeedback(this.queryParams).then(response => {
this.feedbackList = response.rows; this.feedbackList = response.rows;
this.total = response.total; this.total = response.total;
...@@ -440,7 +471,10 @@ export default { ...@@ -440,7 +471,10 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.feedbackTimeRange = []
this.resetForm("queryForm"); this.resetForm("queryForm");
this.queryParams.feedbackTimeStart = null
this.queryParams.feedbackTimeEnd = null
this.handleQuery(); this.handleQuery();
}, },
// 多选框选中数据 // 多选框选中数据
...@@ -542,15 +576,6 @@ export default { ...@@ -542,15 +576,6 @@ export default {
}); });
} }
}, },
handleExport(){
this.download1(
'mes/pro/feedback/list/export',
{
...this.queryParams,
},
`feedback_${new Date().getTime()}.xlsx`
);
},
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const recordIds = row.recordId || this.ids; const recordIds = row.recordId || this.ids;
...@@ -600,6 +625,13 @@ export default { ...@@ -600,6 +625,13 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
if (this.feedbackTimeRange && this.feedbackTimeRange.length === 2) {
this.queryParams.feedbackTimeStart = this.feedbackTimeRange[0]
this.queryParams.feedbackTimeEnd = this.feedbackTimeRange[1]
} else {
this.queryParams.feedbackTimeStart = null
this.queryParams.feedbackTimeEnd = null
}
this.download1('mes/pro/feedback/list/export', { this.download1('mes/pro/feedback/list/export', {
...this.queryParams, ...this.queryParams,
pageNum: null, pageNum: null,
......
...@@ -161,6 +161,18 @@ ...@@ -161,6 +161,18 @@
:end-placeholder="$t('common.end_date')"> :end-placeholder="$t('common.end_date')">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item :label="$t('排产日期')" label-width="130px" prop="scheduleDocCreateTime">
<el-date-picker
v-model="queryParams.scheduleDocCreateTime"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss"
:range-separator="$t('至')"
:start-placeholder="$t('common.start_date')"
:end-placeholder="$t('common.end_date')"
clearable>
</el-date-picker>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('common.search') }}</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('common.search') }}</el-button>
...@@ -238,6 +250,11 @@ ...@@ -238,6 +250,11 @@
{{scope.row.taskBatch.split('-').length > 1 ? scope.row.taskBatch.split('-')[scope.row.taskBatch.split('-').length - 1]: ''}} {{scope.row.taskBatch.split('-').length > 1 ? scope.row.taskBatch.split('-')[scope.row.taskBatch.split('-').length - 1]: ''}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('排产日期')" align="center" prop="scheduleDocCreateTime" width="170">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.scheduleDocCreateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('任务单编码')" width="120" prop="taskCode"> <el-table-column :label="$t('任务单编码')" width="120" prop="taskCode">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
...@@ -670,6 +687,7 @@ export default { ...@@ -670,6 +687,7 @@ export default {
statusArr: ['PREPARE'], statusArr: ['PREPARE'],
scheduleStartDate: null, scheduleStartDate: null,
scheduleEndDate: null, scheduleEndDate: null,
scheduleDocCreateTime: null,
}, },
editTimeLast: null, editTimeLast: null,
jobAssignmentVisible: false, jobAssignmentVisible: false,
...@@ -686,14 +704,32 @@ export default { ...@@ -686,14 +704,32 @@ export default {
this.hanldeGetdefaultWorkCenterList() this.hanldeGetdefaultWorkCenterList()
}, },
methods: { methods: {
buildQueryParams() {
const params = { ...this.queryParams, neWorkunitId: 1 }
if (params.scheduleEndDate && params.scheduleEndDate.length > 0) {
params.scheduleEndDateFrom = params.scheduleEndDate[0]
params.scheduleEndDateTo = params.scheduleEndDate[1]
}
if (params.scheduleStartDate && params.scheduleStartDate.length > 0) {
params.scheduleStartDateFrom = params.scheduleStartDate[0]
params.scheduleStartDateTo = params.scheduleStartDate[1]
}
if (params.scheduleDocCreateTime && params.scheduleDocCreateTime.length > 0) {
params.scheduleDocCreateTimeFrom = params.scheduleDocCreateTime[0]
params.scheduleDocCreateTimeTo = params.scheduleDocCreateTime[1]
}
delete params.scheduleStartDate
delete params.scheduleEndDate
delete params.scheduleDocCreateTime
return params
},
handleExport(){ handleExport(){
const params = this.buildQueryParams()
params.pageSize = null
params.pageNum = null
this.download1( this.download1(
'mes/pro/taskWorkunit/list/export', 'mes/pro/taskWorkunit/list/export',
{ params,
...this.queryParams,
pageSize: null,
pageNum: null
},
`taskWorkunit_${new Date().getTime()}.xlsx` `taskWorkunit_${new Date().getTime()}.xlsx`
); );
}, },
...@@ -829,17 +865,7 @@ export default { ...@@ -829,17 +865,7 @@ export default {
this.queryParams.workCenterId = this.queryWorkunitParams.workstationId this.queryParams.workCenterId = this.queryWorkunitParams.workstationId
this.queryParams.workshopId = this.queryWorkunitParams.workshopId this.queryParams.workshopId = this.queryWorkunitParams.workshopId
this.loading = true; this.loading = true;
const params = {...this.queryParams, neWorkunitId: 1} const params = this.buildQueryParams()
if (params.scheduleEndDate&&params.scheduleEndDate.length > 0) {
params.scheduleEndDateFrom = params.scheduleEndDate[0]
params.scheduleEndDateTo = params.scheduleEndDate[1]
}
if (params.scheduleStartDate&&params.scheduleStartDate.length > 0) {
params.scheduleStartDateFrom = params.scheduleStartDate[0]
params.scheduleStartDateTo = params.scheduleStartDate[1]
}
delete params.scheduleStartDate
delete params.scheduleEndDate
const response = await getListData(params) const response = await getListData(params)
this.maintenanceList = response.rows; this.maintenanceList = response.rows;
......
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
<el-table-column :label="$t('产品编码')" align="center" prop="productCode"/> <el-table-column :label="$t('产品编码')" align="center" prop="productCode"/>
<el-table-column :label="$t('产品名称')" align="center" prop="productName"/> <el-table-column :label="$t('产品名称')" align="center" prop="productName"/>
<el-table-column :label="$t('产品图号')" align="center" prop="customerDrawingNo"/> <el-table-column :label="$t('产品图号')" align="center" prop="customerDrawingNo"/>
<el-table-column :label="$t('首工序名称')" align="center" prop="firstProcessName" min-width="120" show-overflow-tooltip/>
<el-table-column :label="$t('预交日期')" align="center" prop="requestDate"/> <el-table-column :label="$t('预交日期')" align="center" prop="requestDate"/>
<el-table-column :label="$t('未排数量')" align="center" prop="disQuantity"/> <el-table-column :label="$t('未排数量')" align="center" prop="disQuantity"/>
<el-table-column :label="$t('本次数量')" align="center" prop="scheduleQuantity" width="160"> <el-table-column :label="$t('本次数量')" align="center" prop="scheduleQuantity" width="160">
......
...@@ -19,6 +19,18 @@ ...@@ -19,6 +19,18 @@
<el-form-item :label="$t('排产次数')" prop="taskBatch"> <el-form-item :label="$t('排产次数')" prop="taskBatch">
<el-input v-model="queryParams.taskBatch" :placeholder="$t('请输入')" /> <el-input v-model="queryParams.taskBatch" :placeholder="$t('请输入')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('排产日期')" label-width="100px" prop="scheduleDate">
<el-date-picker
v-model="queryParams.scheduleDate"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss"
:range-separator="$t('至')"
:start-placeholder="$t('common.start_date')"
:end-placeholder="$t('common.end_date')"
clearable>
</el-date-picker>
</el-form-item>
<el-form-item :label="$t('订单序号')" prop="orderSerial"> <el-form-item :label="$t('订单序号')" prop="orderSerial">
<el-input v-model="queryParams.orderSerial" :placeholder="$t('请输入')" /> <el-input v-model="queryParams.orderSerial" :placeholder="$t('请输入')" />
</el-form-item> </el-form-item>
...@@ -39,7 +51,7 @@ ...@@ -39,7 +51,7 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{$t('重置')}}</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{$t('重置')}}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row style="margin-bottom: 10px;"> <el-row ref="toolbarRow" style="margin-bottom: 10px;">
<el-button type="primary" size="mini" @click="handleExport">{{$t('导出')}}</el-button> <el-button type="primary" size="mini" @click="handleExport">{{$t('导出')}}</el-button>
</el-row> </el-row>
<el-table v-loading="loading" :data="tbodys" @row-click="mainTableClick" :height="tableHeight" :row-class-name="tableRowClassName"> <el-table v-loading="loading" :data="tbodys" @row-click="mainTableClick" :height="tableHeight" :row-class-name="tableRowClassName">
...@@ -47,6 +59,11 @@ ...@@ -47,6 +59,11 @@
<el-table-column :label="$t('订单号')" align="center" prop="orderCode"></el-table-column> <el-table-column :label="$t('订单号')" align="center" prop="orderCode"></el-table-column>
<el-table-column :label="$t('生产工单')" align="center" prop="workorderCode"></el-table-column> <el-table-column :label="$t('生产工单')" align="center" prop="workorderCode"></el-table-column>
<el-table-column :label="$t('排产次数')" align="center" prop="taskBatch"></el-table-column> <el-table-column :label="$t('排产次数')" align="center" prop="taskBatch"></el-table-column>
<el-table-column :label="$t('排产日期')" align="center" prop="scheduleDate" width="170">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.scheduleDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('订单序号')" align="center" prop="orderSerial"></el-table-column> <el-table-column :label="$t('订单序号')" align="center" prop="orderSerial"></el-table-column>
<el-table-column :label="$t('所属产线')" align="center" prop="lineName"></el-table-column> <el-table-column :label="$t('所属产线')" align="center" prop="lineName"></el-table-column>
<el-table-column :label="$t('工单状态')" align="center" prop="status"> <el-table-column :label="$t('工单状态')" align="center" prop="status">
...@@ -54,6 +71,7 @@ ...@@ -54,6 +71,7 @@
<dict-tag :options="dict.type.mes_workorder_status" :value="scope.row.status" /> <dict-tag :options="dict.type.mes_workorder_status" :value="scope.row.status" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('首道未完成工序')" align="center" prop="firstUnfinishedProcessName" width="140" show-overflow-tooltip />
<el-table-column :label="$t('工单类型')" align="center" prop="workorderType"> <el-table-column :label="$t('工单类型')" align="center" prop="workorderType">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.mes_workorder_type" :value="scope.row.workorderType" /> <dict-tag :options="dict.type.mes_workorder_type" :value="scope.row.workorderType" />
...@@ -78,7 +96,7 @@ ...@@ -78,7 +96,7 @@
@pagination="getList" @pagination="getList"
/> />
<div class="second-box" v-if="isShowSecond"> <div class="second-box" v-if="isShowSecond">
<el-table v-loading="loadingLeft" :data="tbodysLeft" border @row-click="secondTableClick" :max-height="tableHeightSecond" :row-class-name="tableRowClassName1"> <el-table v-loading="loadingLeft" :data="tbodysLeft" border @row-click="secondTableClick" :height="tableHeightSecond" :row-class-name="tableRowClassName1">
<el-table-column :label="$t('状态')" align="center" prop="status"></el-table-column> <el-table-column :label="$t('状态')" align="center" prop="status"></el-table-column>
<el-table-column :label="$t('工序名称')" align="center" prop="processName"></el-table-column> <el-table-column :label="$t('工序名称')" align="center" prop="processName"></el-table-column>
<el-table-column :label="$t('派工数量')" align="center" prop="quantity"></el-table-column> <el-table-column :label="$t('派工数量')" align="center" prop="quantity"></el-table-column>
...@@ -92,7 +110,7 @@ ...@@ -92,7 +110,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-table v-loading="loadingRight" :data="tbodysRight" border :max-height="tableHeightSecond" style="margin-left: 15px"> <el-table v-loading="loadingRight" :data="tbodysRight" border :height="tableHeightSecond" style="margin-left: 15px">
<el-table-column :label="$t('排产次数')" align="center" prop="taskBatch" > <el-table-column :label="$t('排产次数')" align="center" prop="taskBatch" >
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.taskBatch.split('-').length > 1 ? scope.row.taskBatch.split('-')[scope.row.taskBatch.split('-').length - 1]: ''}} {{scope.row.taskBatch.split('-').length > 1 ? scope.row.taskBatch.split('-')[scope.row.taskBatch.split('-').length - 1]: ''}}
...@@ -171,6 +189,7 @@ export default { ...@@ -171,6 +189,7 @@ export default {
lineName: null, lineName: null,
orderSerial: null, orderSerial: null,
taskBatch: null, taskBatch: null,
scheduleDate: null,
pageSize: 10, pageSize: 10,
defectStatus: true, defectStatus: true,
workOrderStatus: [], workOrderStatus: [],
...@@ -203,22 +222,53 @@ export default { ...@@ -203,22 +222,53 @@ export default {
created() { created() {
this.getList(); this.getList();
}, },
mounted(){ mounted() {
this.$nextTick(()=>{ this._resizeHandler = this.calcTableHeight
this._resizeHandler() this.$nextTick(() => this.calcTableHeight())
})
this._resizeHandler = () => {
this.tableHeight = (window.innerHeight / 2) - 120
this.tableHeightSecond = (window.innerHeight / 2) - 100
}
window.addEventListener('resize', this._resizeHandler) window.addEventListener('resize', this._resizeHandler)
}, },
beforeDestroy() { beforeDestroy() {
window.removeEventListener('resize', this._resizeHandler) window.removeEventListener('resize', this._resizeHandler)
}, },
watch: { watch: {
isShowSecond() {
this.$nextTick(() => this.calcTableHeight())
},
showSearch() {
this.$nextTick(() => this.calcTableHeight())
},
total() {
this.$nextTick(() => this.calcTableHeight())
}
}, },
methods: { methods: {
calcTableHeight() {
const appMain = document.querySelector('.app-main')
const viewportH = appMain ? appMain.clientHeight : window.innerHeight
let used = 40
const formEl = this.$refs.queryForm && this.$refs.queryForm.$el
if (formEl && this.showSearch) {
used += formEl.offsetHeight
}
const toolbarEl = this.$refs.toolbarRow && this.$refs.toolbarRow.$el
if (toolbarEl) {
used += toolbarEl.offsetHeight + 10
}
const paginationEl = this.$el.querySelector('.pagination-container')
if (paginationEl && this.total > 0) {
used += paginationEl.offsetHeight
}
const available = viewportH - used
if (this.isShowSecond) {
const mainH = Math.floor(available * 0.42)
const secondH = Math.floor(available * 0.52)
this.tableHeight = Math.max(200, mainH)
this.tableHeightSecond = Math.max(150, secondH)
} else {
this.tableHeight = Math.max(200, available)
this.tableHeightSecond = 0
}
},
mainTableClick(row){ mainTableClick(row){
this.loadingLeft = true; this.loadingLeft = true;
this.highlightRow = row; this.highlightRow = row;
...@@ -229,6 +279,7 @@ export default { ...@@ -229,6 +279,7 @@ export default {
this.tbodysLeft = response.rows this.tbodysLeft = response.rows
this.loadingLeft = false; this.loadingLeft = false;
this.isShowSecond = true this.isShowSecond = true
this.$nextTick(() => this.calcTableHeight())
}); });
this.secondTableClick(row) this.secondTableClick(row)
}, },
...@@ -266,18 +317,30 @@ export default { ...@@ -266,18 +317,30 @@ export default {
} }
return ''; return '';
}, },
buildQueryParams() {
const params = { ...this.queryParams, defectStatus: true }
if (this.daterangePurchaseDate && this.daterangePurchaseDate.length > 0) {
params.startDate = this.daterangePurchaseDate[0]
params.endDate = this.daterangePurchaseDate[1]
}
if (params.scheduleDate && params.scheduleDate.length > 0) {
params.scheduleDateFrom = params.scheduleDate[0]
params.scheduleDateTo = params.scheduleDate[1]
} else {
params.scheduleDateFrom = null
params.scheduleDateTo = null
}
delete params.scheduleDate
return params
},
/** 查询排产换型对照信息列表 */ /** 查询排产换型对照信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;
this.queryParams['defectStatus'] = true getList(this.buildQueryParams()).then(response => {
if (this.daterangePurchaseDate && this.daterangePurchaseDate.length > 0) {
this.queryParams['startDate'] = this.daterangePurchaseDate[0]
this.queryParams['endDate'] = this.daterangePurchaseDate[1]
}
getList(this.queryParams).then(response => {
this.tbodys = response.rows; this.tbodys = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
this.$nextTick(() => this.calcTableHeight())
}); });
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
...@@ -311,18 +374,17 @@ export default { ...@@ -311,18 +374,17 @@ export default {
handleExport(){ handleExport(){
this.download( this.download(
'report/pro/workOrderProgress/getList/export', 'report/pro/workOrderProgress/getList/export',
{ this.buildQueryParams(),
...this.queryParams,
},
`productProcess_${new Date().getTime()}.xlsx` `productProcess_${new Date().getTime()}.xlsx`
); );
} }
} }
}; };
</script>\ </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.second-box{ .second-box{
display: flex; display: flex;
margin-top: 10px;
} }
.mys-container { .mys-container {
.pagination-container { .pagination-container {
......
...@@ -16,6 +16,12 @@ ...@@ -16,6 +16,12 @@
<el-form-item :label="$t('订单号')" prop="orderCode"> <el-form-item :label="$t('订单号')" prop="orderCode">
<el-input v-model="queryParams.orderCode" :placeholder="$t('请输入订单号')" /> <el-input v-model="queryParams.orderCode" :placeholder="$t('请输入订单号')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('订单序号')" prop="orderSerial">
<el-input v-model="queryParams.orderSerial" :placeholder="$t('请输入')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('排产次数')" prop="taskBatch">
<el-input v-model="queryParams.taskBatch" :placeholder="$t('请输入')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('生产工单')" prop="workorderCode"> <el-form-item :label="$t('生产工单')" prop="workorderCode">
<el-input v-model="queryParams.workorderCode" :placeholder="$t('请输入生产工单')" /> <el-input v-model="queryParams.workorderCode" :placeholder="$t('请输入生产工单')" />
</el-form-item> </el-form-item>
...@@ -69,6 +75,18 @@ ...@@ -69,6 +75,18 @@
></el-button> ></el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('计划开始时间')" prop="scheduleStartDate">
<el-date-picker
v-model="queryParams.scheduleStartDate"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('common.start_date')"
:end-placeholder="$t('common.end_date')"
clearable>
</el-date-picker>
</el-form-item>
<el-form-item :label="$t('报工时间')"> <el-form-item :label="$t('报工时间')">
<el-date-picker v-model="daterangePurchaseDate" value-format="yyyy-MM-dd" type="daterange" range-separator="-" <el-date-picker v-model="daterangePurchaseDate" value-format="yyyy-MM-dd" type="daterange" range-separator="-"
:start-placeholder="$t('common.start_date')" :end-placeholder="$t('common.end_date')"></el-date-picker> :start-placeholder="$t('common.start_date')" :end-placeholder="$t('common.end_date')"></el-date-picker>
...@@ -88,6 +106,9 @@ ...@@ -88,6 +106,9 @@
<el-table-column :label="item.label" align="center" :prop="item.value" :width="item.width" v-for="(item, index) in theaders" :key="index"> <el-table-column :label="item.label" align="center" :prop="item.value" :width="item.width" v-for="(item, index) in theaders" :key="index">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.mes_workorder_type" :value="scope.row.workorderType" v-if="item.value==='workorderType'" /> <dict-tag :options="dict.type.mes_workorder_type" :value="scope.row.workorderType" v-if="item.value==='workorderType'" />
<span v-else-if="['scheduleStartDate','scheduleEndDate','feedbackTime'].includes(item.value)">
{{ parseTime(scope.row[item.value], '{y}-{m}-{d} {h}:{i}:{s}') }}
</span>
<div v-else>{{ item.value === 'machineTime' ? scope.row[item.value] ? Number(scope.row[item.value]).toFixed(2) : scope.row[item.value] : scope.row[item.value] }}</div> <div v-else>{{ item.value === 'machineTime' ? scope.row[item.value] ? Number(scope.row[item.value]).toFixed(2) : scope.row[item.value] : scope.row[item.value] }}</div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -214,6 +235,9 @@ import dayjs from 'dayjs' ...@@ -214,6 +235,9 @@ import dayjs from 'dayjs'
"customerProjectNo": null, "customerProjectNo": null,
"endDate": null, "endDate": null,
"orderCode": null, "orderCode": null,
"orderSerial": null,
"taskBatch": null,
scheduleStartDate: null,
"processName": null, "processName": null,
"processCode": null, "processCode": null,
"processId": null, "processId": null,
...@@ -285,7 +309,8 @@ import dayjs from 'dayjs' ...@@ -285,7 +309,8 @@ import dayjs from 'dayjs'
{label: i18n.t('实际工时'), value: 'machineTime', width: '80px'}, {label: i18n.t('实际工时'), value: 'machineTime', width: '80px'},
{label: i18n.t('排产次数'), value: 'taskBatch', width: '80px'}, {label: i18n.t('排产次数'), value: 'taskBatch', width: '80px'},
{label: i18n.t('订单序号'), value: 'orderSerial', width: '80px'}, {label: i18n.t('订单序号'), value: 'orderSerial', width: '80px'},
{label: i18n.t('计划完成时间'), value: 'scheduleEndDate', width: '100px'}, {label: i18n.t('计划开始时间'), value: 'scheduleStartDate', width: '160px'},
{label: i18n.t('计划完成时间'), value: 'scheduleEndDate', width: '160px'},
{label: i18n.t('报工时间'), value: 'feedbackTime', width: '100px'} {label: i18n.t('报工时间'), value: 'feedbackTime', width: '100px'}
] ]
this.handleQuery() this.handleQuery()
...@@ -328,16 +353,29 @@ import dayjs from 'dayjs' ...@@ -328,16 +353,29 @@ import dayjs from 'dayjs'
this.queryParams.productName = row.itemName; this.queryParams.productName = row.itemName;
} }
}, },
/** 查询排产换型对照信息列表 */ buildQueryParams() {
getList() { const params = { ...this.queryParams }
this.loading = true;
if (this.daterangePurchaseDate && this.daterangePurchaseDate.length > 0) { if (this.daterangePurchaseDate && this.daterangePurchaseDate.length > 0) {
this.queryParams['startDate'] = this.daterangePurchaseDate[0] params.startDate = this.daterangePurchaseDate[0]
this.queryParams['endDate'] = this.daterangePurchaseDate[1] params.endDate = this.daterangePurchaseDate[1]
} else { } else {
this.queryParams['startDate'] = null params.startDate = null
this.queryParams['endDate'] = null params.endDate = null
} }
if (params.scheduleStartDate && params.scheduleStartDate.length > 0) {
params.scheduleStartDateFrom = params.scheduleStartDate[0]
params.scheduleStartDateTo = params.scheduleStartDate[1]
} else {
params.scheduleStartDateFrom = null
params.scheduleStartDateTo = null
}
delete params.scheduleStartDate
return params
},
/** 查询排产换型对照信息列表 */
getList() {
this.loading = true;
const query = this.buildQueryParams()
let api = getList let api = getList
if (Number(this.tabIndex) === 1) { if (Number(this.tabIndex) === 1) {
if(this.statisisType === i18n.t('工单')){ if(this.statisisType === i18n.t('工单')){
...@@ -403,7 +441,7 @@ import dayjs from 'dayjs' ...@@ -403,7 +441,7 @@ import dayjs from 'dayjs'
api = getListByUser api = getListByUser
} }
} }
api(this.queryParams).then(response => { api(query).then(response => {
if (Number(this.tabIndex) === 1) { if (Number(this.tabIndex) === 1) {
this.tbodys1 = response.rows this.tbodys1 = response.rows
} }
...@@ -462,9 +500,7 @@ import dayjs from 'dayjs' ...@@ -462,9 +500,7 @@ import dayjs from 'dayjs'
} }
this.download( this.download(
apiName, apiName,
{ this.buildQueryParams(),
...this.queryParams,
},
`statistAnaly_${new Date().getTime()}.xlsx` `statistAnaly_${new Date().getTime()}.xlsx`
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment