|
@@ -8,6 +8,7 @@ import { KuIsTreeType } from '@/pages/D_storeManage/D4impStor/type'
|
|
import { baseURL } from './http'
|
|
import { baseURL } from './http'
|
|
import { cascaderArr } from '@/pages/C_goodsManage/C1register/AddGoods/data'
|
|
import { cascaderArr } from '@/pages/C_goodsManage/C1register/AddGoods/data'
|
|
import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
|
|
import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
|
|
|
|
+// import dd from 'gdt-jsapi'
|
|
const history = createHashHistory()
|
|
const history = createHashHistory()
|
|
export default history
|
|
export default history
|
|
|
|
|
|
@@ -18,6 +19,10 @@ export const openGoodsInfoFu = (id: number, src?: string) => {
|
|
|
|
|
|
history.push(src ? (src + id).replace('#', '') : `/goodsLook/${id}`)
|
|
history.push(src ? (src + id).replace('#', '') : `/goodsLook/${id}`)
|
|
|
|
|
|
|
|
+ // dd.openLink({
|
|
|
|
+ // url: 'https://sit-yiwubwg.4dage.com/abcd/index.html#/business'
|
|
|
|
+ // })
|
|
|
|
+
|
|
// window.open(src ? urlQian + src + id : `${urlQian}#/goodsLook/${id}`, '_blank')
|
|
// window.open(src ? urlQian + src + id : `${urlQian}#/goodsLook/${id}`, '_blank')
|
|
}
|
|
}
|
|
|
|
|
|
@@ -105,7 +110,12 @@ export const buMenRes = (list: any[]) => {
|
|
export type btnFlagTxtType = '查看' | '编辑' | '删除' | '审批' | '盘点'
|
|
export type btnFlagTxtType = '查看' | '编辑' | '删除' | '审批' | '盘点'
|
|
export const btnFlagFu = (item: FourTableType) => {
|
|
export const btnFlagFu = (item: FourTableType) => {
|
|
//申请单状态 申请人id 当前节点审批人 历史审批人 抄送人
|
|
//申请单状态 申请人id 当前节点审批人 历史审批人 抄送人
|
|
- const { status, creatorId, currentAuditUserIds, auditUserIds, copyUserIds } = item
|
|
|
|
|
|
+ const {
|
|
|
|
+ status,
|
|
|
|
+ creatorId,
|
|
|
|
+ currentAuditUserIds
|
|
|
|
+ // auditUserIds, copyUserIds
|
|
|
|
+ } = item
|
|
|
|
|
|
let flagObj: { [K in btnFlagTxtType]: boolean } = {
|
|
let flagObj: { [K in btnFlagTxtType]: boolean } = {
|
|
查看: false,
|
|
查看: false,
|
|
@@ -120,9 +130,9 @@ export const btnFlagFu = (item: FourTableType) => {
|
|
// 当前节点审批人
|
|
// 当前节点审批人
|
|
const arr3 = (currentAuditUserIds || '').split(',').map(v => Number(v))
|
|
const arr3 = (currentAuditUserIds || '').split(',').map(v => Number(v))
|
|
// 历史审批人
|
|
// 历史审批人
|
|
- const arr4 = (auditUserIds || '').split(',').map(v => Number(v))
|
|
|
|
- // 抄送人
|
|
|
|
- const arr5 = (copyUserIds || '').split(',').map(v => Number(v))
|
|
|
|
|
|
+ // const arr4 = (auditUserIds || '').split(',').map(v => Number(v))
|
|
|
|
+ // // 抄送人
|
|
|
|
+ // const arr5 = (copyUserIds || '').split(',').map(v => Number(v))
|
|
|
|
|
|
const obj = {
|
|
const obj = {
|
|
1: () => {
|
|
1: () => {
|
|
@@ -138,37 +148,43 @@ export const btnFlagFu = (item: FourTableType) => {
|
|
2: () => {
|
|
2: () => {
|
|
//待审批
|
|
//待审批
|
|
// 申请人是我自己 =》查看
|
|
// 申请人是我自己 =》查看
|
|
- if (myId === creatorId) flagObj['查看'] = true
|
|
|
|
- // 历史审批人有我 =》查看
|
|
|
|
- if (arr4.includes(myId)) flagObj['查看'] = true
|
|
|
|
|
|
+ // if (myId === creatorId) flagObj['查看'] = true
|
|
|
|
+ // // 历史审批人有我 =》查看
|
|
|
|
+ // if (arr4.includes(myId)) flagObj['查看'] = true
|
|
|
|
+ // // 抄送人有我 =》查看
|
|
|
|
+ // if (arr5.includes(myId)) flagObj['查看'] = true
|
|
// 当前审批人有我 =》审批
|
|
// 当前审批人有我 =》审批
|
|
if (arr3.includes(myId)) flagObj['审批'] = true
|
|
if (arr3.includes(myId)) flagObj['审批'] = true
|
|
- // 抄送人有我 =》查看
|
|
|
|
- if (arr5.includes(myId)) flagObj['查看'] = true
|
|
|
|
|
|
+
|
|
|
|
+ flagObj['查看'] = true
|
|
},
|
|
},
|
|
3: () => {
|
|
3: () => {
|
|
//审批不通过
|
|
//审批不通过
|
|
// 申请人是我自己 =》查看
|
|
// 申请人是我自己 =》查看
|
|
- if (myId === creatorId) flagObj['查看'] = true
|
|
|
|
- // 历史审批人有我 =》查看
|
|
|
|
- if (arr4.includes(myId)) flagObj['查看'] = true
|
|
|
|
- // 抄送人有我 =》查看
|
|
|
|
- if (arr5.includes(myId)) flagObj['查看'] = true
|
|
|
|
|
|
+ // if (myId === creatorId) flagObj['查看'] = true
|
|
|
|
+ // // 历史审批人有我 =》查看
|
|
|
|
+ // if (arr4.includes(myId)) flagObj['查看'] = true
|
|
|
|
+ // // 抄送人有我 =》查看
|
|
|
|
+ // if (arr5.includes(myId)) flagObj['查看'] = true
|
|
|
|
+
|
|
|
|
+ flagObj['查看'] = true
|
|
},
|
|
},
|
|
4: () => {
|
|
4: () => {
|
|
//已完成
|
|
//已完成
|
|
// 申请人是我自己 =》查看
|
|
// 申请人是我自己 =》查看
|
|
- if (myId === creatorId) flagObj['查看'] = true
|
|
|
|
- // 历史审批人有我 =》查看
|
|
|
|
- if (arr4.includes(myId)) flagObj['查看'] = true
|
|
|
|
- // 抄送人有我 =》查看
|
|
|
|
- if (arr5.includes(myId)) flagObj['查看'] = true
|
|
|
|
- },
|
|
|
|
- 5: () => {
|
|
|
|
- //待盘点
|
|
|
|
- // 申请人是我自己 =》查看 编辑 盘点
|
|
|
|
- if (myId === creatorId) flagObj['查看'] = flagObj['编辑'] = flagObj['盘点'] = true
|
|
|
|
|
|
+ // if (myId === creatorId) flagObj['查看'] = true
|
|
|
|
+ // // 历史审批人有我 =》查看
|
|
|
|
+ // if (arr4.includes(myId)) flagObj['查看'] = true
|
|
|
|
+ // // 抄送人有我 =》查看
|
|
|
|
+ // if (arr5.includes(myId)) flagObj['查看'] = true
|
|
|
|
+
|
|
|
|
+ flagObj['查看'] = true
|
|
}
|
|
}
|
|
|
|
+ // 5: () => {
|
|
|
|
+ // //待盘点
|
|
|
|
+ // // 申请人是我自己 =》查看 编辑 盘点
|
|
|
|
+ // if (myId === creatorId) flagObj['查看'] = flagObj['编辑'] = flagObj['盘点'] = true
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
if (Reflect.get(obj, status)) Reflect.get(obj, status)()
|
|
if (Reflect.get(obj, status)) Reflect.get(obj, status)()
|
|
|
|
|