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