Commit d1ef5c42 by Denglingling

完善自助下单

parent 9c9fbe5d
...@@ -11,7 +11,7 @@ import LodingModel from '../common/LodingModel'; ...@@ -11,7 +11,7 @@ import LodingModel from '../common/LodingModel';
import DateModel from '../common/DateModel'; import DateModel from '../common/DateModel';
import { AudioRecorder, AudioUtils } from 'react-native-audio'; import { AudioRecorder, AudioUtils } from 'react-native-audio';
import Sound from 'react-native-sound'; import Sound from 'react-native-sound';
import { requestSelfOrganizations, requestSelfSurgeryHospital, requestSelfOrderType, requestSelfTemplateCollect, requestSelfAudio, requestSelfSumbit, setSelfInitData, reqSelfSurgeryHospital, requestListDataSuccess, requestSelfSurgeryType, setSelectProductOpts } from '../../action/SelfAction'; import { requestSelfOrganizations, requestSelfSurgeryHospital, requestSelfOrderType, requestSelfTemplateCollect, requestSelfAudio, requestSelfSumbit, setSelfInitData, reqSelfSurgeryHospital, requestListDataSuccess, requestSelfSurgeryType, setSelectProductOpts, reqSelfOrganizations } from '../../action/SelfAction';
import { exitLoginStatus } from '../../action/LoginAction'; import { exitLoginStatus } from '../../action/LoginAction';
import { SELF_ORDER_LIST_DOING, SELF_ORDER_LIST_SUCCESS, SELF_ORDER_LIST_FAILURE, LOGIN_NO, SELF_SUBMIT_DOING, SELF_SUBMIT_SUCCESS, SELF_SUBMIT_FAILURE } from '../../base/ActionTypes'; import { SELF_ORDER_LIST_DOING, SELF_ORDER_LIST_SUCCESS, SELF_ORDER_LIST_FAILURE, LOGIN_NO, SELF_SUBMIT_DOING, SELF_SUBMIT_SUCCESS, SELF_SUBMIT_FAILURE } from '../../base/ActionTypes';
import PageListArrow from '../common/listDataComponent/PageListArrow'; import PageListArrow from '../common/listDataComponent/PageListArrow';
...@@ -22,6 +22,7 @@ import NotEnoughModel from '../common/NotEnoughModel'; ...@@ -22,6 +22,7 @@ import NotEnoughModel from '../common/NotEnoughModel';
import ImagePicker from 'react-native-image-picker'; import ImagePicker from 'react-native-image-picker';
import ZoomPictureModel from '../common/ZoomPictureModel'; import ZoomPictureModel from '../common/ZoomPictureModel';
import { uploadTransImg } from '../../action/TransAction'; import { uploadTransImg } from '../../action/TransAction';
import moment from 'moment';
class SelfOrderPage extends Component { class SelfOrderPage extends Component {
constructor(props) { constructor(props) {
...@@ -74,9 +75,9 @@ class SelfOrderPage extends Component { ...@@ -74,9 +75,9 @@ class SelfOrderPage extends Component {
// }, // },
{ {
"id": "6", "id": "6",
title: '手术时间', title: '需求时间',
name: '请选择', name: moment(new Date()).format("YYYY-MM-DD HH:mm"),
value: '', value: moment(new Date()).format("YYYY-MM-DD HH:mm"),
dateValue: new Date(), dateValue: new Date(),
showDatePicker: true showDatePicker: true
}, },
...@@ -100,11 +101,11 @@ class SelfOrderPage extends Component { ...@@ -100,11 +101,11 @@ class SelfOrderPage extends Component {
lines: [], lines: [],
sub_lines: [], sub_lines: [],
replace_item_flag: 'N', // 器械包 replace_item_flag: 'N', // 器械包
take_cert_flag: 'N' // 注册 take_cert_flag: 'N' // 合格
}, },
{ {
"id": "9", "id": "9",
title: '需要携带注册证', title: '需要携带合格证',
// name: '', // name: '',
value: '', value: '',
isRedio: '' // 单选 isRedio: '' // 单选
...@@ -188,6 +189,7 @@ class SelfOrderPage extends Component { ...@@ -188,6 +189,7 @@ class SelfOrderPage extends Component {
this.props.setSelectProductOpts([]) this.props.setSelectProductOpts([])
this.getSellerName() this.getSellerName()
this.getAudioAuthorize() this.getAudioAuthorize()
this.getOrganizationData()
} }
// 赋值销售员 初始化数据 // 赋值销售员 初始化数据
...@@ -605,6 +607,40 @@ class SelfOrderPage extends Component { ...@@ -605,6 +607,40 @@ class SelfOrderPage extends Component {
props.requestSelfOrganizations(params) props.requestSelfOrganizations(params)
}) })
} }
async getOrganizationData() {
let { state, props } = this
let params = {
access_token: props.token
}
let that = this
let { global_domain_config } = props
let orgResult = await reqSelfOrganizations(global_domain_config, params);
if (orgResult.error_code == 0) {
let { data: { organizations } } = orgResult
let { listOptionData } = state
props.requestListDataSuccess(organizations)
let filterOpt = dedupQuoteArray(organizations, 'org_code')
if (filterOpt.length === 0) {
show(`当前${listOptionData[1].title}为空`)
return
}
if (filterOpt.length === 1) {
listOptionData[1].name = filterOpt[0].org_name
listOptionData[1].value = filterOpt[0].org_code
that.setState({
listOptionData
}, () => {
that.organizationGetCustomerData()
})
}
} else if (orgResult.error_code == 41006) {
show('登录过期,请重新登录');
props.exitLoginStatus();
} else {
let error_msg = orgResult.error_msg || orgResult.message
show(error_msg);
}
}
// 客户名称 点击 // 客户名称 点击
handleCustomerCheck(curData) { handleCustomerCheck(curData) {
...@@ -644,14 +680,14 @@ class SelfOrderPage extends Component { ...@@ -644,14 +680,14 @@ class SelfOrderPage extends Component {
let cusResult = await reqSelfSurgeryHospital(global_domain_config, params); let cusResult = await reqSelfSurgeryHospital(global_domain_config, params);
if (cusResult.error_code == 0) { if (cusResult.error_code == 0) {
let { data: { customers } } = cusResult let { data: { customers } } = cusResult
let { listOptionData } = state
props.requestListDataSuccess(customers) props.requestListDataSuccess(customers)
let filterOpt = dedupQuoteArray(customers, 'customer_code') let filterOpt = dedupQuoteArray(customers, 'customer_code')
if (filterOpt.length === 0) { if (filterOpt.length === 0) {
show(`当前客户名称为空`) show(`当前${listOptionData[2].title}为空`)
return return
} }
if (filterOpt.length === 1) { if (filterOpt.length === 1) {
let { listOptionData } = state
listOptionData[2].name = filterOpt[0].customer_name listOptionData[2].name = filterOpt[0].customer_name
listOptionData[2].value = filterOpt[0].customer_code listOptionData[2].value = filterOpt[0].customer_code
that.setState({ that.setState({
...@@ -709,7 +745,7 @@ class SelfOrderPage extends Component { ...@@ -709,7 +745,7 @@ class SelfOrderPage extends Component {
let tempLocalOption = localCustomersOption.filter(item => item.customer_code === listOptionData[2].value) let tempLocalOption = localCustomersOption.filter(item => item.customer_code === listOptionData[2].value)
tempLocalOption = dedupQuoteArray(tempLocalOption, 'bill_to_site_code') tempLocalOption = dedupQuoteArray(tempLocalOption, 'bill_to_site_code')
if (tempLocalOption.length === 0) { if (tempLocalOption.length === 0) {
show(`当前收单地点为空`) show(`当前${listOptionData[3].title}为空`)
return return
} }
if (tempLocalOption.length === 1) { if (tempLocalOption.length === 1) {
...@@ -759,7 +795,7 @@ class SelfOrderPage extends Component { ...@@ -759,7 +795,7 @@ class SelfOrderPage extends Component {
let tempLocalOption = localCustomersOption.filter(item => item.customer_code === listOptionData[2].value) let tempLocalOption = localCustomersOption.filter(item => item.customer_code === listOptionData[2].value)
tempLocalOption = dedupQuoteArray(tempLocalOption, 'ship_to_site_code') tempLocalOption = dedupQuoteArray(tempLocalOption, 'ship_to_site_code')
if (tempLocalOption.length === 0) { if (tempLocalOption.length === 0) {
show(`当前收货地点为空`) show(`当前${listOptionData[4].title}为空`)
return return
} }
if (tempLocalOption.length === 1) { if (tempLocalOption.length === 1) {
...@@ -921,7 +957,7 @@ class SelfOrderPage extends Component { ...@@ -921,7 +957,7 @@ class SelfOrderPage extends Component {
} }
} }
// 需要携带注册证 / 自动更换同品不同器械包 点击 // 需要携带合格证 / 自动更换同品不同器械包 点击
handleCertAndItemCheck(curData, certFlag) { handleCertAndItemCheck(curData, certFlag) {
console.log('更新', curData, certFlag) console.log('更新', curData, certFlag)
let { listOptionData } = this.state let { listOptionData } = this.state
...@@ -1325,7 +1361,7 @@ class SelfOrderPage extends Component { ...@@ -1325,7 +1361,7 @@ class SelfOrderPage extends Component {
// if (showPackageTip) { // if (showPackageTip) {
// this.refs.PackageModel.show() // this.refs.PackageModel.show()
// } else { // } else {
// this.refs.CertModel.show('需要携带注册证?') // this.refs.CertModel.show('需要携带合格证?')
// } // }
} }
...@@ -1403,7 +1439,7 @@ class SelfOrderPage extends Component { ...@@ -1403,7 +1439,7 @@ class SelfOrderPage extends Component {
// listOptionData: listOptionData // listOptionData: listOptionData
// }) // })
// if (typeName === 'replace_item_flag') { // if (typeName === 'replace_item_flag') {
// this.refs.CertModel.show('需要携带注册证?') // this.refs.CertModel.show('需要携带合格证?')
// } else { // } else {
// this.submitSelfOrder() // this.submitSelfOrder()
// } // }
......
...@@ -103,7 +103,7 @@ class ChooseProductPage extends Component { ...@@ -103,7 +103,7 @@ class ChooseProductPage extends Component {
let params = { let params = {
access_token: token, access_token: token,
org_code: cur_org_code, org_code: cur_org_code,
supplier_type: 'MANUFACTURER,M&O', // 供应商 supplier_type: 'MANUFACTURER,M%26O', // 供应商
filter_flag: 'Y', // 过滤标识 filter_flag: 'Y', // 过滤标识
} }
console.log('params=', params) console.log('params=', params)
...@@ -182,6 +182,8 @@ class ChooseProductPage extends Component { ...@@ -182,6 +182,8 @@ class ChooseProductPage extends Component {
let that = this let that = this
let { topProcOptionList, topActiveIndex } = that.state let { topProcOptionList, topActiveIndex } = that.state
let { token, global_domain_config, navigation } = that.props let { token, global_domain_config, navigation } = that.props
that.handleChangeThrShow(false)
if (leftItem[LocalVariable.SELECTED_QUQNTITY] !== 0) { if (leftItem[LocalVariable.SELECTED_QUQNTITY] !== 0) {
that.setState({ that.setState({
leftActiveIndex: leftIndex leftActiveIndex: leftIndex
...@@ -927,7 +929,8 @@ const styles = StyleSheet.create({ ...@@ -927,7 +929,8 @@ const styles = StyleSheet.create({
width: pxSize(14), width: pxSize(14),
height: pxSize(14), height: pxSize(14),
marginRight: 4, marginRight: 4,
marginLeft: 6 marginLeft: 6,
marginBottom: 5
}, },
cont_left_tit: {}, cont_left_tit: {},
cont_left_noicon: { cont_left_noicon: {
......
...@@ -171,6 +171,7 @@ class ProductRightStyle extends Component { ...@@ -171,6 +171,7 @@ class ProductRightStyle extends Component {
curThridObj: curThridObj, curThridObj: curThridObj,
rowSingleData: curRowData rowSingleData: curRowData
}) })
this.props.changeThrShow(show)
} else { } else {
// 小类点击标题 // 小类点击标题
if (curThridObj.superItem) { if (curThridObj.superItem) {
...@@ -187,12 +188,14 @@ class ProductRightStyle extends Component { ...@@ -187,12 +188,14 @@ class ProductRightStyle extends Component {
that.setState({ that.setState({
thridIsVisible: show thridIsVisible: show
}) })
this.props.changeThrShow(show)
} }
} }
} }
// 计算后的回调 - 头/行 // 计算后的回调 - 头/行
handleCalCallBack(item, index, dataName, coutFieName) { handleCalCallBack(item, index, dataName, coutFieName) {
let that = this
// 除了耗材小类的回调 // 除了耗材小类的回调
if (dataName && this.state[dataName]) { if (dataName && this.state[dataName]) {
let curDataName = this.state[dataName] let curDataName = this.state[dataName]
...@@ -200,7 +203,11 @@ class ProductRightStyle extends Component { ...@@ -200,7 +203,11 @@ class ProductRightStyle extends Component {
this.setState({ this.setState({
[dataName]: curDataName [dataName]: curDataName
}) })
if (coutFieName) { if(dataName === 'rowSingleData'){
// 小类
that.changeThrShow(true)
}
if(coutFieName) {
// 计算==头 // 计算==头
let sumCount = 0 let sumCount = 0
curDataName.map(item => { curDataName.map(item => {
......
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