Commit 559ef2e2 by wong.peiyi

消耗确认添加用户定价或定价引擎定价

parent 7be4f296
......@@ -25,7 +25,7 @@ import { show } from '../../utils/Utils';
class SubSuccPage extends Component {
constructor(props) {
super(props);
this.state = {
this.state = {
orderVal: ''
}
}
......@@ -58,9 +58,9 @@ class SubSuccPage extends Component {
render() {
let { navigation } = this.props
let { title } = navigation.state.params
let { title, warnTip } = navigation.state.params
let { state } = this
return (
return (
<View style={styles.succ_container}>
<StatusBarView
isReactStackNavigator={true}
......@@ -75,10 +75,13 @@ class SubSuccPage extends Component {
</View>
<Text style={styles.succ_title}>{'提交成功'}</Text>
{
state.orderVal ?
state.orderVal ?
<Text style={styles.succ_text}>{'订单号:'} { state.orderVal }</Text>
: null
}
{
!!warnTip && <Text style={styles.warn_tip}>{warnTip}</Text>
}
<TouchableOpacity
activeOpacity={.9}
style={styles.succ_btn}
......@@ -90,7 +93,7 @@ class SubSuccPage extends Component {
</TouchableOpacity>
</View>
</SafeAreaView>
</View>
);
}
......@@ -125,7 +128,14 @@ const styles = StyleSheet.create({
color: second_text_color,
paddingBottom: 30,
fontFamily: font_family_regular
},
},
warn_tip: {
fontSize: 14,
paddingLeft: 20,
paddingRight: 20,
paddingBottom: 20,
color: '#fdbe34'
},
succ_btn: {
backgroundColor: promary_color,
width: pxSize(330),
......@@ -141,5 +151,5 @@ const styles = StyleSheet.create({
fontFamily: font_family_regular
}
})
export default SubSuccPage;
\ No newline at end of file
export default SubSuccPage;
......@@ -25,6 +25,7 @@ class EquipConsuPage extends Component {
super(props);
this.state = {
canSubFlag: false, // 生成订单按钮样式改变
userEnteredPrice: "Y",
listOptionData: [ // 页面元素
{
"id": "0",
......@@ -446,6 +447,7 @@ class EquipConsuPage extends Component {
that.clearInitNameAndValue(3)
that.getCurOrderDetail()
that.autoSetDoctorAndFollower()
that.setUserEnteredPrice(item.value)
}
}
return chItem
......@@ -497,6 +499,7 @@ class EquipConsuPage extends Component {
let tempName = `${collect_number}-${surgery_name}-${item.doctor_name ? (item.doctor_name + '-') : ''}${create_time}`
obj.name = tempName,
obj.value = item.collect_number
obj.userEnteredPrice = item.userEnteredPrice || 'Y'
resultArr.push(obj)
})
tempOption = [...resultArr]
......@@ -529,6 +532,18 @@ class EquipConsuPage extends Component {
})
}
/**
* @description: 设置是否可以用户输入价格
* @param {*}
* @return {*}
*/
setUserEnteredPrice(collectNumber) {
const {orderInfos, listOptionData} = this.state
const orders = orderInfos[`${listOptionData[1].value}_${listOptionData[2].value}`]
const order = R.find(R.propEq('value', collectNumber))(orders)
this.setState({userEnteredPrice: order.userEnteredPrice || 'Y'})
}
// 修改选择器为属性 name 和 value
changeNameAndValue(data, nameType, valueType) {
let result = []
......@@ -1096,12 +1111,13 @@ class EquipConsuPage extends Component {
// 耗材明细 点击
handleConsumDetailCheck() {
let { listOptionData } = this.state
let { listOptionData, userEnteredPrice } = this.state
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()
&& this.judgeOrderInfoIsNull()) {
this.props.navigation.navigate('ConsumDetailsPage', {
title: '器械消耗 - 添加明细',
orderId: listOptionData[3].value
orderId: listOptionData[3].value,
userEnteredPrice
})
}
}
......@@ -1250,7 +1266,10 @@ class EquipConsuPage extends Component {
tempSubOption.patient_id = state.listOptionData[9].value
// tempSubOption.settled_flag = state.listOptionData[10].isRedio
tempSubOption.remark = state.listOptionData[11].value
tempSubOption.lines = state.listOptionData[12].subOption
tempSubOption.lines = R.clone(state.listOptionData[12].subOption)
if (OBS_MOBILE_EQU_CON_DISPLAY_PRICE === 'N' || state.userEnteredPrice === 'N') {
tempSubOption.lines = R.map(R.dissoc('sale_price'))(tempSubOption.lines)
}
// 部门等信息
sysValues.OBS_MOBILE_CONSU_DEPARTMENT_DISPLAY > 0 && (tempSubOption.department_code = state.listOptionData[15].value)
......@@ -1326,7 +1345,8 @@ class EquipConsuPage extends Component {
this.clearAllData() // 清空数据
let { state: { params: { title } } } = this.props.navigation
this.props.navigation.navigate('SubSuccPage', { // 现在没返回订单号
title: `${title} - 下单成功`
title: `${title} - 下单成功`,
get_price_error_list: equipOrderOption.get_price_error_list
})
}
}
......@@ -1645,7 +1665,11 @@ class EquipConsuPage extends Component {
// 返回耗材明细
renderConsumablesDetailsItem() {
let { state } = this
const sum = this.consumeSum()
let {userEnteredPrice} = state
let sum = 0
if (userEnteredPrice !== 'N') {
sum = this.consumeSum()
}
return (
<CellTextStyle style={list_common_item.consu_detail}>
......@@ -1662,7 +1686,9 @@ class EquipConsuPage extends Component {
<Text style={list_common_item.detail_tit_text}>
耗材({state.listOptionData[12].subOption.length}
</Text>
<Text style={list_common_item.detail_tit_text}>耗材总金额:{sum}</Text>
{
userEnteredPrice !== 'N' && <Text style={list_common_item.detail_tit_text}>耗材总金额:{sum}</Text>
}
</View>
{
state.listOptionData[12].isShowSub ?
......@@ -1690,6 +1716,8 @@ class EquipConsuPage extends Component {
// 返回耗材明细子项
renderConDeSubItem(item, index) {
const {userEnteredPrice} = this.state
return(
<View style={list_common_item.con_de_sub} key={index}>
<Text style={[list_common_item.de_sub_tit]}>
......@@ -1698,7 +1726,7 @@ class EquipConsuPage extends Component {
<Text style={list_common_item.de_tip}>
序列号:{item.serial_number ? item.serial_number : '无'}
</Text>
{ OBS_MOBILE_EQU_CON_DISPLAY_PRICE === 'Y' ?
{ OBS_MOBILE_EQU_CON_DISPLAY_PRICE === 'Y' && userEnteredPrice !== 'N' ?
<Text style={list_common_item.de_tip}>
单价(¥){ item.sale_price }
</Text> : null }
......@@ -1766,14 +1794,18 @@ class EquipConsuPage extends Component {
// 返回添加图片
renderAddPicturesItem() {
let { state } = this
const sum = this.feeSum() + this.consumeSum()
const userEnteredPrice = state.userEnteredPrice
let sum = this.feeSum()
if (userEnteredPrice !== 'N') {
sum += this.consumeSum()
}
return (
<CellTextStyle style={list_common_item.consu_addpic}>
<View style={list_common_item.addpic_inner}>
<View style={list_common_item.detail_title_box}>
<Text style={list_common_item.addpic_tit}>添加图片</Text>
<Text style={list_common_item.detail_tit}>耗材+费用总金额:{sum}</Text>
<Text style={list_common_item.detail_tit}>{userEnteredPrice !== 'N' && '耗材+'}费用总金额:{sum}</Text>
</View>
<View style={list_common_item.addpic_cont}>
{state.localPhoOption.length
......
......@@ -27,6 +27,7 @@ class ConsumDetailsPage extends Component {
localSelectOption: [], // 已选数据
isSubLoding: true, // 加载中弹窗
lodingTitle: '加载中',
userEnteredPrice: 'Y'
}
}
......@@ -57,7 +58,7 @@ class ConsumDetailsPage extends Component {
// 获取当前订单的消耗明细
async getCurOrderDetail() {
let {orderId} = this.props.navigation.state.params
let {orderId, userEnteredPrice} = this.props.navigation.state.params
let {global_domain_config} = this.props
let params = {
access_token: this.props.token,
......@@ -88,7 +89,8 @@ class ConsumDetailsPage extends Component {
this.setState({
isSubLoding: false,
conDetaOption: lines,
allConOption: lines
allConOption: lines,
userEnteredPrice
})
this.changeIsSelected()
} else if(detailResult.error_code === 41006) {
......@@ -217,12 +219,12 @@ class ConsumDetailsPage extends Component {
// 点击 确定耗材
handleSubmit() {
this.handleCloseSelectModal(false)
let {localSelectOption} = this.state
let {localSelectOption, userEnteredPrice} = this.state
if(!localSelectOption.length) {
show('请选择耗材')
return
}
if(OBS_MOBILE_EQU_CON_DISPLAY_PRICE === 'Y'){
if(OBS_MOBILE_EQU_CON_DISPLAY_PRICE === 'Y' && userEnteredPrice !== 'N'){
this.props.navigation.navigate('FillUnitPricePage', {
title: '器械消耗 - 填写单价',
localSelectOption: localSelectOption
......
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