123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503 |
- import React, { Component } from "react";
- import { AutoComplete, Button, Form, Input, message, Modal, Radio, Select, Spin, Tag, DatePicker } from "antd";
- import { boutique } from "../../dataDic";
- import $ from "jquery";
- import { getboutique, splitUrl } from "../../tools";
- import moment from "moment";
- import { vipYear } from "../../dataDic";
- import ImgList from "../imgList";
- const FormItem = Form.Item;
- const Option = Select.Option;
- const RadioGroup = Radio.Group;
- const confirm = Modal.confirm;
- const formItemLayout = {
- labelCol: { span: 8 },
- wrapperCol: { span: 14 },
- };
- const PicturesWall = React.createClass({
- getInitialState() {
- return {
- previewVisible: false,
- previewImage: "",
- fileList: this.props.pictureUrl,
- };
- },
- getDefaultProps() {
- return {
- changeClick: this.modifyChange,
- };
- },
- handleCancel() {
- this.setState({ previewVisible: false });
- },
- handlePreview(file) {
- this.setState({
- previewImage: file.url || file.thumbUrl,
- previewVisible: true,
- });
- },
- handleChange(info) {
- let fileList = info.fileList;
- this.setState({ fileList });
- this.props.fileList(fileList);
- },
- componentWillReceiveProps(nextProps) {
- this.state.fileList = nextProps.pictureUrl;
- },
- render() {
- const { fileList } = this.state;
- return (
- <div style={{ display: "inline-block" }}>
- <ImgList
- domId={this.props.domId}
- uploadConfig={{
- action: globalConfig.context + "/api/admin/orderProject/uploadMemberFile",
- data: { sign: "memberFile" },
- multiple: true,
- listType: "picture-card",
- }}
- onChange={(infor) => {
- this.handleChange(infor);
- }}
- fileList={fileList}
- />
- </div>
- );
- },
- });
- /**
- * 新增项目
- */
- class NewAddProject extends Component {
- constructor(props) {
- super(props);
- this.state = {
- commodityName: '',//项目名称
- commodityQuantity: '',//项目数量
- patentType: 0,
- officialCost: '',
- costReduction: '',
- commodityPrice: '',//项目价格
- main: '',//主要项目 0否 1是
- lastYearCapital: '',//上年度总资本
- lastYearIncome: '',//上年度总资本
- taskComment: '',//项目说明
- declarationBatch: '',
- ifCertificationFee: '',
- displayFees: "none",
- customerArr: [],
- patentTypeList: [],
- loading: false,
- orgCodeUrl: [],
- patentTransfer: 0, //是否为专利转让 0 否 1 是
- serviceLife: [],//服务年份
- isVip: undefined,
- histYear: [],
- editName: false,
- isEdit: false,//是否可编辑
- contractTerm: [],//合同期
- addyear: undefined,//
- isGive: undefined,//是否赠送
- splitList: [],//子集
- addFrom: false,
- serviceYear: '',
- }
- this.onSubmit = this.onSubmit.bind(this);
- this.httpChange = this.httpChange.bind(this);
- this.selectAuto = this.selectAuto.bind(this);
- this.getpatentTypeList = this.getpatentTypeList.bind(this);
- this.getOrgCodeUrl = this.getOrgCodeUrl.bind(this);
- }
- componentDidMount() {
- this.getpatentTypeList();
- this.props.type == "vipAdd" && this.setValue();
- }
- setValue() {
- const { newData } = this.props;
- if (!!newData && newData.length > 0) {
- let list = []
- for (var i = 0; i < newData.length; i++) {
- if (newData[i].cSort == 6) {
- list.push({
- bname: newData[i].commodityName,
- type: newData[i].type,
- id: newData[i].commodityId,
- cSort: newData[i].cSort,
- patentTransfer: newData[i].patentTransfer,
- })
- }
- }
- this.setState({
- commodityName: undefined,
- customerArr: list
- })
- }
- }
- onSubmit() {
- if (this.state.gid === undefined || !this.state.gid) {
- message.warning("服务名称不匹配!");
- return false;
- }
- let reg = /^([0]|[1-9][0-9]*)$/;
- if (
- !this.state.commodityQuantity ||
- !reg.test(this.state.commodityQuantity)
- ) {
- message.warning("请输入正确服务数量!");
- return false;
- }
- if (this.state.displayFees === 'block') {
- if (this.state.patentType === "" && !this.state.patentTransfer) {
- message.warning("请选择专利类型!");
- return false;
- }
- if (this.state.officialCost === '') {
- message.warning("请选择官费!");
- return false;
- }
- if (this.state.costReduction === "" && (this.state.patentType === 0 || this.state.patentType === 2)) {
- message.warning("请选择费减!");
- return false;
- }
- }
- if (isNaN(parseFloat(this.state.commodityPrice))) {
- message.warning("请输入正确的金额!");
- return false;
- }
- // 3审计
- if (this.state.addProjectType == "3") {
- if (this.state.serviceLife.length === 0) {
- message.warning("请选择服务年限!");
- return
- }
- if (this.state.serviceLife.length != this.state.commodityQuantity) {
- message.warning("服务数量与服务年限不符!");
- return
- }
- if (isNaN(parseFloat(this.state.lastYearCapital))) {
- message.warning("请输入正确的企业上年度总资本!");
- return
- }
- if (isNaN(parseFloat(this.state.lastYearIncome))) {
- message.warning("请输入正确的企业上年度总收入!");
- return
- }
- }
- if (!this.state.main) {
- message.warning("请选择是否为主要项目!");
- return false;
- }
- // 5高新
- if (this.state.addProjectType === 5) {
- if (!this.state.declarationBatch) {
- message.warning("请选择企业要求申报批次!");
- return
- }
- if (!this.state.serviceYear) {
- message.warning("请选择申报年份!");
- return
- }
- }
- if (this.state.isIso && !this.state.ifCertificationFee) {
- message.warning("请选择是否包含认证费用!");
- return false;
- }
- if (this.state.isVip == 6) {
- // if (this.state.yearSum === undefined) {
- // message.warning("请选择会员总服务年限!");
- // return
- // }
- if (this.state.serviceLife.length === 0) {
- message.warning("请添加会员服务年限!");
- return
- }
- // if (this.state.serviceLife.length != this.state.yearSum) {
- // message.warning("会员服务年限与总年限不符合!");
- // return
- // }
- // if (this.state.serviceYear === undefined) {
- // message.warning("请选择本次派单年份!");
- // return
- // }
- if (this.state.contractTerm.length === 0 || this.state.contractTerm[1] == "") {
- message.warning("请填写合同期!");
- return
- }
- }
- this.setState({
- loading: true,
- });
- let infor = {
- commodityId: this.state.gid, //商品ID
- orderNo: this.props.orderNo, //订单编号
- commodityName: this.state.commodityName, //商品名称
- commodityQuantity: this.state.isVip == 6 ? this.state.yearSum : this.state.commodityQuantity, //商品数量
- commodityPrice: this.state.commodityPrice, //签单总价
- taskComment: this.state.taskComment, //服务说明
- main: this.state.main, //是否为主要项目
- }
- // 变更添加 this.props.type == "change"
- let type = 0;
- if (this.props.typeChange == 4 || this.props.typeChange == 5) {
- type = 1;
- }
- if (this.props.type == "change") {
- infor.cid = this.props.cid
- infor.type = type
- }
- if (this.state.displayFees === 'block') {
- infor.officialCost = this.state.officialCost //是否有官费
- infor.costReduction = (this.state.patentType === 0 || this.state.patentType === 2) ? this.state.costReduction : 0//是否有费减
- infor.patentType = this.state.patentType //专利类型
- }
- if (this.state.isIso) {
- infor.ifCertificationFee = this.state.ifCertificationFee || undefined;//是否包含认证费用
- }
- if (this.state.addProjectType == "3") {//审计
- infor.serviceLife = JSON.stringify(this.state.serviceLife) //服务年限
- infor.lastYear = new Date().getFullYear() - 1 //上年度年份
- infor.lastYearCapital = this.state.lastYearCapital //上年度总资本
- infor.lastYearIncome = this.state.lastYearIncome //上年度总收入
- }
- if (this.state.addProjectType == "5") {//高新
- infor.declarationBatch = this.state.declarationBatch || 1//申报批次
- infor.serviceYear = this.state.serviceYear //申报年份
- }
- if (this.state.isVip == 6) {//会员
- infor.yearSum = this.state.yearSum //会员总服务年限
- infor.serviceLife = JSON.stringify(this.state.serviceLife) //会员服务年限
- // infor.serviceYear = this.state.serviceYear //本次派单年份
- infor.contractTerm = JSON.stringify(this.state.contractTerm)//合同期
- }
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context +
- this.props.type == "change"
- ? "/api/admin/orderChange/addChangeTask"
- : "/api/admin/newOrder/addOrderTask",
- data: infor,
- }).done(
- function (data) {
- this.setState({
- loading: false,
- });
- if (!data.error.length) {
- message.success("保存成功!");
- if (this.state.isVip == 6) {
- this.setState({
- isEdit: true,
- editName: true,
- tid: data.data.id,
- })
- } else {
- this.props.onCancel();
- }
- if (this.props.type == "change") {
- this.setState({
- tid: data.data.id
- })
- }
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(this)
- );
- }
- httpChange(e) {
- this.setState({
- commodityName: e,
- });
- if (e.length >= 1) {
- this.supervisor(e, false);
- }
- }
- //加载(自动补全)
- supervisor(e, state) {
- //客户名称与服务名称自动补全
- let api = state
- ? "/api/admin/customer/getCustomerByName"
- : "/api/admin/order/getBusinessProjectByName";
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + api,
- data: state
- ? {
- name: e,
- type: this.state.customType,
- }
- : {
- businessName: e,
- },
- success: function (data) {
- let thedata = data.data;
- if (!thedata) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- }
- thedata = {};
- }
- this.setState({
- states: state,
- customerArr: thedata,
- });
- }.bind(this),
- }).always(
- function () {
- }.bind(this)
- );
- }
- //上级主管输入框失去焦点是判断客户是否存在
- selectAuto(value) {
- const { newData, children = "splitList" } = this.props
- let kid = {};
- let fwList = this.state.customerArr;
- fwList.map(function (item) {
- if (value == item.bname) {
- kid = item;
- }
- });
- if (kid.type == "1") {
- this.setState({
- displayFees: "block",
- patentTransfer: kid.patentTransfer,
- });
- } else {
- this.setState({
- displayFees: "none",
- });
- }
- //0通用 1专利 2软著 3审计 4双软 5高新 6商标
- this.setState({
- commodityName: value,
- gid: kid.id,
- addProjectType: kid.type,
- isIso: value.indexOf("贯标") !== -1,// 是否为贯标项目
- isVip: kid.cSort,//暂时判断等于6的时候会员
- commodityQuantity: kid.cSort == 6 ? 1 : undefined,//服务数量
- histYear: [],
- });
- if (newData && newData.length > 0 && kid.cSort == 6) {
- for (var i = newData.length - 1; i >= 0; i--) {
- if (newData[i].commodityId == kid.id) {
- if (!!newData[i][children]) {
- let list = []
- for (var j = 0; j < newData[i][children].length; j++) {
- list.push(newData[i][children][j].serviceYear)
- }
- this.setState({
- histYear: list, // 已派单
- })
- }
- this.setState({
- commodityPrice: newData[i].commodityPrice, // 实签价格
- main: newData[i].main.toString(), // 是否为主要项目
- yearSum: !newData[i].yearSum ? "" : newData[i].yearSum, // 会员总服务年限
- serviceLife: !newData[i].serviceLife ? [] : JSON.parse(newData[i].serviceLife), // 会员服务年限
- contractTerm: (!newData[i].contractTerm || (newData[i].contractTerm.indexOf("-") == -1)) ? [] : JSON.parse(newData[i].contractTerm), // 合同期
- // taskComment: kid.cSort == 6 ? undefined : newData[i].taskComment, // 项目说明
- isEdit: true, // 不可编辑
- splitList: newData[i][children] || [],
- tid: newData[i].id, // 父级项目id
- })
- return
- } else {
- this.setState({
- commodityPrice: undefined,
- main: undefined,
- yearSum: undefined,
- serviceLife: [],
- contractTerm: [],
- taskComment: undefined,
- isEdit: false, // 可编辑
- splitList: [],
- })
- }
- }
- }
- }
- getpatentTypeList() {
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/orderProject/getPatentType',
- success: function (data) {
- if (data.error.length === 0) {
- this.setState({
- patentTypeList: data.data
- })
- } else {
- message.warning(data.error[0].message);
- };
- }.bind(this)
- });
- }
- deleteMemberSonProject(id) {
- const { splitList, serviceLife } = this.state
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/orderProject/deleteMemberSonProject',
- data: {
- id,
- },
- success: function (data) {
- if (data.error.length === 0) {
- let splList = splitList
- for (var i = 0; i < splitList.length; i++) {
- if (id == splitList[i].id) {
- splList.splice(i, 1)
- }
- }
- this.setState({
- splitList: splList
- })
- } else {
- message.warning(data.error[0].message);
- };
- }.bind(this)
- });
- }
- handleClose(removedTag) {
- let serviceLife = this.state.serviceLife.filter(tag => { return tag !== removedTag });
- this.setState({
- serviceLife,
- commodityQuantity: serviceLife.length == 0 ? undefined : serviceLife.length,
- yearSum: serviceLife.length == 0 ? undefined : serviceLife.length.toString(),
- serviceYear: undefined
- });
- }
- // 添加会员子项目
- addMemberFirstSonProject() {
- // type=="change" 变更项目
- const { type = "" } = this.props
- // type=="vipAdd" 需审批的会员项目
- let pictureUrl = [];
- if (type == "vipAdd") {
- if (this.state.orgCodeUrl.length) {
- let picArr = [];
- this.state.orgCodeUrl.map(function (item) {
- if (
- item.response &&
- item.response.data &&
- item.response.data.length
- ) {
- picArr.push(item.response.data);
- }
- });
- pictureUrl = picArr.join(",");
- }
- if (this.state.memberType === undefined) {
- message.warning("请选择付款情况!");
- return
- }
- if (this.state.memberType == "1" || this.state.memberType == "2") {
- if (typeof pictureUrl !== "string") {
- message.warning("请上传附件!");
- return
- }
- }
- }
- if (this.state.serviceYear === undefined) {
- message.warning("请选择本次派单年份!");
- return
- }
- this.setState({
- loading: true,
- });
- let info = {
- tid: this.state.tid,
- serviceYear: this.state.serviceYear,
- taskComment: this.state.taskComment,
- }
- let changeInfo = {
- id: this.state.tid,
- serviceYear: this.state.serviceYear,
- taskComment: this.state.taskComment,
- }
- let vipAddInfo = {
- tid: this.state.tid,
- serviceYear: this.state.serviceYear,//本次派单
- taskComment: this.state.taskComment,//服务说明
- memberType: this.state.memberType,//会员付款状态
- pictureUrl: pictureUrl.length ? pictureUrl : undefined,//附件
- }
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context +
- type == "change"
- ? "/api/admin/orderChange/addMemberSonProject" : type == "vipAdd"
- ? "/api/admin/orderProject/addMemberSonProject" : "/api/admin/orderProject/addMemberFirstSonProject",
- data: type == "change" ? changeInfo : type == "vipAdd" ? vipAddInfo : info,
- }).done(
- function (data) {
- this.setState({
- loading: false,
- });
- if (!data.error.length) {
- message.success("添加成功!");
- let list = this.state.splitList
- let histList = this.state.histYear
- list.push(data.data)
- histList.push(data.data.serviceYear)
- this.setState({
- addFrom: false,
- splitList: list,
- histYear: histList,
- serviceYear: undefined,
- taskComment: undefined,
- memberType: undefined,
- orgCodeUrl: [],
- })
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(this)
- );
- }
- // 图片添加
- getOrgCodeUrl(e) {
- this.setState({ orgCodeUrl: e });
- }
- render() {
- let newOptions = this.state.customerArr.map((group, index) => (
- <Select.Option key={index} value={group.bname}>
- {group.bname}
- </Select.Option>
- ));
- let options = this.state.states
- ? this.state.customerArr.map((group) => (
- <Select.Option key={group.id} value={group.name}>
- {group.name}
- </Select.Option>
- ))
- : this.state.customerArr.map((group, index) => (
- <Select.Option key={index} value={group.bname}>
- {group.bname}
- </Select.Option>
- ));
- let children = vipYear.map(its => (
- <Option key={its}>{its}</Option>
- ));
- const { RangePicker } = DatePicker;
- const { type = "" } = this.props;
- const { isVip, histYear, isEdit } = this.state
- return (
- <Modal
- maskClosable={false}
- visible={this.props.visible}
- onOk={this.props.onCancel}
- onCancel={this.props.onCancel}
- width="920px"
- title={"新增项目任务"}
- footer=""
- className="admin-desc-content"
- >
- <Form
- layout="horizontal"
- >
- <Spin spinning={this.state.loading}>
- <div>
- <div className="clearfix">
- {
- type == "vipAdd" ?
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="服务名称"
- >
- <Select
- style={{ width: '200px' }}
- placeholder="请选择服务名称"
- value={this.state.commodityName}
- onChange={this.selectAuto}
- >
- {newOptions}
- </Select>
- </FormItem> :
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="服务名称"
- >
- {this.state.jid ? this.state.commodityName :
- <AutoComplete
- disabled={(isVip == 6 && this.state.editName)}
- className="certain-category-search"
- dropdownClassName="certain-category-search-dropdown"
- dropdownMatchSelectWidth={false}
- style={{ width: "200px" }}
- dataSource={options}
- placeholder="输入服务名称"
- value={this.state.commodityName}
- onChange={this.httpChange}
- filterOption={true}
- onSelect={this.selectAuto}
- >
- <Input />
- </AutoComplete>}
- {<span className="mandatory">*</span>}
- </FormItem>
- }
- {
- isVip != 6 &&
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="服务数量"
- >
- {
- <Input
- placeholder="请输入服务数量"
- disabled={isVip == 6}
- value={this.state.commodityQuantity}
- style={{ width: "200px" }}
- onChange={(e) => {
- this.setState({ commodityQuantity: e.target.value });
- }}
- ref="commodityQuantity"
- />
- }
- {<span className="mandatory">*</span>}
- </FormItem>
- }
- </div>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="实签价格(万元)"
- >
- {
- <Input
- type='number'
- placeholder="请输入实签价格"
- disabled={isEdit}
- value={this.state.commodityPrice}
- style={{ width: "200px" }}
- onChange={(e) => {
- this.setState({ commodityPrice: e.target.value });
- }}
- ref="commodityPrice"
- />
- }
- {<span className="mandatory">*</span>}
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="主要业务"
- >
- {
- <Select
- placeholder="选择是否为主要业务"
- disabled={isEdit}
- style={{ width: "200px" }}
- value={this.state.main}
- onChange={(e) => {
- this.setState({ main: e });
- }}
- >
- {boutique.map(function (item) {
- return (
- <Select.Option key={item.value}>
- {item.key}
- </Select.Option>
- );
- })}
- </Select>
- }
- {<span className="mandatory">*</span>}
- </FormItem>
- {!this.state.patentTransfer &&
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="专利类型:"
- style={{
- display: this.state.displayFees,
- }}
- >
- {
- <Select
- placeholder="请选择专利类型"
- style={{ width: "200px" }}
- value={this.state.patentType}
- onChange={(e) => {
- this.setState({ patentType: e });
- if (e !== 0 && e !== 2) {
- this.setState({
- costReduction: ''
- })
- }
- }}
- >
- {this.state.patentTypeList.map(function (v, k) {
- return (
- <Select.Option key={k} value={v.id}>{v.name}</Select.Option>
- );
- })}
- </Select>
- }
- <span style={{ color: "red", marginLeft: "8px" }}>
- *
- </span>
- </FormItem>}
- <div className="clearfix">
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="官费:"
- style={{
- display: this.state.displayFees,
- }}
- >
- {
- <Radio.Group
- value={this.state.officialCost}
- onChange={(e) => {
- this.setState({ officialCost: e.target.value });
- if (e.target.value === 0) {
- this.setState({
- costReduction: ''
- })
- }
- }}
- >
- <Radio value={1}>含官费</Radio>
- <Radio value={0}>不含官费</Radio>
- </Radio.Group>
- }
- <span style={{ color: "red", marginLeft: "8px" }}>
- *
- </span>
- </FormItem>
- </div>
- {
- (this.state.patentType === 0 || this.state.patentType === 2) &&
- <div className="clearfix">
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="费减:"
- style={{
- display: this.state.displayFees,
- }}
- >
- {/*专利类型不为复审或者申请时置灰*/}
- <Radio.Group
- disabled={this.state.patentType !== 0 && this.state.patentType !== 2}
- value={this.state.costReduction}
- onChange={(e) => {
- this.setState({ costReduction: e.target.value });
- }}
- >
- <Radio value={1}>有费减</Radio>
- <Radio value={0}>无费减</Radio>
- </Radio.Group>
- <span style={{ color: "red", marginLeft: "8px" }}>
- *
- </span>
- </FormItem>
- </div>
- }
- {
- //审计
- this.state.addProjectType == "3" &&
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="服务年限"
- >
- {
- <Select
- mode="multiple"
- style={{ width: '200px' }}
- placeholder="请选择服务年限"
- value={this.state.serviceLife}
- onChange={(e) => {
- this.setState({
- serviceLife: e,
- })
- }}
- >
- {children}
- </Select>
- }
- {<span className="mandatory">*</span>}
- </FormItem>
- }
- {/* {
- isVip == 6 &&
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="科技项目"
- >
- <RadioGroup onChange={() => { }}>
- <Radio value={1}>国家级</Radio>
- <Radio value={2}>省级</Radio>
- <Radio value={3}>市区级</Radio>
- <Radio value={4}>简易项目</Radio>
- </RadioGroup>
- </FormItem>
- } */}
- {/* {
- isVip == 6 &&
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="标准会员"
- >
- <RadioGroup onChange={() => { }}>
- <Radio value={1}>高新会员</Radio>
- <Radio value={2}>加计扣除</Radio>
- <Radio value={3}>研发奖补</Radio>
- </RadioGroup>
- </FormItem>
- } */}
- {/* {
- isVip == 6 &&
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="简单会员"
- >
- <RadioGroup onChange={() => { }} value={1}>
- <Radio value={1}>仅填报表,仅咨询,不出备查资料</Radio>
- </RadioGroup>
- </FormItem>
- } */}
- {/* {
- isVip == 6 &&
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="简单会员"
- >
- <RadioGroup onChange={() => { }} value={1}>
- <Radio value={1}>仅提供单边会员服务</Radio>
- </RadioGroup>
- </FormItem>
- } */}
- {
- isVip == 6 &&
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="会员总服务年限"
- >
- {
- !this.state.yearSum ? "" :
- [
- { value: "0", key: "" },
- { value: "1", key: "一年" },
- { value: "2", key: "二年" },
- { value: "3", key: "三年" },
- { value: "4", key: "四年" },
- { value: "5", key: "五年" },
- { value: "6", key: "六年" },
- { value: "7", key: "七年" },
- { value: "8", key: "八年" },
- { value: "9", key: "九年" },
- { value: "10", key: "十年" },
- ][this.state.yearSum]["key"]
- }
- </FormItem>
- }
- {
- // 会员合同期
- isVip == 6 &&
- <div className="clearfix">
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="会员服务年限"
- >
- {
- <div>
- {
- this.state.serviceLife.map((tag) =>
- <Tag closable={!isEdit} key={tag}
- afterClose={() => this.handleClose(tag)}
- >{tag}</Tag>
- )
- }
- {
- !isEdit && (this.state.serviceLife.length < 10) &&
- <Button
- size="small"
- type="primary"
- style={{ marginLeft: 0 }}
- onClick={() => {
- this.setState({
- addYears: true,
- addyear: undefined,
- isGive: undefined,
- })
- }}>
- + 添加服务年限
- </Button>
- }
- </div>
- }
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="合同期"
- >
- {
- <RangePicker
- style={{ width: 200 }}
- disabled={isEdit}
- value={[
- this.state.contractTerm[0]
- ? moment(this.state.contractTerm[0])
- : null,
- this.state.contractTerm[1]
- ? moment(this.state.contractTerm[1])
- : null,
- ]}
- onChange={(data, dataString) => {
- this.setState({ contractTerm: dataString });
- }}
- />
- }
- {<span className="mandatory">*</span>}
- </FormItem>
- </div>
- }
- {
- // 审计
- this.state.addProjectType == "3" &&
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 16 }}
- label=""
- >
- <span style={{ color: "red" }}>注:派单年度的上年度总资产和收入。如,当前为2022年,那么需要填写2021年的总资产和收入!</span>
- </FormItem>
- <FormItem
- className="half-item"
- label="企业上年度总资产(万元)"
- {...formItemLayout}
- >
- <Input
- type='number'
- placeholder=""
- value={this.state.lastYearCapital}
- style={{ width: "200px" }}
- onChange={(e) => {
- this.setState({ lastYearCapital: e.target.value });
- }}
- />
- {<span className="mandatory">*</span>}
- </FormItem>
- <FormItem
- className="half-item"
- label="企业上年度总收入(万元)"
- {...formItemLayout}
- >
- <Input
- type='number'
- placeholder=""
- value={this.state.lastYearIncome}
- style={{ width: "200px" }}
- onChange={(e) => {
- this.setState({ lastYearIncome: e.target.value });
- }}
- />
- {<span className="mandatory">*</span>}
- </FormItem>
- </div>
- }
- {
- // 普通项目说明
- isVip != 6 &&
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 16 }}
- label="项目说明"
- >
- {
- <Input
- type="textarea"
- placeholder=""
- autosize={{ minRows: 3 }}
- value={this.state.taskComment}
- onChange={(e) => {
- this.setState({ taskComment: e.target.value });
- }}
- />
- }
- </FormItem>
- </div>
- }
- {/*0通用 1专利 2软著 3审计 4双软 5高新 6商标*/}
- {this.state.addProjectType === 5 &&
- <div className="clearfix">
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="企业要求申报批次"
- >
- {
- <Select
- placeholder="请选择企业要求申报批次"
- style={{ width: "200px" }}
- value={this.state.declarationBatch}
- onChange={(e) => {
- this.setState({ declarationBatch: e });
- }}
- >
- <Select.Option value={1}>
- 第一批
- </Select.Option>
- <Select.Option value={2}>
- 第二批
- </Select.Option>
- <Select.Option value={3}>
- 第三批
- </Select.Option>
- <Select.Option value={4}>
- 第四批
- </Select.Option>
- </Select>
- }
- {<span className="mandatory">*</span>}
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="申报年份"
- >
- {
- <Select
- style={{ width: '200px' }}
- placeholder="请选择申报年份"
- value={this.state.serviceYear}
- onChange={e => {
- this.setState({
- serviceYear: e,
- })
- }}
- >
- {
- vipYear.map(its => (
- <Option key={its}>{its}</Option>
- ))
- }
- </Select>
- }
- {<span className="mandatory">*</span>}
- </FormItem>
- </div>
- }
- {
- this.props.isIso || this.state.isIso ?
- <div className="clearfix">
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="是否包含认证费用"
- >
- {
- <Select
- placeholder="请选择是否包含认证费用"
- style={{ width: "200px" }}
- value={this.state.ifCertificationFee}
- onChange={(e) => {
- this.setState({ ifCertificationFee: e });
- }}
- >
- <Select.Option value={"0"}>否</Select.Option>
- <Select.Option value={"1"}>是</Select.Option>
- </Select>
- }
- {<span className="mandatory">*</span>}
- </FormItem>
- </div> : null
- }
- {((isVip != 6) || (isVip == 6 && !isEdit)) &&
- <div className="clearfix">
- <FormItem
- wrapperCol={{ span: 12, offset: 8 }}
- className="half-middle"
- >
- <Button
- className="submitSave"
- type="primary"
- onClick={() => {
- this.onSubmit();
- }}
- >
- 保存
- </Button>
- <Button
- className="submitSave"
- type="ghost"
- onClick={this.props.onCancel}
- >
- 取消
- </Button>
- </FormItem>
- </div>
- }
- {
- // 会员项目子集列表
- isEdit &&
- !!this.state.splitList && this.state.splitList.length > 0 &&
- this.state.splitList.map((item) =>
- <div
- key={item.id}
- className="clearfix"
- style={{
- width: "100%",
- borderTop: "1px dashed #000000",
- padding: "10px 0"
- }}
- >
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="本次派单"
- >
- {item.serviceYear}
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="服务数量"
- >
- {item.commodityQuantity}
- </FormItem>
- {
- type == "vipAdd" &&
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="付款情况"
- >
- {item.memberType == "0"
- ? "已付会员节点全款" : item.memberType == "1"
- ? "已付部分期款,需特批" : item.memberType == "2"
- ? "未付款,需特批" : ""}
- </FormItem>
- }
- {
- type == "vipAdd" &&
- (item.memberType == "1" || item.memberType == "2") &&
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 16 }}
- label="附件"
- >
- {item.pictureUrl ?
- <div>
- <ImgList fileList={splitUrl(item.pictureUrl, ",", globalConfig.avatarHost + "/upload")} ItemWidth={'96px'} />
- </div> : <div />}
- </FormItem>
- </div>
- }
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 16 }}
- label="项目说明"
- >
- {item.taskComment}
- </FormItem>
- </div>
- </div>
- )
- }
- {
- this.state.splitList.length < this.state.yearSum &&
- <div
- className="clearfix"
- style={{
- width: "100%",
- borderTop: "1px dashed #000000",
- padding: "30px 0 10px 0"
- }}
- >
- {
- isEdit &&
- !this.state.addFrom &&
- this.state.splitList.length < this.state.yearSum &&
- <div className="clearfix">
- <FormItem
- wrapperCol={{ span: 19, offset: 8 }}
- className="half-middle"
- >
- <Button
- type="primary"
- onClick={() => {
- this.setState({
- addFrom: true
- })
- }}
- >
- + 添加本次派单
- </Button>
- <span style={{ color: "#61BBE2", marginLeft: 10 }}>请填写本次派单的年份,派单表示立即安排人员开始相关的工作!!!</span>
- </FormItem>
- </div>
- }
- {
- this.state.addFrom &&
- <div>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="本次派单"
- >
- <Select
- placeholder="请选择本次派单年份"
- style={{ width: "200px" }}
- value={this.state.serviceYear}
- onChange={(e) => {
- this.setState({ serviceYear: e });
- }}
- >
- {this.state.serviceLife.length > 0 && this.state.serviceLife.map(function (item) {
- return (
- <Select.Option key={item} disabled={histYear.includes(item)}>
- {item}
- </Select.Option>
- );
- })}
- </Select>
- {<span className="mandatory">*</span>}
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="服务数量"
- >
- <Input
- placeholder="请输入服务数量"
- disabled={isVip == 6}
- value={1}
- style={{ width: "200px" }}
- // onChange={(e) => {
- // this.setState({ commodityQuantity: e.target.value });
- // }}
- ref="commodityQuantity"
- />
- {<span className="mandatory">*</span>}
- </FormItem>
- {
- this.props.type == "vipAdd" &&
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="付款情况"
- >
- {
- <Select
- placeholder="选择付款情况"
- style={{ width: "200px" }}
- value={this.state.memberType}
- onChange={(e) => {
- this.setState({ memberType: e });
- }}
- >
- {[
- { value: "0", key: "已付会员节点全款" },
- { value: "1", key: "已付部分期款,需特批" },
- { value: "2", key: "未付款,需特批" }].map(function (item) {
- return (
- <Select.Option key={item.value}>
- {item.key}
- </Select.Option>
- );
- })}
- </Select>
- }
- <span className="mandatory">*</span>
- </FormItem>
- }
- {
- (this.state.memberType == "1" || this.state.memberType == "2") && this.props.type == "vipAdd" &&
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 16 }}
- label="上传附件"
- >
- <PicturesWall
- domId={'vip'}
- fileList={this.getOrgCodeUrl}
- pictureUrl={this.state.orgCodeUrl}
- />
- {<span className="mandatory">*</span>}
- </FormItem>
- <div style={{ color: "red", marginLeft: 144, marginBottom: 15 }}>
- 特批需上传附件图,请上传客户同意我方继续服务并安排给我司付款的聊天记录截图,
- <p>若没有客户同意继续服务及会安排付款的截图,特派流程将无法走下去,以免造成派单耽搁</p>
- </div>
- </div>
- }
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 16 }}
- label="项目说明"
- >
- <Input
- type="textarea"
- placeholder=""
- autosize={{ minRows: 2 }}
- value={this.state.taskComment}
- onChange={(e) => {
- this.setState({ taskComment: e.target.value });
- }}
- />
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- wrapperCol={{ span: 12, offset: 8 }}
- className="half-middle"
- >
- <Button
- className="submitSave"
- type="primary"
- onClick={() => { this.addMemberFirstSonProject() }}
- >
- 保存
- </Button>
- <Button
- className="submitSave"
- type="ghost"
- onClick={() => {
- this.setState({
- addFrom: false
- })
- }}
- >
- 取消
- </Button>
- </FormItem>
- </div>
- </div>
- }
- </div>
- }
- </div>
- </Spin>
- </Form>
- {
- this.state.addYears &&
- <Modal
- title="添加服务年限"
- visible={this.state.addYears}
- okText="添加"
- onOk={() => {
- if (!this.state.addyear) {
- message.warn("请选择年份!")
- return
- }
- if (this.state.isGive == undefined) {
- message.warn("请选择是否赠送!")
- return
- }
- let slist = this.state.serviceLife
- if (this.state.isGive == 0) {
- slist.push(this.state.addyear)
- } else if (this.state.isGive == 1) {
- let newYear = this.state.addyear + "(赠)"
- slist.push(newYear)
- }
- this.setState({
- serviceLife: slist,
- yearSum: slist.length.toString(),
- addYears: false
- })
- }}
- onCancel={() => {
- this.setState({
- addYears: false
- })
- }}
- >
- <Select
- style={{ width: '200px', marginRight: 50 }}
- placeholder="请选择年份"
- onChange={e => {
- this.setState({
- addyear: e,
- })
- }}
- >
- {
- vipYear.map(its => (
- <Option
- key={its}
- disabled={this.state.serviceLife.toString().includes(its)}
- >{its}</Option>
- ))
- }
- </Select>
- <RadioGroup
- onChange={e => {
- this.setState({
- isGive: e.target.value
- })
- }}
- value={this.state.isGive}
- >
- <Radio value={0}>非赠送</Radio>
- <Radio value={1}>赠送</Radio>
- </RadioGroup>
- </Modal>
- }
- </Modal >
- )
- }
- }
- export default NewAddProject;
|