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