123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <template>
- <div class="salesDetail-wrap">
- <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
- <template slot="subTitle">
- <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
- </template>
- <template slot="extra">
- <a-button key="4" type="primary" id="salesDetail-print-btn">快速打印</a-button>
- </template>
- </a-page-header>
- <!-- 基础信息 -->
- <a-card size="small" :bordered="false" class="salesDetail-cont">
- <a-collapse :activeKey="['1']">
- <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.salesBillExtEntity.shippingAddrProvinceName || '--' }}{{ detailData.salesBillExtEntity.shippingAddrCityName || '--' }}{{ detailData.salesBillExtEntity.shippingAddrCountyName || '--' }}{{ detailData.salesBillExtEntity.shippingAddr || '--' }}</a-descriptions-item>
- <a-descriptions-item label="收款方式">{{ detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
- <a-descriptions-item label="收货人">{{ detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
- <a-descriptions-item label="收货电话">{{ detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
- <a-descriptions-item label="备注">{{ detailData.remarks || '--' }}</a-descriptions-item>
- <a-descriptions-item label="审核时间">{{ detailData.auditDate || '--' }}</a-descriptions-item>
- <a-descriptions-item label="业务状态">{{ detailData.billStatusDictValue || '--' }}</a-descriptions-item>
- <a-descriptions-item label="财务状态">{{ detailData.financialStatusDictValue || '--' }}</a-descriptions-item>
- </a-descriptions>
- </a-collapse-panel>
- </a-collapse>
- </a-card>
- <a-card size="small" :bordered="false" class="pages-wrap">
- <!-- alert -->
- <a-alert type="info" style="margin-bottom: 15px;" v-if="detailData">
- <div slot="message">
- 总销售数量:<strong>{{ detailData.totalQty || 0 }}</strong>;已取消数量:<strong>{{ detailData.totalCancelQty || 0 }}</strong>;已下推数量:<strong>{{ detailData.totalPushedQty || 0 }}</strong>;待下推数量:<strong>{{ detailData.totalUnpushedQty || 0 }}</strong>;已发货数量:<strong>{{ detailData.totalDispatchQty || 0 }}</strong>;待发货数量:<strong>{{ detailData.totalUndispatchQty || 0 }}</strong>;<br/>
- 总售价:<strong>{{ detailData.totalAmount || 0 }}</strong>;总成本:<strong>{{ detailData.totalCost || 0 }}</strong>;总毛利:<strong>{{ detailData.grossProfit || 0 }}</strong>;已取消金额:<strong>{{ detailData.totalCancelAmount || 0 }}</strong>;已下推金额:<strong>{{ detailData.totalPushedAmount || 0 }}</strong>;待下推金额:<strong>{{ detailData.totalUnpushedAmount || 0 }};已发货金额:<strong>{{ detailData.totalDispatchAmount || 0 }};待发货金额:<strong>{{ detailData.totalUndispatchAmount || 0 }}</strong>;
- </strong></strong></div>
- </a-alert>
- <!-- 列表 -->
- <s-table
- class="sTable"
- ref="table"
- size="default"
- :rowKey="(record) => record.id"
- :columns="columns"
- :data="loadData"
- :scroll="{ y: 500 }"
- bordered>
- <!-- 产品编码 -->
- <template slot="productCode" slot-scope="text, record">
- <a-badge count="促" v-if="record.promotionFlag == 1">
- <div style="padding-right: 15px;">{{ text }}</div>
- </a-badge>
- <span v-else>{{ text }}</span>
- </template>
- </s-table>
- </a-card>
- </div>
- </template>
- <script>
- import { STable, VSelect } from '@/components'
- import { dispatchDetaillList, dispatchFindBySn } from '@/api/dispatch'
- export default {
- name: 'SalesDetail',
- components: { STable, VSelect },
- data () {
- return {
- disabled: false,
- // 表头
- columns: [
- { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
- { title: '产品编码', dataIndex: 'productCode', width: 140, scopedSlots: { customRender: 'productCode' }, 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: 'productOrigUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
- { title: '销售数量', dataIndex: 'salesQty', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
- { title: '本次下推数', dataIndex: 'qty', width: 200, align: 'center', customRender: function (text) { return text || '--' } }
- ],
- // 加载数据方法 必须为 Promise 对象
- loadData: parameter => {
- this.disabled = true
- return dispatchDetaillList(Object.assign(parameter, { dispatchBillSn: this.$route.params.sn })).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)
- const productOrigUnit = (data.list[i].productEntity && data.list[i].productEntity.unit) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.unit)
- data.list[i].productCode = productCode || '--'
- data.list[i].productName = productName || '--'
- data.list[i].productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
- data.list[i].productOrigUnit = productOrigUnit || '--'
- }
- this.disabled = false
- return data
- })
- },
- detailData: null // 详情数据
- }
- },
- methods: {
- // 返回
- handleBack () {
- this.$router.back()
- },
- // 详情
- getDetail () {
- dispatchFindBySn({ dispatchBillSn: this.$route.params.sn }).then(res => {
- if (res.status == 200) {
- this.detailData = res.data
- } else {
- this.detailData = null
- }
- })
- }
- },
- mounted () {
- this.getDetail()
- }
- }
- </script>
- <style lang="less">
- .salesDetail-wrap{
- .salesDetail-cont{
- margin-bottom: 15px;
- }
- .footer-cont{
- margin-top: 5px;
- text-align: center;
- }
- }
- </style>
|