Commit a4bd954d authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

Merge branch 'dev' into test

parents ed793325 e4825f7f
......@@ -92,7 +92,6 @@ const company: React.FC<parmas> = (props) => {
const [selectRow, setSelectRow] = useState<Item[]>([]) // 模态框选择的行数据
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
useEffect(() => {
console.log(id, pageStatus, '100000')
let _title = pageStatus === PageStatus.PREVIEW ? '查看' : id ? '编辑' : '新建'
setHeaderTitle(`${_title}物流公司`)
PublicApi.getMemberManageRoleList().then(res => {
......
......@@ -96,8 +96,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
* @return:
*/
useEffect(() => {
let id = history.location.query.id
let {id , isSee} = history.location.query
let _title = history.location.query.isSee ? '查看' :
Number(id) === 0 ? '新建' : '编辑'
......@@ -127,8 +126,8 @@ const diaLogForm: React.FC<ListProps> = (props) => {
})
}
return () => {
if(isSee) {
setFormIsHalfFilledOut(false)
}
}, [])
const List: string[] = [ChinaImg, gou, japenImg, korenImg, us]
......
......@@ -8,56 +8,97 @@ const AddGoods: React.FC<{}> = () => {
const columns: ColumnType<any>[] = [
{
title: 'ID',
key: 'productId',
dataIndex: 'productId'
},
{
title: '商品名称',
key: 'productName',
dataIndex: 'productName'
},
{
title: '品类',
key: 'categoryName',
dataIndex: 'categoryName'
},
{
title: '品牌',
key: 'brandName',
dataIndex: 'brandName'
},
{
title: '单位',
key: 'unitName',
dataIndex: 'unitName'
},
{
title: '数量',
key: 'amount',
dataIndex: 'amount',
render: (text: any, record: any) =>
<Input />
},
{
title: '箱数',
key: 'carton',
dataIndex: 'carton',
render: (text: any, record: any) =>
<Input />
},
{
title: '重量 (KG)',
key: 'weight',
dataIndex: 'weight',
render: (text: any, record: any) =>
<Input />
},
{
title: '体积 (M3)',
key: 'volume',
dataIndex: 'volume',
render: (text: any, record: any) =>
<Input />
},
{
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) =>
<Input />
}
]
/**选择商品弹框表头 */
const columnsTable: ColumnType<any>[] = [
{
title: 'ID',
key: 'productId',
dataIndex: 'productId'
},
{
title: '商品名称',
key: 'productName',
dataIndex: 'productName'
},
{
title: '品类',
key: 'categoryName',
dataIndex: 'categoryName'
},
{
title: '品牌',
key: 'brandName',
dataIndex: 'brandName'
}
]
/**获取商品列表 */
const fetchProductList = (params:any) => {
return new Promise(resolve => {
})
}
return (
<>
<Button block type='dashed' style={{ marginBottom: '24px' }}><PlusOutlined />添加商品</Button>
......@@ -67,6 +108,12 @@ const AddGoods: React.FC<{}> = () => {
<Col span={8}><Statistic title="总重量(KG)" value={112893} /></Col>
<Col span={8}><Statistic title="总体积(M3)" value={112893} /></Col>
</Row>
{/* 选择商品弹框 */}
{/* <ModalTable
modalTitle='选择商品'
columns={columnsTable}
fetchTableData={params => fetchProductList(params)}
/> */}
</>
)
}
......
......@@ -111,6 +111,7 @@ const Deatail: React.FC<{}> = () => {
const [totalWeight, setTotalWeight] = useState(0)
const [totalCarton, setTotalCarton] = useState(0)//箱数
const [editable, setEditable] = useState(true)
const [loading, setloading] = useState(false);
const columns: ColumnType<any>[] = [
{
title: '序号',
......@@ -274,7 +275,7 @@ const Deatail: React.FC<{}> = () => {
useEffect(() => {
// let _title = pageStatus === PageStatus.PREVIEW ? '查看' : id ? '编辑' : '新建'
// setHeaderTitle(`${_title}物流单`)
PublicApi.getLogisticsSelectListCompany({cooperateType: '1'}).then(res => {
PublicApi.getLogisticsSelectListCompany({ cooperateType: '1' }).then(res => {
let list = []
res.data.forEach(item => {
list.push({ value: item.id, label: item.name })
......@@ -289,7 +290,7 @@ const Deatail: React.FC<{}> = () => {
})
setshipperAddress(list)
})
//详情
if (id) {
PublicApi.getLogisticsOrderWaitSubmitGet({ id: id }).then(res => {
......@@ -302,8 +303,8 @@ const Deatail: React.FC<{}> = () => {
console.log('query', query)
//从销售订单来
if (query.orderId) {
PublicApi.getOrderPurchaseOrderDetails({id: query.orderId}).then(res => {
if(res.code === 1000) {
PublicApi.getOrderPurchaseOrderDetails({ id: query.orderId }).then(res => {
if (res.code === 1000) {
actions.setFieldValue('receiverName', res.data.receiverName)
}
})
......@@ -334,8 +335,8 @@ const Deatail: React.FC<{}> = () => {
}
})
return
}
if(query.invoicesId){//订单
}
if (query.invoicesId) {//订单
PublicApi.getOrderLogisticsOrderList({
current: '1',
pageSize: '100000'
......@@ -390,22 +391,22 @@ const Deatail: React.FC<{}> = () => {
properties: {
category: {
type: 'string',
"x-component": 'Input',
"x-component": 'Select',
"x-component-props": {
placeholder: '请输入品类',
// className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
// fetchSearch: PublicApi.getProductSelectGetSelectCustomerCategory,
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetSelectCustomerCategory,
style: {
width: 160
}
}
},
},
brand: {
type: 'string',
"x-component": 'Input',
"x-component-props": {
placeholder: '请输入品牌',
// fetchSearch: PublicApi.getProductSelectGetSelectBrand,
fetchSearch: PublicApi.getProductSelectGetSelectBrand,
style: {
width: 160
}
......@@ -459,6 +460,7 @@ const Deatail: React.FC<{}> = () => {
const FormSubmit = (values: any) => {
let value = { ...values }
console.log(value)
setloading(true)
if (query.orderId) {//销售订单过来的
// value['orderId'] = query.orderId
// value['orderDeliveryDetailsId'] = query.orderDeliveryDetailsId
......@@ -476,6 +478,8 @@ const Deatail: React.FC<{}> = () => {
history.goBack()
}, 1000)
}
}).catch(error => {
setloading(false)
})
} else {//原页面 物流进来
......@@ -488,6 +492,8 @@ const Deatail: React.FC<{}> = () => {
history.goBack()
}, 1000)
}
}).catch(error => {
setloading(false)
})
} else {
value['relevanceType'] = Number(relevanceType)
......@@ -497,6 +503,8 @@ const Deatail: React.FC<{}> = () => {
history.goBack()
}, 1000)
}
}).catch(error => {
setloading(false)
})
}
}
......@@ -555,7 +563,7 @@ const Deatail: React.FC<{}> = () => {
let detailData = [...value]
computedALL(detailData)
})
}
/**
......@@ -564,12 +572,12 @@ const Deatail: React.FC<{}> = () => {
* @return {type}
*/
const computedALL = (data) => {
let _totalCarton = 0, _totalVolume = 0, _totalWeight = 0
if (data && data.length > 0) {
console.log('全部',data)
console.log('全部', data)
data.forEach(v => {
if (v.amount && v.carton) {
_totalCarton += Number(v.carton)
......@@ -582,7 +590,7 @@ const Deatail: React.FC<{}> = () => {
}
});
}
setTotalCarton(_totalCarton)
setTotalVolume(_totalVolume)
setTotalWeight(_totalWeight)
......@@ -641,20 +649,20 @@ const Deatail: React.FC<{}> = () => {
const handleConfirmProduct = () => {
console.log('goodRowCtl', goodRowCtl)
let list = [...goodRowCtl.selectRow]
list.forEach((val:any) => {
if(!val.hasOwnProperty('amount')){
list.forEach((val: any) => {
if (!val.hasOwnProperty('amount')) {
val['amount'] = null
}
if(!val.hasOwnProperty('carton')){
if (!val.hasOwnProperty('carton')) {
val['carton'] = null
}
if(!val.hasOwnProperty('weight')){
if (!val.hasOwnProperty('weight')) {
val['weight'] = null
}
if(!val.hasOwnProperty('volume')){
if (!val.hasOwnProperty('volume')) {
val['volume'] = null
}
})
actions.setFieldValue("detailList", goodRowCtl.selectRow)
setvisibleObj({ ...visibleObj, ModalSeletOrder3: false })
......@@ -705,7 +713,7 @@ const Deatail: React.FC<{}> = () => {
onBack={() => history.goBack()}
title={headerTitle}
backIcon={<ReturnEle description='返回' />}
extra={<Button type="primary" onClick={() => actions.submit()}> 保存</Button>}
extra={<Button type="primary" onClick={() => actions.submit()} loading={loading}> 保存</Button>}
>
<Card>
<Row>
......@@ -874,7 +882,7 @@ const Deatail: React.FC<{}> = () => {
[
{
// pattern:''
message:'请输入数值'
message: '请输入数值'
}
]
}
......
......@@ -51,8 +51,8 @@ const PendingSubmit: React.FC<{}> = () => {
render: (text: any, record: any) => format(text)
}, {
title: '单据时间',
key: 'createTime',
dataIndex: 'createTime',
key: 'voucherTime',
dataIndex: 'voucherTime',
render: (text: any, record: any) => format(text)
}, {
title: '外部状态',
......
......@@ -51,8 +51,8 @@ const PendingSubmitReview: React.FC<{}> = () => {
render: (text: any, record: any) => format(text)
}, {
title: '单据时间',
key: 'createTime',
dataIndex: 'createTime',
key: 'voucherTime',
dataIndex: 'voucherTime',
render: (text: any, record: any) => format(text)
}, {
title: '外部状态',
......
......@@ -49,8 +49,8 @@ const EnquiryOrder: React.FC<{}> = (props) => {
render: (text: any, record: any) => format(text)
}, {
title: '单据时间',
key: 'createTime',
dataIndex: 'createTime',
key: 'voucherTime',
dataIndex: 'voucherTime',
render: (text: any, record: any) => format(text)
}, {
title: '外部状态',
......
......@@ -64,22 +64,30 @@ const AddDemandOrder: React.FC<{}> = () => {
}
})
}).then((res:any) => {
// let obj: any = {}
// for (let key in fetchdata) {
// for (let keys in res) {
// if (key === keys) {
// obj = {
// ...obj, ...{
// [keys]: res[keys]
// }
// }
// }
// }
// }
setfetchdata(res)
})
}
}, [id])
/**获取添加的商品品类id */
const getCategoryIds = (ids:any) => {
const categoryIds: any = [];
const attributeList: any = [];
ids.forEach( v => {
let id = v.ids[v.ids.length - 1];
categoryIds.push([...categoryIds, ...id])
let productAttributeJson = JSON.parse(v.productAttributeJson);
productAttributeJson.forEach(vs => {
console.log(vs)
attributeList.push({
attributeValue: vs
})
})
console.log(categoryIds, attributeList)
})
console.log(ids)
}
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
......@@ -99,6 +107,7 @@ const AddDemandOrder: React.FC<{}> = () => {
<TabPane forceRender tab='添加商品' key='2'>
<AddGoods
set={fetchdata}
onGet={getCategoryIds}
currentRef={goods}
/>
</TabPane>
......
......@@ -15,10 +15,11 @@ const layout: any = {
};
export interface faceSetData {
set?: any,
onGet?: Function,
currentRef: any
}
const AddGoods: React.FC<faceSetData> = (props) => {
const { set, currentRef } = props
const { set, currentRef, onGet } = props
const [form] = Form.useForm();
const [type, setType] = useState<number>(0);
const btnname: Array<string> = ['添加商品', '选择货品', '导入货品']
......@@ -104,6 +105,7 @@ const AddGoods: React.FC<faceSetData> = (props) => {
settabledata([...newdata]);
setidx(-1);
}
onGet([...tabledata, data])
handleModal(type);
}
/** 编辑商品 */
......
......@@ -4,6 +4,7 @@ import { QuestionCircleOutlined, PlusOutlined } from '@ant-design/icons';
import style from './index.less';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { GlobalConfig } from '@/global/config'
import { PublicApi } from '@/services/api';
const layout: any = {
......@@ -21,6 +22,7 @@ const DemandDbutted: React.FC<faceSetData> = (props) => {
const [shopId, setShopId] = useState<Number>(0);
const ref = useRef<any>({});
const [filterParams, setFilterParams] = useState<any>({});
const [goodAllIds, setgoodAllIds] = useState<Array<any>>([]);
// 搜索
const handleSearch = (val: string) => {
let obj = { ...filterParams, name: val }
......@@ -114,15 +116,23 @@ const DemandDbutted: React.FC<faceSetData> = (props) => {
// 切换添加方式
const changeRadio = (e: any) => {
const { value } = e.target;
if(value === 1) {
let shopList = GlobalConfig.web.shopInfo.filter(v => v.type == 1).map(
v => v
)
setgoodAllIds(shopList)
} else {
}
setShopId(value)
}
// 请求系统匹配列表数据
const fetchSystemMateData = (params: any, index: number) => {
if (index === 1) {
console.log(params, index)
} else if (index === 2) {
} else {
return new Promise(resolve => {
PublicApi.getMemberManageUpperProviderPage({ ...filterParams, ...params }).then(res => {
......@@ -146,17 +156,24 @@ const DemandDbutted: React.FC<faceSetData> = (props) => {
</Form.Item>
{shopId === 1 &&
// 发布至平台
<Form.Item label='发布至平台' wrapperCol={{ span: 24 }}>
<Checkbox.Group className={style.checkbox_wrap_style}>
<Form.Item label='发布至平台' name='shopId' wrapperCol={{ span: 24 }}>
<Checkbox.Group className={style.checkbox_wrap_style} onChange={(e) => fetchSystemMateData(e, 1)}>
<Row>
<Col span={6}>
<Checkbox value="A">
<Space>
<Avatar>LOGO</Avatar>
<span>名称</span>
</Space>
</Checkbox>
</Col>
{
goodAllIds.map((v: any, i: number) => {
console.log(v, 1002)
return (
<Col span={6} key={`col_${i}`}>
<Checkbox value={v.id}>
<Space>
<Avatar src={v.logoUrl}>LOGO</Avatar>
<span>{v.name}</span>
</Space>
</Checkbox>
</Col>
)
})
}
</Row>
</Checkbox.Group>
</Form.Item>
......
......@@ -59,8 +59,8 @@ const AddEnquiryOrder: React.FC<{}> = () => {
},
{
title: '单据时间',
key: 'createTime',
dataIndex: 'createTime',
key: 'voucherTime',
dataIndex: 'voucherTime',
render: (text: any) =>
format(text)
},
......
......@@ -48,8 +48,8 @@ const EnquiryOrder: React.FC<{}> = (props) => {
render: (text: any, record: any) => format(text)
}, {
title: '单据时间',
key: 'createTime',
dataIndex: 'createTime',
key: 'voucherTime',
dataIndex: 'voucherTime',
render: (text: any, record: any) => format(text)
}, {
title: '外部状态',
......
......@@ -53,8 +53,8 @@ const AddInquiryOrder: React.FC<{}> = () => {
}, {
title: '单据时间',
key: 'createTime',
dataIndex: 'createTime',
key: 'voucherTime',
dataIndex: 'voucherTime',
render: (text: any, record: any) => format(text)
}, {
title: '外部状态',
......
......@@ -68,8 +68,8 @@ const ReviewList: React.FC<parmas> = (props) => {
},
{
title: '单据时间',
key: 'createTime',
dataIndex: 'createTime',
key: 'voucherTime',
dataIndex: 'voucherTime',
render: (text: any, record: any) => format(text)
},
{
......
......@@ -49,8 +49,8 @@ const EnquiryOrder: React.FC<{}> = (props) => {
render: (text: any, record: any) => format(text)
}, {
title: '单据时间',
key: 'createTime',
dataIndex: 'createTime',
key: 'voucherTime',
dataIndex: 'voucherTime',
render: (text: any, record: any) => format(text)
}, {
title: '外部状态',
......
......@@ -51,8 +51,8 @@ const PendingSubmit: React.FC<{}> = () => {
render: (text: any, record: any) => format(text)
}, {
title: '单据时间',
key: 'createTime',
dataIndex: 'createTime',
key: 'voucherTime',
dataIndex: 'voucherTime',
render: (text: any, record: any) => format(text)
}, {
title: '外部状态',
......
......@@ -49,8 +49,8 @@ const EnquiryOrder: React.FC<{}> = (props) => {
render: (text: any, record: any) => format(text)
}, {
title: '单据时间',
key: 'createTime',
dataIndex: 'createTime',
key: 'voucherTime',
dataIndex: 'voucherTime',
render: (text: any, record: any) => format(text)
}, {
title: '外部状态',
......
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