Commit 046384c3 by Denglingling

完善【转单申请】模块,转单提交以及转单查询基本功能;

(cherry picked from commit 6a12e04a)
parent 93628fd7
...@@ -9,7 +9,7 @@ import { ...@@ -9,7 +9,7 @@ import {
TRANS_SUBMIT_SUCCESS, TRANS_SUBMIT_SUCCESS,
TRANS_SUBMIT_FAILURE, TRANS_SUBMIT_FAILURE,
TRANS_INIT_DATA, TRANS_INIT_DATA,
GET_TRANS_DETAIL_OPTION SET_TRANS_DETAIL_OPTION
} from '../base/ActionTypes'; } from '../base/ActionTypes';
// 获取组织 params={access_token:''} // 获取组织 params={access_token:''}
...@@ -113,11 +113,12 @@ function requestListDataFail() { ...@@ -113,11 +113,12 @@ function requestListDataFail() {
} }
} }
// 获取当前临时存储的明细 // 获取当前临时存储的明细、以及搜索条件
export function getTransDetailOption(data) { export function setTransDetailOption(data, searchData) {
return { return {
type: GET_TRANS_DETAIL_OPTION, type: SET_TRANS_DETAIL_OPTION,
rawData: data rawData: data,
searchForm: searchData
} }
} }
...@@ -132,11 +133,21 @@ export const requestTransAudio = async (global_domain_config, params) => { ...@@ -132,11 +133,21 @@ export const requestTransAudio = async (global_domain_config, params) => {
return await UploadRequest(global_domain_config, getUrlParams('/dingding/upload_media', { access_token }), formData) return await UploadRequest(global_domain_config, getUrlParams('/dingding/upload_media', { access_token }), formData)
} }
// 获取消耗明细 params={access_token:'', org_code: '', surgery_collect_number: '', item_name: '', serial_number: '', seller_name: '', surgery_name: ''} // 子页-获取消耗明细 params={access_token:'', org_code: '', surgery_collect_number: '', item_name: '', serial_number: '', seller_name: '', surgery_name: ''}
export const requestTransDetails = async (global_domain_config, params) => { export const requestTransDetails = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/transferSurOrder/sur_order_transfer_line_search', params)) return await GetRequest(global_domain_config, getUrlParams('/transferSurOrder/sur_order_transfer_line_search', params))
} }
// 子页-获取组织 params={access_token:''}
export const requestSubTransOrganizations = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/authorized_inventory/search', params))
}
// 子页-获取来源借货订单号 parmas={access_token: '', org_code: '', seller_code: '', customer_code: '', collect_header_status: 'RETURNED,COLLECTED' / 'COLLECTING_WAITING_CONFIRM,CONFIRM_COLLECT,COLLECTED_WAITING_CONFIRMED,APPROVED,COLLECTED'}
export const requestSubSourBorOrdNum = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/surgery/collect_order/search', params))
}
// 图片上传 // 图片上传
export const uploadTransImg = async (global_domain_config, params) => { export const uploadTransImg = async (global_domain_config, params) => {
let { access_token, formData } = params let { access_token, formData } = params
...@@ -148,8 +159,10 @@ export function requestTransSumbit({access_token, ...params}) { ...@@ -148,8 +159,10 @@ export function requestTransSumbit({access_token, ...params}) {
return (dispatch, getState) => { return (dispatch, getState) => {
dispatch(requestSubmiting()); dispatch(requestSubmiting());
let { global_domain_config } = getState().login let { global_domain_config } = getState().login
console.log('params--------', params)
PostRequest(global_domain_config, getUrlParams('/transferSurOrder/sur_order_transfer/create', {access_token: access_token}), params) PostRequest(global_domain_config, getUrlParams('/transferSurOrder/sur_order_transfer/create', {access_token: access_token}), params)
.then(res => { .then(res => {
console.log('requestTransSumbit === res--------', res)
if(res.error_code == 0) { if(res.error_code == 0) {
dispatch(requestSubmitSuccess(res)); dispatch(requestSubmitSuccess(res));
} else if(res.error_code === 41006) { } else if(res.error_code === 41006) {
......
...@@ -53,4 +53,5 @@ export const TRANS_SUBMIT_DOING = "TRANS_SUBMIT_DOING" ...@@ -53,4 +53,5 @@ export const TRANS_SUBMIT_DOING = "TRANS_SUBMIT_DOING"
export const TRANS_SUBMIT_SUCCESS = "TRANS_SUBMIT_SUCCESS" export const TRANS_SUBMIT_SUCCESS = "TRANS_SUBMIT_SUCCESS"
export const TRANS_SUBMIT_FAILURE = "TRANS_SUBMIT_FAILURE" export const TRANS_SUBMIT_FAILURE = "TRANS_SUBMIT_FAILURE"
export const TRANS_INIT_DATA = "TRANS_INIT_DATA" export const TRANS_INIT_DATA = "TRANS_INIT_DATA"
export const GET_TRANS_DETAIL_OPTION = "GET_TRANS_DETAIL_OPTION" export const SET_TRANS_DETAIL_OPTION = "SET_TRANS_DETAIL_OPTION"
\ No newline at end of file export const SET_TRANS_SEARCH_FORM = "SET_TRANS_SEARCH_FORM"
\ No newline at end of file
...@@ -251,14 +251,14 @@ class EquipConsuPage extends Component { ...@@ -251,14 +251,14 @@ class EquipConsuPage extends Component {
isSubLoding: false, // 加载中弹窗 isSubLoding: false, // 加载中弹窗
lodingTitle: '加载中', lodingTitle: '加载中',
listCurrentOption: [ // 当前选择器数据 listCurrentOption: [ // 当前选择器数据
{ // {
name: '测试1', // name: '测试1',
value: '测试1' // value: '测试1'
}, // },
{ // {
name: '测试2', // name: '测试2',
value: '测试2' // value: '测试2'
} // }
], ],
dateModelPop: false, // 日期选择器 dateModelPop: false, // 日期选择器
sexTypeOption: [ // 性别 sexTypeOption: [ // 性别
...@@ -809,7 +809,7 @@ class EquipConsuPage extends Component { ...@@ -809,7 +809,7 @@ class EquipConsuPage extends Component {
// 耗材明细 点击 // 耗材明细 点击
handleConsumDetailCheck() { handleConsumDetailCheck() {
// console.warn('耗材明细------check') // console.warn('耗材明细------check')
let {listOptionData} = this.state let { listOptionData } = this.state
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull() if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()
&& this.judgeOrderInfoIsNull()) { && this.judgeOrderInfoIsNull()) {
this.props.navigation.navigate('ConsumDetailsPage', { this.props.navigation.navigate('ConsumDetailsPage', {
...@@ -1444,9 +1444,9 @@ class EquipConsuPage extends Component { ...@@ -1444,9 +1444,9 @@ class EquipConsuPage extends Component {
} }
render() { render() {
let {canSubFlag} = this.state let { canSubFlag } = this.state
let {navigation} = this.props let { navigation } = this.props
let {title} = navigation.state.params let { title } = navigation.state.params
return ( return (
<View style={styles.equip_container}> <View style={styles.equip_container}>
<StatusBarView <StatusBarView
......
...@@ -30,6 +30,7 @@ import { ...@@ -30,6 +30,7 @@ import {
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { show} from '../../../utils/Utils'; import { show} from '../../../utils/Utils';
import LodingModel from '../../common/LodingModel'; import LodingModel from '../../common/LodingModel';
import { exitLoginStatus } from '../../../action/LoginAction';
class ConsumDetailsPage extends Component { class ConsumDetailsPage extends Component {
constructor(props) { constructor(props) {
...@@ -120,12 +121,16 @@ class ConsumDetailsPage extends Component { ...@@ -120,12 +121,16 @@ class ConsumDetailsPage extends Component {
surgery_collect_number: orderId surgery_collect_number: orderId
} }
let detailResult = await requestEquipDetails(global_domain_config, params) let detailResult = await requestEquipDetails(global_domain_config, params)
console.log('detailResult-----',detailResult)
if(detailResult.error_code === 0) { if(detailResult.error_code === 0) {
let {lines} = detailResult.data let {lines} = detailResult.data
// 需要过滤已提过消耗的数据 raised_consume="Y" // 需要过滤已提过消耗的数据 raised_consume="Y"
lines = lines.filter((fiItem) => { lines = lines.filter((fiItem) => {
return fiItem.raised_consume != 'Y' return fiItem.raised_consume != 'Y'
}) })
if(lines.length == 0) {
show('当前明细数据为空,请重现选择订单')
} else {
let {subDetOption} = this.props // 【器械消耗】已存在的明细 let {subDetOption} = this.props // 【器械消耗】已存在的明细
// console.log('subDetOption-----', subDetOption) // console.log('subDetOption-----', subDetOption)
subDetOption.length && subDetOption.forEach((item, index) => { subDetOption.length && subDetOption.forEach((item, index) => {
...@@ -137,6 +142,7 @@ class ConsumDetailsPage extends Component { ...@@ -137,6 +142,7 @@ class ConsumDetailsPage extends Component {
} }
}) })
}) })
}
this.setState({ this.setState({
isSubLoding: false, isSubLoding: false,
conDetaOption: lines, conDetaOption: lines,
...@@ -475,9 +481,9 @@ const mapStateToProps = (state) => { ...@@ -475,9 +481,9 @@ const mapStateToProps = (state) => {
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = (dispatch) => {
return { return {
// requestEquipOrganizations: (params) => { exitLoginStatus: () => {
// dispatch(requestEquipOrganizations(params)) dispatch(exitLoginStatus())
// } }
} }
} }
......
...@@ -225,8 +225,8 @@ class EquipConsuPage extends Component { ...@@ -225,8 +225,8 @@ class EquipConsuPage extends Component {
// 赋值销售员 初始化数据 // 赋值销售员 初始化数据
getSellerName() { getSellerName() {
let {state, props} = this let { state, props } = this
let {listOptionData} = this.state let { listOptionData } = this.state
this.setState({ this.setState({
subInitListOption: cloneObject(listOptionData) // 存储初始化数据,提交成功后赋此值 subInitListOption: cloneObject(listOptionData) // 存储初始化数据,提交成功后赋此值
}) })
......
...@@ -8,7 +8,8 @@ import { ...@@ -8,7 +8,8 @@ import {
TRANS_SUBMIT_SUCCESS, TRANS_SUBMIT_SUCCESS,
TRANS_SUBMIT_FAILURE, TRANS_SUBMIT_FAILURE,
TRANS_INIT_DATA, TRANS_INIT_DATA,
GET_TRANS_DETAIL_OPTION SET_TRANS_DETAIL_OPTION,
// SET_TRANS_SEARCH_FORM
} from '../../base/ActionTypes'; } from '../../base/ActionTypes';
// 转单状态 // 转单状态
...@@ -17,6 +18,7 @@ const defaultState = { ...@@ -17,6 +18,7 @@ const defaultState = {
submit_trans_order_status: TRANS_SUBMIT_NO, // 提交订单状态 submit_trans_order_status: TRANS_SUBMIT_NO, // 提交订单状态
transOrderOption: {}, // 当前选择器临时存储数据 transOrderOption: {}, // 当前选择器临时存储数据
subTransDetOption: [], // 选择的消耗明细数据 subTransDetOption: [], // 选择的消耗明细数据
subTransSearchForm: {}, // 消耗明细筛选条件
} }
export default trans = (state = defaultState, action) => { export default trans = (state = defaultState, action) => {
...@@ -54,12 +56,18 @@ export default trans = (state = defaultState, action) => { ...@@ -54,12 +56,18 @@ export default trans = (state = defaultState, action) => {
trans_list_status: TRANS_ORDER_LIST_NO, trans_list_status: TRANS_ORDER_LIST_NO,
submit_trans_order_status: TRANS_SUBMIT_NO, submit_trans_order_status: TRANS_SUBMIT_NO,
transOrderOption: {}, transOrderOption: {},
subTransDetOption: [] subTransDetOption: [],
subTransSearchForm: {}
}) })
case GET_TRANS_DETAIL_OPTION: case SET_TRANS_DETAIL_OPTION:
return Object.assign({}, state, { return Object.assign({}, state, {
subTransDetOption: action.rawData subTransDetOption: action.rawData,
subTransSearchForm: action.searchForm
}) })
// case SET_TRANS_SEARCH_FORM:
// return Object.assign({}, state, {
// subTransSearchForm: action.rawData
// })
default: default:
return state; 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