130 lines
4.0 KiB
JavaScript
130 lines
4.0 KiB
JavaScript
![]() |
import { fetchManagerList,openBizassessroom,resetVerificationCode,fetchJuryList,fetchSupplierList
|
||
|
,fetchJuryMemInfo,updateJuryMemInfo,validateVerificationCode,fetchbidslist } from '../services/bidev';
|
||
|
import { message } from 'antd';
|
||
|
// import { message } from 'antd';
|
||
|
// import { stringify } from 'qs';
|
||
|
|
||
|
export default {
|
||
|
namespace: 'bidev',
|
||
|
|
||
|
state: {
|
||
|
supplierList:[],
|
||
|
managerList:[],
|
||
|
JuryList:[],
|
||
|
JuryInfo:[],
|
||
|
bidslist:[]
|
||
|
},
|
||
|
|
||
|
effects: {
|
||
|
// 查询招标代理列表
|
||
|
*fetchManagerList({payload,callback}, { call, put }){
|
||
|
const response =yield call(fetchManagerList,payload)
|
||
|
if(response.code==200){
|
||
|
yield put({ type: 'save', payload: {managerList:response.data} });
|
||
|
}else{
|
||
|
message.error("查询错误!")
|
||
|
}
|
||
|
},
|
||
|
// 开启评审室
|
||
|
*openBizassessroom({payload,callback}, { call, put }){
|
||
|
const response =yield call(openBizassessroom,payload)
|
||
|
if(response.code==200){
|
||
|
// 查询招标代理列表
|
||
|
const params={
|
||
|
pageNo:1,
|
||
|
pageSize:10,
|
||
|
roomType:2,
|
||
|
tpId:1111111//项目id
|
||
|
}
|
||
|
yield put({ type: 'fetchManagerList', payload: {...params} });
|
||
|
message.success("开启成功!")
|
||
|
}else{
|
||
|
message.error("开启失败!")
|
||
|
}
|
||
|
},
|
||
|
// 重置校验码
|
||
|
*resetVerificationCode({payload,callback}, { call, put }){
|
||
|
const response =yield call(resetVerificationCode,payload)
|
||
|
if(response.code==200){
|
||
|
// 查询招标代理列表
|
||
|
const params={
|
||
|
pageNo:payload.pageNo,
|
||
|
pageSize:payload.pageSize,
|
||
|
roomType:2,
|
||
|
tpId:payload.tpId//项目id
|
||
|
}
|
||
|
yield put({ type: 'fetchManagerList', payload: {...params} });
|
||
|
}else{
|
||
|
message.error("重置失败!")
|
||
|
}
|
||
|
},
|
||
|
// 查询专家地列表
|
||
|
*fetchJuryList({payload,callback}, { call, put }){
|
||
|
const response =yield call(fetchJuryList,payload)
|
||
|
if(response.code==200){
|
||
|
yield put({ type: 'save', payload: {JuryList:response.data} });
|
||
|
}else{
|
||
|
message.error("查询错误!")
|
||
|
}
|
||
|
},
|
||
|
*fetchSupplierList({payload,callback}, { call, put }){
|
||
|
const response =yield call(fetchSupplierList,payload)
|
||
|
if(response.code==200){
|
||
|
yield put({ type: 'save', payload: {supplierList:response.data} });
|
||
|
}else{
|
||
|
message.error("查询错误!")
|
||
|
}
|
||
|
},
|
||
|
*fetchJuryMemInfo({payload,callback}, { call, put }){
|
||
|
const response =yield call(fetchJuryMemInfo,payload)
|
||
|
if(response.code==200){
|
||
|
yield put({ type: 'save', payload: {JuryInfo:response.data} });
|
||
|
if(callback) callback(response,"success")
|
||
|
}else{
|
||
|
if(callback) callback(response,"fail")
|
||
|
message.error("查询专家信息错误!")
|
||
|
}
|
||
|
},
|
||
|
// 新更新评委信息
|
||
|
*updateJuryMemInfo({payload,callback}, { call, put }){
|
||
|
const response =yield call(updateJuryMemInfo,payload)
|
||
|
if(response.code==200){
|
||
|
if(callback) callback(response,"success")
|
||
|
}else{
|
||
|
if(callback) callback(response,"fail")
|
||
|
message.error("修改专家信息失败!")
|
||
|
}
|
||
|
},
|
||
|
*validateVerificationCode({payload,callback}, { call, put }){
|
||
|
const response =yield call(validateVerificationCode,payload)
|
||
|
if(response.code==200){
|
||
|
if(response.success==true){
|
||
|
if(callback) callback(response,"success")
|
||
|
}else{
|
||
|
if(callback) callback(response,"fail")
|
||
|
message.error("校验码错误!")
|
||
|
}
|
||
|
}else{
|
||
|
if(callback) callback(response,"fail")
|
||
|
message.error(response.message)
|
||
|
}
|
||
|
},
|
||
|
*fetchbidslist({payload,callback}, { call, put }){
|
||
|
const response =yield call(fetchbidslist,payload)
|
||
|
if(response.code==200){
|
||
|
yield put({ type: 'save', payload: {bidslist:response.data} });
|
||
|
}else{
|
||
|
message.error("查询投标人信息错误!")
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
reducers: {
|
||
|
save(state, { payload }) {
|
||
|
return {
|
||
|
...state,
|
||
|
...payload,
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|