dev01 10 months ago
parent
commit
8fba8e23b4

+ 4 - 4
js/component/dataDic.js

@@ -1419,10 +1419,10 @@ module.exports = {
       value: "1",
       key: "已签单客户",
     },
-    // {
-    //   value: "2",
-    //   key: "外联客户",
-    // },
+    {
+      value: "2",
+      key: "渠道客户",
+    },
     {
       value: "3",
       key: "限定项目",

+ 3 - 3
js/component/manageCenter/financialManage/account/publicityAccount.jsx

@@ -405,11 +405,11 @@ const PublicityAccount = React.createClass({
             <div className="user-search" style={{ marginLeft: 10 }}>
               <Input
                 placeholder="合同编号"
-                value={searchValues["contactNo"]
-                  ? searchValues["contactNo"]
+                value={searchValues["contractNo"]
+                  ? searchValues["contractNo"]
                   : ""}
                 onChange={(e) => {
-                  searchValues["contactNo"] = e.target.value;
+                  searchValues["contractNo"] = e.target.value;
                   this.setState({
                     searchValues: searchValues,
                   });

+ 2 - 1
js/component/manageCenter/order/orderNew/mysuspend.jsx

@@ -4,7 +4,7 @@ import { AutoComplete, Button, Input, Spin, Table, DatePicker, Select, message,
 import { ChooseList } from "../../order/orderNew/chooseList"
 import moment from "moment";
 import ShowModalDiv from "@/showModal.jsx";
-import { getStopStatus } from '@/tools';
+import { ShowModal, getStopStatus } from '@/tools';
 import Cascaders from "../../../common/cascaders";
 import MySuspend from '../../../common/mysuspend';
 import MySuspendLog from '../../../common/logPopup/mysuspendlog';
@@ -215,6 +215,7 @@ const MySuspendList = React.createClass({
       url: globalConfig.context + "/api/admin/orderProject/selectProjectStop",
       data: datas,
       success: function (data) {
+        ShowModal(this);
         this.setState({
           loading: false,
         });

+ 2 - 1
js/component/manageCenter/order/orderNew/suspendexamine.jsx

@@ -4,7 +4,7 @@ import { AutoComplete, Button, Input, Spin, Table, DatePicker, Select, message,
 import { ChooseList } from "../../order/orderNew/chooseList"
 import moment from "moment";
 import ShowModalDiv from "@/showModal.jsx";
-import { getStopStatus } from '@/tools';
+import { ShowModal, getStopStatus } from '@/tools';
 import Cascaders from "../../../common/cascaders";
 import MySuspend from '../../../common/mysuspend';
 import MySuspendLog from '../../../common/logPopup/mysuspendlog';
@@ -191,6 +191,7 @@ const SuspendExamine = React.createClass({
       url: globalConfig.context + "/api/admin/orderProject/selectProjectStop",
       data: datas,
       success: function (data) {
+        ShowModal(this);
         this.setState({
           loading: false,
         });

+ 7 - 0
js/component/manageCenter/project/task/myTask.jsx

@@ -5075,6 +5075,13 @@ const Task = React.createClass({
                             disabled={this.state.payNodeLoading || this.state.thirdInfoLoading}
                             value={this.state.patentNameType}
                             onChange={(e) => {
+                              Modal.info({
+                                title: '系统提示',
+                                content: (
+                                  <div>
+                                    <span style={{ color: "red" }}>请再次确定“对应的项目”与右上角的“项目名称”保持一致!</span>
+                                  </div>),
+                              });
                               this.detectDeletion(0, () => {
                                 this.setState({ patentNameType: e.target.value }, () => {
                                   this.projectTypeTabContent(this.state.projectType);

+ 1 - 1
js/component/manageCenter/standard/stList/index.jsx

@@ -400,7 +400,7 @@ const Standard = Form.create()(React.createClass({
       if (!data.error.length) {
         message.success('保存成功!');
         this.handleCancel();
-        this.loadData();
+        this.loadData(this.state.pageNo);
       } else {
         message.warning(data.error[0].message);
       }

+ 2 - 2
js/component/manageCenter/topTab.jsx

@@ -866,9 +866,9 @@ const TopTab = React.createClass({
               className="user-badge"
             >
               <Icon type="mail" />
-              {!window.showSystem && this.state.badge ? (
+              {/* {!window.showSystem && this.state.badge ? (
                 <Badge status="processing" />
-              ) : null}
+              ) : null} */}
             </a>
           ) : null}
         </div>

+ 450 - 34
js/component/showModal.jsx

@@ -1,59 +1,475 @@
 import React from "react";
+import $ from "jquery/src/ajax";
 import { Spin, Button, Tabs, Table, message, Modal } from "antd";
+import FollowDetail from "./manageCenter/customer/NEW/intentionCustomer/followDetail"
 
 
+const MessageModal = React.createClass({
+  getInitialState() {
+    return {
+      unreadData: [],
+      unreadDataType: "0",
+      dataSourceType: "1",
+      unreadDataIndex: 0,
+      visible: false,
+      loading: false,
+      pagination: {
+        defaultCurrent: 1,
+        defaultPageSize: 10,
+        showQuickJumper: true,
+        pageSize: 10,
+        onChange: function (page) {
+          this.loadReaded(page);
+        }.bind(this),
+        showTotal: function (total) {
+          return "共" + total + "条数据";
+        },
+      },
+      UnreadPagination: {
+        defaultCurrent: 1,
+        defaultPageSize: 10,
+        showQuickJumper: true,
+        pageSize: 10,
+        onChange: function (page) {
+          this.loadUnread(page);
+        }.bind(this),
+        showTotal: function (total) {
+          return "共" + total + "条数据";
+        },
+      },
+      categoryArr: [],
+      columns: [
+        {
+          title: "类型",
+          dataIndex: "noticeType",
+          key: "noticeType",
+          render: (text, record) => {
+            return <span style={{ color: record.noticeType == 59 && "red" }}>{record.noticeTypeName}</span>;
+          },
+        },
+        {
+          title: "时间",
+          dataIndex: "createTimeFormattedDate",
+          key: "createTimeFormattedDate",
+        },
+        {
+          title: "内容",
+          dataIndex: "content",
+          key: "content",
+          render: (text, record) => {
+            return <span style={{ color: record.noticeType == 59 && "red" }}>{text}</span>;
+          },
+        },
+        {
+          title: "操作",
+          dataIndex: "abc",
+          key: "abc",
+          render: (text, record) => {
+            let contractNo = "";
+            if (
+              (record.noticeType === 14 || record.noticeType === 40) &&
+              record.content.indexOf("合同编号-") !== -1
+            ) {
+              let arr = record.content.split("合同编号-");
+              contractNo = arr[1].match(/(\S*), 订单编号/)[1];
+            }
+            return record.noticeType === 48 || record.noticeType === 49 ? (
+              <Button
+                type="primary"
+                onClick={() => {
+                  this.category();
+                  record.id = record.uid;
+                  this.setState({
+                    followData: record,
+                    visitModul: true,
+                  });
+                }}
+              >
+                立即跟进
+              </Button>
+            ) : record.noticeType === 14 || record.noticeType === 40 ? (
+              <Button
+                disabled={!contractNo}
+                type="primary"
+                onClick={(e) => {
+                  e.stopPropagation();
+                  let input = document.getElementById("copyText");
+                  input.value = contractNo;
+                  input.select();
+                  document.execCommand("copy");
+                  message.success("复制成功");
+                }}
+              >
+                复制合同号
+              </Button>
+            ) : null;
+          },
+        },
+      ],
+      data: [],
+    };
+  },
+  category() {
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/Varieties/getSuperList",
+      data: {},
+      success: function (data) {
+        let thedata = data.data;
+        let theArr = [];
+        if (!thedata) {
+          if (data.error && data.error.length) {
+            message.warning(data.error[0].message);
+          }
+          thedata = {};
+        } else {
+          thedata.map(function (item, index) {
+            theArr.push({
+              value: item.id,
+              key: item.cname,
+            });
+          });
+        }
+        this.setState({
+          categoryArr: theArr,
+        });
+      }.bind(this),
+    });
+  },
+  loadReaded(pageNo) {
+    this.state.data = [];
+    this.setState({
+      loading: true,
+    });
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/notice/readed",
+      data: {
+        pageNo: pageNo || 1,
+        pageSize: this.state.pagination.pageSize,
+        type: this.state.unreadDataType,
+      },
+    })
+      .done((data) => {
+        if (!data.data) {
+          if (data.error && data.error.length) {
+            message.warning(data.error[0].message);
+            return;
+          }
+        }
+        this.state.data = [];
+        for (let i = 0; i < data.data.list.length; i++) {
+          let thisdata = data.data.list[i];
+          this.state.data.push({
+            key: i + 1,
+            id: thisdata.id,
+            rid: thisdata.rid,
+            uid: thisdata.uid,
+            aid: thisdata.aid,
+            noticeType: thisdata.noticeType,
+            year: thisdata.year,
+            noticeTypeName: thisdata.noticeTypeName,
+            content: thisdata.content,
+            createTime: thisdata.createTime,
+            createTimeFormattedDate: thisdata.createTimeFormattedDate,
+            principle: thisdata.principle,
+            unitName: thisdata.unitName,
+          });
+        }
+        this.state.pagination.current = data.data.pageNo;
+        this.state.pagination.total = data.data.totalCount;
+        this.setState({
+          dataSource: this.state.data,
+          pagination: this.state.pagination,
+        });
+      })
+      .always(
+        function () {
+          this.setState({
+            loading: false,
+          });
+        }.bind(this)
+      );
+  },
+  loadUnread(pageNo) {
+    this.state.data = [];
+    this.setState({
+      loading: true,
+    });
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/notice/unread",
+      data: {},
+    })
+      .done((data) => {
+        if (data.error && data.error.length) {
+          message.warning(data.error[0].message);
+          return;
+        } else {
+          let arr = data.data.filter((v) => v.list.length > 0);
+          if (arr.length) {
+            this.setState({
+              newVisible: true,
+            });
+          }
+          let index = data.data.findIndex((v) => v.list.length > 0);
+          if (index >= 0) {
+            data.data[index].isRead = true;
+            this.setState({
+              unreadDataType: data.data[index]["id"] + "",
+              unreadDataIndex: index,
+            });
+          } else {
+            this.setState({
+              unreadDataType: data.data[0]["id"] + "",
+              unreadDataIndex: "0",
+            });
+          }
+          this.setState({
+            unreadData: data.data,
+          });
+        }
+      })
+      .always(
+        function () {
+          this.setState({
+            loading: false,
+          });
+        }.bind(this)
+      );
+  },
+  componentWillReceiveProps(nextProps) {
+    if (!this.state.visible && nextProps.showDesc) {
+      this.loadReaded();
+      this.loadUnread();
+    }
+    this.state.visible = nextProps.showDesc;
+  },
+  handleOk() {
+    let arr = this.state.unreadData.filter(
+      (v) => v.list.length > 0 && !v.isRead
+    );
+    if (arr.length > 0) {
+      message.warning("还存在未读消息,请查看后再关闭当前页面!");
+      return;
+    } else {
+      this.setState({
+        visible: false,
+      });
+    }
+    this.props.closeDesc(false, true);
+  },
+  handleCancel(e) {
+    let arr = this.state.unreadData.filter(
+      (v) => v.list.length > 0 && !v.isRead
+    );
+    if (arr.length > 0) {
+      message.warning("还存在未读消息,请查看后再关闭当前页面!");
+      return;
+    } else {
+      this.setState({
+        visible: false,
+      });
+    }
+    this.props.closeDesc(false, true);
+  },
+  closeDesc() {
+    this.setState(
+      {
+        categoryArr: [],
+        followData: "",
+        visitModul: false,
+      },
+      () => {
+        this.loadReaded(this.state.pagination.current);
+      }
+    );
+  },
+  render() {
+    return (
+      <div className="topTab-modal">
+        <Spin spinning={this.state.loading} className="spin-box">
+          <Modal
+            maskClosable={false}
+            title="信息中心"
+            visible={this.state.visible}
+            onOk={this.handleOk}
+            onCancel={this.handleCancel}
+            width="1200px"
+            footer=""
+          >
+            <Spin spinning={this.state.loading} className="spin-box">
+              <Tabs
+                defaultActiveKey={this.state.unreadDataType}
+                activeKey={this.state.unreadDataType}
+                onChange={(v) => {
+                  let index = this.state.unreadData.findIndex((d) => d.id == v);
+                  this.state.unreadData[index].isRead = true;
+                  this.setState(
+                    {
+                      unreadDataIndex: index,
+                      unreadData: this.state.unreadData,
+                      unreadDataType: v,
+                    },
+                    () => {
+                      if (this.state.dataSourceType === "2") {
+                        this.loadReaded();
+                      }
+                    }
+                  );
+                }}
+              >
+                {this.state.unreadData.map((v) => (
+                  <Tabs.TabPane
+                    key={v.id + ""}
+                    tab={
+                      <div
+                        style={{ color: v.id == 7 && "red" }}
+                      >
+                        {v.list.length === 0 || v.isRead ? null : (
+                          <div
+                            style={{
+                              width: "8px",
+                              height: "8px",
+                              borderRadius: "8px",
+                              background: "#f00",
+                              position: "absolute",
+                              right: "5px",
+                              top: "2px",
+                            }}
+                          />
+                        )}
+                        {v.name}
+                      </div>
+                    }
+                  />
+                ))}
+              </Tabs>
+              <Tabs
+                defaultActiveKey="1"
+                type="card"
+                tabPosition="left"
+                value={this.state.dataSourceType}
+                onChange={(v) => {
+                  this.setState({
+                    dataSourceType: v,
+                  });
+                  if (v === "2") {
+                    this.loadReaded();
+                  }
+                }}
+              >
+                <Tabs.TabPane tab={"未读"} key="1">
+                  <Table
+                    bordered
+                    columns={this.state.columns}
+                    dataSource={
+                      this.state.unreadData[this.state.unreadDataIndex]
+                        ? this.state.unreadData[this.state.unreadDataIndex].list
+                        : []
+                    }
+                    pagination={false}
+                  />
+                </Tabs.TabPane>
+                <Tabs.TabPane tab="已读" key="2">
+                  <Table
+                    bordered
+                    columns={this.state.columns}
+                    dataSource={this.state.dataSource}
+                    pagination={this.state.pagination}
+                  />
+                </Tabs.TabPane>
+              </Tabs>
+            </Spin>
+            <textarea id="copyText" style={{ opacity: 0 }} />
+          </Modal>
+        </Spin>
+        <FollowDetail
+          categoryArr={this.state.categoryArr}
+          followData={this.state.followData}
+          visitModul={this.state.visitModul}
+          closeDesc={this.closeDesc}
+        />
+      </div>
+    );
+  },
+});
+
 const ShowModal = React.createClass({
   getInitialState() {
     return {
-      newVisible: false
+      newVisible: false,
+      messageModalShow: false,
     };
   },
+
   componentWillReceiveProps(nextProps) {
     this.setState({
       newVisible: nextProps.ShowModal
     });
   },
+
   handleOk() {
     this.setState({
       newVisible: false
     });
-    // window.setTimeout( () => {
-    //   this.setState({
-    //     newVisible: true
-    //   });
-    // },)
   },
+
+  closeMessageModal(e, s) {
+    this.setState({
+      messageModalShow: e
+    })
+  },
+
   render() {
     return (
-      <Modal
-        style={{ position: "relative" }}
-        title="消息提醒"
-        visible={this.state.newVisible}
-        closable={false}
-        footer={null}
-        destroyOnClose={true}
-      >
-        <div style={{ textAlign: "center" }}>
-          您有新消息尚未查看,请及时查看信息!
-          <a href={"/admin/index.html#normal"}
-            onClick={() => {
-              !!this.props.seeInfo && this.props.seeInfo()
-            }}
-          >点我查看信息</a>
-        </div>
-        <Button
-          onClick={this.handleOk}
-          type={"primary"}
-          style={{
-            position: "relative",
-            left: "50%",
-            transform: "translateX(-50%)",
-            bottom: -10
-          }}
+      <div>
+        <Modal
+          style={{ position: "relative" }}
+          title="消息提醒"
+          visible={this.state.newVisible}
+          closable={false}
+          footer={null}
+          destroyOnClose={true}
         >
-          关闭
-        </Button>
-      </Modal>
+          <div style={{ textAlign: "center" }}>
+            您有新消息尚未查看,请及时查看信息!
+            <span
+              style={{ color: "#58a3ff", cursor: "pointer" }}
+              //  href={"/admin/index.html#normal"}
+              onClick={() => {
+                this.setState({
+                  messageModalShow: true,
+                  newVisible: false,
+                })
+                !!this.props.seeInfo && this.props.seeInfo()
+              }}
+            >点我查看信息</span>
+          </div>
+          <Button
+            onClick={this.handleOk}
+            type={"primary"}
+            style={{
+              position: "relative",
+              left: "50%",
+              transform: "translateX(-50%)",
+              bottom: -10
+            }}
+          >
+            关闭
+          </Button>
+        </Modal>
+        <MessageModal
+          showDesc={this.state.messageModalShow}
+          closeDesc={this.closeMessageModal}
+        />
+      </div>
     );
   }
 });

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "afanti",
-  "version": "1.3.16",
+  "version": "1.3.17",
   "description": "",
   "main": "index.js",
   "scripts": {