|
|
@ -46,10 +46,9 @@ |
|
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
<!-- 列表 --> |
|
|
<el-table :data="dataList" :height="height" border ref="mainTable" highlight-current-row v-loading="loading" style="width:100%" stripe> |
|
|
<el-table :data="dataList" :height="height" border ref="mainTable" highlight-current-row v-loading="loading" style="width:100%" stripe> |
|
|
<el-table-column fixed="right" :label="'操作'" header-align="center" align="center" width="220"> |
|
|
|
|
|
|
|
|
<el-table-column fixed="right" :label="'操作'" header-align="center" align="center" width="120"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<el-link style="cursor: pointer" v-if="scope.row.status === '已报价'" @click="openDialog(scope.row)">审批 </el-link> |
|
|
<el-link style="cursor: pointer" v-if="scope.row.status === '已报价'" @click="openDialog(scope.row)">审批 </el-link> |
|
|
<el-link style="cursor: pointer; margin-left: 8px;" v-if="scope.row.id" @click="openPriceSheet(scope.row)">价格表查询</el-link> |
|
|
|
|
|
<!-- <el-link style="cursor: pointer" v-if="scope.row.status === '已接受'" @click="openPartDialog(scope.row)"> 可供物料</el-link>--> |
|
|
<!-- <el-link style="cursor: pointer" v-if="scope.row.status === '已接受'" @click="openPartDialog(scope.row)"> 可供物料</el-link>--> |
|
|
|
|
|
|
|
|
<!-- <el-link style="cursor: pointer" @click="handleDelete(scope.row)">删除</el-link> --> |
|
|
<!-- <el-link style="cursor: pointer" @click="handleDelete(scope.row)">删除</el-link> --> |
|
|
@ -163,6 +162,32 @@ |
|
|
|
|
|
|
|
|
<!-- 标签页 --> |
|
|
<!-- 标签页 --> |
|
|
<el-tabs v-model="activeName" style="margin-top: 0px; width: 99%; padding: 0;" @tab-click="tabClick" class="customer-tab" type="border-card"> |
|
|
<el-tabs v-model="activeName" style="margin-top: 0px; width: 99%; padding: 0;" @tab-click="tabClick" class="customer-tab" type="border-card"> |
|
|
|
|
|
<el-tab-pane label="价格阶梯" name="tierPrice"> |
|
|
|
|
|
<el-table |
|
|
|
|
|
:data="tierPriceList" |
|
|
|
|
|
:height="tabHeight" |
|
|
|
|
|
border |
|
|
|
|
|
stripe |
|
|
|
|
|
v-loading="tierPriceLoading" |
|
|
|
|
|
style="width: 100%"> |
|
|
|
|
|
<el-table-column prop="qtyStart" label="开始数量" min-width="110" header-align="center" align="right"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{ formatNumber(scope.row.qtyStart) }} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="qtyEnd" label="结束数量" min-width="110" header-align="center" align="right"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{ formatNumber(scope.row.qtyEnd) }} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="unitPrice" label="价格" min-width="120" header-align="center" align="right"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{ formatNumber(scope.row.unitPrice) }} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="remark" label="备注" min-width="200" header-align="center" align="left" show-overflow-tooltip /> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
</el-tab-pane> |
|
|
<el-tab-pane label="附件" name="attachments"> |
|
|
<el-tab-pane label="附件" name="attachments"> |
|
|
<attachments ref="attachments" :height="tabHeight"></attachments> |
|
|
<attachments ref="attachments" :height="tabHeight"></attachments> |
|
|
</el-tab-pane> |
|
|
</el-tab-pane> |
|
|
@ -558,64 +583,6 @@ |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
<el-dialog |
|
|
|
|
|
title="价格表查询" |
|
|
|
|
|
:visible.sync="priceSheetDialogVisible" |
|
|
|
|
|
width="700px" |
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
v-drag |
|
|
|
|
|
append-to-body |
|
|
|
|
|
> |
|
|
|
|
|
<el-form :inline="true" label-position="top" class="price-sheet-header-form"> |
|
|
|
|
|
<el-form-item label="产品编码"> |
|
|
|
|
|
<el-input :value="displayText(priceSheetHeader.partNo)" disabled style="width: 140px" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="物料名称"> |
|
|
|
|
|
<el-input :value="displayText(priceSheetHeader.partDesc)" disabled style="width: 180px" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="价格日期"> |
|
|
|
|
|
<el-input :value="displayText(formatDateOnly(priceSheetHeader.priceDate))" disabled style="width: 120px" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="供应商编码"> |
|
|
|
|
|
<el-input :value="displayText(priceSheetHeader.supplierId)" disabled style="width: 120px" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="供应商名称"> |
|
|
|
|
|
<el-input :value="displayText(priceSheetHeader.supplierName)" disabled style="width: 160px" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="币种"> |
|
|
|
|
|
<el-input :value="displayText(priceSheetHeader.currency)" disabled style="width: 70px" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
|
|
<el-table |
|
|
|
|
|
:data="priceSheetDetailList" |
|
|
|
|
|
:height="320" |
|
|
|
|
|
border |
|
|
|
|
|
stripe |
|
|
|
|
|
v-loading="priceSheetLoading" |
|
|
|
|
|
style="width: 100%" |
|
|
|
|
|
> |
|
|
|
|
|
<el-table-column prop="qtyStart" label="开始数量" min-width="110" header-align="center" align="right"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{ formatNumber(scope.row.qtyStart) }} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="qtyEnd" label="结束数量" min-width="110" header-align="center" align="right"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{ formatNumber(scope.row.qtyEnd) }} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="unitPrice" label="价格" min-width="120" header-align="center" align="right"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{ formatNumber(scope.row.unitPrice) }} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="remark" label="备注" min-width="200" header-align="center" align="left" show-overflow-tooltip /> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
|
|
<el-button type="primary" @click="priceSheetDialogVisible = false">关闭</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
@ -650,6 +617,7 @@ export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
height: 200, |
|
|
height: 200, |
|
|
|
|
|
tabHeight: 300, |
|
|
loading: false, |
|
|
loading: false, |
|
|
submitLoading: false, |
|
|
submitLoading: false, |
|
|
dataList: [], |
|
|
dataList: [], |
|
|
@ -657,7 +625,7 @@ export default { |
|
|
pageSize: 20, |
|
|
pageSize: 20, |
|
|
totalPage: 0, |
|
|
totalPage: 0, |
|
|
currentRow: {}, |
|
|
currentRow: {}, |
|
|
activeName: 'attachments', |
|
|
|
|
|
|
|
|
activeName: 'tierPrice', |
|
|
searchData: { |
|
|
searchData: { |
|
|
site: this.$store.state.user.site, |
|
|
site: this.$store.state.user.site, |
|
|
createdBy: this.$store.state.user.name, |
|
|
createdBy: this.$store.state.user.name, |
|
|
@ -747,18 +715,8 @@ export default { |
|
|
overReceiveFlag: 'N', |
|
|
overReceiveFlag: 'N', |
|
|
overReceiveTolerance: 0 |
|
|
overReceiveTolerance: 0 |
|
|
}, |
|
|
}, |
|
|
priceSheetDialogVisible: false, |
|
|
|
|
|
priceSheetLoading: false, |
|
|
|
|
|
priceSheetHeader: { |
|
|
|
|
|
quotationReplyHistId: null, |
|
|
|
|
|
partNo: '', |
|
|
|
|
|
partDesc: '', |
|
|
|
|
|
priceDate: '', |
|
|
|
|
|
supplierId: '', |
|
|
|
|
|
supplierName: '', |
|
|
|
|
|
currency: '' |
|
|
|
|
|
}, |
|
|
|
|
|
priceSheetDetailList: [] |
|
|
|
|
|
|
|
|
tierPriceList: [], |
|
|
|
|
|
tierPriceLoading: false |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
@ -795,9 +753,35 @@ export default { |
|
|
this.currentRow = {site: '', orderNo: ''} |
|
|
this.currentRow = {site: '', orderNo: ''} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (this.activeName === 'tierPrice') { |
|
|
|
|
|
this.refreshTierPrice() |
|
|
|
|
|
} |
|
|
if (this.activeName === 'attachments') { |
|
|
if (this.activeName === 'attachments') { |
|
|
this.refreshAttachments() |
|
|
this.refreshAttachments() |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
// 价格阶梯页签:查询逻辑与报价记录的价格表查询一致 |
|
|
|
|
|
refreshTierPrice() { |
|
|
|
|
|
if (!this.currentRow || !this.currentRow.id) { |
|
|
|
|
|
this.tierPriceList = [] |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const params = { |
|
|
|
|
|
site: this.$store.state.user.site, |
|
|
|
|
|
quotationReplyHistId: this.currentRow.id |
|
|
|
|
|
} |
|
|
|
|
|
this.tierPriceLoading = true |
|
|
|
|
|
getPurReplyPriceSheet(params).then(({ data }) => { |
|
|
|
|
|
if (data && data.code === 0 && data.row) { |
|
|
|
|
|
this.tierPriceList = data.row.tierPriceList || [] |
|
|
|
|
|
} else { |
|
|
|
|
|
this.tierPriceList = [] |
|
|
|
|
|
} |
|
|
|
|
|
this.tierPriceLoading = false |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.tierPriceLoading = false |
|
|
|
|
|
this.tierPriceList = [] |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
refreshAttachments () { |
|
|
refreshAttachments () { |
|
|
console.log('刷新附件组件,当前行数据:', this.currentRow) |
|
|
console.log('刷新附件组件,当前行数据:', this.currentRow) |
|
|
@ -830,24 +814,6 @@ export default { |
|
|
if (value === null || value === undefined) return '-' |
|
|
if (value === null || value === undefined) return '-' |
|
|
return new Intl.NumberFormat('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(value) |
|
|
return new Intl.NumberFormat('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(value) |
|
|
}, |
|
|
}, |
|
|
displayText(value) { |
|
|
|
|
|
if (value === null || value === undefined || value === '') { |
|
|
|
|
|
return '-' |
|
|
|
|
|
} |
|
|
|
|
|
return value |
|
|
|
|
|
}, |
|
|
|
|
|
formatDateOnly(value) { |
|
|
|
|
|
if (!value) return '' |
|
|
|
|
|
if (typeof value === 'string') { |
|
|
|
|
|
return value.length >= 10 ? value.slice(0, 10) : value |
|
|
|
|
|
} |
|
|
|
|
|
const date = new Date(value) |
|
|
|
|
|
if (Number.isNaN(date.getTime())) { |
|
|
|
|
|
return '' |
|
|
|
|
|
} |
|
|
|
|
|
const pad = num => String(num).padStart(2, '0') |
|
|
|
|
|
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}` |
|
|
|
|
|
}, |
|
|
|
|
|
formatNumber(value) { |
|
|
formatNumber(value) { |
|
|
if (value === null || value === undefined || value === '') { |
|
|
if (value === null || value === undefined || value === '') { |
|
|
return '0' |
|
|
return '0' |
|
|
@ -858,51 +824,6 @@ export default { |
|
|
} |
|
|
} |
|
|
return String(Object.is(num, -0) ? 0 : num) |
|
|
return String(Object.is(num, -0) ? 0 : num) |
|
|
}, |
|
|
}, |
|
|
openPriceSheet(row) { |
|
|
|
|
|
if (!row || !row.id) { |
|
|
|
|
|
this.$message.warning('当前报价记录缺少主键,无法查询价格表') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const params = { |
|
|
|
|
|
site: this.$store.state.user.site, |
|
|
|
|
|
quotationReplyHistId: row.id |
|
|
|
|
|
} |
|
|
|
|
|
this.priceSheetDialogVisible = true |
|
|
|
|
|
this.priceSheetLoading = true |
|
|
|
|
|
this.priceSheetHeader = { |
|
|
|
|
|
quotationReplyHistId: row.id, |
|
|
|
|
|
partNo: row.partNo || '', |
|
|
|
|
|
partDesc: row.partDesc || '', |
|
|
|
|
|
priceDate: row.createdDate || '', |
|
|
|
|
|
supplierId: row.supplierId || '', |
|
|
|
|
|
supplierName: row.supplierName || '', |
|
|
|
|
|
currency: row.currency || '' |
|
|
|
|
|
} |
|
|
|
|
|
this.priceSheetDetailList = [] |
|
|
|
|
|
getPurReplyPriceSheet(params).then(({ data }) => { |
|
|
|
|
|
if (data && data.code === 0 && data.row) { |
|
|
|
|
|
const responseRow = data.row |
|
|
|
|
|
this.priceSheetHeader = { |
|
|
|
|
|
quotationReplyHistId: responseRow.quotationReplyHistId || row.id, |
|
|
|
|
|
partNo: responseRow.partNo || row.partNo || '', |
|
|
|
|
|
partDesc: responseRow.partDesc || row.partDesc || '', |
|
|
|
|
|
priceDate: responseRow.priceDate || row.createdDate || '', |
|
|
|
|
|
supplierId: responseRow.supplierId || row.supplierId || '', |
|
|
|
|
|
supplierName: responseRow.supplierName || row.supplierName || '', |
|
|
|
|
|
currency: responseRow.currency || row.currency || '' |
|
|
|
|
|
} |
|
|
|
|
|
this.priceSheetDetailList = responseRow.tierPriceList || [] |
|
|
|
|
|
} else { |
|
|
|
|
|
this.priceSheetDetailList = [] |
|
|
|
|
|
this.$message.error((data && data.msg) || '获取价格表失败') |
|
|
|
|
|
} |
|
|
|
|
|
this.priceSheetLoading = false |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.priceSheetLoading = false |
|
|
|
|
|
this.priceSheetDetailList = [] |
|
|
|
|
|
this.$message.error('获取价格表失败') |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
getList() { |
|
|
getList() { |
|
|
this.loading = true |
|
|
this.loading = true |
|
|
const params = { |
|
|
const params = { |
|
|
@ -1182,10 +1103,6 @@ export default { |
|
|
margin-right: 10px; |
|
|
margin-right: 10px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.price-sheet-header-form { |
|
|
|
|
|
margin-bottom: 8px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* 页签样式穿透 */ |
|
|
/* 页签样式穿透 */ |
|
|
/deep/ .customer-tab.el-tabs--border-card > .el-tabs__content { |
|
|
/deep/ .customer-tab.el-tabs--border-card > .el-tabs__content { |
|
|
padding: 0; |
|
|
padding: 0; |
|
|
|