Commit 18e709e5 by peii

Merge branch 'develop' into product

parents a9e327f4 66740df1
......@@ -168,7 +168,7 @@ android {
resValue "string", "baseUrl", '"https://hos.dev.bjhh.guke.tech"'
}
gyxj {
resValue "string", "baseUrl", '"http://190.3.1.42"'
resValue "string", "baseUrl", '"https://obs-pro.xtmy.com:14500"'
}
hzngz {
resValue "string", "baseUrl", '"https://obs.hzn.orth.tech"'
......
import * as R from 'ramda';
import {
LOGIN_DOING,
LOGIN_SUCCESS,
......@@ -7,7 +8,8 @@ import {
AUTO_LOGIN_FAILURE,
SET_DOMAIN_CONFIGURATE,
SET_VERSION_APK,
SET_DOMAIN_FROM_ORIGIN
SET_DOMAIN_FROM_ORIGIN,
SET_SYSPROFILE
} from '../base/ActionTypes';
import { GetRequest, PostRequest } from '../network/RequestUtils';
import { getUrlParams, show, showWarnErrorMessage, showErrorMessage } from '../utils/Utils';
......@@ -22,6 +24,7 @@ export function requestLogin(params) {
if(res.functions && res.functions.length) {
show('登录成功');
dispatch(loginSuccess(res, params.data.user_name, params.data.user_password));
dispatch(getSysProfiles())
} else {
show(`当前用户没有菜单权限,\n请联系管理员配置!`)
dispatch(loginFailure())
......@@ -156,3 +159,44 @@ export function setVersionApk(versionApk) {
local_version_apk: versionApk
}
}
/**
* @description: 获取系统配置
* @param {*} access_token
* @return {*}
*/
export function getSysProfiles() {
return (dispatch, getState) => {
let {global_domain_config, token, originSysProfiles} = getState().login
function getSysProfile(profile_code) {
const params = {
access_token: token,
profile_code
}
requestSysProfile(global_domain_config, params).then(res => {
console.log(res)
if (res.error_code === 0) {
const value = R.pathOr(originSysProfiles[profile_code], ['data', 'profile_value'])(res)
dispatch(setSysProfiles(profile_code, value))
}
})
}
R.compose(R.map(getSysProfile), R.keys)(originSysProfiles)
}
}
/**
* @description: 设置系统配置
* @param {*} code
* @param {*} value
* @return {*}
*/
export function setSysProfiles(code, value) {
return {
type: SET_SYSPROFILE,
code,
value
}
}
\ No newline at end of file
......@@ -9,6 +9,8 @@ export const AUTO_LOGIN_FAILURE = "AUTO_LOGIN_FAILURE"
export const SET_DOMAIN_CONFIGURATE="SET_DOMAIN_CONFIGURATE"
export const SET_DOMAIN_FROM_ORIGIN = 'SET_DOMAIN_FROM_ORIGIN'
export const SET_VERSION_APK="SET_VERSION_APK"
export const GET_SYSPROFILE = "GET_SYSPROFILE"
export const SET_SYSPROFILE = "SET_SYSPROFILE"
//-----------self order---------------------
export const SELF_ORDER_LIST_NO = "SELF_ORDER_LIST_NO"
export const SELF_ORDER_LIST_DOING = "SELF_ORDER_LIST_DOING"
......
......@@ -638,7 +638,7 @@ class EquipConsuPage extends Component {
let orgResult = await reqEquipOrganizations(global_domain_config, params);
if (orgResult.error_code == 0) {
let { data: { organizations } } = orgResult
let { listOptionData } = state
let { listOptionData, sysValues } = state
// props.requestListDataSuccess(organizations)
let filterOpt = dedupQuoteArray(organizations, 'org_code')
if (filterOpt.length === 0) {
......@@ -652,9 +652,19 @@ class EquipConsuPage extends Component {
listOptionData
}, () => {
that.organizationGetCustomerData()
that.getDepartmentsByOrg(listOptionData[1].value)
setTimeout(() => {
if (sysValues.OBS_MOBILE_CONSU_DEPARTMENT_DISPLAY > 0) {
that.getDepartmentsByOrg(listOptionData[1].value)
}
}, 1000)
})
}
// 贵州需要不显示组织, 所以只能每个用户只能授权1个组织
const isShowOrg = R.compose(R.equals('Y'), R.prop('OBS_SHOW_ORG_FLAG'))(this.props.sysProfiles)
if (!isShowOrg && filterOpt.length > 1) {
show(`请先选择组织`)
}
} else if (orgResult.error_code == 41006) {
show('登录过期,请重新登录');
props.exitLoginStatus();
......@@ -1479,6 +1489,8 @@ class EquipConsuPage extends Component {
// 返回备注以上的元素
renderListItem() {
let { listOptionData, dateModelPop, sysValues } = this.state
const isShowOrg = R.compose(R.equals('Y'), R.prop('OBS_SHOW_ORG_FLAG'))(this.props.sysProfiles)
return(
<View style={styles.list_cont}>
<PageListArrow
......@@ -1489,15 +1501,19 @@ class EquipConsuPage extends Component {
listDefaValue={'name'}
listTitle={'title'}
/>
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[1]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleOrganizationCheck(listOptionData[1])}
listHasArrow={true}
/>
{
isShowOrg && (
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[1]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleOrganizationCheck(listOptionData[1])}
listHasArrow={true}
/>
)
}
{
sysValues.OBS_MOBILE_CONSU_DEPARTMENT_DISPLAY > 0 && (
<PageListArrow
......@@ -2055,6 +2071,7 @@ const mapStateToProps = (state) => {
equipOrderOption: state.equip.equipOrderOption,
subDetOption: state.equip.subDetOption,
charDetailOption: state.equip.charDetailOption,
sysProfiles: state.login.sysProfiles,
global_domain_config: state.login.global_domain_config
}
}
......
......@@ -8,6 +8,7 @@ import {
ScrollView,
SafeAreaView
} from 'react-native';
import * as R from 'ramda';
import {
promary_color,
safe_view,
......@@ -552,6 +553,11 @@ class LineOrderPage extends Component {
// 返回弹窗
renderDetailModel() {
let {popFormItem, toolShowPopup} = this.state
const { sysProfiles } = this.props
let {supIndex} = this.props.navigation.state.params
const showSalePrice = R.compose(R.equals('Y'), R.prop('SUR_MOBILE_HISTORY_SALE_PRICE_SHOW_FLAG'))(sysProfiles)
console.log(supIndex);
return (
<ShowModel
title={ popFormItem.item_name}
......@@ -586,6 +592,36 @@ class LineOrderPage extends Component {
</Text> : null
}
{
popFormItem.serial_number ?
<Text style={styles.mo_cont_tip}>
序列号:{popFormItem.serial_number}
</Text> : null
}
{
popFormItem.production_batch_number ?
<Text style={styles.mo_cont_tip}>
生产批号:{popFormItem.production_batch_number}
</Text> : null
}
{
popFormItem.production_serial_number ?
<Text style={styles.mo_cont_tip}>
生产序号:{popFormItem.production_serial_number}
</Text> : null
}
{
popFormItem.production_date ?
<Text style={styles.mo_cont_tip}>
生产日期:{moment(popFormItem.production_date).format('YYYY-MM-DD')}
</Text> : null
}
{
popFormItem.expiration_date ?
<Text style={styles.mo_cont_tip}>
过期日期:{moment(popFormItem.expiration_date).format('YYYY-MM-DD')}
</Text> : null
}
{
popFormItem.plan_quantity ?
<Text style={styles.mo_cont_tip}>
计划数量:{popFormItem.plan_quantity}
......@@ -604,10 +640,10 @@ class LineOrderPage extends Component {
</Text> : null
}
{
popFormItem.sale_price ?
!popFormItem.sale_price || !showSalePrice && supIndex === 0 ? null :
<Text style={styles.mo_cont_tip}>
销售价格:{popFormItem.sale_price}
</Text> : null
</Text>
}
</View>
</View>
......@@ -770,7 +806,8 @@ const mapStateToProps = (state) => {
return {
token: state.login.token,
loginState: state.login.loginState,
global_domain_config: state.login.global_domain_config
global_domain_config: state.login.global_domain_config,
sysProfiles: state.login.sysProfiles,
}
}
......
......@@ -911,7 +911,7 @@ class EquipConsuPage extends Component {
let orgResult = await reqQuickOrganizations(global_domain_config, params);
if (orgResult.error_code == 0) {
let { data: { organizations } } = orgResult
let { listOptionData } = state
let { listOptionData, sysValues } = state
// props.requestListDataSuccess(organizations)
let filterOpt = dedupQuoteArray(organizations, 'org_code')
if (filterOpt.length === 0) {
......@@ -925,9 +925,19 @@ class EquipConsuPage extends Component {
listOptionData
}, () => {
that.organizationGetCustomerData()
that.getDepartmentsByOrg(listOptionData[1].value)
setTimeout(() => {
if (sysValues.OBS_MOBILE_DEPARTMENT_DISPLAY > 0) {
that.getDepartmentsByOrg(listOptionData[1].value)
}
}, 1000);
})
}
// 贵州需要不显示组织, 所以只能每个用户只能授权1个组织
const isShowOrg = R.compose(R.equals('Y'), R.prop('OBS_SHOW_ORG_FLAG'))(this.props.sysProfiles)
if (!isShowOrg && filterOpt.length > 1) {
show(`请先选择组织`)
}
}else {
this.showWarnError(orgResult)
}
......@@ -1648,6 +1658,8 @@ class EquipConsuPage extends Component {
// 返回备注以上的元素
renderListItem() {
let { listOptionData, dateModelPop, sysValues } = this.state
const isShowOrg = R.compose(R.equals('Y'), R.prop('OBS_SHOW_ORG_FLAG'))(this.props.sysProfiles)
return(
<View style={styles.list_cont}>
<PageListArrow
......@@ -1658,15 +1670,19 @@ class EquipConsuPage extends Component {
listDefaValue={'name'}
listTitle={'title'}
/>
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[1]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleOrganizationCheck(listOptionData[1])}
listHasArrow={true}
/>
{
isShowOrg && (
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[1]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleOrganizationCheck(listOptionData[1])}
listHasArrow={true}
/>
)
}
{
sysValues.OBS_MOBILE_DEPARTMENT_DISPLAY > 1 && (
......@@ -2021,7 +2037,8 @@ const mapStateToProps = (state) => {
quick_list_status: state.quick.quick_list_status,
submit_quick_order_status: state.quick.submit_quick_order_status,
quickOrderOption: state.quick.quickOrderOption,
global_domain_config: state.login.global_domain_config
global_domain_config: state.login.global_domain_config,
sysProfiles: state.login.sysProfiles,
}
}
......
......@@ -805,7 +805,7 @@ class SelfOrderPage extends Component {
let orgResult = await reqSelfOrganizations(global_domain_config, params);
if (orgResult.error_code == 0) {
let { data: { organizations } } = orgResult
let { listOptionData } = state
let { listOptionData, sysValues } = state
// props.requestListDataSuccess(organizations)
let filterOpt = dedupQuoteArray(organizations, 'org_code')
if (filterOpt.length === 0) {
......@@ -819,9 +819,19 @@ class SelfOrderPage extends Component {
listOptionData
}, () => {
that.organizationGetCustomerData()
that.getDepartmentsByOrg(listOptionData[1].value)
setTimeout(() => {
if (sysValues.OBS_MOBILE_DEPARTMENT_DISPLAY > 0) {
that.getDepartmentsByOrg(listOptionData[1].value)
}
}, 1000);
})
}
// 贵州需要不显示组织, 所以只能每个用户只能授权1个组织
const isShowOrg = R.compose(R.equals('Y'), R.prop('OBS_SHOW_ORG_FLAG'))(this.props.sysProfiles)
if (!isShowOrg && filterOpt.length > 1) {
show(`请先选择组织`)
}
} else if (orgResult.error_code == 41006) {
show('登录过期,请重新登录');
props.exitLoginStatus();
......@@ -1860,6 +1870,8 @@ class SelfOrderPage extends Component {
// 返回备注以上的元素
renderListItem() {
let { listOptionData, dateModelPop, sysValues } = this.state
const isShowOrg = R.compose(R.equals('Y'), R.prop('OBS_SHOW_ORG_FLAG'))(this.props.sysProfiles)
return (
<View style={styles.list_cont}>
<PageListArrow
......@@ -1870,15 +1882,19 @@ class SelfOrderPage extends Component {
listDefaValue={'name'}
listTitle={'title'}
/>
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[1]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleOrganizationCheck(listOptionData[1])}
listHasArrow={true}
/>
{
isShowOrg && (
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[1]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleOrganizationCheck(listOptionData[1])}
listHasArrow={true}
/>
)
}
{
sysValues.OBS_MOBILE_DEPARTMENT_DISPLAY > 1 && (
<PageListArrow
......@@ -2372,7 +2388,8 @@ const mapStateToProps = (state) => {
submit_self_order_status: state.selfOrder.submit_self_order_status,
selfOrderOption: state.selfOrder.selfOrderOption,
global_domain_config: state.login.global_domain_config,
local_sele_pro_options: state.selfOrder.local_sele_pro_options
local_sele_pro_options: state.selfOrder.local_sele_pro_options,
sysProfiles: state.login.sysProfiles
}
}
......
......@@ -742,6 +742,10 @@ class ChooseProductPage extends Component {
return list
}
if (isOperation) {
return list
}
if (isBlank(searchValue)) return list
const keys = ['general_name', 'item_name', 'specification', 'manufacturer_product_code', 'initials_pinyin', 'serial_number', 'category_name']
......
......@@ -502,7 +502,7 @@ class TransOrderPage extends Component {
// 清空当前项以下的值
clearInitNameAndValue(startIndex, endIndex = 5) {
let { listOptionData, localOtherObj } = this.state
let { listOptionData, localOtherObj, sysValues } = this.state
let that = this
this.setState({
listOptionData: listOptionData.map(async (item, index) => {
......@@ -510,7 +510,9 @@ class TransOrderPage extends Component {
item.name = localOtherObj.name
item.value = localOtherObj.value
if(listOptionData[1].value && item.title == '客户名称') {
await that.getDepartmentsByOrg(listOptionData[1].value)
if (sysValues.OBS_MOBILE_TRANS_DEPARTMENT_DISPLAY > 0) {
that.getDepartmentsByOrg(listOptionData[1].value)
}
setTimeout(() => {
that.organizationGetCustomerData()
}, 0);
......@@ -687,7 +689,7 @@ class TransOrderPage extends Component {
let orgResult = await reqTransOrganizations(global_domain_config, params);
if (orgResult.error_code == 0) {
let { data: { organizations } } = orgResult
let { listOptionData } = state
let { listOptionData, sysValues } = state
// props.requestListDataSuccess(organizations)
let filterOpt = dedupQuoteArray(organizations, 'org_code')
if (filterOpt.length === 0) {
......@@ -700,12 +702,20 @@ class TransOrderPage extends Component {
that.setState({
listOptionData
}, async () => {
await that.getDepartmentsByOrg(listOptionData[1].value)
setTimeout(() => {
that.organizationGetCustomerData()
}, 0);
if (sysValues.OBS_MOBILE_TRANS_DEPARTMENT_DISPLAY > 0) {
that.getDepartmentsByOrg(listOptionData[1].value)
}
}, 1000)
})
}
// 贵州需要不显示组织, 所以只能每个用户只能授权1个组织
const isShowOrg = R.compose(R.equals('Y'), R.prop('OBS_SHOW_ORG_FLAG'))(this.props.sysProfiles)
if (!isShowOrg && filterOpt.length > 1) {
show(`请先选择组织`)
}
}else {
this.showWarnError(orgResult)
}
......@@ -1311,6 +1321,8 @@ class TransOrderPage extends Component {
// 返回备注以上的元素
renderListItem() {
let { listOptionData, sysValues } = this.state
const isShowOrg = R.compose(R.equals('Y'), R.prop('OBS_SHOW_ORG_FLAG'))(this.props.sysProfiles)
return(
<View style={styles.list_cont}>
<PageListArrow
......@@ -1321,15 +1333,19 @@ class TransOrderPage extends Component {
listDefaValue={'name'}
listTitle={'title'}
/>
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[1]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleOrganizationCheck(listOptionData[1])}
listHasArrow={true}
/>
{
isShowOrg && (
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[1]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleOrganizationCheck(listOptionData[1])}
listHasArrow={true}
/>
)
}
{
sysValues.OBS_MOBILE_TRANS_DEPARTMENT_DISPLAY > 1 && (
<PageListArrow
......@@ -1737,7 +1753,8 @@ const mapStateToProps = (state) => {
submit_trans_order_status: state.trans.submit_trans_order_status,
transOrderOption: state.trans.transOrderOption,
subTransDetOption: state.trans.subTransDetOption,
global_domain_config: state.login.global_domain_config
global_domain_config: state.login.global_domain_config,
sysProfiles: state.login.sysProfiles,
}
}
......
......@@ -8,7 +8,8 @@ import {
AUTO_LOGIN_FAILURE,
SET_DOMAIN_CONFIGURATE,
SET_VERSION_APK,
SET_DOMAIN_FROM_ORIGIN
SET_DOMAIN_FROM_ORIGIN,
SET_SYSPROFILE
} from '../../base/ActionTypes';
// 登录状态
......@@ -21,9 +22,14 @@ const defaultState = {
global_domain_config: 'https://obs.uat.guke.tech',
hasSetDomainFromOrigin: false,
local_version_apk: '',
// 默认【深圳仓】https://obs.uat.guke.tech;【十方uat】https://obs.uat.sfrx.guke.tech;【十方pro】https://obs.sfrx.orth.tech
// 【国药dev】https://obs.dev.guke.tech;【国药pro】https://obs-pro.gyjtsx.com
// 【国药uat】https://obs-dev.gyjtsx.com
originSysProfiles: {
OBS_SHOW_ORG_FLAG: 'Y',
SUR_MOBILE_HISTORY_SALE_PRICE_SHOW_FLAG: 'Y'
},
sysProfiles: {
OBS_SHOW_ORG_FLAG: 'Y',
SUR_MOBILE_HISTORY_SALE_PRICE_SHOW_FLAG: 'Y'
}
}
export default login = (state = defaultState, action) => {
......@@ -73,6 +79,13 @@ export default login = (state = defaultState, action) => {
return Object.assign({}, state, {
local_version_apk: action.local_version_apk
})
case SET_SYSPROFILE:
return Object.assign({}, state, {
sysProfiles: {
...state.sysProfiles,
[action.code]: action.value
}
})
default: // need this for default case
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