Sfoglia il codice sorgente

外包/供应商信息

mentoswzq 4 anni fa
parent
commit
09506a0177

File diff suppressed because it is too large
+ 1236 - 1238
js/component/manageCenter/financialManage/distribute/approvedOutsourcing.jsx


File diff suppressed because it is too large
+ 482 - 458
js/component/manageCenter/order/orderNew/checkOutsourcing.jsx


+ 515 - 0
js/component/manageCenter/order/orderNew/checkProject.jsx

@@ -0,0 +1,515 @@
+import React, { Component } from 'react'
+import {
+  Form,
+  Spin,
+  Table,
+  Modal,
+  Radio,
+  Col,
+  Upload,
+  Input,
+  Button,
+} from 'antd'
+import { getMaterialStatus, getUrgentStatus } from '@/tools'
+import './checkProjectStyle.less'
+
+const radioGroupStyle = {
+  display: 'flex',
+  flexFlow: 'row nowrap',
+  alignItems: 'flex-start',
+  flex: 1,
+}
+
+const layout = {
+  labelCol: {
+    span: 8,
+  },
+  wrapperCol: {
+    span: 16,
+  },
+};
+
+const tailLayout = {
+  wrapperCol: {
+    offset: 8,
+    span: 16,
+  },
+};
+
+const radioStyle = {
+  display: 'flex',
+  flexFlow: 'row nowrap',
+}
+
+const FormItem = Form.Item
+
+class CheckProject extends Component {
+  constructor(props) {
+    super(props)
+    this.state = {
+      value: '',
+      loading: false,
+      previewImage: '',
+      previewVisible: false,
+      previewPayVisible: false,
+      // 专利
+      ContactsListsNew: [
+        {
+          title: '供应商名称',
+          dataIndex: 'companyName',
+          key: 'companyName',
+          render: (text, record, index) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '单价(万元)',
+          dataIndex: 'unitPrice',
+          key: 'unitPrice',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '数量',
+          dataIndex: 'quantity',
+          key: 'quantity',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '总价(万元)',
+          dataIndex: 'totalAmount',
+          key: 'totalAmount',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '材料',
+          dataIndex: 'material',
+          key: 'material',
+          render: (text, record) => {
+            return getMaterialStatus(text)
+          },
+        },
+        {
+          title: '加急',
+          dataIndex: 'urgent',
+          key: 'urgent',
+          render: (text, record) => {
+            return getUrgentStatus(text)
+          },
+        },
+        {
+          title: '操作',
+          dataIndex: 'action',
+          key: 'action',
+          render: (text, record) => {
+            return (
+              <div>
+                <Button type="primary" onClick={() => {
+                  this.setState({
+                    previewPayVisible: true
+                  })
+                }}>
+                  申请付款
+                </Button>
+              </div>
+            )
+          },
+        },
+      ],
+      //付款节点表头
+      PayNodeTableColunms: [
+        {
+          title: '供应商名称',
+          dataIndex: 'companyName',
+          key: 'companyName',
+          render: (text, record, index) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '付款科目',
+          dataIndex: 'dunType',
+          key: 'dunType',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '付款时间',
+          dataIndex: 'partyTimes',
+          key: 'partyTimes',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '数量',
+          dataIndex: 'quantity',
+          key: 'quantity',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '总价(万元)',
+          dataIndex: 'totalAmount',
+          key: 'totalAmount',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '付款(万元)',
+          dataIndex: 'partyAmount',
+          key: 'partyAmount',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+      ],
+    }
+  }
+
+  onChange() {
+    this.setState({
+      value: e.target.value,
+    })
+  }
+
+  tableRowClickOne(record) {}
+
+  //点击付款节点详情
+  payNodeTableRowClickOne(record) {}
+
+  //第三方信息 新增支付
+  addOrderPayment(id) {
+    $.ajax({
+      method: 'POST',
+      dataType: 'json',
+      crossDomain: false,
+      url: globalConfig.context + '/api/admin/company/addOrderPayment',
+      data: {},
+    }).done(
+      function (data) {
+        this.setState({
+          loading: false,
+        })
+        if (!data.error.length) {
+          message.success('保存成功!')
+          this.noCancel()
+        } else {
+          message.warning(data.error[0].message)
+        }
+      }.bind(this)
+    )
+  }
+
+  handleSubmit(e){
+    e.preventDefault();
+    console.log('Success:',this.props.form);
+  }
+
+  render() {
+    return (
+      <div className="App">
+        <div className="projectType">
+          <div className="typeTitle">
+            <div className="required">*</div>
+            <div>类型:</div>
+          </div>
+          <Radio.Group style={radioGroupStyle} value={this.props.startType}>
+            <Radio value={0} style={radioStyle}>
+              <div>
+                <div>供应商信息(外包派单,不走总部)</div>
+                <div className="tipsText">提示高于总部价格,费用个人承担</div>
+              </div>
+            </Radio>
+            <Radio value={1} style={radioStyle}>
+              供应商信息(普通单)
+            </Radio>
+          </Radio.Group>
+        </div>
+        <div className="thirdParty">
+          <div>
+            <span
+              style={{
+                fontSize: '18px',
+              }}
+            >
+              第三方信息
+            </span>
+          </div>
+          <div
+            className="clearfix"
+            style={
+              {
+                // display: this.state.type == 1 ? 'block' : 'block',
+              }
+            }
+          >
+            <Spin spinning={this.state.loading}>
+              <Form layout="horizontal">
+                <Table
+                  pagination={false}
+                  columns={this.state.ContactsListsNew}
+                  dataSource={this.props.thirdInfoList}
+                  onRowClick={this.tableRowClickOne}
+                  scroll={{ x: 'max-content', y: 0 }}
+                  bordered
+                  size="small"
+                />
+                <Col span={24} offset={9} style={{ marginTop: '15px' }}></Col>
+              </Form>
+            </Spin>
+          </div>
+        </div>
+        <div className="thirdParty">
+          <div>
+            <span
+              style={{
+                fontSize: '18px',
+              }}
+            >
+              付款节点
+            </span>
+          </div>
+          <div
+            className="clearfix"
+            style={
+              {
+                // display: this.state.type == 1 ? 'block' : 'block',
+              }
+            }
+          >
+            <Spin spinning={this.state.loading}>
+              <Form layout="horizontal">
+                <Table
+                  pagination={false}
+                  columns={this.state.PayNodeTableColunms}
+                  dataSource={this.props.dataSource}
+                  onRowClick={this.payNodeTableRowClickOne}
+                  scroll={{ x: 'max-content', y: 0 }}
+                  bordered
+                  size="small"
+                />
+                <Col span={24} offset={9} style={{ marginTop: '15px' }}></Col>
+              </Form>
+            </Spin>
+          </div>
+        </div>
+        <div
+          className="clearfix"
+          style={{
+            borderTop: '1px #000000 dashed',
+            paddingTop: '20px',
+          }}
+        >
+          <FormItem
+            labelCol={{ span: 2 }}
+            wrapperCol={{ span: 8 }}
+            label="备注"
+          >
+            <Input
+              type="textarea"
+              placeholder="请输入备注"
+              rows={4}
+              value={this.props.outsourceRemarks}
+            />
+          </FormItem>
+        </div>
+        <div className="clearfix">
+          <FormItem
+            labelCol={{ span: 3 }}
+            wrapperCol={{ span: 18 }}
+            label="合同/协议扫描件"
+          >
+            <Upload
+              className="demandDetailShow-upload"
+              listType="picture-card"
+              fileList={this.props.fileList}
+              onPreview={(file) => {
+                this.setState({
+                  previewImage: file.url || file.thumbUrl,
+                  previewVisible: true,
+                })
+              }}
+            />
+            <Modal
+              maskClosable={false}
+              footer={null}
+              visible={this.state.previewVisible}
+              onCancel={() => {
+                this.setState({ previewVisible: false })
+              }}
+            >
+              <img
+                alt=""
+                style={{ width: '100%' }}
+                src={this.state.previewImage || ''}
+              />
+            </Modal>
+          </FormItem>
+        </div>
+        {/* 申请付款 */}
+        <Modal
+          maskClosable={false}
+          footer={null}
+          visible={this.state.previewPayVisible}
+          onCancel={() => {
+            this.setState({ previewPayVisible: false })
+          }}
+        >
+          <div>
+            <div>支付供应商费用</div>
+            <Form
+                {...layout}
+                name="basic"
+                initialValues={{
+                  remember: true,
+                }}
+                onSubmit={this.handleSubmit}
+            >
+              <Form.Item
+                  style={{
+                    display:'flex'
+                  }}
+                  label="付款单位/个人:"
+                  name="company"
+                  rules={[
+                    {
+                      required: true,
+                      message: '请输入付款单位/个人!',
+                    },
+                  ]}
+              >
+                <Input style={{ width: '200px' }} placeholder="请输入付款单位/个人"/>
+              </Form.Item>
+              <Form.Item
+                  style={{
+                    display:'flex'
+                  }}
+                  label="单价(万元):"
+                  name="unitPrice"
+                  rules={[
+                    {
+                      required: true,
+                      message: '请输入单价!',
+                    },
+                  ]}
+              >
+                <Input style={{ width: '200px' }} placeholder="请输入单价" type={'number'}/>
+              </Form.Item>
+              <Form.Item
+                  style={{
+                    display:'flex'
+                  }}
+                  label="数量:"
+                  name="num"
+                  rules={[
+                    {
+                      required: true,
+                      message: '请输入數量!',
+                    },
+                  ]}
+              >
+                <Input style={{ width: '200px' }} placeholder="请输入數量" type={'number'}/>
+              </Form.Item>
+              <Form.Item
+                  style={{
+                    display:'flex'
+                  }}
+                  label="总价(万元):"
+                  name="totalPrice"
+                  rules={[
+                    {
+                      required: true,
+                      message: '请输入总价!',
+                    },
+                  ]}
+              >
+                <Input style={{ width: '200px' }} placeholder="请输入总价" type={'number'}/>
+              </Form.Item>
+              <Form.Item
+                  style={{
+                    display:'flex'
+                  }}
+                  label="已付(万元):"
+                  name="paid"
+                  rules={[
+                    {
+                      required: true,
+                      message: '请输入已付金额!',
+                    },
+                  ]}
+              >
+                <Input style={{ width: '200px' }} placeholder="请输入已付金额" type={'number'}/>
+              </Form.Item>
+              <Form.Item
+                  style={{
+                    display:'flex'
+                  }}
+                  label="本次申请支付金额(万元):"
+                  name="payment"
+                  rules={[
+                    {
+                      required: true,
+                      message: '请输入本次申请支付金额!',
+                    },
+                  ]}
+              >
+                <Input style={{ width: '200px' }} placeholder="请输入本次申请支付金额(" type={'number'}/>
+              </Form.Item>
+              <Form.Item
+                  style={{
+                    display:'flex'
+                  }}
+                  label="备注:"
+                  name="remarks"
+                  rules={[
+                    {
+                      required: true,
+                      message: '请输入本次申请支付金额!',
+                    },
+                  ]}
+              >
+                <Input style={{ width: '200px' }} placeholder="请输入本次申请支付金额(" type={'textarea'}/>
+              </Form.Item>
+              <Form.Item>
+                <Button type="primary" htmlType="submit">
+                  确定申请支付
+                </Button>
+              </Form.Item>
+            </Form>
+          </div>
+        </Modal>
+      </div>
+    )
+  }
+}
+
+export default CheckProject

+ 29 - 0
js/component/manageCenter/order/orderNew/checkProjectStyle.less

@@ -0,0 +1,29 @@
+.App {
+  padding-top: 10px;
+
+  .thirdParty {
+    padding: 20px 20px 0px 20px;
+  }
+
+  .projectType {
+    display: flex;
+    flex-flow: row nowrap;
+    border-bottom: 1px #000000 dashed;
+    padding-left: 20px;
+
+    .typeTitle {
+      display: flex;
+      flex-flow: row nowrap;
+      align-items: center;
+      padding-right: 15px;
+
+      .required {
+        color: #F00;
+      }
+    }
+
+    .tipsText {
+      color: #F00;
+    }
+  }
+}

+ 194 - 115
js/component/manageCenter/order/orderNew/outsourcingPro.jsx

@@ -34,6 +34,7 @@ import "./customer.less";
 import ShowModalDiv from "@/showModal.jsx";
 import ResolutionDetail from "@/resolutionDetail";
 const confirm = Modal.confirm;
+import CheckProject from './checkProject'
 import OrderRiZi from "@/orderRiZi.jsx";
 //图片组件
 const PicturesWall = React.createClass({
@@ -814,6 +815,181 @@ const outsourcingPro = Form.create()(
         }.bind(this)
       );
     },
+    thirdTable(id){
+      $.ajax({
+        method: 'get',
+        dataType: 'json',
+        crossDomain: false,
+        url: globalConfig.context + '/api/admin/company/selectCompany',
+        data: {
+          tid: id,
+        },
+        success: function (data) {
+          if (data.error && data.error.length) {
+            message.warning(data.error[0].message)
+          } else {
+            let companyNameArr = []
+            let theArr = []
+            let thisData = []
+            let arr = data.data || []
+            let allTotalAmount = 0
+            for (let i = 0; i < arr.length; i++) {
+              thisData = arr[i]
+              allTotalAmount =
+                  (allTotalAmount * 10000 + thisData.totalAmount * 10000) / 10000
+              companyNameArr.push(thisData.companyName)
+              theArr.push({
+                key: i,
+                id: thisData.id, //节点Id
+                tid: thisData.tid,
+                companyName: thisData.companyName, //供应商名称
+                unitPrice: thisData.unitPrice, //单价
+                quantity: thisData.quantity, //数量
+                totalAmount: thisData.totalAmount, //总价
+                material: thisData.material, //材料 0无 1有
+                urgent: thisData.urgent, //	0无加急(系统默认)1加急3天 2加急4天 3加急5-10天 4加急11-15天 5加急16-20天 6加急21-25天 7加急26-30天
+                audit: thisData.audit, //0无审计 1年审 2专审
+                assets: thisData.assets, //资产
+                income: thisData.income, //收入
+                remarks: thisData.remarks, //备注
+                cid: thisData.cid, //机构id
+              })
+            }
+            if (!allTotalAmount) {
+              allTotalAmount = 0
+            }
+            console.log(theArr)
+            console.log(companyNameArr)
+
+            this.setState({
+              tid: id,
+              PayNodeCompany: companyNameArr,
+              thirdInfoList: theArr,
+              allTotalAmount: allTotalAmount,
+            })
+          }
+        }.bind(this),
+      }).always(
+          function () {
+            this.setState({
+              loading: false,
+            })
+          }.bind(this)
+      )
+    },
+    payNodeTable(id) {
+      $.ajax({
+        method: 'get',
+        dataType: 'json',
+        crossDomain: false,
+        url: globalConfig.context + '/api/admin/company/selectPaymentNode',
+        data: {
+          tid: id,
+        },
+        success: function (data) {
+          if (data.error && data.error.length) {
+            message.warning(data.error[0].message)
+          } else {
+            let payNodeArr = []
+            let thisData = []
+            let arr = data.data || []
+            // console.log('this.state.paySubject', this.state.paySubject)
+            //对#5283自定义的补充展示
+            this.state.paySubject.push({ key: '自定义', value: '0' })
+            for (let i = 0; i < arr.length; i++) {
+              thisData = arr[i]
+              //遍历paySubject,获取当前dunType对应的key
+              this.state.paySubject.map((item) => {
+                if (item.value == thisData.dunType) {
+                  thisData.dunType = item.key
+                }
+              })
+              payNodeArr.push({
+                key: i,
+                id: thisData.id, //付款节点Id
+                tid: thisData.tid,
+                companyName: thisData.companyName, //供应商名称
+                projectType: thisData.projectType, //项目分类
+                dunType: thisData.dunType, //催款分类
+                unitPrice: thisData.unitPrice, //单价
+                quantity: thisData.quantity, //数量
+                totalAmount: thisData.totalAmount, //总价
+                partyAmount: thisData.partyAmount, //付款
+                partyTimes: thisData.partyTimes, //付款时间
+                cid: thisData.cid, //机构id
+              })
+            }
+            console.log('payNodeArr:', payNodeArr)
+            // console.log('paySubject:', this.state.paySubject)
+            this.setState({
+              tid: id,
+              payNodeList: payNodeArr,
+            })
+          }
+        }.bind(this),
+      }).always(
+          function () {
+            this.setState({
+              loading: false,
+            })
+          }.bind(this)
+      )
+    },
+    waiDetail() {
+      let url = window.location.href.substring(7)
+      this.setState({
+        loading: true,
+      })
+      $.ajax({
+        method: 'get',
+        dataType: 'json',
+        crossDomain: false,
+        url:
+            globalConfig.context + '/api/admin/outsourceOrg/orderOutsourceDtails',
+        data: {
+          tid: this.state.tid,
+          orderNo: this.state.orderNo,
+        },
+      }).done(
+          function (data) {
+            this.setState({
+              loading: false,
+            })
+            if (!data.error.length && data.data) {
+              this.setState({
+                startType: data.data.startType, //类型
+                patentType: data.data.patentType, //专利类型
+                patentNameType: data.data.patentNameType, //专利名称类型
+                patentName: data.data.patentName, //专利名称
+                outsourceRemarks: data.data.outsourceRemarks,
+                remarks: data.data.remarks,
+                companyName: data.data.companyName,
+                amount: data.data.amount,
+                mid: data.data.id,
+                unitPrice: data.data.unitPrice,
+                refundStatus: data.data.refundStatus,
+                unitNumber: data.data.unitNumber,
+                pictureUrl: data.data.pictureUrl
+                    ? splitUrl(
+                        data.data.pictureUrl,
+                        ',',
+                        globalConfig.avatarHost + '/upload',
+                        url
+                    )
+                    : [], //图片地址
+                createTimes: data.data.createTimes,
+                auditTimes: data.data.auditTimes,
+              })
+            } else if (data.error && data.error.length) {
+              message.warning(data.error[0].message)
+            } else if (!data.data) {
+              this.setState({
+                refundStatus: undefined,
+              })
+            }
+          }.bind(this)
+      )
+    },
     tableRowClick(record) {
       this.setState(
         {
@@ -830,6 +1006,10 @@ const outsourcingPro = Form.create()(
       this.xiangmu(record.orderNo);
       this.jiedian(record.orderNo);
       this.jiedianNew(record.orderNo);
+      // 获取第三方信息表格
+      this.thirdTable(record.tid);
+      //获取支付节点信息表格
+      this.payNodeTable(record.tid);
 
       $.ajax({
         method: "get",
@@ -1048,6 +1228,9 @@ const outsourcingPro = Form.create()(
       this.setState({ pictureUrl: e });
     },
     callback(e) {
+      if (e == 2) {
+        this.waiDetail()
+      }
       this.setState({
         activeKey: e,
       });
@@ -1159,7 +1342,9 @@ const outsourcingPro = Form.create()(
           <div className="user-search">
             <Tabs
               defaultActiveKey="1"
-              onChange={this.callback}
+              onChange={(e) => {
+                this.callback(e);
+              }}
               className="test"
             >
               <TabPane tab="搜索" key="1">
@@ -1682,120 +1867,14 @@ const outsourcingPro = Form.create()(
                 </TabPane>
                 <TabPane tab="外包审核" key="2">
                   <Spin spinning={this.state.loading}>
-                    <div className="clearfix">
-                      <FormItem
-                        className="half-item"
-                        {...formItemLayout}
-                        label="外包公司"
-                      >
-                        <span>{this.state.companyName}</span>
-                      </FormItem>
-                    </div>
-                    <div className="clearfix">
-                      <FormItem
-                        className="half-item"
-                        {...formItemLayout}
-                        label="单价(万元)"
-                      >
-                        <span>{this.state.unitPrice}</span>
-                      </FormItem>
-                    </div>
-                    <div className="clearfix">
-                      <FormItem
-                        className="half-item"
-                        {...formItemLayout}
-                        label="数量(个)"
-                      >
-                        <span>{this.state.unitNumber}</span>
-                      </FormItem>
-                    </div>
-                    <div className="clearfix">
-                      <FormItem
-                        className="half-item"
-                        {...formItemLayout}
-                        label="总金额(万元)"
-                      >
-                        <span>{this.state.amount}</span>
-                      </FormItem>
-                    </div>
-                    <div className="clearfix">
-                      <FormItem
-                        className="half-item"
-                        {...formItemLayout}
-                        label="备注"
-                      >
-                        <span>{this.state.outsourceRemarks}</span>
-                      </FormItem>
-                    </div>
-                    <div className="clearfix">
-                      <FormItem
-                        labelCol={{ span: 4 }}
-                        wrapperCol={{ span: 18 }}
-                        label="合同/协议扫描件"
-                      >
-                        <Upload
-                          className="demandDetailShow-upload"
-                          listType="picture-card"
-                          fileList={this.state.pictureUrl}
-                          onPreview={(file) => {
-                            this.setState({
-                              previewImage: file.url || file.thumbUrl,
-                              previewVisible: true,
-                            });
-                          }}
-                        ></Upload>
-                        <Modal
-                          maskClosable={false}
-                          footer={null}
-                          width={"50%"}
-                          visible={this.state.previewVisible}
-                          onCancel={() => {
-                            this.setState({ previewVisible: false,rotateDeg: 0 });
-                          }}
-                        >
-                          <img
-                            alt=""
-                            style={{
-                              width: "100%",
-                              transform: `rotate(${this.state.rotateDeg}deg)`,
-                            }}
-                            src={this.state.previewImage || ""}
-                          />
-                          <Button
-                            onClick={this.rotate}
-                            style={{
-                              position: "relative",
-                              left: "50%",
-                              transform: "translateX(-50%)",
-                            }}
-                          >
-                            旋转
-                          </Button>
-                          <Button
-                            onClick={this.upImg}
-                            style={{
-                              position: "absolute",
-                              left: -81,
-                              top: "50%",
-                              transform: "translateY(-50%)",
-                            }}
-                          >
-                            上一张
-                          </Button>
-                          <Button
-                            onClick={this.downImg}
-                            style={{
-                              position: "absolute",
-                              right: -81,
-                              top: "50%",
-                              transform: "translateY(-50%)",
-                            }}
-                          >
-                            下一张
-                          </Button>
-                        </Modal>
-                      </FormItem>
-                    </div>
+                    <CheckProject
+                        {...this.props}
+                        thirdInfoList={this.state.thirdInfoList}
+                        dataSource={this.state.payNodeList}
+                        outsourceRemarks={this.state.outsourceRemarks}
+                        fileList={this.state.pictureUrl}
+                        startType={this.state.startType}
+                    />
                     {this.state.refundStatus == 0 ? (
                       <div>
                         <hr className="division" />

+ 516 - 0
js/component/manageCenter/project/task/checkProject.jsx

@@ -0,0 +1,516 @@
+import React, { Component } from 'react'
+import {
+  Form,
+  Spin,
+  Table,
+  Modal,
+  Radio,
+  Col,
+  Upload,
+  Input,
+  Button,
+} from 'antd'
+import { getMaterialStatus, getUrgentStatus } from '@/tools'
+import './checkProjectStyle.less'
+
+const radioGroupStyle = {
+  display: 'flex',
+  flexFlow: 'row nowrap',
+  alignItems: 'flex-start',
+  flex: 1,
+}
+
+const layout = {
+  labelCol: {
+    span: 8,
+  },
+  wrapperCol: {
+    span: 16,
+  },
+};
+
+const tailLayout = {
+  wrapperCol: {
+    offset: 8,
+    span: 16,
+  },
+};
+
+const radioStyle = {
+  display: 'flex',
+  flexFlow: 'row nowrap',
+}
+
+const FormItem = Form.Item
+
+class CheckProject extends Component {
+  constructor(props) {
+    super(props)
+    this.state = {
+      value: '',
+      loading: false,
+      previewImage: '',
+      previewVisible: false,
+      previewPayVisible: false,
+      // 专利
+      ContactsListsNew: [
+        {
+          title: '供应商名称',
+          dataIndex: 'companyName',
+          key: 'companyName',
+          render: (text, record, index) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '单价(万元)',
+          dataIndex: 'unitPrice',
+          key: 'unitPrice',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '数量',
+          dataIndex: 'quantity',
+          key: 'quantity',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '总价(万元)',
+          dataIndex: 'totalAmount',
+          key: 'totalAmount',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '材料',
+          dataIndex: 'material',
+          key: 'material',
+          render: (text, record) => {
+            return getMaterialStatus(text)
+          },
+        },
+        {
+          title: '加急',
+          dataIndex: 'urgent',
+          key: 'urgent',
+          render: (text, record) => {
+            return getUrgentStatus(text)
+          },
+        },
+        {
+          title: '操作',
+          dataIndex: 'action',
+          key: 'action',
+          render: (text, record) => {
+            return (
+              <div>
+                <Button type="primary" onClick={() => {
+                  this.setState({
+                    previewPayVisible: true
+                  })
+                }}>
+                  申请付款
+                </Button>
+              </div>
+            )
+          },
+        },
+      ],
+      //付款节点表头
+      PayNodeTableColunms: [
+        {
+          title: '供应商名称',
+          dataIndex: 'companyName',
+          key: 'companyName',
+          render: (text, record, index) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '付款科目',
+          dataIndex: 'dunType',
+          key: 'dunType',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '付款时间',
+          dataIndex: 'partyTimes',
+          key: 'partyTimes',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '数量',
+          dataIndex: 'quantity',
+          key: 'quantity',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '总价(万元)',
+          dataIndex: 'totalAmount',
+          key: 'totalAmount',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+        {
+          title: '付款(万元)',
+          dataIndex: 'partyAmount',
+          key: 'partyAmount',
+          render: (text, record) => {
+            if (text) {
+              return <span>{text}</span>
+            }
+          },
+        },
+      ],
+    }
+  }
+
+  onChange() {
+    this.setState({
+      value: e.target.value,
+    })
+  }
+
+  tableRowClickOne(record) {}
+
+  //点击付款节点详情
+  payNodeTableRowClickOne(record) {}
+
+  //第三方信息 新增支付
+  addOrderPayment(id) {
+    $.ajax({
+      method: 'POST',
+      dataType: 'json',
+      crossDomain: false,
+      url: globalConfig.context + '/api/admin/company/addOrderPayment',
+      data: {},
+    }).done(
+      function (data) {
+        this.setState({
+          loading: false,
+        })
+        if (!data.error.length) {
+          message.success('保存成功!')
+          this.noCancel()
+        } else {
+          message.warning(data.error[0].message)
+        }
+      }.bind(this)
+    )
+  }
+
+  handleSubmit(e){
+    e.preventDefault();
+    console.log('Success:',this.props.form);
+  }
+
+  render() {
+    return (
+      <div className="App">
+        <div className="projectType">
+          <div className="typeTitle">
+            <div className="required">*</div>
+            <div>类型:</div>
+          </div>
+          <Radio.Group style={radioGroupStyle} value={this.props.startType}>
+            <Radio value={0} style={radioStyle}>
+              <div>
+                <div>供应商信息(外包派单,不走总部)</div>
+                <div className="tipsText">提示高于总部价格,费用个人承担</div>
+              </div>
+            </Radio>
+            <Radio value={1} style={radioStyle}>
+              供应商信息(普通单)
+            </Radio>
+          </Radio.Group>
+        </div>
+        <div className="thirdParty">
+          <div>
+            <span
+              style={{
+                fontSize: '18px',
+              }}
+            >
+              第三方信息
+            </span>
+          </div>
+          <div
+            className="clearfix"
+            style={
+              {
+                // display: this.state.type == 1 ? 'block' : 'block',
+              }
+            }
+          >
+            <Spin spinning={this.state.loading}>
+              <Form layout="horizontal">
+                <Table
+                  pagination={false}
+                  columns={this.state.ContactsListsNew}
+                  dataSource={this.props.thirdInfoList}
+                  onRowClick={this.tableRowClickOne}
+                  scroll={{ x: 'max-content', y: 0 }}
+                  bordered
+                  size="small"
+                />
+                <Col span={24} offset={9} style={{ marginTop: '15px' }}></Col>
+              </Form>
+            </Spin>
+          </div>
+        </div>
+        <div className="thirdParty">
+          <div>
+            <span
+              style={{
+                fontSize: '18px',
+              }}
+            >
+              付款节点
+            </span>
+          </div>
+          <div
+            className="clearfix"
+            style={
+              {
+                // display: this.state.type == 1 ? 'block' : 'block',
+              }
+            }
+          >
+            <Spin spinning={this.state.loading}>
+              <Form layout="horizontal">
+                <Table
+                  pagination={false}
+                  columns={this.state.PayNodeTableColunms}
+                  dataSource={this.props.dataSource}
+                  onRowClick={this.payNodeTableRowClickOne}
+                  scroll={{ x: 'max-content', y: 0 }}
+                  bordered
+                  size="small"
+                />
+                <Col span={24} offset={9} style={{ marginTop: '15px' }}></Col>
+              </Form>
+            </Spin>
+          </div>
+        </div>
+        <div
+          style={{
+            borderTop: '1px #000000 dashed',
+            paddingTop: '20px',
+          }}
+        >
+          <Form.Item
+            labelCol={{ span: 2 }}
+            wrapperCol={{ span: 8 }}
+            labelAlign="left"
+            label="备注"
+          >
+            <Input
+              type="textarea"
+              placeholder="请输入备注"
+              rows={4}
+              value={this.props.outsourceRemarks}
+            />
+          </Form.Item>
+        </div>
+        <div className="clearfix">
+          <FormItem
+            labelCol={{ span: 3 }}
+            wrapperCol={{ span: 18 }}
+            label="合同/协议扫描件"
+            labelAlign='left'
+          >
+            <Upload
+              className="demandDetailShow-upload"
+              listType="picture-card"
+              fileList={this.props.fileList}
+              onPreview={(file) => {
+                this.setState({
+                  previewImage: file.url || file.thumbUrl,
+                  previewVisible: true,
+                })
+              }}
+            />
+            <Modal
+              maskClosable={false}
+              footer={null}
+              visible={this.state.previewVisible}
+              onCancel={() => {
+                this.setState({ previewVisible: false })
+              }}
+            >
+              <img
+                alt=""
+                style={{ width: '100%' }}
+                src={this.state.previewImage || ''}
+              />
+            </Modal>
+          </FormItem>
+        </div>
+        {/* 申请付款 */}
+        <Modal
+          maskClosable={false}
+          footer={null}
+          visible={this.state.previewPayVisible}
+          onCancel={() => {
+            this.setState({ previewPayVisible: false })
+          }}
+        >
+          <div>
+            <div>支付供应商费用</div>
+            <Form
+                {...layout}
+                name="basic"
+                initialValues={{
+                  remember: true,
+                }}
+                onSubmit={this.handleSubmit}
+            >
+              <Form.Item
+                  style={{
+                    display:'flex'
+                  }}
+                  label="付款单位/个人:"
+                  name="company"
+                  rules={[
+                    {
+                      required: true,
+                      message: '请输入付款单位/个人!',
+                    },
+                  ]}
+              >
+                <Input style={{ width: '200px' }} placeholder="请输入付款单位/个人"/>
+              </Form.Item>
+              <Form.Item
+                  style={{
+                    display:'flex'
+                  }}
+                  label="单价(万元):"
+                  name="unitPrice"
+                  rules={[
+                    {
+                      required: true,
+                      message: '请输入单价!',
+                    },
+                  ]}
+              >
+                <Input style={{ width: '200px' }} placeholder="请输入单价" type={'number'}/>
+              </Form.Item>
+              <Form.Item
+                  style={{
+                    display:'flex'
+                  }}
+                  label="数量:"
+                  name="num"
+                  rules={[
+                    {
+                      required: true,
+                      message: '请输入數量!',
+                    },
+                  ]}
+              >
+                <Input style={{ width: '200px' }} placeholder="请输入數量" type={'number'}/>
+              </Form.Item>
+              <Form.Item
+                  style={{
+                    display:'flex'
+                  }}
+                  label="总价(万元):"
+                  name="totalPrice"
+                  rules={[
+                    {
+                      required: true,
+                      message: '请输入总价!',
+                    },
+                  ]}
+              >
+                <Input style={{ width: '200px' }} placeholder="请输入总价" type={'number'}/>
+              </Form.Item>
+              <Form.Item
+                  style={{
+                    display:'flex'
+                  }}
+                  label="已付(万元):"
+                  name="paid"
+                  rules={[
+                    {
+                      required: true,
+                      message: '请输入已付金额!',
+                    },
+                  ]}
+              >
+                <Input style={{ width: '200px' }} placeholder="请输入已付金额" type={'number'}/>
+              </Form.Item>
+              <Form.Item
+                  style={{
+                    display:'flex'
+                  }}
+                  label="本次申请支付金额(万元):"
+                  name="payment"
+                  rules={[
+                    {
+                      required: true,
+                      message: '请输入本次申请支付金额!',
+                    },
+                  ]}
+              >
+                <Input style={{ width: '200px' }} placeholder="请输入本次申请支付金额(" type={'number'}/>
+              </Form.Item>
+              <Form.Item
+                  style={{
+                    display:'flex'
+                  }}
+                  label="备注:"
+                  name="remarks"
+                  rules={[
+                    {
+                      required: true,
+                      message: '请输入本次申请支付金额!',
+                    },
+                  ]}
+              >
+                <Input style={{ width: '200px' }} placeholder="请输入本次申请支付金额(" type={'textarea'}/>
+              </Form.Item>
+              <Form.Item>
+                <Button type="primary" htmlType="submit">
+                  确定申请支付
+                </Button>
+              </Form.Item>
+            </Form>
+          </div>
+        </Modal>
+      </div>
+    )
+  }
+}
+
+export default CheckProject

+ 24 - 0
js/component/manageCenter/project/task/checkProjectStyle.css

@@ -0,0 +1,24 @@
+.App {
+  padding-top: 10px;
+}
+.App .thirdParty {
+  padding: 20px;
+}
+.App .projectType {
+  display: flex;
+  flex-flow: row nowrap;
+  border-bottom: 1px #000000 dashed;
+  padding-left: 20px;
+}
+.App .projectType .typeTitle {
+  display: flex;
+  flex-flow: row nowrap;
+  align-items: center;
+  padding-right: 15px;
+}
+.App .projectType .typeTitle .required {
+  color: #F00;
+}
+.App .projectType .tipsText {
+  color: #F00;
+}

+ 29 - 0
js/component/manageCenter/project/task/checkProjectStyle.less

@@ -0,0 +1,29 @@
+.App {
+  padding-top: 10px;
+
+  .thirdParty {
+    padding: 20px 20px 0px 20px;
+  }
+
+  .projectType {
+    display: flex;
+    flex-flow: row nowrap;
+    border-bottom: 1px #000000 dashed;
+    padding-left: 20px;
+
+    .typeTitle {
+      display: flex;
+      flex-flow: row nowrap;
+      align-items: center;
+      padding-right: 15px;
+
+      .required {
+        color: #F00;
+      }
+    }
+
+    .tipsText {
+      color: #F00;
+    }
+  }
+}

+ 205 - 194
js/component/manageCenter/project/task/myTask.jsx

@@ -47,6 +47,9 @@ import {
 } from '@/tools'
 import { taskStatus, projectStatus, cuiJieDian } from '@/dataDic.js'
 import ShowModalDiv from '@/showModal.jsx'
+
+import CheckProject from './CheckProject'
+
 const confirm = Modal.confirm
 const FormItem = Form.Item
 const { TabPane } = Tabs
@@ -209,13 +212,15 @@ const Task = React.createClass({
   },
   getInitialState() {
     return {
-      projectType:'',//项目分类
-      paySubject:[],
-      PayNodeCompany:[],
+      projectType: '', //项目分类
+      paySubject: [],
+      paySubjectName: '', //付款科目名称
+      PayNodeCompany: [],
       thirdMaterial: 0, //第三方信息材料 0-无 1-有
       thirdUrgent: 0, //第三方信息加急状态
       thirdCompanyName: '',
       thirdUnitPrice: '',
+      currentCompanyName: '', //当前选中供应商名称
       thirdQuantity: 1,
       payNodeQuantity: 1,
       thirdRemarks: '',
@@ -232,6 +237,7 @@ const Task = React.createClass({
       searchMore: true,
       assignVisible: false,
       releaseDate: [],
+      startType: 0, //外包供应商类型
       // 判断是否是退回给咨询师经理
       flag: false,
       roleName: '',
@@ -737,8 +743,8 @@ const Task = React.createClass({
         },
         {
           title: '付款科目',
-          dataIndex: 'projectType',
-          key: 'projectType',
+          dataIndex: 'dunType',
+          key: 'dunType',
           render: (text, record) => {
             if (text) {
               return <span>{text}</span>
@@ -818,7 +824,7 @@ const Task = React.createClass({
             )
           },
         },
-      ]
+      ],
     }
   },
   /* 分派 */
@@ -851,11 +857,11 @@ const Task = React.createClass({
   },
   // 获取csort下的数据
   getCsortData(cSort) {
-    cuiJieDian.map(item=>{
-      if(item.value==cSort) {
-        console.log(item.children);
+    cuiJieDian.map((item) => {
+      if (item.value == cSort) {
+        console.log(item.children)
         this.setState({
-          paySubject : item.children
+          paySubject: item.children,
         })
       }
     })
@@ -901,7 +907,7 @@ const Task = React.createClass({
     //获取支付节点信息表格
     this.payNodeTable(record.id)
     // 获取Csort
-    this.getCsortData(localStorage.getItem('cSort'));
+    this.getCsortData(localStorage.getItem('cSort'))
   },
   //点击修改项目详情
   tijiaoOk() {
@@ -1149,7 +1155,7 @@ const Task = React.createClass({
         } else {
           for (let i = 0; i < data.data.length; i++) {
             let thisdata = data.data[i]
-            localStorage.setItem('cSort',thisdata.cSort);
+            localStorage.setItem('cSort', thisdata.cSort)
             theArr.push({
               key: i,
               id: thisdata.id,
@@ -1508,7 +1514,7 @@ const Task = React.createClass({
     this.state.reviewDate = '' //评审日期
     this.state.publicityDate = '' //公示日期
     this.state.licenceDate = '' //发证日期
-    this.state.partyTimes = ''//付款时间
+    this.state.partyTimes = '' //付款时间
     attachmentUrl: [] //附件
     this.state.contacts = '' //联系人
     this.state.contactMobile = '' //联系人电话
@@ -1648,7 +1654,7 @@ const Task = React.createClass({
   },
   // 项目发起外包
   sureOut() {
-    if (!this.state.startType) {
+    if (this.state.startType !== 0 && this.state.startType !== 1) {
       message.warning('请选择类型')
       return
     }
@@ -1680,6 +1686,24 @@ const Task = React.createClass({
     this.setState({
       loading: true,
     })
+    setTimeout(() => {
+      this.setState({
+        loading: true,
+      })
+      /* this.setState(
+        {
+          ContactsListsNew: this.state.ContactsListsNew.map((item) => {
+            if (item.title != '操作') {
+              this.state.ContactsListsNew.push(item)
+            } 
+          }),
+        },
+        () => {
+          console.log('this.state.contactListNew', this.state.contactListNew)
+        }
+      ) */
+    }, 3000)
+
     $.ajax({
       method: 'POST',
       dataType: 'json',
@@ -1689,7 +1713,8 @@ const Task = React.createClass({
       data: {
         tid: this.state.id,
         orderNo: this.state.orderNo,
-        type: 1,
+        type: 1,                                //分类 0订单  1项目
+        startType: this.state.startType,       //支付类型  0外包 1供应商 false 0
         companyName: this.state.companyName,
         amount: this.state.amount,
         pictureUrl: this.getUrl(this.state.pictureUrl).length
@@ -2041,7 +2066,8 @@ const Task = React.createClass({
           let allTotalAmount = 0
           for (let i = 0; i < arr.length; i++) {
             thisData = arr[i]
-            allTotalAmount += +thisData.totalAmount
+            allTotalAmount =
+              (allTotalAmount * 10000 + thisData.totalAmount * 10000) / 10000
             companyNameArr.push(thisData.companyName)
             theArr.push({
               key: i,
@@ -2064,11 +2090,11 @@ const Task = React.createClass({
             allTotalAmount = 0
           }
           console.log(theArr)
-          console.log(companyNameArr);
-          
+          console.log(companyNameArr)
+
           this.setState({
             tid: id,
-            PayNodeCompany:companyNameArr,
+            PayNodeCompany: companyNameArr,
             thirdInfoList: theArr,
             allTotalAmount: allTotalAmount,
           })
@@ -2101,8 +2127,17 @@ const Task = React.createClass({
           let payNodeArr = []
           let thisData = []
           let arr = data.data || []
+          // console.log('this.state.paySubject', this.state.paySubject)
+          //对#5283自定义的补充展示
+          this.state.paySubject.push({ key: '自定义', value: '0' })
           for (let i = 0; i < arr.length; i++) {
             thisData = arr[i]
+            //遍历paySubject,获取当前dunType对应的key
+            this.state.paySubject.map((item) => {
+              if (item.value == thisData.dunType) {
+                thisData.dunType = item.key
+              }
+            })
             payNodeArr.push({
               key: i,
               id: thisData.id, //付款节点Id
@@ -2118,7 +2153,8 @@ const Task = React.createClass({
               cid: thisData.cid, //机构id
             })
           }
-          console.log(payNodeArr)
+          console.log('payNodeArr:', payNodeArr)
+          // console.log('paySubject:', this.state.paySubject)
           this.setState({
             tid: id,
             payNodeList: payNodeArr,
@@ -2153,15 +2189,38 @@ const Task = React.createClass({
     this.setState({
       currentTotalPrice: currentTotalPrice,
     })
+    console.log(
+      'thirdUnitPrice:',
+      this.state.thirdUnitPrice,
+      'thirdQuantity:',
+      this.state.thirdQuantity,
+      'currentTotalPrice:',
+      currentTotalPrice
+    )
   },
   // 付款节点自动计算总金额
   payNodeCalculatedAmount() {
     let currentTotalPrice
-    currentTotalPrice = this.state.thirdUnitPrice * this.state.payNodeQuantity
-    currentTotalPrice = currentTotalPrice.toFixed(4)
+    console.log(this.state.thirdCompanyName, this.state.thirdInfoList)
+    //获取当前供应商名称对应的单价并更新
+    this.state.thirdInfoList.forEach((item) => {
+      if (item.companyName === this.state.thirdCompanyName) {
+        currentTotalPrice = item.unitPrice * this.state.payNodeQuantity
+        currentTotalPrice = currentTotalPrice.toFixed(4)
+      }
+    })
+
     this.setState({
       currentTotalPrice: currentTotalPrice,
     })
+    console.log(
+      'thirdUnitPrice:',
+      this.state.thirdUnitPrice,
+      'payNodeQuantity:',
+      this.state.payNodeQuantity,
+      'currentTotalPrice:',
+      currentTotalPrice
+    )
   },
   //服务值改变时请求供应商名称
   httpChange(e) {
@@ -2244,6 +2303,7 @@ const Task = React.createClass({
             thirdQuantity: '', //数量
             currentTotalPrice: '', //总价
             thirdRemarks: '',
+            thirdUrgent: 0,
           })
           // this.visitCancel();
           this.thirdTable(this.state.tid)
@@ -2265,51 +2325,52 @@ const Task = React.createClass({
     }
     this.setState({
       loading: true,
-    })
-    $.ajax({
-      url: globalConfig.context + api,
-      method: 'post',
-      dataType: 'json',
-      crossDomain: false,
-      data: {
-        id: this.state.ThirdId, //id
-        tid: this.state.tid, //订单编号
-        companyName: this.state.thirdCompanyName, //第三方名称
-        unitPrice: this.state.thirdUnitPrice, //单价
-        quantity: this.state.thirdQuantity, //数量
-        totalAmount: this.state.currentTotalPrice, //总价
-        partyAmount: this.state.partyAmount, //付款金额
-        partyTimes: this.state.partyTimes, //付款时间
-        dunType: this.state.dunType, //催款节点
-        projectType: this.state.projectType, //项目分类
-      },
-    }).done(
-      function (data) {
-        this.setState({
-          loading: false,
-        })
-        if (!data.error.length) {
-          message.success('保存成功!')
+    }),
+      $.ajax({
+        url: globalConfig.context + api,
+        method: 'post',
+        dataType: 'json',
+        crossDomain: false,
+        data: {
+          id: this.state.ThirdId, //id
+          tid: this.state.tid, //订单编号
+          companyName: this.state.thirdCompanyName, //第三方名称
+          unitPrice: this.state.thirdUnitPrice, //单价
+          quantity: this.state.payNodeQuantity, //数量
+          totalAmount: this.state.currentTotalPrice, //总价
+          partyAmount: this.state.partyAmount, //付款金额
+          partyTimes: this.state.partyTimes, //付款时间
+          dunType: this.state.dunType, //催款节点
+          projectType: this.state.cSort, //项目分类
+        },
+      }).done(
+        function (data) {
           this.setState({
-            ThirdId: '',
-            PayNodeVisible: false,
-            thirdCompanyName: '', //第三方名称
-            thirdUnitPrice: '', //单价
-            thirdQuantity: '', //数量
-            currentTotalPrice: '', //总价
-            partyAmount:'',//付款金额
-            partyTimes:'',//付款时间
-            dunType:'',//催款节点
-            projectType:''//项目分类
-
+            loading: false,
           })
-          // this.visitCancel();
-          this.payNodeTable(this.state.tid)
-        } else {
-          message.warning(data.error[0].message)
-        }
-      }.bind(this)
-    )
+          if (!data.error.length) {
+            message.success('保存成功!')
+            this.setState({
+              ThirdId: '',
+              PayNodeVisible: false,
+              thirdCompanyName: '', //第三方名称
+              paySubjectName: '', //付款科目名称
+              thirdUnitPrice: '', //单价
+              thirdQuantity: '', //数量
+              payNodeQuantity: 1, //付款节点数量
+              currentTotalPrice: '', //总价
+              partyAmount: '', //付款金额
+              partyTimes: '', //付款时间
+              dunType: '', //催款节点
+              projectType: '', //项目分类
+            })
+            // this.visitCancel();
+            this.payNodeTable(this.state.tid)
+          } else {
+            message.warning(data.error[0].message)
+          }
+        }.bind(this)
+      )
   },
 
   // 取消
@@ -2318,11 +2379,15 @@ const Task = React.createClass({
       PayNodeVisible: false,
       ThirdListVisible: false,
       thirdCompanyName: '', //第三方名称
+      paySubjectName: '', //付款科目名称
       thirdUnitPrice: '', //单价
+      partyTimes: '',
       thirdQuantity: 1, //数量
+      payNodeQuantity: 1,
       currentTotalPrice: '', //总价
       thirdRemarks: '',
       ThirdId: '',
+      thirdUrgent: 0, //加急状态
     })
   },
   // 删除供应商信息
@@ -2380,7 +2445,7 @@ const Task = React.createClass({
   //点击供应商详情
   tableRowClickOne(record) {
     this.setState({
-      ThirdListVisible:true,
+      ThirdListVisible: true,
       ThirdId: record.id, //供应商id
       thirdCompanyName: record.companyName, //第三方名称
       thirdUnitPrice: record.unitPrice, //单价
@@ -2398,8 +2463,11 @@ const Task = React.createClass({
       ThirdId: record.id, //供应商id
       thirdCompanyName: record.companyName, //第三方名称
       thirdUnitPrice: record.unitPrice, //单价
-      thirdQuantity: record.quantity, //数量
+      thirdQuantity: record.quantity, //供应商数量
+      payNodeQuantity: record.quantity, //付款节点数量
       currentTotalPrice: record.totalAmount, //总价
+      partyTimes: record.partyTimes,
+      paySubjectName: record.dunType,
     })
   },
   render() {
@@ -3796,106 +3864,14 @@ const Task = React.createClass({
                   </div>
                 </div>
               ) : (
-                <div>
-                  <div className="clearfix">
-                    <FormItem
-                      className="half-item"
-                      {...formItemLayout}
-                      label="外包公司"
-                    >
-                      <span>{this.state.companyName}</span>
-                    </FormItem>
-                  </div>
-                  <div className="clearfix">
-                    <FormItem
-                      className="half-item"
-                      {...formItemLayout}
-                      label="单价(万元)"
-                    >
-                      <span>{this.state.unitPrice}</span>
-                    </FormItem>
-                  </div>
-                  <div className="clearfix">
-                    <FormItem
-                      className="half-item"
-                      {...formItemLayout}
-                      label="数量(个)"
-                    >
-                      <span>{this.state.unitNumber}</span>
-                    </FormItem>
-                  </div>
-                  <div className="clearfix">
-                    <FormItem
-                      className="half-item"
-                      {...formItemLayout}
-                      label="总金额(万元)"
-                    >
-                      <span>{this.state.amount}</span>
-                    </FormItem>
-                  </div>
-                  <div className="clearfix">
-                    <FormItem
-                      className="half-item"
-                      {...formItemLayout}
-                      label="备注"
-                    >
-                      <span>{this.state.outsourceRemarks}</span>
-                    </FormItem>
-                  </div>
-                  {/*<div className="clearfix">
-										<FormItem className="half-item" style={{height:'auto'}}
-										    {...formItemLayout}
-										    label="上传协议文件" >  
-											<Upload header={{authorization: 'authorization-text'}} action={globalConfig.context + "/api/admin/outsourceOrg/uploadOutsourceFile"}
-													data={(e)=>{
-														return {
-															'sign': e.name.substring(0,e.name.lastIndexOf("."))
-														}
-													}}
-													fileList={this.state.fileUrl}
-													showUploadList={{showRemoveIcon:false}}
-													onPreview={(e)=>{
-														let url = window.location.href.substring(7)
-														window.location.href="http://"+url.substring(0,url.indexOf("/"))+"/api/admin/outsourceOrg//downloadFile?path="+e.response.data
-													}}
-													>
-											</Upload>
-										</FormItem>
-									</div>*/}
-                  <div className="clearfix">
-                    <FormItem
-                      labelCol={{ span: 4 }}
-                      wrapperCol={{ span: 18 }}
-                      label="合同/协议扫描件"
-                    >
-                      <Upload
-                        className="demandDetailShow-upload"
-                        listType="picture-card"
-                        fileList={this.state.pictureUrl}
-                        onPreview={(file) => {
-                          this.setState({
-                            previewImage: file.url || file.thumbUrl,
-                            previewVisible: true,
-                          })
-                        }}
-                      ></Upload>
-                      <Modal
-                        maskClosable={false}
-                        footer={null}
-                        visible={this.state.previewVisible}
-                        onCancel={() => {
-                          this.setState({ previewVisible: false })
-                        }}
-                      >
-                        <img
-                          alt=""
-                          style={{ width: '100%' }}
-                          src={this.state.previewImage || ''}
-                        />
-                      </Modal>
-                    </FormItem>
-                  </div>
-                </div>
+                <CheckProject
+                  {...this.props}
+                  thirdInfoList={this.state.thirdInfoList}
+                  dataSource={this.state.payNodeList}
+                  outsourceRemarks={this.state.outsourceRemarks}
+                  fileList={this.state.pictureUrl}
+                  startType={this.state.startType}
+                />
               )}
               {this.state.refundStatus == 1 ||
               this.state.refundStatus == 0 ||
@@ -5077,6 +5053,7 @@ const Task = React.createClass({
                         this.setState({
                           thirdQuantity: e.target.value,
                         })
+                        console.log('thirdQuantity', this.state.thirdQuantity)
                       }}
                       style={{ width: '220px' }}
                     />
@@ -5196,41 +5173,69 @@ const Task = React.createClass({
               <div className="clearfix">
                 <div className="clearfix">
                   <FormItem {...formItemLayout} label="供应商名称">
-                    <Select onChange={(val) => {
-                        this.setState({
-                          thirdCompanyName: val,
-                        })
-                      }} defaultValue="请选择供应商" style={{ width: 220 }}>
+                    <Select
+                      value={this.state.thirdCompanyName}
+                      onChange={(val) => {
+                        this.setState(
+                          {
+                            thirdCompanyName: val,
+                          },
+                          () => this.payNodeCalculatedAmount()
+                        ) //更新完state调用
+                      }}
+                      defaultValue="请选择供应商"
+                      style={{ width: 220 }}
+                    >
                       {this.state.PayNodeCompany.map((item, index) => (
-                        <Select.Option value={item} key={index}>{item}</Select.Option>
+                        <Select.Option value={item} key={index}>
+                          {item}
+                        </Select.Option>
                       ))}
                     </Select>
                     <span className="mandatory">*</span>
                   </FormItem>
                 </div>
+
                 <div className="clearfix">
                   <FormItem {...formItemLayout} label="付款科目">
-                  <Select  defaultValue="请选择付款科目" style={{ width: 220 }}>
-                    {
-                 this.state.paySubject.map((item, index) => <Select.Option value={item.value} key={index}>{item.key}</Select.Option>)
-                 }
-                 <Select.Option key={0} value={0}>
+                    <Select
+                      value={this.state.paySubjectName}
+                      onChange={(val) => {
+                        this.setState({
+                          paySubjectName: val,
+                          dunType: val,
+                        })
+                      }}
+                      defaultValue="请选择付款科目"
+                      style={{ width: 220 }}
+                    >
+                      {this.state.paySubject.map((item, index) => (
+                        <Select.Option value={item.value} key={index}>
+                          {item.key}
+                        </Select.Option>
+                      ))}
+                      <Select.Option key={0} value={0}>
                         自定义
                       </Select.Option>
-
-                  </Select>
+                    </Select>
                     <span className="mandatory">*</span>
                   </FormItem>
                 </div>
                 <div className="clearfix">
-                  <FormItem {...formItemLayout} label="付款时间">
-                    <DatePicker value={ this.state.partyTimes? moment(this.state.partyTimes):null }
-                    onChange={(data,dataString)=>{
-                      this.setState({ partyTimes:dataString })
-                    }}
-                    style={{ width: '220px' }} />
+                  {parseInt(this.state.paySubjectName) === 0 ? <FormItem {...formItemLayout} label="付款时间">
+                    <DatePicker
+                      value={
+                        this.state.partyTimes
+                          ? moment(this.state.partyTimes)
+                          : null
+                      }
+                      onChange={(data, dataString) => {
+                        this.setState({ partyTimes: dataString })
+                      }}
+                      style={{ width: '220px' }}
+                    />
                     <span className="mandatory">*</span>
-                  </FormItem>
+                  </FormItem> : <div/>}
                 </div>
                 <div className="clearfix">
                   <FormItem {...formItemLayout} label="数量">
@@ -5238,11 +5243,17 @@ const Task = React.createClass({
                       value={this.state.payNodeQuantity}
                       placeholder="请输入数量(必填项)"
                       required="required"
-                      onBlur={this.calculatedAmount}
                       onChange={(e) => {
-                        this.setState({
-                          payNodeQuantity: e.target.value,
-                        })
+                        this.setState(
+                          {
+                            payNodeQuantity: e.target.value,
+                          },
+                          () => this.payNodeCalculatedAmount()
+                        ) //更新完state调用
+                        console.log(
+                          'payNodeQuantity',
+                          this.state.payNodeQuantity
+                        )
                       }}
                       style={{ width: '220px' }}
                     />
@@ -5256,12 +5267,12 @@ const Task = React.createClass({
                       value={this.state.currentTotalPrice}
                       placeholder=""
                       required="required"
-                      onBlur={this.payNodeCalculatedAmount}
-                      onChange={(e) => {
+                      // onBlur={this.payNodeCalculatedAmount}
+                      onChange={(e) =>
                         this.setState({
                           toltalAmount: e.target.value,
                         })
-                      }}
+                      }
                       style={{ width: '220px' }}
                     />
                     <span className="mandatory">*</span>

File diff suppressed because it is too large
+ 302 - 293
js/component/project.jsx


+ 367 - 354
webpack.config.js

@@ -1,362 +1,375 @@
-const webpack = require('webpack');
-const path = require('path');
-const ExtractTextPlugin = require("extract-text-webpack-plugin");
-const HtmlWebpackPlugin = require('html-webpack-plugin');
-const CopyWebpackPlugin = require('copy-webpack-plugin');
-const HtmlWebpackIncludeAssetsPlugin = require('html-webpack-include-assets-plugin');
-const WebpackDevServer = require('webpack-dev-server');
-const entries = require('./webpack/entry.config.js');
-const version = require('./package.json').version;
-const argv = require('yargs').argv;
-const dirVars = require('./webpack/dir.config.js');
+const webpack = require('webpack')
+const path = require('path')
+const ExtractTextPlugin = require('extract-text-webpack-plugin')
+const HtmlWebpackPlugin = require('html-webpack-plugin')
+const CopyWebpackPlugin = require('copy-webpack-plugin')
+const HtmlWebpackIncludeAssetsPlugin = require('html-webpack-include-assets-plugin')
+const WebpackDevServer = require('webpack-dev-server')
+const entries = require('./webpack/entry.config.js')
+const version = require('./package.json').version
+const argv = require('yargs').argv
+const dirVars = require('./webpack/dir.config.js')
 
 let theme = {
-    '@primary-color': '#58a3ff',
-    '@link-color': '#58a3ff'
-};
-let isWatch = argv.env.watch == 'watch';
-let isDev = isWatch || argv.env.deploy == 'dev';
+  '@primary-color': '#58a3ff',
+  '@link-color': '#58a3ff',
+}
+let isWatch = argv.env.watch == 'watch'
+let isDev = isWatch || argv.env.deploy == 'dev'
 
-process.traceDeprecation = true;
-process.noDeprecation = true;
+process.traceDeprecation = true
+process.noDeprecation = true
 
 module.exports = (function () {
-    let jumlApi = '';
-    switch (argv.env.deploy) {
-        case 'dev': jumlApi = "http://sb.jishutao.com"; break;
-        case 'test': jumlApi = "http://uat.jishutao.com"; break;
-        case 'prod': jumlApi = "http://bm.jishutao.com"; break;
-        default:
-            break;
-    }
-    let plugins = [
-      //把入口文件里面的数组打包成verdors.js
-      new webpack.optimize.CommonsChunkPlugin({
-        name: "vendors",
-      }),
-      /* 配置好Dll */
-      new webpack.DllReferencePlugin({
-        context: dirVars.staticRootDir, // 指定一个路径作为上下文环境,需要与DllPlugin的context参数保持一致,建议统一设置为项目根目录
-        manifest: require("./dll/" + argv.env.deploy + "/manifest.json"), // 指定manifest.json
-      }),
-      // 把dll文件复制到打包后的文件中
-      new CopyWebpackPlugin([
-        {
-          from: path.resolve("./dll/" + argv.env.deploy),
-          to: (__dirname, "./dll/"),
-          ignore: [".*"],
-        },
-      ]),
-      // 将 dll.js 插入HTML里
-      new HtmlWebpackIncludeAssetsPlugin({
-        assets: [(__dirname, "dll/dll.js"), (__dirname, "dll/dll.css")],
-        append: false,
-      }),
-      new ExtractTextPlugin({
-        filename: "[name].css",
-        disable: false,
-        allChunks: true,
-      }),
-      //定义全局变量区分本地测试生产做跳转
+  let jumlApi = ''
+  switch (argv.env.deploy) {
+    case 'dev':
+      jumlApi = 'http://sb.jishutao.com'
+      break
+    case 'test':
+      jumlApi = 'http://uat.jishutao.com'
+      break
+    case 'prod':
+      jumlApi = 'http://bm.jishutao.com'
+      break
+    default:
+      break
+  }
+  let plugins = [
+    //把入口文件里面的数组打包成verdors.js
+    new webpack.optimize.CommonsChunkPlugin({
+      name: 'vendors',
+    }),
+    /* 配置好Dll */
+    new webpack.DllReferencePlugin({
+      context: dirVars.staticRootDir, // 指定一个路径作为上下文环境,需要与DllPlugin的context参数保持一致,建议统一设置为项目根目录
+      manifest: require('./dll/' + argv.env.deploy + '/manifest.json'), // 指定manifest.json
+    }),
+    // 把dll文件复制到打包后的文件中
+    new CopyWebpackPlugin([
+      {
+        from: path.resolve('./dll/' + argv.env.deploy),
+        to: (__dirname, './dll/'),
+        ignore: ['.*'],
+      },
+    ]),
+    // 将 dll.js 插入HTML里
+    new HtmlWebpackIncludeAssetsPlugin({
+      assets: [(__dirname, 'dll/dll.js'), (__dirname, 'dll/dll.css')],
+      append: false,
+    }),
+    new ExtractTextPlugin({
+      filename: '[name].css',
+      disable: false,
+      allChunks: true,
+    }),
+    //定义全局变量区分本地测试生产做跳转
+    new webpack.DefinePlugin({
+      jumpUrl: `'${jumlApi}'`,
+    }),
+    //user
+    new HtmlWebpackPlugin({
+      title: '用户首页',
+      filename: 'user/index.html',
+      template: './template/template.html',
+      chunks: ['user/index', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '用户登录',
+      filename: 'user/login.html',
+      template: './template/template.html',
+      chunks: ['user/login', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '用户注册',
+      filename: 'user/signIn.html',
+      template: './template/template.html',
+      chunks: ['user/signIn', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '个人用户认证',
+      filename: 'user/certify.html',
+      template: './template/template.html',
+      chunks: ['user/certify', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '团体用户认证',
+      filename: 'user/groupCertify.html',
+      template: './template/template.html',
+      chunks: ['user/groupCertify', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '用户详情',
+      filename: 'user/subscriberDetail.html',
+      template: './template/template.html',
+      chunks: ['user/subscriberDetail', 'vendors'],
+    }),
+    //user-account
+    new HtmlWebpackPlugin({
+      title: '用户中心-首页',
+      filename: 'user/account/index.html',
+      template: './template/template.html',
+      chunks: ['user/account/index', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '用户中心-设置',
+      filename: 'user/account/set.html',
+      template: './template/template.html',
+      chunks: ['user/account/set', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '用户中心-科技服务',
+      filename: 'user/account/services.html',
+      template: './template/template.html',
+      chunks: ['user/account/services', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '用户中心-科技服务',
+      filename: 'user/account/achievement.html',
+      template: './template/template.html',
+      chunks: ['user/account/achievement', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '用户中心-科技服务',
+      filename: 'user/account/demand.html',
+      template: './template/template.html',
+      chunks: ['user/account/demand', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '管理员-科技服务管理-科技评估信息',
+      filename: 'user/account/evaluateInfo.html',
+      template: './template/template.html',
+      chunks: ['user/account/evaluateInfo', 'vendors'],
+    }),
+    //admin
+    new HtmlWebpackPlugin({
+      title: '管理员-首页',
+      filename: 'admin/index.html',
+      template: './template/template.html',
+      chunks: ['admin/index', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '管理员-登录',
+      filename: 'admin/login.html',
+      template: './template/template.html',
+      chunks: ['admin/login', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '管理员-用户管理',
+      filename: 'admin/userManage.html',
+      template: './template/template.html',
+      chunks: ['admin/userManage', 'vendors'],
+    }),
+    //admin-servicesManage
+    new HtmlWebpackPlugin({
+      title: '管理员-科技服务管理-专利',
+      filename: 'admin/servicesManage/contract.html',
+      template: './template/template.html',
+      chunks: ['admin/servicesManage/contract', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '管理员-科技服务管理-专利',
+      filename: 'admin/servicesManage/patent.html',
+      template: './template/template.html',
+      chunks: ['admin/servicesManage/patent', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '管理员-科技服务管理-软著',
+      filename: 'admin/servicesManage/copyright.html',
+      template: './template/template.html',
+      chunks: ['admin/servicesManage/copyright', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '管理员-科技服务管理-高企',
+      filename: 'admin/servicesManage/highTech.html',
+      template: './template/template.html',
+      chunks: ['admin/servicesManage/highTech', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '管理员-科技服务管理-高企信息',
+      filename: 'admin/servicesManage/highTechInfo.html',
+      template: './template/template.html',
+      chunks: ['admin/servicesManage/highTechInfo', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '管理员-科技服务管理-科技',
+      filename: 'admin/servicesManage/technology.html',
+      template: './template/template.html',
+      chunks: ['admin/servicesManage/technology', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '管理员-科技服务管理-项目单',
+      filename: 'admin/servicesManage/projectOrder.html',
+      template: './template/template.html',
+      chunks: ['admin/servicesManage/projectOrder', 'vendors'],
+    }),
+    //admin-demand
+    new HtmlWebpackPlugin({
+      title: '管理员-用户管理',
+      filename: 'admin/demand.html',
+      template: './template/template.html',
+      chunks: ['admin/demand', 'vendors'],
+    }),
+    //admin-achievement
+    new HtmlWebpackPlugin({
+      title: '管理员-用户管理',
+      filename: 'admin/achievement.html',
+      template: './template/template.html',
+      chunks: ['admin/achievement', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '管理员-用户管理',
+      filename: 'admin/customer.html',
+      template: './template/template.html',
+      chunks: ['admin/customer', 'vendors'],
+    }),
+    //admin-set
+    new HtmlWebpackPlugin({
+      title: '管理员-用户管理',
+      filename: 'admin/set.html',
+      template: './template/template.html',
+      chunks: ['admin/set', 'vendors'],
+    }),
+    //admin-idea
+    new HtmlWebpackPlugin({
+      title: '管理员-财务管理',
+      filename: 'admin/idea.html',
+      template: './template/template.html',
+      chunks: ['admin/idea', 'vendors'],
+    }),
+    //admin-userOrder
+    new HtmlWebpackPlugin({
+      title: '管理员-用户订单管理',
+      filename: 'admin/userOrder.html',
+      template: './template/template.html',
+      chunks: ['admin/userOrder', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '管理员-订单管理',
+      filename: 'admin/order.html',
+      template: './template/template.html',
+      chunks: ['admin/order', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '管理员-平台管理',
+      filename: 'admin/operate.html',
+      template: './template/template.html',
+      chunks: ['admin/operate', 'vendors'],
+    }), //statistics
+    new HtmlWebpackPlugin({
+      title: '管理员-数据统计',
+      filename: 'admin/statistics.html',
+      template: './template/template.html',
+      chunks: ['admin/statistics', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '管理员-项目管理',
+      filename: 'admin/project.html',
+      template: './template/template.html',
+      chunks: ['admin/project', 'vendors'],
+    }),
+    new HtmlWebpackPlugin({
+      title: '管理员-人事管理',
+      filename: 'admin/personnel.html',
+      template: './template/template.html',
+      chunks: ['admin/personnel', 'vendors'],
+    }),
+    //portal 门户
+    // new HtmlWebpackPlugin({
+    //     title: '主页-需求搜索',
+    //     filename: 'portal/search/demand.html',
+    //     template: './template/template.html',
+    //     chunks: ['portal/search/demand', 'vendors']
+    // }),
+    // new HtmlWebpackPlugin({
+    //     title: '主页-科技成果搜索',
+    //     filename: 'portal/search/achievement.html',
+    //     template: './template/template.html',
+    //     chunks: ['portal/search/achievement', 'vendors']
+    // }),
+    // new HtmlWebpackPlugin({
+    //     title: '主页-行家搜索',
+    //     filename: 'portal/search/subscriberUser.html',
+    //     template: './template/template.html',
+    //     chunks: ['portal/search/subscriberUser', 'vendors']
+    // }),
+    // new HtmlWebpackPlugin({
+    //     title: '主页-伙伴搜索',
+    //     filename: 'portal/search/subscriberOrg.html',
+    //     template: './template/template.html',
+    //     chunks: ['portal/search/subscriberOrg', 'vendors']
+    // })
+  ]
+  if (!isDev) {
+    //这个使用uglifyJs压缩你的js代码
+    plugins.unshift(
       new webpack.DefinePlugin({
-        jumpUrl: `'${jumlApi}'`,
-      }),
-      //user
-      new HtmlWebpackPlugin({
-        title: "用户首页",
-        filename: "user/index.html",
-        template: "./template/template.html",
-        chunks: ["user/index", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "用户登录",
-        filename: "user/login.html",
-        template: "./template/template.html",
-        chunks: ["user/login", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "用户注册",
-        filename: "user/signIn.html",
-        template: "./template/template.html",
-        chunks: ["user/signIn", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "个人用户认证",
-        filename: "user/certify.html",
-        template: "./template/template.html",
-        chunks: ["user/certify", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "团体用户认证",
-        filename: "user/groupCertify.html",
-        template: "./template/template.html",
-        chunks: ["user/groupCertify", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "用户详情",
-        filename: "user/subscriberDetail.html",
-        template: "./template/template.html",
-        chunks: ["user/subscriberDetail", "vendors"],
-      }),
-      //user-account
-      new HtmlWebpackPlugin({
-        title: "用户中心-首页",
-        filename: "user/account/index.html",
-        template: "./template/template.html",
-        chunks: ["user/account/index", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "用户中心-设置",
-        filename: "user/account/set.html",
-        template: "./template/template.html",
-        chunks: ["user/account/set", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "用户中心-科技服务",
-        filename: "user/account/services.html",
-        template: "./template/template.html",
-        chunks: ["user/account/services", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "用户中心-科技服务",
-        filename: "user/account/achievement.html",
-        template: "./template/template.html",
-        chunks: ["user/account/achievement", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "用户中心-科技服务",
-        filename: "user/account/demand.html",
-        template: "./template/template.html",
-        chunks: ["user/account/demand", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "管理员-科技服务管理-科技评估信息",
-        filename: "user/account/evaluateInfo.html",
-        template: "./template/template.html",
-        chunks: ["user/account/evaluateInfo", "vendors"],
-      }),
-      //admin
-      new HtmlWebpackPlugin({
-        title: "管理员-首页",
-        filename: "admin/index.html",
-        template: "./template/template.html",
-        chunks: ["admin/index", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "管理员-登录",
-        filename: "admin/login.html",
-        template: "./template/template.html",
-        chunks: ["admin/login", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "管理员-用户管理",
-        filename: "admin/userManage.html",
-        template: "./template/template.html",
-        chunks: ["admin/userManage", "vendors"],
-      }),
-      //admin-servicesManage
-      new HtmlWebpackPlugin({
-        title: "管理员-科技服务管理-专利",
-        filename: "admin/servicesManage/contract.html",
-        template: "./template/template.html",
-        chunks: ["admin/servicesManage/contract", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "管理员-科技服务管理-专利",
-        filename: "admin/servicesManage/patent.html",
-        template: "./template/template.html",
-        chunks: ["admin/servicesManage/patent", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "管理员-科技服务管理-软著",
-        filename: "admin/servicesManage/copyright.html",
-        template: "./template/template.html",
-        chunks: ["admin/servicesManage/copyright", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "管理员-科技服务管理-高企",
-        filename: "admin/servicesManage/highTech.html",
-        template: "./template/template.html",
-        chunks: ["admin/servicesManage/highTech", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "管理员-科技服务管理-高企信息",
-        filename: "admin/servicesManage/highTechInfo.html",
-        template: "./template/template.html",
-        chunks: ["admin/servicesManage/highTechInfo", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "管理员-科技服务管理-科技",
-        filename: "admin/servicesManage/technology.html",
-        template: "./template/template.html",
-        chunks: ["admin/servicesManage/technology", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "管理员-科技服务管理-项目单",
-        filename: "admin/servicesManage/projectOrder.html",
-        template: "./template/template.html",
-        chunks: ["admin/servicesManage/projectOrder", "vendors"],
-      }),
-      //admin-demand
-      new HtmlWebpackPlugin({
-        title: "管理员-用户管理",
-        filename: "admin/demand.html",
-        template: "./template/template.html",
-        chunks: ["admin/demand", "vendors"],
-      }),
-      //admin-achievement
-      new HtmlWebpackPlugin({
-        title: "管理员-用户管理",
-        filename: "admin/achievement.html",
-        template: "./template/template.html",
-        chunks: ["admin/achievement", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "管理员-用户管理",
-        filename: "admin/customer.html",
-        template: "./template/template.html",
-        chunks: ["admin/customer", "vendors"],
-      }),
-      //admin-set
-      new HtmlWebpackPlugin({
-        title: "管理员-用户管理",
-        filename: "admin/set.html",
-        template: "./template/template.html",
-        chunks: ["admin/set", "vendors"],
-      }),
-      //admin-idea
-      new HtmlWebpackPlugin({
-        title: "管理员-财务管理",
-        filename: "admin/idea.html",
-        template: "./template/template.html",
-        chunks: ["admin/idea", "vendors"],
-      }),
-      //admin-userOrder
-      new HtmlWebpackPlugin({
-        title: "管理员-用户订单管理",
-        filename: "admin/userOrder.html",
-        template: "./template/template.html",
-        chunks: ["admin/userOrder", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "管理员-订单管理",
-        filename: "admin/order.html",
-        template: "./template/template.html",
-        chunks: ["admin/order", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "管理员-平台管理",
-        filename: "admin/operate.html",
-        template: "./template/template.html",
-        chunks: ["admin/operate", "vendors"],
-      }), //statistics
-      new HtmlWebpackPlugin({
-        title: "管理员-数据统计",
-        filename: "admin/statistics.html",
-        template: "./template/template.html",
-        chunks: ["admin/statistics", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "管理员-项目管理",
-        filename: "admin/project.html",
-        template: "./template/template.html",
-        chunks: ["admin/project", "vendors"],
-      }),
-      new HtmlWebpackPlugin({
-        title: "管理员-人事管理",
-        filename: "admin/personnel.html",
-        template: "./template/template.html",
-        chunks: ["admin/personnel", "vendors"],
-      }),
-      //portal 门户
-      // new HtmlWebpackPlugin({
-      //     title: '主页-需求搜索',
-      //     filename: 'portal/search/demand.html',
-      //     template: './template/template.html',
-      //     chunks: ['portal/search/demand', 'vendors']
-      // }),
-      // new HtmlWebpackPlugin({
-      //     title: '主页-科技成果搜索',
-      //     filename: 'portal/search/achievement.html',
-      //     template: './template/template.html',
-      //     chunks: ['portal/search/achievement', 'vendors']
-      // }),
-      // new HtmlWebpackPlugin({
-      //     title: '主页-行家搜索',
-      //     filename: 'portal/search/subscriberUser.html',
-      //     template: './template/template.html',
-      //     chunks: ['portal/search/subscriberUser', 'vendors']
-      // }),
-      // new HtmlWebpackPlugin({
-      //     title: '主页-伙伴搜索',
-      //     filename: 'portal/search/subscriberOrg.html',
-      //     template: './template/template.html',
-      //     chunks: ['portal/search/subscriberOrg', 'vendors']
-      // })
-    ];
-    if (!isDev) {
-        //这个使用uglifyJs压缩你的js代码
-        plugins.unshift(new webpack.DefinePlugin({
-            "process.env": {
-                NODE_ENV: JSON.stringify("production")
-            }
-        }));
-        plugins.unshift(new webpack.optimize.UglifyJsPlugin({
-            minimize: true,
-            compress: {
-                warnings: true
-            }
-        }));
-    }
-
-    //let staticHost = 'http://afts.hnzhiming.com';
-    let staticHost = "http://172.16.0.253";
-    // let staticHost = "http://192.168.0.106";
-    // let staticHost = "http://192.168.0.103";
-    switch (argv.env.deploy) {
-        case 'test':
-            staticHost = "http://static.jishutao.com";
-            break;
-        case 'prod':
-            staticHost = "http://s.jishutao.com";
-            break;
-        default:
-            break;
-    }
-    staticHost = staticHost + '/' + version + '/';
-    theme['@icon-url'] = '"' + staticHost + 'css/iconfont/iconfont"'
-    return {
-        //devtool:"source-map",
-        entry: isWatch ? entries.watch : entries.prod,
-        output: {
-            path: path.resolve(__dirname, './build/' + argv.env.deploy + '/' + version),
-            filename: '[name].js',
-            publicPath: staticHost,
-            chunkFilename: 'chunks/[name].[hash:8].js'
+        'process.env': {
+          NODE_ENV: JSON.stringify('production'),
         },
-        module: require('./webpack/module.config.js')(theme),
-        resolve: {
-            alias: {
-                '@': __dirname + '/js/component',
-            },
-            extensions: ['.js', '.jsx']
+      })
+    )
+    plugins.unshift(
+      new webpack.optimize.UglifyJsPlugin({
+        minimize: true,
+        compress: {
+          warnings: true,
         },
-        plugins: plugins,
-        // devServer: {
-        //     disableHostCheck: true,
-        //     allowedHosts: ['bm.kedexinxi.com'],
-        //     headers: {
-        //         "Access-Control-Allow-Origin": "*"
-        //     }
-        // }
-        devServer: {
-            disableHostCheck: true,
-            host: '172.16.0.253',
-            port: 80,
-            allowedHosts: ['127.0.0.1', '192.168.0.20', '192.168.0.99'],
-            headers: {
-                "Access-Control-Allow-Origin": "*"
-            }
-        }
-    };
-})();
+      })
+    )
+  }
+
+  //let staticHost = 'http://afts.hnzhiming.com';
+  let staticHost = 'http://172.16.0.253:3000'
+  // let staticHost = "http://192.168.0.106";
+  // let staticHost = "http://192.168.0.103";
+  switch (argv.env.deploy) {
+    case 'test':
+      staticHost = 'http://static.jishutao.com'
+      break
+    case 'prod':
+      staticHost = 'http://s.jishutao.com'
+      break
+    default:
+      break
+  }
+  staticHost = staticHost + '/' + version + '/'
+  theme['@icon-url'] = '"' + staticHost + 'css/iconfont/iconfont"'
+  return {
+    //devtool:"source-map",
+    entry: isWatch ? entries.watch : entries.prod,
+    output: {
+      path: path.resolve(
+        __dirname,
+        './build/' + argv.env.deploy + '/' + version
+      ),
+      filename: '[name].js',
+      publicPath: staticHost,
+      chunkFilename: 'chunks/[name].[hash:8].js',
+    },
+    module: require('./webpack/module.config.js')(theme),
+    resolve: {
+      alias: {
+        '@': __dirname + '/js/component',
+      },
+      extensions: ['.js', '.jsx'],
+    },
+    plugins: plugins,
+    // devServer: {
+    //     disableHostCheck: true,
+    //     allowedHosts: ['bm.kedexinxi.com'],
+    //     headers: {
+    //         "Access-Control-Allow-Origin": "*"
+    //     }
+    // }
+    devServer: {
+      disableHostCheck: true,
+      host: '172.16.0.253',
+      port: 3000,
+      allowedHosts: ['127.0.0.1', '192.168.0.20', '192.168.0.99'],
+      headers: {
+        'Access-Control-Allow-Origin': '*',
+      },
+    },
+  }
+})()