Skip to content

Commit

Permalink
1.项目管理 周报 费用换位置。
Browse files Browse the repository at this point in the history
2.市场管理客户管理联系人展示方式修改。
3.市场管理客户管理变软删除。
4.客户管理,标签要有部门和职位信息比如(卡部主管)。
5.待办数量标红。
  • Loading branch information
zouhaitaoGit committed Nov 3, 2023
1 parent ff079e3 commit 5997cbb
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 59 deletions.
9 changes: 6 additions & 3 deletions pm-resource-server/src/graphql/resolvers/markets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ export default {
Query: {
marketsBySuper: (_: any, __: any, context: AuthContext) => {
return Market
.find()
.find({ isDel: false })
.sort({ createDate: -1 })
.map(dbid2id).toArray()
},
markets: (_: any, __: any, context: AuthContext) => {
return Market
.find({ leader: context.user!.id })
.find({ leader: context.user!.id, isDel: false })
.sort({ createDate: -1 })
.map(dbid2id).toArray()
},
Expand All @@ -26,8 +26,10 @@ export default {
let repeat = await Market.findOne({ $or: [ { _id: new ObjectId(id) }, { _id: id }] })
if (isNil(repeat)) {
market.createDate = moment().utc().utcOffset(8 * 60).format('YYYYMMDD')
market.isDel = false
} else {
market.createDate = repeat.createDate
market.isDel = repeat.isDel
}
let isRep = false;
let proMap = {};
Expand All @@ -40,7 +42,8 @@ export default {
return Market.updateOne({ $or: [ {_id: new ObjectId(id) }, { _id: id }] }, { $set: market }, { upsert: true }).then((res) => id || res.upsertedId._id)
},
deleteMarket: async (_: any, args: any, context: AuthContext) => {
return Market.deleteOne({ $or: [ {_id: new ObjectId(args.id) }, { _id: args.id }] }).then(() => args.id)
const id = args.id
return Market.updateOne({ $or: [{_id: new ObjectId(id) }, { _id: id }] }, { $set: { isDel: true } }, { upsert: true }).then((res) => args.id || res.upsertedId._id)
},
},
}
4 changes: 4 additions & 0 deletions pm-resource-server/src/mongodb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,10 @@ export interface IMarket {
* 更新时间
*/
updateTime?: Date
/**
* 是否删除
*/
isDel: Boolean
}

export const Market = client.db().collection<IMarket>(pluralize('Market'))
Expand Down
12 changes: 6 additions & 6 deletions pm-web-app/config/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,18 @@
component: './Daily/View/ByProj',
access: 'canProjDailies'
},
{
path: '/project/projExpense',
name: 'projExpense',
component: './Expense/View/ByProj',
access: 'canProjExpense'
},
{
path: '/project/projWeeklies',
name: 'projWeeklies',
component: './Weekly/View/ByProj',
access: 'canProjWeeklies'
},
{
path: '/project/projExpense',
name: 'projExpense',
component: './Expense/View/ByProj',
access: 'canProjExpense'
},
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export default (form: FormInstance<CustomerInput>, data?: CustomerInput) => {
key="tags"
name={[field.name, 'tags']}
rules={[{ required: true }]}
extra="请包括部门和职位信息,例:卡部主管"
>
<Select
mode="tags"
Expand Down
88 changes: 50 additions & 38 deletions pm-web-app/src/pages/Market/Edit/EditCustom/MarketForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,44 +75,56 @@ export default (form: FormInstance<MarketInput>, data?: MarketInput) => {
{fields.map((field, i) => (
<div key={field.key} style={{ textAlign: 'center' }}>
<Divider>联系人 {i + 1}</Divider>
<Form.Item
labelCol={{ span: 3, offset: 0 }}
key="name"
label="姓名"
name={[field.name, 'name']}
rules={[{ required: true }]}
>
<Input />
</Form.Item>
<Form.Item
labelCol={{ span: 3, offset: 0 }}
key="phone"
label="电话"
name={[field.name, 'phone']}
rules={[{ required: true }]}
>
<Input />
</Form.Item>
<Form.Item
labelCol={{ span: 3, offset: 0 }}
key="duties"
label="职务"
name={[field.name, 'duties']}
>
<Select
mode="tags"
style={{ width: '100%' }}
placeholder="输入职务"
/>
</Form.Item>
<Form.Item
labelCol={{ span: 3, offset: 0 }}
key="remark"
label="备注"
name={[field.name, 'remark']}
>
<Input />
</Form.Item>
<Row>
<Col span={6}>
<Form.Item
labelCol={{ span: 12, offset: 0 }}
key="name"
label="姓名"
name={[field.name, 'name']}
rules={[{ required: true }]}
>
<Input />
</Form.Item>
</Col>
<Col span={6}>
<Form.Item
key="phone"
label="电话"
name={[field.name, 'phone']}
rules={[{ required: true }]}
>
<Input />
</Form.Item>
</Col>
<Col span={10}>
<Form.Item
key="duties"
label="职务"
name={[field.name, 'duties']}
rules={[{ required: true }]}
extra="请包括部门和职位信息,例:卡部主管"
>
<Select
mode="tags"
style={{ width: '100%' }}
placeholder="输入职务"
/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
labelCol={{ span: 3, offset: 0 }}
key="remark"
label="备注"
name={[field.name, 'remark']}
>
<Input style={{ width: '100%' }}/>
</Form.Item>
</Col>
</Row>
<MinusCircleOutlined
className="dynamic-delete-button"
onClick={() => remove(i)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,15 @@ export default (form: FormInstance<MarketProjectInput>, data?: MarketProjectInpu
<Form.ErrorList errors={errors} />
</Form.Item>
<div style={{ maxHeight: '45vh', overflowY: 'auto' }}>
<Row>
{[...fields].reverse().map((field, i) => (
<Col span={6} key={field.key} style={{ textAlign: 'left' }}>
<div key={field.key} style={{ textAlign: 'left' }}>
<Divider>拜访记录 {field.name + 1}</Divider>
<Row>
<Col xs={24} sm={24}>
<Row>
<Col span={24}>
<Form.Item
labelCol={{ span: 0, offset: 0 }}
labelCol={{ span: 5, offset: 0 }}
key="date"
label="时间"
name={[field.name, 'date']}
Expand All @@ -141,7 +140,7 @@ export default (form: FormInstance<MarketProjectInput>, data?: MarketProjectInpu
<Row>
<Col span={24}>
<Form.Item
labelCol={{ span: 0, offset: 0 }}
labelCol={{ span: 5, offset: 0 }}
key="content"
label="内容"
name={[field.name, 'content']}
Expand All @@ -159,9 +158,8 @@ export default (form: FormInstance<MarketProjectInput>, data?: MarketProjectInpu
onClick={() => remove(field.name)}
/>
</div>
</Col>
</div>
))}
</Row>
</div>
</>
)}
Expand Down
5 changes: 2 additions & 3 deletions pm-web-app/src/pages/Market/Edit/EditCustom/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PageContainer } from '@ant-design/pro-layout';
import React, { useRef, useState } from 'react';
import { Button, Table, Popconfirm, Tag, Select, Space, DatePicker, Input } from 'antd';
import type { Market as Mark, MarketInput, MarketProject, MarketProjectInput, MarketProjectVisit } from '@/apollo';
import { Button, Table, Popconfirm, Tag, Select, Space } from 'antd';
import type { Market as Mark, MarketInput, MarketProject, MarketProjectInput } from '@/apollo';
import { client } from '@/apollo';
import { ApolloProvider } from '@apollo/client';
import moment from 'moment';
Expand All @@ -22,7 +22,6 @@ const Market: React.FC<any> = () => {
const { isAdmin, markets, subordinates, groupsUsers, loading, setFilter, deleteMarket, pushMarket } = useProjStatus();
const [editeMarket, setEditeMarket] = useState({});
const [editeIndex, setEditeIndex] = useState(0);
const refMap = useRef([])

const editHandle = (mark: Mark) => {
ref.current?.showDialog({ ...mark });
Expand Down
8 changes: 6 additions & 2 deletions pm-web-app/src/pages/Project/Edit/EditProj/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PageContainer } from '@ant-design/pro-layout';
import React, { useRef, useState } from 'react';
import { Button, Table, Popconfirm, Tag, Input, Space, Radio } from 'antd';
import { Button, Table, Popconfirm, Tag, Input, Space, Radio, Badge } from 'antd';
import type { Project as Proj, ProjectInput, ActiveInput } from '@/apollo';
import { client } from '@/apollo';
import { ApolloProvider } from '@apollo/client';
Expand Down Expand Up @@ -277,7 +277,11 @@ const Project: React.FC<any> = () => {
{isAdmin?
<Radio.Button value="1">归档项目</Radio.Button>
:
<Radio.Button value="2">待办项目({todoProjs.length})</Radio.Button>
<Radio.Button value="2">
<Badge count={todoProjs.length}>
待办项目
</Badge>
</Radio.Button>
}
</Radio.Group>
,
Expand Down
Binary file modified pm-web-mobile/src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pm-web-mobile/src/views/project/ProjectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<script setup lang="ts">
import { reactive, ref, computed } from 'vue';
import { buildProjName } from '@/utils';
import logo from '@/assets/logo.jpg';
import logo from '@/assets/logo.png';
import moment from 'moment';
import { useProjectState } from './hook';
import ProjectInfo from '@/components/ProjectInfo.vue';
Expand Down

0 comments on commit 5997cbb

Please sign in to comment.