|
|
|
@ -38,22 +38,17 @@ |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="' '"> |
|
|
|
<el-button @click="search()" style="margin-left: 0px;margin-top: 0px" type="primary">查询</el-button> |
|
|
|
<download-excel |
|
|
|
:fields="exportDataStandard" |
|
|
|
:data="tableData" |
|
|
|
type="xlsx" |
|
|
|
:name="exportName" |
|
|
|
:header="exportHeader" |
|
|
|
:footer="exportFooter" |
|
|
|
:defaultValue="exportDefaultValue" |
|
|
|
:fetch="createExportData" |
|
|
|
:before-generate="startDownload" |
|
|
|
:before-finish="finishDownload" |
|
|
|
worksheet="导出信息" |
|
|
|
class="el-button el-button--primary el-button--medium"> |
|
|
|
{{'导出'}} |
|
|
|
</download-excel> |
|
|
|
<el-button @click="search()" style="margin-left: 0px;margin-top: 0px" type="primary">查询</el-button> |
|
|
|
<!-- rqrq - 与 cancelSfdc 一致:columnList + fields() 动态导出 --> |
|
|
|
<download-excel |
|
|
|
:fields="fields()" |
|
|
|
type="xlsx" |
|
|
|
:name="exportName" |
|
|
|
:fetch="createExportData" |
|
|
|
worksheet="导出信息" |
|
|
|
class="el-button el-button--primary el-button--medium"> |
|
|
|
导出 |
|
|
|
</download-excel> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-table |
|
|
|
@ -62,207 +57,157 @@ |
|
|
|
border |
|
|
|
style="width: 100%"> |
|
|
|
<el-table-column |
|
|
|
prop="site" |
|
|
|
v-for="(item,index) in columnList" |
|
|
|
:key="index" |
|
|
|
:sortable="item.columnSortable" |
|
|
|
:prop="item.columnProp" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
min-width="60" |
|
|
|
|
|
|
|
label="工厂编码"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="orderNo" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
min-width="140" |
|
|
|
|
|
|
|
label="日计划单号"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="orderDate" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
min-width="70" |
|
|
|
label="计划日期"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="orderRef1" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
min-width="90" |
|
|
|
label="订单号"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="partNo" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
min-width="70" |
|
|
|
label="物料编码"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="partDescription" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
min-width="200" |
|
|
|
label="物料名称"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="orderQty" |
|
|
|
header-align="center" |
|
|
|
align="right" |
|
|
|
min-width="60" |
|
|
|
label="计划数量"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="partPlanQty" |
|
|
|
header-align="center" |
|
|
|
align="right" |
|
|
|
min-width="60" |
|
|
|
label="班产量"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="shiftQty" |
|
|
|
header-align="center" |
|
|
|
align="right" |
|
|
|
min-width="60" |
|
|
|
label="计划班数"> |
|
|
|
:show-overflow-tooltip="item.showOverflowTooltip" |
|
|
|
:align="item.align" |
|
|
|
:fixed="item.fixed==''?false:item.fixed" |
|
|
|
:min-width="item.columnWidth" |
|
|
|
:label="item.columnLabel"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{scope.row.partPlanQty<=0?0:(scope.row.orderQty*1.0/scope.row.partPlanQty).toFixed(1)}} |
|
|
|
<span v-if="item.slotKey === 'shiftQty'" v-show="!item.columnHidden"> |
|
|
|
{{ shiftQtyFmt(scope.row) }} |
|
|
|
</span> |
|
|
|
<span v-else-if="!item.columnHidden && !item.columnImage"> |
|
|
|
{{ scope.row[item.columnProp] }} |
|
|
|
</span> |
|
|
|
<span v-if="item.columnImage"> |
|
|
|
<img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/> |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="orderQty" |
|
|
|
header-align="center" |
|
|
|
align="right" |
|
|
|
min-width="60" |
|
|
|
label="计划数量"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="weight" |
|
|
|
header-align="center" |
|
|
|
align="right" |
|
|
|
min-width="60" |
|
|
|
label="参考数量"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="qtyfinished" |
|
|
|
header-align="center" |
|
|
|
align="right" |
|
|
|
min-width="70" |
|
|
|
label="混炼胶数"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="taskNo" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
min-width="120" |
|
|
|
label="混炼任务单"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="userName" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
min-width="50" |
|
|
|
label="录入人"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="enterDate" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
min-width="100" |
|
|
|
label="录入时间"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="reportTime" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
min-width="100" |
|
|
|
label="报工时间"> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
getDailyPlanData |
|
|
|
} from "@/api/production.js" |
|
|
|
/** |
|
|
|
* rqrq - 列配置常量:增删列、改中文名仅此维护;表格与导出共用 |
|
|
|
*/ |
|
|
|
const DAILY_PLAN_COLUMN_SPECS = [ |
|
|
|
{ prop: 'site', label: '工厂编码', width: 60, align: 'left', tooltip: true }, |
|
|
|
{ prop: 'orderNo', label: '日计划单号', width: 140, align: 'left', tooltip: true }, |
|
|
|
{ prop: 'orderDate', label: '计划日期', width: 70, align: 'left' }, |
|
|
|
{ prop: 'orderRef1', label: '订单号', width: 90, align: 'left', tooltip: true }, |
|
|
|
{ prop: 'partNo', label: '物料编码', width: 70, align: 'left', tooltip: true }, |
|
|
|
{ prop: 'partDescription', label: '物料名称', width: 200, align: 'left', tooltip: true }, |
|
|
|
{ prop: 'orderQty', label: '计划数量', width: 60, align: 'right' }, |
|
|
|
{ prop: 'partPlanQty', label: '班产量', width: 60, align: 'right' }, |
|
|
|
{ prop: 'shiftQty', label: '计划班数', width: 60, align: 'right', slotKey: 'shiftQty' }, |
|
|
|
{ prop: 'weight', label: '参考数量', width: 60, align: 'right' }, |
|
|
|
{ prop: 'qtyfinished', label: '混炼胶数', width: 70, align: 'right' }, |
|
|
|
{ prop: 'taskNo', label: '混炼任务单', width: 120, align: 'left', tooltip: true }, |
|
|
|
{ prop: 'userName', label: '录入人', width: 50, align: 'left' }, |
|
|
|
{ prop: 'enterDate', label: '录入时间', width: 100, align: 'left', tooltip: true }, |
|
|
|
{ prop: 'reportTime', label: '报工时间', width: 100, align: 'left', tooltip: true } |
|
|
|
] |
|
|
|
|
|
|
|
import { |
|
|
|
getDailyPlanData |
|
|
|
} from '@/api/production.js' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'stockPrint', |
|
|
|
data () { |
|
|
|
return { |
|
|
|
// 导出 start |
|
|
|
exportData: [], |
|
|
|
exportDataStandard: { |
|
|
|
"日计划单号": "orderNo", |
|
|
|
"计划日期": "orderDate", |
|
|
|
"订单号": "orderRef1", |
|
|
|
"物料编码": "partNo", |
|
|
|
"物料名称": "partDescription", |
|
|
|
"计划数量": "orderQty", |
|
|
|
"已完工数": "qtyfinished", |
|
|
|
"录入人": "userName", |
|
|
|
"录入时间": "enterDate" |
|
|
|
}, |
|
|
|
exportName: "日计划列表"+this.getStrDate(), |
|
|
|
exportHeader: ["日计划列表"], |
|
|
|
exportFooter: [], |
|
|
|
exportDefaultValue: "", |
|
|
|
// 导出 end |
|
|
|
height:200, |
|
|
|
tableData:[], |
|
|
|
date1:'', |
|
|
|
searchData:{ |
|
|
|
orderNo:'', |
|
|
|
orderRef1:'', |
|
|
|
partNo:'', |
|
|
|
startDate1:new Date(), |
|
|
|
endDate1:'', |
|
|
|
taskNo:'', |
|
|
|
status:'all', |
|
|
|
site:'', |
|
|
|
}, |
|
|
|
export default { |
|
|
|
name: 'stockPrint', |
|
|
|
computed: { |
|
|
|
// rqrq - 结构与 cancelSfdcForWareHouse.columnList 一致 |
|
|
|
columnList () { |
|
|
|
const vm = this |
|
|
|
return DAILY_PLAN_COLUMN_SPECS.map(spec => ({ |
|
|
|
tableId: 'dailyPlanSearchList', |
|
|
|
tableName: vm.$route.meta.title, |
|
|
|
columnProp: spec.prop, |
|
|
|
columnLabel: spec.label, |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
columnWidth: spec.width, |
|
|
|
format: null, |
|
|
|
functionId: vm.$route.meta.menuId, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
serialNumber: null, |
|
|
|
columnType: null, |
|
|
|
align: spec.align || 'left', |
|
|
|
showOverflowTooltip: !!spec.tooltip, |
|
|
|
slotKey: spec.slotKey || '' |
|
|
|
})) |
|
|
|
} |
|
|
|
}, |
|
|
|
data () { |
|
|
|
return { |
|
|
|
exportName: '日计划列表' + this.getStrDate(), |
|
|
|
height: 200, |
|
|
|
tableData: [], |
|
|
|
date1: '', |
|
|
|
searchData: { |
|
|
|
orderNo: '', |
|
|
|
orderRef1: '', |
|
|
|
partNo: '', |
|
|
|
startDate1: new Date(), |
|
|
|
endDate1: '', |
|
|
|
taskNo: '', |
|
|
|
status: 'all', |
|
|
|
site: '' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.height = window.innerHeight - 210 |
|
|
|
}) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
shiftQtyFmt (row) { |
|
|
|
const pp = Number(row.partPlanQty) |
|
|
|
const oq = Number(row.orderQty) |
|
|
|
if (!(pp > 0)) { |
|
|
|
return 0 |
|
|
|
} |
|
|
|
return (oq * 1.0 / pp).toFixed(1) |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.$nextTick(()=>{ |
|
|
|
this.height = window.innerHeight - 210; |
|
|
|
/** rqrq - 动态导出列映射(cancelSfdc 同款) */ |
|
|
|
fields () { |
|
|
|
let json = '{' |
|
|
|
this.columnList.forEach((item, index) => { |
|
|
|
if (index === this.columnList.length - 1) { |
|
|
|
json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' |
|
|
|
} else { |
|
|
|
json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ',' |
|
|
|
} |
|
|
|
}) |
|
|
|
json += '}' |
|
|
|
return eval('(' + json + ')') |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
search(){ |
|
|
|
getDailyPlanData(this.searchData).then(({data}) => { |
|
|
|
this.tableData = data.rows; |
|
|
|
}) |
|
|
|
}, |
|
|
|
createExportData() { |
|
|
|
|
|
|
|
return this.tableData; |
|
|
|
}, |
|
|
|
startDownload() { |
|
|
|
// this.exportData = this.dataList |
|
|
|
|
|
|
|
}, |
|
|
|
finishDownload() { |
|
|
|
|
|
|
|
}, |
|
|
|
getStrDate() { |
|
|
|
let dd = new Date(); |
|
|
|
let Y = dd.getFullYear(); |
|
|
|
let M = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1);//获取当前月份的日期,不足10补0 |
|
|
|
let D = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();//获取当前几号,不足10补0 |
|
|
|
let H = dd.getHours() < 10 ? "0" + dd.getHours() : dd.getHours(); |
|
|
|
let MM = dd.getMinutes() < 10 ? "0" + dd.getMinutes() : dd.getMinutes(); |
|
|
|
let S = dd.getSeconds() < 10 ? "0" + dd.getSeconds() : dd.getSeconds(); |
|
|
|
return Y + M + D + H + MM + S; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** rqrq - 导出时为「计划班数」补充计算字段 shiftQty */ |
|
|
|
createExportData () { |
|
|
|
return this.tableData.map(row => { |
|
|
|
const shiftQty = this.shiftQtyFmt(row) |
|
|
|
return Object.assign({}, row, { shiftQty }) |
|
|
|
}) |
|
|
|
}, |
|
|
|
search () { |
|
|
|
getDailyPlanData(this.searchData).then(({ data }) => { |
|
|
|
this.tableData = data.rows |
|
|
|
}) |
|
|
|
}, |
|
|
|
created() { |
|
|
|
getStrDate () { |
|
|
|
const dd = new Date() |
|
|
|
const Y = dd.getFullYear() |
|
|
|
const M = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1) |
|
|
|
const D = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate() |
|
|
|
const H = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours() |
|
|
|
const MM = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes() |
|
|
|
const S = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds() |
|
|
|
return Y + '' + M + D + H + MM + S |
|
|
|
} |
|
|
|
}, |
|
|
|
created () { |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped> |
|
|
|
|