Commit bfb3a582 by wong.peiyi

自助下单添加多仓显示借货仓库

parent 7a45fc0f
import { PostRequest, GetRequest, UploadRequest } from '../network/RequestUtils'; import { PostRequest, GetRequest, UploadRequest } from '../network/RequestUtils';
import { show, getUrlParams, showWarnErrorMessage, showErrorMessage } from '../utils/Utils'; import { show, getUrlParams, showWarnErrorMessage, showErrorMessage, dedupQuoteArray } from '../utils/Utils';
import { exitLoginStatus } from './LoginAction'; import { exitLoginStatus } from './LoginAction';
import { import {
SELF_ORDER_LIST_DOING, SELF_ORDER_LIST_DOING,
...@@ -44,6 +44,42 @@ export function requestSelfOrganizations(params) { ...@@ -44,6 +44,42 @@ export function requestSelfOrganizations(params) {
} }
} }
// 获取未定单据借货设置 params={access_token:'', org_code:'', customer_code: '', bill_to_site_code: '', ship_to_site_code: '', process_code: ''}
export function requestQuickSurColSetting(params) {
return (dispatch, getState) => {
dispatch(requestListDataing());
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/surgery/collect_setting/search', params))
.then(res => {
console.log('获取未定单据借货设置 res=====', res);
if(res.error_code == 0) {
let { data } = res
let filterOpt = dedupQuoteArray(data, 'source_inv_code')
dispatch(requestListDataSuccess(filterOpt));
}else {
showWarnErrorMessage(dispatch, res, exitLoginStatus, requestListDataFail);
}
// else if(res.error_code === 41006) {
// show('登录过期,请重新登录');
// dispatch(exitLoginStatus());
// }else if(res.status === 404){
// show('请求接口不存在,请联系管理员!')
// dispatch(requestListDataFail());
// } else {
// let error_msg = res.error_msg || res.message
// show(error_msg);
// dispatch(requestListDataFail());
// }
})
.catch(err => {
// console.log('------err-====获取未定单据借货设置----', Object.keys(err), err)
// show(err.error);
// dispatch(requestListDataFail());
showErrorMessage(dispatch, err, requestListDataFail, '获取未定单据借货设置');
})
}
}
export const reqSelfOrganizations = async (global_domain_config, params) => { export const reqSelfOrganizations = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/authorized_inventory/search', params)) return await GetRequest(global_domain_config, getUrlParams('/authorized_inventory/search', params))
} }
......
...@@ -613,10 +613,10 @@ class EquipConsuPage extends Component { ...@@ -613,10 +613,10 @@ class EquipConsuPage extends Component {
tempStatus = true tempStatus = true
break break
} }
if ((chIndex === 14 && sysValues.OBS_MOBILE_DEPARTMENT_DISPLAY > 2) if (((chIndex == 14 && sysValues.OBS_MOBILE_DEPARTMENT_DISPLAY > 2)
|| (chIndex === 15 && sysValues.OBS_MOBILE_BM_DISPLAY > 2) || (chIndex == 15 && sysValues.OBS_MOBILE_BM_DISPLAY > 2)
|| (chIndex === 16 && sysValues.OBS_MOBILE_SUR_FOLLOWER_DISPLAY > 2) || (chIndex == 16 && sysValues.OBS_MOBILE_SUR_FOLLOWER_DISPLAY > 2)
|| (chIndex === 17 && sysValues.OBS_MOBILE_DELIVERYMAN_DISPLAY > 2) || (chIndex == 17 && sysValues.OBS_MOBILE_DELIVERYMAN_DISPLAY > 2))
&& !listOptionData[chIndex].value) { && !listOptionData[chIndex].value) {
tempTit = listOptionData[chIndex].title tempTit = listOptionData[chIndex].title
tempStatus = true tempStatus = true
......
...@@ -11,7 +11,7 @@ import LodingModel from '../common/LodingModel'; ...@@ -11,7 +11,7 @@ import LodingModel from '../common/LodingModel';
import DateModel from '../common/DateModel'; import DateModel from '../common/DateModel';
import { AudioRecorder, AudioUtils } from 'react-native-audio'; import { AudioRecorder, AudioUtils } from 'react-native-audio';
import Sound from 'react-native-sound'; import Sound from 'react-native-sound';
import { requestSelfOrganizations, requestSelfSurgeryHospital, requestSelfOrderType, requestSelfTemplateCollect, requestSelfAudio, requestSelfSumbit, setSelfInitData, reqSelfSurgeryHospital, requestListDataSuccess, requestSelfSurgeryType, setSelectProductOpts, reqSelfOrganizations, reqOrgDepartments } from '../../action/SelfAction'; import { requestSelfOrganizations, requestSelfSurgeryHospital, requestSelfOrderType, requestSelfTemplateCollect, requestSelfAudio, requestSelfSumbit, setSelfInitData, reqSelfSurgeryHospital, requestListDataSuccess, requestSelfSurgeryType, setSelectProductOpts, reqSelfOrganizations, reqOrgDepartments, requestQuickSurColSetting} from '../../action/SelfAction';
import { exitLoginStatus, requestSysProfile } from '../../action/LoginAction'; import { exitLoginStatus, requestSysProfile } from '../../action/LoginAction';
import { SELF_ORDER_LIST_DOING, SELF_ORDER_LIST_SUCCESS, SELF_ORDER_LIST_FAILURE, LOGIN_NO, SELF_SUBMIT_DOING, SELF_SUBMIT_SUCCESS, SELF_SUBMIT_FAILURE } from '../../base/ActionTypes'; import { SELF_ORDER_LIST_DOING, SELF_ORDER_LIST_SUCCESS, SELF_ORDER_LIST_FAILURE, LOGIN_NO, SELF_SUBMIT_DOING, SELF_SUBMIT_SUCCESS, SELF_SUBMIT_FAILURE } from '../../base/ActionTypes';
import PageListArrow from '../common/listDataComponent/PageListArrow'; import PageListArrow from '../common/listDataComponent/PageListArrow';
...@@ -147,6 +147,12 @@ class SelfOrderPage extends Component { ...@@ -147,6 +147,12 @@ class SelfOrderPage extends Component {
title: '送货员', title: '送货员',
name: '请选择', name: '请选择',
value: '', value: '',
},
{
"id": "18",
title: '借货仓库',
name: '请选择',
value: '',
} }
], ],
subInitListOption: [], // 存储最初数据 subInitListOption: [], // 存储最初数据
...@@ -195,10 +201,11 @@ class SelfOrderPage extends Component { ...@@ -195,10 +201,11 @@ class SelfOrderPage extends Component {
isShowImage: false, isShowImage: false,
currShowImgIndex: 0, currShowImgIndex: 0,
sysValues: { sysValues: {
OBS_MOBILE_DEPARTMENT_DISPLAY: 'N', OBS_MOBILE_DEPARTMENT_DISPLAY: 0,
OBS_MOBILE_BM_DISPLAY: 'N', OBS_MOBILE_BM_DISPLAY: 0,
OBS_MOBILE_SUR_FOLLOWER_DISPLAY: 'N', OBS_MOBILE_SUR_FOLLOWER_DISPLAY: 0,
OBS_MOBILE_DELIVERYMAN_DISPLAY: 'N', OBS_MOBILE_DELIVERYMAN_DISPLAY: 0,
OBS_MOBILE_BOR_WARE_REQUIRED: 0
}, },
departments: [] departments: []
} }
...@@ -243,7 +250,7 @@ class SelfOrderPage extends Component { ...@@ -243,7 +250,7 @@ class SelfOrderPage extends Component {
} }
const res = await requestSysProfile(global_domain_config, params) const res = await requestSysProfile(global_domain_config, params)
if (res.error_code || res.status) return if (res.error_code || res.status) return
sysValues[key] = res.data.profile_value sysValues[key] = isNaN(res.data.profile_value) ? res.data.profile_value : parseInt(res.data.profile_value)
this.setState({ this.setState({
sysValues sysValues
}) })
...@@ -512,10 +519,11 @@ class SelfOrderPage extends Component { ...@@ -512,10 +519,11 @@ class SelfOrderPage extends Component {
} }
break break
} }
if ((chIndex === 14 && sysValues.OBS_MOBILE_DEPARTMENT_DISPLAY > 2) if (((chIndex == 14 && sysValues.OBS_MOBILE_DEPARTMENT_DISPLAY > 2)
|| (chIndex === 15 && sysValues.OBS_MOBILE_BM_DISPLAY > 2) || (chIndex == 15 && sysValues.OBS_MOBILE_BM_DISPLAY > 2)
|| (chIndex === 16 && sysValues.OBS_MOBILE_SUR_FOLLOWER_DISPLAY > 2) || (chIndex == 16 && sysValues.OBS_MOBILE_SUR_FOLLOWER_DISPLAY > 2)
|| (chIndex === 17 && sysValues.OBS_MOBILE_DELIVERYMAN_DISPLAY > 2) || (chIndex == 17 && sysValues.OBS_MOBILE_DELIVERYMAN_DISPLAY > 2)
|| (chIndex == 18 && sysValues.OBS_MOBILE_BOR_WARE_REQUIRED > 2))
&& !listOptionData[chIndex].value) { && !listOptionData[chIndex].value) {
tempTit = listOptionData[chIndex].title tempTit = listOptionData[chIndex].title
tempStatus = true tempStatus = true
...@@ -642,6 +650,9 @@ class SelfOrderPage extends Component { ...@@ -642,6 +650,9 @@ class SelfOrderPage extends Component {
// } // }
else if (currentTitle === '订单类型') { else if (currentTitle === '订单类型') {
tempOption = that.changeNameAndValue(selfOrderOption, 'value_name', 'value_code') tempOption = that.changeNameAndValue(selfOrderOption, 'value_name', 'value_code')
} else if (currentTitle === '借货仓库') {
let filterOpt = dedupQuoteArray(selfOrderOption, 'source_inv_code')
tempOption = this.changeNameAndValue(filterOpt, 'source_inv_name', 'source_inv_code')
} }
that.setState({ that.setState({
listCurrentOption: [...tempOption] listCurrentOption: [...tempOption]
...@@ -1287,6 +1298,31 @@ class SelfOrderPage extends Component { ...@@ -1287,6 +1298,31 @@ class SelfOrderPage extends Component {
}) })
} }
// 借货仓库 点击
handleWareCheck(curData){
let { state, props } = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
this.setState({
currentTitle: curData.title,
currentItem: {
name: curData.name,
value: curData.value
}
}, () => {
// 在此修改接口
let params = {
access_token: props.token,
org_code: state.listOptionData[1].value,
customer_code: state.listOptionData[2].value,
bill_to_site_code: state.listOptionData[3].value,
ship_to_site_code: state.listOptionData[4].value,
process_code: 'COLLECT'
}
props.requestQuickSurColSetting(params)
})
}
}
// 添加图片 点击 // 添加图片 点击
handleAddPicCheck() { handleAddPicCheck() {
let { localPhoOption, listOptionData } = this.state let { localPhoOption, listOptionData } = this.state
...@@ -1480,6 +1516,7 @@ class SelfOrderPage extends Component { ...@@ -1480,6 +1516,7 @@ class SelfOrderPage extends Component {
tempSubOption.voice_url = state.listOptionData[12].value tempSubOption.voice_url = state.listOptionData[12].value
tempSubOption.image_url = state.listOptionData[13].uploadImgArr.join(',') tempSubOption.image_url = state.listOptionData[13].uploadImgArr.join(',')
tempSubOption.collect_src_inv_code = state.listOptionData[18].value
// 有部门显示的提交 // 有部门显示的提交
const {sysValues} = state const {sysValues} = state
...@@ -1938,6 +1975,20 @@ class SelfOrderPage extends Component { ...@@ -1938,6 +1975,20 @@ class SelfOrderPage extends Component {
listIsAudio={true} listIsAudio={true}
/> />
{
sysValues.OBS_MOBILE_BOR_WARE_REQUIRED > 1 ?
<PageListArrow
listActOpa={.8}
listHasAster={sysValues.OBS_MOBILE_BOR_WARE_REQUIRED > 2}
listItem={listOptionData[18]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleWareCheck(listOptionData[18])}
listHasArrow={true}
/>
: <Text></Text>
}
<DateModel <DateModel
date={listOptionData[6].dateValue} date={listOptionData[6].dateValue}
closeModal={(show) => this.closeDateModal(show)} closeModal={(show) => this.closeDateModal(show)}
...@@ -2293,6 +2344,9 @@ const mapDispatchToProps = (dispatch) => { ...@@ -2293,6 +2344,9 @@ const mapDispatchToProps = (dispatch) => {
}, },
setSelectProductOpts: (data) => { setSelectProductOpts: (data) => {
dispatch(setSelectProductOpts(data)) dispatch(setSelectProductOpts(data))
},
requestQuickSurColSetting: (params) => {
dispatch(requestQuickSurColSetting(params))
} }
} }
} }
......
...@@ -541,7 +541,7 @@ class TransOrderPage extends Component { ...@@ -541,7 +541,7 @@ class TransOrderPage extends Component {
tempTit = `“${listOptionData[chIndex].title}”未添加` tempTit = `“${listOptionData[chIndex].title}”未添加`
tempStatus = true tempStatus = true
break break
} else if (chIndex == 9 && !listOptionData[chIndex].value) { } else if (chIndex == 9 && sysValues.OBS_MOBILE_TRANS_DEPARTMENT_DISPLAY > 2 && !listOptionData[chIndex].value) {
tempTit = `“${listOptionData[chIndex].title}”未选择` tempTit = `“${listOptionData[chIndex].title}”未选择`
tempStatus = true tempStatus = true
break break
......
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