Commit cf69922c by Denglingling

【器械消耗】需要的组件,以及需要存储到 store 的数据配置

parent f11e0158
import { PostRequest, GetRequest } from '../network/RequestUtils';
import { PostRequest, GetRequest, UploadRequest } from '../network/RequestUtils';
import { show, getUrlParams } from '../utils/Utils';
import { exitLoginStatus } from './LoginAction';
import {
......@@ -7,7 +7,9 @@ import {
EQUIP_CONSU_LIST_FAILURE,
EQUIP_SUBMIT_DOING,
EQUIP_SUBMIT_SUCCESS,
EQUIP_SUBMIT_FAILURE
EQUIP_SUBMIT_FAILURE,
GET_SUB_DETAIL_OPTION,
EQUIP_INIT_DATA
} from '../base/ActionTypes';
......@@ -112,21 +114,25 @@ function requestListDataFail() {
}
}
// 获取当前临时存储的明细
export function getSubdetailOption(data) {
console.log('data====!!!!', data)
return {
type: GET_SUB_DETAIL_OPTION,
rawData: data
}
}
// 获取消耗明细 params={access_token:'', surgery_collect_number:''}
export const requestEquipDetails = async (params) => {
console.log('----requestEquipDetails----', params)
return await GetRequest(getUrlParams('/surgery/collected_order_line/search', params))
}
// 图片上传 -- 具体需要修改!!!!!
export const requestQuickAudio = async (params) => {
let { access_token, path } = params
let formData = new FormData()
let soundPath = `file://${path}`
let fileName = path.substring(path.lastIndexOf('/') + 1, path.length)
let file = { uri: soundPath, type: "multipart/form-data", name: fileName}
formData.append('file', file)
console.log('--------', file, formData)
// 图片上传
export const uploadEquipImg = async (params) => {
let { access_token, formData } = params
console.log('--------', access_token, formData)
return await UploadRequest(getUrlParams('/dingding/upload_media', { access_token }), formData)
}
......
......@@ -7,7 +7,8 @@ import {
QUICK_ORDER_LIST_FAILURE,
QUICK_SUBMIT_DOING,
QUICK_SUBMIT_SUCCESS,
QUICK_SUBMIT_FAILURE
QUICK_SUBMIT_FAILURE,
QUICK_INIT_DATA
} from '../base/ActionTypes';
// 获取组织 params={access_token:''}
......
import { PostRequest, GetRequest } from '../network/RequestUtils';
import { show } from '../utils/Utils';
import { exitLoginStatus } from './LoginAction';
import { SELF_ORDER_LIST_DOING, SELF_ORDER_LIST_SUCCESS, SELF_ORDER_LIST_FAILURE } from '../base/ActionTypes';
import {
SELF_ORDER_LIST_DOING,
SELF_ORDER_LIST_SUCCESS,
SELF_ORDER_LIST_FAILURE,
SELF_INIT_DATA
} from '../base/ActionTypes';
// 获取组织
// export const requestOrganizations = async (params) => {
......
......@@ -15,6 +15,7 @@ export const SELF_SUBMIT_NO = "SELF_SUBMIT_NO"
export const SELF_SUBMIT_DOING = "SELF_SUBMIT_DOING"
export const SELF_SUBMIT_SUCCESS = "SELF_SUBMIT_SUCCESS"
export const SELF_SUBMIT_FAILURE = "SELF_SUBMIT_FAILURE"
export const SELF_INIT_DATA = "SELF_INIT_DATA"
//-----------quick order---------------------
export const QUICK_ORDER_LIST_NO = "QUICK_ORDER_LIST_NO"
export const QUICK_ORDER_LIST_DOING = "QUICK_ORDER_LIST_DOING"
......@@ -24,6 +25,7 @@ export const QUICK_SUBMIT_NO = "QUICK_SUBMIT_NO"
export const QUICK_SUBMIT_DOING = "QUICK_SUBMIT_DOING"
export const QUICK_SUBMIT_SUCCESS = "QUICK_SUBMIT_SUCCESS"
export const QUICK_SUBMIT_FAILURE = "QUICK_SUBMIT_FAILURE"
export const QUICK_INIT_DATA = "QUICK_INIT_DATA"
//-----------equipment consumption---------------------
export const EQUIP_CONSU_LIST_NO = "EQUIP_CONSU_LIST_NO"
export const EQUIP_CONSU_LIST_DOING = "EQUIP_CONSU_LIST_DOING"
......@@ -33,3 +35,5 @@ export const EQUIP_SUBMIT_NO = "EQUIP_SUBMIT_NO"
export const EQUIP_SUBMIT_DOING = "EQUIP_SUBMIT_DOING"
export const EQUIP_SUBMIT_SUCCESS = "EQUIP_SUBMIT_SUCCESS"
export const EQUIP_SUBMIT_FAILURE = "EQUIP_SUBMIT_FAILURE"
export const EQUIP_INIT_DATA = "EQUIP_INIT_DATA"
export const GET_SUB_DETAIL_OPTION = "GET_SUB_DETAIL_OPTION"
\ No newline at end of file
......@@ -55,7 +55,7 @@ export const font_family_light = "PingFangSC-Light";
export const header_height = 58
export const icon_style = {
resizeMode: 'contain',
resizeMode: 'cover',
width: '100%',
height: '100%'
}
......@@ -306,12 +306,36 @@ export const list_common_item = {
padding: 20,
marginTop: 10,
flexDirection: 'row',
flex: 1
flex: 1,
flexWrap: 'wrap'
},
addpic_img_btn: {
width: pxSize(68),
height: pxSize(68),
marginRight: 20
width: pxSize(64),
height: pxSize(64),
marginTop: -3,
marginLeft: -4,
marginRight: 16
},
addnew_pic_btn: {
width: pxSize(64),
height: pxSize(64),
marginRight: 16,
marginBottom: 16
},
show_pic_btn: {
width: pxSize(57),
height: pxSize(57),
borderWidth: 1,
borderColor: '#DDDDDD',
borderRadius: 6,
padding: 1
},
del_img_box: {
position: 'absolute',
right: -4,
top: -10,
width: pxSize(20),
height: pxSize(20)
},
// 二级页面-两个提交按钮
sub_box: {
......
......@@ -87,6 +87,7 @@ const styles = StyleSheet.create({
},
image_box: {
width: 14,
height: 14,
marginLeft: 6
},
call_box: {
......
......@@ -7,7 +7,8 @@ import {
ScrollView,
Image,
TouchableOpacity,
TextInput
TextInput,
Platform
} from 'react-native';
import {
home_background_color,
......@@ -32,9 +33,28 @@ import {
ContTextStyle
} from '../common/CellTextStyle';
import { connect } from 'react-redux';
import { isEmpty } from '../../utils/Utils';
import { isEmpty, dedupQuoteArray, show, formatStrForDate } from '../../utils/Utils';
import DateModel from '../common/DateModel';
import DialogModel from '../common/DialogModel';
import {
requestEquipOrganizations,
requestEquipSurgeryHospital,
requestEquipOrderInfo,
uploadEquipImg
} from '../../action/EquipAction';
import {
EQUIP_CONSU_LIST_DOING,
EQUIP_CONSU_LIST_SUCCESS,
EQUIP_CONSU_LIST_FAILURE,
LOGIN_NO,
EQUIP_SUBMIT_DOING,
EQUIP_SUBMIT_SUCCESS,
EQUIP_SUBMIT_FAILURE
} from '../../base/ActionTypes';
import moment from 'moment';
import ImagePicker from 'react-native-image-picker';
import { exitLoginStatus } from '../../action/LoginAction';
import LodingModel from '../common/LodingModel';
class EquipConsuPage extends Component {
constructor(props) {
......@@ -147,37 +167,42 @@ class EquipConsuPage extends Component {
isJumpSubPage: true, // 跳转子页
isShowSub: true, // 是否展示子项
subOption: [
{
"id": "0",
title: '人工髋关节假体-JS-HB ||| T',
tip1: '2001202001001774',
price: '36668',
select: true
},{
"id": "1",
title: '人工髋关节假体-JS-HB ||| T2',
tip1: '2001202001001774',
price: '36668',
select: true
},{
"id": "2",
title: '人工髋关节假体-JS-HB ||| T3',
tip1: '2001202001001774',
price: '36668',
select: true
},{
"id": "3",
title: '人工髋关节假体-JS-HB ||| T4',
tip1: '2001202001001774',
price: '36668',
select: true
},{
"id": "4",
title: '人工髋关节假体-JS-HB ||| T5',
tip1: '2001202001001774',
price: '36668',
select: true
}
// {
// "id": "0",
// item_name: '人工髋关节假体-JS-HB ||| T',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// sale_price: '360000',
// select: true
// },{
// "id": "1",
// item_name: '人工髋关节假体-JS-HB ||| T2',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// sale_price: '36668',
// select: true
// },{
// "id": "2",
// item_name: '人工髋关节假体-JS-HB ||| T3',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// sale_price: '36668',
// select: true
// },{
// "id": "3",
// item_name: '人工髋关节假体-JS-HB ||| T4',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// sale_price: '36668',
// select: true
// },{
// "id": "4",
// item_name: '人工髋关节假体-JS-HB ||| T5',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// sale_price: '36668',
// select: true
// }
]
},
{
......@@ -186,26 +211,26 @@ class EquipConsuPage extends Component {
value: '',
isPicker: false,
select: false,
isAddImage: true // 添加图片
isAddImage: true, // 添加图片
uploadImgArr: [] // 上传后的路径
}
],
submitOption: { // 提交的信息
// seller_code: '', // 用户名username
// org_code: '', // 组织
// customer_code: '', // 手术医院
// bill_to_site_code: '', // 收单地点
// ship_to_site_code: '', // 收货地点
// doctor_name: '', // 主治医生
// // surgery_name: '', // 手术名称
// surgery_date: '', // 手术时间
// // surgery_type_code: '', // 手术类型
// template_collect_number: '', // 配台模版
// order_type_code: '', // 订单类型
// surgery_desc: '', // 备注信息
// voice_url: '', // 录音地址
// order_currency: 'CNY',
// Caller: 'dingding',
// force_balance_check_flag: 'Y', // 检查缺失物料
// seller_code: '', // 用户名username ?? 没有用户名
org_code: '', // 组织
surgery_collect_number: '', // 订单信息 ?? 没有手术医院
patient_name: '', // 患者姓名
patient_gender: '', // 性别
patient_age: '', // 年龄
patient_bed: '', // 床位
patient_id: '', // 病历号
consume_date: '', // 消耗时间
settled_flag: false, // 是否结单
remark: '', // 备注信息
lines: [], // 消耗明细
img_url: '', // 图片路径
},
currentItem: {
name: '请选择',
......@@ -221,20 +246,33 @@ class EquipConsuPage extends Component {
lodingTitle: '加载中',
listCurrentOption: [ // 当前选择器数据
{
name: '',
value: 'boy'
name: '测试1',
value: '测试1'
},
{
name: '',
value: 'girl'
name: '测试2',
value: '测试2'
}
],
dateModelPop: false, // 日期选择器
sexTypeOption: [ // 性别
{
name:'男',
value:'男'
},{
name:'女',
value:'女'
}
],
localPhoOption: [ // 添加的图片
// 'file:///storage/emulated/0/Pictures/images/image-ea1a24b8-2d12-468f-ac23-e9aed20c6d31.jpg'
],
}
}
componentDidMount() {
console.log('houhou hahei!谁在跳???')
this.getSellerName()
}
......@@ -255,10 +293,130 @@ class EquipConsuPage extends Component {
}
}
componentWillReceiveProps(nextProps) {
let { equip_list_status, loginState, navigation, subDetOption, submit_equip_order_status} = this.props
let self = this
if(equip_list_status != nextProps.equip_list_status) {
console.log('-222------', nextProps.equip_list_status)
console.log('--222---equip_list_status--', equip_list_status)
switch (nextProps.equip_list_status) {
case EQUIP_CONSU_LIST_DOING:
this.changeSubLoding(true)
break;
case EQUIP_CONSU_LIST_SUCCESS:
self.setState({
isSubLoding: false,
lodingTitle: '加载中'
},() => {
self.changeCurrentOption()
})
break;
case EQUIP_CONSU_LIST_FAILURE:
this.changeSubLoding(false)
break;
default:
break;
}
}
console.log('-----nextProps.loginState----', nextProps.loginState, loginState)
if(loginState != nextProps.loginState) {
switch(nextProps.loginState) {
case LOGIN_NO:
navigation.navigate('LoginPage')
break;
default:
break;
}
}
// console.log('!!=========单价填完啦??', nextProps, subDetOption)
if(subDetOption != nextProps.subDetOption) {
console.log('!!=========单价填完啦??', nextProps.subDetOption)
let {listOptionData} = this.state
listOptionData[12].subOption = nextProps.subDetOption
this.setState({
listOptionData
})
}
}
// 修改正在加载
changeSubLoding(loading, loadTit) {
this.setState({
isSubLoding: loading || false,
lodingTitle: loadTit || '加载中'
})
}
// 清空当前项以下的值
clearInitNameAndValue(curIndex) {
let { listOptionData, localOtherObj } = this.state
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(index > curIndex && index < 4 ) {
item.name = localOtherObj.name
item.value = localOtherObj.value
}
return item
})
})
}
// 判断是否都有值,修改提交按钮的颜色
changeCanSub(isSubCheck) {
// let { listOptionData } = this.state
// let tempStatus = false
// let tempTit = ''
// for(let chIndex in listOptionData) {
// if(chIndex > 0 && chIndex < 10
// && chIndex != 6 && chIndex != 8
// && !listOptionData[chIndex].value
// && listOptionData[chIndex].name !== '其他') {
// // console.log('chIndex-----',chIndex, chIndex !== 6, typeof chIndex, listOptionData[chIndex].title)
// // 不是主治医生
// tempTit = listOptionData[chIndex].title
// tempStatus = true
// break
// }
// }
// // console.log('tempStatus====',tempStatus)
// this.setState({
// canSubFlag: !tempStatus
// })
// if(isSubCheck && tempStatus) {
// show(`${tempTit}未选择,不能提交`)
// }
}
// 选择器弹窗回调函数
handleCallBack(item, itemTitle) {
console.warn(item, 'item--选择器弹窗回调函数----')
console.warn('item-itemTitle-----',itemTitle)
let { listOptionData} = this.state
let self = this
this.setState({
currentItem: item,
})
this.setState({
listOptionData: listOptionData.map((chItem, index) => {
if(chItem.title === itemTitle) {
console.warn('---hhh-----', item)
chItem.name = item.name
chItem.value = item.value
if(itemTitle === '组织') {
self.clearInitNameAndValue(1)
}
if(itemTitle === '手术医院') {
self.clearInitNameAndValue(2)
}
}
return chItem
})
}, () => {
self.changeCanSub()
})
console.warn('listOptionData[2]-----',this.state.listOptionData[2])
}
// 关闭弹窗
......@@ -268,76 +426,262 @@ class EquipConsuPage extends Component {
})
}
// 修改当前选择器数据
changeCurrentOption() {
let { currentTitle } = this.state
let { equipOrderOption } = this.props
console.log('当前:--equipOrderOption---', equipOrderOption)
let tempOption = []
if(equipOrderOption.length === 0) {
show(`当前${currentTitle}为空`)
return
}
if (currentTitle === '组织') {
tempOption = this.changeNameAndValue(equipOrderOption, 'org_name', 'org_code')
} else if (currentTitle === '手术医院') {
// console.log('----equipOrderOption----', equipOrderOption)
// 去重医院数据
let filterOpt = dedupQuoteArray(equipOrderOption, 'customer_code')
let currentArr = []
if(filterOpt.length) {
filterOpt.forEach(item => {
let obj = {}
obj.customer_code = item.customer_code
obj.customer_name = item.customer_name
currentArr.push(obj)
})
}
tempOption = this.changeNameAndValue(currentArr, 'customer_name', 'customer_code')
} else if (currentTitle === '订单信息') {
console.log('momentvmoment------', moment("2020-04-22T14:17:56").format("YYYY-MM-DD HH:mm:ss"))
let resultArr = []
equipOrderOption.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 HH:mm:ss") : '空'
let tempName = `${collect_number}-${surgery_name}-${create_time}`
obj.name = tempName,
obj.value = item.collect_number
resultArr.push(obj)
})
tempOption = [...resultArr]
// tempOption = this.changeNameAndValue(equipOrderOption, 'value_name', 'value_code')
}
this.setState({
showTypePop: true,
listCurrentOption: [...tempOption]
})
}
// 修改选择器为属性 name 和 value
changeNameAndValue(data, nameType, valueType) {
let result = []
data.forEach(item => {
let obj = {}
obj.name = item[nameType],
obj.value = item[valueType]
result.push(obj)
})
return result
}
// 组织 点击
handleOrganizationCheck() {
console.warn('组织------check')
// let { state, props } = this
// this.setState({
// currentTitle: '组织',
// currentItem: {
// name: state.listOptionData[1].name,
// value: state.listOptionData[1].value
// }
// }, () => {
// let params = {
// access_token: props.token
// }
// props.requestQuickOrganizations(params)
// })
let { state, props } = this
this.setState({
currentTitle: '组织',
currentItem: {
name: state.listOptionData[1].name,
value: state.listOptionData[1].value
}
}, () => {
let params = {
access_token: props.token
}
props.requestEquipOrganizations(params)
})
}
// 手术医院 点击
handleCustomerCheck() {
console.warn('手术医院------check')
// let { state, props } = this
// let self = this
// if(this.judgeOrgIsNull()) {
// self.setState({
// currentTitle: '手术医院',
// currentItem: {
// name: state.listOptionData[2].name,
// value: state.listOptionData[2].value
// }
// }, () => {
// // 在此修改接口
// self.getCustomerData()
// })
// }
let { state, props } = this
let self = this
if(this.judgeOrgIsNull()) {
self.setState({
currentTitle: '手术医院',
currentItem: {
name: state.listOptionData[2].name,
value: state.listOptionData[2].value
}
}, () => {
// 在此修改接口
self.getCustomerData()
})
}
}
// 获取手术医院
getCustomerData() {
let { state, props } = this
let params = {
access_token: props.token,
org_code: state.listOptionData[1].value,
seller_code: props.userInfo.user_name
}
console.log('-----params---', params)
props.requestEquipSurgeryHospital(params)
}
// 订单信息 点击
handleOrderInfoCheck() {
console.warn('订单信息------check')
let { state, props } = this
let that = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
that.setState({
currentTitle: '订单信息',
currentItem: {
name: state.listOptionData[3].name,
value: state.listOptionData[3].value
}
}, () => {
let params = {
access_token: props.token,
org_code: state.listOptionData[1].value,
seller_code: props.userInfo.user_name,
customer_code: state.listOptionData[2].value,
collect_header_status: 'RETURNED,COLLECTED'
}
props.requestEquipOrderInfo(params)
})
}
}
// 消耗时间 点击
handleEquipDateCheck() {
console.warn('消耗时间------check')
let { listOptionData } = this.state
let date = listOptionData[8].value
if(date) {
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(item.title === '消耗时间') {
item.dateValue = formatStrForDate(date)
}
return item
})
})
console.warn('!date----', listOptionData[8])
}
this.closeDateModal(true)
}
// 关闭日期选择器
closeDateModal(show) {
this.setState({
dateModelPop: show
})
}
// 修改当前日期数据
dateModalCallback(date) {
console.warn('callback',date)
let { listOptionData } = this.state
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(item.title === '消耗时间') {
item.name = date
item.value = date
item.dateValue = formatStrForDate(date)
}
return item
})
})
console.warn('--手术类时间---', listOptionData[8])
}
// 患者姓名 输入
handlePatNameInput(text) {
console.warn('患者姓名------input:', text)
let { listOptionData } = this.state
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(item.title === '患者姓名') {
item.value = text
}
return item
})
})
}
// 性别 点击
handleGenderCheck() {
console.warn('性别------check:')
let { listOptionData, sexTypeOption } = this.state
let self = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
self.setState({
currentTitle: '性别',
currentItem: {
name: listOptionData[6].name,
value: listOptionData[6].value
}
}, () => {
self.setState({
showTypePop: true,
listCurrentOption: [...sexTypeOption]
})
})
}
}
// 年龄 输入
handleAgeInput(text) {
console.warn('年龄------input:', text)
let { listOptionData } = this.state
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(item.title === '年龄') {
item.value = text
}
return item
})
})
}
// 床位 输入
handleBedInput(text) {
console.warn('床位------input:', text)
let { listOptionData } = this.state
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(item.title === '床位') {
item.value = text
}
return item
})
})
}
// 病历号 输入
handleRecordNumInput(text) {
console.warn('病历号------input:', text)
let { listOptionData } = this.state
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(item.title === '病历号') {
item.value = text
}
return item
})
})
}
// 结单 是
......@@ -404,22 +748,233 @@ class EquipConsuPage extends Component {
// 耗材明细 点击
handleConsumDetailCheck() {
console.warn('耗材明细------check')
// console.warn('耗材明细------check')
let {listOptionData} = this.state
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()
&& this.judgeOrderInfoIsNull()) {
this.props.navigation.navigate('ConsumDetailsPage', {
title: '器械消耗 - 添加明细'
title: '器械消耗 - 添加明细',
orderId: listOptionData[3].value
})
}
}
// 添加图片 点击
handleAddPicCheck() {
console.warn('添加图片------check')
let { localPhoOption, listOptionData } = this.state
let { props } = this
let that = this
const options = {
title: '选择图片',
cancelButtonTitle: '取消',
takePhotoButtonTitle: '拍照',
chooseFromLibraryButtonTitle: '相册',
cameraType: 'back',
mediaType: 'photo',
videoQuality: 'high',
durationLimit: 10,
maxWidth: 720,
maxHeight: 1280,
aspectX: 2,
aspectY: 1,
quality: 1,
angle: 0,
allowsEditing: false,
noData: false,
storageOptions: {
skipBackup: true,
path: 'images'
}
};
ImagePicker.showImagePicker(options, async (res) => {
console.log('res00000-----------------', res)
if (res.didCancel) {
console.log('User cancelled photo picker');
}
else if (res.error) {
console.log('ImagePicker Error: ', res.error);
if(res.error.indexOf('Camera permissions not granted') > -1){
Alert.alert(('提示信息', 'APP需要使用相机,请打开相机权限允许APP使用'), [{
text: '设置',
onPress: () => {
Linking.openURL('app-settings:')
.catch(err => console.log('error', err))
}
},{
text: '取消'
}])
}
if(res.error.indexOf('Photo library permissions not granted') > -1){
Alert.alert('提示信息', 'APP需要使用相册,请打开相册权限允许APP使用', [{
text: '设置',
onPress: () => {
Linking.openURL('app-settings:')
.catch(err => console.log('error', err))
}
},{
text: '取消'
}]);
}
}
else if (res.customButton) {
console.log('User tapped custom button: ', res.customButton);
} else {
// show('上传中...')
that.changeSubLoding(true, '上传中')
let source; //保存选中的图片
if (Platform.OS === 'android') {
source = res.uri;
} else {
source = res.uri.replace('file://','');
}
const formData = new FormData();
let file = { uri: source, type: 'multipart/form-data', name: res.fileName };
formData.append('file',file);
console.log('formData112===',formData)
let params = {
access_token: props.token,
formData
}
//上传图片接口
console.log('---handleSubmit--',params)
let imgResult = await uploadEquipImg(params);
console.log('返回---imgResult======',imgResult)
if(imgResult.error_code == 0) {
that.changeSubLoding(false)
// 提交订单
show('上传成功');
let {url} = imgResult.data
localPhoOption.push(source);
listOptionData[13].uploadImgArr.push(url)
that.setState({
localPhoOption,
listOptionData
});
// // that.setState({
// // listOptionData: state.listOptionData.map((item, index) => {
// // if(index == 11) {
// // item.value = imgResult.data.url
// // }
// // return item
// // })
// // }, () => {
// // that.changeSubLoding(false)
// // that.submitQuickOrder()
// // })
} else if(imgResult.error_code == 41006) {
that.changeSubLoding(false)
show('登录过期,请重新登录');
props.exitLoginStatus();
} else {
that.changeSubLoding(false)
let error_msg = imgResult.error_msg || imgResult.message
show(error_msg);
}
// uploadEquipImg(params)
// .then((response)=>{
// console.log('response==!!!!----------=', response)
// if (response.error_code === 0) {
// show('上传成功');
// localPhoOption.push(source);
// that.setState({localPhoOption});
// }else if(response.error_code === 41006){
// show('登录过期,请重新登录');
// props.exitLoginStatus()
// } else {
// show(response.error_msg)
// }
// })
}
})
}
// 生成订单 点击
handleSubmit() {
console.warn('生成订单------check')
// 先上传照片,再提交订单
}
// 提交订单
submitQuickOrder() {
}
// 判断组织是否为空
judgeOrgIsNull() {
return this.showTipFirstSelect(1)
// let { listOptionData } = this.state
// let orgVal = listOptionData[1].value
// if(!orgVal) {
// show('请先选择组织')
// return false
// } else {
// return true
// }
}
// 判断手术医院是否为空
judgeCustomerIsNull() {
return this.showTipFirstSelect(2)
// let { listOptionData } = this.state
// let orgVal = listOptionData[2].value
// if(!orgVal) {
// show('请先选择手术医院')
// return false
// } else {
// return true
// }
}
// 判断订单信息是否为空
judgeOrderInfoIsNull() {
return this.showTipFirstSelect(3)
// let { listOptionData } = this.state
// let orgVal = listOptionData[3].value
// if(!orgVal) {
// show(`请先选择${listOptionData[3].title}`)
// return false
// } else {
// return true
// }
}
// 提示请先选择
showTipFirstSelect(ind) {
let { listOptionData } = this.state
let orgVal = listOptionData[ind].value
if(!orgVal) {
show(`请先选择${listOptionData[ind].title}`)
return false
} else {
return true
}
}
// 处理提交后返回的数据
processReturnData() {
}
// 返回备注以上的元素
renderListItem() {
let { listOptionData, dateModelPop } = this.state
......@@ -491,9 +1046,9 @@ class EquipConsuPage extends Component {
<DateModel
date={listOptionData[4].dateValue}
// closeModal={(show) => this.closeDateModal(show)}
closeModal={(show) => this.closeDateModal(show)}
show={dateModelPop}
// callback={(date) => this.dateModalCallback(date)}
callback={(date) => this.dateModalCallback(date)}
/>
</View>
......@@ -695,7 +1250,7 @@ class EquipConsuPage extends Component {
耗材({state.listOptionData[12].subOption.length}
</Text>
{
{/* {
state.listOptionData[12].isShowSub ?
<TouchableOpacity
activeOpacity={.8}
......@@ -711,7 +1266,7 @@ class EquipConsuPage extends Component {
>
<Image style={[icon_style, list_common_item.detail_top_icon]} source={require('../../images/arr_rig.png')} />
</TouchableOpacity>
}
} */}
</View>
{
......@@ -758,13 +1313,13 @@ class EquipConsuPage extends Component {
return(
<View style={list_common_item.con_de_sub} key={index}>
<Text style={list_common_item.de_sub_tit}>
{index+1}{ item.title }
{index+1}{ item.item_name } - {item.specification}
</Text>
<Text style={list_common_item.de_tip}>
序列号:{ item.tip1 }
序列号:{ item.serial_number }
</Text>
<Text style={list_common_item.de_tip}>
单价(¥){ item.price }
单价(¥){ item.sale_price }
</Text>
</View>
)
......@@ -778,31 +1333,54 @@ class EquipConsuPage extends Component {
<View style={list_common_item.addpic_inner}>
<Text style={list_common_item.addpic_tit}>添加图片</Text>
<View style={list_common_item.addpic_cont}>
{
state.localPhoOption.length
? state.localPhoOption.map((item, index) => this.renderPicItem(item, index) )
: null
}
<TouchableOpacity
activeOpacity={.8}
style={list_common_item.addpic_img_btn}
// onPress={() => this.handleAddPicCheck()}
onPress={() => this.handleAddPicCheck()}
>
<Image style={icon_style} source={require('../../images/add_icon_large.png')} />
</TouchableOpacity>
{/* <TouchableOpacity
activeOpacity={.8}
style={list_common_item.addpic_img_btn}>
<Image style={icon_style} source={require('../../images/add_icon_large.png')} />
</TouchableOpacity> */}
</View>
</View>
</CellTextStyle>
)
}
// 返回增加的图片
renderPicItem(item, index) {
console.log('item----',item)
return (
<View style={list_common_item.addnew_pic_btn} key={index}>
<TouchableOpacity
activeOpacity={.8}
style={list_common_item.show_pic_btn}
onPress={()=>console.log('放大图片')}
>
{/* <Image style={icon_style} source={{uri: "file:///storage/emulated/0/Pictures/images/image-ea1a24b8-2d12-468f-ac23-e9aed20c6d31.jpg"}} /> */}
<Image style={icon_style} source={{uri: item}} />
</TouchableOpacity>
<TouchableOpacity
activeOpacity={.8}
style={list_common_item.del_img_box}
onPress={()=>console.log('删除图片')}
>
<Image style={icon_style} source={require('../../images/close_err_icon.png')} />
</TouchableOpacity>
</View>
)
}
// 返回正在加载中
renderLodingItem() {
// let { lodingTitle, isSubLoding } = this.state
// return(
// <LodingModel title={lodingTitle} show={isSubLoding} style_back={styles.loding_back} />
// )
let { lodingTitle, isSubLoding } = this.state
return(
<LodingModel title={lodingTitle} show={isSubLoding} style_back={styles.loding_back} />
)
}
render() {
......@@ -838,6 +1416,9 @@ class EquipConsuPage extends Component {
/>
</ScrollView>
{ this.renderLodingItem() }
</SafeAreaView>
</View>
);
......@@ -907,14 +1488,27 @@ const mapStateToProps = (state) => {
userInfo: state.login.userInfo,
token: state.login.token,
loginState: state.login.loginState,
equip_list_status: state.equip.equip_list_status,
submit_equip_order_status: state.equip.submit_equip_order_status,
equipOrderOption: state.equip.equipOrderOption,
subDetOption: state.equip.subDetOption
}
}
const mapDispatchToProps = (dispatch) => {
return {
// requestOrganizations: (token) => {
// dispatch(requestOrganizations(token))
// }
requestEquipOrganizations: (params) => {
dispatch(requestEquipOrganizations(params))
},
requestEquipSurgeryHospital: (params) => {
dispatch(requestEquipSurgeryHospital(params))
},
requestEquipOrderInfo: (params) => {
dispatch(requestEquipOrderInfo(params))
},
exitLoginStatus: () => {
dispatch(exitLoginStatus())
}
}
}
......
......@@ -24,68 +24,136 @@ import {
import StatusBarView from '../../common/StatusBarView';
import HeadBackItem from '../../common/HeadBackItem';
import DetailsModel from './DetailsModel';
import {
requestEquipDetails
} from '../../../action/EquipAction';
import { connect } from 'react-redux';
import { show} from '../../../utils/Utils';
import LodingModel from '../../common/LodingModel';
class ConsumDetailsPage extends Component {
constructor(props) {
super(props);
this.state = {
searchValue: '',
conDetaOption: [{
"id": "0",
title: '人工髋关节假体-JS-HB ||| T',
tip1: '2001202001001774',
select: false
},{
"id": "1",
title: '人工髋关节假体-JS-HB ||| T2',
tip1: '2001202001001774',
select: false
},{
"id": "2",
title: '人工髋关节假体-JS-HB ||| T3',
tip1: '2001202001001774',
select: true
},{
"id": "3",
title: '人工髋关节假体-JS-HB ||| T4',
tip1: '2001202001001774',
select: true
},{
"id": "4",
title: '人工髋关节假体-JS-HB ||| T5',
tip1: '2001202001001774',
select: true
},{
"id": "5",
title: '人工髋关节假体-JS-HB ||| T6',
tip1: '2001202001001774',
select: true
},{
"id": "6",
title: '人工髋关节假体-JS-HB ||| T',
tip1: '2001202001001774',
select: false
},{
"id": "7",
title: '人工髋关节假体-JS-HB ||| T',
tip1: '2001202001001774',
select: false
},{
"id": "8",
title: '人工髋关节假体-JS-HB ||| T',
tip1: '2001202001001774',
select: false
},{
"id": "9",
title: '人工髋关节假体-JS-HB ||| T',
tip1: '2001202001001774',
select: false
}],
conDetaOption: [
// {
// "id": "0",
// item_name: '人工髋关节假体-JS-HB ||| T',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: false
// },{
// "id": "1",
// item_name: '人工髋关节假体-JS-HB ||| T2',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: false
// },{
// "id": "2",
// item_name: '人工髋关节假体-JS-HB ||| T3',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: true
// },{
// "id": "3",
// item_name: '人工髋关节假体-JS-HB ||| T4',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: true
// },{
// "id": "4",
// item_name: '人工髋关节假体-JS-HB ||| T5',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: true
// },{
// "id": "5",
// item_name: '人工髋关节假体-JS-HB ||| T6',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: true
// },{
// "id": "6",
// item_name: '人工髋关节假体-JS-HB ||| T',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: false
// },{
// "id": "7",
// item_name: '人工髋关节假体-JS-HB ||| T',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: false
// },{
// "id": "8",
// item_name: '人工髋关节假体-JS-HB ||| T',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: false
// },{
// "id": "9",
// item_name: '人工髋关节假体-JS-HB ||| T',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: false
// }
],
selectShowPopup: false, // 共计已选弹窗
localSelectOption: [], // 已选数据
isSubLoding: true, // 加载中弹窗
lodingTitle: '加载中',
}
}
componentDidMount() {
this.getCurOrderDetail()
}
// 获取当前订单的消耗明细
async getCurOrderDetail() {
let {orderId} = this.props.navigation.state.params
let params = {
access_token: this.props.token,
surgery_collect_number: orderId
}
let detailResult = await requestEquipDetails(params)
if(detailResult.error_code === 0) {
let {lines} = detailResult.data
let {subDetOption} = this.props // 【器械消耗】已存在的明细
console.log('subDetOption-----', subDetOption)
subDetOption.length && subDetOption.forEach((item, index) => {
lines.length && lines.forEach((chItem, chInd) => {
if(chItem.serial_number == item.serial_number) {
// chItem.sale_price = item.sale_price
chItem.local_add_price = item.local_add_price
chItem.select = true
}
})
})
this.setState({
isSubLoding: false,
conDetaOption: lines
})
this.changeIsSelected()
} else if(detailResult.error_code === 41006) {
this.changeLodingFlag(false)
show('登录过期,请重新登录');
this.props.exitLoginStatus()
} else {
this.changeLodingFlag(false)
let error_msg = detailResult.error_msg || detailResult.message
show(error_msg);
}
}
// 修改加载中
changeLodingFlag(show) {
this.setState({
isSubLoding: show
})
}
// 取消选择
handleCelSelCheck(item, index) {
console.log('取消===cel:', item, index)
......@@ -98,10 +166,12 @@ class ConsumDetailsPage extends Component {
this.changeIsSelected(index, true)
}
// 修改是否选择
// 修改 当前已选择
changeIsSelected(ind, selFlag) {
let {conDetaOption} = this.state
if(ind) {
conDetaOption[ind].select = selFlag
}
let that = this
this.setState({
conDetaOption
......@@ -133,8 +203,8 @@ class ConsumDetailsPage extends Component {
item.select = false
if(subOpt.length) {
subOpt.forEach(subIt => {
// 根据接口查看!!!!!!!!!!!!当前唯一值
if(subIt.id == item.id) {
// 序列号唯一:serial_number
if(subIt.serial_number == item.serial_number) {
item.select = true
}
})
......@@ -160,13 +230,20 @@ class ConsumDetailsPage extends Component {
}
// 点击 确定耗材
handleSubmit(show) {
handleSubmit() {
console.warn('确定耗材', this.props.navigation.navigate)
this.handleCloseSelectModal(false)
console.warn('携带数据,填写单价') // 可存储于store中!!!
let {localSelectOption} = this.state
if(!localSelectOption.length) {
show('请选择耗材')
return
}
this.props.navigation.navigate('FillUnitPricePage', {
title: '器械消耗 - 填写单价'
title: '器械消耗 - 填写单价',
localSelectOption: localSelectOption
})
}
......@@ -193,7 +270,7 @@ class ConsumDetailsPage extends Component {
return (
<ScrollView
style={styles.cons_cont_scroll}
showsVerticalScrollIndicator={false}
// showsVerticalScrollIndicator={false}
>
<FlatList
style={styles.cons_cont}
......@@ -230,10 +307,10 @@ class ConsumDetailsPage extends Component {
</View>
<View style={styles.sub_list_rig}>
<Text style={styles.rig_tit}>
{item.title}
{item.item_name}
</Text>
<Text style={styles.rig_ser}>
序列号:{item.tip1}
序列号:{item.serial_number}
</Text>
</View>
</View>
......@@ -256,7 +333,7 @@ class ConsumDetailsPage extends Component {
<TouchableOpacity
activeOpacity={.8}
style={[list_common_item.rig_btn, styles.fot_btn_rig]}
onPress={() => this.handleSubmit(selectShowPopup)}
onPress={() => this.handleSubmit()}
>
<Text style={list_common_item.rig_tip}>{'确定耗材'}</Text>
</TouchableOpacity>
......@@ -266,7 +343,7 @@ class ConsumDetailsPage extends Component {
show={ selectShowPopup }
closeModal={(show) => this.handleCloseSelectModal(show)}
closeSelected={(show) => this.handleSubSelected(show)}
closeSubmit={(show) => this.handleSubmit(show)}
closeSubmit={() => this.handleSubmit()}
subOption={ localSelectOption }
callback={(subOpt) => this.detailsCallbak(subOpt)}
/>
......@@ -274,6 +351,14 @@ class ConsumDetailsPage extends Component {
)
}
// 返回正在加载中
renderLodingItem() {
let { lodingTitle, isSubLoding } = this.state
return(
<LodingModel title={lodingTitle} show={isSubLoding} style_back={styles.loding_back} />
)
}
render() {
let {navigation} = this.props
let {title} = navigation.state.params
......@@ -291,6 +376,8 @@ class ConsumDetailsPage extends Component {
{ this.renderContItem() }
{this.renderLodingItem()}
</View>
{this.renderFooterBtnItem()}
</SafeAreaView>
......@@ -347,7 +434,27 @@ const styles = StyleSheet.create({
fot_btn_rig: {
width: pxSize(120)
// width: '38%'
},
loding_back: {
backgroundColor: 'rgba(0, 0, 0, 0)'
}
})
export default ConsumDetailsPage;
const mapStateToProps = (state) => {
return {
userInfo: state.login.userInfo,
token: state.login.token,
loginState: state.login.loginState,
subDetOption: state.equip.subDetOption
}
}
const mapDispatchToProps = (dispatch) => {
return {
// requestEquipOrganizations: (params) => {
// dispatch(requestEquipOrganizations(params))
// }
}
}
export default connect(mapStateToProps, mapDispatchToProps)(ConsumDetailsPage);
......@@ -52,38 +52,44 @@ class DetailsModel extends Component {
contOptionData: [ // 底部产品内容
{
"id": "0",
title: '人工髋关节假体-JS-HB ||| T',
tip1: '2001202001001774',
item_name: '人工髋关节假体-JS-HB ||| T',
specification: '3g,Ytg-DG-SZGT',
serial_number: '2001202001001774',
select: false
},
{
"id": "1",
title: '规格:JS-CGO PE 10 11',
tip1: '2001202001001774',
item_name: '规格:JS-CGO PE 10 11',
specification: '3g,Ytg-DG-SZGT',
serial_number: '2001202001001774',
select: false
},
{
"id": "2",
title: '规格:JS-CGO PE 10 22',
tip1: '2001202001001774',
item_name: '规格:JS-CGO PE 10 22',
specification: '3g,Ytg-DG-SZGT',
serial_number: '2001202001001774',
select: false
},
{
"id": "3",
title: '规格:JS-CGO PE 10 33',
tip1: '2001202001001774',
item_name: '规格:JS-CGO PE 10 33',
specification: '3g,Ytg-DG-SZGT',
serial_number: '2001202001001774',
select: false
},
{
"id": "4",
title: '规格:JS-CGO PE 10 44',
tip1: '2001202001001774',
item_name: '规格:JS-CGO PE 10 44',
specification: '3g,Ytg-DG-SZGT',
serial_number: '2001202001001774',
select: false
},
{
"id": "5",
title: '规格:JS-CGO PE 10 55',
tip1: '2001202001001774',
item_name: '规格:JS-CGO PE 10 55',
specification: '3g,Ytg-DG-SZGT',
serial_number: '2001202001001774',
select: false
}
]
......@@ -209,9 +215,9 @@ class DetailsModel extends Component {
<View style={styles.ri_inner}>
<View style={styles.ri_text_box}>
<Text style={styles.ri_te_tit}>
{ item.title }
{ item.item_name } - {item.specification}
</Text>
<Text style={[styles.ri_te_ot, styles.thr_ot]}>序列号:{item.tip1}</Text>
<Text style={[styles.ri_te_ot, styles.thr_ot]}>序列号:{item.serial_number}</Text>
</View>
<View style={styles.ri_num_box}>
<TouchableOpacity
......
......@@ -14,6 +14,10 @@ import {
} from '../../../base/BaseStyle';
import StatusBarView from '../../common/StatusBarView';
import HeadBackItem from '../../common/HeadBackItem';
import { show } from '../../../utils/Utils';
import { getSubdetailOption } from '../../../action/EquipAction';
import { connect } from 'react-redux';
class FillUnitPricePage extends Component {
constructor(props) {
......@@ -22,37 +26,87 @@ class FillUnitPricePage extends Component {
unitPriceOption: [
{
"id": "2",
title: '人工髋关节假体-JS-HB ||| T3',
tip1: '2001202001001774',
item_name: '人工髋关节假体-JS-HB ||| T',
specification: '3g,Ytg-DG-SZGT',
serial_number: '2001202001001774',
sale_price: 90890,
local_add_price: 90890,
select: true
},{
"id": "3",
title: '人工髋关节假体-JS-HB ||| T4',
tip1: '2001202001001774',
item_name: '人工髋关节假体-JS-HB ||| T4',
specification: '3g,Ytg-DG-SZGT',
serial_number: '2001202001001774',
sale_price: 90890,
local_add_price: 90890,
select: true
},{
"id": "4",
title: '人工髋关节假体-JS-HB ||| T5',
tip1: '2001202001001774',
item_name: '人工髋关节假体-JS-HB ||| T5',
specification: '3g,Ytg-DG-SZGT',
serial_number: '2001202001001774',
sale_price: 90890,
local_add_price: 90890,
select: true
},{
"id": "5",
title: '人工髋关节假体-JS-HB ||| T6',
tip1: '2001202001001774',
item_name: '人工髋关节假体-JS-HB ||| T6',
specification: '3g,Ytg-DG-SZGT',
serial_number: '2001202001001774',
sale_price: 90890,
local_add_price: 90890,
select: true
}
]
}
}
componentDidMount() {
this.getLocalSelectedData()
}
// 获取选择的数据
getLocalSelectedData() {
let {localSelectOption} = this.props.navigation.state.params
console.log('-------localSelectOption--------', localSelectOption)
this.setState({
unitPriceOption: localSelectOption
})
}
// 每一个元素输入单价
handleItemPriceInput(text, index) {
console.warn('单价------input:', text, index)
console.warn('单价------input:', text, index, typeof Number(text))
let {unitPriceOption} = this.state
unitPriceOption[index].local_add_price = Number(text)
this.setState({
unitPriceOption
})
}
// 确定单价 点击
handleSubmit() {
console.warn('确定单价------check:')
let {unitPriceOption} = this.state
let canSubFlag = true
let {props} = this
for(let i in unitPriceOption) {
if(!unitPriceOption[i].local_add_price) {
show('请填写完单价')
canSubFlag = false
break
}
unitPriceOption[i].sale_price = unitPriceOption[i].local_add_price
}
if(canSubFlag) {
this.setState({
unitPriceOption
})
console.log('unitPriceOption====', unitPriceOption)
// 存储于store中,并跳转
props.getSubdetailOption(unitPriceOption)
props.navigation.navigate('EquipConsuPage', { title: '器械消耗' })
}
}
// 返回主要元素
......@@ -60,7 +114,7 @@ class FillUnitPricePage extends Component {
return(
<ScrollView
style={styles.cons_cont_scroll}
showsVerticalScrollIndicator={false}
// showsVerticalScrollIndicator={false}
>
<FlatList
style={styles.cons_cont}
......@@ -76,13 +130,17 @@ class FillUnitPricePage extends Component {
// 返回每一列元素
renderSubListItem(item, index) {
console.log('item, index---',item, index)
let price = ''
if(item.local_add_price) {
price = String(item.local_add_price)
}
return(
<View style={styles.cons_sub_list}>
<Text style={styles.cont_tit}>
{item.title}
{item.item_name}
</Text>
<Text style={styles.cont_ser}>
序列号:{item.tip1}
序列号:{item.serial_number}
</Text>
<View style={styles.cont_pri}>
<Text style={styles.pri_icon}>*</Text>
......@@ -98,7 +156,8 @@ class FillUnitPricePage extends Component {
underlineColorAndroid = {'transparent'}
ref = {textInput => this.TextInput = textInput}
onChangeText={(text) => this.handleItemPriceInput(text, index)}
defaultValue={item.price}
defaultValue={price}
keyboardType={'numeric'}
/>
</TouchableOpacity>
</View>
......@@ -191,7 +250,10 @@ const styles = StyleSheet.create({
fontSize: second_text_size,
color: promary_text_color
},
cont_pri_box: {},
cont_pri_box: {
flex: 1,
paddingRight: 20
},
pri_txt: {
fontFamily: font_family_medium,
fontSize: second_text_size,
......@@ -206,4 +268,20 @@ const styles = StyleSheet.create({
}
})
export default FillUnitPricePage;
\ No newline at end of file
const mapStateToProps = (state) => {
return {
// userInfo: state.login.userInfo,
// token: state.login.token,
// loginState: state.login.loginState
}
}
const mapDispatchToProps = (dispatch) => {
return {
getSubdetailOption: (data) => {
dispatch(getSubdetailOption(data))
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(FillUnitPricePage);
\ No newline at end of file
......@@ -6,14 +6,17 @@ import {
EQUIP_SUBMIT_NO,
EQUIP_SUBMIT_DOING,
EQUIP_SUBMIT_SUCCESS,
EQUIP_SUBMIT_FAILURE
EQUIP_SUBMIT_FAILURE,
EQUIP_INIT_DATA,
GET_SUB_DETAIL_OPTION
} from '../../base/ActionTypes';
// 器械消耗状态
const defaultState = {
equip_list_status: EQUIP_CONSU_LIST_NO, // 获取数据状态
submit_equip_order_status: EQUIP_SUBMIT_NO, // 提交订单状态
equipOrderOption: {} // 当前临时存储数据
equipOrderOption: {}, // 当前选择器临时存储数据
subDetOption: {}, // 选择的消耗明细数据
}
export default equip = (state = defaultState, action) => {
......@@ -45,6 +48,19 @@ export default equip = (state = defaultState, action) => {
return Object.assign({}, state, {
submit_equip_order_status: EQUIP_SUBMIT_FAILURE
})
case EQUIP_INIT_DATA:
return Object.assign({}, state, {
// 初始化数据
equip_list_status: EQUIP_CONSU_LIST_NO,
submit_equip_order_status: EQUIP_SUBMIT_NO,
equipOrderOption: {},
subDetOption: {}
})
case GET_SUB_DETAIL_OPTION:
console.log('----??----存储啦吗??', action.rawData)
return Object.assign({}, state, {
subDetOption: action.rawData
})
default:
return state;
}
......
......@@ -6,7 +6,8 @@ import {
QUICK_SUBMIT_NO,
QUICK_SUBMIT_DOING,
QUICK_SUBMIT_SUCCESS,
QUICK_SUBMIT_FAILURE
QUICK_SUBMIT_FAILURE,
QUICK_INIT_DATA
} from '../../base/ActionTypes';
......@@ -46,6 +47,13 @@ export default quick = (state = defaultState, action) => {
return Object.assign({}, state, {
submit_quick_order_status: QUICK_SUBMIT_FAILURE
})
case QUICK_INIT_DATA:
return Object.assign({}, state, {
// 初始化数据
quick_list_status: QUICK_ORDER_LIST_NO,
submit_quick_order_status: QUICK_SUBMIT_NO,
quickOrderOption: {}
})
default:
return state;
}
......
......@@ -6,7 +6,8 @@ import {
SELF_SUBMIT_NO,
SELF_SUBMIT_DOING,
SELF_SUBMIT_SUCCESS,
SELF_SUBMIT_FAILURE
SELF_SUBMIT_FAILURE,
SELF_INIT_DATA
} from '../../base/ActionTypes';
// 自助下单状态
......@@ -44,6 +45,13 @@ export default selfOrder = (state = defaultState, action) => {
return Object.assign({}, state, {
submit_self_order_status: SELF_SUBMIT_FAILURE
})
case SELF_INIT_DATA:
return Object.assign({}, state, {
// 初始化数据
self_list_status: QUICK_ORDER_LIST_NO,
submit_self_order_status: QUICK_SUBMIT_NO,
selfOrderOption: {}
})
default:
return state;
}
......
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