Commit a171ade8 authored by XieZhiXiong's avatar XieZhiXiong

Merge branch 'v2-220418' of…

Merge branch 'v2-220418' of ssh://gitlab.shushangyun.com:8122/linkseeks-design/pro-platform into feat-sortable-table
parents ae3b3ce5 6141615e
import { debounceFn, throttleFn } from '@/utils/throttleFn';
import { useDebounce } from '@umijs/hooks';
import { Button, Col, Drawer, Form, FormInstance, Input, Radio, Row, Select, Space } from 'antd';
import React, { useContext, useEffect, useState } from 'react';
import AddressForm from './AddressForm';
......@@ -46,14 +48,42 @@ function AddressDrawer(props: AddressDrawerProps) {
const [addrForm] = Form.useForm(formInstance);
const [addrList, setAddrList] = useState([]);
const handleInputChangeHooks = debounceFn((str) => {
const val: string = str
const reg = /.+?(省|市|自治区|自治州|镇|县|区)/g;
const maths = val.match(reg);
if (maths && maths.length >= 3) {
//至少 拥有省市区 才进行处理
const slice: string = maths[maths.length - 1];
const addressOther: string = val.slice(val.indexOf(slice) + slice.length, val.length)
const otherSplit = addressOther.split(" ");
let propValue = {
provinceName: tryGetMatchValue(maths, 0),
cityName: tryGetMatchValue(maths, 1),
districtName: tryGetMatchValue(maths, 2),
streetName: tryGetMatchValue(maths, 3),
address: tryGetMatchValue(otherSplit, 0),
receiverName: tryGetMatchValue(otherSplit, 1),
phone: tryGetMatchValue(otherSplit, 2),
fullAddress: tryGetMatchValue(maths, 0) + tryGetMatchValue(maths, 1) + tryGetMatchValue(maths, 2) + tryGetMatchValue(maths, 3) + tryGetMatchValue(otherSplit, 0)
}
onChange(propValue)
}
}, 1000);
useEffect(() => {
renderAddressList().then(data => {
if (addr) {
// props 更新 内部状态更新 用于FormItem 的操作
setValue(addr)
let targetValue = `${addr?.fullAddress ?? ''} ${addr?.shipperName ? addr?.shipperName : addr?.receiverName ?? ''} ${addr?.phone ?? ''}`
setValue(targetValue)
} else if (showDefault) {
// 如果没有默认值,且设置了 showDefault
const target = data.find(v=>v.isDefault ===1)
const target = data.find(v => v.isDefault === 1)
setValue(target)
onChange(target)
}
......@@ -96,7 +126,7 @@ function AddressDrawer(props: AddressDrawerProps) {
form={addrForm} />
}
function renderAddressFormBtnGroup() {
const renderAddressFormBtnGroup = () => {
if (showForm) {
return <Button type='primary' onClick={sumbitAddressForm}>提交</Button>
} else {
......@@ -104,11 +134,28 @@ function AddressDrawer(props: AddressDrawerProps) {
}
}
const handleInputChange = (e) => {
const targetValue = e.target.value;
setValue(targetValue)
handleInputChangeHooks(targetValue)
}
const tryGetMatchValue = (maths, i) => {
try {
return maths[i] || ''
} catch {
return ""
}
}
return (
<AddressRaioContextProvider value={addrList}>
<Row gutter={10}>
<Col span={20}>
<Input.TextArea rows={rows} disabled={true} value={`${value?.fullAddress ?? ''} ${value?.shipperName ? value?.shipperName : value?.receiverName ?? ''} ${value?.phone ?? ''}`} />
<Input.TextArea rows={rows} disabled={disabled}
value={value}
onChange={handleInputChange}
/>
</Col>
<Col span={4}>
......
......@@ -81,7 +81,7 @@ function RoleSelect(props: RoleSelectProps) {
<RowStyleLayout>
<Input.Group compact>
<Input value={value?.name} disabled />
<Button type='primary' icon={<LinkOutlined />} disabled={disabled} onClick={showDrawer}>选择</Button>
<Button type='primary' icon={<LinkOutlined />} disabled={disabled} onClick={showDrawer}>选择</Button>
</Input.Group>
</RowStyleLayout>
......@@ -104,11 +104,13 @@ function RoleSelect(props: RoleSelectProps) {
</Form.Item>
<Form.Item name="name">
<Input.Search onSearch={() => {
form.setFieldsValue({ "current": "1" })
setCurrent(1)
fetchData()
}} />
<Input.Search
placeholder="会员名称"
onSearch={() => {
form.setFieldsValue({ "current": "1" })
setCurrent(1)
fetchData()
}} />
</Form.Item>
</Form>
<Radio.Group className="block w-full" onChange={(e) => {
......
......@@ -878,6 +878,7 @@ export default {
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.materialCode' : 'Material number',
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.materialName' : 'Material name',
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.type':'Specification Model',
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.materialGroup':'materialGroup',
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.customerCategory':'Category',
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.brand':'Brand',
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.costPrice':'list price',
......
......@@ -253,6 +253,7 @@ export default {
'detail.purchase.materialCode1': 'Material Number/Summary',
'detail.purchase.materialCode2': 'Material Number/Name',
'detail.purchase.materialName': 'Material name',
'detail.purchase.materialGroup': 'Material Group',
'detail.purchase.memberId': 'Member ID',
'detail.purchase.memberName': 'Member Name',
'detail.purchase.memberType': 'Member Type',
......
......@@ -879,6 +879,7 @@ export default {
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.materialCode' : '재료 번호',
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.materialName' : '재료 이름',
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.type' : '사양 모델',
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.materialGroup':'자재반',
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.customerCategory' : '종류',
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.brand' : '브랜드',
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.costPrice' : '정가',
......
......@@ -253,6 +253,7 @@ export default {
'detail.purchase.materialCode1': '재료 번호/요약',
'detail.purchase.materialCode2': '재료 번호/이름',
'detail.purchase.materialName': '재료 이름',
'detail.purchase.materialGroup': '자재반',
'detail.purchase.memberId': '회원 ID',
'detail.purchase.memberName': '회원명',
'detail.purchase.memberType': '회원 유형',
......
......@@ -888,6 +888,7 @@ export default {
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.materialCode' : '物料编号',
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.materialName' : '物料名称',
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.type' : '规格型号',
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.materialGroup':'物料组',
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.customerCategory' : '品类',
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.brand' : '品牌',
'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.costPrice' : '目录价',
......
......@@ -253,6 +253,7 @@ export default {
'detail.purchase.materialCode1': '物料编号/摘要',
'detail.purchase.materialCode2': '物料编号/名称',
'detail.purchase.materialName': '物料名称',
'detail.purchase.materialGroup': '物料组',
'detail.purchase.memberId': '会员ID',
'detail.purchase.memberName': '会员名称',
'detail.purchase.memberType': '会员类型',
......
......@@ -86,6 +86,11 @@ const SelectGoodsForm: React.FC<{}> = (props) => {
key: 'type',
},
{
title: intl.formatMessage({ id: 'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.materialGroup' }),
dataIndex: ['materialGroup', 'name'],
key: 'materialGroup',
},
{
title: intl.formatMessage({ id: 'commodity.products.addProductsItem.selectGoodsForm.goodsColumns.customerCategory' }),
dataIndex: ['customerCategory', 'name'],
key: 'customerCategory',
......
......@@ -30,6 +30,7 @@ export class HandleFormSubmit {
}
getTableData() {
if(this.#tableData === undefined) return false;
return this.#tableData.map(v => {
return (
{
......@@ -128,6 +129,10 @@ export class HandleFormSubmit {
}
submit() {
if (!this.getTableData()) {
message.error('请选择送货物料');
return;
}
if (this.handleBeforeFields()) return Promise.reject("error");
return this.validateFormFields()
}
......
......@@ -130,7 +130,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
}}
onChange={(val) => {
form.setFieldsValue({
"executorVO.phone": val.phone
"executorVO.phone": val?.phone
})
}}
/>
......
......@@ -5,7 +5,7 @@
*/
import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import React, { useCallback, useEffect, useState, useContext } from 'react'
import { BillsInfo, BuyerLabel, ConsigneeLabel, ConsigneePhoneLabel, ConsigneeTimeLabel, DeliveryAbstractLabel, DeliveryAddrLabel, DeliveryDateLabel, DeliveryGood, DeliveryInfo, DeliveryNameLabel, DeliveryNoLabel, DeliveryPhoneLabel, DeliverySlefAddrLabel, DeliveryTimeLabel, DeliveryTypeLabel, Distribution, LogisticsCarNoLabel, LogisticsCompanyLabel, LogisticsInfo, LogisticsNoLabel, NoteLabel, OutStatusLabel, ReceivingAddress } from '../../constants'
import { BaseInfo, BillsInfo, BuyerLabel, ConsigneeLabel, ConsigneePhoneLabel, ConsigneeTimeLabel, DeliveryAbstractLabel, DeliveryAddrLabel, DeliveryDate, DeliveryDateLabel, DeliveryGood, DeliveryInfo, DeliveryNameLabel, DeliveryNoLabel, DeliveryPhoneLabel, DeliverySlefAddrLabel, DeliveryTime, DeliveryTimeLabel, DeliveryTypeLabel, Distribution, LogisticsCarNoLabel, LogisticsCompanyLabel, LogisticsInfo, LogisticsNoLabel, NoteLabel, OutStatusLabel, ReceivingAddress } from '../../constants'
import { BaseInfo as ContentBox } from '@/components/BaseInfo'
import { Input, Table, Row, Col, Select, Radio, Form, Button } from 'antd';
import { DeliveryNoticeTableColumn } from '../../constants/page-table-column';
......@@ -34,7 +34,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
const service = new DeliveryNoteAddService(form);
const [anchors, setAnchors] = useState<AnchorsItem[]>([
BillsInfo,
BaseInfo,
Distribution,
DeliveryInfo,
LogisticsInfo,
......@@ -73,7 +73,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<Input type="hidden" />
</FormItem>
<ContentBox title={BillsInfo.name} id={BillsInfo.key}>
<ContentBox title={BaseInfo.name} id={BaseInfo.key}>
<FormItem
rules={[
required()
......@@ -108,7 +108,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
rules={[
required()
]}
label={DeliveryDateLabel} name="deliveryTime">
label={DeliveryDate} name="deliveryTime">
<DatePickerSelect defualtToday={true} className='w-full' />
</FormItem>
......@@ -132,7 +132,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
}}
onChange={(val) => {
form.setFieldsValue({
"executorVO.phone": val.phone
"executorVO.phone": val?.phone
})
}}
/>
......@@ -142,7 +142,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
rules={[
required()
]}
label={DeliveryTimeLabel} name="deliveryRangeTime">
label={DeliveryTime} name="deliveryRangeTime">
<DatePickerSelect.RangePicker className="w-full" picker='time' />
</FormItem>
......
......@@ -34,6 +34,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
const [isMro, setIsMro] = useState<boolean>(false)
const userInfo = getAuth()
const shopId = detailInfo?.shopId || detailInfo?.sourceShopId
const MOBILE_ENVIROMENT = [2, 3 ,4]
const getMemberShopAll = async (environment: number, property: number) => {
const params = {
......@@ -104,7 +105,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
if (detailInfo?.environment === 1) {
// 自营商城装修
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/edit?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${shopId}&property=${detailInfo?.property}`
} else if ([2, 3, 4].includes(detailInfo?.environment)) {
} else if (MOBILE_ENVIROMENT.includes(detailInfo?.environment)) {
// 自营商城装修
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/mobile/edit?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${shopId}&environment=${detailInfo?.environment}&property=${detailInfo?.property}`
} else {
......@@ -116,7 +117,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
const shopId = detailInfo?.shopId || detailInfo?.sourceShopId
if(detailInfo?.environment === 1) {
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/preview?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${shopId}&property=${detailInfo?.property}`
} else if ([2, 3, 4].includes(detailInfo?.environment)) {
} else if (MOBILE_ENVIROMENT.includes(detailInfo?.environment)) {
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/mobile/preview?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${shopId}&environment=${detailInfo?.environment}&property=${detailInfo?.property}`
} else {
message.info(intl.formatMessage({ id: 'shop.template.preview.tip' }))
......@@ -191,7 +192,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
</AuthButton>
<AuthButton btnCode='ownMallTemplate.detail.categoryrenovation' >
{
(detailInfo?.environment === 4 || detailInfo?.environment === 3) && (
MOBILE_ENVIROMENT.includes(detailInfo?.environment) && (
<div className={cx(styles.btn, styles.fit)} onClick={() => handleCategoryJump()}>
<LayoutOutlined />
<label>{intl.formatMessage({ id: 'own.template.button.mall.category.edit' })}</label>
......
......@@ -30,7 +30,7 @@ const QuotationDesk: React.FC<QuotationDeskProps> = (props: any) => {
});
return {
value: { min: 0 },
// time: { range: [0, 1] },
time: { range: [0, 1] },
type: {
formatter: v => {
return _obj[v]
......
......@@ -86,12 +86,12 @@ const Detail = () => {
_quotationDesks = socketObj.quotationDesks
}
_quotationDesks.forEach((item) => {
_offerList.push({ type: 'offer', time: formatTimeString(item.offerTime || item.peportTime, 'HH:mm:ss'), value: priceFormat(item.price || item.sumPice, 0) });
_offerList.push({ type: 'offer', time: formatTimeString(item.offerTime || item.peportTime, 'HH:mm:ss'), value: parseInt(priceFormat(item.price || item.sumPice, 0)) });
})
_list.push({ title: intl.formatMessage({ id: 'detail.purchase.quotedAmount' }), type: 'offer', list: _offerList });
if (data.isOpenPurchase) {
_quotationDesks.forEach((item) => {
_minList.push({ type: 'min', time: formatTimeString(item.offerTime || item.peportTime, 'HH:mm:ss'), value: priceFormat(item.minPrice, 0) });
_minList.push({ type: 'min', time: formatTimeString(item.offerTime || item.peportTime, 'HH:mm:ss'), value: parseInt(priceFormat(item.minPrice, 0)) });
})
_list.push({ title: intl.formatMessage({ id: 'detail.purchase.minPrice1' }), type: 'min', list: _minList });
}
......
......@@ -55,7 +55,7 @@ const Management = () => {
setLowestList({
type: 'min',
title: intl.formatMessage({ id: 'detail.purchase.minPrice1' }),
list: _data.awardProcesss ? _data.awardProcesss.map((item) => { return { type: 'min', time: formatTimeString(item.peportTime, 'HH:mm:ss'), value: priceFormat(item.sumPice, 0) } }) : []
list: _data.awardProcesss ? _data.awardProcesss.map((item) => { return { type: 'min', time: formatTimeString(item.peportTime, 'HH:mm:ss'), value: parseInt(priceFormat(item.sumPice, 0)) } }).reverse() : []
})
}
}, [purchaseBiddingMessage])
......@@ -117,7 +117,7 @@ const Management = () => {
setLowestList({
type: 'min',
title: intl.formatMessage({ id: 'detail.purchase.minPrice1' }),
list: data ? data.map((item) => { return { type: 'min', time: formatTimeString(item.peportTime, 'HH:mm:ss'), value: priceFormat(item.sumPice, 0) } }) : []
list: data ? data.map((item) => { return { type: 'min', time: formatTimeString(item.peportTime, 'HH:mm:ss'), value: parseInt(priceFormat(item.sumPice, 0)) } }).reverse() : []
})
})
}
......
......@@ -9,7 +9,12 @@ import Demand from './components/demand';
import File from './components/file';
import ReutrnEle from '@/components/ReturnEle';
import { getAuth } from '@/utils/auth';
import { getPurchasePurchaseInquiryDetails, GetPurchasePurchaseInquiryDetailsResponse, PostPurchasePurchaseInquiryAddRequest, postPurchasePurchaseInquiryAdd, postPurchasePurchaseInquiryUpdate } from '@/services/PurchaseV2Api';
import {
getPurchasePurchaseInquiryDetails,
GetPurchasePurchaseInquiryDetailsResponse,
PostPurchasePurchaseInquiryAddRequest, postPurchasePurchaseInquiryAdd,
postPurchasePurchaseInquiryUpdate
} from '@/services/PurchaseV2Api';
const { TabPane } = Tabs;
......@@ -65,7 +70,7 @@ const AddForm = () => {
...conditionRef.data,
...demandRef.data,
transactionUurls: fileRef.data,
shopType:1,
shopType: 1,
}
let res: {
code: number,
......
......@@ -71,10 +71,15 @@ const Material: React.FC<Iprops> = (props: any) => {
key: 'name',
dataIndex: 'name',
render: (text: any, record: any, index: number) => (
<EyePreview type='button' handleClick={() => handleEdit(record, index, true) } >{text}</EyePreview>
<EyePreview type='button' handleClick={() => handleEdit(record, index, true)} >{text}</EyePreview>
)
},
{
title: intl.formatMessage({ id: 'detail.purchase.materialGroup' }),
key: 'materialGroup',
dataIndex: 'materialGroup',
},
{
title: intl.formatMessage({ id: 'detail.purchase.nameCode' }),
key: 'model',
dataIndex: 'model',
......@@ -131,6 +136,7 @@ const Material: React.FC<Iprops> = (props: any) => {
}
/** 添加列表 */
const fetchTableList = (data: any) => {
console.log(data)
if (Object.keys(data).length > 0) {
if (eidtIndex || eidtIndex === 0) {
dataSource[eidtIndex] = data;
......
......@@ -151,7 +151,7 @@ const AddInquiry = () => {
columns={columns}
effects="purchaseInquiryNo"
fetch={getPurchasePurchaseInquiryShopAddList}
fetchRowkeys={(e) => setRowKeys(e)}
controllerBtns={
<Row>
......
......@@ -144,6 +144,8 @@ const AnchorModal: React.FC<AnchorModalProps> = (props: any) => {
}
if (selectRow.length > 0) {
const data: any = selectRow[0]
console.log(data);
if (data.customerCategory) {
const fullId = data.customerCategory.fullId;
const ids = fullId.replace(/\b(0+)/gi, '').split('.');
......@@ -162,6 +164,7 @@ const AnchorModal: React.FC<AnchorModalProps> = (props: any) => {
model: data.type,
brand: data.brand && data.brand.name,
unit: data.unitName,
goodsGroup: data?.materialGroup?.name
})
setProduct(data);
setSearchVisible(false);
......@@ -179,6 +182,7 @@ const AnchorModal: React.FC<AnchorModalProps> = (props: any) => {
number: Object.keys(product).length > 0 ? product.code : res.number,
name: Object.keys(product).length > 0 ? product.name : res.name,
category: Object.keys(product).length > 0 ? product.customerCategory.name : edit.category,
materialGroup: Object.keys(product).length > 0 ? product?.materialGroup?.name : edit.materialGroup,
ids: res.ids,
categoryId: (Object.keys(product).length > 0 && !isEmpty(product.customerCategory.category)) ? product.customerCategory.category.id : edit.categoryId,
memberCategoryId: Object.keys(product).length > 0 ? product.customerCategory.id : edit.memberCategoryId,
......@@ -229,7 +233,7 @@ const AnchorModal: React.FC<AnchorModalProps> = (props: any) => {
{
title: intl.formatMessage({ id: 'detail.purchase.goodsGroup' }),
key: 'goodsGroup',
dataIndex: 'goodsGroup'
dataIndex: ['materialGroup', 'name']
},
{
title: intl.formatMessage({ id: 'detail.purchase.nameCode' }),
......
......@@ -382,12 +382,16 @@ const StatistticsList: React.FC<{ searchType: string; id: number }> = ({
newParam = {
memberTime: params.memberTime,
memberName: params.memberName,
current: params.current,
pageSize: params.pageSize,
};
} else {
newParam = {
productTime: params.productTime,
commodityName: params.commodityName,
category: params.category,
current: params.current,
pageSize: params.pageSize,
};
}
return fetchListData(newParam);
......
export const throttleFn = (fn, delay) => {
let valid = true
return function (...args) {
if (!valid) {
return false;
}
valid = false;
setTimeout(() => {
fn(...args)
valid = true
}, delay);
}
}
let timer = null;
export const debounceFn = (func, delay) => {
return function (...args) {
if (timer) {
clearTimeout(timer)
}
timer = setTimeout(() => {
func(...args)
}, delay);
}
}
\ No newline at end of file
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