|
@@ -0,0 +1,333 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <basicDetails
|
|
|
|
|
+ ref="details"
|
|
|
|
|
+ :titleText="mainData.billno"
|
|
|
|
|
+ :editData="mainData"
|
|
|
|
|
+ :mainAreaData="mainAreaData"
|
|
|
|
|
+ turnPageId="2026052510111206"
|
|
|
|
|
+ idname="sc_points_adjustid"
|
|
|
|
|
+ ownertable="sc_points_adjust"
|
|
|
|
|
+ tags=""
|
|
|
|
|
+ :tabs="[]"
|
|
|
|
|
+ :column="4"
|
|
|
|
|
+ @pageChange="pageChange"
|
|
|
|
|
+ @onEditSuccess="queryMainData($route.query.id)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div slot="tags"></div>
|
|
|
|
|
+ <template slot="customOperation">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="tool.checkAuth($route.name, 'update')"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="showEditDialog"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ :disabled="mainData.status !== '新建'"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ $t(`编 辑`) }}
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="tool.checkAuth($route.name, 'audit')"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="onAudit"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ :disabled="mainData.status !== '新建'"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ $t(`审 核`) }}
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="tool.checkAuth($route.name, 'delete')"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="onDelete"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ :disabled="mainData.status !== '新建'"
|
|
|
|
|
+ style="margin-right:10px"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ $t(`删 除`) }}
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </basicDetails>
|
|
|
|
|
+ <el-drawer
|
|
|
|
|
+ append-to-body
|
|
|
|
|
+ :title="$t('编辑')"
|
|
|
|
|
+ :visible.sync="editDialogVisible"
|
|
|
|
|
+ :wrapperClosable="false"
|
|
|
|
|
+ direction="rtl"
|
|
|
|
|
+ size="500px"
|
|
|
|
|
+ @close="cancelEditDrawer"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div class="drawer__panel">
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-form :model="editForm" :rules="editRules" ref="editForm" :label-width="tool.onlyZh('100px')" label-position="right" size="mini">
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item :label="$t(`积分类型`)+':'" prop="type">
|
|
|
|
|
+ <el-select v-model="editForm.type" :placeholder="$t(`请选择积分类型`)" clearable>
|
|
|
|
|
+ <el-option :label="$t(`A类`)" value="A"></el-option>
|
|
|
|
|
+ <el-option :label="$t(`C类`)" value="C"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item :label="$t(`调整类型`)+':'" prop="adjusttype">
|
|
|
|
|
+ <el-select v-model="editForm.adjusttype" :placeholder="$t(`请选择调整类型`)" clearable>
|
|
|
|
|
+ <el-option :label="$t(`增加`)" value="1"></el-option>
|
|
|
|
|
+ <el-option :label="$t(`减少`)" value="0"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item :label="$t(`调整积分`)+':'" prop="points">
|
|
|
|
|
+ <el-input v-model="editForm.points" :placeholder="$t(`请输入调整积分`)" @input="validatePoints"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item :label="$t(`调整原因`)+':'" prop="reason">
|
|
|
|
|
+ <el-input type="textarea" v-model="editForm.reason" :placeholder="$t(`请输入调整原因`)"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="fixed__btn__panel">
|
|
|
|
|
+ <el-button size="small" @click="editDialogVisible = false" class="normal-btn-width">{{$t('取 消')}}</el-button>
|
|
|
|
|
+ <el-button size="small" type="primary" @click="onEditSubmit" class="normal-btn-width">{{$t('确 定')}}</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-drawer>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+export default {
|
|
|
|
|
+ name: "integralAdjustDetail",
|
|
|
|
|
+ data() {
|
|
|
|
|
+ const validatePoints = (rule, value, callback) => {
|
|
|
|
|
+ const num = Number(value);
|
|
|
|
|
+ if (!value) {
|
|
|
|
|
+ callback(new Error(this.$t("请输入调整积分")));
|
|
|
|
|
+ } else if (isNaN(num) || num <= 0) {
|
|
|
|
|
+ callback(new Error(this.$t("仅可填写大于0的数字")));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ callback();
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ return {
|
|
|
|
|
+ mainData: {},
|
|
|
|
|
+ mainAreaData: [],
|
|
|
|
|
+ editDialogVisible: false,
|
|
|
|
|
+ editForm: {
|
|
|
|
|
+ type: "",
|
|
|
|
|
+ adjusttype: "",
|
|
|
|
|
+ points: "",
|
|
|
|
|
+ reason: "",
|
|
|
|
|
+ },
|
|
|
|
|
+ editRules: {
|
|
|
|
|
+ type: [
|
|
|
|
|
+ { required: true, message: this.$t("请选择积分类型"), trigger: "change" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ adjusttype: [
|
|
|
|
|
+ { required: true, message: this.$t("请选择调整类型"), trigger: "change" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ points: [
|
|
|
|
|
+ { required: true, validator: validatePoints, trigger: "blur" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ reason: [
|
|
|
|
|
+ { required: true, message: this.$t("请输入调整原因"), trigger: "blur" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ async queryMainData() {
|
|
|
|
|
+ const res = await this.$api.requested({
|
|
|
|
|
+ id: 2026052510111206,
|
|
|
|
|
+ content: {
|
|
|
|
|
+ sc_points_adjustid: this.$route.query.id,
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ this.mainData = res.data;
|
|
|
|
|
+ this.changeDataStructure();
|
|
|
|
|
+ },
|
|
|
|
|
+ changeDataStructure() {
|
|
|
|
|
+ let that = this;
|
|
|
|
|
+ this.mainAreaData = [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "单号",
|
|
|
|
|
+ value: this.mainData.billno,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "经销商",
|
|
|
|
|
+ value: this.mainData.dealername,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "姓名",
|
|
|
|
|
+ value: this.mainData.personname,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "联系电话",
|
|
|
|
|
+ value: this.mainData.phonenumber,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "状态",
|
|
|
|
|
+ value: this.$t(this.mainData.status),
|
|
|
|
|
+ style: function () {
|
|
|
|
|
+ let style = {};
|
|
|
|
|
+ if (that.mainData.status === "已审核") {
|
|
|
|
|
+ style.color = "#52C41A";
|
|
|
|
|
+ } else if (that.mainData.status === "待审核") {
|
|
|
|
|
+ style.color = "#1890FF";
|
|
|
|
|
+ } else if (that.mainData.status === "已拒绝") {
|
|
|
|
|
+ style.color = "#F5222D";
|
|
|
|
|
+ }
|
|
|
|
|
+ return style;
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "A积分",
|
|
|
|
|
+ value: this.mainData.type === "A" ? this.mainData.points : 0,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "C积分",
|
|
|
|
|
+ value: this.mainData.type === "C" ? this.mainData.points : 0,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "调整类型",
|
|
|
|
|
+ value: this.mainData.adjusttype == 1 ? "增加" : "扣减",
|
|
|
|
|
+ style: function () {
|
|
|
|
|
+ let style = {};
|
|
|
|
|
+ if (that.mainData.adjusttype == 1) {
|
|
|
|
|
+ style.color = "#52C41A";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ style.color = "#F5222D";
|
|
|
|
|
+ }
|
|
|
|
|
+ return style;
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "调整原因",
|
|
|
|
|
+ value: this.mainData.reason,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "创建时间",
|
|
|
|
|
+ value: this.mainData.createdate,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "审核时间",
|
|
|
|
|
+ value: this.mainData.auditdate,
|
|
|
|
|
+ },
|
|
|
|
|
+ ];
|
|
|
|
|
+ },
|
|
|
|
|
+ showEditDialog() {
|
|
|
|
|
+ this.editForm = {
|
|
|
|
|
+ type: this.mainData.type,
|
|
|
|
|
+ adjusttype: String(this.mainData.adjusttype),
|
|
|
|
|
+ points: String(this.mainData.points),
|
|
|
|
|
+ reason: this.mainData.reason,
|
|
|
|
|
+ };
|
|
|
|
|
+ this.editDialogVisible = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ cancelEditDrawer() {
|
|
|
|
|
+ this.$refs.editForm.resetFields();
|
|
|
|
|
+ },
|
|
|
|
|
+ validatePoints() {
|
|
|
|
|
+ this.editForm.points = this.editForm.points.replace(/[^0-9]/g, "");
|
|
|
|
|
+ },
|
|
|
|
|
+ async onEditSubmit() {
|
|
|
|
|
+ this.$refs.editForm.validate(async (valid) => {
|
|
|
|
|
+ if (!valid) return false;
|
|
|
|
|
+ const res = await this.$api.requested({
|
|
|
|
|
+ id: 2026052510111506,
|
|
|
|
|
+ content: {
|
|
|
|
|
+ sc_points_adjustid: this.mainData.sc_points_adjustid,
|
|
|
|
|
+ type: this.editForm.type,
|
|
|
|
|
+ adjusttype: Number(this.editForm.adjusttype),
|
|
|
|
|
+ points: Number(this.editForm.points),
|
|
|
|
|
+ reason: this.editForm.reason,
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ this.tool.showMessage(res, () => {
|
|
|
|
|
+ this.editDialogVisible = false;
|
|
|
|
|
+ this.queryMainData();
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ onAudit() {
|
|
|
|
|
+ this.$confirm(this.$t("是否确定审核该记录") + "?", this.$t("提示"), {
|
|
|
|
|
+ confirmButtonText: this.$t("确定"),
|
|
|
|
|
+ cancelButtonText: this.$t("取消"),
|
|
|
|
|
+ type: "warning",
|
|
|
|
|
+ beforeClose: async (action, instance, done) => {
|
|
|
|
|
+ if (action === "confirm") {
|
|
|
|
|
+ instance.confirmButtonLoading = true;
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await this.$api.requested({
|
|
|
|
|
+ id: 2026052510111606,
|
|
|
|
|
+ content: {
|
|
|
|
|
+ sc_points_adjustid: this.mainData.sc_points_adjustid,
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ if (res.code !== 1) {
|
|
|
|
|
+ this.$message.error(this.$t(res.msg));
|
|
|
|
|
+ instance.confirmButtonLoading = false;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.tool.showMessage(res, () => {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ instance.confirmButtonLoading = false;
|
|
|
|
|
+ done();
|
|
|
|
|
+ this.queryMainData();
|
|
|
|
|
+ }, 500);
|
|
|
|
|
+ });
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ instance.confirmButtonLoading = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ done();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ }).catch(() => {});
|
|
|
|
|
+ },
|
|
|
|
|
+ onDelete() {
|
|
|
|
|
+ this.$confirm(this.$t("是否确定删除该记录") + "?", this.$t("提示"), {
|
|
|
|
|
+ confirmButtonText: this.$t("确定"),
|
|
|
|
|
+ cancelButtonText: this.$t("取消"),
|
|
|
|
|
+ type: "warning",
|
|
|
|
|
+ beforeClose: async (action, instance, done) => {
|
|
|
|
|
+ if (action === "confirm") {
|
|
|
|
|
+ instance.confirmButtonLoading = true;
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await this.$api.requested({
|
|
|
|
|
+ id: 2026052510111706,
|
|
|
|
|
+ content: {
|
|
|
|
|
+ sc_points_adjustid: this.mainData.sc_points_adjustid,
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ if (res.code !== 1) {
|
|
|
|
|
+ this.$message.error(this.$t(res.msg));
|
|
|
|
|
+ instance.confirmButtonLoading = false;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.tool.showMessage(res, () => {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ instance.confirmButtonLoading = false;
|
|
|
|
|
+ done();
|
|
|
|
|
+ this.$router.go(-1);
|
|
|
|
|
+ }, 500);
|
|
|
|
|
+ });
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ instance.confirmButtonLoading = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ done();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ }).catch(() => {});
|
|
|
|
|
+ },
|
|
|
|
|
+ pageChange() {},
|
|
|
|
|
+ },
|
|
|
|
|
+ mounted() {
|
|
|
|
|
+ this.queryMainData();
|
|
|
|
|
+ },
|
|
|
|
|
+};
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style>
|
|
|
|
|
+</style>
|