lanjianrong преди 5 години
родител
ревизия
6153fde5ff
променени са 3 файла, в които са добавени 78 реда и са изтрити 25 реда
  1. 12 2
      src/pages/Customer/Company/components/PersonLabel/index.jsx
  2. 28 8
      src/pages/Customer/Company/index.jsx
  3. 38 15
      src/pages/Customer/Contact/index.jsx

+ 12 - 2
src/pages/Customer/Company/components/PersonLabel/index.jsx

@@ -53,7 +53,7 @@ const PersonLabel = props => {
     tagIds = [],
     tagType,
     tagColumn,
-    modeType = 'column',
+    modeType = LabelModeType.column,
     checkCallBack,
     contactPersonTags,
     companyPersonTags,
@@ -61,7 +61,15 @@ const PersonLabel = props => {
   } = props
   const [dropdownType, setDropdownType] = useState(DropdownTypeEnum.check)
 
-  const [checkedIds, setCheckedIds] = useState(tagIds)
+  if (modeType === 0) {
+    console.log('tagIds', tagIds)
+  }
+  const [checkedIds, setCheckedIds] = useState([...tagIds])
+
+  if (modeType === 0) {
+    console.log('222', checkedIds)
+  }
+
   const [showOkBtn, setShowOkBtn] = useState(false)
   const initData = () => {
     dispatch({
@@ -142,6 +150,8 @@ const DropDownMenu = props => {
     initCallBack
   } = props
 
+  console.log('checkedIds', checkedIds)
+
   const [activeState, setActiveState] = useState({
     id: '',
     activeId: '',

+ 28 - 8
src/pages/Customer/Company/index.jsx

@@ -134,12 +134,32 @@ const Company = props => {
         </div>
       )
     },
-    {
-      title: '协作标签',
-      dataIndex: 'biaoqian1',
-      key: 'biaoqian1',
-      width: 80
-    },
+    // {
+    //   title: '协作标签',
+    //   dataIndex: 'tagCooperationIds',
+    //   key: 'tagCooperationIds',
+    //   width: 80,
+    //   render: (_, record) => (
+    //     <div className="zh-align-center zh-flex-wrap">
+    //       {record.tagCooperationIds.map(item => (
+    //         <span
+    //           key={record.id + item}
+    //           className="zh-circle-icon zh-mg-right-3"
+    //           style={{ backgroundColor: personTagColorMap[item] }}
+    //         />
+    //       ))}
+    //       <PersonLabel
+    //         dataId={record.id}
+    //         tagIds={record.tagCooperationIds}
+    //         tagType={TagTypeEnum.TEAM}
+    //         tagColumn={TagDataTypeEnum.COMPANY}
+    //         checkCallBack={initData}
+    //         modeType={LabelModeType.column}>
+    //         <IconPark type="add" theme="filled" size="20" fill="#868e96" className="zh-pointer" />
+    //       </PersonLabel>
+    //     </div>
+    //   )
+    // },
     {
       title: '联系人',
       dataIndex: 'clientTotal',
@@ -307,7 +327,7 @@ const Company = props => {
                   )}
                 </PersonLabel>
               </div>
-              <div className="zh-mg-right-5">
+              {/* <div className="zh-mg-right-5">
                 <PersonLabel
                   tagType={TagTypeEnum.TEAMTAG}
                   tagColumn={TagDataTypeEnum.COMPANY}
@@ -331,7 +351,7 @@ const Company = props => {
                     </Button>
                   )}
                 </PersonLabel>
-              </div>
+              </div> */}
               <Button onClick={() => tagsSettingConfirm(selectedRowKeys)}>
                 <IconPark type="check" size={14} />
                 确认

+ 38 - 15
src/pages/Customer/Contact/index.jsx

@@ -41,7 +41,8 @@ const Contact = props => {
     journal: [],
     servicelog: [],
     total: 0,
-    current: 1,
+    page: 1,
+    size: 20,
     loading: false,
     id: '',
     tail: { department: 0, email: 0, telephone: 0 }
@@ -60,6 +61,7 @@ const Contact = props => {
       }
     } = await queryContact(payload)
     if (code === consts.RET_CODE.SUCCESS) {
+      console.log(payload?.page, state.page)
       setState({
         ...state,
         data: client,
@@ -68,7 +70,7 @@ const Contact = props => {
         total,
         tail,
         loading: false,
-        current: payload?.page || 1
+        page: payload?.page || state.page
       })
     }
   }
@@ -225,10 +227,29 @@ const Contact = props => {
     },
     {
       title: '协作标签',
-      dataIndex: 'tooltip',
-      key: 'tooltip',
+      dataIndex: 'tagCooperationIds',
+      key: 'tagCooperationIds',
       width: 100,
-      render: (_, record) => <Tag color="#F8AC59">{record.tooltip}</Tag>,
+      render: (_, record) => (
+        <div className="zh-align-center zh-flex-wrap">
+          {record.tagCooperationIds.map(item => (
+            <span
+              key={record.id + item}
+              className="zh-circle-icon zh-mg-right-3"
+              style={{ backgroundColor: teamTagColorMap[item] }}
+            />
+          ))}
+          <PersonLabel
+            dataId={record.id}
+            tagIds={record.tagCooperationIds}
+            tagType={TagTypeEnum.TEAM}
+            tagColumn={TagDataTypeEnum.CONTACT}
+            checkCallBack={initData}
+            modeType={LabelModeType.column}>
+            <IconPark type="add" theme="filled" size="20" fill="#868e96" className="zh-pointer" />
+          </PersonLabel>
+        </div>
+      ),
       filters: true,
       valueType: 'select',
       valueEnum: {
@@ -433,20 +454,22 @@ const Contact = props => {
       bordered
       columns={columns}
       dataSource={state.data}
-      summary={() => (
-        <ProTable.Summary.Row>
-          <ProTable.Summary.Cell>统计: 总数</ProTable.Summary.Cell>
-          <ProTable.Summary.Cell />
-          <ProTable.Summary.Cell>未填写: {state.tail.department}</ProTable.Summary.Cell>
-          <ProTable.Summary.Cell>未填写: {state.tail.telephone}</ProTable.Summary.Cell>
-          <ProTable.Summary.Cell>未填写: {state.tail.email}</ProTable.Summary.Cell>
-        </ProTable.Summary.Row>
-      )}
+      // summary={() => (
+      //   <ProTable.Summary.Row>
+      //     <ProTable.Summary.Cell>统计: 总数</ProTable.Summary.Cell>
+      //     <ProTable.Summary.Cell />
+      //     <ProTable.Summary.Cell>未填写: {state.tail.department}</ProTable.Summary.Cell>
+      //     <ProTable.Summary.Cell>未填写: {state.tail.telephone}</ProTable.Summary.Cell>
+      //     <ProTable.Summary.Cell>未填写: {state.tail.email}</ProTable.Summary.Cell>
+      //   </ProTable.Summary.Row>
+      // )}
       pagination={{
         pageSize: consts.PAGE_SIZE,
         total: state.total,
         current: state.current,
-        onChange: (page, size) => initData({ page, size })
+        onChange: (page, size) => {
+          initData({ page, size })
+        }
       }}
       tableAlertRender={({ selectedRowKeys }) => {
         return (