Commit d897b6d0 by wong.peiyi

Merge branch 'develop' into product

parents 15e67e1a 1659da2f
......@@ -73,7 +73,7 @@ class HistoricalOrderPage extends Component {
],
isShowSelect: false, // 显示/隐藏 筛选内容
borrowStatus: ['待审核','待出库','待还货','其他'],
consumeStatus: ['待审核','已消耗'],
consumeStatus: ['待确认消耗','已确认消耗'],
transferStatus: ['已输入', '已审批', '已驳回', '已提交', '已取消'],
searchBorrowStatus: [ // 【借货】对应的状态值
"ENTERED,SUBMITTED",
......@@ -474,9 +474,9 @@ class HistoricalOrderPage extends Component {
<Text
style={[
styles.cont_rig_status,
(item.local_his_status == '待审核' || item.local_his_status == '已提交') ? styles.status_audit : '',
(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 : ''
['待审核', '已提交', '待确认消耗'].includes(item.local_his_status) && styles.status_audit,
['待还货', '已输入', '已驳回', '已确认消耗'].includes(item.local_his_status) && styles.status_return,
['其他', '已取消'].includes(item.local_his_status) && styles.status_other
]}>
{item.local_his_status}
</Text>
......
......@@ -61,6 +61,142 @@ class LineOrderPage extends Component {
orderSupOptions: {}, // 获取主表数据
toolShowPopup: false, // 弹窗显示
popFormItem: {}, // 弹窗对象
// 渲染内容,下标就是历史列表里的序号subIndex
columns: [
// 借货订单
[
{
prop: 'local_his_name',
name: '手术名称',
},
{
prop: 'doctor_name',
name: '手术医生',
},
{
prop: 'local_his_time',
name: '手术时间',
},
{
prop: 'customer_name',
name: '客户名称',
},
{
prop: 'local_his_number',
name: '订 单 号',
},
{
prop: 'create_time',
name: '下单日期',
format: data => data && moment(data).format('YYYY/MM/DD HH:mm')
},
{
prop: 'allPlanQuanSum',
name: '下单数量',
obj: 'consumaData'
},
{
prop: 'surgery_desc',
name: '备注信息',
},
],
[ // 消耗订单
{
prop: 'surgery_collect_number',
name: '借货订单',
},
{
prop: 'consume_order_number',
name: '消耗订单',
},
{
prop: 'local_his_name',
name: '结单标识',
},
{
prop: 'seller_name',
name: '业 务 员',
suffix: () => {
const {local_his_time} = this.state.orderSupOptions
return !!local_his_time && `(${moment(local_his_time).format('YYYY/MM/DD HH:mm')})`
}
},
{
prop: 'customer_name',
name: '客户名称',
},
{
prop: 'doctor_name',
name: '手术医生',
},
{
prop: 'local_his_time',
name: '消耗时间',
},
{
prop: 'patient_id',
name: '病 历 号',
},
{
prop: 'patient_bed',
name: '床 位',
},
{
prop: 'patient_name',
name: '患者姓名',
},
{
prop: 'patient_age',
name: '患者年龄',
},
{
prop: 'patient_gender',
name: '患者性别',
},
{
prop: 'surgery_desc',
name: '备注信息',
},
], [{
prop: 'local_his_name',
name: '目标借货订单号',
suffix: () => {
const {orderSupOptions} = this.state
return `(${orderSupOptions.local_his_time})`
}
},
{
prop: 'source_surgery_order_number',
name: '来源借货订单号',
ifShow: () => !!this.state.orderSupOptions.source_surgery_order_number,
suffix: () => {
const {source_surgery_date} = this.state.orderSupOptions
return !!source_surgery_date && `(${moment(source_surgery_date).format('YYYY/MM/DD HH:mm')})`
}
},
{
prop: 'doctor_name',
name: '手术医生',
},
{
prop: 'destination_customer_name',
name: '目标客户名称',
},
{
prop: 'source_customer_name',
name: '来源客户名称',
},
{
prop: 'order_number',
name: '订单号',
},
{
prop: 'surgery_desc',
name: '备注信息',
},
]
]
}
}
......@@ -339,121 +475,50 @@ class LineOrderPage extends Component {
// 返回主要内容
renderContItem() {
let {orderSupOptions, consumaData} = this.state
let {orderSupOptions, consumaData, columns} = this.state
let {supIndex} = this.props.navigation.state.params
let tempTit = []
if(supIndex == 0) {
tempTit.push('手术名称:', '手术时间:')
} else if(supIndex == 1) {
tempTit.push('结单标识:', '消耗时间:')
} else if(supIndex == 2) {
tempTit.push('目标借货订单号:', '手术时间:')
}
const subColumns = columns[supIndex]
return (
<ScrollView style={styles.line_cont_scroll}>
<View style={styles.fo_cont_inner}>
<Text style={styles.fo_cont_top_tit}>订单信息</Text>
<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> : null
}
{
supIndex !== 2 ?
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
客户名称:{orderSupOptions.customer_name ? orderSupOptions.customer_name : '无'}
</Text>
</View> :
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
目标客户名称:{orderSupOptions.destination_customer_name ? orderSupOptions.destination_customer_name : '无'}
</Text>
<Text style={styles.fo_tip_txt}>
来源客户名称:{orderSupOptions.source_customer_name ? orderSupOptions.source_customer_name : '无'}
</Text>
</View>
}
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
订单号:{supIndex == 0 ? orderSupOptions.local_his_number :
(supIndex == 1 ? orderSupOptions.surgery_collect_number : orderSupOptions.order_number)}
</Text>
subColumns.map(col => {
const obj = this.state[col.obj] || orderSupOptions
if(!!col.ifShow && !col.ifShow()) return null
console.log(Object.prototype.toString.call(col.prop))
return (
<View key={col.name} style={styles.fo_cell_box}>
<View style={{minWidth: pxSize(70), }}>
<Text style={[styles.fo_tip_txt]}>{col.name}:</Text>
</View>
{
supIndex == 0 ?
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
下单日期 {orderSupOptions.create_time ? moment(orderSupOptions.create_time).format('YYYY/MM/DD HH:mm') : '无'}
</Text>
</View>
: null
}
{
supIndex == 0 ?
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
下单数量 {consumaData.allPlanQuanSum}
</Text>
</View>
: null
<Text>{col.format ? col.format(obj[col.prop]) : obj[col.prop] || '无'}</Text>
}
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
备注信息:{orderSupOptions.surgery_desc ? orderSupOptions.surgery_desc : '无'}
</Text>
</View>
{
supIndex == 1 ?
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
消耗数量:{consumaData.allConmQuanSum}
</Text>
</View>
: null
!!col.suffix && <Text>{col.suffix()}</Text>
}
{
consumaData.allOptSum ?
<View style={styles.fo_cell_box}>
<Text style={styles.fo_sum_txt}>
消耗金额:¥{consumaData.allOptSum}
</Text>
</View>
: null
)
})
}
</View>
<View style={styles.line_cont}>
<View style={styles.line_cont_title}>
<Text style={styles.cont_tip_tit}>订单详情</Text>
{
supIndex === 1 &&
<View style={[styles.line_cont_title]}>
<Text style={{marginRight: pxSize(15)}}>数量:{consumaData.allConmQuanSum}</Text>
<Text style>金额:{consumaData.allOptSum}</Text>
</View>
}
</View>
{ this.renderConsumablesItem() }
......@@ -463,9 +528,9 @@ class LineOrderPage extends Component {
<View style={styles.fo_sta_inner}>
<Text style={[
styles.fo_sta_txt,
(orderSupOptions.local_his_status == '待审核' || orderSupOptions.local_his_status == '已提交') ? styles.status_audit : '',
(orderSupOptions.local_his_status == '待还货' || orderSupOptions.local_his_status == '已输入' || orderSupOptions.local_his_status == '已驳回') ? styles.status_return : '',
(orderSupOptions.local_his_status == '其他' || orderSupOptions.local_his_status == '已取消') ? styles.status_other : ''
['待审核', '已提交', '待确认消耗'].includes(orderSupOptions.local_his_status) && styles.status_audit,
['待还货', '已输入', '已驳回', '已确认消耗'].includes(orderSupOptions.local_his_status) && styles.status_return,
['其他', '已取消'].includes(orderSupOptions.local_his_status) && styles.status_other
]}>
{orderSupOptions.local_his_status}
</Text>
......@@ -593,6 +658,11 @@ const styles = StyleSheet.create({
paddingVertical: 16,
paddingBottom: 20
},
line_cont_title: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: "center"
},
cont_tip_tit: {
fontSize: 16,
fontFamily: font_family_regular,
......@@ -621,13 +691,18 @@ const styles = StyleSheet.create({
fontFamily: font_family_regular,
color: second_text_color
},
fo_cell_box: {},
fo_cell_box: {
flexDirection: 'row'
},
fo_tip_txt: {
fontSize: third_text_size,
fontFamily: font_family_regular,
color: second_text_color,
lineHeight: 18
},
fo_tip_txt_key: {
// minWidth: pxSize(120),
},
fo_sum_txt: {
color: first_text_color,
fontSize: 14,
......
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