123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403 |
- import React,{Component} from 'react';
- import {message, Modal, Tabs} from "antd";
- import { cuiJieDian } from '@/dataDic.js'
- import ProjectOverview from './projectOverview'
- import {splitUrl} from '@/tools'
- import CheckProject from "../../../../components/checkProject";
- import $ from "jquery";
- import OrderItemStatus from "../../../../../common/orderItemStatus";
- const { TabPane } = Tabs
- class DetailsModal extends Component{
- constructor(props) {
- super(props);
- this.state={
- loading: false,
- activeKey:'1',
- paySubject: [],
- orderDtails: {},
- containOfficialFees:0,//官费缴费情况
- }
- this.visitCancel = this.visitCancel.bind(this);
- this.getCsortData = this.getCsortData.bind(this);
- }
- async componentDidMount() {
- if(this.props.tid){
- this.waiDetail();
- this.thirdTable(this.props.tid);
- this.getOrderNewDetail();
- await this.xiangqing(this.props.tid);
- await this.getCsortData(this.state.sort)
- await this.payNodeTable(this.props.tid);
- }
- }
- // 获取csort下的数据
- getCsortData(cSort) {
- return cuiJieDian.map((item) => {
- if (item.value == cSort) {
- this.setState({
- paySubject: item.children,
- })
- }
- })
- }
- visitOk(){
- this.setState({
- oldInfor: {}
- });
- }
- visitCancel(){
- this.setState({
- oldInfor: {}
- });
- this.props.visitCancel();
- }
- waiDetail() {
- let url = window.location.href.substring(7)
- this.setState({
- loading: true,
- })
- $.ajax({
- method: 'get',
- dataType: 'json',
- crossDomain: false,
- url:
- globalConfig.context + '/api/admin/outsourceOrg/orderOutsourceDtails',
- data: {
- tid: this.props.tid,
- orderNo: this.props.orderNo,
- },
- }).done(
- function (data) {
- this.setState({
- loading: false,
- })
- if (!data.error.length && data.data) {
- if(data.data.unitNumber){
- this.setState({
- oldInfor: {
- companyName:data.data.companyName,
- unitPrice:data.data.unitPrice,
- unitNumber:data.data.unitNumber,
- amount:data.data.amount,
- outsourceRemarks:data.data.outsourceRemarks,
- refundStatus: data.data.refundStatus,
- pictureUrl: data.data.pictureUrl
- ? splitUrl(
- data.data.pictureUrl,
- ',',
- globalConfig.avatarHost + '/upload',
- url
- )
- : [], //图片地址
- }
- })
- }else{
- this.setState({
- oldInfor: {}
- })
- }
- this.setState({
- containOfficialFees: data.data.actualOfficial,//官费类型 0实际已缴费 1实际未缴费
- orderDtails: data.data,
- startType: data.data.startType, //类型
- mid: data.data.id,
- outsourceRemarks: data.data.outsourceRemarks,
- refundStatus: data.data.refundStatus,
- pictureUrl: data.data.pictureUrl
- ? splitUrl(
- data.data.pictureUrl,
- ',',
- globalConfig.avatarHost + '/upload',
- url
- )
- : [], //图片地址
- })
- } else if (data.error && data.error.length) {
- message.warning(data.error[0].message)
- } else if (!data.data) {
- this.setState({
- refundStatus: undefined,
- })
- }
- }.bind(this)
- )
- }
- //查看第三方信息表格
- thirdTable(id) {
- this.setState({
- loadData: true,
- })
- $.ajax({
- method: 'get',
- dataType: 'json',
- crossDomain: false,
- url: globalConfig.context + '/api/admin/company/selectCompany',
- data: {
- tid: id,
- },
- success: function (data) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message)
- } else {
- let companyNameArr = []
- let theArr = []
- let thisData = []
- let arr = data.data || []
- let allTotalAmount = 0
- for (let i = 0; i < arr.length; i++) {
- thisData = arr[i]
- allTotalAmount =
- (allTotalAmount * 10000 + thisData.totalAmount * 10000) / 10000
- companyNameArr.push(thisData.companyName);
- thisData.key = i;
- theArr.push(thisData)
- }
- for(let d=0;d<theArr.length;d++){
- theArr[d].companyName = theArr[d].companyName+ '-' + theArr[d].id;
- // companyNameArr[d] = {
- // companyName: theArr[d].companyName,
- // id: theArr[d].id,
- // }
- }
- if (!allTotalAmount) {
- allTotalAmount = 0
- }
- this.setState({
- thirdInfoList: theArr,
- allTotalAmount: allTotalAmount,
- })
- }
- }.bind(this),
- }).always(
- function () {
- this.setState({
- loading: false,
- })
- }.bind(this)
- )
- }
- payNodeTable(id) {
- this.setState({
- loadData: true,
- })
- return $.ajax({
- method: 'get',
- dataType: 'json',
- crossDomain: false,
- url: globalConfig.context + '/api/admin/company/selectPaymentNode',
- data: {
- tid: id,
- },
- success: function (data) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message)
- } else {
- let payNodeArr = []
- let thisData = []
- let arr = data.data || []
- //对#5283自定义的补充展示
- this.state.paySubject.push({ key: '自定义', value: '0' })
- for (let i = 0; i < arr.length; i++) {
- thisData = arr[i]
- //遍历paySubject,获取当前dunType对应的key
- this.state.paySubject.map((item) => {
- if (item.value == thisData.dunType) {
- thisData.dunType = item.key
- }
- })
- payNodeArr.push({
- key: i,
- id: thisData.id, //付款节点Id
- tid: thisData.tid,
- companyName: thisData.companyName, //供应商名称
- projectType: thisData.projectType, //项目分类
- dunType: thisData.dunType, //催款分类
- unitPrice: thisData.unitPrice, //单价
- quantity: thisData.quantity, //数量
- totalAmount: thisData.totalAmount, //总价
- partyAmount: thisData.partyAmount, //付款
- partyTimes: thisData.partyTimes, //付款时间
- cid: thisData.cid, //机构id
- })
- }
- for(let d=0;d<payNodeArr.length;d++){
- payNodeArr[d].companyName = payNodeArr[d].companyName+ '-' + payNodeArr[d].cid;
- }
- this.setState({
- payNodeList: payNodeArr,
- })
- }
- }.bind(this),
- }).always(
- function () {
- this.setState({
- loading: false,
- })
- }.bind(this)
- )
- }
- //订单详情
- xiangqing(id) {
- return $.ajax({
- method: 'get',
- dataType: 'json',
- crossDomain: false,
- url: globalConfig.context + '/api/admin/orderProject/orderTaskDetail',
- data: {
- id: id,
- },
- success: function (data) {
- let thisdata = data.data
- if (data.error.length || data.data.list == '') {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message)
- }
- } else {
- localStorage.setItem('cSort', thisdata.sort);
- this.setState({
- orderTaskOfficialCost: thisdata.officialCost, //官费 0无 1有
- orderTaskCostReduction: thisdata.costReduction,//费减
- checkStatus:thisdata.checkStatus,//核对状态
- commodityQuantity:thisdata.commodityQuantity,//项目数量
- patentTypeName:thisdata.patentTypeName,//官费类型名称
- patentTypeId: thisdata.patentType,//官费专利类型
- sort: thisdata.sort,
- })
- }
- }.bind(this),
- }).always(
- function () {
- this.setState({
- loading: false,
- })
- }.bind(this)
- )
- }
- getOrderNewDetail() {
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
- data: {
- orderNo: this.props.orderNo
- },
- success: function (data) {
- if (data.error.length || data.data.list == "") {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- }
- } else {
- let thisdata = data.data;
- this.setState({
- deleteSign:thisdata.deleteSign,
- });
- }
- }.bind(this)
- });
- }
- render() {
- return(
- <Modal
- maskClosable={false}
- className="customeDetails"
- footer=""
- title=""
- width="900px"
- visible={this.props.visible}
- onOk={this.visitOk}
- onCancel={this.visitCancel}
- >
- <Tabs
- defaultActiveKey='1'
- activeKey={this.state.activeKey}
- onChange={(e) => {
- this.setState({
- activeKey: e
- })
- if(e === '1'){
- this.waiDetail();
- this.thirdTable(this.props.tid);
- this.payNodeTable(this.props.tid);
- this.xiangqing(this.props.tid);
- }
- }}
- tabBarExtraContent={
- <div style={{fontWeight:'bold',paddingRight:'15px'}}>
- <span>
- 项目名称:
- <span style={{color:'#F00',paddingRight:'5px'}}>{this.props.taskName}</span>
- </span>
- <span style={{marginLeft:'15px'}}>
- 项目编号:
- <span style={{color:'#F00',paddingRight:'5px'}}>
- {this.props.taskID}
- </span>
- </span>
- <OrderItemStatus deleteSign={this.state.deleteSign}/>
- </div>
- }
- >
- <TabPane tab="外包/供应商信息" key="1">
- {this.state.activeKey === '1' ? <CheckProject
- {...this.props}
- tid={this.props.tid}
- sort={this.state.sort}
- patentTypeName={this.state.patentTypeName} //官费类型
- patentTypeId={this.state.patentTypeId}
- commodityQuantity={this.state.commodityQuantity} //项目数量
- checkStatus={this.state.checkStatus} //核对状态
- orderTaskCostReduction={this.state.orderTaskCostReduction} //是否含费减 0无1有
- oldInfor={this.state.oldInfor}
- orderTaskOfficialCost={this.state.orderTaskOfficialCost} //是否含官费 0无1有
- containOfficialFees={this.state.containOfficialFees} //0:实际已缴费 1:实际未缴费
- status={this.state.refundStatus}
- mid={this.state.mid}
- patentNameType={this.state.orderDtails.patentNameType}
- patentName={this.state.orderDtails.patentName}
- patentType={this.state.orderDtails.patentType}
- projectType={this.props.projectType}
- projectStatus={this.props.projectStatus}
- thirdInfoList={this.state.thirdInfoList}
- dataSource={this.state.payNodeList}
- outsourceRemarks={this.state.outsourceRemarks}
- fileList={this.state.pictureUrl}
- startType={this.state.startType}
- onRefresh={()=>{
- this.waiDetail();
- this.thirdTable(this.props.tid);
- this.payNodeTable(this.props.tid);
- this.xiangqing(this.props.tid);
- this.props.refreshList && this.props.refreshList();
- }}
- /> : <div/>}
- </TabPane>
- <TabPane tab="项目概况" key="2">
- <ProjectOverview projectStatus={this.props.projectStatus} tid={this.props.tid} taskName={this.props.taskName}/>
- </TabPane>
- </Tabs>
- </Modal>
- )
- }
- }
- export default DetailsModal;
|