Commit 552fcefd by Denglingling

优化【库存不足】弹窗样式等;

(cherry picked from commit 25351b6d)
parent b33ae503
...@@ -29,69 +29,33 @@ class NotEnoughModel extends Component { ...@@ -29,69 +29,33 @@ class NotEnoughModel extends Component {
super(props); super(props);
this.state = { this.state = {
isVisible: this.props.show, isVisible: this.props.show,
notEnoughList: this.props.notEnoughList, not_enough_items_list: this.props.not_enough_items_list,
title: '以下物品缺失,是否继续提交?', title: '以下物品缺失,是否继续提交?'
not_enough_items_list: [
{
"item_code": "AR00000004",
"reg_number": "国械注进20173466362",
"plan_quantity": 10,
"specification": "2.2mm带线锚钉,蓝色缝线",
"item_name": "钛合金缝线锚钉",
"general_name": "钛合金锚钉",
"storage_quantity": 0
},
{
"item_code": "AR00000003",
"reg_number": "国械注进20173466362",
"plan_quantity": 10,
"specification": "3.5*12.1,蓝色缝线",
"item_name": "钛合金缝线锚钉",
"general_name": "钛合金锚钉",
"storage_quantity": 6
},
{
"item_code": "AR00000002",
"reg_number": "国械注进20173466362",
"plan_quantity": 10,
"specification": "5.0X15.5,蓝色缝线",
"item_name": "钛合金缝线锚钉",
"general_name": "钛合金锚钉",
"storage_quantity": 4
}
],
} }
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
// console.warn('------show--------------',nextProps.show, this.state.isVisible )
if (this.state.isVisible != nextProps.show) { if (this.state.isVisible != nextProps.show) {
this.setState({ this.setState({
isVisible: nextProps.show isVisible: nextProps.show
}); });
} }
if (this.state.notEnoughList != nextProps.notEnoughList) { if (this.state.not_enough_items_list != nextProps.not_enough_items_list) {
this.setState({ this.setState({
notEnoughList: nextProps.notEnoughList not_enough_items_list: nextProps.not_enough_items_list
}) })
} }
} }
// 取消
closeModal() { closeModal() {
this.setState({ this.setState({
isVisible: false isVisible: false
}); });
this.props.closeModal(false); this.props.closeModal(false);
} }
// 确定
submitModal() { submitModal() {
console.log('确定!!!')
this.props.callback(); this.props.callback();
this.closeModal() this.closeModal()
} }
renderNotEnItem(item, index) { renderNotEnItem(item, index) {
return ( return (
<TouchableOpacity <TouchableOpacity
...@@ -122,9 +86,8 @@ class NotEnoughModel extends Component { ...@@ -122,9 +86,8 @@ class NotEnoughModel extends Component {
</TouchableOpacity> </TouchableOpacity>
) )
} }
renderDialog() { renderDialog() {
let { notEnoughList, title, not_enough_items_list } = this.state let { not_enough_items_list, title } = this.state
return ( return (
<View style={styles.opt_area}> <View style={styles.opt_area}>
<View style={styles.modal_style}> <View style={styles.modal_style}>
...@@ -146,10 +109,8 @@ class NotEnoughModel extends Component { ...@@ -146,10 +109,8 @@ class NotEnoughModel extends Component {
style={styles.item_scroll} style={styles.item_scroll}
// showsVerticalScrollIndicator={false} // showsVerticalScrollIndicator={false}
> >
{/* notEnoughList not_enough_items_list */}
{ {
notEnoughList.map((item, index) => this.renderNotEnItem(item, index)) not_enough_items_list.map((item, index) => this.renderNotEnItem(item, index))
} }
</ScrollView> </ScrollView>
</View> </View>
...@@ -250,8 +211,10 @@ const styles = StyleSheet.create({ ...@@ -250,8 +211,10 @@ const styles = StyleSheet.create({
maxHeight: pxHeight(320), maxHeight: pxHeight(320),
minHeight: pxHeight(220), minHeight: pxHeight(220),
borderWidth: 1, borderWidth: 1,
borderColor: '#E0E0E0', borderColor: '#eaeaea',
paddingLeft: 4 paddingLeft: 6,
borderRadius: 4,
paddingBottom: 6
}, },
item_scroll: {}, item_scroll: {},
modal_head: { modal_head: {
...@@ -273,30 +236,30 @@ const styles = StyleSheet.create({ ...@@ -273,30 +236,30 @@ const styles = StyleSheet.create({
fontFamily: font_family_medium fontFamily: font_family_medium
}, },
head_tou_clo: { head_tou_clo: {
width: pxSize(28), width: pxSize(24),
height: pxSize(28) height: pxSize(24)
}, },
cont_list: {}, cont_list: {},
co_li: { co_li: {
lineHeight: 20, lineHeight: 20,
fontSize: 14, fontSize: 12,
fontFamily: font_family_regular, fontFamily: font_family_regular,
color: second_text_color color: second_text_color
}, },
co_str: { co_str: {
fontFamily: font_family_semibold, fontFamily: font_family_semibold,
fontWeight: '500', fontWeight: '500',
fontSize: 16, fontSize: 14,
paddingTop: 6, paddingTop: 6,
paddingBottom: 2, paddingBottom: 2,
color: first_text_color color: first_text_color
}, },
plan_num: { plan_num: {
fontSize: 16, fontSize: 14,
fontFamily: font_family_semibold fontFamily: font_family_semibold
}, },
sto_num: { sto_num: {
fontSize: 16, fontSize: 14,
fontFamily: font_family_semibold, fontFamily: font_family_semibold,
color: 'red' color: 'red'
}, },
...@@ -305,13 +268,13 @@ const styles = StyleSheet.create({ ...@@ -305,13 +268,13 @@ const styles = StyleSheet.create({
justifyContent: 'space-around' justifyContent: 'space-around'
}, },
foo_btn: { foo_btn: {
width: pxSize(100), width: '38%',
height: pxSize(36), height: pxSize(36),
borderRadius: 5, borderRadius: 5,
marginTop: 20 marginTop: 20
}, },
btn_cel: { btn_cel: {
backgroundColor: '#E0E0E0' backgroundColor: '#E7F1FD'
}, },
btn_sub: { btn_sub: {
backgroundColor: promary_color backgroundColor: promary_color
...@@ -323,7 +286,7 @@ const styles = StyleSheet.create({ ...@@ -323,7 +286,7 @@ const styles = StyleSheet.create({
lineHeight: 32 lineHeight: 32
}, },
tit_cel: { tit_cel: {
color: first_text_color color: '#007EFF'
}, },
}) })
......
...@@ -114,7 +114,7 @@ class SelfOrderPage extends Component { ...@@ -114,7 +114,7 @@ class SelfOrderPage extends Component {
}, },
{ {
"id": "7", "id": "7",
title: '手术时间', title: '手术时间',
name: '请选择', name: '请选择',
value: '', value: '',
dateValue: new Date(), dateValue: new Date(),
...@@ -743,15 +743,15 @@ class SelfOrderPage extends Component { ...@@ -743,15 +743,15 @@ class SelfOrderPage extends Component {
// console.warn('手术名称---',listOptionData[6]) // console.warn('手术名称---',listOptionData[6])
} }
// 手术时间 点击 2020-04-23 17:41 // 手术时间 点击 2020-04-23 17:41
handleSurDateCheck() { handleSurDateCheck() {
console.warn('手术时间 点击 ===') console.warn('手术时间 点击 ===')
let { listOptionData } = this.state let { listOptionData } = this.state
let date = listOptionData[7].value let date = listOptionData[7].value
if(date) { if(date) {
this.setState({ this.setState({
listOptionData: listOptionData.map((item, index) => { listOptionData: listOptionData.map((item, index) => {
if(item.title === '手术时间') { if(item.title === '手术时间') {
item.dateValue = formatStrForDate(date) item.dateValue = formatStrForDate(date)
} }
return item return item
...@@ -775,7 +775,7 @@ class SelfOrderPage extends Component { ...@@ -775,7 +775,7 @@ class SelfOrderPage extends Component {
let { listOptionData } = this.state let { listOptionData } = this.state
this.setState({ this.setState({
listOptionData: listOptionData.map((item, index) => { listOptionData: listOptionData.map((item, index) => {
if(item.title === '手术时间') { if(item.title === '手术时间') {
item.name = date item.name = date
item.value = date item.value = date
item.dateValue = formatStrForDate(date) item.dateValue = formatStrForDate(date)
...@@ -996,7 +996,7 @@ class SelfOrderPage extends Component { ...@@ -996,7 +996,7 @@ class SelfOrderPage extends Component {
onPress={() => this.handleSurDateCheck()} onPress={() => this.handleSurDateCheck()}
> >
<CellTextStyle> <CellTextStyle>
<TitleTextStyle>{'手术时间'}</TitleTextStyle> <TitleTextStyle>{'手术时间'}</TitleTextStyle>
<ContTextStyle>{listOptionData[7].name} -- {listOptionData[7].value}</ContTextStyle> <ContTextStyle>{listOptionData[7].name} -- {listOptionData[7].value}</ContTextStyle>
{ this.renderRightArrowItem() } { this.renderRightArrowItem() }
</CellTextStyle> </CellTextStyle>
......
...@@ -45,7 +45,7 @@ export default [ ...@@ -45,7 +45,7 @@ export default [
}, },
{ {
isRequest: false, isRequest: false,
title: '手术时间', title: '手术时间',
value: '请选择', value: '请选择',
isPicker: true, isPicker: true,
showDatePicker: true showDatePicker: true
......
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