|
@@ -0,0 +1,317 @@
|
|
|
+<template>
|
|
|
+ <div id="cash_check">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <el-col :span="24" class="one">
|
|
|
+ <el-col :span="24" class="top">
|
|
|
+ <el-button type="primary" size="mini" @click="toFlow">查看意见</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="back">返回</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="down">
|
|
|
+ <el-form :model="form" :rules="rules" ref="form" label-width="100px">
|
|
|
+ <el-col :span="12" class="text">
|
|
|
+ <el-form-item label="订单号" prop="no">
|
|
|
+ <el-input v-model="form.no" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="text">
|
|
|
+ <el-form-item label="兑付单位" prop="company">
|
|
|
+ <el-input v-model="form.company" placeholder="" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="text">
|
|
|
+ <el-form-item label="申请人" prop="apply_person">
|
|
|
+ <el-input v-model="form.apply_person" placeholder="" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="text">
|
|
|
+ <el-form-item label="联系电话" prop="phone">
|
|
|
+ <el-input v-model="form.phone" placeholder="" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="text">
|
|
|
+ <el-form-item label="选择创新券">
|
|
|
+ <el-select v-model="form.coupons_id" placeholder="" disabled>
|
|
|
+ <el-option v-for="item in couponsapplyList" :key="item._id" :label="item.name" :value="item._id"> </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="text">
|
|
|
+ <el-form-item label="订单金额" prop="money">
|
|
|
+ <el-input type="text" oninput="value=value.replace(/[^\d]/g,'')" v-model="form.money" clearable style="width: 96%" disabled></el-input>
|
|
|
+ <span style="padding: 0 5px">元</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="text">
|
|
|
+ <el-form-item label="券抵扣金额" prop="allowance">
|
|
|
+ <el-input type="text" oninput="value=value.replace(/[^\d]/g,'')" v-model="form.allowance" clearable style="width: 96%" disabled></el-input>
|
|
|
+ <span style="padding: 0 5px">元</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="text">
|
|
|
+ <el-form-item label="应收金额" prop="total">
|
|
|
+ <el-input type="text" oninput="value=value.replace(/[^\d]/g,'')" v-model="form.total" clearable style="width: 96%" disabled></el-input>
|
|
|
+ <span style="padding: 0 5px">元</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="text">
|
|
|
+ <el-form-item label="最后提交时间" prop="create_time">
|
|
|
+ <el-input v-model="form.create_time" placeholder="" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="text">
|
|
|
+ <el-form-item label="最后审核时间" prop="end_time">
|
|
|
+ <el-input v-model="form.end_time" placeholder="" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="file">
|
|
|
+ <el-col :span="24" class="file_title"> 相关附件 </el-col>
|
|
|
+ <el-col :span="24" class="text">
|
|
|
+ <el-col :span="24" class="left">1.创新券服务合同</el-col>
|
|
|
+ <el-col :span="24" class="right">
|
|
|
+ <el-col :span="4" v-for="(i, index) in form.contract" :key="`contract-${index}`">
|
|
|
+ <img v-if="isImg(i.url)" :src="i.url" width="150px" height="150px" @click="toOpen(i.url)" />
|
|
|
+ <el-link v-else type="primary" @click="toOpen(i.url)"> <i class="el-icon-view"></i> {{ i.name }} </el-link>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="text">
|
|
|
+ <el-col :span="24" class="left">2.官方缴费证明</el-col>
|
|
|
+ <el-col :span="24" class="right">
|
|
|
+ <el-col :span="4" v-for="(i, index) in form.accept" :key="`accept-${index}`">
|
|
|
+ <img v-if="isImg(i.url)" :src="i.url" width="150px" height="150px" @click="toOpen(i.url)" />
|
|
|
+ <el-link v-else type="primary" @click="toOpen(i.url)"> <i class="el-icon-view"></i> {{ i.name }} </el-link>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="text">
|
|
|
+ <el-col :span="24" class="left">3.创新券服务合同</el-col>
|
|
|
+ <el-col :span="24" class="right">
|
|
|
+ <el-col :span="4" v-for="(i, index) in form.cost" :key="`cost-${index}`">
|
|
|
+ <img v-if="isImg(i.url)" :src="i.url" width="150px" height="150px" @click="toOpen(i.url)" />
|
|
|
+ <el-link v-else type="primary" @click="toOpen(i.url)"> <i class="el-icon-view"></i> {{ i.name }} </el-link>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="text">
|
|
|
+ <el-col :span="24" class="left">4.服务结果证明</el-col>
|
|
|
+ <el-col :span="24" class="right">
|
|
|
+ <el-col :span="4" v-for="(i, index) in form.result" :key="`result-${index}`">
|
|
|
+ <img v-if="isImg(i.url)" :src="i.url" width="150px" height="150px" @click="toOpen(i.url)" />
|
|
|
+ <el-link v-else type="primary" @click="toOpen(i.url)"> <i class="el-icon-view"></i> {{ i.name }} </el-link>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="text">
|
|
|
+ <el-col :span="24" class="left">5.其他能够证明服务真实发生的材料</el-col>
|
|
|
+ <el-col :span="24" class="right">
|
|
|
+ <el-col :span="4" v-for="(i, index) in form.result_else" :key="`result_else-${index}`">
|
|
|
+ <img v-if="isImg(i.url)" :src="i.url" width="150px" height="150px" @click="toOpen(i.url)" />
|
|
|
+ <el-link v-else type="primary" @click="toOpen(i.url)"> <i class="el-icon-view"></i> {{ i.name }} </el-link>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="text">
|
|
|
+ <el-col :span="1" class="left"> 审核状态</el-col>
|
|
|
+ <el-col :span="23" class="right">
|
|
|
+ <el-radio-group v-model="form.status">
|
|
|
+ <el-radio v-for="(i, index) in statusList" :key="`status-${index}`" :label="i.value">{{ i.label }}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="text" v-if="dataStatus == '0'">
|
|
|
+ <el-col :span="1" class="left"> 审核意见</el-col>
|
|
|
+ <el-col :span="23" class="right">
|
|
|
+ <el-input v-model="form.desc" type="textarea" maxlength="300" :autosize="{ minRows: 4, maxRows: 6 }" show-word-limit></el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="formBtn" v-if="dataStatus == '0'">
|
|
|
+ <el-button type="danger" size="mini" @click="back">取消保存</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="onSubmit('form')">确认订单</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-form>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-dialog title="意见" :visible.sync="dialog" :destroy-on-close="true">
|
|
|
+ <flow :list="recordList"></flow>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import flow from './parts/cash_flow.vue';
|
|
|
+const moment = require('moment');
|
|
|
+const { cashStatus } = require('@common/dict/couindex');
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: coupons } = createNamespacedHelpers('coupons');
|
|
|
+const { mapActions: mapCashing } = createNamespacedHelpers('cashing');
|
|
|
+export default {
|
|
|
+ name: 'cash_check',
|
|
|
+ props: {},
|
|
|
+ components: {
|
|
|
+ flow,
|
|
|
+ },
|
|
|
+ data: function () {
|
|
|
+ return {
|
|
|
+ form: {},
|
|
|
+ dataStatus: '0',
|
|
|
+ rules: {},
|
|
|
+ couponsapplyList: [],
|
|
|
+ imgList: ['jpg', 'jpeg', 'png', 'bmp', 'gif'],
|
|
|
+ statusList: cashStatus,
|
|
|
+ // 意见
|
|
|
+ dialog: false,
|
|
|
+ recordList: [],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.searchOther();
|
|
|
+ if (this.id) this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...coupons({ couponsQuery: 'query' }),
|
|
|
+ ...mapCashing(['fromFetch', 'update']),
|
|
|
+ async search() {
|
|
|
+ let res = await this.fromFetch(this.id);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `form`, res.data);
|
|
|
+ this.$set(this, `dataStatus`, res.data.status);
|
|
|
+ this.$set(this, `recordList`, res.data.record);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onSubmit(formName) {
|
|
|
+ this.$refs[formName].validate(async (valid) => {
|
|
|
+ if (valid) {
|
|
|
+ let data = this.form;
|
|
|
+ data.status = '1';
|
|
|
+ data.end_time = this.nowDate();
|
|
|
+ let arr = this.couponsapplyList.find((i) => i.id == data.coupons_id);
|
|
|
+ if (this.$checkRes(arr)) {
|
|
|
+ if (arr.discount_type == '全额折扣券') {
|
|
|
+ data.money = Number(data.money);
|
|
|
+ data.allowance = Number(data.money);
|
|
|
+ data.total = 0;
|
|
|
+ } else if (arr.discount_type == '折扣券') {
|
|
|
+ data.money = Number(data.money);
|
|
|
+ data.allowance = (Number(data.money) * Number(arr.scale)) / 100;
|
|
|
+ data.total = Number(data.money) - data.allowance;
|
|
|
+ } else if (arr.discount_type == '定额券') {
|
|
|
+ data.money = Number(data.money);
|
|
|
+ data.allowance = Number(arr.allowance);
|
|
|
+ data.total = Number(data.money - arr.allowance);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let newRecord = this.getRecord(data);
|
|
|
+ data.record = data.record.concat(newRecord);
|
|
|
+ let res = await this.update(data);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({
|
|
|
+ message: '兑付确认成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ this.back();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log('error submit!!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ back() {
|
|
|
+ this.$router.push({ path: '/adminCenter/reward', query: { type: this.type } });
|
|
|
+ },
|
|
|
+ // 最后审核时间
|
|
|
+ nowDate() {
|
|
|
+ return moment().format('YYYY-MM-DD HH:mm:ss');
|
|
|
+ },
|
|
|
+ // 审核列表整合
|
|
|
+ getRecord(data) {
|
|
|
+ let arr = [{ status: data.status, desc: data.desc, desc_time: moment().format('YYYY-MM-DD HH:mm:ss') }];
|
|
|
+ return arr;
|
|
|
+ },
|
|
|
+ isImg(url) {
|
|
|
+ const arr = url.split('.');
|
|
|
+ const suffix = _.last(arr);
|
|
|
+ return this.imgList.includes(suffix);
|
|
|
+ },
|
|
|
+ toOpen(url) {
|
|
|
+ window.open(url);
|
|
|
+ },
|
|
|
+ // 查询其他
|
|
|
+ async searchOther() {
|
|
|
+ let res = await this.couponsQuery();
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `couponsapplyList`, res.data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 查看意见
|
|
|
+ toFlow() {
|
|
|
+ this.dialog = true;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ id() {
|
|
|
+ return this.$route.query.id;
|
|
|
+ },
|
|
|
+ type() {
|
|
|
+ return this.$route.query.type;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ test: {
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ handler(val) {},
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.main {
|
|
|
+ border-radius: 10px;
|
|
|
+ box-shadow: 0 0 5px #cccccc;
|
|
|
+ padding: 20px;
|
|
|
+ .one {
|
|
|
+ .top {
|
|
|
+ text-align: right;
|
|
|
+ margin: 0 0 15px 0;
|
|
|
+ }
|
|
|
+ .down {
|
|
|
+ .text {
|
|
|
+ border-bottom: 1px dashed #ccc;
|
|
|
+ padding: 10px 0;
|
|
|
+ margin: 0 0 10px 0;
|
|
|
+ }
|
|
|
+ /deep/.el-form-item {
|
|
|
+ margin: 0;
|
|
|
+ }
|
|
|
+ .el-select {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ .formBtn {
|
|
|
+ text-align: center;
|
|
|
+ padding: 15px 0;
|
|
|
+ }
|
|
|
+ .file {
|
|
|
+ padding: 0 15px;
|
|
|
+ .file_title {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ margin: 10px 0 0 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.main:hover {
|
|
|
+ box-shadow: 0 0 5px #409eff;
|
|
|
+}
|
|
|
+</style>
|