Commit 7a156482 by peii

feat

parent 55ab9255
Showing with 12 additions and 31 deletions
......@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/order/self.tsx
* @Author: peii
* @Date: 2021-07-13 22:40:12
* @LastEditTime: 2022-11-02 19:41:00
* @LastEditTime: 2022-11-04 15:16:13
* @LastEditors: PEII
* @Vision: 1.0
* @Description: 自助下单
......@@ -35,6 +35,7 @@ type IProps = {
type IState = {
data: { [key: string]: any[] }
formItems: IFormField[]
doctorNames: []
}
class SelfOrder extends Component<IProps, IState> {
......@@ -282,13 +283,17 @@ class SelfOrder extends Component<IProps, IState> {
* @return {*}
*/
setBillToSitesCallback() {
const { formItems, data } = this.state
const { formItems, data, doctorNames } = this.state
const { billToSiteCode } = data
const item = getFormItem(formItems, 'shipToSiteCode')
const billItem = getFormItem(formItems, 'billToSiteCode')
const billToSiteItem = R.find(R.propEq('value', billToSiteCode))(billItem.options || [])
doctorNames = R.compose(R.uniq, R.pluck('customer_name'))(billToSiteItem.shipToSites)
const doctorItem = getFormItem(formItems, 'doctorName')
doctorItem.options = R.map(R.applySpec({ label: R.identity, value: R.identity }))(doctorNames)
item.options = R.compose(
R.map(
R.applySpec({
......@@ -299,7 +304,7 @@ class SelfOrder extends Component<IProps, IState> {
),
)(billToSiteItem.shipToSites || [])
this.setState({ formItems })
this.setState({ formItems, doctorNames })
}
/**
......@@ -308,36 +313,12 @@ class SelfOrder extends Component<IProps, IState> {
* @return {*}
*/
setShipToSiteCallback() {
const { formItems, data } = this.state
const { sellerCode, orgCode, customerCode, billToSiteCode, shipToSiteCode } = data
const { formItems, data } = this.state
const { billToSiteCode } = data
const item = getFormItem(formItems, 'doctorName')
const shipItem = getFormItem(formItems, 'shipToSiteCode')
const billToSiteItem = R.find(R.propEq('value', billToSiteCode))(billItem.options || [])
item.options = R.map(
R.applySpec({
label: R.prop('ship_to_site_name'),
value: R.prop('ship_to_site_code'),
doctorName: R.prop('customer_doctor'),
}),
)(billToSiteItem.shipToSites || [])
this.setState({ formItems })
// const doctors = this.props.orgStore.doctors(sellerCode, orgCode, customerCode, billToSiteCode)
// const item = getFormItem(formItems, 'doctorName')
// item.options = doctors
// this.setState({ formItems })
const { shipToSiteCode } = this.state.data
// 借货仓库依赖收货地址
// if (isNotBlank(shipToSiteCode)) {
// this.getInventories()
// }
if (isNotBlank(shipToSiteCode)) {
this.getInventories()
}
}
/**
......
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 sign in to comment