fix: key批次优惠券

This commit is contained in:
zhangds 2022-10-25 14:23:13 +08:00
parent 57e0cc6dfe
commit c75b9c4a01
2 changed files with 21 additions and 18 deletions

View File

@ -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 = () => {
let planItem = sessionStorage.getItem("plan_item");
if (planItem) {
let planObj = JSON.parse(planItem);
console.log("plan item =>", planObj);
setModel({
plan_title: planObj.title,
});
setState({
plan_id: planObj.id,
reseller_id: planObj.reseller_id,
});
// KeyPcType 1 2 3 // KeyPcType 1 2 3
if (state.KeyPcType === "3") { if (state.KeyPcType === "3") {
setState({ setState({
pageTitle: "新增key", pageTitle: "新增key",
}); });
let planItem = sessionStorage.getItem("plan_item"); getResellerFun(state.reseller_id);
if (planItem) {
let obj = JSON.parse(planItem);
console.log("plan item =>", obj);
setModel({
plan_title: obj.title,
});
setState({
plan_id: obj.plan_id,
});
getResellerFun(obj.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,

View File

@ -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");