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>
......
......@@ -41,7 +41,8 @@ import {
requestHistorOrganizations,
requestHistorSurgeryHospital,
requestHistorOrderType,
requestHistorSourBorOrdNum
requestHistorSourBorOrdNum,
requestHistorTarOrSourOrd
} from '../../../action/HistorAction';
import { show, dedupQuoteArray, cloneObject } from '../../../utils/Utils';
import moment from 'moment';
......@@ -104,7 +105,18 @@ class FilterModel extends Component {
settled_flag: 'Y', // 是否结单 'Y'/'N'
},
transferSearchOption: { // [转单]筛选条件 -- 待定
header_status: '',
seller_code: '',
org_code: '',
destination_customer_code: '',
source_customer_code: '',
destination_surgery_collect_number: '',
source_surgery_order_number: '',
order_number: '',
source_surgery_date_from: '',
source_surgery_date_to: '',
destination_surgery_date_from: '',
destination_surgery_date_to: ''
},
borrowListOptionData: [{ // [借货]筛选-对应字段
"id": "0",
......@@ -230,7 +242,8 @@ class FilterModel extends Component {
"id": "0",
title: '状态筛选',
name: '状态筛选',
status: ['已提交','已完成'],
// status: ['已提交','已完成'],
status: ['已输入', '已审批', '已驳回', '已提交', '已取消'],
curStatus: []
},{
"id": "1",
......@@ -247,64 +260,36 @@ class FilterModel extends Component {
title: '客户名称',
name: '请选择',
value: ''
},{
},
{
"id": "4",
title: '目标借货订单',
name: '请选择',
value: ''
},
{
"id": "5",
title: '来源借货订单号',
name: '请选择',
value: ''
},{
"id": "5",
"id": "6",
title: '申请单号',
name: '请输入',
value: ''
},{
"id": "6",
"id": "7",
title: '手术时间',
name: '开始时间',
value: '',
dateValue: new Date()
},{
"id": "7",
"id": "8",
title: '手术时间',
name: '结束时间',
value: '',
dateValue: new Date()
},
// {
// "id": "1",
// title: '组织',
// name: '请选择',
// value: ''
// }, {
// "id": "2",
// title: '客户名称',
// name: '请选择',
// value: ''
// }, {
// "id": "3",
// title: '主治医生',
// name: '请选择',
// value: '',
// showInput: false,
// inputValue: ''
// }, {
// "id": "4",
// title: '手术类型',
// name: '请选择',
// value: ''
// }, {
// "id": "5",
// title: '手术时间',
// name: '开始时间',
// value: '',
// dateValue: new Date()
// }, {
// "id": "6",
// title: '手术时间',
// name: '结束时间',
// value: '',
// dateValue: new Date()
// }
}
],
subBorrowInitListOption: [], // 初始化 [借货]
subConsumeInitListOption: [], // 初始化 [消耗]
......@@ -338,8 +323,9 @@ class FilterModel extends Component {
"Y"
],
searchTransStatus: [ // 【转单】对应的状态值
"N",
"Y"
// "N",
// "Y"
"ENTERED", "APPROVED", "REJECTED", "SUBMITTED", "CANCELED"
],
errorPopType: false, // 错误提示弹窗
errorTit: '', // 错误提示文字
......@@ -390,12 +376,14 @@ class FilterModel extends Component {
// 默认勾选值
initSelectPickerData() {
let {borrowListOptionData, consumeListOptionData} = this.state
let {borrowListOptionData, consumeListOptionData, transferListOptionData} = this.state
borrowListOptionData[0].curStatus = [0, 1, 2] // 默认勾选【待审核】、【待出库】、【待还货】
consumeListOptionData[0].curStatus = [0] // 默认勾选【待审核】
// transferListOptionData[0].curStatus = [3] // 默认勾选【已提交】
this.setState({
borrowListOptionData,
consumeListOptionData
consumeListOptionData,
// transferListOptionData
})
}
......@@ -980,9 +968,9 @@ class FilterModel extends Component {
case 2:
tempCurTit = '手术时间'
if(typeName == 'start') {
tempCurDate = transferListOptionData[6].dateValue
} else if(typeName == 'end') {
tempCurDate = transferListOptionData[7].dateValue
} else if(typeName == 'end') {
tempCurDate = transferListOptionData[8].dateValue
}
break;
default:
......@@ -1100,6 +1088,62 @@ class FilterModel extends Component {
})
}
// 目标借货订单 - 筛选
handleTargetBorCheck() {
let { transferListOptionData } = this.state
let { props } = this
let that = this
this.setState({
currentTitle: '目标借货订单',
currentItem: {
name: transferListOptionData[4].name,
value: transferListOptionData[4].value
}
}, async() => {
let params = {
access_token: props.token,
seller_code: props.userInfo.user_name
}
console.log('目标借货订单=========params-----', params)
let orgResult = await requestHistorTarOrSourOrd(props.global_domain_config, params)
console.log('orgResult-----', orgResult)
that.props.callSupLoading(true)
if(orgResult.error_code == 0) {
that.props.callSupLoading(false)
// 修改当前选择器数据
let { data: { sur_order_transfer_head_chs_v } } = orgResult
if(sur_order_transfer_head_chs_v.length === 0) {
that.showErrorModel(`目标借货订单为空`)
return
}
let resultArr = []
sur_order_transfer_head_chs_v.forEach(item => {
let obj = {}
let destination_surgery_collect_number = item.destination_surgery_collect_number ? item.destination_surgery_collect_number : '空'
let destination_surgery_date = item.destination_surgery_date ? moment(item.destination_surgery_date).format("YYYY-MM-DD") : '空'
let tempName = `${destination_surgery_collect_number}(${destination_surgery_date})`
obj.name = tempName,
obj.value = item.destination_surgery_collect_number
resultArr.push(obj)
})
resultArr = dedupQuoteArray(resultArr, 'destination_surgery_collect_number')
let tempOption = [...resultArr]
that.setState({
showTypePop: true,
listCurrentOption: [...tempOption]
})
} else if(orgResult.error_code == 41006) {
that.props.callSupLoading(false)
that.showErrorModel(`登录过期,请重新登录`)
props.exitLoginStatus();
} else {
that.props.callSupLoading(false)
let error_msg = orgResult.error_msg || orgResult.message
that.showErrorModel(error_msg);
}
})
}
// 来源借货订单号 - 筛选
handleSourOrdCheck() {
let { transferListOptionData } = this.state
......@@ -1108,38 +1152,37 @@ class FilterModel extends Component {
this.setState({
currentTitle: '来源借货订单号',
currentItem: {
name: transferListOptionData[4].name,
value: transferListOptionData[4].value
name: transferListOptionData[5].name,
value: transferListOptionData[5].value
}
}, async() => {
let params = {
access_token: props.token,
org_code: transferListOptionData[2].value,
seller_code: props.userInfo.user_name,
customer_code: '',
// collect_header_status: 'COLLECTING_WAITING_CONFIRM,CONFIRM_COLLECT,COLLECTED_WAITING_CONFIRMED,APPROVED,COLLECTED'
seller_code: props.userInfo.user_name
}
let orgResult = await requestHistorSourBorOrdNum(props.global_domain_config, params)
console.log('来源借货订单号=========params-----', params)
let orgResult = await requestHistorTarOrSourOrd(props.global_domain_config, params)
console.log('来源借货订单号=====orgResult-----', orgResult)
that.props.callSupLoading(true)
if(orgResult.error_code == 0) {
that.props.callSupLoading(false)
// 修改当前选择器数据
let { data: { surgery_collect_headers } } = orgResult
if(surgery_collect_headers.length === 0) {
that.showErrorModel(`当前来源借货订单号为空`)
let { data: { sur_order_transfer_head_chs_v } } = orgResult
if(sur_order_transfer_head_chs_v.length === 0) {
that.showErrorModel(`来源借货订单号`)
return
}
let resultArr = []
surgery_collect_headers.forEach(item => {
sur_order_transfer_head_chs_v.forEach(item => {
let obj = {}
let collect_number = item.collect_number ? item.collect_number : '空'
let surgery_name = item.surgery_name ? item.surgery_name : '空'
let create_time = item.create_time ? moment(item.create_time).format("YYYY-MM-DD") : '空'
let tempName = `${collect_number}-${surgery_name}-${create_time}`
let source_surgery_order_number = item.source_surgery_order_number ? item.source_surgery_order_number : '空'
let source_surgery_date = item.source_surgery_date ? moment(item.source_surgery_date).format("YYYY-MM-DD") : '空'
let tempName = `${source_surgery_order_number}(${source_surgery_date})`
obj.name = tempName,
obj.value = item.collect_number
obj.value = item.source_surgery_order_number
resultArr.push(obj)
})
resultArr = dedupQuoteArray(resultArr, 'source_surgery_order_number')
let tempOption = [...resultArr]
that.setState({
showTypePop: true,
......@@ -1161,7 +1204,7 @@ class FilterModel extends Component {
handleRequeNumInput(text) {
// console.log('筛选 - 申请单号---', text)
let {transferListOptionData} = this.state
transferListOptionData[5].value = text
transferListOptionData[6].value = text
this.setState({
transferListOptionData
})
......@@ -1340,6 +1383,35 @@ class FilterModel extends Component {
break;
case 2:
tempSubOption = {...transferSearchOption}
if(transferListOptionData[0].curStatus.length) {
let tempSta = ''
transferListOptionData[0].curStatus.forEach(item => {
tempSta += searchTransStatus[item]+','
})
tempSubOption.header_status = tempSta
} else {
tempSubOption.header_status = ''
}
tempSubOption.seller_code = transferListOptionData[1].value
tempSubOption.org_code = transferListOptionData[2].value
tempSubOption.destination_customer_code = transferListOptionData[3].value
tempSubOption.source_customer_code = transferListOptionData[3].value
tempSubOption.destination_surgery_collect_number = transferListOptionData[4].value
tempSubOption.source_surgery_order_number = transferListOptionData[5].value
tempSubOption.order_number = transferListOptionData[6].value
tempSubOption.source_surgery_date_from = transferListOptionData[7].value
tempSubOption.source_surgery_date_to = transferListOptionData[8].value
tempSubOption.destination_surgery_date_from = transferListOptionData[7].value
tempSubOption.destination_surgery_date_to = transferListOptionData[8].value
params = Object.assign({}, params, tempSubOption)
console.log('-----params----', params)
props.callSupSubmit(params)
that.changeSeaColorAct() // 改变筛选颜色
that.closeModal() // 关闭弹窗
break;
default:
break;
......@@ -2009,7 +2081,7 @@ class FilterModel extends Component {
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
// onPress={() => this.handleOrganizationCheck() }
onPress={() => this.handleOrganizationCheck() }
>
<Text style={styles.cell_rig_sel}>{transferListOptionData[2].name}</Text>
<View style={styles.arr_icon_box}>
......@@ -2022,7 +2094,7 @@ class FilterModel extends Component {
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
// onPress={() => this.handleCustomerCheck() }
onPress={() => this.handleCustomerCheck() }
>
<Text style={styles.cell_rig_sel}>{transferListOptionData[3].name}</Text>
<View style={styles.arr_icon_box}>
......@@ -2031,11 +2103,11 @@ class FilterModel extends Component {
</TouchableOpacity>
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>来源借货订单号</Text>
<Text style={styles.qui_cell_tit}>目标借货订单</Text>
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
// onPress={() => this.handleSourOrdCheck() }
onPress={() => this.handleTargetBorCheck() }
>
<Text style={styles.cell_rig_sel}>{transferListOptionData[4].name}</Text>
<View style={styles.arr_icon_box}>
......@@ -2044,6 +2116,19 @@ class FilterModel extends Component {
</TouchableOpacity>
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>来源借货订单号</Text>
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_rig}
onPress={() => this.handleSourOrdCheck() }
>
<Text style={styles.cell_rig_sel}>{transferListOptionData[5].name}</Text>
<View style={styles.arr_icon_box}>
<Image source={require('../../../images/arr_rig.png')} style={icon_style} />
</View>
</TouchableOpacity>
</View>
<View style={styles.qui_cell}>
<Text style={styles.qui_cell_tit}>申请单号</Text>
<TouchableOpacity
activeOpacity={.8}
......@@ -2053,8 +2138,9 @@ class FilterModel extends Component {
style={[styles.cell_rig_sel, styles.cell_rig_input]}
placeholderTextColor = {placehold_text_color}
underlineColorAndroid = {'transparent'}
// onChangeText={(text) => this.handleRequeNumInput(text)}
defaultValue={transferListOptionData[5].value}
onChangeText={(text) => this.handleRequeNumInput(text)}
defaultValue={transferListOptionData[6].value}
keyboardType="email-address"
/>
</TouchableOpacity>
</View>
......@@ -2066,7 +2152,7 @@ class FilterModel extends Component {
style={styles.qui_date_box}
onPress={() => this.handleSurDateCheck('start') }
>
<Text style={styles.qui_date_inp}>{transferListOptionData[6].name}</Text>
<Text style={styles.qui_date_inp}>{transferListOptionData[7].name}</Text>
<View style={styles.date_icon_box}>
<Image source={require('../../../images/date_icon.png')} style={icon_style} />
</View>
......@@ -2077,7 +2163,7 @@ class FilterModel extends Component {
style={styles.qui_date_box}
onPress={() => this.handleSurDateCheck('end') }
>
<Text style={styles.qui_date_inp}>{transferListOptionData[7].name}</Text>
<Text style={styles.qui_date_inp}>{transferListOptionData[8].name}</Text>
<View style={styles.date_icon_box}>
<Image source={require('../../../images/date_icon.png')} style={icon_style} />
</View>
......
......@@ -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>
{
supIndex !== 2 ?
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
{tempTit[1]}{orderSupOptions.local_his_time}
</Text>
</View>
</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={[
......
......@@ -51,7 +51,6 @@ import { exitLoginStatus } from '../../../action/LoginAction';
import DialogModel from '../../common/DialogModel';
import DateModel from '../../common/DateModel';
import moment from 'moment';
// import { RNCamera } from 'react-native-camera';
class TransSearchPage extends Component {
constructor(props) {
......@@ -205,8 +204,6 @@ class TransSearchPage extends Component {
// 选择器弹窗回调函数
handleCallBack(item, itemTitle) {
// console.warn(item, 'item--选择器弹窗回调函数----')
// console.warn('item-itemTitle-----',itemTitle)
let { listOptionData} = this.state
let self = this
self.setState({
......@@ -232,7 +229,6 @@ class TransSearchPage extends Component {
// 日期选择器回调
dateModalCallback(date) {
// console.warn('date------', date)
let { currentTitle, listOptionData } = this.state
if(currentTitle.includes('start')) {
listOptionData[2].name = date
......@@ -283,15 +279,12 @@ class TransSearchPage extends Component {
access_token: props.token,
org_code: subTransObj.org_code,
seller_code: props.userInfo.user_name,
customer_code: '',
// customer_code: subTransObj.customer_code,
// collect_header_status: 'COLLECTING_WAITING_CONFIRM,CONFIRM_COLLECT,COLLECTED_WAITING_CONFIRMED,APPROVED,COLLECTED'
// customer_code: '',
collect_header_status: 'COLLECTING_WAITING_CONFIRM,CONFIRM_COLLECT,COLLECTED_WAITING_CONFIRMED,APPROVED,COLLECTED'
}
let { global_domain_config } = that.props
that.changeLodingFlag(true)
console.log('params------', params)
let sourResult = await requestSubSourBorOrdNum(global_domain_config, params)
console.log('sourResult---', sourResult)
if(sourResult.error_code === 0) {
that.changeLodingFlag(false)
let { data: { surgery_collect_headers } } = sourResult
......@@ -402,57 +395,53 @@ class TransSearchPage extends Component {
let seaFlag = false
let that = this
for(let item of listOptionData) {
// 当前查询数据
if(item.value) {
seaFlag = true
break
}
}
let curLen = curForm && Object.keys(curForm).length
console.log('curLen----', curLen)
if(curLen) {
// 已存在明细数据
seaFlag = true
} else if(curForm instanceof Object) {
return
}
if(seaFlag) {
// if(seaFlag) {
// 调用接口
let { subTransObj } = that.props.navigation.state.params
let { token, userInfo } = that.props
let { listOptionData } = that.state
let { token } = that.props
let seaForm = {
surgery_collect_number: listOptionData[0].value,
serial_number: listOptionData[1].value,
surgery_date_from: listOptionData[2].value,
surgery_date_to: listOptionData[3].value
surgery_date_from: listOptionData[2].value ? moment(listOptionData[2].value).format('YYYY-MM-DDTHH:mm:ss') : '',
surgery_date_to: listOptionData[3].value ? moment(listOptionData[3].value).format('YYYY-MM-DDTHH:mm:ss') : ''
}
if(curLen) {
curForm.surgery_date_from = curForm.surgery_date_from ? moment(curForm.surgery_date_from).format('YYYY-MM-DDTHH:mm:ss') : ''
curForm.surgery_date_to = curForm.surgery_date_to ? moment(curForm.surgery_date_to).format('YYYY-MM-DDTHH:mm:ss') : ''
seaForm = {...curForm}
}
let params = {
access_token: token,
seller_name: subTransObj.seller_name,
org_code: subTransObj.org_code,
item_name: '钉', // 测试
org_name: subTransObj.org_name,
...seaForm
}
console.log('查询===========》', params)
this.changeLodingFlag(true)
let { global_domain_config } = that.props
let detailResult = await requestTransDetails(global_domain_config, params)
console.log('detailResult-----',detailResult)
if(detailResult.error_code === 0) {
let { data: { sur_transfer_lines }} = detailResult
if(sur_transfer_lines.length == 0) {
show('当前明细数据为空,请重现选择订单')
show('当前明细为空!')
} else {
let {subTransDetOption} = this.props // 【转单】主页面已存在的明细
console.log('subTransDetOption-----', subTransDetOption)
subTransDetOption.length && subTransDetOption.forEach((item, index) => {
sur_transfer_lines.length && sur_transfer_lines.forEach((chItem, chInd) => {
subTransDetOption.length && subTransDetOption.forEach((item) => {
sur_transfer_lines.length && sur_transfer_lines.forEach((chItem) => {
if(chItem.serial_number == item.serial_number
&& chItem.surgery_collect_number == item.surgery_collect_number ) {
// chItem.sale_price = item.sale_price
// chItem.local_add_price = item.local_add_price
chItem.select = true
}
})
......@@ -473,9 +462,9 @@ class TransSearchPage extends Component {
let error_msg = detailResult.error_msg || detailResult.message
show(error_msg);
}
} else {
show('请至少输入一个查询条件')
}
// } else {
// show('请至少输入一个查询条件')
// }
}
// 修改加载中
......@@ -486,14 +475,12 @@ class TransSearchPage extends Component {
}
// 取消选择
handleCelSelCheck(item, index) {
// console.log('取消===cel:', item, index)
handleCelSelCheck(index) {
this.changeIsSelected(index, false)
}
// 确定选择
handleSubSelectedCheck(item, index) {
// console.log('确定===sub:', item, index)
handleSubSelectedCheck(index) {
this.changeIsSelected(index, true)
}
......@@ -508,24 +495,14 @@ class TransSearchPage extends Component {
this.setState({
conDetaOption
},() => {
// console.log('conDetaOption---修改-', conDetaOption)
let tempArr = []
conDetaOption.forEach(item => {
if(item.select) {
tempArr.push(item)
}
})
// let curOthOption = subTransDetOption.filter(fiItem => {
// if(fiItem.serial_number) {
// }
// })
// tempArr = tempArr.concat(subTransDetOption)
tempArr = [...tempArr, ...subTransDetOption]
tempArr = that.dedupQuoteDetailArr(tempArr, 'serial_number', 'surgery_collect_number')
that.setState({
localSelectOption: tempArr
})
......@@ -549,7 +526,6 @@ class TransSearchPage extends Component {
// 已选回调函数
detailsCallbak(subOpt) {
console.log('----回调:',subOpt)
let tempOption = [...this.state.conDetaOption]
// 获取当前已选值
tempOption = tempOption.map(item => {
......@@ -579,13 +555,11 @@ class TransSearchPage extends Component {
// 点击 已选
handleSubSelected(show) {
// console.warn('已选:666!!')
this.handleCloseSelectModal(true)
}
// 点击 确定
handleSubmit() {
// console.warn('确定', this.props.navigation.navigate)
this.handleCloseSelectModal(false)
let { localSelectOption, listOptionData } = this.state
if(!localSelectOption.length) {
......@@ -757,7 +731,6 @@ class TransSearchPage extends Component {
// 返回日期选择器
renderDateModel() {
let { currentDateVal, dateModelPop } = this.state
// console.warn('弹窗--日期---,', currentDateVal)
return (
<DateModel
date={currentDateVal}
......@@ -796,9 +769,7 @@ class TransSearchPage extends Component {
</TouchableOpacity>
}
</View>
<View style={styles.cont_list}>
<FlatList
style={styles.cons_cont}
keyExtractor={item => item.id}
......@@ -807,8 +778,6 @@ class TransSearchPage extends Component {
renderItem={ ({item, index}) => this.renderSubListItem(item, index) }
/>
{/* <View style={styles.cont_list_item}>
<View style={styles.list_left}>
<TouchableOpacity
......@@ -863,13 +832,13 @@ class TransSearchPage extends Component {
<TouchableOpacity
activeOpacity={.8}
style={styles.sub_icon_box}
onPress={() => this.handleCelSelCheck(item, index)}>
onPress={() => this.handleCelSelCheck(index)}>
<Image style={icon_style} source={require('../../../images/radio_yes.png')} />
</TouchableOpacity>
: <TouchableOpacity
activeOpacity={.8}
style={styles.sub_icon_box}
onPress={() => this.handleSubSelectedCheck(item, index)}>
onPress={() => this.handleSubSelectedCheck(index)}>
<Image style={icon_style} source={require('../../../images/radio_no.png')} />
</TouchableOpacity>
}
......
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