2 changed files with 358 additions and 1 deletions
@ -0,0 +1,353 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<!-- 查询条件 --> |
|||
<el-form :inline="true" label-position="top" :model="searchData"> |
|||
<el-form-item label="客户编码"> |
|||
<el-input v-model="searchData.customerNo" clearable style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="客户名称"> |
|||
<el-input v-model="searchData.customerDesc" clearable style="width: 150px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="报价单号"> |
|||
<el-input v-model="searchData.quoteVersionNo" clearable style="width: 180px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="内部询价单号"> |
|||
<el-input v-model="searchData.insideInquiryNo" clearable style="width: 150px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="料号"> |
|||
<el-input v-model="searchData.partNo" clearable style="width: 150px"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" :model="searchData"> |
|||
<el-form-item label="项目号"> |
|||
<el-input v-model="searchData.projectNo" clearable style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="项目名称"> |
|||
<el-input v-model="searchData.projectDesc" clearable style="width: 150px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="报价专员"> |
|||
<el-input v-model="searchData.quoter" clearable style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="状态"> |
|||
<el-select v-model="searchData.status" clearable style="width: 100px"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option label="草稿" value="草稿"></el-option> |
|||
<el-option label="下达" value="下达"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="报价日期"> |
|||
<el-date-picker style="width: 130px" placeholder="开始日期" v-model="searchData.startDate" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd'></el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label=" "> |
|||
<el-date-picker style="width: 130px" placeholder="结束日期" v-model="searchData.endDate" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd'></el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label=" "> |
|||
<el-button plain type="primary" @click="handleSearch" :loading="searchLoading">查询</el-button> |
|||
<download-excel |
|||
:fields="exportFields()" |
|||
:data="exportData" |
|||
type="xls" |
|||
:name="exportName" |
|||
:fetch="createExportData" |
|||
:before-generate="startDownload" |
|||
:before-finish="finishDownload" |
|||
worksheet="报价明细查询" |
|||
class="el-button el-button--success el-button--medium"> |
|||
导出 |
|||
</download-excel> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<!-- 数据表格 --> |
|||
<el-table |
|||
:data="dataList" |
|||
border |
|||
:height="tableHeight" |
|||
v-loading="searchLoading" |
|||
style="width: 100%"> |
|||
<el-table-column type="index" label="序号" width="60" align="center" fixed></el-table-column> |
|||
<el-table-column prop="quoteVersionNo" label="报价单号" width="180" align="center" fixed show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="customerNo" label="客户编码" width="120" align="center"></el-table-column> |
|||
<el-table-column prop="customerDesc" label="客户名称" width="180" align="left" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="projectNo" label="项目号" width="120" align="center"></el-table-column> |
|||
<el-table-column prop="projectDesc" label="项目名称" width="180" align="left" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="status" label="状态" width="80" align="center"></el-table-column> |
|||
<el-table-column prop="plmPartNo" label="PLM物料编码" width="150" align="left" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="ifsPartNo" label="IFS物料编码" width="150" align="left" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="partDesc" label="物料名称" width="240" align="left" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="qty" label="MOQ" width="100" align="right"></el-table-column> |
|||
<el-table-column prop="adjustPartCost" label="材料成本" width="130" align="right"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.adjustPartCost | numberFormat }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="adjustLabourCost" label="人工成本" width="120" align="right"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.adjustLabourCost | numberFormat }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="adjustMachineCost" label="机器成本" width="120" align="right"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.adjustMachineCost | numberFormat }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="adjustToolCost" label="工具成本" width="120" align="right"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.adjustToolCost | numberFormat }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="adjustTestCost" label="测试成本" width="120" align="right"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.adjustTestCost | numberFormat }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="packCost" label="包装成本" width="120" align="right"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.packCost | numberFormat }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="shippingCost" label="运输成本" width="120" align="right"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.shippingCost | numberFormat }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="adjustElseCost" label="其他成本" width="120" align="right"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.adjustElseCost | numberFormat }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="totalCost" label="总成本" width="120" align="right"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.totalCost | numberFormat }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="finalTransactionPrice" label="最终交易价" width="120" align="right"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.finalTransactionPrice | numberFormat }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="quoteProfitRate" label="VA%" width="100" align="right"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.quoteProfitRate | numberFormat }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="quoteProfitAmount" label="Contribution%" width="120" align="right"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.quoteProfitAmount | numberFormat }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="quoteTaxRate" label="Margin%" width="100" align="right"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.quoteTaxRate | numberFormat }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="quoteTaxTotalPrice" label="Price ¥(ex VAT)" width="130" align="right"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.quoteTaxTotalPrice | numberFormat }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="unitPrice" label="未税单价" width="120" align="right"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.unitPrice | numberFormat }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="taxRate" label="税率" width="100" align="right"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.taxRate | numberFormat }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="taxUnitPrice" label="含税单价(CNY)" width="130" align="right"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.taxUnitPrice | numberFormat }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<!-- 分页 --> |
|||
<el-pagination |
|||
@size-change="handleSizeChange" |
|||
@current-change="handleCurrentChange" |
|||
:current-page="pageIndex" |
|||
:page-sizes="[20, 50, 100, 200, 500]" |
|||
:page-size="pageSize" |
|||
:total="total" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
style="margin-top: 0px"> |
|||
</el-pagination> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import {queryQuoteDetailReport} from "@/api/quote/quoteDetail"; |
|||
|
|||
export default { |
|||
name: "quoteDetailReport", |
|||
filters: { |
|||
numberFormat(value) { |
|||
if (!value && value !== 0) return '' |
|||
return Number(value).toLocaleString('en-US', { |
|||
minimumFractionDigits: 2, |
|||
maximumFractionDigits: 6 |
|||
}) |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
searchData: { |
|||
site: this.$store.state.user.site, |
|||
customerNo: '', |
|||
customerDesc: '', |
|||
quoteVersionNo: '', |
|||
insideInquiryNo: '', |
|||
partNo: '', |
|||
projectNo: '', |
|||
projectDesc: '', |
|||
quoter: '', |
|||
status: '', |
|||
startDate: '', |
|||
endDate: '' |
|||
}, |
|||
dataList: [], |
|||
pageIndex: 1, |
|||
pageSize: 50, |
|||
total: 0, |
|||
searchLoading: false, |
|||
exportLoading: false, |
|||
tableHeight: window.innerHeight - 213, |
|||
exportData: [], |
|||
exportName: '报价明细查询_' + new Date().getTime() |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.handleSearch() |
|||
}, |
|||
methods: { |
|||
handleSearch() { |
|||
this.searchLoading = true |
|||
let params = { |
|||
...this.searchData, |
|||
page: this.pageIndex, |
|||
limit: this.pageSize |
|||
} |
|||
// 为LIKE查询添加通配符 |
|||
if (params.quoteVersionNo) params.quoteVersionNo = '%' + params.quoteVersionNo + '%' |
|||
if (params.customerNo) params.customerNo = '%' + params.customerNo + '%' |
|||
if (params.customerDesc) params.customerDesc = '%' + params.customerDesc + '%' |
|||
if (params.projectNo) params.projectNo = '%' + params.projectNo + '%' |
|||
if (params.projectDesc) params.projectDesc = '%' + params.projectDesc + '%' |
|||
if (params.quoter) params.quoter = '%' + params.quoter + '%' |
|||
if (params.insideInquiryNo) params.insideInquiryNo = '%' + params.insideInquiryNo + '%' |
|||
if (params.partNo) params.partNo = '%' + params.partNo + '%' |
|||
|
|||
queryQuoteDetailReport(params).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.dataList = data.page.list |
|||
this.total = data.page.totalCount |
|||
this.pageIndex = data.page.currPage |
|||
this.pageSize = data.page.pageSize |
|||
} else { |
|||
this.$message.error(data.msg || '查询失败') |
|||
} |
|||
this.searchLoading = false |
|||
}).catch((error) => { |
|||
this.$message.error(error || '查询失败') |
|||
this.searchLoading = false |
|||
}) |
|||
}, |
|||
handleSizeChange(val) { |
|||
this.pageSize = val |
|||
this.handleSearch() |
|||
}, |
|||
handleCurrentChange(val) { |
|||
this.pageIndex = val |
|||
this.handleSearch() |
|||
}, |
|||
async createExportData() { |
|||
let params = { |
|||
...this.searchData, |
|||
page: 1, |
|||
limit: -1 |
|||
} |
|||
// 为LIKE查询添加通配符 |
|||
if (params.quoteVersionNo) params.quoteVersionNo = '%' + params.quoteVersionNo + '%' |
|||
if (params.customerNo) params.customerNo = '%' + params.customerNo + '%' |
|||
if (params.customerDesc) params.customerDesc = '%' + params.customerDesc + '%' |
|||
if (params.projectNo) params.projectNo = '%' + params.projectNo + '%' |
|||
if (params.projectDesc) params.projectDesc = '%' + params.projectDesc + '%' |
|||
if (params.quoter) params.quoter = '%' + params.quoter + '%' |
|||
if (params.insideInquiryNo) params.insideInquiryNo = '%' + params.insideInquiryNo + '%' |
|||
if (params.partNo) params.partNo = '%' + params.partNo + '%' |
|||
|
|||
await queryQuoteDetailReport(params).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.exportData = data.page.list |
|||
} |
|||
}) |
|||
return this.exportData |
|||
}, |
|||
startDownload() { |
|||
this.exportLoading = true |
|||
}, |
|||
finishDownload() { |
|||
this.exportLoading = false |
|||
this.$message.success('导出成功') |
|||
}, |
|||
exportFields() { |
|||
return { |
|||
'报价单号': 'quoteVersionNo', |
|||
'客户编码': 'customerNo', |
|||
'客户名称': 'customerDesc', |
|||
'项目号': 'projectNo', |
|||
'项目名称': 'projectDesc', |
|||
'状态': 'status', |
|||
'PLM物料编码': 'plmPartNo', |
|||
'IFS物料编码': 'ifsPartNo', |
|||
'物料名称': 'partDesc', |
|||
'MOQ': 'qty', |
|||
'材料成本': 'adjustPartCost', |
|||
'人工成本': 'adjustLabourCost', |
|||
'机器成本': 'adjustMachineCost', |
|||
'工具成本': 'adjustToolCost', |
|||
'测试成本': 'adjustTestCost', |
|||
'包装成本': 'packCost', |
|||
'运输成本': 'shippingCost', |
|||
'其他成本': 'adjustElseCost', |
|||
'总成本': 'totalCost', |
|||
'最终交易价': 'finalTransactionPrice', |
|||
'VA%': 'quoteProfitRate', |
|||
'Contribution%': 'quoteProfitAmount', |
|||
'Margin%': 'quoteTaxRate', |
|||
'Price ¥(ex VAT)': 'quoteTaxTotalPrice', |
|||
'未税单价': 'unitPrice', |
|||
'税率': 'taxRate', |
|||
'含税单价(CNY)': 'taxUnitPrice' |
|||
} |
|||
}, |
|||
handleReset() { |
|||
this.searchData = { |
|||
site: this.$store.state.user.site, |
|||
customerNo: '', |
|||
customerDesc: '', |
|||
quoteVersionNo: '', |
|||
insideInquiryNo: '', |
|||
partNo: '', |
|||
projectNo: '', |
|||
projectDesc: '', |
|||
quoter: '', |
|||
status: '', |
|||
startDate: '', |
|||
endDate: '' |
|||
} |
|||
this.pageIndex = 1 |
|||
this.handleSearch() |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.mod-config { |
|||
/* 无额外样式,使用系统默认 */ |
|||
} |
|||
</style> |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue