1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723 |
- import React from "react";
- import { Button, Input, Spin, Table, message, Form, Modal, Tabs, Select, DatePicker, Tooltip } from "antd";
- import $ from "jquery/src/ajax";
- import {
- getNewOrderStatus,
- getProcessStatusNew,
- splitUrl,
- getjiedian,
- getboutique,
- getCuikuan,
- getProjectStatus,
- ShowModal,
- getType
- } from "@/tools.js";
- import "./customer.less";
- import { ChangeDetail } from "./changeComponent/changeDetailCwzy.js";
- import { SearchInput } from "./changeComponent/searchInput.js";
- import OrderDetail from "./changeComponent/orderDetail";
- import { ChooseList } from "./chooseList.jsx";
- import ShowModalDiv from "@/showModal.jsx";
- const { RangePicker } = DatePicker;
- import ReactToPrint from "react-to-print";
- import OrderRiZi from "@/orderRiZi.jsx";
- import { getProjectName } from "../../../tools";
- import ProjectDetailsReadOnly from "../../../common/projectDetailsReadOnly";
- import NewEditProject from "../../../common/projectOperation/newEditProject";
- const contractChange = Form.create()(
- React.createClass({
- loadData(pageNo) {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/orderChange/orderChangeList",
- data: {
- pageNo: pageNo || 1,
- pageSize: this.state.pagination.pageSize,
- userName: this.state.searchData.userNameSearch,
- processState: this.props.processState,
- timeType: this.state.searchData.timeTypeSearch,
- startTime: this.state.searchData.releaseDate[0],
- endTime: this.state.searchData.releaseDate[1],
- salesmanName: this.state.searchData.salesmanNameSearch,
- complete: this.state.searchData.completeSearch || 1,
- deps: this.state.searchData.deps,
- orderNo: this.state.searchData.orderNoSearch,
- contractNo: this.state.searchData.contractNoSearch,
- type: this.state.searchData.changeSearch
- },
- success: function (data) {
- ShowModal(this);
- let theArr = [];
- if (data.error.length || data.data.list == "") {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- }
- } else {
- for (let i = 0; i < data.data.list.length; i++) {
- let thisdata = data.data.list[i];
- theArr.push({
- key: i,
- orderNo: thisdata.orderNo,
- createTimes: thisdata.createTimes,
- nickname: thisdata.nickname,
- orderType: thisdata.orderType,
- establishTimes: thisdata.establishTimes,
- orderStatus: thisdata.orderStatus,
- totalAmount: thisdata.totalAmount,
- settlementAmount: thisdata.settlementAmount,
- arrears: thisdata.arrears,
- salesmanName: thisdata.salesmanName,
- depName: thisdata.depName,
- processState: thisdata.processState,
- type: thisdata.type,
- status: thisdata.status,
- id: thisdata.id,
- contractNo: thisdata.contractNo,
- processStateText: getProcessStatusNew(
- thisdata.examineName,
- thisdata.processState,
- thisdata.status
- )
- });
- }
- this.state.pagination.total = data.data.totalCount;
- this.state.pagination.current = data.data.pageNo;
- }
- if (data.data && data.data.list && !data.data.list.length) {
- this.state.pagination.total = 0;
- }
- this.setState({
- dataSource: theArr,
- pageNo: pageNo,
- pagination: this.state.pagination
- });
- }.bind(this)
- }).always(
- function () {
- this.setState({
- loading: false
- });
- }.bind(this)
- );
- },
- getInitialState() {
- return {
- dvisible: false,
- page: 1,
- searchData: {
- releaseDate: []
- },
- declarationBatch: 1,
- dataInfor: {},
- primaryOrderData: {}, //原订单数据
- orderData: {}, //现订单数据
- pictureUrl: [],
- voucherUrl: [],
- attachment: [],
- attachmentUrl: [],
- //收款数据
- proceedsData: {},
- proTotal: 0,
- invTotal: 0,
- contractData: {},
- // 回收退票数据
- refundInvoice: [],
- RefundInvoice: [],
- additionalOrderData: {},
- paginations: false,
- activeKey: "a",
- confirmLoading: false,
- aloading: false,
- pagination: {
- defaultCurrent: 1,
- defaultPageSize: 10,
- showQuickJumper: true,
- pageSize: 10,
- onChange: function (page) {
- this.loadData(page);
- }.bind(this),
- showTotal: function (total) {
- return "共" + total + "条数据";
- }
- },
- columns: [
- {
- title: "合同编号",
- dataIndex: "contractNo",
- key: "contractNo"
- },
- {
- title: "订单编号",
- dataIndex: "orderNo",
- key: "orderNo"
- },
- {
- title: "客户名称",
- dataIndex: "nickname",
- key: "nickname",
- width: 150,
- render: (text) => {
- return (
- <Tooltip title={text}>
- <div
- // style={{
- // maxWidth: '150px',
- // overflow: 'hidden',
- // textOverflow: "ellipsis",
- // whiteSpace: 'nowrap',
- // }}
- >{text}</div>
- </Tooltip>
- )
- },
- },
- {
- title: "订单部门",
- dataIndex: "depName",
- key: "depName"
- },
- {
- title: "订单类型",
- dataIndex: "orderType",
- key: "orderType",
- render: text => {
- return text ? "科技项目" : "认证项目";
- }
- },
- {
- title: "下单时间",
- dataIndex: "establishTimes",
- key: "establishTimes"
- },
- {
- title: "订单状态",
- dataIndex: "orderStatus",
- key: "orderStatus",
- render: text => {
- return getNewOrderStatus(text);
- }
- },
- {
- title: "合同额(万元)",
- dataIndex: "totalAmount",
- key: "totalAmount"
- },
- {
- title: "已付额(万元)",
- dataIndex: "settlementAmount",
- key: "settlementAmount"
- },
- {
- title: "欠款(万元)",
- dataIndex: "arrears",
- key: "arrears"
- },
- {
- title: "订单负责人",
- dataIndex: "salesmanName",
- key: "salesmanName"
- },
- {
- title: "变更类型",
- dataIndex: "type",
- key: "type",
- render: text => {
- return getType(text);
- }
- },
- {
- title: "审核状态",
- dataIndex: "processStateText",
- key: "processStateText"
- },
- {
- title: "提交时间",
- dataIndex: "createTimes",
- key: "createTimes"
- }
- ],
- dataSource: [],
- // 传递给子组件的
- dataProps: [],
- columnsX: [
- {
- title: "业务项目名称",
- dataIndex: "commodityName",
- key: "commodityName",
- render: (text, record) => {
- return (
- <span>{text}<span style={{ color: "red" }}>{record.patentTypeName}</span></span>
- )
- }
- },
- {
- title: "项目类别",
- dataIndex: "cname",
- key: "cname"
- },
- {
- title: "项目数量",
- dataIndex: "commodityQuantity",
- key: "commodityQuantity"
- },
- {
- title: "金额(万元)",
- dataIndex: "commodityPrice",
- key: "commodityPrice"
- },
- {
- title: "负责人",
- dataIndex: "contacts",
- key: "contacts"
- },
- {
- title: "负责人电话",
- dataIndex: "contactsMobile",
- key: "contactsMobile"
- },
- {
- title: "项目状态",
- dataIndex: "projectStatus",
- key: "projectStatus",
- render: text => {
- return getProjectName(text);
- }
- },
- {
- title: "主要项目",
- dataIndex: "main",
- key: "main",
- render: text => {
- return text ? "是" : "否";
- }
- },
- {
- title: "总年限",
- dataIndex: "yearSum",
- key: "yearSum",
- render: (text, record) => {
- return (
- <div>{["", "一年", "二年", "三年", "四年", "五年"][text]}</div>
- );
- }
- },
- {
- title: "年限",
- dataIndex: "serviceLife",
- key: "serviceLife",
- render: (text, record) => {
- return (
- <div>{!!text && JSON.parse(text).toString()}</div>
- );
- }
- },
- {
- title: "本次派单",
- dataIndex: "serviceYear",
- key: "serviceYear",
- render: (text, record) => {
- return (
- <div>{!text ? "" : text}</div>
- );
- }
- },
- {
- title: "项目说明",
- dataIndex: "taskComment",
- key: "taskComment",
- render: text => {
- return (
- <Tooltip title={text}>
- <div
- style={{
- width: 100,
- overflow: "hidden",
- whiteSpace: "nowrap",
- textOverflow: "ellipsis",
- }}
- >{text}</div>
- </Tooltip>
- )
- }
- }
- ],
- // 子组件改变的表格title数组
- changeList: undefined,
- columnsrizhi: [
- {
- title: "流程",
- dataIndex: "processName",
- key: "processName"
- },
- {
- title: "操作人",
- dataIndex: "adminName",
- key: "adminName"
- },
- {
- title: "时间",
- dataIndex: "createDate",
- key: "createDate"
- }
- ],
- dataSourceX: [],
- ContactsLists: [
- {
- title: "催款科目",
- dataIndex: "dunSubject",
- key: "dunSubject",
- render: text => {
- return getjiedian(text);
- }
- },
- {
- title: "金额(万元)",
- dataIndex: "money",
- key: "money"
- },
- {
- title: "催款状态",
- dataIndex: "dunStatus",
- key: "dunStatus",
- render: text => {
- return getCuikuan(text);
- }
- }
- ]
- };
- },
- departmentList() {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/organization/selectSuperId",
- data: {},
- success: function (data) {
- let thedata = data.data;
- let theArr = [];
- if (!thedata) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- }
- } else {
- thedata.map(function (item, index) {
- theArr.push({
- key: index,
- name: item.name,
- id: item.id
- });
- });
- }
- this.setState({
- departmentArr: theArr
- });
- }.bind(this)
- }).always(
- function () {
- this.setState({
- loading: false
- });
- }.bind(this)
- );
- },
- //页面加载函数
- componentWillMount() {
- const data = localStorage.getItem('typeCw') || "";
- /**
- * 统计页点击跳转,将参数存在缓存中(缓存中有数据就给筛选项添加默认值)
- */
- if (!data) {
- this.loadData()
- } else {
- this.state.searchData.completeSearch = data
- this.loadData()
- }
- this.loadData();
- },
- componentDidMount() {
- localStorage.removeItem('typeCw') // 组件挂载完清除缓存
- },
- componentWillUnmount() {
- localStorage.removeItem('typeCw') // 组件销毁时清除缓存
- },
- //整行点击
- tableRowClick(record) {
- this.setState(
- {
- visible: true,
- type: record.type,
- status: record.status,
- buttonStatus: true,
- orderStatus: record.orderStatus,
- processStateText: record.processStateText,
- id: record.id,
- orderNo: record.orderNo
- },
- () => {
- this.xiangqing(record.orderNo);
- this.xiangmu(record.orderNo);
- this.jiedian(record.orderNo);
- this.jiedianNew(record.orderNo);
- this.createTabs();
- }
- );
- },
- //点击打卡项目详情
- tableRowClickX(record) {
- this.setState({
- jid: record.id, //项目ID
- kid: record.commodityId, //商品ID
- commodityName: record.commodityName, //金额
- commodityPrice: record.commodityPrice, //金额
- commodityQuantity: record.commodityQuantity, //数量
- taskComment: record.taskComment, //备注
- main: record.main.toString(), //是否为主要
- addnextVisible: true,
- dataInfor: record,
- addState: 0
- });
- },
- //项目详情关闭
- nextCancel() {
- this.setState({
- addnextVisible: false
- });
- },
- // 合同变更详情
- ChangeDetail(id) {
- let url = window.location.href.substring(7);
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url:
- globalConfig.context +
- "/api/admin/orderChange/orderChangeDetailsById",
- data: {
- id: id
- },
- success: function (data) {
- if (data.data) {
- let thisdata = data.data;
- Object.assign(thisdata, {
- processStateText: this.state.processStateText,
- userName: this.state.userName,
- contractNo: this.state.contractNo
- });
- this.setState({
- contractData: thisdata,
- voucherUrl: thisdata.voucherUrl
- ? splitUrl(
- thisdata.voucherUrl,
- ",",
- globalConfig.avatarHost + "/upload",
- url
- )
- : [],
- attachment: thisdata.attachmentUrl
- ? splitUrl(
- thisdata.attachmentUrl,
- ",",
- globalConfig.avatarHost + "/upload",
- url
- )
- : [],
- contractPictureUrl: thisdata.contractPictureUrl
- ? splitUrl(
- thisdata.contractPictureUrl,
- ",",
- globalConfig.avatarHost + "/upload",
- url
- )
- : []
- });
- }
- }.bind(this)
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url:
- globalConfig.context +
- "/api/admin/orderChange/listOrderInvoiceAndBill",
- data: {
- orderNo: this.state.orderNo
- },
- success: function (data) {
- if (!data.data) return;
- let proTotal = 0;
- let invTotal = 0;
- data.data.bill.forEach(item => {
- proTotal += item.transactionAmount;
- });
- data.data.invoice.forEach(item => {
- invTotal += item.amount;
- });
- this.setState({
- proceedsData: data.data,
- proTotal: (Math.round(proTotal * 1000000) / 1000000).toFixed(6),
- invTotal: (Math.round(invTotal * 1000000) / 1000000).toFixed(6),
- });
- }.bind(this)
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url:
- globalConfig.context +
- "/api/admin/orderChange/listOrderRefundInvoice",
- data: {
- orderNo: this.state.orderNo
- },
- success: data => {
- if (!data) return;
- data.data.forEach(item => {
- item.load = true;
- });
- this.setState({
- refundInvoice: data.data
- });
- }
- });
- },
- //订单详情
- xiangqing(orderNos) {
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
- data: {
- orderNo: orderNos
- },
- 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({
- userName: thisdata.userName,
- primaryOrderNo: thisdata.primaryOrder,
- additionalOrder: thisdata.additionalOrder,
- contractNo: thisdata.contractNo,
- // arrears: thisdata.arrears,
- orderData: thisdata,
- isAddition: thisdata.additionalOrder ? true : false,
- contractPictureUrl: thisdata.contractPictureUrl
- ? splitUrl(
- thisdata.contractPictureUrl,
- ",",
- globalConfig.avatarHost + "/upload"
- )
- : []
- });
- // console.log(thisdata.contractPictureUrl);
- }
- }.bind(this)
- });
- },
- // 原订单数据
- primaryOrder(primaryOrder) {
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
- data: {
- orderNo: primaryOrder
- },
- 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({
- primaryOrderData: thisdata
- });
- }
- }.bind(this)
- });
- },
- // 附加订单数据
- additionalOrder(additionalOrder) {
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
- data: {
- orderNo: additionalOrder
- },
- 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({
- additionalOrderData: thisdata
- });
- }
- }.bind(this)
- });
- },
- //项目列表
- xiangmu(orderNos) {
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
- data: {
- orderNo: orderNos
- },
- success: function (data) {
- let theArr = [];
- if (data.error.length || data.data.list == "") {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- }
- } else {
- for (let i = 0; i < data.data.length; i++) {
- let thisdata = data.data[i];
- thisdata.key = i;
- thisdata.sort = thisdata.cSort;
- theArr.push(thisdata);
- }
- }
- this.setState({
- dataSourceX: theArr
- });
- }.bind(this)
- });
- },
- // 查看收款金额
- getProceeds(id) {
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url:
- globalConfig.context +
- "/api/admin/orderChange/orderChangeDetailsById",
- data: {
- id: id
- },
- 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;
- }
- }.bind(this)
- });
- },
- search(obj) {
- this.setState({
- searchData: obj
- }, () => {
- this.loadData(1);
- })
- },
- rizhi(orderNo) {
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: "/api/admin/newOrder/selectOrderLog",
- data: {
- orderNo: orderNo
- },
- success: function (data) {
- let theArr = [];
- let thisData = data.data;
- if (!thisData.length) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- }
- thisData = {};
- } else {
- for (let i = 0; i < data.data.length; i++) {
- let thisdata = data.data[i];
- theArr.push({
- processName: thisdata.processName,
- adminName: thisdata.adminName,
- createDate: thisdata.createDate,
- remarks: thisdata.remarks
- });
- }
- }
- this.setState({
- dataSourcerizhi: theArr
- });
- }.bind(this)
- });
- },
- getOrderLog(orderNo) {
- this.setState({
- rizhivisible: true
- });
- this.rizhi(orderNo);
- },
- closeOrderLog() {
- this.setState({
- rizhivisible: false
- });
- },
- //节点列表
- jiedian(orderNos) {
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
- data: {
- orderNo: orderNos
- },
- success: function (data) {
- let theArr = [];
- let thisData = [];
- if (data.error.length || data.data.list == "") {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- }
- } else {
- for (let i = 0; i < data.data.length; i++) {
- thisData = data.data[i];
- theArr.push({
- key: i,
- dunSubject: thisData.dunSubject
- ? thisData.dunSubject.toString()
- : "", //催款科目
- id: thisData.id, //节点Id
- money: thisData.money, //催款金额
- dunStatus: thisData.dunStatus //催款状态
- });
- }
- this.setState({
- contactList: theArr
- });
- }
- }.bind(this)
- });
- },
- jiedianNew(orderNos) {
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url:
- globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
- data: {
- orderNo: orderNos
- },
- success: function (data) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- } else {
- let theArr = [];
- let thisData = [];
- let arr = data.data || [];
- let totalCui = 0;
- for (let i = 0; i < arr.length; i++) {
- thisData = arr[i];
- totalCui += +thisData.money;
- theArr.push({
- key: i,
- dunSubject: thisData.dunSubject
- ? thisData.dunSubject.toString()
- : "", //催款科目
- id: thisData.id, //节点Id
- money: thisData.money, //催款金额
- // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
- commodityName: thisData.commodityName,
- projectType: thisData.projectType,
- dunTypeName: thisData.dunTypeName,
- status: thisData.status,
- waitDay: thisData.waitDay,
- effectiveCount: thisData.effectiveCount,
- startDate: thisData.startDate,
- dunType: thisData.dunType,
- appropriationRatio: thisData.appropriationRatio,
- customizeName: thisData.customizeName,
- customizeTimes: thisData.customizeTimes,
- tid: thisData.tid,
- });
- }
- if (!totalCui) {
- totalCui = 0;
- }
- totalCui = (Math.round(totalCui * 1000000) / 1000000).toFixed(6);
- this.setState({
- contactListNew: theArr,
- totalCui
- });
- }
- }.bind(this)
- }).always(
- function () {
- this.setState({
- loading: false
- });
- }.bind(this)
- );
- },
- //审核通过
- examOk() {
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
- data: {
- orderNo: this.state.orderNo,
- orderStatus: 2
- },
- success: function (data) {
- if (data.error.length || data.data.list == "") {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- }
- } else {
- message.success("该订单已通过审核~");
- this.setState({
- visible: false
- });
- this.reset();
- }
- }.bind(this)
- }).always(
- function () {
- this.setState({
- loading: false
- });
- }.bind(this)
- );
- },
- //通过发给外包
- outsourcing() {
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
- data: {
- orderNo: this.state.orderNo,
- orderStatus: 2,
- outsource: 1
- },
- success: function (data) {
- if (data.error.length || data.data.list == "") {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- }
- } else {
- message.success("该订单已通过审核~");
- this.setState({
- visible: false
- });
- this.reset();
- }
- }.bind(this)
- }).always(
- function () {
- this.setState({
- loading: false
- });
- }.bind(this)
- );
- },
- //审核不通过
- examOks() {
- this.setState({
- aloading: true
- });
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
- data: {
- orderNo: this.state.orderNo,
- orderStatus: 3,
- reason: this.state.reason
- },
- success: function (data) {
- if (data.error.length || data.data.list == "") {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- this.setState({
- aloading: true
- });
- }
- } else {
- message.success("该订单已被拒绝~");
- this.setState({
- visible: false,
- aloading: false,
- noVisible: false,
- reason: ""
- });
- this.reset();
- }
- }.bind(this)
- }).always(
- function () {
- this.setState({
- loading: false
- });
- }.bind(this)
- );
- },
- //点击拒绝
- examNo() {
- this.setState({
- noVisible: true
- });
- },
- loadDataChange(key) {
- $.ajax({
- method: "get",
- dataType: "json",
- async: false,
- crossDomain: false,
- url: globalConfig.context + "/api/admin/orderChange/orderChangeLogList",
- data: {
- changeId: key
- },
- success: function (data) {
- if (data.error.length || data.data.list == "") {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- }
- } else {
- // console.log("拿到历史", data);
- this.setState({
- dataProps: data.data
- });
- }
- }.bind(this)
- });
- },
- callback(key) {
- this.setState(
- {
- activeKey: key
- },
- () => {
- if (key != "a" && key != "c" && key.length < 10) {
- this.ChangeDetail(key);
- this.loadDataChange(key);
- this.getProceeds(key);
- } else if (key != "a" && key != "c" && key.length > 10) {
- this.primaryOrder(key);
- this.xiangmu(key);
- this.jiedian(key);
- this.jiedianNew(key);
- this.loadDataChange(key);
- }
- }
- );
- if (key === "a") {
- this.xiangmu(this.state.orderNo);
- this.jiedian(this.state.orderNo);
- this.jiedianNew(this.state.orderNo);
- }
- // if (key === "2") {
- // this.ChangeDetail(this.state.id);
- // this.loadDataChange();
- // this.getProceeds(this.state.id);
- // }
- // if (key === "3") {
- // this.primaryOrder(this.state.primaryOrderNo);
- // this.xiangmu(this.state.primaryOrderNo);
- // this.jiedian(this.state.primaryOrderNo);
- // this.jiedianNew(this.state.primaryOrderNo);
- // }
- if (key === "c") {
- this.additionalOrder(this.state.additionalOrder);
- this.xiangmu(this.state.additionalOrder);
- this.jiedian(this.state.additionalOrder);
- this.jiedianNew(this.state.additionalOrder);
- this.setState({
- buttonStatusA: false
- });
- } else {
- this.setState({
- buttonStatusA: true
- });
- }
- },
- closeDesc(e, s) {
- this.state.activeKey = "a";
- this.state.userDetaile = false;
- this.state.signBillVisible = false;
- this.state.visible = e;
- if (s) {
- this.loadData(this.state.pageNo);
- }
- },
- // 获取原订单编号
- getPrimaryOrder(value) {
- this.setState({
- primaryOrder: value
- });
- },
- getAdditionalOrder(value) {
- this.setState({
- additionalOrder: value
- });
- },
- getUrl(url) {
- let theorgCodeUrl = [];
- if (url.length) {
- let picArr = [];
- url.map(function (item) {
- if (
- item.response &&
- item.response.data &&
- item.response.data.length
- ) {
- picArr.push(item.response.data);
- }
- });
- theorgCodeUrl = picArr.join(",");
- }
- return theorgCodeUrl;
- },
- sureOut() {
- if (!this.state.companyName) {
- message.warning("公司名称不能为空");
- return;
- }
- if (!this.state.unitPrice) {
- message.warning("单价不能为空");
- return;
- }
- if (!this.state.unitNumber) {
- message.warning("数量不能为空");
- return;
- }
- if (!this.state.amount) {
- message.warning("总金额不能为空");
- return;
- }
- if (!this.state.outsourceRemarks) {
- message.warning("备注不能为空");
- return;
- }
- if (this.state.pictureUrl.length === 0) {
- message.warning("合同扫描件不能为空");
- return;
- }
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/outsourceOrg/auditOutsource",
- data: {
- id: this.state.id,
- orderNo: this.state.orderNo,
- companyName: this.state.companyName,
- amount: this.state.amount,
- outsourceRemarks: this.state.outsourceRemarks,
- unitNumber: this.state.unitNumber,
- unitPrice: this.state.unitPrice,
- attachmentUrl: this.getUrl(this.state.attachmentUrl).length
- ? this.getUrl(this.state.attachmentUrl)
- : "",
- orderStatus: 2,
- pictureUrl: this.getUrl(this.state.pictureUrl).length
- ? this.getUrl(this.state.pictureUrl)
- : ""
- }
- }).done(
- function (data) {
- this.setState({
- loading: false
- });
- if (!data.error.length) {
- message.success("发起成功!");
- this.outReset();
- this.visitCancel();
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(this)
- );
- },
- //关闭输入理由框
- noCancel() {
- this.setState({
- noVisible: false,
- aloading: false,
- reason: ""
- });
- },
- //重置
- reset() {
- this.setState({
- signBillVisible: false
- });
- this.state.orderNo = "";
- this.state.customerName = "";
- this.state.releaseDate[0] = undefined;
- this.state.releaseDate[1] = undefined;
- this.state.approval = undefined;
- this.loadData(1);
- },
- outReset() {
- this.setState({
- companyName: "",
- amount: "",
- unitPrice: "",
- unitNumber: "",
- outsourceRemarks: "",
- attachmentUrl: [],
- pictureUrl: []
- });
- },
- getOrgCodeUrl(e) {
- this.setState({ pictureUrl: e });
- },
- //关闭详情
- visitCancel() {
- this.setState(
- {
- activeKey: "a"
- },
- () => {
- this.setState({
- visible: false
- });
- }
- );
- this.loadData(this.state.pageNo);
- },
- visitOk() {
- this.setState({
- visible: false
- });
- },
- changeList(arr) {
- const newArr = [];
- this.state.columns.forEach(item => {
- arr.forEach(val => {
- if (val === item.title) {
- newArr.push(item);
- }
- });
- });
- this.setState({
- changeList: newArr
- });
- },
- printAll() {
- this.setState({
- dvisible: true
- // loading: true
- });
- this.state.pagination.pageSize = 9999999;
- this.setState({
- pagination: this.state.pagination
- });
- this.loadData();
- },
- exportAll() {
- window.location.href =
- globalConfig.context +
- "/api/admin/orderChange/exportMyChange?" +
- `orderNo=${this.state.searchData.orderNoSearch
- ? this.state.searchData.orderNoSearch
- : ""
- }&processState=${this.props.processState ? this.props.processState : ""
- }&userName=${this.state.searchData.userNameSearch
- ? this.state.searchData.userNameSearch
- : ""
- }&contractNo=${this.state.searchData.contractNoSearch
- ? this.state.searchData.contractNoSearch
- : ""
- }
- &timeType=${this.state.searchData.timeTypeSearch
- ? this.state.searchData.timeTypeSearch
- : ""
- }
- &startTime=${this.state.searchData.releaseDate[0]
- ? this.state.searchData.releaseDate[0]
- : ""
- }
- &endTime=${this.state.searchData.releaseDate[1]
- ? this.state.searchData.releaseDate[1]
- : ""
- }
- &salesmanName=${this.state.searchData.salesmanNameSearch
- ? this.state.searchData.salesmanNameSearch
- : ""
- }
- &complete=${this.state.searchData.completeSearch || 1}
- &depId=${this.state.searchData.depIdSearch
- ? this.state.searchData.depIdSearch
- : ""
- }
- &type=${this.state.searchData.changeSearch
- ? this.state.searchData.changeSearch
- : ""
- }`;
- },
- createTabs() {
- $.ajax({
- url: globalConfig.context + "/api/admin/orderChange/getOrderChange",
- method: "get",
- data: {
- orderNo: this.state.orderNo
- },
- success: data => {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- } else {
- this.setState({
- tabList: data.data
- });
- }
- }
- });
- },
- render() {
- const data = localStorage.getItem('typeCw') || "";
- const tabList = this.state.tabList || [];
- const formItemLayout = {
- labelCol: { span: 8 },
- wrapperCol: { span: 14 }
- };
- const FormItem = Form.Item;
- const { TabPane } = Tabs;
- const departmentArr = this.state.departmentArr || [];
- return (
- <div className="user-content" style={{ position: "relative" }}>
- <ShowModalDiv ShowModal={this.state.showModal} onClose={() => { this.setState({ showModal: false }) }} />
- <div className="content-title" style={{ marginBottom: 10 }}>
- <span style={{ fontWeight: 900, fontSize: 16 }}>
- 合同变更审核订单
- </span>
- </div>
- <div className="user-search">
- {/* <SearchInput search={this.search} /> */}
- {/* <ChooseList
- columns={this.state.columns}
- changeFn={this.changeList}
- changeList={this.state.changeList}
- top={55}
- /> */}
- <Tabs
- defaultActiveKey="2"
- onChange={this.callbackTab}
- className="test"
- >
- <TabPane tab="更改表格显示数据" key="1">
- <div style={{ marginLeft: 10 }}>
- <ChooseList
- columns={this.state.columns}
- changeFn={this.changeList}
- changeList={this.state.changeList}
- top={55}
- margin={11}
- />
- </div>
- </TabPane>
- <TabPane tab="搜索" key="2">
- <div style={{ marginLeft: 10 }}>
- <SearchInput search={this.search} default={data || '1'} />
- </div>
- </TabPane>
- <TabPane tab="打印" key="3">
- <Button
- type="primary"
- style={{ margin: "11px 0px 10px 10px" }}
- onClick={this.printAll}
- disabled={!this.state.dataSource.length}
- >
- 打印所有列表信息
- </Button>
- </TabPane>
- <TabPane tab="导出Excel" key="4">
- <Button
- type="primary"
- style={{ margin: "11px 0px 10px 10px" }}
- onClick={this.exportAll}
- >
- 导出当前列表
- </Button>
- </TabPane>
- {/* <TabPane tab="批量操作" key="6">
- <Button
- type="primary"
- disabled={this.state.selectedRowKeys.length == 0}
- style={{ margin: "0px 0px 10px 10px" }}
- onClick={e => {
- e.stopPropagation(),
- this.evaluateY(this.state.selectedRowKeys, "财务专员");
- }}
- >
- 转交
- </Button>
- </TabPane> */}
- </Tabs>
- <div className="patent-table">
- <Spin spinning={this.state.loading}>
- <Table
- bordered
- columns={
- this.state.changeList == undefined
- ? this.state.columns
- : this.state.changeList
- }
- scroll={{ x: "max-content", y: 0 }}
- dataSource={this.state.dataSource}
- pagination={this.state.pagination}
- onRowClick={this.tableRowClick}
- // scroll={{ y: 140 }}
- size="small"
- />
- </Spin>
- </div>
- {
- this.state.visible &&
- <Modal
- className="customeDetails"
- footer=""
- maskClosable={false}
- width="1200px"
- visible={this.state.visible}
- onOk={this.visitOk}
- onCancel={this.visitCancel}
- >
- <Tabs
- activeKey={this.state.activeKey}
- onChange={this.callback}
- type="card"
- >
- <TabPane tab="订单详情" key="a">
- <Form
- layout="horizontal"
- onSubmit={this.handleSubmit}
- id="demand-form"
- style={{ paddingBottom: "40px" }}
- >
- <Spin spinning={this.state.loading}>
- {
- this.state.activeKey == "a" &&
- <OrderDetail
- domId='dingdanxiangqing'
- orderData={this.state.orderData}
- getOrderLog={this.getOrderLog}
- dataSourceX={this.state.dataSourceX}
- contactList={this.state.contactList}
- orderNo={this.state.orderNo}
- totalCui={this.state.totalCui}
- contactListNew={this.state.contactListNew}
- pictureUrl={this.state.contractPictureUrl}
- isCaiWu={true}
- />
- }
- </Spin>
- </Form>
- </TabPane>
- {tabList.map((item, index, arr) => {
- return (
- <TabPane tab={"合同变更记录" + (tabList.length - index)} key={item.id}>
- {
- this.state.activeKey == item.id &&
- <ChangeDetail
- domId={'hetongbiangenjilu' + (index + 1)}
- id={item.id}
- money={index == arr.length - 1 ? this.state.orderData.totalAmount + "" : undefined}
- data={this.state.contractData}
- // loadData={this.ChangeDetail}
- txt={this.state.processStateText}
- pictureUrl={this.state.voucherUrl}
- contractPictureUrl={this.state.contractPictureUrl}
- attachment={this.state.attachment}
- processState={this.props.processState}
- loadData={this.callback}
- reset={this.state.visible}
- dataSource={this.state.dataProps}
- proceedsData={this.state.proceedsData}
- proceedsTotal={this.state.proTotal}
- invoiceTotal={this.state.invTotal}
- contactList={this.state.refundInvoice}
- onCancel={this.visitCancel}
- />
- }
- </TabPane>
- );
- })}
- {tabList.map((item, index) => {
- if (item.usedOrder) {
- return (
- <TabPane
- tab={"原订单" + (tabList.length - index)}
- key={item.usedOrder}
- >
- {
- this.state.activeKey == item.usedOrder &&
- <Form
- layout="horizontal"
- onSubmit={this.handleSubmit}
- id="demand-form"
- style={{ paddingBottom: "40px" }}
- >
- <Spin spinning={this.state.loading}>
- {
- this.state.activeKey == item.usedOrder &&
- <OrderDetail
- domId={'yuandingdan' + (index + 1)}
- orderData={this.state.primaryOrderData}
- getOrderLog={this.getOrderLog}
- dataSourceX={this.state.dataSourceX}
- contactList={this.state.contactList}
- orderNo={this.state.primaryOrderNo}
- totalCui={this.state.totalCui}
- contactListNew={this.state.contactListNew}
- isCaiWu={true}
- />
- }
- </Spin>
- </Form>
- }
- </TabPane>
- );
- } else {
- return "";
- }
- })}
- {this.state.status === 4 && this.state.isAddition ? (
- this.state.type === 4 || this.state.type === 5 ? (
- <TabPane tab="附加订单" key="c">
- <OrderDetail
- domId='fujiadingdan'
- orderData={this.state.additionalOrderData}
- getOrderLog={this.getOrderLog}
- dataSourceX={this.state.dataSourceX}
- contactList={this.state.contactList}
- totalCui={this.state.totalCui}
- contactListNew={this.state.contactListNew}
- orderNo={this.state.additionalOrder}
- isCaiWu={true}
- />
- </TabPane>
- ) : (
- ""
- )
- ) : (
- ""
- )}
- </Tabs>
- </Modal>
- }
- <Modal
- maskClosable={false}
- visible={this.state.noVisible}
- onOk={this.handleOk}
- onCancel={this.noCancel}
- width="400px"
- title={"拒绝理由"}
- footer=""
- className="admin-desc-content"
- confirmLoading={this.state.confirmLoading}
- >
- <Form layout="horizontal" id="demand-form">
- <Spin spinning={this.state.loading}>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 16 }}
- label="拒绝理由"
- >
- <Input
- type="textarea"
- placeholder="请输入拒绝理由"
- rows={4}
- value={this.state.reason}
- onChange={e => {
- this.setState({ reason: e.target.value });
- }}
- />
- </FormItem>
- </div>
- <div className="clearfix">
- <Button
- className="cancel"
- type="primary"
- onClick={this.examOks}
- style={{ marginLeft: "50px" }}
- htmlType="submit"
- loading={this.state.aloading}
- >
- 确定
- </Button>
- <Button
- className="cancel"
- type="ghost"
- onClick={this.noCancel}
- style={{ marginLeft: "50px" }}
- >
- 取消
- </Button>
- </div>
- </Spin>
- </Form>
- </Modal>
- {/* <Modal
- visible={this.state.rizhivisible}
- className="admin-desc-content"
- width="800px"
- maskClosable={false}
- title="订单日志"
- footer={null}
- onCancel={this.closeOrderLog}
- >
- <div className="patent-table">
- <Spin spinning={this.state.loading}>
- <Table
- bordered
- columns={this.state.columnsrizhi}
- dataSource={this.state.dataSourcerizhi}
- pagination={false}
- />
- </Spin>
- </div>
- </Modal> */}
- <OrderRiZi
- dataSourcerizhi={this.state.dataSourcerizhi}
- closeOrderLog={this.closeOrderLog}
- visible={this.state.rizhivisible}
- loading={this.state.loading}
- />
- <Modal
- visible={this.state.dvisible}
- footer=""
- title="所有列表信息"
- className="admin-desc-content"
- width="1300px"
- onCancel={() => {
- this.setState({
- dvisible: false
- });
- this.state.pagination.pageSize = 10;
- this.setState({
- pagination: this.state.pagination
- });
- this.loadData();
- }}
- >
- <Spin spinning={this.state.loading}>
- <div
- className="patent-table"
- style={{
- // width: 900,
- // position: "relative",
- // left: "50%",
- // transform: "translate(-50%)",
- padding: "25px 30px 30px 30px"
- }}
- ref={e => {
- this.refs.all = e;
- }}
- >
- <Table
- columns={this.state.columns}
- dataSource={this.state.dataSource}
- pagination={false}
- bordered
- size="small"
- />
- </div>
- </Spin>
- <ReactToPrint
- trigger={() => (
- <Button
- type="primary"
- style={{
- float: "right",
- marginTop: 10,
- position: "absolute",
- top: 0,
- right: 30
- }}
- >
- 打印
- </Button>
- )}
- content={() => this.refs.all}
- />
- </Modal>
- </div>
- {/* {this.state.addnextVisible && <ProjectDetailsReadOnly
- infor={this.state.dataInfor}
- visible={this.state.addnextVisible}
- onCancel={this.nextCancel}
- />} */}
- {
- // 项目业务详情
- this.state.addnextVisible &&
- <NewEditProject
- readOnly={true}
- visible={this.state.addnextVisible}
- dataInfor={this.state.dataInfor}
- onCancel={this.nextCancel}
- />
- }
- </div>
- );
- }
- })
- );
- export default contractChange;
|