1) 修复key批次新建不能选择对象绑定
This commit is contained in:
parent
49ac172d38
commit
aafce8ea5d
|
@ -225,6 +225,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
|||
sessionStorage.setItem("keyType", 2);
|
||||
// 1.1 获取归属计划下拉框数据
|
||||
await getPlanList().then((arr) => {
|
||||
console.log("arr =>1", arr);
|
||||
// 1.2 优惠券管理判断是新增还是编辑
|
||||
if (editData && editData !== "") {
|
||||
setState({ isEdit: true });
|
||||
|
@ -232,7 +233,11 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
|||
let plan_row = arr.find(
|
||||
(item) => item.text === editData.plan_title
|
||||
);
|
||||
if (plan_row) {
|
||||
if (
|
||||
plan_row &&
|
||||
plan_row !== undefined &&
|
||||
plan_row !== "undefined"
|
||||
) {
|
||||
setForm_info_data({
|
||||
plan_id: plan_row,
|
||||
});
|
||||
|
@ -240,7 +245,6 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
|||
setState({
|
||||
direct_reseller_id: plan_row.key.reseller_id,
|
||||
});
|
||||
}
|
||||
// 1.5 设置归属计划key
|
||||
getKey(plan_row.key.key).then((arr_key) => {
|
||||
let el_key = arr_key.find(
|
||||
|
@ -250,6 +254,8 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
|||
setForm_info_data({ key_batch_id: el_key });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 1.6 设置其它数据
|
||||
editFun();
|
||||
|
||||
|
@ -559,7 +565,6 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
|||
(item) => !item.checked && (item.goods_id || item.only.goods_id)
|
||||
)
|
||||
.map((item) => {
|
||||
console.log("item =>", item);
|
||||
if (item.type === 1) {
|
||||
return item.goods_id;
|
||||
} else {
|
||||
|
@ -799,7 +804,6 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
|||
table_index: index,
|
||||
});
|
||||
} else {
|
||||
console.log("rowData =>", rowData);
|
||||
setState({
|
||||
product_title: "编辑商品",
|
||||
productData: rowData,
|
||||
|
|
|
@ -127,7 +127,9 @@ export default class acclist extends React.Component {
|
|||
product_title: "新建商品",
|
||||
addIsType: "",
|
||||
keyCodeId: "", //key批次ID
|
||||
keyType: 1,
|
||||
keyType: sessionStorage.getItem("isKeyAdd")
|
||||
? Number(sessionStorage.getItem("isKeyAdd"))
|
||||
: 1,
|
||||
couponData: [],
|
||||
Column: [
|
||||
{
|
||||
|
@ -1554,7 +1556,11 @@ export default class acclist extends React.Component {
|
|||
<FormItem labelname="绑定类型" prop="bind_object" id="bind_object">
|
||||
<Radio.Group
|
||||
value={this.state.keyType}
|
||||
disabled={this.state.isEdit}
|
||||
disabled={
|
||||
this.state.isEdit || sessionStorage.getItem("isKeyAdd")
|
||||
? true
|
||||
: false
|
||||
}
|
||||
onChange={(e) => {
|
||||
this.onCheckChange(e);
|
||||
}}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue