fix: key批次优惠券
This commit is contained in:
parent
57e0cc6dfe
commit
c75b9c4a01
|
@ -57,7 +57,7 @@ const UseKeyAddEdit = () => {
|
||||||
recall_visible: false,
|
recall_visible: false,
|
||||||
audit_visible: false,
|
audit_visible: false,
|
||||||
key_status: -1,
|
key_status: -1,
|
||||||
keyType: 1,
|
keyType: Number(sessionStorage.getItem("keyType")),
|
||||||
rowIndex: -1,
|
rowIndex: -1,
|
||||||
distdata: [],
|
distdata: [],
|
||||||
couponData: [],
|
couponData: [],
|
||||||
|
@ -178,6 +178,8 @@ const UseKeyAddEdit = () => {
|
||||||
reseller: {},
|
reseller: {},
|
||||||
payment_direction: ["对私账户", "对公账户", "预付款扣除"],
|
payment_direction: ["对私账户", "对公账户", "预付款扣除"],
|
||||||
payType: 3,
|
payType: 3,
|
||||||
|
copyKeyCodeId: "",
|
||||||
|
reseller_id: "",
|
||||||
});
|
});
|
||||||
const keyFormEl = useRef(null);
|
const keyFormEl = useRef(null);
|
||||||
const bindObjEl = useRef(null);
|
const bindObjEl = useRef(null);
|
||||||
|
@ -193,6 +195,7 @@ const UseKeyAddEdit = () => {
|
||||||
stock: "",
|
stock: "",
|
||||||
merge_stock: 1,
|
merge_stock: 1,
|
||||||
mobile_excel: "",
|
mobile_excel: "",
|
||||||
|
mobile_repeat: [],
|
||||||
});
|
});
|
||||||
//#endRegion data ***************************/
|
//#endRegion data ***************************/
|
||||||
|
|
||||||
|
@ -219,22 +222,23 @@ const UseKeyAddEdit = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const init = () => {
|
const init = () => {
|
||||||
// KeyPcType 1编辑 2复制 3新增
|
let planItem = sessionStorage.getItem("plan_item");
|
||||||
if (state.KeyPcType === "3") {
|
if (planItem) {
|
||||||
setState({
|
let planObj = JSON.parse(planItem);
|
||||||
pageTitle: "新增key",
|
console.log("plan item =>", planObj);
|
||||||
|
setModel({
|
||||||
|
plan_title: planObj.title,
|
||||||
});
|
});
|
||||||
let planItem = sessionStorage.getItem("plan_item");
|
setState({
|
||||||
if (planItem) {
|
plan_id: planObj.id,
|
||||||
let obj = JSON.parse(planItem);
|
reseller_id: planObj.reseller_id,
|
||||||
console.log("plan item =>", obj);
|
});
|
||||||
setModel({
|
// KeyPcType 1编辑 2复制 3新增
|
||||||
plan_title: obj.title,
|
if (state.KeyPcType === "3") {
|
||||||
});
|
|
||||||
setState({
|
setState({
|
||||||
plan_id: obj.plan_id,
|
pageTitle: "新增key",
|
||||||
});
|
});
|
||||||
getResellerFun(obj.reseller_id);
|
getResellerFun(state.reseller_id);
|
||||||
}
|
}
|
||||||
} else if (state.KeyPcType === "1") {
|
} else if (state.KeyPcType === "1") {
|
||||||
setState({
|
setState({
|
||||||
|
@ -439,7 +443,7 @@ const UseKeyAddEdit = () => {
|
||||||
style: model.style,
|
style: model.style,
|
||||||
quantity: model.quantity,
|
quantity: model.quantity,
|
||||||
bind_object: [state.keyType],
|
bind_object: [state.keyType],
|
||||||
|
copy_key_batch_id: state.copyKeyCodeId,
|
||||||
allow_repetition: model.allow_repetition,
|
allow_repetition: model.allow_repetition,
|
||||||
allow_loss: model.allow_loss,
|
allow_loss: model.allow_loss,
|
||||||
|
|
||||||
|
@ -459,7 +463,6 @@ const UseKeyAddEdit = () => {
|
||||||
create_param.coupon = data;
|
create_param.coupon = data;
|
||||||
}
|
}
|
||||||
console.log("大提交 =>", create_param);
|
console.log("大提交 =>", create_param);
|
||||||
return;
|
|
||||||
addKeysBatchInfo(state.plan_id, create_param).then((res) => {
|
addKeysBatchInfo(state.plan_id, create_param).then((res) => {
|
||||||
handelResponse(
|
handelResponse(
|
||||||
res,
|
res,
|
||||||
|
|
|
@ -310,7 +310,7 @@ export default class acclist extends React.Component {
|
||||||
(req, msg) => {
|
(req, msg) => {
|
||||||
console.log("req =>", req);
|
console.log("req =>", req);
|
||||||
if (req.data.length > 0) {
|
if (req.data.length > 0) {
|
||||||
sessionStorage.setItem("bind_object", req.data[0].bind_object[0]);
|
sessionStorage.setItem("keyType", req.data[0].bind_object[0]);
|
||||||
}
|
}
|
||||||
const newData = req.data.map((item) => {
|
const newData = req.data.map((item) => {
|
||||||
if (![4, 5].includes(item.status)) {
|
if (![4, 5].includes(item.status)) {
|
||||||
|
@ -339,7 +339,7 @@ export default class acclist extends React.Component {
|
||||||
// this.getKeyList();
|
// this.getKeyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
clickFn2222() {
|
clickFn22() {
|
||||||
this.props.history.push("/home/exchangecode-add");
|
this.props.history.push("/home/exchangecode-add");
|
||||||
sessionStorage.setItem("pathname2", "/home/exchangecode-add");
|
sessionStorage.setItem("pathname2", "/home/exchangecode-add");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue