浏览代码

fix: 联系人服务记录时间和内容的修改+仪表盘服务记录修改

outaozhen 5 年之前
父节点
当前提交
8cb8bc9e2a

+ 4 - 1
src/pages/Customer/Client/components/ClientDetail/AddRecord.jsx

@@ -36,6 +36,9 @@ const AddRecord = props => {
           if (values.date) {
             newVal.date = dayjsFormat(values.date, 'YYYY-MM-DD')
           }
+          if (values.remindTime) {
+            newVal.remindTime = dayjsFormat(values.remindTime, 'YYYY-MM-DD')
+          }
           await onConfirm(newVal)
           return true
         } catch (error) {
@@ -65,7 +68,7 @@ const AddRecord = props => {
           <Form.Item name="remindTime" label="备忘日期">
             <DatePicker style={{ width: '100%' }} disabledDate={disabledDate} />
           </Form.Item>
-          <Form.Item name="remark" label="备忘内容">
+          <Form.Item name="memoContent" label="备忘内容">
             <TextArea rows={2} />
           </Form.Item>
         </>

+ 78 - 5
src/pages/workbench/Dashboard/components/RatioPanels.jsx

@@ -41,23 +41,33 @@ const renderBadge = (count, active = false) => {
 }
 
 /** 服务环比数据Tab切换表格 */
-const ServiceRatioPanels = ({ cyclical, dataPermission }) => {
+const ServiceRatioPanels = ({ cyclical, dataPermission, dataType }) => {
   const [state, setState] = useState({
     activeKey: '0',
     total: 0
   })
 
-  const columns = [
+  const clientColumns = [
+    {
+      dataIndex: 'clientName',
+      title: '联系人名称',
+      width: '10%'
+    },
+    {
+      dataIndex: 'customerName',
+      title: '客户名称',
+      width: '20%'
+    },
     {
       dataIndex: 'status',
       title: '服务类型',
-      width: '25%',
+      width: '10%',
       render: type => servicelogEnum[type]
     },
     {
       dataIndex: 'date',
       title: '服务日期',
-      width: '25%',
+      width: '10%',
       valueType: 'date'
     },
     {
@@ -66,6 +76,69 @@ const ServiceRatioPanels = ({ cyclical, dataPermission }) => {
       title: '服务内容'
     }
   ]
+  const customerColumns = [
+    {
+      dataIndex: 'clientName',
+      title: '客户名称',
+      width: '10%'
+    },
+    {
+      dataIndex: 'status',
+      title: '服务类型',
+      width: '10%',
+      render: type => servicelogEnum[type]
+    },
+    {
+      dataIndex: 'date',
+      title: '服务日期',
+      width: '10%',
+      valueType: 'date'
+    },
+    {
+      dataIndex: 'mark',
+      width: '50%',
+      title: '服务内容'
+    }
+  ]
+  const businessColumns = [
+    {
+      dataIndex: 'name',
+      title: '商机名称',
+      width: '10%'
+    },
+    {
+      dataIndex: 'status',
+      title: '服务类型',
+      width: '10%',
+      render: type => servicelogEnum[type]
+    },
+    {
+      dataIndex: 'date',
+      title: '服务日期',
+      width: '10%',
+      valueType: 'date'
+    },
+    {
+      dataIndex: 'mark',
+      width: '50%',
+      title: '服务内容'
+    }
+  ]
+
+  const dataMap = {
+    0: {
+      key: 'client',
+      columns: clientColumns
+    },
+    1: {
+      key: 'customer',
+      columns: customerColumns
+    },
+    2: {
+      key: 'business',
+      columns: businessColumns
+    }
+  }
 
   return (
     <ProTable
@@ -74,7 +147,7 @@ const ServiceRatioPanels = ({ cyclical, dataPermission }) => {
       rowKey={record => record.id}
       scroll={{ y: 400 }}
       border={true}
-      columns={columns}
+      columns={dataMap[dataType].columns}
       search={false}
       toolbar={{
         settings: false,