diff --git a/README.md b/README.md index a1840d5..a105bb5 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,41 @@ vue-admin-vben 39: /home/web/qingdao-order-erp/dist 47: /order-erp/dist + +# 权限整理 + +### 管理员 + +所有按钮权限,所有订单列表展示,所有订单字段编辑 + +### 总监 + +读:基本信息,跟单,质检 + +写:没有权限 + +导出: 基本信息,跟单,质检 + +### 跟单员(只有自己订单) + +读:基本信息,利润分析(只有单价美元,客户单价,客户总价),跟单,质检 + +写:基本信息,跟单 + +导出:基本信息,利润分析(只有单价美元,客户单价,客户总价),跟单,质检 + +### 质检员(所有人订单) + +读:基本信息,跟单,质检 + +写:质检 + +导出:无导出权限 + +### 业务员(只有自己订单) + +读:所有列 + +写:利润分析,项目报告书 + +导出:基本信息,利润分析,跟单,质检 diff --git a/src/views/project/account/account.data.tsx b/src/views/project/account/account.data.tsx index 45e6105..f95d641 100644 --- a/src/views/project/account/account.data.tsx +++ b/src/views/project/account/account.data.tsx @@ -5,7 +5,7 @@ export const columns: BasicColumn[] = [ { title: '手机号', dataIndex: 'phone', - width: 120, + width: 200, }, { title: '昵称', diff --git a/src/views/project/order/ExportModal.vue b/src/views/project/order/ExportModal.vue index 3c3d1e0..28c11ef 100644 --- a/src/views/project/order/ExportModal.vue +++ b/src/views/project/order/ExportModal.vue @@ -67,6 +67,22 @@ }); const options = computed(() => { + // 运营总监-基本信息,跟单,质检 + if (props.role === ROLE.DATA_REPORT_USER) { + return [ + { label: '基本信息', value: 'baseFields' }, + { label: '跟单信息', value: 'trackStageFields' }, + { label: '质检信息', value: 'inspectionStageFields' }, + ]; + } + if (props.role === ROLE.BUSINESS) { + return [ + { label: '基本信息', value: 'baseFields' }, + { label: '利润分析', value: 'profitAnalysisFields' }, + { label: '跟单信息', value: 'trackStageFields' }, + { label: '质检信息', value: 'inspectionStageFields' }, + ]; + } if (props.role === ROLE.TRACKER) { return [ { label: '基本信息', value: 'baseFields' }, @@ -75,20 +91,19 @@ { label: '质检信息', value: 'inspectionStageFields' }, ]; } - if (props.role === ROLE.INSPECT) { + + if (props.role === ROLE.ADMIN) { return [ { label: '基本信息', value: 'baseFields' }, + { label: '项目报告', value: 'reportFields' }, + { label: '利润分析', value: 'profitAnalysisFields' }, { label: '跟单信息', value: 'trackStageFields' }, { label: '质检信息', value: 'inspectionStageFields' }, ]; } - return [ - { label: '基本信息', value: 'baseFields' }, - { label: '项目报告', value: 'reportFields' }, - { label: '利润分析', value: 'profitAnalysisFields' }, - { label: '跟单信息', value: 'trackStageFields' }, - { label: '质检信息', value: 'inspectionStageFields' }, - ]; + + // 质检不能导出任何 + return []; }); function handleShow(visible: boolean) { @@ -117,9 +132,8 @@ .filter((k) => [ 'customerPrice', - 'customerRmbPrice', - 'customerTotalPrice', - 'customerRmbTotalPrice', + 'productionDepartmentPrice', + 'productionDepartmentTotalPrice', ].includes(k.dataIndex), ) .map((item) => ({ diff --git a/src/views/project/order/index.vue b/src/views/project/order/index.vue index 7093147..e4c2624 100644 --- a/src/views/project/order/index.vue +++ b/src/views/project/order/index.vue @@ -85,14 +85,17 @@ <a-button type="primary" @click="handleRateModal" v-if="role === ROLE.ADMIN" >比重计算</a-button > - <a-button type="primary" @click="handleExportModal">导出</a-button> + <!-- 质检角色不能导出任何信息 --> + <a-button type="primary" @click="handleExportModal" v-if="role !== ROLE.INSPECT" + >导出</a-button + > <a-button type="primary" @click="handleProfitModal" v-if="role === ROLE.ADMIN" >分析利润</a-button > <a-button type="primary" @click="handleAdd" - v-if="role === ROLE.ADMIN || role === ROLE.BUSINESS || role === ROLE.TRACKER" + v-if="role === ROLE.ADMIN || role === ROLE.TRACKER" >创建订单</a-button > </template> diff --git a/src/views/project/order/tableData.tsx b/src/views/project/order/tableData.tsx index 456bcc1..6701926 100644 --- a/src/views/project/order/tableData.tsx +++ b/src/views/project/order/tableData.tsx @@ -610,7 +610,7 @@ const ORDER_LIST_SCHEDULE = [ // 订单列表,也就是读权限 export function getOrderColumns(role: ROLE) { // 管理员/业务员看到所有列 - if (role === ROLE.ADMIN || role === ROLE.BUSINESS) { + if (role === ROLE.ADMIN) { return [ ...ORDER_LIST_BASE_FIELDS, ...ORDER_LIST_PROFIT_FIELDS, @@ -620,13 +620,28 @@ export function getOrderColumns(role: ROLE) { ...ORDER_LIST_SCHEDULE, ]; } - // 跟单 -基本信息-利润分析(单价,总价),跟单,质检 + //业务员看到-基本,项目报告书,利润分析,跟单信息,质检 + if (role === ROLE.BUSINESS) { + return [ + ...ORDER_LIST_BASE_FIELDS, + ...ORDER_LIST_PROFIT_FIELDS, + ...ORDER_LIST_REPORT_FIELDS, + ...ORDER_LIST_TRACK_FIELDS, + ...ORDER_LIST_INSPECT_FIELDS, + ...ORDER_LIST_SCHEDULE, + ]; + } + + // 跟单 -基本信息-利润分析(单价美元,生产科单价,生产科总价),跟单,质检 if (role === ROLE.TRACKER) { return [ ...ORDER_LIST_BASE_FIELDS, ...ORDER_LIST_PROFIT_FIELDS.map((item) => { const children = item.children.filter( - (k) => k.dataIndex === 'customerPrice' || k.dataIndex === 'customerTotalPrice', + (k) => + k.dataIndex === 'customerPrice' || + k.dataIndex === 'productionDepartmentPrice' || + k.dataIndex === 'productionDepartmentTotalPrice', ); item.children = children; @@ -639,7 +654,17 @@ export function getOrderColumns(role: ROLE) { } // 质检-基本,跟单,质检 - if (role === ROLE.INSPECT || role === ROLE.DATA_REPORT_USER) { + if (role === ROLE.INSPECT) { + return [ + ...ORDER_LIST_BASE_FIELDS, + ...ORDER_LIST_TRACK_FIELDS, + ...ORDER_LIST_INSPECT_FIELDS, + ...ORDER_LIST_SCHEDULE, + ]; + } + + // 运营总监-基本,跟单,质检 + if (role === ROLE.DATA_REPORT_USER) { return [ ...ORDER_LIST_BASE_FIELDS, ...ORDER_LIST_TRACK_FIELDS,