Prechádzať zdrojové kódy

Merge branch 'dev' of http://smartcost.in.8866.org:26903/outaozhen/cldV2react into dev

lanjianrong 4 rokov pred
rodič
commit
8cb1171614

+ 6 - 11
src/pages/Customer/Company/components/CompanyDetail/TabList.jsx

@@ -46,8 +46,7 @@ const CompanyTabList = ({ initData, customerId, client, software, customer, busi
         if (key !== defaultSelectedKey) {
           changePriority(key, id)
         }
-      }}
-    >
+      }}>
       <Menu.Item key="1">1</Menu.Item>
       <Menu.Item key="2">2</Menu.Item>
       <Menu.Item key="3">3</Menu.Item>
@@ -92,8 +91,7 @@ const CompanyTabList = ({ initData, customerId, client, software, customer, busi
         <div className="text-primary hover:text-[#967bbd] line-clamp-1">
           <span
             onClick={() => dispatchModal('D_CLIENT_DETAIL', { dataId: record.id })}
-            className="cursor-pointer "
-          >
+            className="cursor-pointer ">
             {clientName}
           </span>
         </div>
@@ -108,7 +106,7 @@ const CompanyTabList = ({ initData, customerId, client, software, customer, busi
     {
       title: '手机',
       dataIndex: 'telephone',
-      width: 110,
+      width: 130,
       ellipsis: true
     },
     {
@@ -129,8 +127,7 @@ const CompanyTabList = ({ initData, customerId, client, software, customer, busi
           className={[
             'cursor-pointer hover:text-hex-967bbd',
             record.preserveStatus === 3 ? null : 'text-primary'
-          ].join(' ')}
-        >
+          ].join(' ')}>
           {record.preserveStatus === 3 ? (
             <Text delete type="secondary">
               {clientName}
@@ -219,8 +216,7 @@ const CompanyTabList = ({ initData, customerId, client, software, customer, busi
       render: (text, record) => (
         <span
           onClick={() => dispatchModal('D_BUSINESS_DETAIL', { dataId: record.id })}
-          className="text-primary cursor-pointer hover:text-[#967bbd]"
-        >
+          className="text-primary cursor-pointer hover:text-[#967bbd]">
           {text}
         </span>
       )
@@ -361,8 +357,7 @@ const CompanyTabList = ({ initData, customerId, client, software, customer, busi
                 landmarks: customer.landmarks
               }
             })
-          }
-        >
+          }>
           <Plus className="mr-1" />
           客户
         </Button>

+ 17 - 7
src/pages/Statistic/Product/CustomerAdditions/index.jsx

@@ -19,11 +19,8 @@ const CustomerAdditions = () => {
     chart: {},
     type: 'month'
   })
-
-  const [type, setType] = useState('month')
   const [dates, setDates] = useState([])
   const [hackValue, setHackValue] = useState()
-  const [value, setValue] = useState()
   const tRef = useRef(null)
   const handleOptionChange = (type, ids) =>
     setState({ ...state, params: { ...state.params, optionType: type, dataIds: ids } })
@@ -31,9 +28,22 @@ const CustomerAdditions = () => {
     if (!dates || dates.length === 0) {
       return false
     }
-    const tooLate = dates[0] && current.diff(dates[0], 'month') > 10
-    const tooEarly = dates[1] && dates[1].diff(current, 'month') > 10
-    return tooEarly || tooLate
+    if (state.type === 'month') {
+      const tooLate = dates[0] && current.diff(dates[0], 'month') > 10
+      const tooEarly = dates[1] && dates[1].diff(current, 'month') > 10
+      return tooEarly || tooLate
+    }
+    if (state.type === 'week') {
+      const tooLate = dates[0] && current.diff(dates[0], 'weeks') > 11
+      const tooEarly = dates[1] && dates[1].diff(current, 'weeks') > 11
+      return tooEarly || tooLate
+    }
+    if (state.type === 'date') {
+      const tooLate = dates[0] && current.diff(dates[0], 'days') > 29
+      const tooEarly = dates[1] && dates[1].diff(current, 'days') > 29
+      return tooEarly || tooLate
+    }
+    // return tooEarly || tooLate
   }
   const onOpenChange = open => {
     if (open) {
@@ -103,7 +113,7 @@ const CustomerAdditions = () => {
                 <Option value="date">日</Option>
               </Select>
               <RangePicker
-                picker={type}
+                picker={state.type}
                 disabledDate={disabledDate}
                 onCalendarChange={val => setDates(val)}
                 onOpenChange={onOpenChange}