Commit 8849fbe9 authored by chenwei's avatar chenwei

修复问题

parent ff4def43
......@@ -15,7 +15,7 @@
:placeholder="$t('请输入')"
:disabled="isDisable"
clearable
v-trim
v-trim
/>
</el-form-item>
</el-col>
......@@ -26,7 +26,7 @@
:disabled="isDisable"
:placeholder="$t('请输入')"
clearable
v-trim
v-trim
/>
</el-form-item>
</el-col>
......@@ -79,11 +79,9 @@
:rules="rules.nodeIds.points"
>
<el-input
type="number"
v-model.trim="item.points"
v-model.trim.number="item.points"
:placeholder="$t('请输入')"
:disabled="isDisable"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/> </el-form-item
></el-col>
<el-col :span="1">
......@@ -130,12 +128,10 @@
<el-form-item :label="$t('允许兑换次数')" prop="allowCount">
<el-input
class="input-item-width"
type="number"
v-model.trim="queryParams.allowCount"
v-model.trim.number="queryParams.allowCount"
:placeholder="$t('请输入')"
clearable
:disabled="isDisable"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-row :gutter="10">
......@@ -351,16 +347,17 @@ export default {
message: this.$t("请输入兑换积分"),
trigger: "blur",
},
{ type: "number", message: "输入数字", trigger: "blur" },
],
},
quantityRemain: [
{
required: true,
message: this.$t("请输入剩余数量"),
trigger: "blur",
},
],
quantityRemain: [
{
required: true,
message: this.$t("请输入剩余数量"),
trigger: "blur",
},
],
pickMethod: [
{
required: true,
......@@ -374,6 +371,7 @@ export default {
message: this.$t("请输入允许兑换次数"),
trigger: "blur",
},
{ type: "number", message: "输入数字", trigger: "blur" },
],
remarkZh: [
{
......@@ -444,7 +442,7 @@ export default {
imgZh: null,
nodeId: null,
pickMethod: null,
pointsRequire: null,
pointsRequire: null,
remarkEn: null,
remarkFr: null,
remarkZh: null,
......@@ -459,7 +457,7 @@ export default {
};
</script>
<style>
.input-item-width{
.input-item-width {
width: 194px;
}
</style>
......@@ -131,7 +131,8 @@
size="mini"
icon="el-icon-plus"
@click="handleAddReward"
>{{ $t("添加礼品") }}</el-button>
>{{ $t("添加礼品") }}</el-button
>
<right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
</el-row>
<!-- 礼品列表 -->
......@@ -154,7 +155,8 @@
<el-image
:src="firstImg(isChinese ? scope.row.imgZh : scope.row.imgEn)"
style="width: 50px; height: 50px"
>{{ $t("") }}</el-image>
>{{ $t("") }}</el-image
>
</template>
</el-table-column>
<el-table-column width="100" :label="$t('开始日期')">
......@@ -220,7 +222,8 @@
<el-button
type="text"
@click="$router.push('/memberManagement/exchangeRecord')"
>{{ scope.row.exchangeCount }}</el-button>
>{{ scope.row.exchangeCount }}</el-button
>
</template>
</el-table-column>
<el-table-column
......@@ -241,7 +244,8 @@
type="text"
icon="el-icon-view"
@click="handleView(scope.row)"
>{{ $t("查看") }}</el-button>
>{{ $t("查看") }}</el-button
>
<el-button
v-hasPermi="['ecw:giftManagement:close']"
size="mini"
......@@ -249,14 +253,16 @@
icon="el-icon-edit"
:disabled="scope.row.status == '2' || scope.row.status == '3'"
@click="handleCloseStatus(scope.row)"
>{{ $t("关闭") }}</el-button>
>{{ $t("关闭") }}</el-button
>
<el-button
v-hasPermi="['ecw:giftManagement:copy']"
size="mini"
type="text"
icon="el-icon-edit"
@click="copyRewards(scope.row)"
>{{ $t("复制") }}</el-button>
>{{ $t("复制") }}</el-button
>
<el-button
v-hasPermi="['ecw:giftManagement:postpone']"
size="mini"
......@@ -264,7 +270,8 @@
icon="el-icon-edit"
:disabled="scope.row.status != '1'"
@click="handlePostpone(scope.row)"
>{{ $t("延期")}}</el-button>
>{{ $t("延期") }}</el-button
>
<el-button
v-hasPermi="['ecw:giftManagement:delete']"
size="mini"
......@@ -272,7 +279,8 @@
icon="el-icon-delete"
:disabled="scope.row.status != '2'"
@click="handleDelete(scope.row)"
>{{ $t("删除") }}</el-button>
>{{ $t("删除") }}</el-button
>
<el-button
v-has-permi="['ecw:giftManagement:edit']"
size="mini"
......@@ -280,23 +288,30 @@
:disabled="scope.row.status != '2' && scope.row.status != '1'"
icon="el-icon-collection"
@click="editRewards(scope.row)"
>{{ $t("编辑") }}</el-button>
>{{ $t("编辑") }}</el-button
>
<el-button
v-has-permi="['ecw:giftManagement:enable']"
size="mini"
type="text"
icon="el-icon-user"
:disabled="scope.row.status == '1' || scope.row.status == '3' || scope.row.status == '4'"
:disabled="
scope.row.status == '1' ||
scope.row.status == '3' ||
scope.row.status == '4'
"
@click="handleLaunchRewards(scope.row)"
>{{ $t("启用") }}</el-button>
>{{ $t("启用") }}</el-button
>
<el-button
v-has-permi="['ecw:giftManagement:exchange']"
:disabled="scope.row.status == '3' || scope.row.status == '4'"
size="mini"
type="text"
icon="el-icon-user"
icon="el-icon-user"
@click="handleExchange(scope.row)"
>{{ $t("兑换") }}</el-button>
>{{ $t("兑换") }}</el-button
>
</template>
</el-table-column>
</el-table>
......@@ -350,17 +365,17 @@ import {
deleteRewards,
copyRewardsAPI,
changeRewardsStatus,
delayRewards
} from '@/api/ecw/giftManagement'
import { getDictDatas, DICT_TYPE } from '@/utils/dict'
import { parseTime } from '../../../utils/ruoyi'
import OperatingGift from '@/views/ecw/giftManagement/components/operatingGift.vue'
import { uploadFile } from '@/api/infra/file'
import ImageUpload from '@/components/ImageUpload'
delayRewards,
} from "@/api/ecw/giftManagement";
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import { parseTime } from "../../../utils/ruoyi";
import OperatingGift from "@/views/ecw/giftManagement/components/operatingGift.vue";
import { uploadFile } from "@/api/infra/file";
import ImageUpload from "@/components/ImageUpload";
export default {
name: 'GiftManagementList',
name: "GiftManagementList",
components: {
OperatingGift
OperatingGift,
},
data() {
return {
......@@ -377,13 +392,13 @@ export default {
// 礼品列表
list: [],
// 弹出层标题
operatingPagetitle: '',
operatingPagetitle: "",
// 是否显示弹出层
dialogVisible: false,
rewardsItem: {},
dateRangeCreateTime: [],
postponeDatetime: '',
postponeRewardsID: '',
postponeDatetime: "",
postponeRewardsID: "",
dialogPostponeVisible: false,
// 查询参数
queryParams: {
......@@ -394,200 +409,200 @@ export default {
pointsRequireSymbol: null,
pickMethod: null,
nodeId: null,
status: null,
status: "1",
remark: null,
quantityRemainSymbol: null,
quantityRemain: null,
beginCreateTime: null,
endCreateTime: null
endCreateTime: null,
},
// 网点
nodeList: [],
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now() - 8.64e7
}
}
}
return time.getTime() < Date.now() - 8.64e7;
},
},
};
},
computed: {
isChinese() {
return this.$i18n.locale === 'zh_CN'
}
return this.$i18n.locale === "zh_CN";
},
},
created() {
this.getList()
this.getNodeList()
this.getList();
this.getNodeList();
},
activated() {
this.getList()
this.getList();
},
methods: {
arraysEqual(arr1, arr2) {
return arr1.filter((current) => {
return !!arr2.find((item) => item == current.value.toString())
})
return !!arr2.find((item) => item == current.value.toString());
});
},
handleRewardsStatus(status) {
return this.getDictDatas(DICT_TYPE.GIFT_STATUS).filter(
(dicItem) => dicItem.value.toString() == status
)[0]
)[0];
},
firstImg(imgString) {
if (!imgString || imgString == '') return imgString
const imgs = imgString.split(',')
return imgs.length ? imgs[0] : null
if (!imgString || imgString == "") return imgString;
const imgs = imgString.split(",");
return imgs.length ? imgs[0] : null;
},
handlePickMethod(pickMethod) {
const pickMethodLabel = []
const pickMethodLabel = [];
if (this.isChinese) {
this.arraysEqual(
this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING),
pickMethod.split(',')
pickMethod.split(",")
).forEach((element) => {
pickMethodLabel.push(element.label)
})
pickMethodLabel.push(element.label);
});
} else {
this.arraysEqual(
this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING),
pickMethod.split(',')
pickMethod.split(",")
).forEach((element) => {
pickMethodLabel.push(element.labelEn)
})
pickMethodLabel.push(element.labelEn);
});
}
return pickMethodLabel.join()
return pickMethodLabel.join();
},
handleExchangeNodeId(nodeId) {
return this.nodeList.filter((nodeItem) => nodeItem.id == nodeId)[0]
return this.nodeList.filter((nodeItem) => nodeItem.id == nodeId)[0];
},
handleAddReward() {
this.rewardsItem = {}
this.dialogVisible = true
this.operatingPagetitle = '3'
this.rewardsItem = {};
this.dialogVisible = true;
this.operatingPagetitle = "3";
},
handleExchange(row) {
this.$router.push({
path: '/giftManagement/bulkExchange',
query: { rewardsID: row.id }
})
path: "/giftManagement/bulkExchange",
query: { rewardsID: row.id },
});
},
/** 延期按钮操作 */
handlePostpone(row) {
this.postponeRewardsID = row.id
this.dialogPostponeVisible = true
this.postponeRewardsID = row.id;
this.dialogPostponeVisible = true;
},
confirmPostponeRewards() {
this.dialogPostponeVisible = false
this.dialogPostponeVisible = false;
delayRewards({
id: this.postponeRewardsID,
endTime: this.postponeDatetime
endTime: this.postponeDatetime,
}).then((res) => {
this.getList()
this.$message.success(this.$t('延期成功'))
})
this.getList();
this.$message.success(this.$t("延期成功"));
});
},
/** 关闭按钮操作 */
handleCloseStatus(row) {
this.$confirm(this.$t('是否关闭当前礼品?'), this.$t('提示'), {
confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t('取消'),
type: 'warning'
this.$confirm(this.$t("是否关闭当前礼品?"), this.$t("提示"), {
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning",
})
.then((_) => {
return changeRewardsStatus({ id: row.id, status: '3' })
return changeRewardsStatus({ id: row.id, status: "3" });
})
.then((res) => {
this.getList()
this.$message.success(this.$t('关闭成功'))
this.getList();
this.$message.success(this.$t("关闭成功"));
})
.catch((_) => {
// this.queryAllData();
})
});
},
// 启用礼品状态
handleLaunchRewards(row) {
this.$confirm(this.$t('是否启用当前礼品?'), this.$t('提示'), {
confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t('取消'),
type: 'warning'
this.$confirm(this.$t("是否启用当前礼品?"), this.$t("提示"), {
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning",
})
.then(() => {
changeRewardsStatus({ id: row.id, status: '1' }).then((r) => {
this.$message.success(this.$t('启用成功'))
this.getList()
})
changeRewardsStatus({ id: row.id, status: "1" }).then((r) => {
this.$message.success(this.$t("启用成功"));
this.getList();
});
})
.catch(() => {})
.catch(() => {});
},
getNodeList() {
getNodeList().then((res) => {
this.nodeList = res.data
})
this.nodeList = res.data;
});
},
getList() {
this.loading = true
this.loading = true;
// 处理查询参数
const params = { ...this.queryParams }
const params = { ...this.queryParams };
this.addBeginAndEndTime(
params,
this.dateRangeCreateTime,
'createTime',
"createTime",
false
)
);
getGiftList(params).then((res) => {
this.loading = false
this.list = res.data.list
this.total = res.data.total
})
this.loading = false;
this.list = res.data.list;
this.total = res.data.total;
});
},
// 新增潜在客户
handleAddPotential() {
this.$refs.potentialCustom.dialogTableVisible = true
this.$refs.potentialCustom.dialogTableVisible = true;
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
.confirm(this.$t('是否确认删除此礼品'))
.then(function() {
return deleteRewards({ id: row.id })
.confirm(this.$t("是否确认删除此礼品"))
.then(function () {
return deleteRewards({ id: row.id });
})
.then(() => {
this.getList()
this.$modal.msgSuccess(this.$t('删除成功'))
this.getList();
this.$modal.msgSuccess(this.$t("删除成功"));
})
.catch(() => {})
.catch(() => {});
},
/** 搜索按钮操作 */
handleQuery() {
this.$nextTick(() => {
this.queryParams.page = 1
this.getList()
})
this.queryParams.page = 1;
this.getList();
});
},
/** 查看按钮操作 */
handleView(row) {
this.dialogVisible = true
this.operatingPagetitle = '1'
this.rewardsItem = row
this.dialogVisible = true;
this.operatingPagetitle = "1";
this.rewardsItem = row;
},
/** 编辑按钮操作 */
editRewards(row) {
this.dialogVisible = true
this.operatingPagetitle = '2'
this.rewardsItem = row
this.dialogVisible = true;
this.operatingPagetitle = "2";
this.rewardsItem = row;
},
/** 复制按钮操作 */
copyRewards(row) {
copyRewardsAPI(row.id).then((res) => {
this.$modal.msgSuccess(this.$t('复制成功'))
this.handleQuery()
})
this.$modal.msgSuccess(this.$t("复制成功"));
this.handleQuery();
});
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = []
this.dateRangeCreateTime = [];
this.queryParams = {
page: 1,
rows: 10,
......@@ -596,19 +611,19 @@ export default {
level: null,
source: null,
customerService: null,
status: null,
status: "1",
department: null,
creditLevel: null,
country: null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
}
this.handleQuery()
}
}
}
memberAreaCode: null,
};
this.handleQuery();
},
},
};
</script>
<style>
.rewardstToolTip {
......
......@@ -5,6 +5,7 @@
ref="queryForm"
size="small"
:rules="rules"
class="integral-rule-operate"
:disabled="showViewTime"
label-width="120px"
>
......@@ -24,7 +25,7 @@
v-model="queryParams.titleZh"
:placeholder="$t('请输入查找')"
clearable
v-trim
v-trim
/>
<el-button
size="mini"
......@@ -43,7 +44,7 @@
v-model="queryParams.titleEn"
:placeholder="$t('请输入查找')"
clearable
v-trim
v-trim
/> </el-form-item
></el-col>
</el-row>
......@@ -108,7 +109,7 @@
v-model="queryParams.extraRecommend.shareContentZh"
:placeholder="$t('请输入分享文案')"
clearable
v-trim
v-trim
/> </el-form-item
></el-col>
<el-col :span="12">
......@@ -122,7 +123,7 @@
v-model="queryParams.extraRecommend.shareContentEn"
:placeholder="$t('请输入分享文案')"
clearable
v-trim
v-trim
/> </el-form-item
></el-col>
</el-row>
......@@ -177,11 +178,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item
:label="$t('积分')"
v-if="queryParams.type == '1'"
required
>
<el-form-item :label="$t('积分')" v-if="queryParams.type == '1'" required>
<el-row
type="flex"
justify="start"
......@@ -283,7 +280,7 @@
clearable
placement="bottom-start"
v-model="queryParams.dateRangeCreateTime"
style="width: 240px"
style="width: 300px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
......@@ -591,6 +588,8 @@ export default {
};
const validatehigh = (rule, value, callback) => {
const index = Number(rule.field.split(".")[2]);
console.log("000000", index);
console.log("0000001", this.queryParams.extraOrderV);
if (index == "0") {
if (
this.queryParams.extraOrderV.orderVRule[index].low &&
......@@ -608,7 +607,7 @@ export default {
} else {
callback();
}
} else if (index > "0") {
} else if (index > 0) {
if (
this.queryParams.extraOrderV.orderVRule[index].low &&
this.queryParams.extraOrderV.orderVRule[index].low >=
......@@ -616,8 +615,9 @@ export default {
) {
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
this.queryParams.extraOrderV.orderVRule[index + 1].low
) {
callback(this.$t("本次最终积分应小于下一次开始积分"));
} else {
......@@ -1057,6 +1057,7 @@ export default {
},
//保存
handleSaveIntegralRule() {
console.log("23333");
this.$refs["queryForm"].validate((valid) => {
if (valid) {
let params = deepClone(this.queryParams);
......@@ -1139,6 +1140,9 @@ export default {
};
</script>
<style lang="scss" scoped>
::v-deep .integral-rule-operate .el-input {
width: 300px;
}
.del-btn {
color: red;
padding-left: 120px;
......
......@@ -28,7 +28,7 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('兑换方式')">
<el-form-item :label="$t('领取方式')">
<dict-selector
v-model="queryParams.redeemType"
clearable
......@@ -127,28 +127,32 @@
size="mini"
icon="el-icon-plus"
@click="handleNewExchange"
>{{ $t("新增兑换") }}</el-button>
>{{ $t("新增兑换") }}</el-button
>
<el-button
v-hasPermi="['ecw:memberManagement:batchWriteOff']"
type="success"
size="mini"
icon="el-icon-plus"
@click="handleBatchVerify"
>{{ $t("批量核销") }}</el-button>
>{{ $t("批量核销") }}</el-button
>
<el-button
v-hasPermi="['ecw:memberManagement:export']"
type="success"
size="mini"
icon="el-icon-plus"
@click="handleBatchExport"
>{{ $t("导出") }}</el-button>
>{{ $t("导出") }}</el-button
>
<el-button
v-hasPermi="['ecw:memberManagement:exchangeoInfoImport']"
type="success"
size="mini"
icon="el-icon-plus"
@click="handleShowFileUploadDialog"
>{{ $t("兑换信息导入") }}</el-button>
>{{ $t("兑换信息导入") }}</el-button
>
<right-toolbar
:show-search.sync="showSearch"
@queryTable="handleQueryPagination"
......@@ -173,17 +177,11 @@
align="center"
prop="rewardCode"
/>
<el-table-column
:label="$t('礼品名称')"
align="center"
>
<template #default="{ row }">
<el-button
type="text"
@click="
handleShowRewardsDetail(row)
"
>{{isChinese ? row.rewardTitleZh : row.rewardTitleEn }}</el-button>
<el-table-column :label="$t('礼品名称')" align="center">
<template #default="{ row }">
<el-button type="text" @click="handleShowRewardsDetail(row)">{{
isChinese ? row.rewardTitleZh : row.rewardTitleEn
}}</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('会员名称')" align="center">
......@@ -193,12 +191,14 @@
@click="
$router.push('/member/member/member-details/' + row.memberId)
"
>{{ isChinese ? row.memberNameZh : row.memberNameEn }}</el-button>
>{{ isChinese ? row.memberNameZh : row.memberNameEn }}</el-button
>
</template>
</el-table-column>
<el-table-column :label="$t('兑换时间')" align="center">
<template #default="{ row }">
{{ parseTime(row.redemptionTime) || "/" }}</template>
{{ parseTime(row.redemptionTime) || "/" }}</template
>
</el-table-column>
<el-table-column
:label="$t('兑换积分')"
......@@ -276,7 +276,8 @@
icon="el-icon-view"
:disabled="scope.row.status != '1'"
@click="handleRewardCancel(scope.row)"
>{{ $t("撤销") }}</el-button>
>{{ $t("撤销") }}</el-button
>
<el-button
v-hasPermi="['ecw:memberManagement:edit']"
size="mini"
......@@ -284,14 +285,16 @@
icon="el-icon-edit"
:disabled="scope.row.status != '1'"
@click="handleRewardEdit(scope.row)"
>{{ $t("编辑") }}</el-button>
>{{ $t("编辑") }}</el-button
>
<el-button
v-hasPermi="['ecw:memberManagement:view']"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleViewRecord(scope.row)"
>{{ $t("查看") }}</el-button>
>{{ $t("查看") }}</el-button
>
<el-button
v-hasPermi="['ecw:memberManagement:verification']"
size="mini"
......@@ -299,7 +302,8 @@
icon="el-icon-edit"
:disabled="scope.row.status != '1'"
@click="handleVerify(scope.row)"
>{{ $t("核销") }}</el-button>
>{{ $t("核销") }}</el-button
>
<el-button
v-hasPermi="['ecw:memberManagement:verificationRollback']"
size="mini"
......@@ -307,7 +311,8 @@
icon="el-icon-delete"
:disabled="scope.row.status != '2'"
@click="handleVerificationRollback(scope.row)"
>{{ $t("核销回退") }}</el-button>
>{{ $t("核销回退") }}</el-button
>
</template>
</el-table-column>
</el-table>
......@@ -351,7 +356,7 @@
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>{{ $t("下载模板") }}
>{{ $t("下载模板") }}
</el-link>
</div>
</el-upload>
......@@ -407,8 +412,8 @@
</span>
</el-dialog>
<!-- 查看 礼品 -->
<operating-gift
<!-- 查看 礼品 -->
<operating-gift
ref="operatingGift"
:title="operatingPagetitle"
:rewards-details="rewardsItem"
......@@ -418,23 +423,23 @@
</div>
</template>
<script>
import { getDictDatas, DICT_TYPE } from '@/utils/dict'
import { getNodeList, getRewardsDetails } from '@/api/ecw/giftManagement'
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import { getNodeList, getRewardsDetails } from "@/api/ecw/giftManagement";
import {
queryMemberExchangeRecord,
batchVerifyAPI,
batchRecordExport,
batchRecordImportTemplate,
rewardCancelQuery,
verifyRollback
} from '@/api/ecw/memberManagement'
import { getNowDateTime, parseTime } from '@/utils/ruoyi'
import { getBaseHeader } from '@/utils/request'
import OperatingGift from '@/views/ecw/giftManagement/components/operatingGift.vue'
verifyRollback,
} from "@/api/ecw/memberManagement";
import { getNowDateTime, parseTime } from "@/utils/ruoyi";
import { getBaseHeader } from "@/utils/request";
import OperatingGift from "@/views/ecw/giftManagement/components/operatingGift.vue";
export default {
name: 'ExchangeRecord',
name: "ExchangeRecord",
components: {
OperatingGift
OperatingGift,
},
data() {
return {
......@@ -442,7 +447,7 @@ export default {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: this.$t('兑换信息导入'),
title: this.$t("兑换信息导入"),
// 是否禁用上传
isUploading: false,
// 设置上传的请求头部
......@@ -450,20 +455,20 @@ export default {
// 上传的地址
url:
process.env.VUE_APP_BASE_API +
'/admin-api/reward/redeem/record/import'
"/admin-api/reward/redeem/record/import",
},
// 批量核销
dialogBatchVerify: false,
batchVerifyForm: {
ids: [],
verifyTime: '',
verifyUser: ''
verifyTime: "",
verifyUser: "",
},
// 显示搜索条件
showSearch: true,
selectedMember: [],
cityList: [],
operatingPagetitle: '',
operatingPagetitle: "",
rewardsItem: {},
dateRangeCreateTime: [],
total: 0,
......@@ -471,270 +476,270 @@ export default {
dialogVisible: false,
memberList: [],
formQuery: {
comment: '',
comment: "",
memberIds: [],
operateType: null,
scoreCount: null
scoreCount: null,
},
queryParams: {
rewardTitle: '',
memberName: '', // 会员昵称
redeemType: '', // 兑换方式
status: '',
rewardCount: '',
rewardCountOperate: '',
rewardCode: '',
entrance: '', // 兑换入口
startTime: '',
endTime: '',
nodeId: '',
rewardTitle: "",
memberName: "", // 会员昵称
redeemType: "", // 兑换方式
status: "",
rewardCount: "",
rewardCountOperate: "",
rewardCode: "",
entrance: "", // 兑换入口
startTime: "",
endTime: "",
nodeId: "",
pageNo: 1,
pageSize: 10
pageSize: 10,
},
// 网点
nodeList: []
}
nodeList: [],
};
},
computed: {
isChinese() {
return this.$i18n.locale === 'zh_CN'
}
return this.$i18n.locale === "zh_CN";
},
},
created() {
this.getNodeListAPI()
this.handleQuery()
this.getNodeListAPI();
this.handleQuery();
},
activated() {
this.handleQuery()
this.handleQuery();
},
methods: {
handleShowRewardsDetail(row){
handleShowRewardsDetail(row) {
let params = {
id: row.rewardId
id: row.rewardId,
};
getRewardsDetails(params).then((res) => {
this.dialogVisible = true
this.operatingPagetitle = '1'
this.rewardsItem = res.data;
this.dialogVisible = true;
this.operatingPagetitle = "1";
this.rewardsItem = res.data;
});
},
// 核销回退
handleVerificationRollback(row) {
this.$confirm(this.$t('是否继续核销回退?'), this.$t('提示'), {
confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t('取消'),
type: 'warning'
this.$confirm(this.$t("是否继续核销回退?"), this.$t("提示"), {
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning",
})
.then(() => {
const params = {
redeemIds: [row.id]
}
redeemIds: [row.id],
};
verifyRollback(params).then((res) => {
this.$message({
type: 'success',
message: this.$t('回退成功!')
})
this.handleQuery()
})
type: "success",
message: this.$t("回退成功!"),
});
this.handleQuery();
});
})
.catch(() => {
this.$message({
type: 'info',
message: this.$t('已取消回退')
})
})
type: "info",
message: this.$t("已取消回退"),
});
});
},
// 核销
handleVerify(row) {
this.$router.push({
path: '/memberManagement/exchangeRecordOperation',
query: { exchangeRewardID: row.id, pageStatus: 'verify' }
})
path: "/memberManagement/exchangeRecordOperation",
query: { exchangeRewardID: row.id, pageStatus: "verify" },
});
},
// 查看按钮操作
handleViewRecord(row) {
this.$router.push({
path: '/memberManagement/exchangeRecordOperation',
query: { exchangeRewardID: row.id, pageStatus: 'view' }
})
path: "/memberManagement/exchangeRecordOperation",
query: { exchangeRewardID: row.id, pageStatus: "view" },
});
},
// 兑换记录编辑操作
handleRewardEdit(row) {
this.$router.push({
path: '/memberManagement/exchangeRecordOperation',
query: { exchangeRewardID: row.id, pageStatus: 'edit' }
})
path: "/memberManagement/exchangeRecordOperation",
query: { exchangeRewardID: row.id, pageStatus: "edit" },
});
},
// 撤销按钮操作
handleRewardCancel(row) {
this.$confirm(
this.$t('此操作积分可能存在到期积分, 撤销后积分将进行扣除,是否继续?'),
this.$t('提示'),
this.$t("此操作积分可能存在到期积分, 撤销后积分将进行扣除,是否继续?"),
this.$t("提示"),
{
confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t('取消'),
type: 'warning'
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning",
}
)
.then(() => {
const params = {
id: row.id
}
id: row.id,
};
rewardCancelQuery(params).then((res) => {
this.$message({
type: 'success',
message: this.$t('撤销成功!')
})
this.handleQuery()
})
type: "success",
message: this.$t("撤销成功!"),
});
this.handleQuery();
});
})
.catch(() => {
this.$message({
type: 'info',
message: this.$t('已取消撤销')
})
})
type: "info",
message: this.$t("已取消撤销"),
});
});
},
// 下载导入模板
importTemplate() {
batchRecordImportTemplate().then((res) => {
this.$download.excel(res, '用户导入模板.xls')
this.$download.excel(res, "用户导入模板.xls");
this.$message({
message: this.$t('下载模板成功'),
type: 'success'
})
})
message: this.$t("下载模板成功"),
type: "success",
});
});
},
// 导入
handleShowFileUploadDialog() {
this.upload.open = true
this.upload.open = true;
},
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true
this.upload.isUploading = true;
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
if (response.code == '1001011027') {
this.$message.error(response.msg)
if (response.code == "1001011027") {
this.$message.error(response.msg);
}
if (
!response.data.redeemIdFailedMap ||
JSON.stringify(response.data.redeemIdFailedMap) == '{}'
JSON.stringify(response.data.redeemIdFailedMap) == "{}"
) {
this.upload.open = false
this.$modal.msgSuccess(this.$t('导入成功'))
this.$refs.upload.clearFiles()
this.upload.isUploading = false
this.handleQuery()
return
this.upload.open = false;
this.$modal.msgSuccess(this.$t("导入成功"));
this.$refs.upload.clearFiles();
this.upload.isUploading = false;
this.handleQuery();
return;
}
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles()
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
// 拼接提示语
const data = response.data
let text = `${this.$t('导入失败:')}`
const data = response.data;
let text = `${this.$t("导入失败:")}`;
for (const username in data.redeemIdFailedMap) {
text +=
'<br />&nbsp;&nbsp;&nbsp;&nbsp;' +
"<br />&nbsp;&nbsp;&nbsp;&nbsp;" +
username +
this.$t('') +
data.redeemIdFailedMap[username]
this.$t("") +
data.redeemIdFailedMap[username];
}
text += `<br />&nbsp;&nbsp;&nbsp;&nbsp;${this.$t('以上数据格式有问题')}`
this.$alert(text, this.$t('导入结果'), {
dangerouslyUseHTMLString: true
})
text += `<br />&nbsp;&nbsp;&nbsp;&nbsp;${this.$t("以上数据格式有问题")}`;
this.$alert(text, this.$t("导入结果"), {
dangerouslyUseHTMLString: true,
});
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit()
this.$refs.upload.submit();
},
// 导出
handleBatchExport() {
const params = { ...this.queryParams }
const 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];
}
batchRecordExport(params).then((res) => {
this.$message({
message: this.$t('已加入导出队列,请稍后在下载日志中下载'),
type: 'success'
})
})
message: this.$t("已加入导出队列,请稍后在下载日志中下载"),
type: "success",
});
});
},
// 批量核销确认按钮
handleBatchVerifySubmit() {
this.$confirm(this.$t('确认提交?'))
this.$confirm(this.$t("确认提交?"))
.then((_) => {
const params = { ...this.batchVerifyForm }
const params = { ...this.batchVerifyForm };
batchVerifyAPI(params).then((res) => {
this.dialogBatchVerify = false
this.dialogBatchVerify = false;
this.$message({
message: this.$t('核销成功'),
type: 'success'
})
})
message: this.$t("核销成功"),
type: "success",
});
});
})
.catch((_) => {})
.catch((_) => {});
},
// 批量核销
handleBatchVerify() {
if (this.batchVerifyForm.ids.length > 0) {
this.dialogBatchVerify = true
this.batchVerifyForm.verifyUser = this.$store.getters.name
this.batchVerifyForm.verifyTime = getNowDateTime()
this.dialogBatchVerify = true;
this.batchVerifyForm.verifyUser = this.$store.getters.name;
this.batchVerifyForm.verifyTime = getNowDateTime();
} else {
this.$message({
message: this.$t('请先选择兑换记录'),
type: 'warning'
})
message: this.$t("请先选择兑换记录"),
type: "warning",
});
}
},
// 新增兑换
handleNewExchange() {
this.$router.push({
path: '/memberManagement/exchangeRecordOperation'
})
path: "/memberManagement/exchangeRecordOperation",
});
},
getNodeListAPI() {
getNodeList().then((res) => {
this.nodeList = res.data
})
this.nodeList = res.data;
});
},
handleExchangeRedeemType(id) {
return this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING).filter(
(item) => item.value == id
)[0]
)[0];
},
// 兑换入口
handleExchangeEntrance(id) {
return this.getDictDatas(DICT_TYPE.PLATFORM_TYPE).filter(
(item) => item.value == id
)[0]
)[0];
},
// 兑换状态
handleExchangeStatus(id) {
return this.getDictDatas(DICT_TYPE.REWARD_REDEEM_STATUS).filter(
(item) => item.value == id
)[0]
)[0];
},
handleClose(done) {
this.$confirm(this.$t('确认关闭?'))
this.$confirm(this.$t("确认关闭?"))
.then((_) => {
done()
done();
})
.catch((_) => {})
.catch((_) => {});
},
handleSelectionChange(val) {
this.selectedMember = val
this.selectedMember = val;
this.batchVerifyForm.ids = val.map((item) => {
return item.id
})
return item.id;
});
},
dialogBeforeClose() {
this.loading = true
this.loading = true;
this.queryParams = {
country: null,
city: null,
......@@ -746,37 +751,37 @@ export default {
pageSize: 10,
startTime: null,
usedScore: null,
usedScoreOperate: null
}
usedScoreOperate: null,
};
},
handleQuery() {
this.queryParams.pageNo = 1
const params = { ...this.queryParams }
this.queryParams.pageNo = 1;
const 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];
}
queryMemberExchangeRecord(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() {
const params = { ...this.queryParams }
const 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];
}
queryMemberExchangeRecord(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 = {
country: null,
city: null,
......@@ -788,10 +793,10 @@ export default {
pageSize: 10,
startTime: null,
usedScore: null,
usedScoreOperate: null
}
this.handleQuery()
}
}
}
usedScoreOperate: null,
};
this.handleQuery();
},
},
};
</script>
......@@ -325,7 +325,7 @@ export default {
pointsRequireSymbol: null,
pickMethod: null,
nodeId: null,
status: null,
status: "1",
remark: null,
quantityRemainSymbol: null,
quantityRemain: null,
......@@ -363,7 +363,7 @@ export default {
pointsRequireSymbol: null,
pickMethod: null,
nodeId: null,
status: null,
status: "1",
remark: null,
quantityRemainSymbol: null,
quantityRemain: null,
......@@ -478,7 +478,7 @@ export default {
level: null,
source: null,
customerService: null,
status: null,
status: "1",
department: null,
creditLevel: null,
country: null,
......
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