Commit ec8c1cc5 authored by chenwei's avatar chenwei

fixed defect related member management

parent e6458a1f
<template> <template>
<div class="app-container"> <div class="app-container">
<el-button type="success" @click="handleSelectMember"> <el-button type="success" @click="handleSelectMember"> {{ $t("添加会员") }}</el-button>
{{ $t("添加会员") }}</el-button
>
<div class="container"> <div class="container">
<div v-if="memberList.length > 0"> <div v-if="memberList.length > 0">
<div <div class="formBox" v-for="(item, index) in queryParamsList" :key="item.memberId">
class="formBox" <el-form :model="queryParamsList[index]" :ref="`queryForm${item.memberId}`" size="small" :inline="true" :rules="rules" label-width="168px">
v-for="(item, index) in queryParamsList"
:key="item.memberId"
>
<el-form
:model="queryParamsList[index]"
:ref="`queryForm${item.memberId}`"
size="small"
:inline="true"
:rules="rules"
label-width="168px"
>
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<el-row :gutter="10"> <el-row :gutter="10">
<span class="card-title">{{ $t("基础信息") }}</span> <span class="card-title">{{ $t("基础信息") }}</span>
<el-button <el-button style="padding: 0 10px" @click="handleExpand(item)" type="text">{{ item.expand ? $t("收起") : $t("展开") }}<i :class="item.expand ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"></i></el-button>
style="padding: 0 10px" <el-button type="text" @click="handleDelete(index, item)" class="del-btn">{{ $t("删除") }}</el-button>
@click="handleExpand(item)"
type="text"
>{{ item.expand ? $t("收起") : $t("展开")
}}<i
:class="
item.expand
? 'el-icon-caret-top'
: 'el-icon-caret-bottom'
"
></i
></el-button>
<el-button
type="text"
@click="handleDelete(index, item)"
class="del-btn"
>{{ $t("删除") }}</el-button
>
</el-row> </el-row>
<el-row :gutter="10"> <el-row :gutter="10">
<el-form-item :label="$t('会员名称')"> <el-form-item :label="$t('会员名称')">
<el-input <el-input :placeholder="$t('请输入会员名称')" clearable :disabled="true" v-model="item.memberName" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
:placeholder="$t('请输入会员名称')"
clearable
:disabled="true"
v-model="item.memberName"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('当前积分')"> <el-form-item :label="$t('当前积分')">
<el-input <el-input :placeholder="$t('请输入当前积分')" clearable :disabled="true" v-model="item.holdScore" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
:placeholder="$t('请输入当前积分')"
clearable
:disabled="true"
v-model="item.holdScore"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('礼品选择')"> <el-form-item :label="$t('礼品选择')">
<el-input <el-input :placeholder="$t('请选择礼品')" clearable :disabled="true" v-model="item.rewardName" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
:placeholder="$t('请选择礼品')"
clearable
:disabled="true"
v-model="item.rewardName"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('礼品积分')"> <el-form-item :label="$t('礼品积分')">
<el-input <el-input :placeholder="$t('请输入礼品积分')" clearable :disabled="true" v-model="item.pointsRequire" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
:placeholder="$t('请输入礼品积分')"
clearable
:disabled="true"
v-model="item.pointsRequire"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('兑换数量')" prop="rewardCount"> <el-form-item :label="$t('兑换数量')" prop="rewardCount">
<el-input <el-input
...@@ -86,29 +32,17 @@ ...@@ -86,29 +32,17 @@
v-model.number="item.rewardCount" v-model.number="item.rewardCount"
@change=" @change="
(val) => { (val) => {
handleRewardCount(item, index, val); handleRewardCount(item, index, val)
} }
" "
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('本次兑换积分')"> <el-form-item :label="$t('本次兑换积分')">
<el-input <el-input :placeholder="$t('请输入本次兑换积分')" clearable :disabled="true" v-model="item.spendCredit" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
:placeholder="$t('请输入本次兑换积分')"
clearable
:disabled="true"
v-model="item.spendCredit"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('兑换后剩余积分')"> <el-form-item :label="$t('兑换后剩余积分')">
<el-input <el-input :placeholder="$t('兑换后剩余积分')" clearable :disabled="true" v-model="item.remainingPoints" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
:placeholder="$t('兑换后剩余积分')"
clearable
:disabled="true"
v-model="item.remainingPoints"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row :gutter="10" v-show="item.expand"> <el-row :gutter="10" v-show="item.expand">
...@@ -117,187 +51,69 @@ ...@@ -117,187 +51,69 @@
</el-row> </el-row>
<el-row> <el-row>
<el-form-item :label="$t('兑换方式')" prop="redeemType"> <el-form-item :label="$t('兑换方式')" prop="redeemType">
<dict-selector <dict-selector clearable :type="DICT_TYPE.WAY_OF_RECEIVING" :filter="(e) => filterDicRedeemTypeList(e)" v-model="item.redeemType" @change="handleRedeemType(item)"> </dict-selector>
clearable
:type="DICT_TYPE.WAY_OF_RECEIVING"
v-model="item.redeemType"
@change="handleRedeemType(item)"
>
</dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('兑换入口')"> <el-form-item :label="$t('兑换入口')">
<dict-selector <dict-selector clearable :disabled="true" v-model="item.entrance" :type="DICT_TYPE.PLATFORM_TYPE"> </dict-selector>
clearable
:disabled="true"
v-model="item.entrance"
:type="DICT_TYPE.PLATFORM_TYPE"
>
</dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('费用')"> <el-form-item :label="$t('费用')">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="12"> <el-col :span="12">
<el-form-item prop="expenses" :rules="rules.expenses" v-show="item.currency"> <el-form-item prop="expenses" :rules="rules.expenses" v-show="item.currency">
<el-input <el-input v-model="item.expenses" :placeholder="$t('请输入数字')" clearable onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
v-model="item.expenses"
:placeholder="$t('请输入数字')"
clearable
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
<el-form-item v-show="!item.currency"> <el-form-item v-show="!item.currency">
<el-input <el-input v-model="item.expenses" :placeholder="$t('请输入数字')" clearable onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
v-model="item.expenses"
:placeholder="$t('请输入数字')"
clearable
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<div> <div>
<el-form-item prop="currency" :rules="rules.currency" v-show="item.expenses"> <el-form-item prop="currency" :rules="rules.currency" v-show="item.expenses">
<el-select <el-select clearable v-model="item.currency" :placeholder="$t('请选择币种')">
clearable <el-option v-for="nodeItem in currencyList" :key="nodeItem.id" :label="isChinese ? nodeItem.titleZh : nodeItem.titleEn" :value="nodeItem.id" />
v-model="item.currency"
:placeholder="$t('请选择币种')"
>
<el-option
v-for="nodeItem in currencyList"
:key="nodeItem.id"
:label="
isChinese
? nodeItem.titleZh
: nodeItem.titleEn
"
:value="nodeItem.id"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-show="!item.expenses"> <el-form-item v-show="!item.expenses">
<el-select <el-select clearable v-model="item.currency" :placeholder="$t('请选择币种')">
clearable <el-option v-for="nodeItem in currencyList" :key="nodeItem.id" :label="isChinese ? nodeItem.titleZh : nodeItem.titleEn" :value="nodeItem.id" />
v-model="item.currency"
:placeholder="$t('请选择币种')"
>
<el-option
v-for="nodeItem in currencyList"
:key="nodeItem.id"
:label="
isChinese
? nodeItem.titleZh
: nodeItem.titleEn
"
:value="nodeItem.id"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-form-item :label="$t('收件人姓名')" <el-form-item :label="$t('收件人姓名')"><el-input :placeholder="$t('请输入收件人姓名')" clearable v-model="item.recipientName" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" /> </el-form-item>
><el-input <el-form-item :label="$t('收件人电话')">
:placeholder="$t('请输入收件人姓名')" <el-input :placeholder="$t('请输入收件人电话')" clearable v-model="item.recipientPhoneNum" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
clearable
v-model="item.recipientName"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item
:label="$t('收件人电话')"
>
<el-input
:placeholder="$t('请输入收件人电话')"
clearable
v-model="item.recipientPhoneNum"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
<el-form-item <el-form-item :label="$t('收件人地址')" v-if="item.redeemType != '1'">
:label="$t('收件人地址')" <el-input :placeholder="$t('请输入收件人地址')" clearable v-model="item.recipientAddress" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
v-if="item.redeemType != '1'"
>
<el-input
:placeholder="$t('请输入收件人地址')"
clearable
v-model="item.recipientAddress"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('兑换人')"> <el-form-item :label="$t('兑换人')">
<el-input <el-input :placeholder="$t('请输入兑换人')" clearable v-model="item.redeemer" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
:placeholder="$t('请输入兑换人')"
clearable
v-model="item.redeemer"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('兑换时间')"> <el-form-item :label="$t('兑换时间')">
<el-date-picker <el-date-picker type="date" placement="bottom-start" value-format="yyyy-MM-dd HH:mm:ss" :placeholder="$t('选择兑换时间')" v-model="item.redemptionTime"></el-date-picker>
type="date"
placement="bottom-start"
value-format="yyyy-MM-dd HH:mm:ss"
:placeholder="$t('选择兑换时间')"
v-model="item.redemptionTime"
></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item <el-form-item :label="$t('快递公司')" v-if="item.redeemType != '1'">
:label="$t('快递公司')" <el-select v-model="item.courierCompany" :placeholder="$t('请选择快递公司')">
v-if="item.redeemType != '1'" <el-option v-for="nodeItem in expressList" :key="nodeItem.id" :label="nodeItem.companyName" :value="nodeItem.id" />
>
<el-select
v-model="item.courierCompany"
:placeholder="$t('请选择快递公司')"
>
<el-option
v-for="nodeItem in expressList"
:key="nodeItem.id"
:label="nodeItem.companyName"
:value="nodeItem.id"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item :label="$t('快递单号')" v-if="item.redeemType != '1'">
:label="$t('快递单号')" <el-input :placeholder="$t('请输入快递单号')" clearable v-model="item.expressNo" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
v-if="item.redeemType != '1'"
>
<el-input
:placeholder="$t('请输入快递单号')"
clearable
v-model="item.expressNo"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
<el-form-item <el-form-item :label="$t('快递日期')" v-if="item.redeemType != '1'">
:label="$t('快递日期')" <el-date-picker type="date" :placeholder="$t('选择快递日期')" v-model="item.expressDate" value-format="yyyy-MM-dd HH:mm:ss" placement="bottom-start"></el-date-picker>
v-if="item.redeemType != '1'"
>
<el-date-picker
type="date"
:placeholder="$t('选择快递日期')"
v-model="item.expressDate"
value-format="yyyy-MM-dd HH:mm:ss"
placement="bottom-start"
></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item :label="$t('快递寄出人')"> <el-form-item :label="$t('快递寄出人')">
<el-input <el-input :placeholder="$t('请输入快递寄出人')" clearable v-model="item.expressSender" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
:placeholder="$t('请输入快递寄出人')"
clearable
v-model="item.expressSender"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('上传附件')"> <el-form-item :label="$t('上传附件')">
<file-upload v-model="item.annex"></file-upload> <file-upload v-model="item.annex"></file-upload>
</el-form-item> </el-form-item>
<el-form-item :label="$t('备注')"> <el-form-item :label="$t('备注')">
<el-input <el-input style="width: 500px" type="textarea" v-model="item.remark"></el-input>
style="width: 500px"
type="textarea"
v-model="item.remark"
></el-input>
</el-form-item> </el-form-item>
</el-row> </el-row>
</el-row> </el-row>
...@@ -311,12 +127,7 @@ ...@@ -311,12 +127,7 @@
</div> </div>
<el-row justify="end" :gutter="20" type="flex" class="handleButton"> <el-row justify="end" :gutter="20" type="flex" class="handleButton">
<el-col :span="2"> <el-col :span="2">
<el-button <el-button v-if="memberList.length > 0" type="primary" @click="handleBulkConversion">{{ $t("确认兑换") }}</el-button>
v-if="memberList.length > 0"
type="primary"
@click="handleBulkConversion"
>{{ $t("确认兑换") }}</el-button
>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<el-button @click="handleBack">{{ $t("返回") }}</el-button> <el-button @click="handleBack">{{ $t("返回") }}</el-button>
...@@ -324,39 +135,32 @@ ...@@ -324,39 +135,32 @@
</el-row> </el-row>
</div> </div>
<choose-Member <choose-Member :dialogVisible.sync="dialogVisible" @transferSelectMemberInfo="onGetSelectMemberInfo" :memberSelectList="memberList"> </choose-Member>
:dialogVisible.sync="dialogVisible"
@transferSelectMemberInfo="onGetSelectMemberInfo"
:memberSelectList="memberList"
>
</choose-Member>
</div> </div>
</template> </template>
<script> <script>
import { getRewardsDetails, bulkConversion } from "@/api/ecw/giftManagement"; import { getRewardsDetails, bulkConversion } from "@/api/ecw/giftManagement"
import FileUpload from "@/components/FileUpload"; import FileUpload from "@/components/FileUpload"
import chooseMember from "./components/chooseMember.vue"; import chooseMember from "./components/chooseMember.vue"
import { getExpressPage } from "@/api/ecw/express"; import { getExpressPage } from "@/api/ecw/express"
import { getCurrencyList } from "@/api/ecw/currency"; import { getCurrencyList } from "@/api/ecw/currency"
import { getNowDateTime } from "@/utils/ruoyi"; import { getNowDateTime } from "@/utils/ruoyi"
import { handleError } from "@vue/runtime-dom"; import { handleError } from "@vue/runtime-dom"
export default { export default {
name: "giftManagementList", name: "giftManagementList",
components: { components: {
chooseMember, chooseMember,
FileUpload, FileUpload
}, },
data() { data() {
var validatePass2 = (rule, value, callback) => { var validatePass2 = (rule, value, callback) => {
if (!this.quantityComputation) { if (!this.quantityComputation) {
return callback( return callback(new Error(this.$t("兑换积分大于当前总积分,请重新输入兑换数量")))
new Error(this.$t("兑换积分大于当前总积分,请重新输入兑换数量"))
);
} else { } else {
return callback(); return callback()
}
} }
};
return { return {
env: process.env.NODE_ENV, env: process.env.NODE_ENV,
// 是否显示弹出层 // 是否显示弹出层
...@@ -376,123 +180,120 @@ export default { ...@@ -376,123 +180,120 @@ export default {
{ {
required: true, required: true,
message: this.$t("请输入兑换数量"), message: this.$t("请输入兑换数量"),
trigger: "blur", trigger: "blur"
}, },
{ {
validator: validatePass2, validator: validatePass2,
trigger: "blur", trigger: ["blur", "change"]
}, }
], ],
expenses: [ expenses: [
{ {
required: true, required: true,
message: this.$t("请输入费用"), message: this.$t("请输入费用"),
trigger: "blur", trigger: "blur"
}, },
{ {
pattern: /^\d+(\.\d{1,2})?$/, pattern: /^\d+(\.\d{1,2})?$/,
message: this.$t("请输入整数或保留小数点后两位"), message: this.$t("请输入整数或保留小数点后两位"),
trigger: "blur", trigger: "blur"
}, }
], ],
currency: [ currency: [
{ {
required: true, required: true,
message: this.$t("请选择币种"), message: this.$t("请选择币种"),
trigger: "change", trigger: "change"
}, }
], ],
redeemType: [ redeemType: [
{ {
required: true, required: true,
message: this.$t("请选择兑换方式"), message: this.$t("请选择兑换方式"),
trigger: "change", trigger: "change"
}, }
], ],
recipientName: [ recipientName: [
{ {
required: true, required: true,
message: this.$t("请输入收件人姓名"), message: this.$t("请输入收件人姓名"),
trigger: "blur", trigger: "blur"
}, }
], ],
recipientPhoneNum: [ recipientPhoneNum: [
{ {
required: true, required: true,
message: this.$t("请输入收件人电话"), message: this.$t("请输入收件人电话"),
trigger: "blur", trigger: "blur"
}, }
], ],
recipientAddress: [ recipientAddress: [
{ {
required: true, required: true,
message: this.$t("请输入收件人地址"), message: this.$t("请输入收件人地址"),
trigger: "blur", trigger: "blur"
}, }
], ]
}, }
}; }
}, },
computed: { computed: {
isChinese() { isChinese() {
return this.$i18n.locale === "zh_CN"; return this.$i18n.locale === "zh_CN"
}, }
}, },
created() { created() {
this.getRewardsDetailsAPI(); this.getRewardsDetailsAPI()
this.getExpressList(); this.getExpressList()
this.currencyListAPI(); this.currencyListAPI()
}, },
activated() {}, activated() {},
methods: { methods: {
//兑换方式下拉列表默认关联礼品
filterDicRedeemTypeList(e) {
return this.rewardsDetails.pickMethod.split(",").some((val) => e.value == val)
},
handleRedeemType(item) { handleRedeemType(item) {
this.$nextTick(() => { this.$nextTick(() => {
// queryForm${item.memberId} this.$refs[`queryForm${item.memberId}`][0].clearValidate()
this.$refs[`queryForm${item.memberId}`][0].clearValidate(); })
});
}, },
handleRewardCount(item, index, value) { handleRewardCount(item, index, value) {
this.queryParamsList[index].spendCredit = this.queryParamsList[index].spendCredit = this.queryParamsList[index].pointsRequire * value
this.queryParamsList[index].pointsRequire * value; this.queryParamsList[index].remainingPoints = this.queryParamsList[index].holdScore - this.queryParamsList[index].spendCredit
this.queryParamsList[index].remainingPoints = this.quantityComputation = this.queryParamsList[index].remainingPoints >= 0 ? true : false
this.queryParamsList[index].holdScore -
this.queryParamsList[index].spendCredit;
this.quantityComputation =
this.queryParamsList[index].remainingPoints >= 0 ? true : false;
}, },
handleDelete(index, item) { handleDelete(index, item) {
this.$modal this.$modal
.confirm(this.$t("是否确认删除此数据")) .confirm(this.$t("是否确认删除此数据"))
.then(() => { .then(() => {
this.queryParamsList.splice(index, 1); this.queryParamsList.splice(index, 1)
this.memberList = this.memberList.filter( this.memberList = this.memberList.filter((res) => res.id != item.memberId)
(res) => res.id != item.memberId
);
this.$modal.msgSuccess(this.$t("删除成功")); this.$modal.msgSuccess(this.$t("删除成功"))
}) })
.catch(() => {}); .catch(() => {})
}, },
handleExpand(item) { handleExpand(item) {
this.queryParamsList.forEach((element) => { this.queryParamsList.forEach((element) => {
if (element.memberId == item.memberId) { if (element.memberId == item.memberId) {
element.expand = !item.expand; element.expand = !item.expand
} }
}); })
}, },
currencyListAPI() { currencyListAPI() {
getCurrencyList().then((res) => { getCurrencyList().then((res) => {
this.currencyList = res.data; this.currencyList = res.data
}); })
}, },
onGetSelectMemberInfo(data) { onGetSelectMemberInfo(data) {
if (data.length > 0) { if (data.length > 0) {
data.filter((item) => { data.filter((item) => {
let inculde = this.queryParamsList.some((itemQuery) => { let inculde = this.queryParamsList.some((itemQuery) => {
return item.id == itemQuery.memberId; return item.id == itemQuery.memberId
}); })
if (!inculde) { if (!inculde) {
let queryParams = { let queryParams = {
expand: true, expand: true,
...@@ -500,7 +301,7 @@ export default { ...@@ -500,7 +301,7 @@ export default {
holdScore: item.holdScore, holdScore: item.holdScore,
rewardId: this.rewardsDetails.id, rewardId: this.rewardsDetails.id,
pointsRequire: this.rewardsDetails.pointsRequire, pointsRequire: this.rewardsDetails.pointsRequire,
rewardCount: null, rewardCount: 1,
spendCredit: null, //本次兑换花费积分 spendCredit: null, //本次兑换花费积分
remainingPoints: null, //剩余积分 remainingPoints: null, //剩余积分
redeemType: null, redeemType: null,
...@@ -517,92 +318,93 @@ export default { ...@@ -517,92 +318,93 @@ export default {
expressSender: this.$store.getters.name, expressSender: this.$store.getters.name,
expressDate: null, expressDate: null,
remark: null, remark: null,
annex: null, annex: null
}; }
if (this.isChinese) { if (this.isChinese) {
queryParams.memberName = item.memberNameZh; queryParams.memberName = item.memberNameZh
queryParams.rewardName = this.rewardsDetails.titleZh; queryParams.rewardName = this.rewardsDetails.titleZh
} else { } else {
queryParams.memberName = item.memberNameEn; queryParams.memberName = item.memberNameEn
queryParams.rewardName = this.rewardsDetails.titleEn; queryParams.rewardName = this.rewardsDetails.titleEn
} }
this.memberList.push(item); queryParams.spendCredit = queryParams.pointsRequire
this.queryParamsList.push({ ...queryParams }); queryParams.remainingPoints = queryParams.holdScore - queryParams.spendCredit
this.quantityComputation = queryParams.remainingPoints >= 0 ? true : false
this.memberList.push(item)
this.queryParamsList.push({ ...queryParams })
this.$nextTick(() => {
this.$refs[`queryForm${item.id}`][0].clearValidate()
this.$refs[`queryForm${item.id}`][0].validateField("rewardCount")
})
} }
}); })
} }
}, },
handleSelectMember() { handleSelectMember() {
this.dialogVisible = true; this.dialogVisible = true
}, },
getExpressList() { getExpressList() {
let params = { let params = {
pageNo: 1, pageNo: 1,
pageSize: 1000, pageSize: 1000
}; }
getExpressPage(params).then((res) => { getExpressPage(params).then((res) => {
this.expressList = res.data.list; this.expressList = res.data.list
}); })
}, },
getRewardsDetailsAPI() { getRewardsDetailsAPI() {
let params = { let params = {
id: this.$route.query.rewardsID, id: this.$route.query.rewardsID
}; }
getRewardsDetails(params).then((res) => { getRewardsDetails(params).then((res) => {
this.rewardsDetails = res.data; this.rewardsDetails = res.data
}); })
}, },
handleBack() { handleBack() {
this.$store.dispatch("tagsView/delCurrentView"); this.$store.dispatch("tagsView/delCurrentView")
}, },
checkForm(formName) { checkForm(formName) {
const result = new Promise((resolve, reject) => { const result = new Promise((resolve, reject) => {
this.$refs[formName][0].validate((valid) => { this.$refs[formName][0].validate((valid) => {
if (valid) { if (valid) {
resolve(); resolve()
} else { } else {
reject(); reject()
} }
}); })
}); })
this.checkFormResult.push(result); this.checkFormResult.push(result)
}, },
handleBulkConversion() { handleBulkConversion() {
this.queryParamsList.forEach((element) => { this.queryParamsList.forEach((element) => {
this.checkForm(`queryForm${element.memberId}`); this.checkForm(`queryForm${element.memberId}`)
}); })
Promise.all(this.checkFormResult) Promise.all(this.checkFormResult)
.then((res) => { .then((res) => {
this.checkFormResult = []; this.checkFormResult = []
let params = this.queryParamsList.map((item) => { let params = this.queryParamsList.map((item) => {
if (item.redeemType == "1") { if (item.redeemType == "1") {
let { let { recipientAddress, expressNo, expressDate, courierCompany, ...itemNew } = item
recipientAddress, return itemNew
expressNo,
expressDate,
courierCompany,
...itemNew
} = item;
return itemNew;
} else { } else {
return item; return item
} }
}); })
bulkConversion(params).then((res) => { bulkConversion(params).then((res) => {
if (res.code == "0") { if (res.code == "0") {
this.queryParamsList = []; this.queryParamsList = []
this.memberList = []; this.memberList = []
this.$message.success(this.$t("兑换成功")); this.$message.success(this.$t("兑换成功"))
} }
}); })
}) })
.catch(() => { .catch(() => {
this.checkFormResult = []; this.checkFormResult = []
this.$message.error(this.$t("兑换失败,请填写必要的信息")); this.$message.error(this.$t("兑换失败,请填写必要的信息"))
}); })
}, }
}, }
}; }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.card-title { .card-title {
......
<template> <template>
<el-dialog :title="$t(titleLabel)" :visible="show" @close="close" width="80%"> <el-dialog :title="$t(titleLabel)" :visible="show" @close="close" width="80%">
<el-form <el-form :model="queryParams" ref="queryForm" size="small" :rules="rules" label-width="120px">
:model="queryParams"
ref="queryForm"
size="small"
:rules="rules"
label-width="120px"
>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('中文礼品名称')" prop="titleZh"> <el-form-item :label="$t('中文礼品名称')" prop="titleZh">
<el-input <el-input v-model="queryParams.titleZh" :placeholder="$t('请输入')" :disabled="isDisable" clearable v-trim />
v-model="queryParams.titleZh"
:placeholder="$t('请输入')"
:disabled="isDisable"
clearable
v-trim
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('英文礼品名称')" prop="titleEn"> <el-form-item :label="$t('英文礼品名称')" prop="titleEn">
<el-input <el-input v-model="queryParams.titleEn" :disabled="isDisable" :placeholder="$t('请输入')" clearable v-trim />
v-model="queryParams.titleEn"
:disabled="isDisable"
:placeholder="$t('请输入')"
clearable
v-trim
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('中文礼品图片')" prop="number"> <el-form-item :label="$t('中文礼品图片')" prop="number">
<image-upload <image-upload :fileType="['png', 'jpg', 'jpeg']" v-model="queryParams.imgZh" :isShowEditButton="!isDisable" />
v-model="queryParams.imgZh"
:isShowEditButton="!isDisable"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('英文礼品图片')" prop="number"> <el-form-item :label="$t('英文礼品图片')" prop="number">
<image-upload <image-upload v-model="queryParams.imgEn" :fileType="['png', 'jpg', 'jpeg']" :isShowEditButton="!isDisable" />
v-model="queryParams.imgEn"
:isShowEditButton="!isDisable"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="10" v-for="(item, index) in queryParams.nodeIds"> <el-row :gutter="10" v-for="(item, index) in queryParams.nodeIds">
<el-col :span="6"> <el-col :span="6">
<el-form-item <el-form-item :label="$t('提货点')" :prop="`nodeIds[${index}].wareHouses`" :rules="rules.nodeIds.wareHouses">
:label="$t('提货点')" <el-select v-model="item.wareHouses" :placeholder="$t('请选择提货点')" :disabled="isDisable" clearable multiple filterable remote reserve-keyword :remote-method="handleWarehouseList" :loading="loading" size="small">
:prop="`nodeIds[${index}].wareHouses`" <el-option v-for="nodeItem in warehouseList" :key="nodeItem.id" :label="isChinese ? nodeItem.titleZh : nodeItem.titleEn" :value="nodeItem.id" />
:rules="rules.nodeIds.wareHouses"
>
<el-select
v-model="item.wareHouses"
:placeholder="$t('请选择提货点')"
:disabled="isDisable"
clearable
multiple
filterable
remote
reserve-keyword
:remote-method="handleWarehouseList"
:loading="loading"
size="small"
>
<el-option
v-for="nodeItem in warehouseList"
:key="nodeItem.id"
:label="isChinese ? nodeItem.titleZh : nodeItem.titleEn"
:value="nodeItem.id"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item <el-form-item :label="$t('兑换积分')" :prop="`nodeIds[${index}].points`" :rules="rules.nodeIds.points"> <el-input v-model.trim.number="item.points" :placeholder="$t('请输入')" :disabled="isDisable" /> </el-form-item
:label="$t('兑换积分')"
:prop="`nodeIds[${index}].points`"
:rules="rules.nodeIds.points"
>
<el-input
v-model.trim.number="item.points"
:placeholder="$t('请输入')"
:disabled="isDisable"
/> </el-form-item
></el-col> ></el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item <el-form-item :label="$t('剩余数量')" :prop="`nodeIds[${index}].quantityRemain`" :rules="rules.nodeIds.quantityRemain">
:label="$t('剩余数量')" <el-input class="input-item-width" :disabled="isDisable && disabelEnableStatus" v-model.trim="item.quantityRemain" :placeholder="$t('请输入')" type="number" />
:prop="`nodeIds[${index}].quantityRemain`"
:rules="rules.nodeIds.quantityRemain"
>
<el-input
class="input-item-width"
:disabled="isDisable && disabelEnableStatus"
v-model.trim="item.quantityRemain"
:placeholder="$t('请输入')"
type="number"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="1"> <el-col :span="1">
<el-button <el-button type="primary" :icon="index == '0' ? 'el-icon-plus' : 'el-icon-minus'" @click="handleOrderVRule(item, index)"></el-button>
type="primary"
:icon="index == '0' ? 'el-icon-plus' : 'el-icon-minus'"
@click="handleOrderVRule(item, index)"
></el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item :label="$t('活动时间')" prop="dateRangeCreateTime"> <el-form-item :label="$t('活动时间')" prop="dateRangeCreateTime">
<el-date-picker <el-date-picker :disabled="isDisable" type="daterange" clearable placement="bottom-start" @change="dataTimeFunc" v-model="queryParams.dateRangeCreateTime" style="width: 400px" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
:disabled="isDisable"
type="daterange"
clearable
placement="bottom-start"
v-model="queryParams.dateRangeCreateTime"
style="width: 400px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('领取方式')" prop="pickMethod"> <el-form-item :label="$t('领取方式')" prop="pickMethod">
<dict-selector <dict-selector clearable multiple :disabled="isDisable" :type="DICT_TYPE.WAY_OF_RECEIVING" v-model="queryParams.pickMethod"> </dict-selector>
clearable
multiple
:disabled="isDisable"
:type="DICT_TYPE.WAY_OF_RECEIVING"
v-model="queryParams.pickMethod"
>
</dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('允许兑换次数')" prop="allowCount"> <el-form-item :label="$t('允许兑换次数')" prop="allowCount">
<el-input <el-input class="input-item-width" v-model.trim.number="queryParams.allowCount" :placeholder="$t('请输入')" clearable :disabled="isDisable" />
class="input-item-width"
v-model.trim.number="queryParams.allowCount"
:placeholder="$t('请输入')"
clearable
:disabled="isDisable"
/>
</el-form-item> </el-form-item>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('中文备注')" prop="remarkZh"> <el-form-item :label="$t('中文备注')" prop="remarkZh">
<el-input <el-input type="textarea" :disabled="isDisable && disabelEnableStatus" height="100" v-model="queryParams.remarkZh" :placeholder="$t('请输入')"></el-input>
type="textarea"
:disabled="isDisable && disabelEnableStatus"
height="100"
v-model="queryParams.remarkZh"
:placeholder="$t('请输入')"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('英文备注')" prop="remarkEn"> <el-form-item :label="$t('英文备注')" prop="remarkEn">
<el-input <el-input type="textarea" :disabled="isDisable && disabelEnableStatus" v-model="queryParams.remarkEn" :placeholder="$t('请输入')"></el-input>
type="textarea"
:disabled="isDisable && disabelEnableStatus"
v-model="queryParams.remarkEn"
:placeholder="$t('请输入')"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<div> <div>
<el-form-item :label="$t('是否启用')" prop="status" v-if="title == '3'"> <el-form-item :label="$t('是否启用')" prop="status" v-if="title == '3'">
<el-radio-group v-model="queryParams.status" :disabled="isDisable"> <el-radio-group v-model="queryParams.status" :disabled="isDisable">
<el-radio <el-radio v-for="dict in getDictDatas(DICT_TYPE.GIFT_ENABLE_STATUS)" :key="dict.value" :label="dict.value">{{ $l(dict, "label") }}</el-radio>
v-for="dict in getDictDatas(DICT_TYPE.GIFT_ENABLE_STATUS)"
:key="dict.value"
:label="dict.value"
>{{ $l(dict, "label") }}</el-radio
>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item :label="$t('状态')" prop="status" v-else> <el-form-item :label="$t('状态')" prop="status" v-else>
<el-radio-group v-model="queryParams.status" :disabled="isDisable"> <el-radio-group v-model="queryParams.status" :disabled="isDisable">
<el-radio <el-radio v-for="dict in getDictDatas(DICT_TYPE.GIFT_STATUS)" :key="dict.value" :label="Number(dict.value)">{{ $l(dict, "label") }}</el-radio>
v-for="dict in getDictDatas(DICT_TYPE.GIFT_STATUS)"
:key="dict.value"
:label="Number(dict.value)"
>{{ $l(dict, "label") }}</el-radio
>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
<div <div slot="footer" class="dialog-footer" v-if="!isDisable || !disabelEnableStatus">
slot="footer"
class="dialog-footer"
v-if="!isDisable || !disabelEnableStatus"
>
<el-button @click="close">{{ $t("取 消") }}</el-button> <el-button @click="close">{{ $t("取 消") }}</el-button>
<el-button type="primary" @click="submit">{{ $t("确 定") }}</el-button> <el-button type="primary" @click="submit">{{ $t("确 定") }}</el-button>
</div> </div>
...@@ -205,101 +88,94 @@ ...@@ -205,101 +88,94 @@
</template> </template>
<script> <script>
import { import { editRewards, addRewards, getWarehouseList } from "@/api/ecw/giftManagement"
editRewards, import { getDictDatas, DICT_TYPE } from "@/utils/dict"
addRewards, import imageUpload from "@/components/ImageUpload"
getWarehouseList, import { parseTime, resetForm } from "../../../../utils/ruoyi"
} from "@/api/ecw/giftManagement"; import { deepClone } from "@/utils"
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import imageUpload from "@/components/ImageUpload";
import { parseTime, resetForm } from "../../../../utils/ruoyi";
import { deepClone } from "@/utils";
export default { export default {
name: "operatingGift", name: "operatingGift",
props: { props: {
title: { title: {
type: String, type: String,
default: "", default: ""
}, },
show: { show: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
rewardsDetails: { rewardsDetails: {
type: Object, type: Object,
default: () => { default: () => {
return this.queryParams; return this.queryParams
}, }
}, },
nodeList: { nodeList: {
type: Array, type: Array,
default: () => [], default: () => []
}, }
}, },
components: { components: {
imageUpload, imageUpload
}, },
computed: { computed: {
isChinese() { isChinese() {
return this.$i18n.locale === "zh_CN"; return this.$i18n.locale === "zh_CN"
}, },
isDisable() { isDisable() {
let disableStatus = false; let disableStatus = false
switch (this.title) { switch (this.title) {
case "1": case "1":
disableStatus = true; disableStatus = true
this.disabelEnableStatus = true; this.disabelEnableStatus = true
break; break
case "2": case "2":
if (this.queryParams.status == "2") { if (this.queryParams.status == "2") {
disableStatus = false; disableStatus = false
this.disabelEnableStatus = true; this.disabelEnableStatus = true
} else if (this.queryParams.status == "1") { } else if (this.queryParams.status == "1") {
disableStatus = true; disableStatus = true
this.disabelEnableStatus = false; this.disabelEnableStatus = false
} else { } else {
disableStatus = true; disableStatus = true
this.disabelEnableStatus = true; this.disabelEnableStatus = true
} }
break; break
case "3": case "3":
disableStatus = false; disableStatus = false
break; break
} }
return disableStatus; return disableStatus
}, },
titleLabel() { titleLabel() {
let titleLabelText = ""; let titleLabelText = ""
switch (this.title) { switch (this.title) {
case "1": case "1":
titleLabelText = this.$t("查看礼品"); titleLabelText = this.$t("查看礼品")
break; break
case "2": case "2":
titleLabelText = this.$t("编辑礼品"); titleLabelText = this.$t("编辑礼品")
break; break
case "3": case "3":
this.resetFormQuery(); this.resetFormQuery()
titleLabelText = this.$t("新增礼品"); titleLabelText = this.$t("新增礼品")
break; break
}
return titleLabelText
} }
return titleLabelText;
},
}, },
watch: { watch: {
rewardsDetails(newVal, oldVal) { rewardsDetails(newVal, oldVal) {
if (JSON.stringify(newVal) != "{}") { if (JSON.stringify(newVal) != "{}") {
this.queryParams = deepClone(newVal); this.queryParams = deepClone(newVal)
this.queryParams.dateRangeCreateTime = [ this.$set(this.queryParams, "dateRangeCreateTime", [parseTime(newVal.startTime), parseTime(newVal.endTime)])
parseTime(newVal.startTime), this.queryParams.pickMethod = newVal.pickMethod.split(",")
parseTime(newVal.endTime),
];
this.queryParams.pickMethod = newVal.pickMethod.split(",");
} else { } else {
this.resetFormQuery(); this.resetFormQuery()
this.$refs["queryForm"].resetFields(); this.$refs["queryForm"].resetFields()
console.log("Prop is empty"); console.log("Prop is empty")
}
} }
},
}, },
data() { data() {
return { return {
...@@ -321,7 +197,7 @@ export default { ...@@ -321,7 +197,7 @@ export default {
status: null, status: null,
titleEn: null, titleEn: null,
titleZh: null, titleZh: null,
dateRangeCreateTime: null, dateRangeCreateTime: []
}, },
disabelEnableStatus: false, disabelEnableStatus: false,
warehouseList: [], warehouseList: [],
...@@ -330,141 +206,144 @@ export default { ...@@ -330,141 +206,144 @@ export default {
{ {
required: true, required: true,
message: this.$t("请输入中文礼品名称"), message: this.$t("请输入中文礼品名称"),
trigger: "blur", trigger: "blur"
}, },
{ {
min: 0, min: 0,
max: 50, max: 50,
message: this.$t("长度在 0 到 50 个字符"), message: this.$t("长度在 0 到 50 个字符"),
trigger: "blur", trigger: "blur"
}, }
], ],
titleEn: [ titleEn: [
{ {
required: true, required: true,
message: this.$t("请输入英文礼品名称"), message: this.$t("请输入英文礼品名称"),
trigger: "blur", trigger: "blur"
}, },
{ {
min: 0, min: 0,
max: 50, max: 50,
message: this.$t("长度在 0 到 50 个字符"), message: this.$t("长度在 0 到 50 个字符"),
trigger: "blur", trigger: "blur"
}, }
], ],
nodeIds: { nodeIds: {
wareHouses: [ wareHouses: [
{ {
required: true, required: true,
message: this.$t("请选择网点"), message: this.$t("请选择网点"),
trigger: "change", trigger: "change"
}, }
], ],
points: [ points: [
{ {
required: true, required: true,
message: this.$t("请输入兑换积分"), message: this.$t("请输入兑换积分"),
trigger: "blur", trigger: "blur"
}, },
{ type: "number", message: "输入数字", trigger: "blur" }, { type: "number", message: "输入数字", trigger: "blur" }
], ],
quantityRemain: [ quantityRemain: [
{ {
required: true, required: true,
message: this.$t("请输入剩余数量"), message: this.$t("请输入剩余数量"),
trigger: "blur", trigger: "blur"
}, }
], ]
}, },
pickMethod: [ pickMethod: [
{ {
required: true, required: true,
message: this.$t("请选择领取方式"), message: this.$t("请选择领取方式"),
trigger: "change", trigger: "change"
}, }
], ],
allowCount: [ allowCount: [
{ {
required: true, required: true,
message: this.$t("请输入允许兑换次数"), message: this.$t("请输入允许兑换次数"),
trigger: "blur", trigger: "blur"
}, },
{ type: "number", message: "输入数字", trigger: "blur" }, { type: "number", message: "输入数字", trigger: "blur" }
], ],
remarkZh: [ remarkZh: [
{ {
min: 0, min: 0,
max: 500, max: 500,
message: this.$t("长度在 0 到 500 个字符"), message: this.$t("长度在 0 到 500 个字符"),
trigger: "blur", trigger: "blur"
}, }
], ],
remarkEn: [ remarkEn: [
{ {
min: 0, min: 0,
max: 500, max: 500,
message: this.$t("长度在 0 到 500 个字符"), message: this.$t("长度在 0 到 500 个字符"),
trigger: "blur", trigger: "blur"
}, }
], ],
status: [ status: [
{ {
required: true, required: true,
message: this.$t("请选择是否启用"), message: this.$t("请选择是否启用"),
trigger: "change", trigger: "change"
}, }
], ]
}, }
}; }
}, },
created() { created() {
this.handleWarehouseList(); this.handleWarehouseList()
}, },
methods: { methods: {
dataTimeFunc(e) {
console.log("5555", e)
},
handleWarehouseList(val = "") { handleWarehouseList(val = "") {
let params = { title: val }; let params = { title: val }
getWarehouseList(params).then((res) => { getWarehouseList(params).then((res) => {
this.warehouseList = res.data; this.warehouseList = res.data
}); })
}, },
handleOrderVRule(item, index) { handleOrderVRule(item, index) {
if (index == "0") { if (index == "0") {
this.queryParams.nodeIds.push({ nodeId: "", points: "" }); this.queryParams.nodeIds.push({ nodeId: "", points: "" })
} else { } else {
this.queryParams.nodeIds.splice(index, 1); this.queryParams.nodeIds.splice(index, 1)
} }
}, },
submit() { submit() {
let params = { ...this.queryParams }; let params = { ...this.queryParams }
params.startTime = this.queryParams?.dateRangeCreateTime?.[0]; params.startTime = this.queryParams?.dateRangeCreateTime?.[0]
params.endTime = this.queryParams?.dateRangeCreateTime?.[1]; params.endTime = this.queryParams?.dateRangeCreateTime?.[1]
params.pickMethod = this.queryParams.pickMethod.toString(); params.pickMethod = this.queryParams.pickMethod.toString()
this.$refs["queryForm"].validate((valid) => { this.$refs["queryForm"].validate((valid) => {
if (valid) { if (valid) {
if (this.title == "2") { if (this.title == "2") {
editRewards(params).then((res) => { editRewards(params).then((res) => {
this.$emit("update:show", false); this.$emit("update:show", false)
this.$message.success(this.$t("编辑成功")); this.$message.success(this.$t("编辑成功"))
this.$refs["queryForm"].resetFields(); this.$refs["queryForm"].resetFields()
this.$parent.getList(); this.$parent.getList()
}); })
} else { } else {
//Add //Add
addRewards(params).then((res) => { addRewards(params).then((res) => {
this.$emit("update:show", false); this.$emit("update:show", false)
this.$message.success(this.$t("成功")); this.$message.success(this.$t("成功"))
this.$refs["queryForm"].resetFields(); this.$refs["queryForm"].resetFields()
}); })
} }
} else { } else {
console.log("error submit!!"); console.log("error submit!!")
return false; return false
} }
}); })
}, },
close() { close() {
this.$emit("update:show", false); this.$emit("update:show", false)
}, },
resetFormQuery() { resetFormQuery() {
this.queryParams = { this.queryParams = {
...@@ -483,11 +362,11 @@ export default { ...@@ -483,11 +362,11 @@ export default {
status: null, status: null,
titleEn: null, titleEn: null,
titleZh: null, titleZh: null,
dateRangeCreateTime: null, dateRangeCreateTime: []
}; }
}, }
}, }
}; }
</script> </script>
<style> <style>
.input-item-width { .input-item-width {
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form <el-form :model="queryParams" ref="queryForm" size="small" :rules="rules" class="integral-rule-operate" :disabled="showViewTime" label-width="120px">
:model="queryParams"
ref="queryForm"
size="small"
:rules="rules"
class="integral-rule-operate"
:disabled="showViewTime"
label-width="120px"
>
<el-form-item :label="$t('指标类型')" prop="type"> <el-form-item :label="$t('指标类型')" prop="type">
<dict-selector <dict-selector clearable :type="DICT_TYPE.SCORE_RULE_TYPE" @change="changeIntegraltype" v-model="queryParams.type"> </dict-selector>
clearable
:type="DICT_TYPE.SCORE_RULE_TYPE"
v-model="queryParams.type"
>
</dict-selector>
</el-form-item> </el-form-item>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('中文标题')" prop="titleZh"> <el-form-item :label="$t('中文标题')" prop="titleZh">
<el-input <el-input style="width: 300px" v-model="queryParams.titleZh" :placeholder="$t('请输入查找')" clearable v-trim />
style="width: 300px" <el-button size="mini" type="text" style="margin-left: 10px" v-if="queryParams.type == '4' && !showViewTime" @click="handleSelectBannerDialog()">{{ $t("选择") }}</el-button>
v-model="queryParams.titleZh"
:placeholder="$t('请输入查找')"
clearable
v-trim
/>
<el-button
size="mini"
type="text"
style="margin-left: 10px"
v-if="queryParams.type == '4' && !showViewTime"
@click="handleSelectBannerDialog()"
>{{ $t("选择") }}</el-button
>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('英文标题')" prop="titleEn"> <el-form-item :label="$t('英文标题')" prop="titleEn"> <el-input style="width: 300px" v-model="queryParams.titleEn" :placeholder="$t('请输入查找')" clearable v-trim /> </el-form-item
<el-input
style="width: 300px"
v-model="queryParams.titleEn"
:placeholder="$t('请输入查找')"
clearable
v-trim
/> </el-form-item
></el-col> ></el-col>
</el-row> </el-row>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('中文封面图')" prop="coverImageZh"> <el-form-item :label="$t('中文封面图')" prop="coverImageZh">
<image-upload v-model="queryParams.coverImageZh" :isShowEditButton="!showViewTime"/> <image-upload v-model="queryParams.coverImageZh" :fileType="['png', 'jpg', 'jpeg']" :isShowEditButton="!showViewTime" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('英文封面图')" prop="coverImageEn"> <el-form-item :label="$t('英文封面图')" prop="coverImageEn">
<image-upload v-model="queryParams.coverImageEn" :isShowEditButton="!showViewTime"/> <image-upload v-model="queryParams.coverImageEn" :isShowEditButton="!showViewTime" :fileType="['png', 'jpg', 'jpeg']" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!--分享活动内容 --> <!--分享活动内容 -->
<el-form-item <el-form-item :label="$t('中文活动内容')" prop="extraShare.activityDescZh" v-if="queryParams.type == '4'">
:label="$t('中文活动内容')"
prop="extraShare.activityDescZh"
v-if="queryParams.type == '4'"
>
<el-col :span="18"> <el-col :span="18">
<editor <editor :readOnly="showViewTime" :class="{ readOnlyEditor: showViewTime }" v-model="queryParams.extraShare.activityDescZh" :min-height="150" />
:readOnly="showViewTime"
:class="{ readOnlyEditor: showViewTime }"
v-model="queryParams.extraShare.activityDescZh"
:min-height="150"
/>
</el-col> </el-col>
<el-col :span="1"></el-col> <el-col :span="1"></el-col>
<el-button type="text" @click="viewActivityDesc('Zh')">{{ <el-button type="text" @click="viewActivityDesc('Zh')">{{ $t("预览") }}</el-button>
$t("预览")
}}</el-button>
</el-form-item> </el-form-item>
<el-form-item <el-form-item :label="$t('英文活动内容')" prop="extraShare.activityDescEn" v-if="queryParams.type == '4'">
:label="$t('英文活动内容')"
prop="extraShare.activityDescEn"
v-if="queryParams.type == '4'"
>
<el-col :span="18"> <el-col :span="18">
<editor <editor :class="{ readOnlyEditor: showViewTime }" :readOnly="showViewTime" v-model="queryParams.extraShare.activityDescEn" :min-height="150" />
:class="{ readOnlyEditor: showViewTime }"
:readOnly="showViewTime"
v-model="queryParams.extraShare.activityDescEn"
:min-height="150"
/>
</el-col> </el-col>
<el-col :span="1"></el-col> <el-col :span="1"></el-col>
<el-button type="text" @click="viewActivityDesc('En')">{{ <el-button type="text" @click="viewActivityDesc('En')">{{ $t("预览") }}</el-button>
$t("预览")
}}</el-button>
</el-form-item> </el-form-item>
<!-- 链接 --> <!-- 链接 -->
<el-form-item :label="$t('活动链接')" v-if="queryParams.type == '4'" > <el-form-item :label="$t('活动链接')" v-if="queryParams.type == '4'">
<el-input <el-input v-model="queryParams.extraShare.activityUrl" :placeholder="$t('请输入活动链接')" clearable :disabled="true" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
v-model="queryParams.extraShare.activityUrl"
:placeholder="$t('请输入活动链接')"
clearable
:disabled="true"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
<!-- 推荐分享文案 --> <!-- 推荐分享文案 -->
<el-row :gutter="10" v-if="queryParams.type == '3'"> <el-row :gutter="10" v-if="queryParams.type == '3'">
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item :label="$t('中文分享文案 ')" prop="extraRecommend.shareContentZh"> <el-input type="textarea" style="width: 300px" v-model="queryParams.extraRecommend.shareContentZh" :placeholder="$t('请输入分享文案')" clearable v-trim /> </el-form-item
:label="$t('中文分享文案 ')"
prop="extraRecommend.shareContentZh"
>
<el-input
type="textarea"
style="width: 300px"
v-model="queryParams.extraRecommend.shareContentZh"
:placeholder="$t('请输入分享文案')"
clearable
v-trim
/> </el-form-item
></el-col> ></el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item :label="$t('英文分享文案')" prop="extraRecommend.shareContentEn"> <el-input type="textarea" style="width: 300px" v-model="queryParams.extraRecommend.shareContentEn" :placeholder="$t('请输入分享文案')" clearable v-trim /> </el-form-item
:label="$t('英文分享文案')"
prop="extraRecommend.shareContentEn"
>
<el-input
type="textarea"
style="width: 300px"
v-model="queryParams.extraRecommend.shareContentEn"
:placeholder="$t('请输入分享文案')"
clearable
v-trim
/> </el-form-item
></el-col> ></el-col>
</el-row> </el-row>
<!-- 注册链接 --> <!-- 注册链接 -->
<el-form-item :label="$t('注册链接')" v-if="queryParams.type == '3'"> <el-form-item :label="$t('注册链接')" v-if="queryParams.type == '3'">
<el-input <el-input v-model="queryParams.registerUrl" :placeholder="$t('请输入注册链接')" clearable :disabled="true" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
v-model="queryParams.registerUrl"
:placeholder="$t('请输入注册链接')"
clearable
:disabled="true"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
<el-form-item v-if="queryParams.type == '1'" :label="$t('首单')"> <el-form-item v-if="queryParams.type == '1'" :label="$t('首单')">
<el-radio-group v-model="queryParams.extraOrderV.firstOrder"> <el-radio-group v-model="queryParams.extraOrderV.firstOrder">
<el-radio <el-radio v-for="dict in getDictDatas(DICT_TYPE.YES_OR_NO)" :key="dict.value" :label="dict.value">{{ $l(dict, "label") }}</el-radio>
v-for="dict in getDictDatas(DICT_TYPE.YES_OR_NO)"
:key="dict.value"
:label="dict.value"
>{{ $l(dict, "label") }}</el-radio
>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item <el-form-item :label="$t('运输方式')" v-if="queryParams.type == '1'" prop="extraOrderV.transportType">
:label="$t('运输方式')" <dict-selector clearable :type="DICT_TYPE.TRANSPORT_TYPE" v-model="queryParams.extraOrderV.transportType"> </dict-selector>
v-if="queryParams.type == '1'"
prop="extraOrderV.transportType"
>
<dict-selector
clearable
:type="DICT_TYPE.TRANSPORT_TYPE"
v-model="queryParams.extraOrderV.transportType"
>
</dict-selector>
</el-form-item> </el-form-item>
<el-form-item <el-form-item :label="$t('提货点')" v-if="queryParams.type == '1'" prop="extraOrderV.receiveAddrList">
:label="$t('提货点')" <el-cascader v-if="cascaderState" style="width: 400px" :options="regionTreeList" @change="selectHandle" @expand-change="selectExpand" collapse-tags v-model="queryParams.extraOrderV.receiveAddrList" :props="cascaderProps" clearable></el-cascader>
v-if="queryParams.type == '1'"
prop="extraOrderV.receiveAddrList"
>
<el-cascader
v-if="cascaderState"
style="width: 400px"
:options="regionTreeList"
@change="selectHandle"
@expand-change="selectExpand"
collapse-tags
v-model="queryParams.extraOrderV.receiveAddrList"
:props="cascaderProps"
clearable
></el-cascader>
</el-form-item> </el-form-item>
<el-form-item <el-form-item :label="$t('渠道')" v-if="queryParams.extraOrderV.transportType == '3'">
:label="$t('渠道')"
v-if="queryParams.extraOrderV.transportType == '3'"
>
<el-select v-model="queryParams.channel" multiple placeholder="请选择"> <el-select v-model="queryParams.channel" multiple placeholder="请选择">
<el-option <el-option v-for="item in channelList" :key="item.channelId" :label="isChinese ? item.nameZh : item.nameEn" :value="item.channelId"> </el-option>
v-for="item in channelList"
:key="item.channelId"
:label="isChinese ? item.nameZh : item.nameEn"
:value="item.channelId"
>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-row :gutter="10">
<!-- v值积分 -->
<el-col :span="18">
<el-form-item :label="$t('积分')" v-if="queryParams.type == '1'" required> <el-form-item :label="$t('积分')" v-if="queryParams.type == '1'" required>
<el-row <el-row type="flex" justify="start" v-for="(item, index) in queryParams.extraOrderV.orderVRule">
type="flex"
justify="start"
v-for="(item, index) in queryParams.extraOrderV.orderVRule"
>
<el-col :span="2"> <el-col :span="2">
<el-form-item <el-form-item :prop="'extraOrderV.orderVRule.' + index + '.low'" :rules="rules.extraOrderV.orderVRule.low"> <el-input style="width: 100px" v-model.number="item.low"></el-input></el-form-item>
:prop="'extraOrderV.orderVRule.' + index + '.low'"
:rules="rules.extraOrderV.orderVRule.low"
>
<el-input
style="width: 100px"
v-model.number="item.low"
></el-input
></el-form-item>
</el-col> </el-col>
<el-col :span="1"> <el-col :span="1">
{{ queryParams.extraOrderV.transportType == "3" ? "kg" : "" }} {{ queryParams.extraOrderV.transportType == "3" ? "kg" : "" }}
{{ $t("") }} {{ $t("") }}
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<el-form-item <el-form-item :prop="'extraOrderV.orderVRule.' + index + '.high'" :rules="rules.extraOrderV.orderVRule.high"> <el-input style="width: 100px" v-model.number="item.high"></el-input> </el-form-item
:prop="'extraOrderV.orderVRule.' + index + '.high'"
:rules="rules.extraOrderV.orderVRule.high"
>
<el-input
style="width: 100px"
v-model.number="item.high"
></el-input> </el-form-item
></el-col> ></el-col>
<el-col :span="1"> <el-col :span="1"> {{ queryParams.extraOrderV.transportType == "3" ? "kg" : "" }} = </el-col>
{{ queryParams.extraOrderV.transportType == "3" ? "kg" : "" }} =
</el-col>
<el-col :span="2"> <el-col :span="2">
<el-form-item <el-form-item :prop="'extraOrderV.orderVRule.' + index + '.score'" :rules="rules.extraOrderV.orderVRule.score"><el-input style="width: 100px" v-model.number="item.score"></el-input></el-form-item>
:prop="'extraOrderV.orderVRule.' + index + '.score'"
:rules="rules.extraOrderV.orderVRule.score"
><el-input
style="width: 100px"
v-model.number="item.score"
></el-input
></el-form-item>
</el-col> </el-col>
<el-col :span="1"> <el-col :span="1">
{{ $t("积分") }} {{ $t("积分") }}
</el-col> </el-col>
<el-col :span="1"> <el-col :span="1">
<el-button <el-button type="primary" :icon="index == '0' ? 'el-icon-plus' : 'el-icon-minus'" @click="handleOrderVRule(item, index)"></el-button>
type="primary"
:icon="index == '0' ? 'el-icon-plus' : 'el-icon-minus'"
@click="handleOrderVRule(item, index)"
></el-button>
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<!-- 除v值之外的积分规则 --> <!-- 除v值之外的积分规则 -->
<el-form-item <el-form-item v-if="queryParams.type != '1'" :label="$t('积分')" prop="getScoreOnce">
v-if="queryParams.type != '1'" <el-input style="width: 300px" v-model.number="queryParams.getScoreOnce" :placeholder="$t('请输入数字')" clearable onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
:label="$t('积分')"
prop="getScoreOnce"
>
<el-input
style="width: 300px"
v-model.number="queryParams.getScoreOnce"
:placeholder="$t('请输入数字')"
clearable
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
</el-row>
<el-row>
<el-form-item v-if="queryParams.type != '2'" :label="$t('累计最高积分')"> <el-form-item v-if="queryParams.type != '2'" :label="$t('累计最高积分')">
<el-input <el-input style="width: 300px" v-model.number="queryParams.maxScoreTotal" :placeholder="$t('请输入累计最高积分')" clearable onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
style="width: 300px"
v-model.number="queryParams.maxScoreTotal"
:placeholder="$t('请输入累计最高积分')"
clearable
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
<el-form-item </el-row>
v-if="queryParams.type == '1'" <el-row>
:label="$t('订单入口')" <el-form-item v-if="queryParams.type == '1'" :label="$t('订单入口')" prop="extraOrderV.orderEntry">
prop="extraOrderV.orderEntry" <dict-selector clearable :multiple="true" :type="DICT_TYPE.PLATFORM_TYPE" v-model="queryParams.extraOrderV.orderEntry"> </dict-selector>
>
<dict-selector
clearable
:multiple="true"
:type="DICT_TYPE.PLATFORM_TYPE"
v-model="queryParams.extraOrderV.orderEntry"
>
</dict-selector>
</el-form-item> </el-form-item>
<el-form-item </el-row>
:label="$t('活动有效期')" <el-row>
prop="dateRangeCreateTime" <div>
:rules="rules.dateRangeCreateTime" <el-form-item :label="$t('活动有效期')" prop="dateRangeCreateTime">
> <el-date-picker type="daterange" clearable placement="bottom-start" v-model="queryParams.dateRangeCreateTime" style="width: 300px" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
<el-date-picker
type="daterange"
clearable
placement="bottom-start"
v-model="queryParams.dateRangeCreateTime"
style="width: 300px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item> </el-form-item>
</div>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item :label="$t('积分有效期')" prop="scorePeriod"> <el-form-item :label="$t('积分有效期')" prop="scorePeriod">
<el-input <el-input v-model.number="queryParams.scorePeriod" :placeholder="$t('请输入积分有效期天数')" clearable onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
v-model.number="queryParams.scorePeriod"
:placeholder="$t('请输入积分有效期天数')"
clearable
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item :label="$t('排序')" prop="orderNum"> <el-form-item :label="$t('排序')" prop="orderNum">
<el-input <el-input v-model.number="queryParams.orderNum" :placeholder="$t('请输入排序')" clearable onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
v-model.number="queryParams.orderNum"
:placeholder="$t('请输入排序')"
clearable
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
</el-row>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="12"> <el-col :span="12">
<div>
<el-form-item :label="$t('中文规则说明')" prop="descZh"> <el-form-item :label="$t('中文规则说明')" prop="descZh">
<el-input type="textarea" v-model="queryParams.descZh"></el-input> <el-input type="textarea" v-model="queryParams.descZh"></el-input>
</el-form-item> </el-form-item>
<span class="del-btn">{{ <span class="del-btn">{{ $t("注:此说明用于展示给会员查看积分原因,请规范填写") }}</span>
$t("注:此说明用于展示给会员查看积分原因,请规范填写") </div>
}}</span>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('英文规则说明')" prop="descEn"> <el-form-item :label="$t('英文规则说明')" prop="descEn">
<el-input type="textarea" v-model="queryParams.descEn"></el-input> <el-input type="textarea" v-model="queryParams.descEn"></el-input>
</el-form-item> </el-form-item>
<span class="del-btn">{{ <span class="del-btn">{{ $t("注:此说明用于展示给会员查看积分原因,请规范填写") }}</span>
$t("注:此说明用于展示给会员查看积分原因,请规范填写")
}}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item :label="$t('是否推送')" prop="pushActivity"> <el-form-item :label="$t('是否推送')" prop="pushActivity">
<el-radio-group v-model="queryParams.pushActivity"> <el-radio-group v-model="queryParams.pushActivity">
<el-radio <el-radio v-for="dict in getDictDatas(DICT_TYPE.YES_OR_NO)" :key="dict.value" :label="dict.value">{{ $l(dict, "label") }}</el-radio>
v-for="dict in getDictDatas(DICT_TYPE.YES_OR_NO)"
:key="dict.value"
:label="dict.value"
>{{ $l(dict, "label") }}</el-radio
>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item :label="$t('展示平台')"> <el-form-item :label="$t('展示平台')">
<dict-selector <dict-selector clearable formType="checkbox" :multiple="true" :type="DICT_TYPE.PLATFORM_TYPE" v-model="queryParams.showPlatform"> </dict-selector>
clearable
formType="checkbox"
:multiple="true"
:type="DICT_TYPE.PLATFORM_TYPE"
v-model="queryParams.showPlatform"
>
</dict-selector>
</el-form-item> </el-form-item>
<el-form-item <el-form-item v-if="queryParams.type == '2'" :label="$t('注册平台')" prop="extraRegister.registerPlatform">
v-if="queryParams.type == '2'" <dict-selector clearable :multiple="true" :type="DICT_TYPE.CLIENT_PLATFORM" v-model="queryParams.extraRegister.registerPlatform"> </dict-selector>
:label="$t('注册平台')"
prop="extraRegister.registerPlatform"
>
<dict-selector
clearable
:multiple="true"
:type="DICT_TYPE.CLIENT_PLATFORM"
v-model="queryParams.extraRegister.registerPlatform"
>
</dict-selector>
</el-form-item> </el-form-item>
<el-form-item <el-form-item :label="$t('是否分享')" prop="extraRecommend.shareStatus" v-if="queryParams.type == '3'">
:label="$t('是否分享')"
prop="extraRecommend.shareStatus"
v-if="queryParams.type == '3'"
>
<el-radio-group v-model="queryParams.extraRecommend.shareStatus"> <el-radio-group v-model="queryParams.extraRecommend.shareStatus">
<el-radio <el-radio v-for="dict in getDictDatas(DICT_TYPE.YES_OR_NO)" :key="dict.value" :label="dict.value">{{ $l(dict, "label") }}</el-radio>
v-for="dict in getDictDatas(DICT_TYPE.YES_OR_NO)"
:key="dict.value"
:label="dict.value"
>{{ $l(dict, "label") }}</el-radio
>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item <el-form-item :label="$t('是否分享')" prop="extraShare.shareStatus" v-if="queryParams.type == '4'">
:label="$t('是否分享')"
prop="extraShare.shareStatus"
v-if="queryParams.type == '4'"
>
<el-radio-group v-model="queryParams.extraShare.shareStatus"> <el-radio-group v-model="queryParams.extraShare.shareStatus">
<el-radio <el-radio v-for="dict in getDictDatas(DICT_TYPE.YES_OR_NO)" :key="dict.value" :label="dict.value">{{ $l(dict, "label") }}</el-radio>
v-for="dict in getDictDatas(DICT_TYPE.YES_OR_NO)"
:key="dict.value"
:label="dict.value"
>{{ $l(dict, "label") }}</el-radio
>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<!-- 编辑相关内容 --> <!-- 编辑相关内容 -->
<div v-if="showViewTime"> <div v-if="showViewTime">
<el-form-item :label="$t('创建人')"> <el-form-item :label="$t('创建人')">
<el-input <el-input v-model.number="queryParams.creator" :placeholder="$t('请输入创建人')" clearable onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
v-model.number="queryParams.creator"
:placeholder="$t('请输入创建人')"
clearable
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('创建时间')"> <el-form-item :label="$t('创建时间')">
<el-date-picker <el-date-picker type="datetime" :placeholder="$t('选择创建时间')" v-model="queryParams.createTime" value-format="yyyy-MM-dd HH:mm:ss" placement="bottom-start"></el-date-picker>
type="datetime"
:placeholder="$t('选择创建时间')"
v-model="queryParams.createTime"
value-format="yyyy-MM-dd HH:mm:ss"
placement="bottom-start"
></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item :label="$t('最后更新人')"> <el-form-item :label="$t('最后更新人')">
<el-input <el-input v-model.number="queryParams.updater" :placeholder="$t('请输入最后更新人')" clearable onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
v-model.number="queryParams.updater"
:placeholder="$t('请输入最后更新人')"
clearable
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('最后更新时间')"> <el-form-item :label="$t('最后更新时间')">
<el-date-picker <el-date-picker type="datetime" :placeholder="$t('选择最后更新时间')" v-model="queryParams.updateTime" value-format="yyyy-MM-dd HH:mm:ss" placement="bottom-start"></el-date-picker>
type="datetime"
:placeholder="$t('选择最后更新时间')"
v-model="queryParams.updateTime"
value-format="yyyy-MM-dd HH:mm:ss"
placement="bottom-start"
></el-date-picker>
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
<el-row justify="end" :gutter="20" type="flex"> <el-row justify="end" :gutter="20" type="flex">
<el-col :span="3" v-if="$route.query.pageStatus == 'new'"> <el-col :span="3" v-if="$route.query.pageStatus == 'new'">
<el-button <el-button type="primary" @click="handleSaveIntegralRule" style="width: 100%">{{ $t("保存") }}</el-button>
type="primary"
@click="handleSaveIntegralRule"
style="width: 100%"
>{{ $t("保存") }}</el-button
>
</el-col> </el-col>
<el-col :span="3" v-if="$route.query.pageStatus == 'new'"> <el-col :span="3" v-if="$route.query.pageStatus == 'new'">
<el-button <el-button type="primary" style="width: 100%" @click="handleEnableIntegralRule">{{ $t("保存并启用") }}</el-button>
type="primary"
style="width: 100%"
@click="handleEnableIntegralRule"
>{{ $t("保存并启用") }}</el-button
>
</el-col> </el-col>
<el-col :span="3" v-if="$route.query.pageStatus == 'edit'"> <el-col :span="3" v-if="$route.query.pageStatus == 'edit'">
<el-button <el-button type="primary" style="width: 100%" @click="handleUpdatedIntegralRule">{{ $t("更新") }}</el-button>
type="primary"
style="width: 100%"
@click="handleUpdatedIntegralRule"
>{{ $t("更新") }}</el-button
>
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
<el-button <el-button v-if="$route.query.pageStatus != 'view'" type="primary" style="width: 100%" @click="handleResetIntegralRule">{{ $t("重置") }}</el-button>
v-if="$route.query.pageStatus != 'view'"
type="primary"
style="width: 100%"
@click="handleResetIntegralRule"
>{{ $t("重置") }}</el-button
>
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
<el-button style="width: 100%" type="primary" @click="handleGoBack">{{ <el-button style="width: 100%" type="primary" @click="handleGoBack">{{ $t("返回") }}</el-button>
$t("返回")
}}</el-button>
</el-col> </el-col>
</el-row> </el-row>
<!-- 选择广告弹窗 --> <!-- 选择广告弹窗 -->
<el-dialog <el-dialog :title="$t('选择广告')" :visible.sync="dialogVisible" width="50%">
:title="$t('选择广告')"
:visible.sync="dialogVisible"
width="50%"
>
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column label="" align="center" prop="id" /> <el-table-column label="" align="center" prop="id" />
<el-table-column :label="$t('标题')" align="center" prop="titleZh" /> <el-table-column :label="$t('标题')" align="center" prop="titleZh" />
<el-table-column <el-table-column :label="$t('WEB端图片')" align="center" prop="bannerUrlWeb">
:label="$t('WEB端图片')"
align="center"
prop="bannerUrlWeb"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-image :src="scope.row.bannerUrlWeb"></el-image> <el-image :src="scope.row.bannerUrlWeb"></el-image>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :label="$t('APP端图片')" align="center" prop="bannerUrlApp">
:label="$t('APP端图片')"
align="center"
prop="bannerUrlApp"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-image :src="scope.row.bannerUrlApp"></el-image> <el-image :src="scope.row.bannerUrlApp"></el-image>
</template> </template>
...@@ -521,47 +234,23 @@ ...@@ -521,47 +234,23 @@
<span>{{ statusName(scope.row.status) }}</span> <span>{{ statusName(scope.row.status) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :label="$t('创建时间')" align="center" prop="createTime" width="180">
:label="$t('创建时间')"
align="center"
prop="createTime"
width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
:label="$t('操作')"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button size="mini" type="text" @click="handleSelectAdvertising(scope.row)">{{ $t("选择") }}</el-button>
size="mini"
type="text"
@click="handleSelectAdvertising(scope.row)"
>{{ $t("选择") }}</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" @pagination="getList" />
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-dialog> </el-dialog>
<!-- 预览弹窗 --> <!-- 预览弹窗 -->
<el-dialog <el-dialog :title="$t('预览')" :visible.sync="viewActivityDialog" width="400px">
:title="$t('预览')"
:visible.sync="viewActivityDialog"
width="400px"
>
<div class="container"> <div class="container">
<div class="phoneBox"> <div class="phoneBox">
<div class="title"> <div class="title">
...@@ -575,100 +264,66 @@ ...@@ -575,100 +264,66 @@
</div> </div>
</template> </template>
<script> <script>
import { CommonStatusEnum } from "@/utils/constants"; import { CommonStatusEnum } from "@/utils/constants"
import { getBannerPage } from "@/api/ecw/banner"; import { getBannerPage } from "@/api/ecw/banner"
import Editor from "@/components/Editor"; import Editor from "@/components/Editor"
import { getDictDatas, DICT_TYPE } from "@/utils/dict"; import { getDictDatas, DICT_TYPE } from "@/utils/dict"
import { import { getRegionTreeList, getChannelList, createIntegralRule, integralRuleDetails, integralRuleUpdated } from "@/api/ecw/memberManagement"
getRegionTreeList, import { deepClone } from "@/utils/index"
getChannelList, import ImageUpload from "@/components/ImageUpload"
createIntegralRule, import { parseTime } from "@/utils/ruoyi"
integralRuleDetails, import { isNumber } from "min-dash"
integralRuleUpdated, import { mergeWith } from "lodash"
} from "@/api/ecw/memberManagement";
import { deepClone } from "@/utils/index";
import ImageUpload from "@/components/ImageUpload";
import { parseTime } from "@/utils/ruoyi";
import { isNumber } from "min-dash";
import { mergeWith } from "lodash";
export default { export default {
name: "addIntegrationRuleOperation", name: "addIntegrationRuleOperation",
components: { components: {
ImageUpload, ImageUpload,
Editor, Editor
}, },
data() { data() {
const validatePass2 = (rule, value, callback) => { const validatePass2 = (rule, value, callback) => {
const index = Number(rule.field.split(".")[2]); const index = Number(rule.field.split(".")[2])
if (index == "0") { if (index == "0") {
if ( if (this.queryParams.extraOrderV.orderVRule[index].low >= this.queryParams.extraOrderV.orderVRule[index].high && this.queryParams.extraOrderV.orderVRule[index].high) {
this.queryParams.extraOrderV.orderVRule[index].low >= callback(this.$t("开始积分应小于本次最终积分"))
this.queryParams.extraOrderV.orderVRule[index].high &&
this.queryParams.extraOrderV.orderVRule[index].high
) {
callback(this.$t("开始积分应小于本次最终积分"));
} else { } else {
callback(); callback()
} }
} else if (index > "0") { } else if (index > "0") {
if ( if (this.queryParams.extraOrderV.orderVRule[index].low >= this.queryParams.extraOrderV.orderVRule[index].high && this.queryParams.extraOrderV.orderVRule[index].high) {
this.queryParams.extraOrderV.orderVRule[index].low >= callback(this.$t("开始积分应小于本次最终积分"))
this.queryParams.extraOrderV.orderVRule[index].high && } else if (this.queryParams.extraOrderV.orderVRule[index].low <= this.queryParams.extraOrderV.orderVRule[index - 1].high) {
this.queryParams.extraOrderV.orderVRule[index].high callback(this.$t("开始积分应大于上一次最终积分"))
) {
callback(this.$t("开始积分应小于本次最终积分"));
} else if (
this.queryParams.extraOrderV.orderVRule[index].low <=
this.queryParams.extraOrderV.orderVRule[index - 1].high
) {
callback(this.$t("开始积分应大于上一次最终积分"));
} else { } else {
callback(); callback()
} }
} else { } else {
callback(); callback()
}
} }
};
const validatehigh = (rule, value, callback) => { const validatehigh = (rule, value, callback) => {
const index = Number(rule.field.split(".")[2]); const index = Number(rule.field.split(".")[2])
if (index == "0") { if (index == "0") {
if ( if (this.queryParams.extraOrderV.orderVRule[index].low && this.queryParams.extraOrderV.orderVRule[index].low >= this.queryParams.extraOrderV.orderVRule[index].high) {
this.queryParams.extraOrderV.orderVRule[index].low && callback(this.$t("本次最终积分应大于本次开始积分"))
this.queryParams.extraOrderV.orderVRule[index].low >= } else if (this.queryParams.extraOrderV.orderVRule[index + 1] && this.queryParams.extraOrderV.orderVRule[index + 1].low && this.queryParams.extraOrderV.orderVRule[index + 1].low <= this.queryParams.extraOrderV.orderVRule[index].high) {
this.queryParams.extraOrderV.orderVRule[index].high callback(this.$t("本次最终积分应小于下一次开始积分"))
) {
callback(this.$t("本次最终积分应大于本次开始积分"));
} else if (
this.queryParams.extraOrderV.orderVRule[index + 1] &&
this.queryParams.extraOrderV.orderVRule[index + 1].low &&
this.queryParams.extraOrderV.orderVRule[index + 1].low <=
this.queryParams.extraOrderV.orderVRule[index].high
) {
callback(this.$t("本次最终积分应小于下一次开始积分"));
} else { } else {
callback(); callback()
} }
} else if (index > 0) { } else if (index > 0) {
if ( if (this.queryParams.extraOrderV.orderVRule[index].low && this.queryParams.extraOrderV.orderVRule[index].low >= this.queryParams.extraOrderV.orderVRule[index].high) {
this.queryParams.extraOrderV.orderVRule[index].low && callback(this.$t("本次最终积分应大于本次开始积分"))
this.queryParams.extraOrderV.orderVRule[index].low >= } else if (this.queryParams.extraOrderV.orderVRule[index + 1]?.low && this.queryParams.extraOrderV.orderVRule[index].high <= this.queryParams.extraOrderV.orderVRule[index + 1].low) {
this.queryParams.extraOrderV.orderVRule[index].high callback(this.$t("本次最终积分应小于下一次开始积分"))
) {
callback(this.$t("本次最终积分应大于本次开始积分"));
} else if (
this.queryParams.extraOrderV.orderVRule[index + 1]?.low &&
this.queryParams.extraOrderV.orderVRule[index].high <=
this.queryParams.extraOrderV.orderVRule[index + 1].low
) {
callback(this.$t("本次最终积分应小于下一次开始积分"));
} else { } else {
callback(); callback()
} }
} else { } else {
callback(); callback()
}
} }
};
return { return {
viewActivityDialog: false, viewActivityDialog: false,
//查看显示时间详情 //查看显示时间详情
...@@ -688,7 +343,7 @@ export default { ...@@ -688,7 +343,7 @@ export default {
contentEn: null, contentEn: null,
bannerUrlWeb: null, bannerUrlWeb: null,
bannerUrlApp: null, bannerUrlApp: null,
status: null, status: null
}, },
cascaderState: true, cascaderState: true,
channelList: [], channelList: [],
...@@ -699,86 +354,86 @@ export default { ...@@ -699,86 +354,86 @@ export default {
{ {
required: true, required: true,
message: this.$t("请选择是否推送"), message: this.$t("请选择是否推送"),
trigger: "change", trigger: "change"
}, }
], ],
getScoreOnce: [ getScoreOnce: [
{ {
required: true, required: true,
message: this.$t("请输入积分"), message: this.$t("请输入积分"),
trigger: "blur", trigger: "blur"
}, },
{ {
type: "number", type: "number",
message: this.$t("请输入整数"), message: this.$t("请输入整数"),
trigger: "blur", trigger: "blur"
}, }
], ],
descEn: [ descEn: [
{ {
required: true, required: true,
message: this.$t("请输入英文规则说明"), message: this.$t("请输入英文规则说明"),
trigger: "blur", trigger: "blur"
}, }
], ],
descZh: [ descZh: [
{ {
required: true, required: true,
message: this.$t("请输入中文规则说明"), message: this.$t("请输入中文规则说明"),
trigger: "blur", trigger: "blur"
}, }
], ],
titleZh: [ titleZh: [
{ {
required: true, required: true,
message: this.$t("请输入中文标题"), message: this.$t("请输入中文标题"),
trigger: "blur", trigger: "blur"
}, }
], ],
titleEn: [ titleEn: [
{ {
required: true, required: true,
message: this.$t("请输入文标题"), message: this.$t("请输入文标题"),
trigger: "blur", trigger: "blur"
}, }
], ],
orderNum: [ orderNum: [
{ {
required: true, required: true,
message: this.$t("请输入排序"), message: this.$t("请输入排序"),
trigger: "blur", trigger: "blur"
}, },
{ {
type: "number", type: "number",
message: this.$t("请输入整数"), message: this.$t("请输入整数"),
trigger: "blur", trigger: "blur"
}, }
], ],
scorePeriod: [ scorePeriod: [
{ {
type: "number", type: "number",
message: this.$t("请输入整数"), message: this.$t("请输入整数"),
trigger: "blur", trigger: "blur"
}, },
{ {
required: true, required: true,
message: this.$t("请输入积分有效天数"), message: this.$t("请输入积分有效天数"),
trigger: "blur", trigger: "blur"
}, }
], ],
type: [ type: [
{ {
required: true, required: true,
message: this.$t("请选择指标类型"), message: this.$t("请选择指标类型"),
trigger: "change", trigger: "change"
}, }
], ],
dateRangeCreateTime: [ dateRangeCreateTime: [
{ {
required: true, required: true,
message: this.$t("请选择活动有效期"), message: this.$t("请选择活动有效期"),
trigger: "change", trigger: ["change", "blur"]
}, }
], ],
//推荐 //推荐
extraRecommend: { extraRecommend: {
...@@ -786,75 +441,69 @@ export default { ...@@ -786,75 +441,69 @@ export default {
{ {
required: true, required: true,
message: this.$t("请输入分享文案"), message: this.$t("请输入分享文案"),
trigger: "blur", trigger: "blur"
}, }
], ],
shareContentZh: [ shareContentZh: [
{ {
required: true, required: true,
message: this.$t("请输入分享文案"), message: this.$t("请输入分享文案"),
trigger: "blur", trigger: "blur"
}, }
], ],
shareStatus: [ shareStatus: [
{ {
required: true, required: true,
message: this.$t("请选择是否分享"), message: this.$t("请选择是否分享"),
trigger: "change", trigger: "change"
}, }
], ]
}, },
//v值 //v值
extraOrderV: { extraOrderV: {
orderEntry: [ orderEntry: [{ required: true, message: "请选择订单入口", trigger: "change" }],
{ required: true, message: "请选择订单入口", trigger: "change" }, transportType: [{ required: true, message: "请选择运输方式", trigger: "change" }],
], receiveAddrList: [{ required: true, message: "请选择提货点", trigger: "change" }],
transportType: [
{ required: true, message: "请选择运输方式", trigger: "change" },
],
receiveAddrList: [
{ required: true, message: "请选择提货点", trigger: "change" },
],
orderVRule: { orderVRule: {
low: [ low: [
{ {
required: true, required: true,
message: this.$t("不能为空"), message: this.$t("不能为空"),
trigger: "blur", trigger: "blur"
}, },
{ {
type: "number", type: "number",
message: this.$t("请输入整数"), message: this.$t("请输入整数"),
trigger: "blur", trigger: "blur"
}, },
{ validator: validatePass2, trigger: "blur" }, { validator: validatePass2, trigger: "blur" }
], ],
score: [ score: [
{ {
required: true, required: true,
message: this.$t("不能为空"), message: this.$t("不能为空"),
trigger: "blur", trigger: "blur"
}, },
{ {
type: "number", type: "number",
message: this.$t("请输入整数"), message: this.$t("请输入整数"),
trigger: "blur", trigger: "blur"
}, }
], ],
high: [ high: [
{ {
required: true, required: true,
message: this.$t("不能为空"), message: this.$t("不能为空"),
trigger: "blur", trigger: "blur"
}, },
{ {
type: "number", type: "number",
message: this.$t("请输入整数"), message: this.$t("请输入整数"),
trigger: "blur", trigger: "blur"
},
{ validator: validatehigh, trigger: "blur" },
],
}, },
{ validator: validatehigh, trigger: "blur" }
]
}
}, },
//注册 //注册
extraRegister: { extraRegister: {
...@@ -862,9 +511,9 @@ export default { ...@@ -862,9 +511,9 @@ export default {
{ {
required: true, required: true,
message: this.$t("请选择注册平台"), message: this.$t("请选择注册平台"),
trigger: "change", trigger: "change"
}, }
], ]
}, },
//分享 //分享
extraShare: { extraShare: {
...@@ -872,24 +521,24 @@ export default { ...@@ -872,24 +521,24 @@ export default {
{ {
required: true, required: true,
message: this.$t("中文活动内容不能为空"), message: this.$t("中文活动内容不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
activityDescZh: [ activityDescZh: [
{ {
required: true, required: true,
message: this.$t("英文活动内容不能为空"), message: this.$t("英文活动内容不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
shareStatus: [ shareStatus: [
{ {
required: true, required: true,
message: this.$t("请选择是否分享"), message: this.$t("请选择是否分享"),
trigger: "change", trigger: "change"
}, }
], ]
}, }
}, },
lastSelectedList: [], //上一次选中数据 lastSelectedList: [], //上一次选中数据
oneDimensionalList: [], oneDimensionalList: [],
...@@ -916,11 +565,11 @@ export default { ...@@ -916,11 +565,11 @@ export default {
//推荐 //推荐
shareContentEn: "", shareContentEn: "",
shareContentZh: "", shareContentZh: "",
shareStatus: "0", //是否分享(0是,1否)默认是 shareStatus: "0" //是否分享(0是,1否)默认是
}, },
extraRegister: { extraRegister: {
// 注册扩展字段 // 注册扩展字段
registerPlatform: null, registerPlatform: null
}, },
extraOrderV: { extraOrderV: {
//订单V值扩展字段 //订单V值扩展字段
...@@ -928,198 +577,177 @@ export default { ...@@ -928,198 +577,177 @@ export default {
orderEntry: null, orderEntry: null,
transportType: "", //运输方式 transportType: "", //运输方式
receiveAddrList: [], receiveAddrList: [],
orderVRule: [{ low: "", high: "", score: "" }], orderVRule: [{ low: "", high: "", score: "" }]
}, },
extraShare: { extraShare: {
// 分享扩展字段 // 分享扩展字段
activityDescEn: null, activityDescEn: null,
activityDescZh: null, activityDescZh: null,
activityUrl: "", activityUrl: "",
shareStatus: "0", shareStatus: "0"
}, }
}, }
}; }
}, },
computed: { computed: {
statusName() { statusName() {
return (value) => { return (value) => {
for (let index in this.statusDictDatas) { for (let index in this.statusDictDatas) {
let dictItem = this.statusDictDatas[index]; let dictItem = this.statusDictDatas[index]
if (dictItem.value == value) { if (dictItem.value == value) {
return dictItem.value == CommonStatusEnum.ENABLE + "" return dictItem.value == CommonStatusEnum.ENABLE + "" ? this.$t("正常") : this.$t("禁用")
? this.$t("正常") }
: this.$t("禁用");
} }
} }
};
}, },
isChinese() { isChinese() {
return this.$i18n.locale === "zh_CN"; return this.$i18n.locale === "zh_CN"
}, },
cascaderProps() { cascaderProps() {
const label = this.isChinese ? "labelZh" : "labelEn"; const label = this.isChinese ? "labelZh" : "labelEn"
return { multiple: true, value: "id", label }; return { multiple: true, value: "id", label }
}, }
}, },
watch: { watch: {
"queryParams.dateRangeCreateTime": { "queryParams.dateRangeCreateTime": {
handler: function (newVal, oldVal) { handler: function (newVal, oldVal) {
this.$nextTick(() => { this.$nextTick(() => {
if (newVal.length) { if (newVal.length) {
this.queryParams.startTime = newVal[0]; this.queryParams.startTime = newVal[0]
this.queryParams.endTime = newVal[1]; this.queryParams.endTime = newVal[1]
} else { } else {
this.queryParams.startTime = ""; this.queryParams.startTime = ""
this.queryParams.endTime = ""; this.queryParams.endTime = ""
} }
}); })
}, },
immediate: true, immediate: true
}, },
isChinese: { isChinese: {
handler: function (newVal, oldVal) { handler: function (newVal, oldVal) {
this.cascaderState = false; this.cascaderState = false
this.$nextTick(() => { this.$nextTick(() => {
this.cascaderState = true; this.cascaderState = true
}); })
},
immediate: true,
}, },
immediate: true
}
}, },
created() { created() {
this.handleGetChannelList(); this.handleGetChannelList()
this.queryParams.registerUrl = this.queryParams.registerUrl = process.env.VUE_APP_BASE_API + "/#/pages/register/register"
process.env.VUE_APP_BASE_API + "/#/pages/register/register"; this.getList()
this.getList();
if (this.$route.query.pageStatus == "edit") { if (this.$route.query.pageStatus == "edit") {
this.handleIntegralRuleDetails(); this.handleIntegralRuleDetails()
} else if (this.$route.query.pageStatus == "view") { } else if (this.$route.query.pageStatus == "view") {
this.showViewTime = true; this.showViewTime = true
this.handleIntegralRuleDetails(); this.handleIntegralRuleDetails()
} else { } else {
this.handleGetRegionTreeList(); this.handleGetRegionTreeList()
} }
this.queryParams.extraShare.activityUrl = '/pages/activityShare/index' this.queryParams.extraShare.activityUrl = "/pages/activityShare/index"
}, },
activated() {}, activated() {},
methods: { methods: {
//process.env.NODE_ENV //process.env.NODE_ENV
changeIntegraltype(e) {
console.log("99999", e)
this.$refs["queryForm"].clearValidate()
},
//预览活动详情 //预览活动详情
viewActivityDesc(val) { viewActivityDesc(val) {
this.viewActivityDialog = true; this.viewActivityDialog = true
this.reviewDedtails.title = this.queryParams[`title${val}`]; this.reviewDedtails.title = this.queryParams[`title${val}`]
this.reviewDedtails.img = this.queryParams[`coverImage${val}`]; this.reviewDedtails.img = this.queryParams[`coverImage${val}`]
this.reviewDedtails.detail = this.reviewDedtails.detail = this.queryParams.extraShare[`activityDesc${val}`]
this.queryParams.extraShare[`activityDesc${val}`];
console.log("ppp", this.queryParams);
console.log("eeeppp", this.reviewDedtails);
}, },
//编辑更新积分规则 //编辑更新积分规则
handleUpdatedIntegralRule() { handleUpdatedIntegralRule() {
this.$refs["queryForm"].validate((valid) => { this.$refs["queryForm"].validate((valid) => {
if (valid) { if (valid) {
let params = deepClone(this.queryParams); let params = deepClone(this.queryParams)
params.showPlatform = this.queryParams.showPlatform?.join(); params.showPlatform = this.queryParams.showPlatform?.join()
params.extraOrderV.orderEntry = params.extraOrderV.orderEntry = this.queryParams.extraOrderV?.orderEntry?.join()
this.queryParams.extraOrderV?.orderEntry?.join(); params.extraRegister.registerPlatform = this.queryParams.extraRegister.registerPlatform?.join()
params.extraRegister.registerPlatform = if (this.queryParams.type == 1 && this.queryParams.extraOrderV.receiveAddrList?.[0]?.[0] == "000") {
this.queryParams.extraRegister.registerPlatform?.join();
if (
(this.queryParams.type ==
1 &&
this.queryParams.extraOrderV.receiveAddrList?.[0]?.[0] == "000")
) {
// params.extraOrderV.receiveAddrList[0] = [0, 0, 0]; // params.extraOrderV.receiveAddrList[0] = [0, 0, 0];
params.extraOrderV.receiveAddrList = [[0, 0, 0]]; params.extraOrderV.receiveAddrList = [[0, 0, 0]]
} }
integralRuleUpdated(params).then((res) => { integralRuleUpdated(params).then((res) => {
this.$message.success(this.$t("更新成功")); this.$message.success(this.$t("更新成功"))
this.$router.go(-1); this.$router.go(-1)
}); })
} else { } else {
console.log("error submit!!"); console.log("error submit!!")
return false; return false
} }
}); })
}, },
//获取积分规则详情 //获取积分规则详情
handleIntegralRuleDetails() { handleIntegralRuleDetails() {
this.queryParams.showPlatform = []; this.queryParams.showPlatform = []
integralRuleDetails({ id: this.$route.query.id }).then((res) => { integralRuleDetails({ id: this.$route.query.id }).then((res) => {
const params = mergeWith( const params = mergeWith(deepClone(this.queryParams), res.data, (a, b) => {
deepClone(this.queryParams), return b === null ? a : undefined
res.data, })
(a, b) => {
return b === null ? a : undefined;
}
);
params.createTime = parseTime(res.data.createTime, '{y}-{m}-{d} {h}:{i}:{s}'); params.createTime = parseTime(res.data.createTime, "{y}-{m}-{d} {h}:{i}:{s}")
params.updateTime = parseTime(res.data.updateTime, '{y}-{m}-{d} {h}:{i}:{s}'); params.updateTime = parseTime(res.data.updateTime, "{y}-{m}-{d} {h}:{i}:{s}")
if (isNumber(res.data.extraOrderV?.firstOrder)) { if (isNumber(res.data.extraOrderV?.firstOrder)) {
params.extraOrderV.firstOrder = params.extraOrderV.firstOrder = res.data.extraOrderV?.firstOrder.toString()
res.data.extraOrderV?.firstOrder.toString();
} }
if (isNumber(res.data.pushActivity)) { if (isNumber(res.data.pushActivity)) {
params.pushActivity = res.data.pushActivity.toString(); params.pushActivity = res.data.pushActivity.toString()
} }
if (isNumber(res.data.extraShare?.shareStatus)) { if (isNumber(res.data.extraShare?.shareStatus)) {
params.extraShare.shareStatus = params.extraShare.shareStatus = params.extraShare.shareStatus.toString()
params.extraShare.shareStatus.toString();
} }
if (isNumber(res.data.extraRecommend?.shareStatus)) { if (isNumber(res.data.extraRecommend?.shareStatus)) {
params.extraRecommend.shareStatus = params.extraRecommend.shareStatus = res.data.extraRecommend?.shareStatus.toString()
res.data.extraRecommend?.shareStatus.toString(); }
} console.log(params)
console.log(params); params.dateRangeCreateTime = [parseTime(res.data.startTime), parseTime(res.data.endTime)]
params.dateRangeCreateTime = [
parseTime(res.data.startTime),
parseTime(res.data.endTime),
];
if ( if (params.type == 1 && params.extraOrderV.receiveAddrList[0].toString() == "0,0,0") {
params.type == 1 && params.extraOrderV.receiveAddrList = [["000"]]
params.extraOrderV.receiveAddrList[0].toString() == "0,0,0" }
) { this.queryParams = { ...params }
params.extraOrderV.receiveAddrList = [["000"]]; this.handleGetRegionTreeList()
} })
this.queryParams = { ...params };
this.handleGetRegionTreeList();
});
}, },
handleSelectBannerDialog() { handleSelectBannerDialog() {
this.dialogVisible = true; this.dialogVisible = true
}, },
handleSelectAdvertising(row) { handleSelectAdvertising(row) {
this.dialogVisible = false; this.dialogVisible = false
this.queryParams.titleZh = row.titleZh; this.queryParams.titleZh = row.titleZh
this.queryParams.titleEn = row.titleEn; this.queryParams.titleEn = row.titleEn
this.queryParams.coverImageZh = row.bannerUrlApp; this.queryParams.coverImageZh = row.bannerUrlApp
this.queryParams.coverImageEn = row.bannerUrlApp; this.queryParams.coverImageEn = row.bannerUrlApp
this.queryParams.extraShare.activityDescZh = row.contentEn; this.queryParams.extraShare.activityDescZh = row.contentEn
this.queryParams.extraShare.activityDescEn = row.contentZh; this.queryParams.extraShare.activityDescEn = row.contentZh
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true
// 处理查询参数 // 处理查询参数
let params = { ...this.queryadvertisingParams }; let params = { ...this.queryadvertisingParams }
getBannerPage(params).then((response) => { getBannerPage(params).then((response) => {
this.list = response.data.list; this.list = response.data.list
this.total = response.data.total; this.total = response.data.total
this.loading = false; this.loading = false
}); })
}, },
//重置按钮操作 //重置按钮操作
handleResetIntegralRule() { handleResetIntegralRule() {
this.$modal this.$modal
.confirm(this.$t("是否确认重置此礼品规则表单"), this.$t("提示")) .confirm(this.$t("是否确认重置此礼品规则表单"), this.$t("提示"))
.then(() => { .then(() => {
this.$refs["queryForm"].resetFields(); this.$refs["queryForm"].resetFields()
this.$modal.msgSuccess(this.$t("重置成功")); this.$modal.msgSuccess(this.$t("重置成功"))
}) })
.catch(() => {}); .catch(() => {})
}, },
//返回按钮操作 //返回按钮操作
handleGoBack() { handleGoBack() {
...@@ -1127,248 +755,202 @@ export default { ...@@ -1127,248 +755,202 @@ export default {
.confirm(this.$t("是否确认返回"), this.$t("提示")) .confirm(this.$t("是否确认返回"), this.$t("提示"))
.then(() => { .then(() => {
// this.$router.go(-1); // this.$router.go(-1);
this.$store.dispatch("tagsView/delCurrentView"); this.$store.dispatch("tagsView/delCurrentView")
this.$modal.msgSuccess(this.$t("成功")); this.$modal.msgSuccess(this.$t("成功"))
}) })
.catch(() => {}); .catch(() => {})
}, },
//保存 //保存
handleSaveIntegralRule() { handleSaveIntegralRule() {
this.$refs["queryForm"].validate((valid) => { this.$refs["queryForm"].validate((valid) => {
if (valid) { if (valid) {
let params = deepClone(this.queryParams); let params = deepClone(this.queryParams)
params.showPlatform = this.queryParams.showPlatform?.join(); params.showPlatform = this.queryParams.showPlatform?.join()
params.extraOrderV.orderEntry = params.extraOrderV.orderEntry = this.queryParams.extraOrderV?.orderEntry?.join()
this.queryParams.extraOrderV?.orderEntry?.join(); params.extraRegister.registerPlatform = this.queryParams.extraRegister.registerPlatform?.join()
params.extraRegister.registerPlatform = params.status = this.queryParams.status || "2"
this.queryParams.extraRegister.registerPlatform?.join(); if (this.queryParams.type == 1 && this.queryParams.extraOrderV.receiveAddrList[0][0] == "000") {
params.status = this.queryParams.status || "2"; params.extraOrderV.receiveAddrList = [[0, 0, 0]]
if (
(this.queryParams.type ==
1 && this.queryParams.extraOrderV.receiveAddrList[0][0] == "000")
) {
params.extraOrderV.receiveAddrList = [[0, 0, 0]];
} }
createIntegralRule(params).then((res) => { createIntegralRule(params).then((res) => {
this.$message.success(this.$t("成功")); this.$message.success(this.$t("成功"))
this.$router.go(-1); this.$router.go(-1)
}); })
} else { } else {
console.log("error submit!!"); console.log("error submit!!")
return false; return false
} }
}); })
}, },
//保存并启用 //保存并启用
handleEnableIntegralRule() { handleEnableIntegralRule() {
this.$refs["queryForm"].validate((valid) => { this.$refs["queryForm"].validate((valid) => {
if (valid) { if (valid) {
let params = deepClone(this.queryParams); let params = deepClone(this.queryParams)
params.showPlatform = this.queryParams.showPlatform?.join(); params.showPlatform = this.queryParams.showPlatform?.join()
params.extraOrderV.orderEntry = params.extraOrderV.orderEntry = this.queryParams.extraOrderV.orderEntry?.join()
this.queryParams.extraOrderV.orderEntry?.join(); params.extraRegister.registerPlatform = this.queryParams.extraRegister.registerPlatform?.join()
params.extraRegister.registerPlatform = params.status = this.queryParams.status || "1"
this.queryParams.extraRegister.registerPlatform?.join(); if (this.queryParams.type == 1 && this.queryParams.extraOrderV.receiveAddrList[0][0] == "000") {
params.status = this.queryParams.status || "1"; params.extraOrderV.receiveAddrList = [[0, 0, 0]]
if (
(this.queryParams.type ==
1 && this.queryParams.extraOrderV.receiveAddrList[0][0] == "000")
) {
params.extraOrderV.receiveAddrList = [[0, 0, 0]];
} }
createIntegralRule(params).then((res) => { createIntegralRule(params).then((res) => {
this.$message.success(this.$t("成功")); this.$message.success(this.$t("成功"))
this.$router.go(-1); this.$router.go(-1)
}); })
} else { } else {
console.log("error submit!!"); console.log("error submit!!")
return false; return false
} }
}); })
}, },
handleOrderVRule(item, index) { handleOrderVRule(item, index) {
if (index == "0") { if (index == "0") {
this.queryParams.extraOrderV.orderVRule.push({ this.queryParams.extraOrderV.orderVRule.push({
low: "", low: "",
high: "", high: "",
score: "", score: ""
}); })
} else { } else {
this.queryParams.extraOrderV.orderVRule.splice(index, 1); this.queryParams.extraOrderV.orderVRule.splice(index, 1)
} }
}, },
//获取渠道列表 //获取渠道列表
handleGetChannelList() { handleGetChannelList() {
getChannelList().then((res) => { getChannelList().then((res) => {
this.channelList = res.data; this.channelList = res.data
}); })
},
selectExpand(val) {
console.log("PPPPPPP", val);
}, },
selectExpand(val) {},
selectHandle(val, defaultStatus = false) { selectHandle(val, defaultStatus = false) {
this.queryParams.extraOrderV.receiveAddrList = []; this.queryParams.extraOrderV.receiveAddrList = []
let current = []; // 获取当前选中的哪个数据 let current = [] // 获取当前选中的哪个数据
if (val.length >= this.lastSelectedList.length) { if (val.length >= this.lastSelectedList.length) {
let keys = this.lastSelectedList.map((item) => JSON.stringify(item)); let keys = this.lastSelectedList.map((item) => JSON.stringify(item))
current = val.filter((item) => !keys.includes(JSON.stringify(item))); current = val.filter((item) => !keys.includes(JSON.stringify(item)))
} else { } else {
// 取消选中 // 取消选中
let keys = val.map((item) => JSON.stringify(item)); let keys = val.map((item) => JSON.stringify(item))
current = this.lastSelectedList.filter( current = this.lastSelectedList.filter((item) => !keys.includes(JSON.stringify(item)))
(item) => !keys.includes(JSON.stringify(item))
);
} }
const currentValue = current.length > 0 ? current[0][0] || "" : ""; const currentValue = current.length > 0 ? current[0][0] || "" : ""
if (currentValue == "000") { if (currentValue == "000") {
if (this.judgetAllSelected(val)) { if (this.judgetAllSelected(val)) {
this.traverseTree(this.regionTreeList); //获取全选时回显的数据 this.traverseTree(this.regionTreeList) //获取全选时回显的数据
} else { } else {
this.queryParams.extraOrderV.receiveAddrList = []; //不选 this.queryParams.extraOrderV.receiveAddrList = [] //不选
} }
} else { } else {
this.queryParams.extraOrderV.receiveAddrList = val; //半选 this.queryParams.extraOrderV.receiveAddrList = val //半选
} }
if (!defaultStatus) { if (!defaultStatus) {
this.checkIsAddAllSelected(); this.checkIsAddAllSelected()
} }
// this.$nextTick(() => { // this.$nextTick(() => {
// //
this.lastSelectedList = this.queryParams.extraOrderV.receiveAddrList; this.lastSelectedList = this.queryParams.extraOrderV.receiveAddrList
// }); // });
}, },
checkIsAddAllSelected() { checkIsAddAllSelected() {
//这里你要判断好你的dom是否正确 //这里你要判断好你的dom是否正确
let label1 = document let label1 = document.querySelectorAll(".el-cascader-panel")[0].querySelector(".el-cascader-menu__wrap").querySelectorAll("li")[0].querySelectorAll("label")[0]
.querySelectorAll(".el-cascader-panel")[0] let span1 = document.querySelectorAll(".el-cascader-panel")[0].querySelector(".el-cascader-menu__wrap").querySelectorAll("li")[0].querySelectorAll("label")[0].querySelectorAll("span")[0]
.querySelector(".el-cascader-menu__wrap")
.querySelectorAll("li")[0]
.querySelectorAll("label")[0];
let span1 = document
.querySelectorAll(".el-cascader-panel")[0]
.querySelector(".el-cascader-menu__wrap")
.querySelectorAll("li")[0]
.querySelectorAll("label")[0]
.querySelectorAll("span")[0];
// 获取所有的数据 // 获取所有的数据
let list = this.regionTreeList; // 原始数据列表 let list = this.regionTreeList // 原始数据列表
if (this.oneDimensionalList.length === 0) { if (this.oneDimensionalList.length === 0) {
this.getTreeList(list); // 把所有的父子级平铺成一个一级列表 this.getTreeList(list) // 把所有的父子级平铺成一个一级列表
} }
let origin = [...this.oneDimensionalList].filter( let origin = [...this.oneDimensionalList].filter((item) => !item.children) //获取所有的叶子节点
(item) => !item.children let nowList = [...this.queryParams.extraOrderV.receiveAddrList].filter((item) => item[0] !== "000")
); //获取所有的叶子节点
let nowList = [...this.queryParams.extraOrderV.receiveAddrList].filter(
(item) => item[0] !== "000"
);
// 半选时, 如果有之前选过全选,要把全选过滤掉 // 半选时, 如果有之前选过全选,要把全选过滤掉
if (origin.length > nowList.length && nowList.length != 0) { if (origin.length > nowList.length && nowList.length != 0) {
this.queryParams.extraOrderV.receiveAddrList = deepClone( this.queryParams.extraOrderV.receiveAddrList = deepClone(this.queryParams.extraOrderV.receiveAddrList.filter((item) => item[0] !== "000"))
this.queryParams.extraOrderV.receiveAddrList.filter(
(item) => item[0] !== "000"
)
);
//设置半选样式,setTimeout可以解决样式渲染不上的问题 //设置半选样式,setTimeout可以解决样式渲染不上的问题
setTimeout(function () { setTimeout(function () {
label1.className = "el-checkbox"; label1.className = "el-checkbox"
span1.className = "el-checkbox__input is-indeterminate"; span1.className = "el-checkbox__input is-indeterminate"
}, 1); }, 1)
} else if (nowList.length == 0) { } else if (nowList.length == 0) {
//不选时, 如果有之前选过全选,要把全选过滤掉 //不选时, 如果有之前选过全选,要把全选过滤掉
this.queryParams.extraOrderV.receiveAddrList = deepClone( this.queryParams.extraOrderV.receiveAddrList = deepClone(this.queryParams.extraOrderV.receiveAddrList.filter((item) => item[0] !== "000"))
this.queryParams.extraOrderV.receiveAddrList.filter( label1.className = "el-checkbox"
(item) => item[0] !== "000" span1.className = "el-checkbox__input"
)
);
label1.className = "el-checkbox";
span1.className = "el-checkbox__input";
} else { } else {
// 当所有的数据都选择时, 要自动把全选勾选上 最后这种是:origin.length == nowList.length // 当所有的数据都选择时, 要自动把全选勾选上 最后这种是:origin.length == nowList.length
if ( if (this.queryParams.extraOrderV.receiveAddrList[0] && this.queryParams.extraOrderV.receiveAddrList[0][0] !== "000") {
this.queryParams.extraOrderV.receiveAddrList[0] && this.queryParams.extraOrderV.receiveAddrList = [["000"], ...this.queryParams.extraOrderV.receiveAddrList]
this.queryParams.extraOrderV.receiveAddrList[0][0] !== "000" label1.className = "el-checkbox"
) { span1.className = "el-checkbox__input is-checked"
this.queryParams.extraOrderV.receiveAddrList = [
["000"],
...this.queryParams.extraOrderV.receiveAddrList,
];
label1.className = "el-checkbox";
span1.className = "el-checkbox__input is-checked";
} }
} }
}, },
getTreeList(list) { getTreeList(list) {
let _this = this; let _this = this
for (let i = 0; i < list.length; i++) { for (let i = 0; i < list.length; i++) {
let a = list[i]; let a = list[i]
if (a.id !== "000") { if (a.id !== "000") {
this.oneDimensionalList.push(list[i]); this.oneDimensionalList.push(list[i])
} }
if (a.children && a.children.length > 0) { if (a.children && a.children.length > 0) {
let res = _this.getTreeList(a.children); let res = _this.getTreeList(a.children)
if (res) { if (res) {
return res; return res
} }
} }
} }
}, },
judgetAllSelected(node) { judgetAllSelected(node) {
// 判断是否是全选,也就是看已选择的选中中包不包含"全选" // 判断是否是全选,也就是看已选择的选中中包不包含"全选"
let isAllSelected = false; let isAllSelected = false
for (let i = 0; i < node.length; i++) { for (let i = 0; i < node.length; i++) {
if (node[i][0] == "000") { if (node[i][0] == "000") {
isAllSelected = true; isAllSelected = true
break; break
} }
} }
return isAllSelected; return isAllSelected
}, },
traverseTree(list, parentNode = []) { traverseTree(list, parentNode = []) {
list.length > 0 && list.length > 0 &&
list.forEach((e) => { list.forEach((e) => {
let pNode = deepClone(parentNode); let pNode = deepClone(parentNode)
if (e.children && e.children.length > 0) { if (e.children && e.children.length > 0) {
pNode.push(e.id); // 1 11 pNode.push(e.id) // 1 11
this.traverseTree(e.children, pNode); this.traverseTree(e.children, pNode)
} else { } else {
if (parentNode.length > 0) { if (parentNode.length > 0) {
this.queryParams.extraOrderV.receiveAddrList.push([ this.queryParams.extraOrderV.receiveAddrList.push([...parentNode, e.id])
...parentNode,
e.id,
]);
} else { } else {
this.queryParams.extraOrderV.receiveAddrList.push([e.id]); this.queryParams.extraOrderV.receiveAddrList.push([e.id])
} }
} }
}); })
}, },
//获取目的仓列表 //获取目的仓列表
handleGetRegionTreeList() { handleGetRegionTreeList() {
getRegionTreeList().then((res) => { getRegionTreeList().then((res) => {
this.regionTreeList = res.data; this.regionTreeList = res.data
this.regionTreeList.unshift({ this.regionTreeList.unshift({
id: "000", id: "000",
labelZh: "全选", labelZh: "全选",
labelEn: "select ALL", labelEn: "select ALL"
}); })
this.$nextTick(() => { this.$nextTick(() => {
this.selectHandle(this.queryParams.extraOrderV.receiveAddrList, true); this.selectHandle(this.queryParams.extraOrderV.receiveAddrList, true)
}); })
}); })
}, },
//积分来源 //积分来源
handleSourceType(id) { handleSourceType(id) {
return this.getDictDatas(DICT_TYPE.SCORE_RULE_TYPE).filter( return this.getDictDatas(DICT_TYPE.SCORE_RULE_TYPE).filter((item) => item.value == id)[0]
(item) => item.value == id }
)[0]; }
}, }
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .integral-rule-operate .el-input { ::v-deep .integral-rule-operate .el-input {
......
<template> <template>
<div style="padding: 20px"> <div style="padding: 20px">
<header <header style="display: flex; justify-content: space-between; align-items: center">
style="display: flex; justify-content: space-between; align-items: center"
>
<h1 style="font-weight: 600; font-size: 20px">{{ $t("会员详情") }}</h1> <h1 style="font-weight: 600; font-size: 20px">{{ $t("会员详情") }}</h1>
<div> <div>
<el-button <el-button type="primary" v-has-permi="['member:certificate']" @click="guarantee(details)">{{ $t("保函证书") }}</el-button>
type="primary" <el-button type="primary" v-has-permi="['member:log']" @click="operationLogFn(details)">{{ $t("操作日志") }}</el-button>
v-has-permi="['member:certificate']" <el-button type="primary" v-has-permi="['member:id-card']" @click="identityFn(details, '1')">{{ $t("身份证") }}</el-button>
@click="guarantee(details)" <el-button type="primary" v-has-permi="['member:business-license']" @click="identityFn(details, '2')">{{ $t("营业执照") }}</el-button>
>{{ $t("保函证书") }}</el-button <el-button type="danger" v-has-permi="['member:delete']" @click="deleteFn(details)">{{ $t("删除") }}</el-button>
>
<el-button
type="primary"
v-has-permi="['member:log']"
@click="operationLogFn(details)"
>{{ $t("操作日志") }}</el-button
>
<el-button
type="primary"
v-has-permi="['member:id-card']"
@click="identityFn(details, '1')"
>{{ $t("身份证") }}</el-button
>
<el-button
type="primary"
v-has-permi="['member:business-license']"
@click="identityFn(details, '2')"
>{{ $t("营业执照") }}</el-button
>
<el-button
type="danger"
v-has-permi="['member:delete']"
@click="deleteFn(details)"
>{{ $t("删除") }}</el-button
>
</div> </div>
</header> </header>
<!--lanbm 2024-05-15 修改信息显示BUG--> <!--lanbm 2024-05-15 修改信息显示BUG-->
<el-descriptions :title="$t('基础信息')" :labelStyle="{'width': '146px'}" :contentStyle="{'width': '278px'}" :column="4" border> <el-descriptions :title="$t('基础信息')" :labelStyle="{ width: '146px' }" :contentStyle="{ width: '278px' }" :column="4" border>
<el-descriptions-item :label="$t('会员编号')">{{ <el-descriptions-item :label="$t('会员编号')">{{ details.memberCode }}</el-descriptions-item>
details.memberCode <el-descriptions-item :label="$t('会员昵称')">{{ details.nickname }}</el-descriptions-item>
}}</el-descriptions-item> <el-descriptions-item :label="$t('英文名称')">{{ details.englishName }}</el-descriptions-item>
<el-descriptions-item :label="$t('会员昵称')">{{ <el-descriptions-item :label="$t('真实姓名')">{{ details.identityName || "-" }}</el-descriptions-item>
details.nickname
}}</el-descriptions-item>
<el-descriptions-item :label="$t('英文名称')">{{
details.englishName
}}</el-descriptions-item>
<el-descriptions-item :label="$t('真实姓名')">{{
details.identityName || "-"
}}</el-descriptions-item>
<el-descriptions-item :label="$t('联系方式')" <el-descriptions-item :label="$t('联系方式')"
><span style="margin-right: 10px">+{{ details.areaCode }}</span ><span style="margin-right: 10px">+{{ details.areaCode }}</span
><span>{{ details.mobile }}</span> ><span>{{ details.mobile }}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('绑定邮箱')">{{ <el-descriptions-item :label="$t('绑定邮箱')">{{ details.email }}</el-descriptions-item>
details.email <el-descriptions-item :label="$t('生日')">{{ details.birthday }}</el-descriptions-item>
}}</el-descriptions-item> <el-descriptions-item :label="$t('性别')">{{ details.gender === 0 ? "" : details.gender === 1 ? "" : "保密" }} </el-descriptions-item>
<el-descriptions-item :label="$t('生日')">{{ <el-descriptions-item :label="$t('地址')">{{ details.address }}</el-descriptions-item>
details.birthday <el-descriptions-item :label="$t('部门')">{{ details.department }}</el-descriptions-item>
}}</el-descriptions-item> <el-descriptions-item :label="$t('职位')">{{ details.jobPosition }}</el-descriptions-item>
<el-descriptions-item :label="$t('性别')" <el-descriptions-item :label="$t('创建时间')">{{ details.createTime }}</el-descriptions-item>
>{{ <el-descriptions-item :label="$t('绑定客户')">{{ details.customerCode }}</el-descriptions-item>
details.gender === 0 ? "" : details.gender === 1 ? "" : "保密" <el-descriptions-item :label="$t('国家')">{{ isChinese ? details.countryTitleZh : details.countryTitleEn }}</el-descriptions-item>
}} <el-descriptions-item :label="$t('城市')">{{ isChinese ? details.cityTitleZh : cityTitleEn }}</el-descriptions-item>
</el-descriptions-item> <el-descriptions-item :label="$t('上次登录')">{{ details.loginDate }}</el-descriptions-item>
<el-descriptions-item :label="$t('地址')">{{
details.address
}}</el-descriptions-item>
<el-descriptions-item :label="$t('部门')">{{
details.department
}}</el-descriptions-item>
<el-descriptions-item :label="$t('职位')">{{
details.jobPosition
}}</el-descriptions-item>
<el-descriptions-item :label="$t('创建时间')">{{
details.createTime
}}</el-descriptions-item>
<el-descriptions-item :label="$t('绑定客户')">{{
details.customerCode
}}</el-descriptions-item>
<el-descriptions-item :label="$t('国家')">{{
isChinese ? details.countryTitleZh : details.countryTitleEn
}}</el-descriptions-item>
<el-descriptions-item :label="$t('城市')">{{
isChinese ? details.cityTitleZh : cityTitleEn
}}</el-descriptions-item>
<el-descriptions-item :label="$t('上次登录')">{{
details.loginDate
}}</el-descriptions-item>
</el-descriptions> </el-descriptions>
<!--lanbm 2024-05-15 修改信息显示BUG--> <!--lanbm 2024-05-15 修改信息显示BUG-->
<el-descriptions <el-descriptions style="margin-top: 20px" :title="$t('公司信息')" :labelStyle="{ width: '146px' }" :contentStyle="{ width: '278px' }" :column="4" border>
style="margin-top: 20px" <el-descriptions-item :label="$t('公司名称')">{{ details.enterpriseName }}</el-descriptions-item>
:title="$t('公司信息')" <el-descriptions-item :label="$t('公司英文名称')">{{ details.enterpriseNameEn }}</el-descriptions-item>
:labelStyle="{'width': '146px',}" <el-descriptions-item :label="$t('档口')">{{ details.enterpriseStall }}</el-descriptions-item>
:contentStyle="{'width': '278px',}" <el-descriptions-item :label="$t('品牌')">{{ details.enterpriseBrand }}</el-descriptions-item>
:column="4" <el-descriptions-item :label="$t('公司地址')">{{ details.enterpriseAddress }}</el-descriptions-item>
border <el-descriptions-item :label="$t('公司简介')">{{ details.enterpriseDesc }}</el-descriptions-item>
>
<el-descriptions-item :label="$t('公司名称')">{{
details.enterpriseName
}}</el-descriptions-item>
<el-descriptions-item :label="$t('公司英文名称')">{{
details.enterpriseNameEn
}}</el-descriptions-item>
<el-descriptions-item :label="$t('档口')">{{
details.enterpriseStall
}}</el-descriptions-item>
<el-descriptions-item :label="$t('品牌')">{{
details.enterpriseBrand
}}</el-descriptions-item>
<el-descriptions-item :label="$t('公司地址')">{{
details.enterpriseAddress
}}</el-descriptions-item>
<el-descriptions-item :label="$t('公司简介')">{{
details.enterpriseDesc
}}</el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-descriptions <el-descriptions style="margin-top: 20px" :title="$t('认证信息')" :labelStyle="{ width: '146px' }" :contentStyle="{ width: '278px' }" :column="4" border>
style="margin-top: 20px" <el-descriptions-item :label="$t('成交')">{{ details.customerStatus === 3 ? "成交" : "未成交" }}</el-descriptions-item>
:title="$t('认证信息')"
:labelStyle="{'width': '146px'}"
:contentStyle="{'width': '278px'}"
:column="4"
border
>
<el-descriptions-item :label="$t('成交')">{{
details.customerStatus === 3 ? "成交" : "未成交"
}}</el-descriptions-item>
<el-descriptions-item :label="$t('认证')"> <el-descriptions-item :label="$t('认证')">
<span <span v-if="details.identityAuditStatus === 2 && details.enterpriseAuditStatus === 2">{{ $t("双认证") }}</span>
v-if=" <span v-else-if="details.identityAuditStatus === 2 && details.enterpriseAuditStatus !== 2">{{ $t("身份证") }}</span>
details.identityAuditStatus === 2 && <span v-else-if="details.identityAuditStatus !== 2 && details.enterpriseAuditStatus === 2">{{ $t("企业") }}</span>
details.enterpriseAuditStatus === 2 <span v-else-if="details.identityAuditStatus !== 2 && details.enterpriseAuditStatus !== 2">{{ $t("") }}</span>
"
>{{ $t("双认证") }}</span
>
<span
v-else-if="
details.identityAuditStatus === 2 &&
details.enterpriseAuditStatus !== 2
"
>{{ $t("身份证") }}</span
>
<span
v-else-if="
details.identityAuditStatus !== 2 &&
details.enterpriseAuditStatus === 2
"
>{{ $t("企业") }}</span
>
<span
v-else-if="
details.identityAuditStatus !== 2 &&
details.enterpriseAuditStatus !== 2
"
>{{ $t("") }}</span
>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('身份证认证状态')">{{ <el-descriptions-item :label="$t('身份证认证状态')">{{
details.identityAuditStatus !== null details.identityAuditStatus !== null
? $l( ? $l(
getDictDatas(this.DICT_TYPE.AUDIT_STATUS).find( getDictDatas(this.DICT_TYPE.AUDIT_STATUS).find((i) => i.value == details.identityAuditStatus),
(i) => i.value == details.identityAuditStatus
),
"label" "label"
) )
: "" : ""
...@@ -174,9 +61,7 @@ ...@@ -174,9 +61,7 @@
<el-descriptions-item :label="$t('营业执照认证状态')">{{ <el-descriptions-item :label="$t('营业执照认证状态')">{{
details.enterpriseAuditStatus !== null details.enterpriseAuditStatus !== null
? $l( ? $l(
getDictDatas(this.DICT_TYPE.AUDIT_STATUS).find( getDictDatas(this.DICT_TYPE.AUDIT_STATUS).find((i) => i.value == details.enterpriseAuditStatus),
(i) => i.value == details.enterpriseAuditStatus
),
"label" "label"
) )
: "" : ""
...@@ -184,39 +69,20 @@ ...@@ -184,39 +69,20 @@
</el-descriptions> </el-descriptions>
<!-- 积分信息 --> <!-- 积分信息 -->
<el-descriptions <el-descriptions style="margin-top: 20px" :title="$t('积分信息')" :column="6" direction="vertical" border>
style="margin-top: 20px"
:title="$t('积分信息')"
:column="6"
direction="vertical"
border
>
<!-- <el-descriptions-item :label="$t('会员图标')"> <!-- <el-descriptions-item :label="$t('会员图标')">
</el-descriptions-item </el-descriptions-item
> --> > -->
<el-descriptions-item :label="$t('会员等级')"> <el-descriptions-item :label="$t('会员等级')">
<el-image <el-image :src="details.userScoreLevelInfo.levelIcon" style="width: 20px; height: 20px">{{ $t("") }}</el-image>
:src="details.userScoreLevelInfo.levelIcon"
style="width: 20px; height: 20px"
>{{ $t("") }}</el-image>
{{ details.userScoreLevelInfo.levelName }} {{ details.userScoreLevelInfo.levelName }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('当前积分')">{{ <el-descriptions-item :label="$t('当前积分')">{{ details.userScoreLevelInfo.holdScore }}</el-descriptions-item>
details.userScoreLevelInfo.holdScore <el-descriptions-item :label="$t('已兑换积分')">{{ details.userScoreLevelInfo.usedScore }}</el-descriptions-item>
}}</el-descriptions-item> <el-descriptions-item :label="$t('推荐码')">{{ details.userScoreLevelInfo.memberCode }}</el-descriptions-item>
<el-descriptions-item :label="$t('已兑换积分')">{{
details.userScoreLevelInfo.usedScore
}}</el-descriptions-item>
<el-descriptions-item :label="$t('推荐码')">{{
details.userScoreLevelInfo.memberCode
}}</el-descriptions-item>
<el-descriptions-item :label="$t('操作')"> <el-descriptions-item :label="$t('操作')">
<el-button <el-button type="text" class="copy-btn" :data-clipboard-text="details.memberCode">
type="text"
class="copy-btn"
:data-clipboard-text="details.memberCode"
>
{{ $t("复制推荐码") }} {{ $t("复制推荐码") }}
</el-button> </el-button>
<el-button type="text" @click="handleExchangeRewards(details)"> <el-button type="text" @click="handleExchangeRewards(details)">
...@@ -226,12 +92,7 @@ ...@@ -226,12 +92,7 @@
</el-descriptions> </el-descriptions>
<!-- table Tab --> <!-- table Tab -->
<el-menu <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
:default-active="activeIndex"
class="el-menu-demo"
mode="horizontal"
@select="handleSelect"
>
<el-menu-item index="reward">{{ $t("积分记录") }}</el-menu-item> <el-menu-item index="reward">{{ $t("积分记录") }}</el-menu-item>
<el-menu-item index="exchange">{{ $t("兑换记录") }}</el-menu-item> <el-menu-item index="exchange">{{ $t("兑换记录") }}</el-menu-item>
</el-menu> </el-menu>
...@@ -340,178 +201,65 @@ ...@@ -340,178 +201,65 @@
/> --> /> -->
</div> </div>
<div class="exchange" v-show="activeIndex != 'reward'"> <div class="exchange" v-show="activeIndex != 'reward'">
<el-form <el-form :model="queryParamsRecord" ref="queryForm" size="small" :inline="true" label-width="120px">
:model="queryParamsRecord"
ref="queryForm"
size="small"
:inline="true"
label-width="120px"
>
<el-form-item :label="$t('礼品名称')"> <el-form-item :label="$t('礼品名称')">
<el-input <el-input style="width: 300px" v-model.trim="queryParamsRecord.rewardTitle" :placeholder="$t('请输入礼品名称')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
style="width: 300px"
v-model.trim="queryParamsRecord.rewardTitle"
:placeholder="$t('请输入礼品名称')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('领取方式')"> <el-form-item :label="$t('领取方式')">
<dict-selector <dict-selector clearable :type="DICT_TYPE.WAY_OF_RECEIVING" v-model="queryParamsRecord.redeemType"> </dict-selector>
clearable
:type="DICT_TYPE.WAY_OF_RECEIVING"
v-model="queryParamsRecord.redeemType"
>
</dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('兑换时间')"> <el-form-item :label="$t('兑换时间')">
<el-date-picker <el-date-picker type="datetimerange" clearable placement="bottom-start" v-model="dateRangeCreateTimeRecord" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
type="datetimerange"
clearable
placement="bottom-start"
v-model="dateRangeCreateTimeRecord"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" icon="el-icon-search" @click="handleQueryRecord">{{ $t("搜索") }}</el-button>
type="primary" <el-button icon="el-icon-refresh" @click="resetQueryRecord">{{ $t("重置") }}</el-button>
icon="el-icon-search"
@click="handleQueryRecord"
>{{ $t("搜索") }}</el-button
>
<el-button icon="el-icon-refresh" @click="resetQueryRecord">{{
$t("重置")
}}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table ref="multipleTable" v-loading="loading" :data="memberRecordList">
ref="multipleTable" <el-table-column :label="$t('兑换记录ID')" width="160" align="center">
v-loading="loading"
:data="memberRecordList"
>
<el-table-column
:label="$t('兑换记录ID')"
width="160"
align="center"
>
<template #default="{ row }"> <template #default="{ row }">
<el-button <el-button type="text" @click="handleViewRecord(row)">{{ row.redemptionNumber }}</el-button>
type="text"
@click="handleViewRecord(scope.row)"
>{{ row.redemptionNumber }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column width="140" :label="$t('礼品ID')" align="center">
width="140"
:label="$t('礼品ID')"
align="center"
>
<template #default="{ row }"> <template #default="{ row }">
<el-button <el-button type="text" @click="handleShowRewardsDetail(row)">{{ row.rewardCode }}</el-button>
type="text"
@click="
handleShowRewardsDetail(row)
"
>{{ row.rewardCode }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :label="$t('礼品名称')" align="center" :prop="isChinese ? 'rewardTitleZh' : 'rewardTitleEn'"></el-table-column>
:label="$t('礼品名称')" <el-table-column :label="$t('会员名称')" align="center" :prop="isChinese ? 'memberNameZh' : 'memberNameEn'"></el-table-column>
align="center"
:prop="isChinese ? 'rewardTitleZh' : 'rewardTitleEn'"
></el-table-column>
<el-table-column
:label="$t('会员名称')"
align="center"
:prop="isChinese ? 'memberNameZh' : 'memberNameEn'"
></el-table-column>
<el-table-column :label="$t('兑换时间')" align="center"> <el-table-column :label="$t('兑换时间')" align="center">
<template v-slot="{ row }"> <template v-slot="{ row }">
{{ parseTime(row.redemptionTime) || "/" }} {{ parseTime(row.redemptionTime) || "/" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :label="$t('兑换积分')" align="center" prop="totalCount"></el-table-column>
:label="$t('兑换积分')"
align="center"
prop="totalCount"
></el-table-column>
<el-table-column width="140" :label="$t('兑换入口')" align="center"> <el-table-column width="140" :label="$t('兑换入口')" align="center">
<template v-slot="{ row }"> <template v-slot="{ row }">
{{ {{ isChinese ? handleExchangeEntrance(row.entrance).label : handleExchangeEntrance(row.entrance).labelEn }}
isChinese
? handleExchangeEntrance(row.entrance).label
: handleExchangeEntrance(row.entrance).labelEn
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column width="140" :label="$t('兑换网点')" align="center" :prop="isChinese ? 'nodeTitleZh' : 'nodeTitleEn'"> </el-table-column>
width="140"
:label="$t('兑换网点')"
align="center"
:prop="isChinese ? 'nodeTitleZh' : 'nodeTitleEn'"
>
</el-table-column>
<el-table-column width="140" :label="$t('领取方式')" align="center"> <el-table-column width="140" :label="$t('领取方式')" align="center">
<template v-slot="{ row }"> <template v-slot="{ row }">
{{ {{ isChinese ? handleExchangeRedeemType(row.redeemType).label : handleExchangeRedeemType(row.redeemType).labelEn }}
isChinese
? handleExchangeRedeemType(row.redeemType).label
: handleExchangeRedeemType(row.redeemType).labelEn
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="140" :label="$t('状态')" align="center"> <el-table-column width="140" :label="$t('状态')" align="center">
<template v-slot="{ row }"> <template v-slot="{ row }">
{{ {{ isChinese ? handleExchangeStatus(row.status).label : handleExchangeStatus(row.status).labelEn }}
isChinese
? handleExchangeStatus(row.status).label
: handleExchangeStatus(row.status).labelEn
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column width="140" :label="$t('备注')" align="center" prop="remark"></el-table-column>
width="140" <el-table-column width="140" :label="$t('数量')" align="center" prop="rewardCount"></el-table-column>
:label="$t('备注')" <el-table-column width="140" :label="$t('创建人')" align="center" prop="creatorName"></el-table-column>
align="center" <el-table-column width="140" :label="$t('更新人')" align="center" prop="updaterName"></el-table-column>
prop="remark"
></el-table-column
>
<el-table-column
width="140"
:label="$t('数量')"
align="center"
prop="rewardCount"
></el-table-column>
<el-table-column
width="140"
:label="$t('创建人')"
align="center"
prop="creatorName"
></el-table-column>
<el-table-column
width="140"
:label="$t('更新人')"
align="center"
prop="updaterName"
></el-table-column>
</el-table> </el-table>
<!-- //分页列表 --> <!-- //分页列表 -->
<pagination <pagination v-show="totalRecord > 0" :total="totalRecord" :page.sync="queryParamsRecord.pageNo" :limit.sync="queryParamsRecord.pageSize" @pagination="handleQueryPaginationRecord" />
v-show="totalRecord > 0"
:total="totalRecord"
:page.sync="queryParamsRecord.pageNo"
:limit.sync="queryParamsRecord.pageSize"
@pagination="handleQueryPaginationRecord"
/>
</div> </div>
</div> </div>
...@@ -520,8 +268,8 @@ ...@@ -520,8 +268,8 @@
:visible.sync="guaranteeShow" :visible.sync="guaranteeShow"
:before-close=" :before-close="
() => { () => {
guaranteeUrl = ''; guaranteeUrl = ''
guaranteeShow = false; guaranteeShow = false
} }
" "
width="50%" width="50%"
...@@ -534,12 +282,7 @@ ...@@ -534,12 +282,7 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<div style="height: 45px; overflow: hidden"> <div style="height: 45px; overflow: hidden">
<file-upload <file-upload v-model="guaranteeUrl" :fileType="['png', 'jpg', 'jpeg', 'pdf']" :limit="1" :isShowTip="false"></file-upload>
v-model="guaranteeUrl"
:fileType="['png', 'jpg', 'jpeg', 'pdf']"
:limit="1"
:isShowTip="false"
></file-upload>
</div> </div>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
...@@ -552,17 +295,10 @@ ...@@ -552,17 +295,10 @@
<el-button @click="setGuarantee">{{ $t("保 存") }}</el-button> <el-button @click="setGuarantee">{{ $t("保 存") }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog :title="$t('操作日志')" :visible.sync="operationLogShow" width="50%">
:title="$t('操作日志')"
:visible.sync="operationLogShow"
width="50%"
>
<el-table :data="operationLogList"> <el-table :data="operationLogList">
<el-table-column :label="$t('标题')" prop="title"></el-table-column> <el-table-column :label="$t('标题')" prop="title"></el-table-column>
<el-table-column <el-table-column :label="$t('操作内容')" prop="content"></el-table-column>
:label="$t('操作内容')"
prop="content"
></el-table-column>
<el-table-column :label="$t('操作人')" prop="userId"> <el-table-column :label="$t('操作人')" prop="userId">
<template v-slot="{ row }"> <template v-slot="{ row }">
{{ details.identityName }} {{ details.identityName }}
...@@ -575,154 +311,64 @@ ...@@ -575,154 +311,64 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作ip')" prop="ip"></el-table-column> <el-table-column :label="$t('操作ip')" prop="ip"></el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="totalLog > 0" :total="totalLog" :page.sync="operationLogFrom.page" :limit.sync="operationLogFrom.row" @pagination="getOperationLogList" />
v-show="totalLog > 0"
:total="totalLog"
:page.sync="operationLogFrom.page"
:limit.sync="operationLogFrom.row"
@pagination="getOperationLogList"
/>
</el-dialog> </el-dialog>
<el-dialog :title="$t('认证')" :visible.sync="attestationShow" width="80%"> <el-dialog :title="$t('认证')" :visible.sync="attestationShow" width="80%">
<div class="details"> <div class="details">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane :label="$t('身份证')" name="1"> <el-tab-pane :label="$t('身份证')" name="1">
<div style="padding: 0 40px; box-sizing: border-box"> <div style="padding: 0 40px; box-sizing: border-box">
<el-form <el-form :disabled="[2, 3].includes(IdDetails.status) && modifyIdCard" ref="formId" label-position="left" label-width="100px" :rules="rulesId" :model="IdDetails">
:disabled="[2, 3].includes(IdDetails.status) && modifyIdCard"
ref="formId"
label-position="left"
label-width="100px"
:rules="rulesId"
:model="IdDetails"
>
<el-form-item :label="$t('姓名')" prop="name"> <el-form-item :label="$t('姓名')" prop="name">
<el-input v-model="IdDetails.name"></el-input> <el-input v-model="IdDetails.name"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('证件类型')" prop="cardType"> <el-form-item :label="$t('证件类型')" prop="cardType">
<dict-selector <dict-selector v-model="IdDetails.cardType" :type="DICT_TYPE.CERTIFICATE_TYPE"></dict-selector>
v-model="IdDetails.cardType"
:type="DICT_TYPE.CERTIFICATE_TYPE"
></dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('证件号码')" prop="cardNumber"> <el-form-item :label="$t('证件号码')" prop="cardNumber">
<el-input v-model="IdDetails.cardNumber"></el-input> <el-input v-model="IdDetails.cardNumber"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('证件正面照')" prop="img1"> <el-form-item :label="$t('证件正面照')" prop="img1">
<div> <div>
<el-input <el-input readonly style="margin-bottom: 20px" v-model="IdDetails.img1"></el-input>
readonly <ImageUpload :isShowTip="false" v-model="IdDetails.img1" :limit="1"></ImageUpload>
style="margin-bottom: 20px"
v-model="IdDetails.img1"
></el-input>
<ImageUpload
:isShowTip="false"
v-model="IdDetails.img1"
:limit="1"
></ImageUpload>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item :label="$t('证件背面照')" prop="img2"> <el-form-item :label="$t('证件背面照')" prop="img2">
<div> <div>
<el-input <el-input readonly style="margin-bottom: 20px" v-model="IdDetails.img2"></el-input>
readonly <ImageUpload :isShowTip="false" :limit="1" v-model="IdDetails.img2"></ImageUpload>
style="margin-bottom: 20px"
v-model="IdDetails.img2"
></el-input>
<ImageUpload
:isShowTip="false"
:limit="1"
v-model="IdDetails.img2"
></ImageUpload>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item <el-form-item :label="$t('审核状态')" v-if="modifyIdCard && IdDetails.status !== 0">
:label="$t('审核状态')" {{ getDictDatas(DICT_TYPE.AUDIT_STATUS)[IdDetails.status] ? getDictDatas(DICT_TYPE.AUDIT_STATUS)[IdDetails.status].label : "" }}
v-if="modifyIdCard && IdDetails.status !== 0"
>
{{
getDictDatas(DICT_TYPE.AUDIT_STATUS)[IdDetails.status]
? getDictDatas(DICT_TYPE.AUDIT_STATUS)[IdDetails.status]
.label
: ""
}}
</el-form-item> </el-form-item>
<el-form-item <el-form-item :label="$t('审核时间')" v-if="[2, 3].includes(IdDetails.status) && modifyIdCard">
:label="$t('审核时间')"
v-if="[2, 3].includes(IdDetails.status) && modifyIdCard"
>
{{ parseTime(IdDetails.auditTime) }} {{ parseTime(IdDetails.auditTime) }}
</el-form-item> </el-form-item>
<el-form-item <el-form-item v-if="modifyIdCard && IdDetails.status !== 0" :label="$t('审核备注')">
v-if="modifyIdCard && IdDetails.status !== 0" <el-input v-model="IdDetails.auditRemark" :disabled="IdDetails.status === 3" type="textarea"></el-input>
:label="$t('审核备注')"
>
<el-input
v-model="IdDetails.auditRemark"
:disabled="IdDetails.status === 3"
type="textarea"
></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div <div v-if="IdDetails.status === 1" style="text-align: center; margin-top: 20px">
v-if="IdDetails.status === 1" <el-button type="primary" @click="idCardAuditFn(2)">{{ $t("审核通过") }}</el-button>
style="text-align: center; margin-top: 20px" <el-button type="primary" @click="idCardAuditFn(3)">{{ $t("审核不通过") }}</el-button>
> <el-button @click="attestationShow = false">{{ $t("取 消") }}</el-button>
<el-button type="primary" @click="idCardAuditFn(2)">{{
$t("审核通过")
}}</el-button>
<el-button type="primary" @click="idCardAuditFn(3)">{{
$t("审核不通过")
}}</el-button>
<el-button @click="attestationShow = false">{{
$t("取 消")
}}</el-button>
</div> </div>
<div <div v-if="IdDetails.status === 2 || IdDetails.status === 3" style="text-align: center; margin-top: 20px">
v-if="IdDetails.status === 2 || IdDetails.status === 3" <el-button type="primary" v-if="modifyIdCard" @click="modifyIdCard = false">{{ $t("修 改") }} </el-button>
style="text-align: center; margin-top: 20px" <el-button type="primary" v-else @click="setMemberUserUpdateIdCard">{{ $t("提交审核") }}</el-button>
> <el-button @click="attestationShow = false">{{ $t("取 消") }}</el-button>
<el-button
type="primary"
v-if="modifyIdCard"
@click="modifyIdCard = false"
>{{ $t("修 改") }}
</el-button>
<el-button
type="primary"
v-else
@click="setMemberUserUpdateIdCard"
>{{ $t("提交审核") }}</el-button
>
<el-button @click="attestationShow = false">{{
$t("取 消")
}}</el-button>
</div> </div>
<div <div v-if="IdDetails.status === 0" style="text-align: center; margin-top: 20px">
v-if="IdDetails.status === 0" <el-button type="primary" @click="submitId">{{ $t("上 传") }}</el-button>
style="text-align: center; margin-top: 20px" <el-button @click="attestationShow = false">{{ $t("取 消") }}</el-button>
>
<el-button type="primary" @click="submitId">{{
$t("上 传")
}}</el-button>
<el-button @click="attestationShow = false">{{
$t("取 消")
}}</el-button>
</div> </div>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('营业执照')" name="2"> <el-tab-pane :label="$t('营业执照')" name="2">
<div style="width: 500px; padding: 0 40px; box-sizing: border-box"> <div style="width: 500px; padding: 0 40px; box-sizing: border-box">
<el-form <el-form :disabled="modifyLicense && [2, 3].includes(enterpriseFrom.status)" :rules="rulesEnterprise" :model="enterpriseFrom" label-position="left" ref="formEnter" label-width="100px">
:disabled="
modifyLicense && [2, 3].includes(enterpriseFrom.status)
"
:rules="rulesEnterprise"
:model="enterpriseFrom"
label-position="left"
ref="formEnter"
label-width="100px"
>
<el-form-item :label="$t('企业名称')" prop="name"> <el-form-item :label="$t('企业名称')" prop="name">
<el-input v-model="enterpriseFrom.name"></el-input> <el-input v-model="enterpriseFrom.name"></el-input>
</el-form-item> </el-form-item>
...@@ -734,102 +380,37 @@ ...@@ -734,102 +380,37 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('证件照')" prop="img1"> <el-form-item :label="$t('证件照')" prop="img1">
<div> <div>
<el-input <el-input readonly style="margin-bottom: 20px" v-model="enterpriseFrom.img1"></el-input>
readonly <ImageUpload :isShowTip="false" :limit="1" v-model="enterpriseFrom.img1"></ImageUpload>
style="margin-bottom: 20px"
v-model="enterpriseFrom.img1"
></el-input>
<ImageUpload
:isShowTip="false"
:limit="1"
v-model="enterpriseFrom.img1"
></ImageUpload>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item :label="$t('附件')"> <el-form-item :label="$t('附件')">
<el-input readonly v-model="enterpriseFrom.img2"></el-input> <el-input readonly v-model="enterpriseFrom.img2"></el-input>
<ImageUpload <ImageUpload :isShowTip="false" :limit="1" v-model="enterpriseFrom.img2"></ImageUpload>
:isShowTip="false"
:limit="1"
v-model="enterpriseFrom.img2"
></ImageUpload>
</el-form-item> </el-form-item>
<el-form-item <el-form-item v-if="modifyLicense && enterpriseFrom.status !== 0" :label="$t('审核状态')">
v-if="modifyLicense && enterpriseFrom.status !== 0" {{ getDictDatas(DICT_TYPE.AUDIT_STATUS)[enterpriseFrom.status].label }}
:label="$t('审核状态')"
>
{{
getDictDatas(DICT_TYPE.AUDIT_STATUS)[enterpriseFrom.status]
.label
}}
</el-form-item> </el-form-item>
<el-form-item <el-form-item v-if="[2, 3].includes(enterpriseFrom.status) && modifyLicense" :label="$t('审核时间')">
v-if="[2, 3].includes(enterpriseFrom.status) && modifyLicense"
:label="$t('审核时间')"
>
{{ parseTime(enterpriseFrom.auditTime) }} {{ parseTime(enterpriseFrom.auditTime) }}
</el-form-item> </el-form-item>
<el-form-item <el-form-item v-if="modifyLicense && enterpriseFrom.status !== 0" :label="$t('审核备注')">
v-if="modifyLicense && enterpriseFrom.status !== 0" <el-input v-model="enterpriseFrom.auditRemark" :disabled="enterpriseFrom.status === 3" type="textarea"></el-input>
:label="$t('审核备注')"
>
<el-input
v-model="enterpriseFrom.auditRemark"
:disabled="enterpriseFrom.status === 3"
type="textarea"
></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div <div v-if="enterpriseFrom.status === 1" style="text-align: center; margin-top: 20px">
v-if="enterpriseFrom.status === 1" <el-button type="primary" @click="certificateVerificationFn(2)">{{ $t("审核通过") }}</el-button>
style="text-align: center; margin-top: 20px" <el-button type="primary" @click="certificateVerificationFn(3)">{{ $t("审核不通过") }}</el-button>
> <el-button @click="attestationShow = false">{{ $t("取 消") }}</el-button>
<el-button
type="primary"
@click="certificateVerificationFn(2)"
>{{ $t("审核通过") }}</el-button
>
<el-button
type="primary"
@click="certificateVerificationFn(3)"
>{{ $t("审核不通过") }}</el-button
>
<el-button @click="attestationShow = false">{{
$t("取 消")
}}</el-button>
</div> </div>
<div <div v-if="enterpriseFrom.status === 2 || enterpriseFrom.status === 3" style="text-align: center; margin-top: 20px">
v-if=" <el-button type="primary" v-if="modifyLicense" @click="modifyLicense = false">{{ $t("修 改") }} </el-button>
enterpriseFrom.status === 2 || enterpriseFrom.status === 3 <el-button type="primary" v-else @click="setMemberUserUpdateEnterprise">{{ $t("提交审核") }}</el-button>
" <el-button @click="attestationShow = false">{{ $t("取 消") }}</el-button>
style="text-align: center; margin-top: 20px"
>
<el-button
type="primary"
v-if="modifyLicense"
@click="modifyLicense = false"
>{{ $t("修 改") }}
</el-button>
<el-button
type="primary"
v-else
@click="setMemberUserUpdateEnterprise"
>{{ $t("提交审核") }}</el-button
>
<el-button @click="attestationShow = false">{{
$t("取 消")
}}</el-button>
</div> </div>
<div <div v-if="enterpriseFrom.status === 0" style="text-align: center; margin-top: 20px">
v-if="enterpriseFrom.status === 0" <el-button type="primary" @click="submit">{{ $t("上 传") }}</el-button>
style="text-align: center; margin-top: 20px" <el-button @click="attestationShow = false">{{ $t("取 消") }}</el-button>
>
<el-button type="primary" @click="submit">{{
$t("上 传")
}}</el-button>
<el-button @click="attestationShow = false">{{
$t("取 消")
}}</el-button>
</div> </div>
</div> </div>
</el-tab-pane> </el-tab-pane>
...@@ -837,40 +418,18 @@ ...@@ -837,40 +418,18 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 查看 礼品 --> <!-- 查看 礼品 -->
<operating-gift <operating-gift ref="operatingGift" :title="operatingPagetitle" :rewards-details="rewardsItem" :show.sync="dialogVisible" :node-list="nodeList" />
ref="operatingGift"
:title="operatingPagetitle"
:rewards-details="rewardsItem"
:show.sync="dialogVisible"
:node-list="nodeList"
/>
</div> </div>
</template> </template>
<script> <script>
import { import { createAuditIdCard, deleteUser, memberGetAuthEnterpriseInfo, memberGetAuthIdcardInfo, memberUserAuditEnterprise, memberUserAuditIdCard, memberUserGet, memberUserUpdateEnterprise, memberUserUpdateIdCard, operationLogApi, seTupdateBackletter, userCreateAuditEnterprise } from "@/api/member/user"
createAuditIdCard, import FileUpload from "@/components/FileUpload/index.vue"
deleteUser, import ImageUpload from "@/components/ImageUpload/index.vue"
memberGetAuthEnterpriseInfo, import { DICT_TYPE, getDictDatas } from "@/utils/dict"
memberGetAuthIdcardInfo, import ClipboardJS from "clipboard"
memberUserAuditEnterprise, import { queryMemberScoreRecord, queryMemberExchangeRecord } from "@/api/ecw/memberManagement"
memberUserAuditIdCard, import { getNodeList, getRewardsDetails } from "@/api/ecw/giftManagement"
memberUserGet, import OperatingGift from "@/views/ecw/giftManagement/components/operatingGift.vue"
memberUserUpdateEnterprise,
memberUserUpdateIdCard,
operationLogApi,
seTupdateBackletter,
userCreateAuditEnterprise,
} from "@/api/member/user";
import FileUpload from "@/components/FileUpload/index.vue";
import ImageUpload from "@/components/ImageUpload/index.vue";
import { DICT_TYPE, getDictDatas } from "@/utils/dict";
import ClipboardJS from "clipboard";
import {
queryMemberScoreRecord,
queryMemberExchangeRecord,
} from "@/api/ecw/memberManagement";
import { getNodeList, getRewardsDetails } from '@/api/ecw/giftManagement'
import OperatingGift from '@/views/ecw/giftManagement/components/operatingGift.vue'
import IntegralRecord from "@/views/ecw/memberManagement/integralRecord" import IntegralRecord from "@/views/ecw/memberManagement/integralRecord"
export default { export default {
name: "memberDetails", name: "memberDetails",
...@@ -896,7 +455,7 @@ export default { ...@@ -896,7 +455,7 @@ export default {
endTime: "", endTime: "",
nodeId: "", nodeId: "",
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100
}, },
queryParams: { queryParams: {
ruleTitle: "", ruleTitle: "",
...@@ -909,7 +468,7 @@ export default { ...@@ -909,7 +468,7 @@ export default {
endTime: "", endTime: "",
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
startTime: "", startTime: ""
}, },
dateRangeCreateTime: [], dateRangeCreateTime: [],
total: 0, total: 0,
...@@ -922,67 +481,67 @@ export default { ...@@ -922,67 +481,67 @@ export default {
{ {
required: true, required: true,
message: this.$t("用户昵称不能为空"), message: this.$t("用户昵称不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
cardType: [ cardType: [
{ {
required: true, required: true,
message: this.$t("证件类型不能为空"), message: this.$t("证件类型不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
cardNumber: [ cardNumber: [
{ {
required: true, required: true,
message: this.$t("证件号码不能为空"), message: this.$t("证件号码不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
img1: [ img1: [
{ {
required: true, required: true,
message: this.$t("身份正面照不能为空"), message: this.$t("身份正面照不能为空"),
trigger: ["blur", "change"], trigger: ["blur", "change"]
}, }
], ],
img2: [ img2: [
{ {
required: true, required: true,
message: this.$t("身份正面照不能为空"), message: this.$t("身份正面照不能为空"),
trigger: ["blur", "change"], trigger: ["blur", "change"]
}, }
], ]
}, },
rulesEnterprise: { rulesEnterprise: {
name: [ name: [
{ {
required: true, required: true,
message: this.$t("企业名称不能为空"), message: this.$t("企业名称不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
legalName: [ legalName: [
{ {
required: true, required: true,
message: this.$t("企业法人不能为空"), message: this.$t("企业法人不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
cardNumber: [ cardNumber: [
{ {
required: true, required: true,
message: this.$t("证件号码不能为空"), message: this.$t("证件号码不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
img1: [ img1: [
{ {
required: true, required: true,
message: this.$t("证件照不能为空"), message: this.$t("证件照不能为空"),
trigger: ["blur", "change"], trigger: ["blur", "change"]
}, }
], ]
}, },
getDictDatas, getDictDatas,
DICT_TYPE, DICT_TYPE,
...@@ -1026,7 +585,7 @@ export default { ...@@ -1026,7 +585,7 @@ export default {
password: "", password: "",
registDate: "", registDate: "",
registerIp: "", registerIp: "",
status: "", status: ""
}, },
publicObj: {}, publicObj: {},
guaranteeShow: false, guaranteeShow: false,
...@@ -1034,11 +593,11 @@ export default { ...@@ -1034,11 +593,11 @@ export default {
operationLogFrom: { operationLogFrom: {
page: 1, page: 1,
row: 10, row: 10,
userId: undefined, userId: undefined
}, },
loading: true, loading: true,
dialogVisible: false, dialogVisible: false,
operatingPagetitle: '', operatingPagetitle: "",
rewardsItem: {}, rewardsItem: {},
attestationShow: false, attestationShow: false,
modifyLicense: false, modifyLicense: false,
...@@ -1048,34 +607,34 @@ export default { ...@@ -1048,34 +607,34 @@ export default {
operationLogShow: false, operationLogShow: false,
activeName: "1", activeName: "1",
operationLogList: [], operationLogList: [],
totalLog: 0, totalLog: 0
}; }
}, },
created() { created() {
this.getDetails(); this.getDetails()
this.handleQuery(); this.handleQuery()
this.handleQueryRecord(); this.handleQueryRecord()
this.getNodeListAPI(); this.getNodeListAPI()
}, },
computed: { computed: {
isChinese() { isChinese() {
return this.$i18n.locale === "zh_CN"; return this.$i18n.locale === "zh_CN"
}, }
}, },
mounted() { mounted() {
let clipboard = new ClipboardJS(".copy-btn"); let clipboard = new ClipboardJS(".copy-btn")
clipboard.on("success", () => { clipboard.on("success", () => {
this.$message.success(this.$t("复制成功")); this.$message.success(this.$t("复制成功"))
}); })
clipboard.on("error", () => { clipboard.on("error", () => {
this.$message.error(this.$t("复制失败")); this.$message.error(this.$t("复制失败"))
}); })
}, },
methods: { methods: {
handleViewRecord(row) { handleViewRecord(row) {
this.$router.push({ this.$router.push({
path: '/member/memberManagement/exchangeRecordOperation', path: "/member/memberManagement/exchangeRecordOperation",
query: { exchangeRewardID: row.id, pageStatus: 'view' } query: { exchangeRewardID: row.id, pageStatus: "view" }
}) })
}, },
getNodeListAPI() { getNodeListAPI() {
...@@ -1083,50 +642,44 @@ export default { ...@@ -1083,50 +642,44 @@ export default {
this.nodeList = res.data this.nodeList = res.data
}) })
}, },
handleShowRewardsDetail(row){ handleShowRewardsDetail(row) {
let params = { let params = {
id: row.rewardId id: row.rewardId
}; }
getRewardsDetails(params).then((res) => { getRewardsDetails(params).then((res) => {
this.dialogVisible = true this.dialogVisible = true
this.operatingPagetitle = '1' this.operatingPagetitle = "1"
this.rewardsItem = res.data; this.rewardsItem = res.data
}); })
}, },
handleExchangeRedeemType(id) { handleExchangeRedeemType(id) {
return this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING).filter( return this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING).filter((item) => item.value == id)[0]
(item) => item.value == id
)[0];
}, },
//兑换入口 //兑换入口
handleExchangeEntrance(id) { handleExchangeEntrance(id) {
return this.getDictDatas(DICT_TYPE.PLATFORM_TYPE).filter( return this.getDictDatas(DICT_TYPE.PLATFORM_TYPE).filter((item) => item.value == id)[0]
(item) => item.value == id
)[0];
}, },
//兑换状态 //兑换状态
handleExchangeStatus(id) { handleExchangeStatus(id) {
return this.getDictDatas(DICT_TYPE.REWARD_REDEEM_STATUS).filter( return this.getDictDatas(DICT_TYPE.REWARD_REDEEM_STATUS).filter((item) => item.value == id)[0]
(item) => item.value == id
)[0];
}, },
handleQueryRecord() { handleQueryRecord() {
this.queryParamsRecord.pageNo = 1; this.queryParamsRecord.pageNo = 1
let params = { ...this.queryParamsRecord }; let params = { ...this.queryParamsRecord }
if (this.dateRangeCreateTimeRecord) { if (this.dateRangeCreateTimeRecord) {
params.startTime = this.dateRangeCreateTimeRecord[0]; params.startTime = this.dateRangeCreateTimeRecord[0]
params.endTime = this.dateRangeCreateTimeRecord[1]; params.endTime = this.dateRangeCreateTimeRecord[1]
} }
queryMemberExchangeRecord(params).then((res) => { queryMemberExchangeRecord(params).then((res) => {
this.loading = false; this.loading = false
this.memberRecordList = res.data.list; this.memberRecordList = res.data.list
this.totalRecord = res.data.total; this.totalRecord = res.data.total
}); })
}, },
resetQueryRecord() { resetQueryRecord() {
this.loading = true; this.loading = true
this.dateRangeCreateTimeRecord = []; this.dateRangeCreateTimeRecord = []
this.queryParamsRecord = { this.queryParamsRecord = {
country: null, country: null,
city: null, city: null,
...@@ -1139,63 +692,59 @@ export default { ...@@ -1139,63 +692,59 @@ export default {
pageSize: 100, pageSize: 100,
startTime: null, startTime: null,
usedScore: null, usedScore: null,
usedScoreOperate: null, usedScoreOperate: null
}; }
this.handleQueryRecord(); this.handleQueryRecord()
}, },
handleQueryPaginationRecord() { handleQueryPaginationRecord() {
let params = { ...this.queryParamsRecord }; let params = { ...this.queryParamsRecord }
if (this.dateRangeCreateTimeRecord) { if (this.dateRangeCreateTimeRecord) {
params.startTime = this.dateRangeCreateTimeRecord[0]; params.startTime = this.dateRangeCreateTimeRecord[0]
params.endTime = this.dateRangeCreateTimeRecord[1]; params.endTime = this.dateRangeCreateTimeRecord[1]
} }
queryMemberExchangeRecord(params).then((res) => { queryMemberExchangeRecord(params).then((res) => {
this.loading = false; this.loading = false
this.memberRecordList = res.data.list; this.memberRecordList = res.data.list
this.totalRecord = res.data.total; this.totalRecord = res.data.total
}); })
}, },
handleSourceType(id) { handleSourceType(id) {
return this.getDictDatas(DICT_TYPE.MEMBER_SCORE_SOURCE).filter( return this.getDictDatas(DICT_TYPE.MEMBER_SCORE_SOURCE).filter((item) => item.value == id)[0]
(item) => item.value == id
)[0];
}, },
handleholdScoreStatus(id) { handleholdScoreStatus(id) {
return this.getDictDatas(DICT_TYPE.MEMBER_SCORE_OPERATE_TYPE).filter( return this.getDictDatas(DICT_TYPE.MEMBER_SCORE_OPERATE_TYPE).filter((item) => item.value == id)[0]
(item) => item.value == id
)[0];
}, },
handleQuery() { handleQuery() {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1
let params = { ...this.queryParams }; let params = { ...this.queryParams }
if (this.dateRangeCreateTime) { if (this.dateRangeCreateTime) {
params.startTime = this.dateRangeCreateTime[0]; params.startTime = this.dateRangeCreateTime[0]
params.endTime = this.dateRangeCreateTime[1]; params.endTime = this.dateRangeCreateTime[1]
} }
queryMemberScoreRecord(params).then((res) => { queryMemberScoreRecord(params).then((res) => {
this.loading = false; this.loading = false
this.memberList = res.data.list; this.memberList = res.data.list
this.total = res.data.total; this.total = res.data.total
}); })
}, },
handleQueryPagination() { handleQueryPagination() {
let params = { ...this.queryParams }; let params = { ...this.queryParams }
if (this.dateRangeCreateTime) { if (this.dateRangeCreateTime) {
params.startTime = this.dateRangeCreateTime[0]; params.startTime = this.dateRangeCreateTime[0]
params.endTime = this.dateRangeCreateTime[1]; params.endTime = this.dateRangeCreateTime[1]
} }
queryMemberScoreRecord(params).then((res) => { queryMemberScoreRecord(params).then((res) => {
this.loading = false; this.loading = false
this.memberList = res.data.list; this.memberList = res.data.list
this.total = res.data.total; this.total = res.data.total
}); })
}, },
resetQuery() { resetQuery() {
this.loading = true; this.loading = true
this.dateRangeCreateTime = []; this.dateRangeCreateTime = []
this.queryParams = { this.queryParams = {
ruleTitle: "", ruleTitle: "",
ruleDesc: "", ruleDesc: "",
...@@ -1207,130 +756,128 @@ export default { ...@@ -1207,130 +756,128 @@ export default {
endTime: "", endTime: "",
pageNo: 1, pageNo: 1,
pageSize: 1000, pageSize: 1000,
startTime: "", startTime: ""
}; }
this.handleQuery(); this.handleQuery()
}, },
handleCopyReferralCode(details) {}, handleCopyReferralCode(details) {},
handleSelect(key, keyPath) { handleSelect(key, keyPath) {
console.log(key, keyPath); console.log(key, keyPath)
this.activeIndex = key; this.activeIndex = key
}, },
handleExchangeRewards(details) { handleExchangeRewards(details) {
this.$router.push({ this.$router.push({
path: "/member/memberManagement/exchangeRecordOperation", path: "/member/memberManagement/exchangeRecordOperation",
query: { query: {
memberId: details.userScoreLevelInfo.memberId, memberId: details.userScoreLevelInfo.memberId,
pageStatus: "add", pageStatus: "add"
}, }
}); })
}, },
deleteFn(row) { deleteFn(row) {
const nickname = row.nickname; const nickname = row.nickname
this.$modal this.$modal
.confirm( .confirm(`${this.$t("是否确认删除昵称为{nickname}的会员?", { nickname })}`)
`${this.$t("是否确认删除昵称为{nickname}的会员?", { nickname })}`
)
.then(function () { .then(function () {
return deleteUser(row.id); return deleteUser(row.id)
}) })
.then((res) => { .then((res) => {
this.$message.success(this.$t("删除成功")); this.$message.success(this.$t("删除成功"))
this.$router.back(); this.$router.back()
}) })
.catch(() => { .catch(() => {
// this.$message.success(this.$t('删除失败')) // this.$message.success(this.$t('删除失败'))
}); })
}, },
getDetails() { getDetails() {
memberUserGet({ id: this.$route.params.id }).then((r) => { memberUserGet({ id: this.$route.params.id }).then((r) => {
this.details = r.data; this.details = r.data
}); })
}, },
// 保函证书 // 保函证书
guarantee(row) { guarantee(row) {
this.publicObj = row; this.publicObj = row
this.guaranteeShow = true; this.guaranteeShow = true
this.guaranteeUrl = row.backLetterImg; this.guaranteeUrl = row.backLetterImg
}, },
// 操作日志 // 操作日志
operationLogFn(row) { operationLogFn(row) {
this.publicObj = row; this.publicObj = row
this.operationLogFrom.page = 1; this.operationLogFrom.page = 1
this.operationLogFrom.userId = row.id; this.operationLogFrom.userId = row.id
this.operationLogShow = true; this.operationLogShow = true
this.operationLogList = []; this.operationLogList = []
this.getOperationLogList(); this.getOperationLogList()
}, },
getOperationLogList() { getOperationLogList() {
operationLogApi(this.operationLogFrom).then((r) => { operationLogApi(this.operationLogFrom).then((r) => {
if (r.code === 0) { if (r.code === 0) {
this.operationLogList = r.data.list; this.operationLogList = r.data.list
this.totalLog = r.data.total; this.totalLog = r.data.total
} }
}); })
}, },
identityFn(row, val) { identityFn(row, val) {
this.attestationShow = true; this.attestationShow = true
this.activeName = val; this.activeName = val
this.publicObj = row; this.publicObj = row
if (val == 1) { if (val == 1) {
this.getIdentityDetails(); this.getIdentityDetails()
} else { } else {
this.getEnterpriseFn(); this.getEnterpriseFn()
} }
}, },
handleClick(val) { handleClick(val) {
if (val.name == 1) { if (val.name == 1) {
this.getIdentityDetails(); this.getIdentityDetails()
} else { } else {
this.getEnterpriseFn(); this.getEnterpriseFn()
} }
}, },
getIdentityDetails() { getIdentityDetails() {
this.resetId(); this.resetId()
memberGetAuthIdcardInfo({ userId: this.publicObj.id }).then((r) => { memberGetAuthIdcardInfo({ userId: this.publicObj.id }).then((r) => {
if (r.code === 0 && !!r.data) { if (r.code === 0 && !!r.data) {
this.IdDetails = r.data; this.IdDetails = r.data
} }
}); })
}, },
getEnterpriseFn() { getEnterpriseFn() {
this.resetEnterprise(); this.resetEnterprise()
memberGetAuthEnterpriseInfo({ userId: this.publicObj.id }).then((r) => { memberGetAuthEnterpriseInfo({ userId: this.publicObj.id }).then((r) => {
if (r.code === 0 && !!r.data) { if (r.code === 0 && !!r.data) {
this.enterpriseFrom = r.data; this.enterpriseFrom = r.data
} }
}); })
}, },
//身份证审核 //身份证审核
idCardAuditFn(val) { idCardAuditFn(val) {
let p = { let p = {
auditStatus: val, auditStatus: val,
userCardAuthId: this.IdDetails.id, userCardAuthId: this.IdDetails.id,
auditRemark: this.IdDetails.auditRemark, auditRemark: this.IdDetails.auditRemark
}; }
memberUserAuditIdCard(p).then((r) => { memberUserAuditIdCard(p).then((r) => {
if (r.code === 0) { if (r.code === 0) {
this.$message.success(this.$t("修改成功")); this.$message.success(this.$t("修改成功"))
this.getList(); this.getList()
this.getIdentityDetails(); this.getIdentityDetails()
} }
}); })
}, },
// 企业证书审核 // 企业证书审核
certificateVerificationFn(val) { certificateVerificationFn(val) {
let p = { let p = {
auditStatus: val, auditStatus: val,
userEnterpriseAuthId: this.enterpriseFrom.id, userEnterpriseAuthId: this.enterpriseFrom.id,
auditRemark: this.enterpriseFrom.auditRemark, auditRemark: this.enterpriseFrom.auditRemark
}; }
memberUserAuditEnterprise(p).then((r) => { memberUserAuditEnterprise(p).then((r) => {
if (r.code === 0) { if (r.code === 0) {
this.getList(); this.getList()
this.getEnterpriseFn(); this.getEnterpriseFn()
} }
}); })
}, },
setMemberUserUpdateIdCard() { setMemberUserUpdateIdCard() {
this.$refs.formId.validate(async (valid) => { this.$refs.formId.validate(async (valid) => {
...@@ -1342,20 +889,20 @@ export default { ...@@ -1342,20 +889,20 @@ export default {
img2: this.IdDetails.img2, img2: this.IdDetails.img2,
name: this.IdDetails.name, name: this.IdDetails.name,
userCardAuthId: this.IdDetails.id, userCardAuthId: this.IdDetails.id,
auditPass: true, auditPass: true
}; }
memberUserUpdateIdCard(p).then((r) => { memberUserUpdateIdCard(p).then((r) => {
if (r.code === 0) { if (r.code === 0) {
this.$message.success(this.$t("修改成功")); this.$message.success(this.$t("修改成功"))
if (p.auditPass === true) { if (p.auditPass === true) {
this.getIdentityDetails(); this.getIdentityDetails()
} }
this.getList(); this.getList()
this.modifyIdCard = true; this.modifyIdCard = true
} }
}); })
} }
}); })
}, },
setMemberUserUpdateEnterprise() { setMemberUserUpdateEnterprise() {
this.$refs.formEnter.validate(async (valid) => { this.$refs.formEnter.validate(async (valid) => {
...@@ -1367,20 +914,20 @@ export default { ...@@ -1367,20 +914,20 @@ export default {
legalName: this.enterpriseFrom.legalName, legalName: this.enterpriseFrom.legalName,
name: this.enterpriseFrom.name, name: this.enterpriseFrom.name,
userEnterpriseAuthId: this.enterpriseFrom.id, userEnterpriseAuthId: this.enterpriseFrom.id,
auditPass: true, auditPass: true
}; }
memberUserUpdateEnterprise(p).then((r) => { memberUserUpdateEnterprise(p).then((r) => {
if (r.code === 0) { if (r.code === 0) {
if (p.auditPass === true) { if (p.auditPass === true) {
this.getEnterpriseFn(); this.getEnterpriseFn()
} }
this.getList(); this.getList()
this.modifyLicense = true; this.modifyLicense = true
this.$message.success(this.$t("修改成功")); this.$message.success(this.$t("修改成功"))
} }
}); })
} }
}); })
}, },
submit() { submit() {
let p = { let p = {
...@@ -1390,17 +937,17 @@ export default { ...@@ -1390,17 +937,17 @@ export default {
legalName: this.enterpriseFrom.legalName, legalName: this.enterpriseFrom.legalName,
name: this.enterpriseFrom.name, name: this.enterpriseFrom.name,
userEnterpriseAuthId: this.enterpriseFrom.id, userEnterpriseAuthId: this.enterpriseFrom.id,
userId: this.publicObj.id, userId: this.publicObj.id
}; }
userCreateAuditEnterprise(p).then((r) => { userCreateAuditEnterprise(p).then((r) => {
if (r.code === 0) { if (r.code === 0) {
this.$message.success(this.$t("添加成功!")); this.$message.success(this.$t("添加成功!"))
this.enterpriseFrom.status = 2; this.enterpriseFrom.status = 2
this.enterpriseFrom.auditTime = new Date().getTime(); this.enterpriseFrom.auditTime = new Date().getTime()
this.getEnterpriseFn(); this.getEnterpriseFn()
this.getList(); this.getList()
} }
}); })
}, },
submitId() { submitId() {
this.$refs.formId.validate(async (valid) => { this.$refs.formId.validate(async (valid) => {
...@@ -1412,19 +959,19 @@ export default { ...@@ -1412,19 +959,19 @@ export default {
img2: this.IdDetails.img2, img2: this.IdDetails.img2,
name: this.IdDetails.name, name: this.IdDetails.name,
status: 2, status: 2,
userId: this.publicObj.id, userId: this.publicObj.id
}; }
createAuditIdCard(p).then((r) => { createAuditIdCard(p).then((r) => {
if (r.code === 0) { if (r.code === 0) {
this.$message.success(this.$t("添加成功!")); this.$message.success(this.$t("添加成功!"))
this.IdDetails.status = 2; this.IdDetails.status = 2
this.IdDetails.auditTime = new Date().getTime(); this.IdDetails.auditTime = new Date().getTime()
this.getIdentityDetails(); this.getIdentityDetails()
this.getList(); this.getList()
} }
}); })
} }
}); })
}, },
/** 表单重置 */ /** 表单重置 */
resetId() { resetId() {
...@@ -1439,8 +986,8 @@ export default { ...@@ -1439,8 +986,8 @@ export default {
img2: undefined, img2: undefined,
name: "", name: "",
status: 0, status: 0,
userId: 0, userId: 0
}; }
}, //清空身份证 }, //清空身份证
resetEnterprise() { resetEnterprise() {
this.enterpriseFrom = { this.enterpriseFrom = {
...@@ -1454,23 +1001,23 @@ export default { ...@@ -1454,23 +1001,23 @@ export default {
legalName: undefined, legalName: undefined,
name: undefined, name: undefined,
status: 0, status: 0,
userId: undefined, userId: undefined
}; }
}, //清空企业 }, //清空企业
setGuarantee() { setGuarantee() {
seTupdateBackletter({ seTupdateBackletter({
userId: this.publicObj.id, userId: this.publicObj.id,
backLetter: this.guaranteeUrl, backLetter: this.guaranteeUrl
}).then((r) => { }).then((r) => {
if (r.code === 0) { if (r.code === 0) {
this.publicObj.backLetterImg = this.guaranteeUrl; this.publicObj.backLetterImg = this.guaranteeUrl
this.guaranteeShow = false; this.guaranteeShow = false
this.$message.success(this.$t("保存成功")); this.$message.success(this.$t("保存成功"))
} }
}); })
}, }
}, }
}; }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.table-container { .table-container {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment