Commit c8126ce7 by Denglingling

增加对接转单历史查询接口方法,以及布局调整

parent 7e73885b
......@@ -22,11 +22,16 @@ 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'}
// 获取来源借货订单号 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))
}
// 获取目标借货订单/来源借货订单 parmas={access_token: '', seller_code: ''}
export const requestHistorTarOrSourOrd = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/surgery/trans_header/search', params))
}
// 借货订单查询 params: {access_token: '', ...}
export function requestGetAllBorrow(params) {
return (dispatch, getState) => {
......@@ -91,17 +96,18 @@ export const requestGetLineFormConsume = async (global_domain_config, params) =>
return await GetRequest(global_domain_config, getUrlParams('/surgery/consume_line/search', params))
}
// 转单订单查询 params: {access_token: '', ...} ----- 待定
// 转单订单查询 params: {access_token: '', header_status: '', seller_name: '', order_number: '', org_name: '', destination_customer_code: '', source_customer_code: '', source_surgery_date_from: '2020-03-15T00:00:00', source_surgery_date_to: '2020-03-18T00:00:00', source_surgery_order_number: '', destination_surgery_collect_number: '', destination_surgery_date_from: '', destination_surgery_date_to: ''}
export function requestGetAllTrans(params) {
return (dispatch, getState) => {
dispatch(requestSearching())
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('xxxx', params))
GetRequest(global_domain_config, getUrlParams('/surgery/trans_header/search', params))
.then(res => {
console.log('--requestGetAllTrans-----res------', res)
if(res.error_code == 0) {
// let { data: { sur_consume_headers } } = res
// dispatch(requestSearchSuccess(sur_consume_headers));
let { data: { sur_order_transfer_head_chs_v } } = res
dispatch(requestSearchSuccess(sur_order_transfer_head_chs_v));
} else if(res.error_code === 41006) {
show('登录过期,请重新登录');
......@@ -120,9 +126,9 @@ export function requestGetAllTrans(params) {
}
}
// 转单订单-行表查询 params: {access_token: '', xxx: ''} ----- 待定
// 转单订单-行表查询 params: {access_token: '', order_number: ''}
export const requestGetLineFormTrans = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('xxx', params))
return await GetRequest(global_domain_config, getUrlParams('/surgery/trans_line/search', params))
}
function requestSearching() {
......
......@@ -133,9 +133,10 @@ export const requestTransAudio = async (global_domain_config, params) => {
return await UploadRequest(global_domain_config, getUrlParams('/dingding/upload_media', { access_token }), formData)
}
// 子页-获取消耗明细 params={access_token:'', org_code: '', surgery_collect_number: '', item_name: '', serial_number: '', seller_name: '', surgery_name: ''}
// 子页-获取消耗明细 params={access_token:'', org_name: '', seller_name: '' ,surgery_collect_number: '', serial_number: '', surgery_date_from: '2020-06-28T17:54:33', surgery_date_to: '2020-07-02T17:54:33'}
export const requestTransDetails = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/transferSurOrder/sur_order_transfer_line_search', params))
// return await GetRequest(global_domain_config, getUrlParams('/transferSurOrder/sur_order_transfer_line_search', params))
return await GetRequest(global_domain_config, getUrlParams('/transferSurOrder/sur_order_transfer_line_find', params))
}
// 子页-获取组织 params={access_token:''}
......
......@@ -84,7 +84,8 @@ class HistoricalOrderPage extends Component {
isShowSelect: false, // 显示/隐藏 筛选内容
borrowStatus: ['待审核','待出库','待还货','其他'],
consumeStatus: ['待审核','已消耗'],
transferStatus: ['已提交','已完成'],
// transferStatus: ['已提交','已完成'],
transferStatus: ['已输入', '已审批', '已驳回', '已提交', '已取消'],
searchBorrowStatus: [ // 【借货】对应的状态值
"ENTERED,SUBMITTED",
"APPROVED,COLLECTING_WAITING_CONFIRM",
......@@ -96,8 +97,9 @@ class HistoricalOrderPage extends Component {
"Y"
],
searchTransStatus: [ // 【转单】对应的状态值
"N",
"Y"
// "N",
// "Y"
"ENTERED", "APPROVED", "REJECTED", "SUBMITTED", "CANCELED"
],
whetherCallClick: false, // 是否调用筛选弹窗的查询
wheShowNoData: false, // 是否展示无数据提示
......@@ -151,7 +153,8 @@ class HistoricalOrderPage extends Component {
let {
contOptionData, topActiveIndex,
borrowStatus, consumeStatus,
searchBorrowStatus, searchComsumeStatus
searchBorrowStatus, searchComsumeStatus,
transferStatus, searchTransStatus
} = this.state
let {historOrderOption} = this.props
if(!historOrderOption.length) {
......@@ -162,6 +165,7 @@ class HistoricalOrderPage extends Component {
return
}
contOptionData = cloneObject(historOrderOption)
console.log('contOptionData--------', contOptionData)
switch(topActiveIndex) {
case 0:
contOptionData = contOptionData.map((supItem, ind) => {
......@@ -209,10 +213,33 @@ class HistoricalOrderPage extends Component {
})
break;
case 2:
contOptionData = contOptionData.map((supItem, ind) => {
supItem.id = ind+''
supItem.local_his_number = supItem.order_number
if(!supItem.destination_surgery_collect_number) {
supItem.local_his_name = '无'
} else {
supItem.local_his_name = supItem.destination_surgery_collect_number
}
if(!supItem.destination_surgery_date) {
supItem.local_his_time = '无'
} else {
supItem.local_his_time = moment(supItem.destination_surgery_date).format('YYYY/MM/DD HH:mm')
}
for(let i in searchTransStatus) {
if(searchTransStatus[i].includes(supItem.header_status)) {
supItem.local_his_status = transferStatus[i]
break;
}
}
return supItem
})
break;
default:
break;
}
console.log('------contOptionData-------', contOptionData)
this.setState({
contOptionData
})
......@@ -424,6 +451,9 @@ class HistoricalOrderPage extends Component {
} else if(topActiveIndex == 1) {
tempTit = '结单标识:'
tempNum = item.surgery_collect_number // 还是显示借货单号,但是接口还是传递消耗单号
}else if(topActiveIndex == 2) {
tempTit = '目标借货订单:'
tempNum = item.local_his_number
}
return (
......@@ -449,8 +479,8 @@ class HistoricalOrderPage extends Component {
style={[
styles.cont_rig_status,
(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 : ''
(item.local_his_status == '待还货' || item.local_his_status == '已输入' || item.local_his_status == '已驳回') ? styles.status_return : '',
(item.local_his_status == '其他' || item.local_his_status == '已取消') ? styles.status_other : ''
]}>
{item.local_his_status}
</Text>
......
......@@ -212,46 +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);
// }
let that = this
let {consumaData} = that.state
let {props} = this
that.changeSubLoding(true)
let params = {
access_token: props.token,
order_number: supData.order_number
}
let conResult = await requestGetLineFormTrans(props.global_domain_config, params)
console.log('params========', params)
console.log('conResult========', conResult)
if(conResult.error_code == 0) {
that.changeSubLoding(false)
// 成功
let {sur_order_transfer_lines} = conResult.data
let tempSum = 0
let tempConQuanSum = 0
sur_order_transfer_lines.length && sur_order_transfer_lines.forEach(item => {
if(item.sale_price) {
tempSum += Number(item.sale_price)
}
if(item.consumed_quantity) {
tempConQuanSum += Number(item.consumed_quantity)
}
})
consumaData.subOption = [...sur_order_transfer_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);
}
}
// 耗材明细 隐藏/显示子项
......@@ -361,6 +363,8 @@ class LineOrderPage extends Component {
tempTit.push('手术名称:', '手术时间:')
} else if(supIndex == 1) {
tempTit.push('结单标识:', '消耗时间:')
} else if(supIndex == 2) {
tempTit.push('目标借货订单:', '手术时间:')
}
return (
......@@ -370,18 +374,35 @@ class LineOrderPage extends Component {
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
{tempTit[0]}{orderSupOptions.local_his_name}
{
supIndex == 2 ? `(${orderSupOptions.local_his_time})` : null
}
</Text>
</View>
{
supIndex == 2 && orderSupOptions.source_surgery_order_number ?
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
来源借货订单号:{orderSupOptions.source_surgery_order_number}
{
orderSupOptions.source_surgery_date ? `(${moment(orderSupOptions.source_surgery_date).format('YYYY/MM/DD HH:mm')})` : null
}
</Text>
</View> : null
}
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
手术医生:{orderSupOptions.doctor_name ? orderSupOptions.doctor_name : '无'}
</Text>
</View>
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
{tempTit[1]}{orderSupOptions.local_his_time}
</Text>
</View>
{
supIndex !== 2 ?
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
{tempTit[1]}{orderSupOptions.local_his_time}
</Text>
</View> : null
}
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
客户名称:{orderSupOptions.customer_name ? orderSupOptions.customer_name : '无'}
......@@ -389,7 +410,8 @@ class LineOrderPage extends Component {
</View>
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
订单号:{supIndex == 0 ? orderSupOptions.local_his_number : orderSupOptions.surgery_collect_number}
订单号:{supIndex == 0 ? orderSupOptions.local_his_number :
(supIndex == 1 ? orderSupOptions.surgery_collect_number : orderSupOptions.order_number)}
</Text>
</View>
{
......
......@@ -28,7 +28,7 @@ class BarCodePage extends Component {
super(props);
this.state = {
transCode:'', // 条码
typeCode: '', // 条码类型
// typeCode: '', // 条码类型
showCode: true,
// animate: new Animated.Value(0), // 二维坐标{x:0,y:0}
animateCode: new Animated.Value((Width() - 200) / 2,(Height() - 340) / 2),
......@@ -67,7 +67,7 @@ class BarCodePage extends Component {
console.log(e);
that.setState({
transCode: e.data,
typeCode: e.type,
// typeCode: e.type,
showCode: false
})
if(e.data) {
......
......@@ -162,6 +162,7 @@ class TransDetailsModel extends Component {
<TouchableOpacity
activeOpacity={1}
style={styles.top_touch_cont}
key={index}
// onPress={() => this.handleTopNav(item, index)}
>
<View style={[
......
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