auditDialog.vue 2.72 KB
<template>
  <div v-if="auditObj.show">
    <GLDialog
      mode="small"
      title="批次审核"
      :visible.sync="auditObj.show"
      :before-close="handleClose"
    >
      <template #default>
        <div class="audit-content flex">
          <div class="title">请和财务确认是否已收到以下门店积分打款</div>
          <div class="info flex">{{auditObj.row.merchantName}}:
            <div class="price flex">
              {{auditObj.row.totalIntegral}}<div class="unit">元</div>
            </div>
          </div>
          <el-checkbox
            v-model="checked"
            class="check-box"
          >
            已确认收款
          </el-checkbox>
          <div class="tips">审核通过后客户积分将实时发放,无法撤销。</div>
        </div>
      </template>
      <template #footer>
        <el-button
          size="small"
          @click="handleClose"
        >否,未收到款项,关闭弹窗</el-button>
        <el-button
          type="primary"
          size="small"
          @click="handleConfirm"
        >是,已确认收到款项,赠送积分</el-button>
      </template>
    </GLDialog>
  </div>
</template>

<script type='text/ecmascript-6'>
export default {
  name: '',

  props: {
    auditObj: {
      type: Object,
      default: () => { }
    }
  },
  data () {
    return {
      loading: false,
      checked: false
    }
  },
  mounted () {

  },
  methods: {
    handleClose () {
      this.checked = false
      this.$emit('update:auditObj', {})
    },
    async handleConfirm () {
      const { checked } = this,
        { id } = this.auditObj.row
      if (checked) {
        this.$loading()
        try {
          const res = await this.$apis.points.auditIntegral({ id })
          if (res) {
            this.handleClose()
            this.$message.success('操作成功')
            this.$parent.handleSearch()
          }
          this.$loading().close()
        } catch (error) {
          this.$loading().close()
          if (error) this.$message.error(error)
        }
      } else this.$message.error('请先勾选确认收款')
    }
  }
}
</script>

<style scoped lang='scss'>
.audit-content {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  .title {
    font-size: 16px;
    color: #333333;
  }
  .check-box {
    font-size: 14px;
    color: #333333;
  }
  .info {
    align-items: center;
    font-size: 16px;
    color: #333333;
    margin: 16px 0 10px;
    .price {
      align-items: center;
      font-weight: 600;
      font-size: 26px;
      color: #eb4e4e;
      .unit {
        font-weight: 400;
        font-size: 16px;
      }
    }
  }
  .tips {
    font-size: 14px;
    color: #999999;
    margin-top: 10px;
  }
}
</style>