✨ feat:客户管理70%
This commit is contained in:
@@ -7,19 +7,34 @@ import Popup from '@/components/popup'
|
||||
import { debounce } from '@/common/util'
|
||||
import { alert } from '@/common/common'
|
||||
import { formatPriceDiv, formatDateTime, formatWeightDiv } from '@/common/format'
|
||||
import { ClientListApi } from '@/api/order'
|
||||
import Tabs from "./components/tabs"
|
||||
import Form from "./components/form"
|
||||
import AddressList from "@/components/AddressList"
|
||||
import TagPopup from './components/tagPopup';
|
||||
import { goLink } from '@/common/common'
|
||||
|
||||
import { mppurchaser } from '@/api/customer'
|
||||
export default () => {
|
||||
const router = useRouter()
|
||||
|
||||
const [status, setstatus] = useState<number>(1)
|
||||
|
||||
useDidShow(() => {
|
||||
getInfo()
|
||||
})
|
||||
const [infoObj, setinfoObj] = useState<any>()
|
||||
const { fetchData: getDesc } = mppurchaser()
|
||||
const getInfo = async () => {
|
||||
Taro.showLoading({
|
||||
title: '请稍等...',
|
||||
mask: true
|
||||
})
|
||||
const res = await getDesc({ id: router.params.purchaser_id })
|
||||
setinfoObj(res.data)
|
||||
Taro.hideLoading()
|
||||
}
|
||||
|
||||
//顶部栏
|
||||
const AddressListRef = useRef<any>()
|
||||
const [TarBarList, setTarBarList] = useState<any[]>([{ id: 1, name: '基础信息', showBorder: true }, { id: 2, name: '收货地址', showBorder: false }])
|
||||
const handChose = (item) => {
|
||||
TarBarList.map(it => {
|
||||
@@ -34,6 +49,11 @@ export default () => {
|
||||
// setOrderData(() => ({ list: [], total: 0 }))
|
||||
// setSearchField((val) => ({ ...val, size: 10, status: item.id }))
|
||||
})
|
||||
if (item.id == 2) {
|
||||
Taro.nextTick(() => {
|
||||
AddressListRef.current?.getData()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const [showPopup, setshowPopup] = useState(false)
|
||||
@@ -41,48 +61,48 @@ export default () => {
|
||||
<View className={styles.mainBox}>
|
||||
<View className={styles.mainTop}>
|
||||
<View className={styles.mainUser}>
|
||||
<View className={styles.itemCile}>欧</View>
|
||||
<View className={styles.itemCile}>{infoObj?.name?.[0]}</View>
|
||||
<View className={styles.item_top_one}>
|
||||
<View className={styles.item_top_one_flex}>
|
||||
<View className={styles.itemName}>欧阳斌峰</View>
|
||||
<View className={styles.itemPhone}>133****7761</View>
|
||||
<View className={styles.itemName}>{infoObj?.name}</View>
|
||||
<View className={styles.itemPhone}>{infoObj?.phone}</View>
|
||||
</View>
|
||||
<View className={styles.item_tag_box}>
|
||||
<View className={styles.item_tagItem}>二批</View>
|
||||
<View className={styles.item_tagItem}>二批</View>
|
||||
<View className={styles.item_tagItem}>{infoObj?.sale_user_name}</View>
|
||||
<View className={styles.item_tagAdd} onClick={() => setshowPopup(true)}>
|
||||
<View className={styles.item_add}>+</View>
|
||||
<View className={styles.item_add_font}>标签</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.pos} onClick={() => goLink('/pages/customerEditor/index?id=' + router.params.purchaser_id)}>{'编辑 >'}</View>
|
||||
<View className={styles.pos} onClick={() => goLink('/pages/customerEditor/index?id=' + router.params.purchaser_id + '&type=edit')}>{'编辑 >'}</View>
|
||||
</View>
|
||||
<Tabs list={TarBarList} handChose={(item) => handChose?.(item)}></Tabs>
|
||||
</View>
|
||||
{
|
||||
status === 1 && <View className={styles.formBox}>
|
||||
<Form title={'客户全称'} des={'2222'} ></Form>
|
||||
<Form title={'客户简称'} des={'2222'} ></Form>
|
||||
<Form title={'客户类型'} des={'2222'} ></Form>
|
||||
<Form title={'联系人'} des={'2222'} ></Form>
|
||||
<Form title={'联系电话'} des={'2222'} isPhone></Form>
|
||||
<Form title={'省市区'} des={'2222'} ></Form>
|
||||
<Form title={'详细地址'} des={'2222'} ></Form>
|
||||
<Form title={'业务人员'} des={'2222'} ></Form>
|
||||
<Form title={'客户来源'} des={'2222'} ></Form>
|
||||
<Form title={'备注信息'} des={'2222'} ></Form>
|
||||
<Form title={'下单时间'} des={'2222'} ></Form>
|
||||
<Form title={'创建时间'} des={'2222'} ></Form>
|
||||
<Form title={'创建人'} des={'2222'} ></Form>
|
||||
<Form title={'更新人'} des={'2222'} ></Form>
|
||||
<Form title={'更新时间'} des={'2222'} isBorder={false}></Form>
|
||||
<Form title={'客户全称'} des={infoObj?.name} ></Form>
|
||||
<Form title={'客户简称'} des={infoObj?.short_name} ></Form>
|
||||
<Form title={'客户类型'} des={infoObj?.purchaser_type_name} ></Form>
|
||||
<Form title={'联系人'} des={infoObj?.director} ></Form>
|
||||
<Form title={'联系电话'} des={infoObj?.phone} isPhone></Form>
|
||||
<Form title={'省市区'} des={infoObj?.province_name + infoObj?.city_name + infoObj?.district_name} ></Form>
|
||||
<Form title={'详细地址'} des={infoObj?.address_detail} ></Form>
|
||||
<Form title={'业务人员'} des={infoObj?.sale_user_name} ></Form>
|
||||
<Form title={'客户来源'} des={infoObj?.qqq} ></Form>
|
||||
<Form title={'备注信息'} des={infoObj?.qqqq} ></Form>
|
||||
<Form title={'下单时间'} des={infoObj?.qqq} ></Form>
|
||||
<Form title={'创建时间'} des={infoObj?.qqqq} ></Form>
|
||||
<Form title={'创建人'} des={infoObj?.qqqq} ></Form>
|
||||
<Form title={'更新人'} des={infoObj?.qqqqq} ></Form>
|
||||
<Form title={'更新时间'} des={infoObj?.qqqqq} isBorder={false}></Form>
|
||||
</View>
|
||||
}
|
||||
{
|
||||
status === 2 &&
|
||||
<View className={styles.order_list}>
|
||||
<AddressList refresherEnabled={true} purchaser_id={router.params.id as any} />
|
||||
<AddressList ref={AddressListRef} refresherEnabled={true} purchaser_id={router.params.purchaser_id as any} />
|
||||
</View>
|
||||
}
|
||||
<TagPopup showPopup={showPopup} handClose={() => setshowPopup(false)}></TagPopup>
|
||||
|
||||
Reference in New Issue
Block a user