<template>
    <view class="page-body">
        <!-- 顶部信息卡片 -->
        <view class="card-header">
            <!-- 顶部信息卡片第一行 -->
            <view class="uni-flex ai-center jc-between fs12">
                <!-- 左侧 -->
                <span>门店名称：{{dataDetail.SHOPNAME || ''}}</span>
                <!-- 右侧 -->
                <span>长短款额：{{dataDetail.DIFFERENT_PRICE !== null ?
                    dataDetail.DIFFERENT_PRICE : ''}}</span>
            </view>
            <!-- 顶部信息卡片第二行 -->
            <view class="uni-flex ai-center jc-between fs12">
                <!-- 左侧 -->
                <span>服务区名称：{{dataDetail.SERVERPART_NAME || ''}}</span>
                <!-- 右侧 -->
                <span>稽查类型：{{dataDetail.CHECK_TYPE || ''}}</span>
            </view>
        </view>
        <!-- 详情信息 -->
        <view class="modle-title">
            <h2>现场稽核异常</h2>
        </view>
        <!-- 详情信息卡片 -->
        <view class="content-detail-box main-card ino-flex ai-center uni-column">
            <!-- 单列样式 -->
            <!-- 省份编码 -->
            <view class="cellTopStyle">
                <span class="fourth-name">省份编码：</span>
                <span>{{dataDetail.PROVINCE_CODE !== null ?
                    dataDetail.PROVINCE_CODE : ''}}</span>
            </view>
            <!-- 服务区编码 -->
            <view class="cellTopStyle">
                <span class="fourth-name">服务区编码：</span>
                <span>{{dataDetail.SERVERPARTCODE || ''}}</span>
            </view>
            <!-- 服务区名称 -->
            <view class="cellTopStyle">
                <span class="fourth-name">服务区名称：</span>
                <span>{{dataDetail.SERVERPART_NAME || ''}}</span>
            </view>
            <!-- 门店编码 -->
            <view class="cellTopStyle">
                <span class="fourth-name">门店编码：</span>
                <span>{{dataDetail.SHOPCODE || ''}}</span>
            </view>
            <!-- 门店名称 -->
            <view class="cellTopStyle">
                <span class="fourth-name">门店名称：</span>
                <span>{{dataDetail.SHOPNAME || ''}}</span>
            </view>
            <!-- 收银机号 -->
            <view class="cellTopStyle">
                <span class="fourth-name">收银机号：</span>
                <span>{{dataDetail.MACHINECODE || ''}}</span>
            </view>
            <!-- 日结时间 -->
            <view class="cellTopStyle">
                <span class="fourth-name">日结时间：</span>
                <span>{{dataDetail.ENDACCOUNT_DATE ?
                    this.$util.changeStringToDate(dataDetail.ENDACCOUNT_DATE.toString()) : ''}}</span>
            </view>
            <!-- 稽查时间 -->
            <view class="cellTopStyle">
                <span class="fourth-name">稽查时间：</span>
                <span>{{dataDetail.CHECK_ENDDATE ?
                    this.$util.changeStringToDate(dataDetail.CHECK_ENDDATE.toString()) : ''}}</span>
            </view>
            <!-- 销售起始时间 -->
            <view class="cellTopStyle">
                <span class="fourth-name">销售起始时间：</span>
                <span>{{dataDetail.CHECK_STARTDATE ?
                    this.$util.changeStringToDate(dataDetail.CHECK_STARTDATE.toString()) : ''}}</span>
            </view>
            <!-- 间隔时长 -->
            <view class="cellTopStyle">
                <span class="fourth-name">间隔时长：</span>
                <span>{{dataDetail.TIME_INTERVAL !== null ?
                    dataDetail.TIME_INTERVAL : ''}}</span>
            </view>
            <!-- 异常类型 -->
            <view class="cellTopStyle">
                <span class="fourth-name">异常类型：</span>
                <span>{{dataDetail.ABNORMALAUDIT_TYPE !== null ?
                    abnormalauditType[dataDetail.ABNORMALAUDIT_TYPE] : ''}}</span>
            </view>
            <!-- 抹平状态 -->
            <view class="cellTopStyle">
                <span class="fourth-name">抹平状态：</span>
                <span>{{dataDetail.ERASE_TYPE !== null ?
                    eraseType[dataDetail.ERASE_TYPE] : ''}}</span>
            </view>
            <!-- 对客营收 -->
            <view class="cellTopStyle">
                <span class="fourth-name">对客营收：</span>
                <span>{{dataDetail.TOTALSELLAMOUNT !== null ?
                    dataDetail.TOTALSELLAMOUNT : ''}}</span>
            </view>
            <!-- 对客现金 -->
            <view class="cellTopStyle">
                <span class="fourth-name">对客现金：</span>
                <span>{{dataDetail.CASH_PAYMENT !== null ?
                    dataDetail.CASH_PAYMENT : ''}}</span>
            </view>
            <!-- 稽核金额 -->
            <view class="cellTopStyle">
                <span class="fourth-name">稽核金额：</span>
                <span>{{dataDetail.CHECK_CASHPAY !== null ?
                    dataDetail.CHECK_CASHPAY : ''}}</span>
            </view>
            <!-- 长短款额 -->
            <view class="cellTopStyle">
                <span class="fourth-name">长短款额：</span>
                <span>{{dataDetail.DIFFERENT_PRICE !== null ?
                    dataDetail.DIFFERENT_PRICE : ''}}</span>
            </view>
            <!-- 流水冲正金额 -->
            <view class="cellTopStyle">
                <span class="fourth-name">流水冲正金额：</span>
                <span>{{dataDetail.REPLENISH_AMOUNT !== null ?
                    dataDetail.REPLENISH_AMOUNT : ''}}</span>
            </view>
            <!-- 账期总销售额 -->
            <view class="cellTopStyle">
                <span class="fourth-name">账期总销售额：</span>
                <span>{{dataDetail.ENDACCOUNT_REVENUE !== null ?
                    dataDetail.ENDACCOUNT_REVENUE : ''}}</span>
            </view>
            <!-- 稽查类型 -->
            <view class="cellTopStyle">
                <span class="fourth-name">稽查类型：</span>
                <span>{{dataDetail.CHECK_TYPE || ''}}</span>
            </view>
            <!-- 是否打印小票（0：否；1：是） -->
            <view class="cellTopStyle">
                <span class="fourth-name">是否打印小票：</span>
                <span>{{dataDetail.PRINTBILL_STATE !== null ?
                    dataDetail.PRINTBILL_STATE : ''}}</span>
            </view>
            <!-- 是否推送提醒（0：否；1：是） -->
            <view class="cellTopStyle">
                <span class="fourth-name">是否推送提醒：</span>
                <span>{{dataDetail.PUSH_STATE !== null ?
                    dataDetail.PUSH_STATE : ''}}</span>
            </view>
            <!-- 稽查人名称 -->
            <view class="cellTopStyle">
                <span class="fourth-name">稽查人名称：</span>
                <span>{{dataDetail.WORKER_NAME || ''}}</span>
            </view>
            <!-- 收银员名称 -->
            <view class="cellTopStyle">
                <span class="fourth-name">收银员名称：</span>
                <span>{{dataDetail.CASHIER_NAME || ''}}</span>
            </view>
            <!-- 上传时间 -->
            <view class="cellTopStyle">
                <span class="fourth-name">上传时间：</span>
                <span>{{dataDetail.DOWNLOAD_DATE ? dataDetail.DOWNLOAD_DATE.replace('T',' ') : ''}}</span>
            </view>
            <!-- 有效状态 -->
            <view class="cellTopStyle">
                <span class="fourth-name">有效状态：</span>
                <span>{{dataDetail.ABNORMALAUDIT_VALID !== null ?
                    isvalid[dataDetail.ABNORMALAUDIT_VALID] : ''}}</span>
            </view>
            <!-- 备注 -->
            <view class="cellTopStyle">
                <span class="fourth-name">备注：</span>
                <span>{{dataDetail.ABNORMALAUDIT_DESC || ''}}</span>
            </view>
        </view>
    </view>
</template>
<script>
    import {mapGetters,mapMutations} from 'vuex'
    export default {
        data() {
            return {
                pageData: {
                    type: null,
                    id: null
                },
                loading: true,
                abnormalauditType: null,
                eraseType: null,
                isvalid: null,
                dataDetail: {},
            }
        },
        methods: {
            ...mapMutations(['shouldReLoadingList']),
            /**
             * 调用接口获取数据详情
             * 
             * Api接口地址：EShangApiMain/Audit/GetABNORMALAUDITDetail
             */
            getDetail(option) {
                this.$request.$webGetTest("EShangApiMain/Audit/GetABNORMALAUDITDetail", {
                    //这里设置接口参数
                    ABNORMALAUDITId: option.ABNORMALAUDITId,
                })
                .then(res => {
                    uni.hideLoading()
                    this.loading = false
                    if (res.Result_Code !== 100) {
                        return
                    }
                    this.dataDetail = res.Result_Data
                })
            },
            // 获取数据异常类型枚举
            async getType() {
                this.abnormalauditType = await this.$util.getFieldEnumByField({
                    FieldExplainField: 'ABNORMALAUDIT_TYPE'
                })
                this.eraseType = await this.$util.getFieldEnumByField({
                    FieldExplainField: 'ERASE_TYPE'
                })
                this.isvalid = await this.$util.getFieldEnumByField({
                    FieldExplainField: 'ISVALID'
                })
            }
        },
        onLoad(option) {
            uni.showLoading()
            this.pageData = option
            this.loading = true
            this.getType()
            this.getDetail(option)
            this.$forceUpdate()
        }
    }
</script>
<style scoped>
    .page-body {
        min-height: 100%;
        padding: 40rpx 25rpx;
        background-color: #fff;
        box-sizing: border-box;
        padding-bottom: 196rpx;
    }
    .card-header {
        border-radius: 10rpx;
        margin: 0 26rpx 22rpx 26rpx;
        background: linear-gradient(to right, #8998bb 0%, #a9b5d2 100%);
        color: #FFFFFF;
        padding: 24rpx 16rpx;
    }
    .card-header h3 {
        padding-bottom: 10rpx;
        font-size: 30rpx;
    }
    .card-header .fs12>text {
        font-size: 24rpx;
    }
    .cellTopStyle {
        line-height: 45rpx;
        width: 100%;
        display: flex;
        align-items: center; //上下对齐
        justify-content: space-between; //两端对齐
    }
    .fourth-name {
        min-width: 120rpx;
        max-width: 140rpx;
        color: #ADB2BF;
        font-size: 26rpx;
        white-space: nowrap;
    }
    .modle-title {
        color: #000;
        padding: 36rpx 30rpx 24rpx 30rpx;
        font-size: 26rpx;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .modle-title h2 {
        font-weight: bolder;
    }
    .content-detail-box {
        margin: 0 26rpx 22rpx 26rpx;
        background: #ffffff;
        border-radius: 8rpx;
        box-shadow: 0rpx 2rpx 8rpx 0rpx rgba(231, 231, 231, 0.67);
        overflow: hidden;
        position: relative;
        padding: 10rpx 30rpx 16rpx 30rpx;
        font-size: 26rpx;
    }
        .content-detail-box span {
        font-size: 26rpx;
    }
</style>
