Commit 67ae8fcf authored by chenwei's avatar chenwei

Merge branch 'cherry-pick-7994d7ed' into 'dev'

Merge branch 'feature/member-defect-604' into 'pre-release'

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