Browse Source

企业项目派单查询

HW 4 years ago
parent
commit
9afbde0e12

+ 79 - 99
js/component/manageCenter/project/project/enterpriseProjectQuery.jsx

@@ -3,7 +3,9 @@ import {Button, DatePicker, Input, message, Select, Spin, Table, Tabs} from "ant
 import {ChooseList} from "../../order/orderNew/chooseList";
 import $ from "jquery/src/ajax";
 import {
-    ShowModal
+    ShowModal,
+    getProjectName,
+    download,
 } from "@/tools";
 import moment from "moment";
 import ProjectDetails from "../summary/projectDetails";
@@ -40,18 +42,18 @@ class EnterpriseProjectQuery extends Component{
                 },
                 {
                     title: "派单时间",
-                    dataIndex: "distributionTime",
-                    key: "distributionTime",
+                    dataIndex: "taskDistributionTime",
+                    key: "taskDistributionTime",
                 },
                 {
                     title: "派单省份",
-                    dataIndex: "province",
-                    key: "province",
+                    dataIndex: "provinceName",
+                    key: "provinceName",
                 },
                 {
                     title: '订单部门',
-                    dataIndex: 'departmentName',
-                    key: 'departmentName',
+                    dataIndex: 'depName',
+                    key: 'depName',
                     render:(text)=>{
                         return (text&&text.length>8?text.substr(0,8)+'...':text)
                     }
@@ -83,8 +85,8 @@ class EnterpriseProjectQuery extends Component{
                 },
                 {
                     title: "项目名称",
-                    dataIndex: "pname",
-                    key: "pname",
+                    dataIndex: "commodityName",
+                    key: "commodityName",
                 },
                 {
                     title: "数量",
@@ -106,13 +108,7 @@ class EnterpriseProjectQuery extends Component{
                     dataIndex: "projectStatus",
                     key: "projectStatus",
                     render:(value)=>(
-                        value === 0 ? '未开始':
-                            value === 1 ? '进行中':
-                                value === 2 ? '已暂停':
-                                    value === 3 ? '已驳回(专利、软著项目编写)':
-                                        value === 4 ? '已完成':
-                                            value === 5 ? '项目已完成 已退单':
-                                                value === 6 ? '项目未完成 已退单': ''
+                        getProjectName(parseInt(value))
                     )
                 },
                 {
@@ -140,11 +136,10 @@ class EnterpriseProjectQuery extends Component{
 
             contactsOption: [],
             contactsOptionData: [],
-
-            status: 0,
         }
         this.changeList = this.changeList.bind(this);
         this.resetAll = this.resetAll.bind(this);
+        this.exportPending = this.exportPending.bind(this);
     }
 
     changeList(arr) {
@@ -169,23 +164,22 @@ class EnterpriseProjectQuery extends Component{
             method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + "/api/admin/statistis/selectTaskList",
+            url: globalConfig.context + "/api/admin/orderProject/managerSelect",
             data: {
                 pageNo: pageNo || 1,
                 pageSize: this.state.pagination.pageSize || 10,
-                startDate: this.state.releaseDate.length > 0 ? this.state.releaseDate[0]: undefined, //开始时间
-                endDate: this.state.releaseDate.length > 0 ? this.state.releaseDate[1]: undefined, //结束时间
+                startTime: this.state.releaseDate.length > 0 ? this.state.releaseDate[0]: undefined, //开始时间
+                endTime: this.state.releaseDate.length > 0 ? this.state.releaseDate[1]: undefined, //结束时间
                 depId: this.state.depId || undefined,//部门ID
-                thchDepId: this.state.thchDepId || undefined,//责任部门ID
-                projectStatus: this.state.projectStatus || undefined,//项目类别
+                techDepId: this.state.thchDepId || undefined,//责任部门ID
+                cid: this.state.projectStatus || undefined,//项目类别
                 projectType: typeof this.state.projectType === 'number' ? this.state.projectType : undefined,//项目分类
                 orderNo: this.state.searchOrderNo || undefined,//订单编号
                 contractNo: this.state.searchContractNo || undefined,//合同编号
-                userName: this.state.searchEnterpriseName || undefined,//企业名称
+                name: this.state.searchEnterpriseName || undefined,//企业名称
                 declarationBatch: this.state.declarationBatch || undefined,//申报批次
-                projectSituation: typeof this.state.projectSituation === 'number' ? this.state.projectSituation : undefined,//项目分类
-                projectAmount: this.state.projectAmount || undefined,//项目金额
-                status: this.state.status,
+                // projectSituation: typeof this.state.projectSituation === 'number' ? this.state.projectSituation : undefined,//项目分类
+                commodityPrice: this.state.projectAmount || undefined,//项目金额
             },
             success: function (data) {
                 ShowModal(this);
@@ -275,7 +269,6 @@ class EnterpriseProjectQuery extends Component{
             depId:'',
             thchDepId:'',
             projectStatus:'',
-            status: 0,
         },()=>{
             this.loadData();
         })
@@ -318,43 +311,41 @@ class EnterpriseProjectQuery extends Component{
     }
 
     exportPending() {
-        let url = `/api/admin/statistis/exporTaskList?status=${this.state.status}`;
-        let dep = this.state.departmentArr.filter((e)=> e.id === this.state.depId);//订单部门名称
-        let thchDep = this.state.departmentArr.filter((e)=> e.id === this.state.thchDepId); //责任部门名称
-        let option = this.state.contactsOptionData.filter((e)=> e.id === this.state.projectStatus); //项目类别名称
-
-        if(dep.length > 0){url = url+`&depName=${dep[0].name}`;}
-        if(thchDep.length > 0){url = url+`&thchDepName=${thchDep[0].name}`;}
-        if(option.length > 0){url = url+`&projectStatusName=${option[0].cname}`;}
-        if(typeof this.state.projectType === 'number'){url = url+`&projectTypeName=${
-            this.state.projectType === 0? '通用' :
-                this.state.projectType === 1? '专利' :
-                    this.state.projectType === 2? '软著' :
-                        this.state.projectType === 3? '审计' :
-                            this.state.projectType === 4? '双软' :
-                                this.state.projectType === 5? '高新' : ''
-        }`;}
-        let data ={
-            startDate: this.state.releaseDate.length > 0 ? this.state.releaseDate[0]: undefined, //开始时间
-            endDate: this.state.releaseDate.length > 0 ? this.state.releaseDate[1]: undefined, //结束时间
-            depId: this.state.depId || undefined,//部门ID
-            thchDepId: this.state.thchDepId || undefined,//责任部门ID
-            projectStatus: this.state.projectStatus || undefined,//项目类别
-            projectType: typeof this.state.projectType === 'number' ? this.state.projectType : undefined,//项目分类
-            orderNo: this.state.searchOrderNo || undefined,//订单编号
-            contractNo: this.state.searchContractNo || undefined,//合同编号
-            userName: this.state.searchEnterpriseName || undefined,//企业名称
-            declarationBatch: this.state.declarationBatch || undefined,//申报批次
-            projectSituation: typeof this.state.projectSituation === 'number' ? this.state.projectSituation : undefined,//项目情况
-            projectAmount: this.state.projectAmount || undefined,//项目金额
-        }
-
-        for(let key in data){
-            if(data[key]){
-                url = url+`&${key}=${data[key]}`;
-            }
-        }
-        window.open(globalConfig.context +url);
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/admin/orderProject/exportManagerSelect",
+            data: {
+                pageNo: 1,
+                pageSize: 99999,
+                startTime: this.state.releaseDate.length > 0 ? this.state.releaseDate[0]: undefined, //开始时间
+                endTime: this.state.releaseDate.length > 0 ? this.state.releaseDate[1]: undefined, //结束时间
+                depId: this.state.depId || undefined,//部门ID
+                techDepId: this.state.thchDepId || undefined,//责任部门ID
+                cid: this.state.projectStatus || undefined,//项目类别
+                projectType: typeof this.state.projectType === 'number' ? this.state.projectType : undefined,//项目分类
+                orderNo: this.state.searchOrderNo || undefined,//订单编号
+                contractNo: this.state.searchContractNo || undefined,//合同编号
+                name: this.state.searchEnterpriseName || undefined,//企业名称
+                declarationBatch: this.state.declarationBatch || undefined,//申报批次
+                commodityPrice: this.state.projectAmount || undefined,//项目金额
+            },
+            success: function (data) {
+                ShowModal(this);
+                if (data.error && data.error.length) {
+                    message.warning(data.error[0].message);
+                } else {
+                    download(data.data,true);
+                }
+            }.bind(this),
+        }).always(
+            function () {
+                this.setState({
+                    loading: false,
+                });
+            }.bind(this)
+        );
     }
 
 
@@ -413,16 +404,6 @@ class EnterpriseProjectQuery extends Component{
                                         let infor = this.state.contactsOptionData.filter((v)=>v.id === e);
                                         this.setState({
                                             projectStatus: e,
-                                        },()=>{
-                                            if(infor[0].cname === '高新' && typeof this.state.projectType !== 'number'){
-                                                this.setState({
-                                                    status: 1,
-                                                })
-                                            }else if (typeof this.state.projectType !== 'number'){
-                                                this.setState({
-                                                    status: 0,
-                                                })
-                                            }
                                         })
                                     }}
                                 >
@@ -438,7 +419,6 @@ class EnterpriseProjectQuery extends Component{
                                     onChange={(e) => {
                                         this.setState({
                                             projectType: e,
-                                            status: e === 4 ? 2 : e === 2 ? 3 : e === 1 ? 4 : e === 5 ? 1 : 0,
                                         })
                                     }}
                                 >
@@ -529,27 +509,27 @@ class EnterpriseProjectQuery extends Component{
                                     <Option value={9}>80万上</Option>
                                 </Select>
                             </span>
-                            <span style={{display:"inline-block"}}>
-                                <span style={{marginRight:'10px',marginBottom:'10px'}}>项目情况 :</span>
-                                <Select
-                                    value={typeof this.state.projectSituation === 'number' ? this.state.projectSituation : undefined}
-                                    placeholder="请选择项目情况"
-                                    style={{ width: 200,marginRight:'10px',marginBottom:'10px' }}
-                                    onChange={(e) => {
-                                        this.setState({
-                                            projectSituation: e,
-                                        });
-                                    }}
-                                >
-                                    <Option value={0}>未开始</Option>
-                                    <Option value={1}>进行中</Option>
-                                    <Option value={2}>已暂停</Option>
-                                    <Option value={3}>已驳回(专利、软著项目编写)</Option>
-                                    <Option value={4}>已完成</Option>
-                                    <Option value={5}>项目已完成 已退单</Option>
-                                    <Option value={6}>项目未完成 已退单</Option>
-                                </Select>
-                            </span>
+                            {/*<span style={{display:"inline-block"}}>*/}
+                            {/*    <span style={{marginRight:'10px',marginBottom:'10px'}}>项目情况 :</span>*/}
+                            {/*    <Select*/}
+                            {/*        value={typeof this.state.projectSituation === 'number' ? this.state.projectSituation : undefined}*/}
+                            {/*        placeholder="请选择项目情况"*/}
+                            {/*        style={{ width: 200,marginRight:'10px',marginBottom:'10px' }}*/}
+                            {/*        onChange={(e) => {*/}
+                            {/*            this.setState({*/}
+                            {/*                projectSituation: e,*/}
+                            {/*            });*/}
+                            {/*        }}*/}
+                            {/*    >*/}
+                            {/*        <Option value={0}>未开始</Option>*/}
+                            {/*        <Option value={1}>进行中</Option>*/}
+                            {/*        <Option value={2}>已暂停</Option>*/}
+                            {/*        <Option value={3}>已驳回(专利、软著项目编写)</Option>*/}
+                            {/*        <Option value={4}>已完成</Option>*/}
+                            {/*        <Option value={5}>项目已完成 已退单</Option>*/}
+                            {/*        <Option value={6}>项目未完成 已退单</Option>*/}
+                            {/*    </Select>*/}
+                            {/*</span>*/}
                             <span style={{display:"inline-block"}}>
                                 <span style={{marginRight:'10px',marginBottom:'10px'}}>派单时间 :</span>
                                 <RangePicker
@@ -601,7 +581,7 @@ class EnterpriseProjectQuery extends Component{
                                 this.setState({
                                     projectdetailsId: record.id,
                                     projectdetailsOrderNo: record.orderNo,
-                                    pname: record.pname,
+                                    commodityName: record.commodityName,
                                     visible: true,
                                 })
                             }}
@@ -614,7 +594,7 @@ class EnterpriseProjectQuery extends Component{
                     visible={this.state.visible}
                     id={this.state.projectdetailsId}
                     orderNo={this.state.projectdetailsOrderNo}
-                    taskName={this.state.pname}
+                    taskName={this.state.commodityName}
                     visitOk={()=>{
                         this.setState({
                             visible: false,

+ 21 - 21
js/component/manageCenter/project/summary/highTech.jsx

@@ -487,27 +487,27 @@ class HighTech extends Component{
                                     <Option value={9}>80万上</Option>
                                 </Select>
                             </span>
-                                <span style={{display:"inline-block"}}>
-                                <span style={{marginRight:'10px',marginBottom:'10px'}}>项目情况 :</span>
-                                <Select
-                                    value={typeof this.state.projectSituation === 'number' ? this.state.projectSituation : undefined}
-                                    placeholder="请选择项目情况"
-                                    style={{ width: 200,marginRight:'10px',marginBottom:'10px' }}
-                                    onChange={(e) => {
-                                        this.setState({
-                                            projectSituation: e,
-                                        });
-                                    }}
-                                >
-                                    <Option value={0}>未开始</Option>
-                                    <Option value={1}>进行中</Option>
-                                    <Option value={2}>已暂停</Option>
-                                    <Option value={3}>已驳回(专利、软著项目编写)</Option>
-                                    <Option value={4}>已完成</Option>
-                                    <Option value={5}>项目已完成 已退单</Option>
-                                    <Option value={6}>项目未完成 已退单</Option>
-                                </Select>
-                            </span>
+                            {/*    <span style={{display:"inline-block"}}>*/}
+                            {/*    <span style={{marginRight:'10px',marginBottom:'10px'}}>项目情况 :</span>*/}
+                            {/*    <Select*/}
+                            {/*        value={typeof this.state.projectSituation === 'number' ? this.state.projectSituation : undefined}*/}
+                            {/*        placeholder="请选择项目情况"*/}
+                            {/*        style={{ width: 200,marginRight:'10px',marginBottom:'10px' }}*/}
+                            {/*        onChange={(e) => {*/}
+                            {/*            this.setState({*/}
+                            {/*                projectSituation: e,*/}
+                            {/*            });*/}
+                            {/*        }}*/}
+                            {/*    >*/}
+                            {/*        <Option value={0}>未开始</Option>*/}
+                            {/*        <Option value={1}>进行中</Option>*/}
+                            {/*        <Option value={2}>已暂停</Option>*/}
+                            {/*        <Option value={3}>已驳回(专利、软著项目编写)</Option>*/}
+                            {/*        <Option value={4}>已完成</Option>*/}
+                            {/*        <Option value={5}>项目已完成 已退单</Option>*/}
+                            {/*        <Option value={6}>项目未完成 已退单</Option>*/}
+                            {/*    </Select>*/}
+                            {/*</span>*/}
                                 <span style={{display:"inline-block"}}>
                                 <span style={{marginRight:'10px',marginBottom:'10px'}}>派单时间 :</span>
                                 <RangePicker

+ 0 - 9
js/component/manageCenter/project/summary/projectDetails.jsx

@@ -882,15 +882,6 @@ class ProjectDetails extends Component{
                                             <FormItem
                                                 className="half-item"
                                                 {...formItemLayout}
-                                                label="项目状态"
-                                            >
-                                                <span>
-                                                  {getProjectStatus(this.state.projectStatus)}
-                                                </span>
-                                            </FormItem>
-                                            <FormItem
-                                                className="half-item"
-                                                {...formItemLayout}
                                                 label="是否特批"
                                             >
                                                 <span>{getApproval(this.state.approval)}</span>

+ 3 - 0
js/component/tools.js

@@ -2023,5 +2023,8 @@ module.exports = {
       return arr[0].label
     }
     return '';
+  },
+  download(fileName,deleteLv= true) {
+    window.open(globalConfig.context +`${'/open/download?fileName='+fileName+'&delete='+deleteLv}`);
   }
 };