1.修改部门组件
This commit is contained in:
parent
822c5c5629
commit
ff84dff20c
2
env/.env.development
vendored
2
env/.env.development
vendored
@ -4,5 +4,5 @@ NODE_ENV = 'development'
|
|||||||
VITE_DELETE_CONSOLE = false
|
VITE_DELETE_CONSOLE = false
|
||||||
# 是否开启sourcemap
|
# 是否开启sourcemap
|
||||||
VITE_SHOW_SOURCEMAP = true
|
VITE_SHOW_SOURCEMAP = true
|
||||||
VITE_SERVER_BASEURL = 'http://10.75.15.249:8080/jeecg-boot'
|
VITE_SERVER_BASEURL = 'http://10.75.15.247:8080/jeecg-boot'
|
||||||
#VITE_SERVER_BASEURL = 'https://36.112.48.190/jeecg-boot'
|
#VITE_SERVER_BASEURL = 'https://36.112.48.190/jeecg-boot'
|
@ -66,3 +66,12 @@ export function getHisInfo(config : Object) {
|
|||||||
data: config
|
data: config
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function taskEntrust(config : Object) { //委托
|
||||||
|
return http({
|
||||||
|
url: '/act/task/taskEntrust',
|
||||||
|
method: 'PUT',
|
||||||
|
data: config
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -54,7 +54,7 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
rowKey: {
|
rowKey: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'key',
|
default: 'id',
|
||||||
},
|
},
|
||||||
labelKey: {
|
labelKey: {
|
||||||
type: String,
|
type: String,
|
||||||
@ -81,6 +81,7 @@ const confirm = () => {
|
|||||||
const titles = treeValue.value.map((item) => item.title)
|
const titles = treeValue.value.map((item) => item.title)
|
||||||
const keys = treeValue.value.map((item) => item.key).join(',')
|
const keys = treeValue.value.map((item) => item.key).join(',')
|
||||||
showText.value = titles.join(',')
|
showText.value = titles.join(',')
|
||||||
|
console.log(showText)
|
||||||
popupShow.value = false
|
popupShow.value = false
|
||||||
emit('update:modelValue', keys)
|
emit('update:modelValue', keys)
|
||||||
emit('change', keys)
|
emit('change', keys)
|
||||||
@ -114,6 +115,7 @@ const handleTreeChange = (value, record) => {
|
|||||||
const transformField = (result) => {
|
const transformField = (result) => {
|
||||||
for (let i of result) {
|
for (let i of result) {
|
||||||
i.value = i.key
|
i.value = i.key
|
||||||
|
i.name = i.title
|
||||||
if (i.isLeaf == false) {
|
if (i.isLeaf == false) {
|
||||||
i.leaf = false
|
i.leaf = false
|
||||||
} else if (i.isLeaf == true) {
|
} else if (i.isLeaf == true) {
|
||||||
@ -131,9 +133,11 @@ const asyncLoadTreeData = ({ originItem }) => {
|
|||||||
http
|
http
|
||||||
.get(api.queryDepartTreeSync, param)
|
.get(api.queryDepartTreeSync, param)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
|
console.log(res)
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
const { result } = res
|
const { result } = res
|
||||||
transformField(result)
|
transformField(result)
|
||||||
|
console.log(result)
|
||||||
resolve(result)
|
resolve(result)
|
||||||
} else {
|
} else {
|
||||||
resolve(null)
|
resolve(null)
|
||||||
@ -155,6 +159,7 @@ function loadRoot() {
|
|||||||
if (result && result.length > 0) {
|
if (result && result.length > 0) {
|
||||||
transformField(result)
|
transformField(result)
|
||||||
treeData.value = result
|
treeData.value = result
|
||||||
|
console.log(result)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.error('部门组件加载根节点数据失败~')
|
console.error('部门组件加载根节点数据失败~')
|
||||||
@ -172,14 +177,16 @@ function loadItemByCode() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
value = value.join(',')
|
value = value.join(',')
|
||||||
}
|
}
|
||||||
|
console.log(treeData)
|
||||||
if (value === treeData.value.map((item) => item.key).join(',')) {
|
if (value === treeData.value.map((item) => item.key).join(',')) {
|
||||||
// 说明是刚选完,内部已有翻译。不需要再请求
|
// 说明是刚选完,内部已有翻译。不需要再请求
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
http
|
http
|
||||||
.get(api.queryDepartTreeSync, { ids: value })
|
.get(api.queryDepartTreeSync, { ids: value,primaryKey: props.rowKey})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
console.log(res)
|
||||||
const { result = [] } = res
|
const { result = [] } = res
|
||||||
showText.value = result.map((item) => item[props.labelKey]).join(',')
|
showText.value = result.map((item) => item[props.labelKey]).join(',')
|
||||||
} else {
|
} else {
|
||||||
|
@ -23,7 +23,12 @@
|
|||||||
@search="handleSearch"
|
@search="handleSearch"
|
||||||
@clear="handleClear"
|
@clear="handleClear"
|
||||||
/>
|
/>
|
||||||
|
<!-- 添加部门选择 by 闵 -->
|
||||||
|
<view style="background-color: red;">
|
||||||
|
<SelectDept label="部门:" @change="bmChange" rowKey="orgCode" :multiple="false" v-model="dept"></SelectDept>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="multi">
|
<template v-if="multi">
|
||||||
<wd-checkbox-group shape="square" v-model="checkedValue">
|
<wd-checkbox-group shape="square" v-model="checkedValue">
|
||||||
<template v-for="(item, index) in dataList" :key="index">
|
<template v-for="(item, index) in dataList" :key="index">
|
||||||
@ -39,6 +44,7 @@
|
|||||||
<view class="subContent">
|
<view class="subContent">
|
||||||
<text>账号:{{ item.username }}</text>
|
<text>账号:{{ item.username }}</text>
|
||||||
<text>姓名:{{ item.realname }}</text>
|
<text>姓名:{{ item.realname }}</text>
|
||||||
|
<text>部门:{{ item.orgCode_dictText }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right" @click.stop>
|
<view class="right" @click.stop>
|
||||||
@ -64,6 +70,7 @@
|
|||||||
<view class="subContent">
|
<view class="subContent">
|
||||||
<text>账号:{{ item.username }}</text>
|
<text>账号:{{ item.username }}</text>
|
||||||
<text>姓名:{{ item.realname }}</text>
|
<text>姓名:{{ item.realname }}</text>
|
||||||
|
<text>部门:{{ item.orgCode_dictText }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right" @click.stop>
|
<view class="right" @click.stop>
|
||||||
@ -87,6 +94,9 @@ import { http } from '@/utils/http'
|
|||||||
import { isArray, isString } from '@/utils/is'
|
import { isArray, isString } from '@/utils/is'
|
||||||
import { cache, getFileAccessHttpUrl } from '@/common/uitls'
|
import { cache, getFileAccessHttpUrl } from '@/common/uitls'
|
||||||
import defaultAvatar from '@/static/default-avatar.png'
|
import defaultAvatar from '@/static/default-avatar.png'
|
||||||
|
import SelectDept from '@/components/SelectDept/SelectDept.vue'
|
||||||
|
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'SelectUserModal',
|
name: 'SelectUserModal',
|
||||||
options: {
|
options: {
|
||||||
@ -121,12 +131,14 @@ const paging = ref(null)
|
|||||||
const dataList = ref([])
|
const dataList = ref([])
|
||||||
const checkedValue: any = ref(props.multi ? [] : '')
|
const checkedValue: any = ref(props.multi ? [] : '')
|
||||||
const checkboxRef = ref(null)
|
const checkboxRef = ref(null)
|
||||||
|
const dept = ref('')
|
||||||
const search = reactive({
|
const search = reactive({
|
||||||
keyword: '',
|
keyword: '',
|
||||||
placeholder: '输入姓名可搜索',
|
placeholder: '输入姓名可搜索',
|
||||||
field: 'realname',
|
field: 'realname',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
emit('close')
|
emit('close')
|
||||||
@ -155,6 +167,10 @@ const handleCancel = () => {
|
|||||||
handleClose()
|
handleClose()
|
||||||
console.log('取消了~')
|
console.log('取消了~')
|
||||||
}
|
}
|
||||||
|
const bmChange = (value)=>{ //部门发生改变 by 闵
|
||||||
|
paging.value.reload()
|
||||||
|
}
|
||||||
|
|
||||||
// 搜索
|
// 搜索
|
||||||
function handleSearch() {
|
function handleSearch() {
|
||||||
paging.value.reload()
|
paging.value.reload()
|
||||||
@ -162,6 +178,7 @@ function handleSearch() {
|
|||||||
// 清除搜索条件
|
// 清除搜索条件
|
||||||
function handleClear() {
|
function handleClear() {
|
||||||
search.keyword = ''
|
search.keyword = ''
|
||||||
|
dept.value = '' //清空部门 min
|
||||||
handleSearch()
|
handleSearch()
|
||||||
}
|
}
|
||||||
const hanldeCheck = (index, username) => {
|
const hanldeCheck = (index, username) => {
|
||||||
@ -197,9 +214,13 @@ const queryList = (pageNo, pageSize) => {
|
|||||||
if (search.keyword) {
|
if (search.keyword) {
|
||||||
pararms[search.field] = `*${search.keyword}*`
|
pararms[search.field] = `*${search.keyword}*`
|
||||||
}
|
}
|
||||||
|
if(dept.value){
|
||||||
|
pararms['orgCode'] = dept.value
|
||||||
|
}
|
||||||
http
|
http
|
||||||
.get(`${api.userlist}`, pararms)
|
.get(`${api.userlist}`, pararms)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
|
console.log(res)
|
||||||
if (res.success && res.result.records) {
|
if (res.success && res.result.records) {
|
||||||
paging.value.complete(res.result.records ?? [])
|
paging.value.complete(res.result.records ?? [])
|
||||||
} else {
|
} else {
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
<wd-button>办理</wd-button>
|
<wd-button>办理</wd-button>
|
||||||
</wd-col>
|
</wd-col>
|
||||||
<wd-col :span="8">
|
<wd-col :span="8">
|
||||||
<wd-button>委托</wd-button>
|
<wd-button @click.stop="entrust(item)">委托</wd-button>
|
||||||
</wd-col>
|
</wd-col>
|
||||||
</view>
|
</view>
|
||||||
<view v-else>
|
<view v-else>
|
||||||
@ -51,6 +51,15 @@
|
|||||||
<wd-loading size="16px">正在加载...</wd-loading>
|
<wd-loading size="16px">正在加载...</wd-loading>
|
||||||
</view>
|
</view>
|
||||||
<wd-message-box></wd-message-box>
|
<wd-message-box></wd-message-box>
|
||||||
|
<wd-toast></wd-toast>
|
||||||
|
<SelectUserModal
|
||||||
|
v-if="modalShow"
|
||||||
|
:selected="user"
|
||||||
|
modalTitle="用户选择"
|
||||||
|
:multi="false"
|
||||||
|
@change="handleChange"
|
||||||
|
@close="() => (modalShow = false)"
|
||||||
|
></SelectUserModal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -65,7 +74,12 @@
|
|||||||
onReachBottom,
|
onReachBottom,
|
||||||
onPullDownRefresh
|
onPullDownRefresh
|
||||||
} from '@dcloudio/uni-app';
|
} from '@dcloudio/uni-app';
|
||||||
|
import {
|
||||||
|
taskEntrust
|
||||||
|
} from '@/api/process'
|
||||||
import { useToast, useMessage } from 'wot-design-uni'
|
import { useToast, useMessage } from 'wot-design-uni'
|
||||||
|
import SelectUserModal from '@/components/SelectUser/components/SelectUserModal.vue'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'myTask',
|
name: 'myTask',
|
||||||
options: {
|
options: {
|
||||||
@ -78,7 +92,9 @@
|
|||||||
let pageSize = 10
|
let pageSize = 10
|
||||||
let loading = false
|
let loading = false
|
||||||
const list = ref([])
|
const list = ref([])
|
||||||
|
const user = ref('')
|
||||||
|
const modalShow = ref(false)
|
||||||
|
const userTask = ref({}) //点击的流程节点
|
||||||
|
|
||||||
|
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
@ -96,6 +112,31 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const entrust = (item)=>{ //委托
|
||||||
|
modalShow.value = true;
|
||||||
|
userTask.value = {};
|
||||||
|
userTask.value = item;
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleChange = (data) => {
|
||||||
|
const rowkey = data.map((item) => item.username).join(',')
|
||||||
|
console.log(rowkey)
|
||||||
|
// var params = {
|
||||||
|
// taskId:userTask.value.id,
|
||||||
|
// taskAssignee:rowkey
|
||||||
|
// };//查询条件
|
||||||
|
// taskEntrust(params).then(res=>{
|
||||||
|
// if(res.success){
|
||||||
|
// toast.success(res.message)
|
||||||
|
// uni.redirectTo({
|
||||||
|
// url: './approvalTabbar'
|
||||||
|
// });
|
||||||
|
// }else{
|
||||||
|
// toast.error(res.message)
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
|
||||||
const goToPage = (item)=>{
|
const goToPage = (item)=>{
|
||||||
//判断是否是签收项目,提示是否签收
|
//判断是否是签收项目,提示是否签收
|
||||||
if(item.taskAssigneeName&&item.taskAssigneeName!=''){
|
if(item.taskAssigneeName&&item.taskAssigneeName!=''){
|
||||||
@ -111,10 +152,16 @@
|
|||||||
title: '确认签收吗',
|
title: '确认签收吗',
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
claim({taskId:item.id}).then(()=>{
|
claim({taskId:item.id}).then((res)=>{
|
||||||
uni.redirectTo({
|
if(res.success){
|
||||||
url: './approvalTabbar'
|
toast.success(res.message)
|
||||||
});
|
uni.redirectTo({
|
||||||
|
url: './approvalTabbar'
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
toast.error(res.message)
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -29,11 +29,11 @@
|
|||||||
<wd-steps :active="completedNum" vertical>
|
<wd-steps :active="completedNum" vertical>
|
||||||
<wd-step v-for="item in dataSource" >
|
<wd-step v-for="item in dataSource" >
|
||||||
<template #title>
|
<template #title>
|
||||||
<view class="content shadow-blur text-sm bg-green">
|
<view :class="{'content':true, 'shadow-blur':true, 'text-sm':true,'bg-green':item.endTime,'bg-gray':!item.endTime}">
|
||||||
<text>流程节点:{{item.name=='start'?'开始':item.name}}<br></text>
|
<text>流程节点:{{item.name=='start'?'开始':item.name}}<br></text>
|
||||||
<text>负责人:{{item.assigneeName}}<br></text>
|
<text>负责人:{{item.assigneeName}}<br></text>
|
||||||
<text>开始时间:{{item.startTime}}<br></text>
|
<text>开始时间:{{item.startTime}}<br></text>
|
||||||
<text>结束时间:{{item.endTime}}<br></text>
|
<text v-if="item.endTime">结束时间:{{item.endTime}}<br></text>
|
||||||
<text>{{item.deleteReason}}</text>
|
<text>{{item.deleteReason}}</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -128,7 +128,11 @@
|
|||||||
if (res.success) {
|
if (res.success) {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
dataSource.value = res.result.records
|
dataSource.value = res.result.records
|
||||||
completedNum.value = res.result.records.length-1
|
//查找最后一个,结束时间
|
||||||
|
completedNum.value = res.result.records.length
|
||||||
|
res.result.records.forEach((item,index)=>{
|
||||||
|
if(item.endTime) completedNum.value = index+1
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -171,6 +175,15 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bg-green {
|
||||||
|
background-color: #39b54a;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-gray {
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
.content{
|
.content{
|
||||||
padding: 5px 25px 5px 15px;
|
padding: 5px 25px 5px 15px;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user