Files
fe_service_ebtp_frontend/src/models/bidev.js
2022-03-10 14:24:13 +08:00

204 lines
6.8 KiB
JavaScript

import { fetchManagerList,openBizassessroom,resetVerificationCode,fetchJuryList,fetchSupplierList
,fetchJuryMemInfo,updateJuryMemInfo,validateVerificationCode,fetchbidslist
,fetchPreSupplierList,fetchPreList,fetchPreListt,bxmultifetchPreListt,pushRedirectRe,getCheckedByRoomId,checkOpenBidSupplier,zmmultiOpenBizassessroom } from '../services/bidev';
import { message } from 'antd';
import { getProId } from '@/utils/session';
import { getURLInformation } from '@/utils/CommonUtils';
// 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} });
}
},
// 开启评审室
*openBizassessroom({payload,callback}, { call, put }){
const response =yield call(openBizassessroom,payload)
if(response?.code==200){
// 查询招标代理列表
const params={
pageNo:1,
pageSize:10,
// roomType:2,
roomType: getURLInformation('roomType'),
tpId:getProId()//项目id
}
yield put({ type: 'fetchManagerList', payload: {...params} });
message.success("开启成功!")
}
callback();
},
// 开启评审室(多轮招募)
*zmmultiOpenBizassessroom({payload,callback}, { call, put }){
const response =yield call(zmmultiOpenBizassessroom,payload)
if(response.code==200){
// 查询招标代理列表
const params={
pageNo:1,
pageSize:10,
// roomType:2,
roomType: getURLInformation('roomType'),
tpId:getProId()//项目id
}
yield put({ type: 'fetchManagerList', payload: {...params} });
message.success("开启成功!")
}
callback();
},
// 重置校验码
*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,
roomType: getURLInformation('roomType'),
tpId:payload.tpId//项目id
}
yield put({ type: 'fetchManagerList', payload: {...params} });
}
},
// 查询专家地列表
*fetchJuryList({payload,callback}, { call, put }){
const response =yield call(fetchJuryList,payload)
if(response.code==200){
yield put({ type: 'save', payload: {JuryList:response.data} });
}
},
*fetchSupplierList({payload,callback}, { call, put }){
const response =yield call(fetchSupplierList,payload)
if(response.code==200){
yield put({ type: 'save', payload: {supplierList:response.data} });
}
},
*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")
}
},
// 新更新评委信息
*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")
}
},
*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")
}
}
},
*fetchbidslist({payload,callback}, { call, put }){
const response =yield call(fetchbidslist,payload)
if(response.code==200){
yield put({ type: 'save', payload: {bidslist:response.data} });
}
},
// 获取初审汇总表title
*fetchPreList({payload,callback}, { call, put }){
const response =yield call(fetchPreList,payload)
// const response=preList;
if(response.code==200){
if(callback) callback(response,"success")
yield put({ type: 'save', payload: {preList:response.data} });
}else{
if(callback) callback(response,"fail")
}
},
// 获取初审汇总表datasource
*fetchPreSupplierList({payload,callback}, { call, put }){
const response =yield call(fetchPreSupplierList,payload)
// const response =preSupplierList;
if(response.code==200){
if(callback) callback(response,"success")
yield put({ type: 'save', payload: {preSupplierList:response.data}});
}else{
if(callback) callback(response,"fail")
}
},
*fetchPreListt({payload,callback}, { call, put }){
const response =yield call(fetchPreListt,payload)
// const response =preSupplierList;
if(response.code==200){
if(callback) callback(response,"success")
yield put({ type: 'save', payload: {preSupplierList:response.data}});
}else{
if(callback) callback(response,"fail")
}
},
*bxmultifetchPreListt({payload,callback}, { call, put }){
const response =yield call(bxmultifetchPreListt,payload)
// const response =preSupplierList;
if(response.code==200){
if(callback) callback(response,"success")
yield put({ type: 'save', payload: {preSupplierList:response.data}});
}else{
if(callback) callback(response,"fail")
}
},
*pushRedirectRe({payload,callback}, { call, put }){
const response =yield call(pushRedirectRe,payload)
if(response.code==200){
if(response.success==true){
if(callback) callback(response,"success")
}else{
if(callback) callback(response,"fail")
}
}
},
*getCheckedByRoomId({payload,callback}, { call, put }){
const response =yield call(getCheckedByRoomId,payload)
if(response.code==200){
if(response.success==true){
if(callback) callback(response)
}else{
if(callback) callback(response)
}
}
},
*checkOpenBidSupplier({payload,callback}, { call, put }){
const response =yield call(checkOpenBidSupplier,payload)
if(response.code==200){
if(callback) callback(response)
}
},
},
reducers: {
save(state, { payload }) {
return {
...state,
...payload,
};
}
}
}