|
@@ -1,6 +1,6 @@
|
|
|
// 开单
|
|
|
import React, { Component } from "react";
|
|
|
-import { AutoComplete, Button, Upload, Form, Input, message, Modal, Radio, Select, Spin } from "antd";
|
|
|
+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";
|
|
@@ -9,6 +9,7 @@ import ImgList from "../imgList";
|
|
|
|
|
|
const FormItem = Form.Item;
|
|
|
const Option = Select.Option;
|
|
|
+const RadioGroup = Radio.Group;
|
|
|
|
|
|
const formItemLayout = {
|
|
|
labelCol: { span: 8 },
|
|
@@ -38,6 +39,9 @@ class ProjectOperation extends Component {
|
|
|
serviceLife: [],
|
|
|
isVip: undefined,
|
|
|
histYear: [],
|
|
|
+
|
|
|
+ addyear: undefined,//
|
|
|
+ isGive: 0,//是否赠送
|
|
|
}
|
|
|
this.onSubmit = this.onSubmit.bind(this);
|
|
|
this.httpChange = this.httpChange.bind(this);
|
|
@@ -105,7 +109,7 @@ class ProjectOperation extends Component {
|
|
|
!this.state.commodityQuantity ||
|
|
|
!reg.test(this.state.commodityQuantity)
|
|
|
) {
|
|
|
- message.warning("请输入正确商品数量!");
|
|
|
+ message.warning("请输入正确服务数量!");
|
|
|
return false;
|
|
|
}
|
|
|
if (this.state.displayFees === 'block') {
|
|
@@ -126,13 +130,29 @@ class ProjectOperation extends Component {
|
|
|
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 && !this.state.declarationBatch) {
|
|
|
- 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("请选择是否包含认证费用!");
|
|
@@ -178,6 +198,12 @@ class ProjectOperation extends Component {
|
|
|
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.serviceYear = this.state.serviceYear //申报年份
|
|
|
+ }
|
|
|
if (this.state.isVip == 6) {//会员
|
|
|
infor.yearSum = this.state.yearSum //会员总服务年限
|
|
|
infor.serviceLife = JSON.stringify(this.state.serviceLife) //会员服务年限
|
|
@@ -217,10 +243,31 @@ class ProjectOperation extends Component {
|
|
|
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("请选择会员总服务年限!");
|
|
@@ -261,8 +308,10 @@ class ProjectOperation extends Component {
|
|
|
declarationBatch: this.state.declarationBatch || undefined,//申报批次
|
|
|
ifCertificationFee: isNaN(parseInt(this.state.ifCertificationFee)) ? undefined : this.state.ifCertificationFee,//是否包含认证费用
|
|
|
yearSum: this.state.isVip == 6 ? this.state.yearSum : undefined,
|
|
|
- serviceLife: this.state.isVip == 6 ? JSON.stringify(this.state.serviceLife) : undefined,
|
|
|
- serviceYear: this.state.isVip == 6 ? this.state.serviceYear : undefined,
|
|
|
+ serviceLife: this.state.isVip == 6 ? JSON.stringify(this.state.serviceLife) : undefined,//会员-服务年限
|
|
|
+ serviceYear: this.state.isVip == 6 ? this.state.serviceYear : undefined,// 会员-本次派单
|
|
|
+ serviceLife: this.state.addProjectType == "3" ? JSON.stringify(this.state.serviceLife) : undefined,//审计-服务年限
|
|
|
+ serviceYear: this.state.addProjectType == "5" ? this.state.serviceYear : undefined, //高新-申报年份
|
|
|
},
|
|
|
}).done(
|
|
|
function (data) {
|
|
@@ -406,6 +455,11 @@ class ProjectOperation extends Component {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ handleClose(removedTag) {
|
|
|
+ let serviceLife = this.state.serviceLife.filter(tag => { return tag !== removedTag });
|
|
|
+ this.setState({ serviceLife });
|
|
|
+ }
|
|
|
+
|
|
|
render() {
|
|
|
let options = this.state.states
|
|
|
? this.state.customerArr.map((group) => (
|
|
@@ -603,6 +657,34 @@ class ProjectOperation extends Component {
|
|
|
/>}
|
|
|
{!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}
|
|
@@ -678,22 +760,46 @@ class ProjectOperation extends Component {
|
|
|
{
|
|
|
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,
|
|
|
- serviceYear: undefined,
|
|
|
- })
|
|
|
- }}
|
|
|
- >
|
|
|
- {children}
|
|
|
- </Select>
|
|
|
+ <div>
|
|
|
+ {
|
|
|
+ this.state.serviceLife.map((tag) =>
|
|
|
+ <Tag closable key={tag} afterClose={() => this.handleClose(tag)}>
|
|
|
+ {tag}
|
|
|
+ </Tag>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ {
|
|
|
+ this.state.serviceLife.length < this.state.yearSum &&
|
|
|
+ <Button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ onClick={() => {
|
|
|
+ this.setState({
|
|
|
+ addYears: true,
|
|
|
+ addyear: undefined,
|
|
|
+ isGive: 0,
|
|
|
+ })
|
|
|
+ }}>
|
|
|
+ + 添加服务年限
|
|
|
+ </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>}
|
|
|
+ {/* {!readOnly && <span className="mandatory">*</span>} */}
|
|
|
</FormItem>
|
|
|
}
|
|
|
{
|
|
@@ -798,6 +904,32 @@ class ProjectOperation extends Component {
|
|
|
</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
|
|
|
}
|
|
|
{
|
|
@@ -853,6 +985,62 @@ class ProjectOperation extends Component {
|
|
|
</div>
|
|
|
</Spin>
|
|
|
</Form>
|
|
|
+ {
|
|
|
+ this.state.addYears &&
|
|
|
+ <Modal
|
|
|
+ title="添加服务年限"
|
|
|
+ visible={this.state.addYears}
|
|
|
+ okText="添加"
|
|
|
+ onOk={() => {
|
|
|
+ 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 >
|
|
|
)
|
|
|
}
|