|
@@ -0,0 +1,337 @@
|
|
|
+<template>
|
|
|
+ <div v-if="showPage" class="jg-page-wrap salesDetail-wrap">
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
+ <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
|
|
|
+ <!-- 自定义的二级文字标题 -->
|
|
|
+ <template slot="subTitle">
|
|
|
+ <span class="billno">【数字货架】:{{ 名称名称 }}</span>
|
|
|
+ <a-button type="link" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo" style="margin-left:10px;vertical-align:middle;">
|
|
|
+ <a-icon :type="isShowBisiceInfo ? 'eye-invisible' : 'eye'"/>
|
|
|
+ {{ isShowBisiceInfo?'隐藏':'查看' }}信息
|
|
|
+ </a-button>
|
|
|
+ <a-button id="purchaseNewOrderEdit-back-btn" type="link" @click="handleBack" class="button-default"> <a-icon type="rollback" /> 返回列表</a-button>
|
|
|
+ </template>
|
|
|
+ </a-page-header>
|
|
|
+ <div class="sales-detail-body">
|
|
|
+ <!-- 数据统计 -->
|
|
|
+ <a-card size="small" :bordered="false" class="salesDetail-cont" v-show="isShowBisiceInfo">
|
|
|
+ <a-descriptions size="small" :column="4">
|
|
|
+ <div slot="title" style="display:flex;justify-content:space-between;align-items:center;">
|
|
|
+ 数据统计
|
|
|
+ </div>
|
|
|
+ <a-descriptions-item label="账单总金额">{{ detailData&&detailData.consigneeTel || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="收款金额">{{ detailData&&detailData.remarks || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="退款中金额">{{ detailData&&detailData.salesBillNo || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="已退款金额">{{ detailData&&detailData.operatorName || '--' }}</a-descriptions-item>
|
|
|
+ </a-descriptions>
|
|
|
+ </a-card>
|
|
|
+ <a-card size="small" :bordered="false" class="pages-wrap">
|
|
|
+ <div ref="tableSearch" class="table-page-search-wrapper">
|
|
|
+ <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
+ <a-row :gutter="15">
|
|
|
+ <a-col :xl="6" :lg="6" :md="12" :sm="24">
|
|
|
+ <a-form-item label="下单时间">
|
|
|
+ <rangeDate id="unSettlement-time" ref="orderDate" :value="orderDate" @change="orderDateChange" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :xl="6" :lg="6" :md="12" :sm="24">
|
|
|
+ <a-form-item label="付款时间">
|
|
|
+ <rangeDate id="unSettlement-qhtime" ref="rangeDate" :value="time" @change="dateChange" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :xl="6" :lg="6" :md="12" :sm="24">
|
|
|
+ <a-form-item label="退款时间">
|
|
|
+ <rangeDate id="unSettlement-time" ref="orderDate" :value="orderDate" @change="orderDateChange" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :xl="6" :lg="6" :md="12" :sm="24">
|
|
|
+ <a-form-item label="采购单号">
|
|
|
+ <a-input id="unSettlement-orderNo" placeholder="请输入采购单号" v-model.trim="queryParam.orderBillNo" allowClear/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :xl="6" :lg="6" :md="12" :sm="24">
|
|
|
+ <a-form-item label="销售单号">
|
|
|
+ <a-input id="unSettlement-orderNo" placeholder="请输入销售单号" v-model.trim="queryParam.orderBillNo" allowClear/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="业务状态">
|
|
|
+ <v-select id="settle-settleType" code="SHELF_SETTLE_TYPE" v-model="queryParam.settleType" allowClear placeholder="请选择业务状态"></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="财务状态">
|
|
|
+ <v-select id="settle-settleType" code="SHELF_SETTLE_TYPE" v-model="queryParam.settleType" allowClear placeholder="请选择财务状态"></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="到账状态">
|
|
|
+ <v-select id="settle-settleType" code="SHELF_SETTLE_TYPE" v-model="queryParam.settleType" allowClear placeholder="请选择到账状态"></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :xl="24" :lg="24" :md="24" :sm="24" style="text-align:center;">
|
|
|
+ <a-button type="primary" @click="getRefresh" :disabled="disabled" id="withdrawa-refresh" >查询</a-button>
|
|
|
+ <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="withdrawa-reset">重置</a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+ <div style="margin-bottom:8px;">
|
|
|
+ 账单总金额:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;
|
|
|
+ 其中收款金额:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;
|
|
|
+ 退款中金额:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;
|
|
|
+ 已退款金额:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;
|
|
|
+ </div>
|
|
|
+ <!-- 列表 -->
|
|
|
+ <s-table
|
|
|
+ class="sTable"
|
|
|
+ ref="table"
|
|
|
+ size="small"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :columns="columns"
|
|
|
+ :data="loadData"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ bordered>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
+ <a-button
|
|
|
+ :id="'sales-detail-out-'+record.id"
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ v-if="record.oosFlag == 0 && (isOwerEdit || isAudit)"
|
|
|
+ class="button-primary"
|
|
|
+ @click="handleViewDetail(record)">出库明细</a-button>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
+ </a-card>
|
|
|
+ </div>
|
|
|
+ </a-spin>
|
|
|
+ <!-- 出入库明细 -->
|
|
|
+ <outInDetialModal ref="outInDetialModal" outBizType="SALES" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
|
|
|
+ <!-- 编辑备注 -->
|
|
|
+ <editRemarkModal :openModal="openEditModal" @close="openEditModal=false" @ok="handleEditOk"></editRemarkModal>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { commonMixin } from '@/utils/mixin'
|
|
|
+import { hdPrint } from '@/libs/JGPrint'
|
|
|
+// 组件
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
+import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
+import PrintPanel from '@/views/common/printPanel.vue'
|
|
|
+// 接口
|
|
|
+import { salesDetailBySn, salesDetailPrint, salesDetailExport } from '@/api/sales'
|
|
|
+import { salesDetailList } from '@/api/salesDetail'
|
|
|
+export default {
|
|
|
+ name: 'SalesDetail',
|
|
|
+ components: { STable, VSelect, PrintPanel, rangeDate },
|
|
|
+ mixins: [commonMixin],
|
|
|
+ props: {
|
|
|
+ outBizSn: { // 有值则为弹框,无值则为页面
|
|
|
+ type: [Number, String],
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ showPage: false, // 是否显示组件
|
|
|
+ spinning: false,
|
|
|
+ disabled: false,
|
|
|
+ showCost: false, // 是否显示成本价
|
|
|
+ printOrgCode: false, // 是否打印原创编码
|
|
|
+ printAllName: false, // 是否打印全部名称
|
|
|
+ printRemarks: false, // 是否打印备注
|
|
|
+ printPrice: false, // 是否打印价格
|
|
|
+ printNo: true, // 是否打印销售单号
|
|
|
+ showOutInModal: false, // 出库明细弹框
|
|
|
+ openEditModal: false, // 打开编辑备注弹窗
|
|
|
+ queryParam: {
|
|
|
+ shelfSn: undefined, // 货架sn
|
|
|
+ settleType: undefined, // 结算方式
|
|
|
+ customerName: undefined, // 客户名称
|
|
|
+ beginAmount: '', // 开始金额
|
|
|
+ endAmount: ''//
|
|
|
+ },
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ loadData: parameter => {
|
|
|
+ this.disabled = true
|
|
|
+ return salesDetailList(Object.assign(parameter, { orderBy: 'sales_bill_detail.CREATE_DATE desc', salesBillSn: this.outBizSn || this.$route.params.sn })).then(res => {
|
|
|
+ let data
|
|
|
+ if (res.status == 200) {
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ this.localDataSource = data.list
|
|
|
+ this.disabled = false
|
|
|
+ }
|
|
|
+ return data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ localDataSource: [], // 原始列表数据
|
|
|
+ detailData: null, // 详情数据
|
|
|
+ isShowBisiceInfo: false// 显示基础内容
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ // 是否自建单据
|
|
|
+ isOwerEdit () {
|
|
|
+ return this.detailData && this.detailData.sourceType == 'SALES'
|
|
|
+ },
|
|
|
+ // 是否审核通过
|
|
|
+ isAudit () {
|
|
|
+ return this.detailData ? (this.detailData.billStatus == 'WAIT_OUT_WAREHOUSE' || this.detailData.billStatus == 'FINISH') : false
|
|
|
+ },
|
|
|
+ // 列定义
|
|
|
+ columns () {
|
|
|
+ const _this = this
|
|
|
+ const arr = [
|
|
|
+ { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
+ { title: '下单时间', dataIndex: 'dealerProductEntity.code', width: '11%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
|
|
|
+ { title: '采购单号', dataIndex: 'productName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '关联销售单号', dataIndex: 'productOrigCode', width: '9%', align: 'center', customRender: function (text) { return text && text != ' ' ? text : '--' } },
|
|
|
+ { title: '财务收款单号', dataIndex: 'price', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '订单金额', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '结算方式', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '付款时间', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '退款时间', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '业务状态', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '财务状态', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '到账状态', dataIndex: 'oosFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
+ ]
|
|
|
+
|
|
|
+ return arr
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleEditOk () {
|
|
|
+ this.openEditModal = false
|
|
|
+ },
|
|
|
+ // 打印预览/快捷打印
|
|
|
+ handlePrint (type, printerType) {
|
|
|
+ const _this = this
|
|
|
+ _this.spinning = true
|
|
|
+ let url = salesDetailPrint
|
|
|
+ const params = {
|
|
|
+ sn: this.outBizSn || this.$route.params.sn,
|
|
|
+ printOrgCode: this.printOrgCode ? 1 : 0,
|
|
|
+ printAllName: this.printAllName ? 1 : 0,
|
|
|
+ remarksShowFlag: this.printRemarks ? 1 : 0,
|
|
|
+ printNo: this.printNo ? 1 : 0,
|
|
|
+ priceFlag: this.printPrice ? 1 : 0
|
|
|
+ }
|
|
|
+ if (type == 'export') { // 导出
|
|
|
+ url = salesDetailExport
|
|
|
+ }
|
|
|
+ // 打印或导出
|
|
|
+ hdPrint(printerType, type, url, params, '销售单', function () {
|
|
|
+ _this.spinning = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 返回
|
|
|
+ handleBack () {
|
|
|
+ this.$router.push({ name: 'onlinePayOrderList' })
|
|
|
+ },
|
|
|
+ // 详情
|
|
|
+ getDetail () {
|
|
|
+ salesDetailBySn({ salesBillSn: this.outBizSn || this.$route.params.sn }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.detailData = res.data
|
|
|
+ } else {
|
|
|
+ this.detailData = null
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 打开出入库明细
|
|
|
+ handleViewDetail (row) {
|
|
|
+ this.showOutInModal = true
|
|
|
+ this.$refs.outInDetialModal.getData(row)
|
|
|
+ },
|
|
|
+ // 页面初始
|
|
|
+ pageInit () {
|
|
|
+ const vm = this
|
|
|
+ vm.$nextTick(() => {
|
|
|
+ vm.spinning = false
|
|
|
+ vm.disabled = false
|
|
|
+ // 是否默认打印原厂编码
|
|
|
+ vm.printOrgCode = localStorage.getItem('printOrgCode-' + this.$store.state.user.info.orgId) == 'true'
|
|
|
+ vm.printAllName = localStorage.getItem('printAllName-' + this.$store.state.user.info.orgId) == 'true'
|
|
|
+ vm.printRemarks = localStorage.getItem('printRemarks-' + this.$store.state.user.info.orgId) == 'true'
|
|
|
+ vm.printPrice = localStorage.getItem('printPrice-' + this.$store.state.user.info.orgId) == 'true'
|
|
|
+ const printNo = localStorage.getItem('printNo-' + this.$store.state.user.info.orgId)
|
|
|
+ console.log(printNo)
|
|
|
+ vm.printNo = printNo ? printNo == 'true' : true
|
|
|
+ // 查询列表
|
|
|
+ vm.$refs.table.refresh(true)
|
|
|
+ // 获取单据详情
|
|
|
+ vm.getDetail()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ // 打印选项变化
|
|
|
+ printOrgCode (newValue, oldValue) {
|
|
|
+ localStorage.setItem('printOrgCode-' + this.$store.state.user.info.orgId, newValue)
|
|
|
+ },
|
|
|
+ printRemarks (newValue, oldValue) {
|
|
|
+ localStorage.setItem('printRemarks-' + this.$store.state.user.info.orgId, newValue)
|
|
|
+ },
|
|
|
+ printPrice (newValue, oldValue) {
|
|
|
+ localStorage.setItem('printPrice-' + this.$store.state.user.info.orgId, newValue)
|
|
|
+ },
|
|
|
+ printAllName (newValue, oldValue) {
|
|
|
+ localStorage.setItem('printAllName-' + this.$store.state.user.info.orgId, newValue)
|
|
|
+ },
|
|
|
+ printNo (newValue, oldValue) {
|
|
|
+ localStorage.setItem('printNo-' + this.$store.state.user.info.orgId, newValue)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ if (!this.$store.state.app.isNewTab || this.outBizSn) { // 页签刷新时调用
|
|
|
+ this.showPage = true
|
|
|
+ this.pageInit()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ activated () {
|
|
|
+ this.showPage = true
|
|
|
+ this.pageInit()
|
|
|
+ },
|
|
|
+ beforeRouteEnter (to, from, next) {
|
|
|
+ next(vm => {
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+ .salesDetail-wrap{
|
|
|
+ position: relative;
|
|
|
+ height: 100%;
|
|
|
+ .billno{
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 600;
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: middle;
|
|
|
+ color: #333;
|
|
|
+ margin-right: 15px;
|
|
|
+ }
|
|
|
+ .ant-tag-green,.ant-tag-orange{
|
|
|
+ vertical-align: middle;
|
|
|
+ }
|
|
|
+ .salesDetail-cont{
|
|
|
+ margin-bottom: 10px;
|
|
|
+ /deep/ .ant-descriptions-title{
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .pages-wrap{
|
|
|
+ strong{
|
|
|
+ color:#f12929;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+</style>
|