1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159 |
- // 开单
- import React, { Component } from "react";
- import { AutoComplete, Button, Upload, Form, Input, message, Modal, Radio, Select, Spin, Tag, } from "antd";
- import { boutique } from "../../dataDic";
- import $ from "jquery";
- import { getboutique, splitUrl } from "../../tools";
- import { vipYear } from "../../dataDic";
- import ImgList from "../imgList";
- const FormItem = Form.Item;
- const Option = Select.Option;
- const RadioGroup = Radio.Group;
- const formItemLayout = {
- labelCol: { span: 8 },
- wrapperCol: { span: 14 },
- };
- class ProjectOperation extends Component {
- constructor(props) {
- super(props);
- this.state = {
- commodityName: '',
- commodityQuantity: '',
- patentType: 0,
- officialCost: '',
- costReduction: '',
- commodityPrice: '',
- main: '',
- taskComment: '',
- declarationBatch: '',
- ifCertificationFee: '',
- displayFees: "none",
- customerArr: [],
- patentTypeList: [],
- loading: false,
- orgCodeUrl: [],
- patentTransfer: props.dataInfor ? props.dataInfor.patentTransfer : 0, //收否为专利转让 0 否 1 是
- serviceLife: [],
- isVip: undefined,
- histYear: [],
- isEdit: false,//是否可编辑
- contractTerm: [],//合同期
- addyear: undefined,//
- isGive: undefined,//是否赠送
- cPeriod: false, // 合同期是否可编辑
- }
- 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.setValue = this.setValue.bind(this);
- }
- componentDidMount() {
- this.getpatentTypeList();
- this.setValue();
- }
- setValue() {
- const { dataInfor, newData } = this.props;
- if (!(dataInfor && Object.keys(dataInfor).length > 0)) { return; }
- if (dataInfor.type === 1) {
- this.setState({
- displayFees: "block",
- costReduction: dataInfor.costReduction,
- officialCost: dataInfor.officialCost,
- patentType: dataInfor.patentType ? dataInfor.patentType : 0,
- });
- } else {
- this.setState({
- displayFees: "none",
- });
- }
- let llist = []
- if (newData && newData.length > 0) {
- for (var i = 0; i < newData.length; i++) {
- if (newData[i].commodityId == dataInfor.commodityId) {
- llist.push(newData[i].serviceYear != dataInfor.serviceYear && newData[i].serviceYear)
- }
- }
- }
- this.setState({
- jid: dataInfor.id, //项目ID
- kid: dataInfor.commodityId, //商品ID
- commodityName: dataInfor.commodityName, //项目名称
- commodityPrice: dataInfor.commodityPrice, //金额
- commodityQuantity: dataInfor.commodityQuantity, //数量
- patentTypeName: dataInfor.patentTypeName,//专利类型名称
- taskComment: dataInfor.taskComment, //备注
- main: dataInfor.main.toString(), //是否为主要
- addState: 0,
- addnextVisible: true,
- addProjectType: dataInfor.type,
- declarationBatch: dataInfor.declarationBatch || 1,//申报批次(只有高新有)
- ifCertificationFee: isNaN(parseInt(dataInfor.ifCertificationFee)) ? '' : dataInfor.ifCertificationFee,//是否包含认证费
- isIso: dataInfor.commodityName.indexOf("贯标") !== -1,
- orgCodeUrl: dataInfor.pictureUrl
- ? splitUrl(
- dataInfor.pictureUrl,
- ",",
- globalConfig.avatarHost + "/upload"
- )
- : [],
- isVip: dataInfor.cSort,
- yearSum: dataInfor.yearSum,//会员总服务年限
- serviceLife: !dataInfor.serviceLife ? [] : JSON.parse(dataInfor.serviceLife), // 会员服务年限
- contractTerm: !dataInfor.contractTerm ? [] : JSON.parse(dataInfor.contractTerm), // 合同期
- serviceYear: dataInfor.serviceYear,//本次派单
- // isEdit: true, // 不可编辑
- isEdit: llist.length <= 1 ? false : true, // 同一会员项目有且只有一条时可编辑 其他情况不可编辑
- histYear: llist, // 本次已派单
- cPeriod: llist.length <= 1 ? false : !dataInfor.contractTerm ? false : true, //合同期
- });
- }
- 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) && this.state.officialCost === 1) {
- message.warning("请选择费减!");
- return false;
- }
- }
- if (isNaN(parseFloat(this.state.commodityPrice))) {
- message.warning("请输入正确的金额!");
- return false;
- }
- if (this.state.addProjectType == "3") {// 3审计
- if (this.state.serviceLife.length === 0) {
- message.warning("请选择服务年限!");
- return
- }
- if (this.state.serviceLife.length != this.state.commodityQuantity) {
- message.warning("服务数量与服务年限不符!");
- return
- }
- }
- if (!this.state.main) {
- message.warning("请选择是否为主要项目!");
- return false;
- }
- if (this.state.addProjectType === 5) {// 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) {
- 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.commodityQuantity, //商品数量
- commodityPrice: this.state.commodityPrice, //签单总价
- taskComment: this.state.taskComment, //服务说明
- main: this.state.main, //是否为主要项目
- }
- if (this.state.displayFees === 'block') {
- infor.officialCost = this.state.officialCost //是否有官费
- infor.costReduction = (this.state.patentType === 0 || this.state.patentType === 2) ? (this.state.officialCost === 1 ? this.state.costReduction : 0) : 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) //服务年限
- }
- 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 + "/api/admin/newOrder/addOrderTask",
- data: infor,
- }).done(
- function (data) {
- this.setState({
- loading: false,
- });
- if (!data.error.length) {
- message.success("保存成功!");
- this.props.onCancel();
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(this)
- );
- }
- onChange() {
- const { type = "", dataInfor } = this.props
- if (isNaN(parseFloat(this.state.commodityPrice))) {
- 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.addProjectType == "3") {
- if (this.state.serviceLife.length === 0) {
- message.warning("请选择服务年限!");
- return
- }
- if (this.state.serviceLife.length != this.state.commodityQuantity) {
- message.warning("服务数量与服务年限不符!");
- return
- }
- }
- if (!this.state.main) {
- message.warning("请选择是否为主要项目!");
- return false;
- }
- if (this.state.addProjectType === 5) {// 5高新
- if (!this.state.declarationBatch) {
- message.warning("请选择企业要求申报批次!");
- return
- }
- if (!this.state.serviceYear) {
- message.warning("请选择申报年份!");
- return
- }
- }
- 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) {
- message.warning("请填写合同期!");
- return
- }
- }
- this.setState({
- loading: true,
- });
- let infor = {
- id: this.state.jid, //项目ID
- commodityId: this.state.kid, //商品ID
- orderNo: this.props.orderNo, //订单编号
- main: this.state.main, //是否为主要
- commodityPrice: this.state.commodityPrice, //金额
- commodityQuantity: this.state.commodityQuantity, //数量
- taskComment: this.state.taskComment, //备注
- }
- 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) //服务年限
- }
- if (this.state.addProjectType == "5") {//高新
- infor.declarationBatch = this.state.declarationBatch || undefined//申报批次
- 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)//合同期
- }
- // 新开单与签单项目变更 -- 编辑项目
- if (type == "biangeng") {
- infor.id = dataInfor.id
- infor.type = dataInfor.tid ? 2 : 1
- infor.tid = dataInfor.tid
- }
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + type == ""
- ? "/api/admin/newOrder/updateOrderTask"
- : "/api/admin/orderChange/updateChangeTask",
- data: infor,
- }).done(
- function (data) {
- this.setState({
- loading: false,
- });
- if (!data.error.length) {
- message.success("保存成功!");
- this.props.onCancel();
- } 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 } = 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) {
- let llist = []
- for (var i = 0; i < newData.length; i++) {
- if (newData[i].commodityId == kid.id) {
- llist.push(newData[i].serviceYear)
- }
- }
- this.setState({
- histYear: llist
- })
- for (var i = newData.length - 1; i >= 0; i--) {
- if (newData[i].commodityId == kid.id) {
- this.setState({
- commodityPrice: newData[i].commodityPrice, // 实签价格
- main: "0", // 是否为主要项目
- yearSum: newData[i].yearSum.toString(), // 会员总服务年限
- serviceLife: !newData[i].serviceLife ? [] : JSON.parse(newData[i].serviceLife), // 会员服务年限
- contractTerm: !newData[i].contractTerm ? [] : JSON.parse(newData[i].contractTerm), // 合同期
- taskComment: newData[i].taskComment, // 项目说明
- isEdit: true, // 不可编辑
- cPeriod: !newData[i].contractTerm ? false : true, //合同期编辑
- })
- return
- } else {
- this.setState({
- commodityPrice: undefined,
- main: undefined,
- yearSum: undefined,
- serviceLife: [],
- contractTerm: [],
- taskComment: undefined,
- isEdit: false, // 可编辑
- cPeriod: false,
- })
- }
- }
- }
- }
- 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)
- });
- }
- handleClose(removedTag) {
- let serviceLife = this.state.serviceLife.filter(tag => { return tag !== removedTag });
- this.setState({ serviceLife, serviceYear: undefined });
- }
- render() {
- 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 { readOnly } = 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="900px"
- title={readOnly ? "项目任务详情" : this.state.jid ? "编辑项目任务" : "添加项目任务"}
- footer=""
- className="admin-desc-content"
- >
- <Form
- layout="horizontal"
- >
- <Spin spinning={this.state.loading}>
- <div className="clearfix">
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="服务名称"
- >
- {this.state.jid ? this.state.commodityName : <AutoComplete
- 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>}
- {!readOnly && <span className="mandatory">*</span>}
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="服务数量"
- >
- {readOnly ? this.state.commodityQuantity : <Input
- placeholder="请输入服务数量"
- disabled={isVip == 6}
- value={this.state.commodityQuantity}
- style={{ width: "200px" }}
- onChange={(e) => {
- this.setState({ commodityQuantity: e.target.value });
- }}
- ref="commodityQuantity"
- />}
- {!readOnly && <span className="mandatory">*</span>}
- </FormItem>
- <div style={{ marginTop: "33px", color: "red", textAlign: "right", position: "relative", top: "-8", left: "0" }}>如会员项目,服务一年,请填写1,服务二年,请填写2,依次类推</div>
- {!this.state.patentTransfer && <FormItem
- className="half-item"
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 14 }}
- label="专利类型:"
- style={{
- display: this.state.displayFees,
- marginLeft: "63px",
- }}
- >
- {readOnly ? this.state.patentTypeName : <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"
- labelCol={{ span: 3 }}
- wrapperCol={{ span: 14 }}
- label="官费:"
- style={{
- display: this.state.displayFees,
- marginLeft: "63px",
- }}
- >
- {readOnly
- ? (this.state.officialCost === 1 ? '含官费' : this.state.officialCost === 0 ? '不含官费' : '')
- : <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>
- <div className="clearfix">
- {
- readOnly ?
- <FormItem
- className="half-item"
- labelCol={{ span: 3 }}
- wrapperCol={{ span: 14 }}
- label="费减:"
- style={{
- display: this.state.displayFees,
- marginLeft: "63px",
- }}
- >
- {this.state.costReduction === 1 ? '有费减' : this.state.costReduction === 0 ? '无费减' : ''}
- <span style={{ color: "red", marginLeft: "8px" }}>
- *
- </span>
- </FormItem>
- :
- (this.state.patentType === 0 || this.state.patentType === 2) &&
- <FormItem
- className="half-item"
- labelCol={{ span: 3 }}
- wrapperCol={{ span: 14 }}
- label="费减:"
- style={{
- display: this.state.displayFees,
- marginLeft: "63px",
- }}
- >
- {/*不含官费或者专利类型不为复审或者申请时置灰*/}
- <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>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="实签价格(万元)"
- >
- {readOnly ? this.state.commodityPrice : <Input
- type='number'
- placeholder="请输入实签价格"
- disabled={isEdit}
- value={this.state.commodityPrice}
- style={{ width: "200px" }}
- onChange={(e) => {
- this.setState({ commodityPrice: e.target.value });
- }}
- ref="commodityPrice"
- />}
- {!readOnly && <span className="mandatory">*</span>}
- </FormItem>
- {
- //审计
- this.state.addProjectType == "3" &&
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="服务年限"
- >
- {
- readOnly ?
- !!this.state.serviceLife ? this.state.serviceLife.toString() : "" :
- <Select
- mode="multiple"
- style={{ width: '200px' }}
- placeholder="请选择服务年限"
- value={this.state.serviceLife}
- onChange={(e) => {
- this.setState({
- serviceLife: e,
- })
- }}
- >
- {children}
- </Select>
- }
- {!readOnly && <span className="mandatory">*</span>}
- </FormItem>
- }
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="主要业务"
- >
- {readOnly ? getboutique(this.state.main) : <Select
- placeholder="选择是否为主要业务"
- 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>}
- {!readOnly && <span className="mandatory">*</span>}
- </FormItem>
- {
- isVip == 6 &&
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="会员总服务年限"
- >
- {readOnly ?
- !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"] :
- <Select
- placeholder="请选择会员总服务年限"
- style={{ width: "200px" }}
- disabled={isEdit}
- value={typeof (this.state.yearSum) === "number" ? this.state.yearSum.toString() : this.state.yearSum}
- onChange={(e) => {
- this.setState({
- yearSum: e,
- serviceLife: [],
- serviceYear: undefined,
- });
- }}
- >
- {[
- { 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: "十年" },
- ].map(function (item) {
- return (
- <Select.Option key={item.value}>
- {item.key}
- </Select.Option>
- );
- })}
- </Select>}
- {!readOnly && <span className="mandatory">*</span>}
- </FormItem>
- }
- {
- isVip == 6 &&
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="会员服务年限"
- >
- {
- readOnly ?
- !!this.state.serviceLife ? this.state.serviceLife.toString() : "" :
- <div>
- {
- this.state.serviceLife.map((tag) =>
- <Tag closable={!isEdit} key={tag} afterClose={() => this.handleClose(tag)}>
- {tag}
- </Tag>
- )
- }
- {
- !isEdit && (this.state.serviceLife.length < this.state.yearSum) &&
- <Button
- size="small"
- type="primary"
- onClick={() => {
- this.setState({
- addYears: true,
- addyear: undefined,
- isGive: undefined,
- })
- }}>
- + 添加服务年限
- </Button>
- }
- </div>
- // <Select
- // mode="multiple"
- // style={{ width: '200px' }}
- // placeholder="请选择服务年限"
- // value={this.state.serviceLife}
- // onChange={e => {
- // this.setState({
- // serviceLife: e,
- // serviceYear: undefined,
- // })
- // }}
- // >
- // {children}
- // </Select>
- }
- {/* {!readOnly && <span className="mandatory">*</span>} */}
- </FormItem>
- }
- {
- isVip == 6 &&
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="本次派单"
- >
- {readOnly ?
- this.state.serviceYear :
- <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>}
- {!readOnly && <span className="mandatory">*</span>}
- </FormItem>
- }
- {
- isVip == 6 &&
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="合同期"
- >
- {
- readOnly ?
- !!this.state.contractTerm ? this.state.contractTerm.toString() : "" :
- <Select
- mode="multiple"
- style={{ width: '200px' }}
- placeholder="请选择合同期"
- disabled={this.state.cPeriod}
- value={this.state.contractTerm}
- onChange={e => {
- this.setState({
- contractTerm: e,
- })
- }}
- >
- {children}
- </Select>
- }
- {!readOnly && <span className="mandatory">*</span>}
- </FormItem>
- }
- {/* {
- this.state.orgCodeUrl.length > 0 &&
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 16 }}
- label="附件"
- >
- <ImgList
- fileList={this.state.orgCodeUrl}
- domId="publicStatistics"
- />
- </FormItem>
- </div>
- } */}
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 16 }}
- label="项目说明"
- >
- {readOnly ? this.state.taskComment :
- <Input
- type="textarea"
- placeholder=""
- autosize={{ minRows: 4 }}
- value={this.state.taskComment}
- onChange={(e) => {
- this.setState({ taskComment: e.target.value });
- }}
- />}
- </FormItem>
- {/* <div style={{ color: "red", marginLeft: 144 }}>
- 请详细说明项目服务时间,总服务时间及付款情况,如:<span style={{ color: "#333" }}>派2022年会员服务,总会员服务三年,客户付款情况说明</span>
- <p>未付款时,需进行特批审核,请详细说明预计付款时间等详细情况</p>
- </div> */}
- </div>
- {/*0通用 1专利 2软著 3审计 4双软 5高新 6商标*/}
- {this.state.addProjectType === 5 ?
- <div className="clearfix">
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="企业要求申报批次"
- >
- {readOnly ? (
- this.state.declarationBatch === 1 ? '第一批' :
- this.state.declarationBatch === 2 ? '第二批' :
- this.state.declarationBatch === 3 ? '第三批' :
- this.state.declarationBatch === 4 ? '第四批' : '未知'
- ) :
- <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>}
- {!readOnly && <span className="mandatory">*</span>}
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="申报年份"
- >
- {
- readOnly ? this.state.serviceYear :
- <Select
- style={{ width: '200px' }}
- placeholder="请选择申报年份"
- value={this.state.serviceYear}
- onChange={e => {
- this.setState({
- serviceYear: e,
- })
- }}
- >
- {
- vipYear.map(its => (
- <Option key={its}>{its}</Option>
- ))
- }
- </Select>
- }
- {!readOnly && <span className="mandatory">*</span>}
- </FormItem>
- </div> : null
- }
- {
- this.props.isIso || this.state.isIso ? <div className="clearfix">
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="是否包含认证费用"
- >
- {readOnly ? (
- this.state.ifCertificationFee == "1" ? '包含' :
- this.state.ifCertificationFee == "0" ? '不包含' : '未知'
- ) : <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>}
- {!readOnly && <span className="mandatory">*</span>}
- </FormItem>
- </div> : null
- }
- {readOnly ? null : <FormItem
- wrapperCol={{ span: 12, offset: 4 }}
- className="half-middle"
- >
- <Button
- className="submitSave"
- type="primary"
- onClick={() => {
- if (this.state.jid) {
- this.onChange();
- } else {
- this.onSubmit();
- }
- }}
- >
- 保存
- </Button>
- <Button
- className="submitSave"
- type="ghost"
- onClick={this.props.onCancel}
- >
- 取消
- </Button>
- </FormItem>}
- </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,
- 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 ProjectOperation;
|