|
@@ -2,7 +2,10 @@
|
|
|
<div class="salesReturnDetail-wrap">
|
|
|
<a-page-header :ghost="false" :backIcon="false" class="salesReturnDetail-cont">
|
|
|
<template slot="subTitle">
|
|
|
- <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
|
|
|
+ <a href="javascript:;" @click="handleBack">
|
|
|
+ <a-icon type="left"></a-icon>
|
|
|
+ 返回列表
|
|
|
+ </a>
|
|
|
</template>
|
|
|
<template slot="extra">
|
|
|
<a-button key="3" id="salesReturnDetail-preview-btn">打印预览</a-button>
|
|
@@ -16,11 +19,13 @@
|
|
|
<a-collapse-panel key="1" header="基础信息">
|
|
|
<a-descriptions size="small" :column="3" v-if="detailData">
|
|
|
<a-descriptions-item label="客户名称">{{ detailData.buyerName || '--' }}</a-descriptions-item>
|
|
|
- <a-descriptions-item label="客户地址">{{ detailData.provinceName || '--' }}{{ detailData.cityName || '--' }}{{ detailData.countyName || '--' }}{{ detailData.customerAddr || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="客户地址">
|
|
|
+ {{ detailData.provinceName || '--' }}{{ detailData.cityName || '--' }}{{ detailData.countyName || '--' }}{{ detailData.customerAddr || '--' }}
|
|
|
+ </a-descriptions-item>
|
|
|
<a-descriptions-item label="联系电话">{{ detailData.contactTel || '--' }}</a-descriptions-item>
|
|
|
<a-descriptions-item label="备注">{{ detailData.remarks || '--' }}</a-descriptions-item>
|
|
|
- <a-descriptions-item label="退货单号">{{ detailData.salesReturnNo || '--' }}</a-descriptions-item>
|
|
|
- <a-descriptions-item label="业务状态">{{ detailData.stateDictValue || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="退货单号">{{ detailData.salesReturnBillNo || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="业务状态">{{ detailData.billStatusDictValue || '--' }}</a-descriptions-item>
|
|
|
</a-descriptions>
|
|
|
</a-collapse-panel>
|
|
|
</a-collapse>
|
|
@@ -29,8 +34,23 @@
|
|
|
<!-- alert -->
|
|
|
<a-alert type="info" style="margin-bottom: 10px;" v-if="detailData">
|
|
|
<div slot="message">
|
|
|
- 总款数:<strong>{{ countData.totalCategory || 0 }}</strong>;总数量:<strong>{{ countData.totalQty || 0 }}</strong>;废品数量:<strong>{{ countData.totalCelQty || 0 }}</strong>;<br/>
|
|
|
- 退货总金额:<strong>{{ countData.totalAmount || 0 }}</strong>;折扣金额:<strong>{{ countData.discountAmount || 0 }}</strong>;折扣:<strong>{{ countData.discountRate || 0 }}%</strong>;折后金额:<strong>{{ countData.discountedAmount || 0 }}</strong>;
|
|
|
+ 总款数:
|
|
|
+ <strong>{{ countData.totalCategory || 0 }}</strong>
|
|
|
+ ;总数量:
|
|
|
+ <strong>{{ countData.totalQty || 0 }}</strong>
|
|
|
+ ;废品数量:
|
|
|
+ <strong>{{ countData.totalCelQty || 0 }}</strong>
|
|
|
+ ;
|
|
|
+ <br />
|
|
|
+ 退货总金额:
|
|
|
+ <strong>{{ countData.totalAmount || 0 }}</strong>
|
|
|
+ ;折扣金额:
|
|
|
+ <strong>{{ countData.discountAmount || 0 }}</strong>
|
|
|
+ ;折扣:
|
|
|
+ <strong>{{ countData.discountRate || 0 }}%</strong>
|
|
|
+ ;折后金额:
|
|
|
+ <strong>{{ countData.discountedAmount || 0 }}</strong>
|
|
|
+ ;
|
|
|
</div>
|
|
|
</a-alert>
|
|
|
<!-- 列表 -->
|
|
@@ -38,12 +58,11 @@
|
|
|
class="sTable"
|
|
|
ref="table"
|
|
|
size="default"
|
|
|
- :rowKey="(record) => record.id"
|
|
|
+ :rowKey="record => record.id"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
:scroll="{ x: 1430 }"
|
|
|
- bordered>
|
|
|
- </s-table>
|
|
|
+ bordered></s-table>
|
|
|
</a-card>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -51,7 +70,8 @@
|
|
|
<script>
|
|
|
import { getOperationalPrecision } from '@/libs/tools.js'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
-import { salesReturnDetail, salesReturnQueryCount, salesReturnDetailList } from '@/api/salesReturn'
|
|
|
+import { salesReturnDetail } from '@/api/salesReturn'
|
|
|
+import { salesReturnDetailList } from '@/api/salesReturnDetail'
|
|
|
export default {
|
|
|
name: 'SalesReturnDetail',
|
|
|
components: { STable, VSelect },
|
|
@@ -62,36 +82,103 @@ export default {
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center' },
|
|
|
- { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '折后售价', dataIndex: 'discountedPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '退货数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '废品数量', dataIndex: 'celQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '入库数量', dataIndex: 'rkqty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '退货金额小计', dataIndex: 'saleReturnSubtotal', width: 120, align: 'center' },
|
|
|
- { title: '折扣金额', dataIndex: 'discountAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '折后退货金额小计', dataIndex: 'discountedAmount', width: 150, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
+ {
|
|
|
+ title: '采购单号',
|
|
|
+ dataIndex: 'purchaseBillNo',
|
|
|
+ align: 'center',
|
|
|
+ width: 200
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '产品编码',
|
|
|
+ dataIndex: 'dealerProductEntity.code',
|
|
|
+ align: 'center',
|
|
|
+ width: 160
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '产品名称',
|
|
|
+ dataIndex: 'dealerProductEntity.name',
|
|
|
+ align: 'center',
|
|
|
+ width: 200
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '售价',
|
|
|
+ dataIndex: 'price',
|
|
|
+ width: 100,
|
|
|
+ align: 'center',
|
|
|
+ customRender: function (text) {
|
|
|
+ return '¥' + (text || 0)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '退货数量',
|
|
|
+ dataIndex: 'qty',
|
|
|
+ width: 100,
|
|
|
+ align: 'center',
|
|
|
+ customRender: function (text) {
|
|
|
+ return text || text == 0 ? text : '--'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '坏件数量',
|
|
|
+ dataIndex: 'badQty',
|
|
|
+ width: 100,
|
|
|
+ align: 'center',
|
|
|
+ customRender: function (text) {
|
|
|
+ return text || text == 0 ? text : '--'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '返库数量',
|
|
|
+ dataIndex: 'backStockQty',
|
|
|
+ width: 100,
|
|
|
+ align: 'center',
|
|
|
+ customRender: function (text) {
|
|
|
+ return text || text == 0 ? text : '--'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '单位',
|
|
|
+ dataIndex: 'dealerProductEntity.unit',
|
|
|
+ align: 'center',
|
|
|
+ width: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '退货金额小计',
|
|
|
+ dataIndex: 'saleReturnSubtotal',
|
|
|
+ width: 120,
|
|
|
+ align: 'center',
|
|
|
+ customRender: function (text) {
|
|
|
+ return '¥' + (text || 0)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '批次',
|
|
|
+ dataIndex: 'batchNo',
|
|
|
+ width: 100,
|
|
|
+ align: 'center',
|
|
|
+ customRender: function (text) {
|
|
|
+ return text || text == 0 ? text : '--'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '退货原因',
|
|
|
+ dataIndex: 'remarks',
|
|
|
+ width: 150,
|
|
|
+ align: 'center',
|
|
|
+ customRender: function (text) {
|
|
|
+ return text || text == 0 ? text : '--'
|
|
|
+ }
|
|
|
+ }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
const params = Object.assign(parameter, { salesReturnBillSn: this.$route.params.sn })
|
|
|
- this.getQueryCount(params)
|
|
|
return salesReturnDetailList(params).then(res => {
|
|
|
const data = res.data
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
|
- const productCode = (data.list[i].productEntity && data.list[i].productEntity.code) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.code)
|
|
|
- const productName = (data.list[i].productEntity && data.list[i].productEntity.name) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.name)
|
|
|
- const productOrigCode = (data.list[i].productEntity && data.list[i].productEntity.origCode) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.origCode)
|
|
|
- data.list[i].productCode = productCode || '--'
|
|
|
- data.list[i].productName = productName || '--'
|
|
|
- data.list[i].productOrigCode = productOrigCode || '--'
|
|
|
- // 退货数量和入库数量取值同一个字段,因表格使用统一字段会报错,因此重新定义
|
|
|
- data.list[i].rkqty = data.list[i].qty || 0
|
|
|
// 折后退货金额小计 由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
|
|
|
data.list[i].saleReturnSubtotal = getOperationalPrecision(data.list[i].price, data.list[i].qty)
|
|
|
}
|
|
@@ -107,12 +194,6 @@ export default {
|
|
|
handleBack () {
|
|
|
this.$router.push({ name: 'salesReturnList' })
|
|
|
},
|
|
|
- // 明细统计
|
|
|
- getQueryCount (params) {
|
|
|
- salesReturnQueryCount(params).then(res => {
|
|
|
- this.countData = res.data || null
|
|
|
- })
|
|
|
- },
|
|
|
// 详情
|
|
|
getDetail () {
|
|
|
salesReturnDetail({ sn: this.$route.params.sn }).then(res => {
|
|
@@ -131,9 +212,9 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
|
- .salesReturnDetail-wrap{
|
|
|
- .salesReturnDetail-cont{
|
|
|
- margin-bottom: 10px;
|
|
|
- }
|
|
|
+.salesReturnDetail-wrap {
|
|
|
+ .salesReturnDetail-cont {
|
|
|
+ margin-bottom: 10px;
|
|
|
}
|
|
|
+}
|
|
|
</style>
|