Commit 143227ff authored by chenwei's avatar chenwei

问题汇总修改

parent 7dbfdb1d
......@@ -116,3 +116,12 @@ export function bulkConversion(data) {
data,
});
}
//获取仓库列表下拉框
export function getWarehouseList(data) {
return request({
url: "/ecw/warehouse/list-all-simple",
method: "post",
data,
});
}
......@@ -4520,6 +4520,7 @@
"领取方式": "Collection method",
"兑换网点": "Exchange outlet",
"请选择兑换网点": "Please select an exchange outlet",
"请选择提货点": "Please select a pickup warehouse",
"剩余数量": "Remaining Quantity",
"礼品ID": "Gift ID",
"允许兑换次数": "Allow redemption times",
......
......@@ -52,19 +52,25 @@
<el-row :gutter="10" v-for="(item, index) in queryParams.nodeIds">
<el-col :span="6">
<el-form-item
:label="$t('兑换网点')"
:prop="`nodeIds[${index}].nodeId`"
:rules="rules.nodeIds.nodeId"
:label="$t('提货点')"
:prop="`nodeIds[${index}].wareHouses`"
:rules="rules.nodeIds.wareHouses"
>
<el-select
v-model="item.nodeId"
:placeholder="$t('请选择兑换网点')"
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 nodeList"
v-for="nodeItem in warehouseList"
:key="nodeItem.id"
:label="isChinese ? nodeItem.titleZh : nodeItem.titleEn"
:value="nodeItem.id"
......@@ -84,6 +90,21 @@
: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>
</el-col>
<el-col :span="1">
<el-button
type="primary"
......@@ -92,15 +113,7 @@
></el-button>
</el-col>
</el-row>
<el-form-item :label="$t('剩余数量')" prop="quantityRemain">
<el-input
class="input-item-width"
:disabled="isDisable && disabelEnableStatus"
v-model.trim="queryParams.quantityRemain"
:placeholder="$t('请输入')"
type="number"
/>
</el-form-item>
<el-form-item :label="$t('活动时间')" prop="dateRangeCreateTime">
<el-date-picker
:disabled="isDisable"
......@@ -192,7 +205,11 @@
</template>
<script>
import { editRewards, addRewards } from "@/api/ecw/giftManagement";
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";
......@@ -286,16 +303,17 @@ export default {
},
data() {
return {
loading: false,
queryParams: {
allowCount: null,
endTime: null,
imgEn: null,
imgZh: null,
nodeIds: [{ nodeId: "", points: "" }],
nodeIds: [{ wareHouses: "", points: "", quantityRemain: null }],
nodeId: null,
pickMethod: null,
pointsRequire: null,
quantityRemain: null,
remarkEn: null,
remarkFr: null,
remarkZh: null,
......@@ -306,6 +324,7 @@ export default {
dateRangeCreateTime: null,
},
disabelEnableStatus: false,
warehouseList: [],
rules: {
titleZh: [
{
......@@ -334,7 +353,7 @@ export default {
},
],
nodeIds: {
nodeId: [
wareHouses: [
{
required: true,
message: this.$t("请选择网点"),
......@@ -349,15 +368,15 @@ export default {
},
{ type: "number", message: "输入数字", trigger: "blur" },
],
quantityRemain: [
{
required: true,
message: this.$t("请输入剩余数量"),
trigger: "blur",
},
],
},
quantityRemain: [
{
required: true,
message: this.$t("请输入剩余数量"),
trigger: "blur",
},
],
pickMethod: [
{
required: true,
......@@ -399,7 +418,16 @@ export default {
},
};
},
created() {
this.handleWarehouseList();
},
methods: {
handleWarehouseList(val = "") {
let params = { title: val };
getWarehouseList(params).then((res) => {
this.warehouseList = res.data;
});
},
handleOrderVRule(item, index) {
if (index == "0") {
this.queryParams.nodeIds.push({ nodeId: "", points: "" });
......@@ -409,24 +437,29 @@ export default {
},
submit() {
let params = { ...this.queryParams };
params.startTime = this.queryParams.dateRangeCreateTime[0];
params.endTime = this.queryParams.dateRangeCreateTime[1];
params.startTime = this.queryParams?.dateRangeCreateTime?.[0];
params.endTime = this.queryParams?.dateRangeCreateTime?.[1];
params.pickMethod = this.queryParams.pickMethod.toString();
this.$refs["queryForm"].validate((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();
});
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();
});
} else {
//Add
addRewards(params).then((res) => {
this.$emit("update:show", false);
this.$message.success(this.$t("成功"));
this.$refs["queryForm"].resetFields();
});
}
} else {
//Add
addRewards(params).then((res) => {
this.$emit("update:show", false);
this.$message.success(this.$t("成功"));
this.$refs["queryForm"].resetFields();
});
console.log("error submit!!");
return false;
}
});
},
......@@ -437,7 +470,7 @@ export default {
this.queryParams = {
allowCount: null,
endTime: null,
nodeIds: [{ nodeId: "", points: "" }],
nodeIds: [{ wareHouses: "", points: "", quantityRemain: null }],
imgEn: null,
imgZh: null,
nodeId: null,
......
......@@ -47,10 +47,10 @@
/>
</el-form-item>
<el-form-item :label="$t('兑换网点')" prop="level">
<el-form-item :label="$t('提货点')" prop="level">
<el-select
v-model="queryParams.nodeId"
:placeholder="$t('请选择兑换网点')"
:placeholder="$t('请选择提货点')"
clearable
size="small"
@change="handleQuery"
......@@ -221,7 +221,12 @@
<template slot-scope="scope">
<el-button
type="text"
@click="$router.push('/memberManagement/exchangeRecord')"
@click="
$router.push({
path: '/memberManagement/exchangeRecord',
query: { rewardCode: scope.row.code },
})
"
>{{ scope.row.exchangeCount }}</el-button
>
</template>
......@@ -360,12 +365,12 @@
</template>
<script>
import {
getNodeList,
getGiftList,
deleteRewards,
copyRewardsAPI,
changeRewardsStatus,
delayRewards,
getWarehouseList,
} from "@/api/ecw/giftManagement";
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import { parseTime } from "../../../utils/ruoyi";
......@@ -535,7 +540,8 @@ export default {
.catch(() => {});
},
getNodeList() {
getNodeList().then((res) => {
let params = { title: "" };
getWarehouseList(params).then((res) => {
this.nodeList = res.data;
});
},
......
......@@ -159,6 +159,9 @@
v-if="cascaderState"
style="width: 400px"
:options="regionTreeList"
@change="selectHandle"
@expand-change="selectExpand"
collapse-tags
v-model="queryParams.extraOrderV.receiveAddrList"
:props="cascaderProps"
clearable
......@@ -588,8 +591,6 @@ 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 &&
......@@ -848,6 +849,8 @@ export default {
],
},
},
lastSelectedList: [], //上一次选中数据
oneDimensionalList: [],
queryParams: {
dateRangeCreateTime: [], //活动有效期
type: "", //指标类型
......@@ -941,14 +944,15 @@ export default {
},
created() {
this.handleGetChannelList();
this.handleGetRegionTreeList();
this.getList();
if (this.$route.query.pageStatus == "edit") {
this.handleIntegralRuleDetails();
}
if (this.$route.query.pageStatus == "view") {
} else if (this.$route.query.pageStatus == "view") {
this.showViewTime = true;
this.handleIntegralRuleDetails();
} else {
this.handleGetRegionTreeList();
}
},
activated() {},
......@@ -963,6 +967,13 @@ export default {
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]];
}
integralRuleUpdated(params).then((res) => {
this.$message.success(this.$t("更新成功"));
this.$router.go(-1);
......@@ -984,6 +995,7 @@ export default {
return b === null ? a : undefined;
}
);
params.createTime = parseTime(res.data.createTime);
params.updateTime = parseTime(res.data.updateTime);
......@@ -1008,7 +1020,14 @@ export default {
parseTime(res.data.endTime),
];
if (
params.type == 1 &&
params.extraOrderV.receiveAddrList[0].toString() == "0,0,0"
) {
params.extraOrderV.receiveAddrList = [["000"]];
}
this.queryParams = { ...params };
this.handleGetRegionTreeList();
});
},
handleSelectBannerDialog() {
......@@ -1057,7 +1076,6 @@ export default {
},
//保存
handleSaveIntegralRule() {
console.log("23333");
this.$refs["queryForm"].validate((valid) => {
if (valid) {
let params = deepClone(this.queryParams);
......@@ -1067,6 +1085,12 @@ export default {
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);
......@@ -1088,6 +1112,12 @@ export default {
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);
......@@ -1115,21 +1145,164 @@ export default {
this.channelList = res.data;
});
},
selectExpand(val) {
console.log("PPPPPPP", val);
},
selectHandle(val, defaultStatus = false) {
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)));
} else {
// 取消选中
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] || "" : "";
if (currentValue == "000") {
if (this.judgetAllSelected(val)) {
this.traverseTree(this.regionTreeList); //获取全选时回显的数据
} else {
this.queryParams.extraOrderV.receiveAddrList = []; //不选
}
} else {
this.queryParams.extraOrderV.receiveAddrList = val; //半选
}
if (!defaultStatus) {
this.checkIsAddAllSelected();
}
// this.$nextTick(() => {
//
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 list = this.regionTreeList; // 原始数据列表
if (this.oneDimensionalList.length === 0) {
this.getTreeList(list); // 把所有的父子级平铺成一个一级列表
}
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"
)
);
//设置半选样式,setTimeout可以解决样式渲染不上的问题
setTimeout(function () {
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";
} 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";
}
}
},
getTreeList(list) {
let _this = this;
for (let i = 0; i < list.length; i++) {
let a = list[i];
if (a.id !== "000") {
this.oneDimensionalList.push(list[i]);
}
if (a.children && a.children.length > 0) {
let res = _this.getTreeList(a.children);
if (res) {
return res;
}
}
}
},
judgetAllSelected(node) {
// 判断是否是全选,也就是看已选择的选中中包不包含"全选"
let isAllSelected = false;
for (let i = 0; i < node.length; i++) {
if (node[i][0] == "000") {
isAllSelected = true;
break;
}
}
return isAllSelected;
},
traverseTree(list, parentNode = []) {
list.length > 0 &&
list.forEach((e) => {
let pNode = deepClone(parentNode);
if (e.children && e.children.length > 0) {
pNode.push(e.id); // 1 11
this.traverseTree(e.children, pNode);
} else {
if (parentNode.length > 0) {
this.queryParams.extraOrderV.receiveAddrList.push([
...parentNode,
e.id,
]);
} else {
this.queryParams.extraOrderV.receiveAddrList.push([e.id]);
}
}
});
},
//获取目的仓列表
handleGetRegionTreeList() {
getRegionTreeList().then((res) => {
this.regionTreeList = res.data;
this.regionTreeList.unshift({
id: "000",
labelZh: "全选",
labelEn: "select ALL",
});
this.$nextTick(() => {
this.selectHandle(this.queryParams.extraOrderV.receiveAddrList, true);
});
});
},
traverseTree(tree, newVal) {
for (let node of tree) {
node.labeluu = newVal ? node.labelZh : node.labelEn;
if (node.children && node.children.length > 0) {
this.traverseTree(node.children); // 递归遍历子节点
}
}
return tree;
},
//积分来源
handleSourceType(id) {
return this.getDictDatas(DICT_TYPE.SCORE_RULE_TYPE).filter(
......
......@@ -516,6 +516,16 @@ export default {
return this.$i18n.locale === "zh_CN";
},
},
watch: {
"$route.query.rewardCode": {
handler(val) {
if (val) {
this.queryParams.rewardCode = val;
}
},
immediate: true,
},
},
created() {
this.getNodeListAPI();
this.handleQuery();
......
......@@ -55,10 +55,10 @@
</dict-selector>
</el-form-item>
<el-form-item :label="$t('兑换网点')" prop="level">
<el-form-item :label="$t('提货点')" prop="level">
<el-select
v-model="queryParams.nodeId"
:placeholder="$t('请选择兑换网点')"
:placeholder="$t('请选择提货点')"
clearable
size="small"
@change="handleQuery"
......@@ -190,7 +190,7 @@
{{ handlePickMethod(row.pickMethod) }}
</template>
</el-table-column>
<el-table-column :label="$t('兑换网点')" align="center">
<el-table-column :label="$t('提货点')" align="center">
<template v-slot="{ row }">
{{
isChinese
......@@ -279,6 +279,7 @@ import {
copyRewardsAPI,
changeRewardsStatus,
delayRewards,
getWarehouseList,
} from "@/api/ecw/giftManagement";
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import { parseTime } from "@/utils/ruoyi";
......@@ -438,7 +439,8 @@ export default {
},
getNodeList() {
getNodeList().then((res) => {
let params = { title: "" };
getWarehouseList(params).then((res) => {
this.nodeList = res.data;
});
},
......
......@@ -11,7 +11,7 @@
:inline="true"
:rules="rules"
:disabled="viewRecordDisable"
label-width="168px"
label-width="148px"
>
<el-card class="box-card">
<div slot="header" class="clearfix">
......@@ -129,7 +129,7 @@
>
</dict-selector>
</el-form-item>
<el-form-item :label="$t('费用')">
<el-form-item class="expenses" :label="$t('费用')">
<el-row :gutter="10">
<el-col :span="12">
<el-form-item prop="expenses">
......@@ -163,7 +163,7 @@
</el-col>
</el-row>
</el-form-item>
<el-form-item :label="$t('收件人姓名')"
<el-form-item :label="$t('收件人姓名')"
><el-input
:placeholder="$t('请输入收件人姓名')"
clearable
......@@ -171,9 +171,7 @@
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item
:label="$t('收件人电话')"
>
<el-form-item :label="$t('收件人电话')">
<el-input
:placeholder="$t('请输入收件人电话')"
clearable
......@@ -381,18 +379,14 @@ export default {
};
var expensesCurrency = (rule, value, callback) => {
if (this.queryParamsList[0].expenses && !value) {
return callback(
new Error(this.$t("请选择币种"))
);
return callback(new Error(this.$t("请选择币种")));
} else {
return callback();
}
};
var expensesValidate =(rule, value, callback) => {
var expensesValidate = (rule, value, callback) => {
if (this.queryParamsList[0].currency && !value) {
return callback(
new Error(this.$t("请输入"))
);
return callback(new Error(this.$t("请输入")));
} else {
return callback();
}
......@@ -473,15 +467,15 @@ export default {
trigger: "blur",
},
{
validator:expensesValidate,
validator: expensesValidate,
trigger: "change",
}
},
],
currency: [
{
// required: true,
// message: this.$t("请选择币种"),
validator:expensesCurrency,
validator: expensesCurrency,
trigger: "change",
},
],
......@@ -554,7 +548,6 @@ export default {
methods: {
getDetails() {
memberUserGet({ id: this.$route.query.memberId }).then((r) => {
console.log(r, "rrrr");
// this.details = r.data;
this.isChinese
? (this.queryParamsList[0].memberName = r.data.nickname)
......@@ -681,12 +674,15 @@ export default {
}
this.queryParamsList[0].pointsRequire = item.pointsRequire;
this.queryParamsList[0].rewardCount = "";
this.queryParamsList[0].rewardCount = "1";
this.queryParamsList[0].spendCredit = "";
this.queryParamsList[0].remainingPoints =
this.queryParamsList[0].holdScore;
this.quantityComputation =
this.queryParamsList[0].remainingPoints >= 0 ? true : false;
// if (this.queryParamsList[0].holdScore) {
this.handleRewardCount({}, 0, 1);
// }
},
handleSelectMember() {
this.dialogVisible = true;
......@@ -802,10 +798,16 @@ export default {
color: red;
font-size: 14px;
}
::v-deep .exchangeRecordOperation{
.el-input{
width: 206px;
}
::v-deep .exchangeRecordOperation {
.el-input,
.upload-file {
width: 286px;
}
.expenses {
.el-form-item--small.el-form-item {
margin-bottom: 0;
}
}
}
.card-title {
padding-right: 10px;
......
......@@ -140,7 +140,13 @@
v-loading="loading"
:data="integrationRuleList"
>
<el-table-column :label="$t('编号')" align="center" prop="code" />
<el-table-column :label="$t('编号')" align="center">
<template #default="{ row }">
<el-button size="mini" type="text" @click="handleViewDetails(row)">
{{ row.code || "/" }}</el-button
>
</template>
</el-table-column>
<el-table-column width="140" :label="$t('指标类型')" align="center">
<template slot-scope="scope">
{{
......@@ -213,12 +219,12 @@
</el-table-column>
<el-table-column width="220px" :label="$t('操作')" align="center">
<template slot-scope="scope">
<el-button
<!-- <el-button
size="mini"
type="text"
@click="handleViewDetails(scope.row)"
>{{ $t("查看") }}</el-button
>
> -->
<el-button
size="mini"
type="text"
......
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