1) 修复key批次新建不能选择对象绑定

This commit is contained in:
zhangds 2022-09-26 16:55:27 +08:00
parent 49ac172d38
commit aafce8ea5d
3 changed files with 535 additions and 503 deletions

View File

@ -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,16 +245,17 @@ 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(
(item) => editData.key_batch_id === item.key
);
if (el_key) {
setForm_info_data({ key_batch_id: el_key });
}
});
}
// 1.5 key
getKey(plan_row.key.key).then((arr_key) => {
let el_key = arr_key.find(
(item) => editData.key_batch_id === item.key
);
if (el_key) {
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,

View File

@ -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