Commit dd130d86 by Denglingling

增加【转单】历史订单查询功能,还未对接后端接口

parent 31a18c1f
......@@ -22,6 +22,11 @@ export const requestHistorOrderType = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/system/value_set/search', params))
}
// 获取来源借货订单号 parmas={access_token: '', org_code: '', seller_code: '', customer_code: '', collect_header_status: 'COLLECTING_WAITING_CONFIRM,CONFIRM_COLLECT,COLLECTED_WAITING_CONFIRMED,APPROVED,COLLECTED'}
export const requestHistorSourBorOrdNum = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/surgery/collect_order/search', params))
}
// 借货订单查询 params: {access_token: '', ...}
export function requestGetAllBorrow(params) {
return (dispatch, getState) => {
......@@ -64,7 +69,6 @@ export function requestGetAllConsume(params) {
if(res.error_code == 0) {
let { data: { sur_consume_headers } } = res
dispatch(requestSearchSuccess(sur_consume_headers));
} else if(res.error_code === 41006) {
show('登录过期,请重新登录');
dispatch(exitLoginStatus());
......@@ -75,7 +79,7 @@ export function requestGetAllConsume(params) {
}
})
.catch(err => {
console.log('------err--====requestGetAllBorrow----', Object.keys(err), err)
console.log('------err--====requestGetAllConsume----', Object.keys(err), err)
show(err.error);
dispatch(requestSearchFail());
})
......@@ -87,8 +91,39 @@ export const requestGetLineFormConsume = async (global_domain_config, params) =>
return await GetRequest(global_domain_config, getUrlParams('/surgery/consume_line/search', params))
}
// 转单订单查询
// 转单订单查询 params: {access_token: '', ...} ----- 待定
export function requestGetAllTrans(params) {
return (dispatch, getState) => {
dispatch(requestSearching())
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('xxxx', params))
.then(res => {
if(res.error_code == 0) {
// let { data: { sur_consume_headers } } = res
// dispatch(requestSearchSuccess(sur_consume_headers));
} else if(res.error_code === 41006) {
show('登录过期,请重新登录');
dispatch(exitLoginStatus());
} else {
let error_msg = res.error_msg || res.message
show(error_msg);
dispatch(requestSearchFail());
}
})
.catch(err => {
console.log('------err--====requestGetAllTrans----', Object.keys(err), err)
show(err.error);
dispatch(requestSearchFail());
})
}
}
// 转单订单-行表查询 params: {access_token: '', xxx: ''} ----- 待定
export const requestGetLineFormTrans = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('xxx', params))
}
function requestSearching() {
return {
......
......@@ -4,7 +4,6 @@ import {
Text,
StyleSheet,
Modal,
ScrollView,
TouchableOpacity,
SafeAreaView
} from 'react-native';
......
......@@ -38,12 +38,17 @@ class HeadBackItem extends Component {
}
goLogin() {
let { navigation } = this.props
let { callback, navigation } = this.props
this.props.exitLoginStatus()
show('退出登录')
setTimeout(() => {
if(callback && callback instanceof Function) {
callback()
setTimeout(() => {
navigation.navigate('LoginPage')
}, 500)
} else {
navigation.navigate('LoginPage')
}, 300)
}
}
render() {
......
......@@ -34,7 +34,8 @@ import {
} from '../../base/ActionTypes';
import {
requestGetAllBorrow,
requestGetAllConsume
requestGetAllConsume,
requestGetAllTrans
} from '../../action/HistorAction';
import { show, cloneObject } from '../../utils/Utils';
import moment from 'moment';
......@@ -56,9 +57,10 @@ class HistoricalOrderPage extends Component {
title: '消耗订单',
selIsAct: false
},
// {
// title: '转单订单'
// }
{
title: '转单订单',
selIsAct: false
}
],
topActiveIndex: 0,
contOptionData: [
......@@ -89,11 +91,14 @@ class HistoricalOrderPage extends Component {
"COLLECTED,RETURNING_WAITING_CONFIRM",
"RETURNED,CLOSED,REJECTED,CANCELED,CONSUMED"
],
searchComsumeStatus: [ // 【借货】对应的状态值
searchComsumeStatus: [ // 【消耗】对应的状态值
"N",
"Y"
],
searchTransStatus: [ // 【转单】对应的状态值
"N",
"Y"
],
searchTransStatus: [], // 【转单】对应的状态值
whetherCallClick: false, // 是否调用筛选弹窗的查询
wheShowNoData: false, // 是否展示无数据提示
......@@ -240,6 +245,7 @@ class HistoricalOrderPage extends Component {
props.requestGetAllConsume(params)
break;
case 2:
props.requestGetAllTrans(params)
break;
default:
break;
......@@ -442,7 +448,7 @@ class HistoricalOrderPage extends Component {
<Text
style={[
styles.cont_rig_status,
item.local_his_status == '待审核' ? styles.status_audit : '',
(item.local_his_status == '待审核' || item.local_his_status == '已提交') ? styles.status_audit : '',
item.local_his_status == '待还货' ? styles.status_return : '',
item.local_his_status == '其他' ? styles.status_other : ''
]}>
......@@ -502,8 +508,8 @@ const styles = StyleSheet.create({
borderBottomWidth: 1
},
top_touch_cont: {
// width: '33.33333%'
width: '50%'
width: '33.33333%'
// width: '50%'
},
top_inner: {
justifyContent: 'center',
......@@ -634,6 +640,9 @@ const mapDispatchToProps = (dispatch) => {
},
requestGetAllConsume: (params) => {
dispatch(requestGetAllConsume(params))
},
requestGetAllTrans: (params) => {
dispatch(requestGetAllTrans(params))
}
}
}
......
......@@ -29,7 +29,8 @@ import { CellTextStyle } from '../../common/CellTextStyle';
import LodingModel from '../../common/LodingModel';
import {
requestGetLineFormBorrow,
requestGetLineFormConsume
requestGetLineFormConsume,
requestGetLineFormTrans
} from '../../../action/HistorAction';
import { connect } from 'react-redux';
import { show } from '../../../utils/Utils';
......@@ -125,6 +126,7 @@ class LineOrderPage extends Component {
break;
case 2:
// 转单
this.getReqTransLineData(data)
break;
default:
break;
......@@ -210,6 +212,48 @@ class LineOrderPage extends Component {
}
}
// 获取转单订单行数据 -- 待定
async getReqTransLineData(supData) {
// let that = this
// let {consumaData} = that.state
// let {props} = this
// that.changeSubLoding(true)
// let params = {
// access_token: props.token,
// consume_order_number: supData.local_his_number
// }
// let conResult = await requestGetLineFormTrans(props.global_domain_config, params)
// if(conResult.error_code == 0) {
// that.changeSubLoding(false)
// // 成功
// let {sur_consume_lines} = conResult.data
// let tempSum = 0
// let tempConQuanSum = 0
// sur_consume_lines.length && sur_consume_lines.forEach(item => {
// if(item.sale_price) {
// tempSum += Number(item.sale_price)
// }
// if(item.consumed_quantity) {
// tempConQuanSum += Number(item.consumed_quantity)
// }
// })
// consumaData.subOption = [...sur_consume_lines]
// consumaData.allOptSum = tempSum
// consumaData.allConmQuanSum = tempConQuanSum
// that.setState({
// consumaData
// })
// } else if(conResult.error_code == 41006) {
// that.changeSubLoding(false)
// show('登录过期,请重新登录');
// props.exitLoginStatus();
// } else {
// that.changeSubLoding(false)
// let error_msg = conResult.error_msg || conResult.message
// show(error_msg);
// }
}
// 耗材明细 隐藏/显示子项
handleDetailBtmCheck(flagType) {
let {consumaData} = this.state
......@@ -403,7 +447,7 @@ class LineOrderPage extends Component {
<View style={styles.fo_sta_inner}>
<Text style={[
styles.fo_sta_txt,
orderSupOptions.local_his_status == '待审核' ? styles.status_audit : '',
(orderSupOptions.local_his_status == '待审核' || orderSupOptions.local_his_status == '已提交') ? styles.status_audit : '',
orderSupOptions.local_his_status == '待还货' ? styles.status_return : '',
orderSupOptions.local_his_status == '其他' ? styles.status_other : ''
]}>
......
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