Commit c69f101a authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:去除干扰样式

parent 63932e52
...@@ -312,11 +312,6 @@ a { ...@@ -312,11 +312,6 @@ a {
margin-right: auto !important; margin-right: auto !important;
} }
// 重置模态框宽度
.ant-modal {
width: 704px !important;
}
// 重置Card样式 // 重置Card样式
.ant-card { .ant-card {
border-radius: 8px !important; border-radius: 8px !important;
......
...@@ -102,7 +102,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => { ...@@ -102,7 +102,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
useEffect(()=>{ useEffect(()=>{
constructedCallback() constructedCallback()
// console.log(productSelectAttribute, 'productSelectAttribute') // console.log(productSelectAttribute, 'productSelectAttribute')
},[productName, selectedGoods, productSelectAttribute, planPrice]) },[productName, selectedGoods, productSelectAttribute, planPrice, tabClickItem])
/* 生成建表所需要的属性 属性值等数组数据 */ /* 生成建表所需要的属性 属性值等数组数据 */
const generateNeedData = (hasAttribute: IProductSelectAttribute[]) => { const generateNeedData = (hasAttribute: IProductSelectAttribute[]) => {
...@@ -194,7 +194,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => { ...@@ -194,7 +194,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
let { _attributeNameArr, _attributeValueArr, _temp_attributeObjArr, _temp_attributeValObjArr } = needObject let { _attributeNameArr, _attributeValueArr, _temp_attributeObjArr, _temp_attributeValObjArr } = needObject
console.log(_priceAttribute, _attributeNameArr, _attributeValueArr, _temp_attributeObjArr, _temp_attributeValObjArr, selectedGoods, '---constructimg---') // 编辑直接进入价格设置 都为空数组 // console.log(_priceAttribute, _attributeNameArr, _attributeValueArr, _temp_attributeObjArr, _temp_attributeValObjArr, selectedGoods, '---constructimg---') // 编辑直接进入价格设置 都为空数组
if(selectedGoods.length>0){ // 编辑情况下 select货品列表可能会采用接口数据 if(selectedGoods.length>0){ // 编辑情况下 select货品列表可能会采用接口数据
_col.push({ _col.push({
...@@ -213,33 +213,35 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => { ...@@ -213,33 +213,35 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
</> </>
}) })
} }
/** 注释原因:编辑时操作货品 没有更新价格属性表格中的货品选项 */ /** fixbug: 编辑情况下 可能不选货品 (借助store中的点击项数据来处理) */
// else if(history.location.query?.id){ // 此时没有货品并且处于编辑状态 取接口返回的数据 else if(history.location.query?.id){ // 此时没有货品并且处于编辑状态 取接口返回的数据
// let _goods: any[] = Object.values(productInfoByEdit.unitPriceAndPicList.map(_ => _.goods)) if(tabClickItem.filter(item => item === '4').length === 1){ // 编辑情况下 第一次点击tab 否则采用页面缓存数据
// if(_goods.indexOf(null)===-1){ let _goods: any[] = Object.values(productInfoByEdit.unitPriceAndPicList.map(_ => _.goods))
// let goodsInApi : any = Object.values(_goods.reduce((item, next)=>{ if(_goods.indexOf(null)===-1){
// item[next.id] = next let goodsInApi : any = Object.values(_goods.reduce((item, next)=>{
// return item item[next.id] = next
// },{})) return item
// if(goodsInApi.length > 0){ },{}))
// _col.push({ if(goodsInApi.length > 0){
// title: '对应货品', _col.push({
// dataIndex: '对应货品', title: '对应货品',
// key: '对应货品', dataIndex: '对应货品',
// width: 360, key: '对应货品',
// render: (text: any, record: any) => <> width: 360,
// <Select style={{width:'100%'}} defaultValue={text} onChange={(v)=> {tableSelelctChange(v, record) }}> render: (text: any, record: any) => <>
// { <Select style={{width:'100%'}} defaultValue={text} onChange={(v)=> {tableSelelctChange(v, record) }}>
// goodsInApi.map(_item => ( {
// <Option key={_item.id} value={_item.id}>{_item.code}/{_item.name}/{_item.type}/¥{_item.costPrice}</Option> goodsInApi.map(_item => (
// )) <Option key={_item.id} value={_item.id}>{_item.code}/{_item.name}/{_item.type}/¥{_item.costPrice}</Option>
// } ))
// </Select> }
// </> </Select>
// }) </>
// } })
// } }
// } }
}
}
if(_attributeNameArr?.length>0){ if(_attributeNameArr?.length>0){
_attributeNameArr.map( _attr => { _attributeNameArr.map( _attr => {
...@@ -285,7 +287,6 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => { ...@@ -285,7 +287,6 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
setAttributeObjArr(_temp_attributeObjArr) setAttributeObjArr(_temp_attributeObjArr)
setAttributeValObjArr(_temp_attributeValObjArr) setAttributeValObjArr(_temp_attributeValObjArr)
// console.log(combineArray, 'SKU组合数据')
let _tableData: any[] = [] let _tableData: any[] = []
if(combineArray?.length>0){ // length存在 表示表格的行数(有价格属性组合) if(combineArray?.length>0){ // length存在 表示表格的行数(有价格属性组合)
combineArray.map((_rowArr: any[], i: any) => { // _rowArr 属性值数组 combineArray.map((_rowArr: any[], i: any) => { // _rowArr 属性值数组
...@@ -295,11 +296,17 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => { ...@@ -295,11 +296,17 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
}) : _tempObj[_attributeNameArr[i]||_attributeNameArr[0]] = _rowArr // 当一项变动的时候 找_attributeNameArr可能会找不到 找不到的情况下置为索引0的那项 }) : _tempObj[_attributeNameArr[i]||_attributeNameArr[0]] = _rowArr // 当一项变动的时候 找_attributeNameArr可能会找不到 找不到的情况下置为索引0的那项
if(history.location.query?.id){ if(history.location.query?.id){
// 编辑的时候,先指定数据中的货品id,如果是重新组合的不存在id就使用选择的货品中的第一个,如果没有置为0;同理,不存在单价就置为{} // 编辑的时候,先指定数据中的货品id,如果是重新组合的不存在id就使用选择的货品中的第一个,如果没有置为0;同理,不存在单价就置为{}
// _tempObj['对应货品'] = selectedGoods.length > 0 ? selectedGoods[0].id : 0 if(tabClickItem.filter(item => item === '4').length > 1){ // 不是初次点击价格属性
_tempObj['对应货品'] = productInfoByEdit.unitPriceAndPicList[i]?.goods?.id || selectedGoods[0]?.id || 0 _tempObj['对应货品'] = selectedGoods.length > 0 ? selectedGoods[0].id : 0
// _tempObj['单价'] = _tableDataSource[i]['单价'] || {}
} else {
_tempObj['对应货品'] = productInfoByEdit.unitPriceAndPicList[i]?.goods?.id || 0
// _tempObj['单价'] = productInfoByEdit?.unitPriceAndPicList[i]?.unitPrice || {}
}
// _tempObj['对应货品'] = productInfoByEdit.unitPriceAndPicList[i]?.goods?.id || selectedGoods[0]?.id || 0
_tempObj['单价'] = productInfoByEdit.unitPriceAndPicList[i]?.unitPrice || {} _tempObj['单价'] = productInfoByEdit.unitPriceAndPicList[i]?.unitPrice || {}
console.log(_tableDataSource, '编辑构建table数据的时候') // console.log(_tableDataSource, '编辑构建table数据的时候')
console.log(tabClickItem, 'store中的点项') // console.log(tabClickItem, 'store中的点项')
// 通过store中的点击项可以判断当前表格的数据是采用接口返回的全局编辑数据还是子模块的局部缓存数据 // 通过store中的点击项可以判断当前表格的数据是采用接口返回的全局编辑数据还是子模块的局部缓存数据
}else{ }else{
_tempObj['对应货品'] = selectedGoods.length > 0 ? selectedGoods[0].id : 0 _tempObj['对应货品'] = selectedGoods.length > 0 ? selectedGoods[0].id : 0
...@@ -314,7 +321,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => { ...@@ -314,7 +321,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
_tempObj['单价'] = productInfoByEdit?.unitPriceAndPicList[0]?.unitPrice || {} _tempObj['单价'] = productInfoByEdit?.unitPriceAndPicList[0]?.unitPrice || {}
_tableData.push(_tempObj) _tableData.push(_tempObj)
} }
console.log(_tableData, '_tableData') // 只有一项 变动情况下表格数据的key获取不到 // console.log(_tableData, '_tableData') // 只有一项 变动情况下表格数据的key获取不到
_tableDataSource = _tableData _tableDataSource = _tableData
// 有前面tab变动引起的二次构建 需要清空价格数据 // 有前面tab变动引起的二次构建 需要清空价格数据
if(updateFlag.current){ if(updateFlag.current){
...@@ -457,7 +464,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => { ...@@ -457,7 +464,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
} }
_tableDataSource = newTabeData _tableDataSource = newTabeData
setTableDataSource(_tableDataSource) setTableDataSource(_tableDataSource)
console.log(_tableDataSource, curretSetPriceRow, v, isBatchSetting, 'setPriceOk') // console.log(_tableDataSource, curretSetPriceRow, v, isBatchSetting, 'setPriceOk')
}) })
} }
......
...@@ -184,6 +184,7 @@ const AccountLists: React.FC<{}> = () => { ...@@ -184,6 +184,7 @@ const AccountLists: React.FC<{}> = () => {
visible={visibleModal} visible={visibleModal}
onOk={handleOK} onOk={handleOK}
onCancel={handleCancel} onCancel={handleCancel}
destroyOnClose={true}
> >
<Form <Form
layout="vertical" layout="vertical"
......
...@@ -265,6 +265,7 @@ const AccountDetail: React.FC<{}> = () => { ...@@ -265,6 +265,7 @@ const AccountDetail: React.FC<{}> = () => {
visible={visibleModal} visible={visibleModal}
onOk={handleOK} onOk={handleOK}
onCancel={handleCancel} onCancel={handleCancel}
destroyOnClose={true}
> >
<Form <Form
layout="vertical" layout="vertical"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment