浏览代码

feat: 完善商机后台

lanjianrong 4 年之前
父节点
当前提交
f32d553384
共有 2 个文件被更改,包括 17 次插入10 次删除
  1. 1 1
      src/pages/Business/Attendance/components/ShowTitleMenu.tsx
  2. 16 9
      src/pages/Business/Contact/index.tsx

+ 1 - 1
src/pages/Business/Attendance/components/ShowTitleMenu.tsx

@@ -15,7 +15,7 @@ const ShowTitleMenu: React.FC<ShowTitleMenuProps> = ({ options, onSelect, defaul
   }
   return (
     <div className="h-full w-max-234px rounded-4px shadow-card">
-      <div className="p-4 border-b-1 border-solid border-black border-opacity-10 bg-[#f7f9fa] justify-around text-left">
+      <div className="p-4 border-b-1 border-solid border-black border-opacity-10 bg-[#f7f9fa] text-left">
         <span>栏目/功能</span>
       </div>
       <div className="p-4 bg-white" style={{ height: 'calc(100% - 1rem*2 - 20px)' }}>

+ 16 - 9
src/pages/Business/Contact/index.tsx

@@ -220,19 +220,26 @@ const Contact: React.FC = () => {
         onVisibleChange={show => setState({ ...state, visible: show })}
         title={state.type === modalType.CREATE ? '创建商机角色' : '更新商机角色'}
         onFinish={async value => {
-          if (state.type === modalType.CREATE) {
-            await tryAddBusinessgroup({
-              ...value,
-              stageSettings: JSON.stringify(value.stageSettings)
-            })
-          } else {
-            await tryUpdateBusinessGroup({ ...value })
+          try {
+            if (state.type === modalType.CREATE) {
+              await tryAddBusinessgroup({
+                ...value,
+                stageSettings: JSON.stringify(value.stageSettings)
+              })
+            } else {
+              await tryUpdateBusinessGroup({
+                ...value,
+                stageSettings: JSON.stringify(value.stageSettings)
+              })
+            }
+            return true
+          } catch (error) {
+            message.error(`${state.type === modalType.CREATE ? '创建' : '更新'}失败,请重试`)
+            return false
           }
-          return true
         }}>
         <ProFormText name="name" label="组名称" required />
         <ProFormText name="id" hidden />
-        {/* <ProFormText name="department" label="应用部门" required /> */}
         <ProForm.Item name="departmentIds" label="应用部门" required>
           <TreeSelect treeData={department} multiple={true} />
         </ProForm.Item>