fix: 新建商品新增完成

This commit is contained in:
zhangds 2022-10-21 17:09:25 +08:00
parent 28b15a22b4
commit dc40ac8587
2 changed files with 13 additions and 5 deletions

View File

@ -55,9 +55,7 @@ const UseGoodsScopePop = forwardRef((props, ref) => {
const format_knockGold_model = () => {
let new_tableData = tableData;
let form_model = knockGold_el.current.state.form_data;
let table_obj = knockGoldFun(form_model);
if (product_title === "编辑立减金") {
if (table_index !== -1) {
table_obj.checked = false;
@ -67,7 +65,6 @@ const UseGoodsScopePop = forwardRef((props, ref) => {
} else {
new_tableData.push(table_obj);
}
return new_tableData;
};

View File

@ -7,7 +7,6 @@ import React, {
} from "react";
import { Select, ImageUpload, RadioButton, RadioGroup, Notify } from "zent";
import { useSetState } from "ahooks";
import { FixedSizeList } from "react-window";
import _ from "lodash";
import Ipt from "@/components/input/main";
@ -70,6 +69,7 @@ const UseProductPop = forwardRef((props, ref) => {
productDataAll: [], //
productPic: [],
isUpdatePic: false,
isProductSelect: false,
});
const [model, setModel] = useSetState({
cur_product: {},
@ -122,17 +122,26 @@ const UseProductPop = forwardRef((props, ref) => {
reseller_id: directResellerId,
type: productType,
};
setState({
isProductSelect: true,
});
getProductInfoSelect(param).then((res) => {
handelResponse(
res,
(req, msg) => {
console.log("商品数据 =>", req);
setState({
isProductSelect: false,
});
setState({
productDataAll: req.data,
});
productListEl(req.data);
},
(err) => {
setState({
isProductSelect: false,
});
console.log("err =>", err);
}
);
@ -404,7 +413,9 @@ const UseProductPop = forwardRef((props, ref) => {
options={state.productOption}
placeholder="请选择商品"
value={model.cur_product}
disabled={model.code_batch_id ? true : false}
disabled={
model.code_batch_id || state.isProductSelect ? true : false
}
onChange={(e) => {
onProductChange(e);
}}