Merge pull request 'master' (#399) from master into prod

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/399
This commit is contained in:
2024-06-26 14:53:15 +00:00
5 changed files with 119 additions and 20 deletions

View File

@@ -185,3 +185,17 @@ export const unbindAllUserByPost = (postId) => {
} }
}) })
} }
export const bindAccount=(data)=>{
return request({
url: '/admin/mosr/user/bind/account',
method: 'post',
data
})
}
export const getBindAccount=(userId)=>{
return request({
url: `/admin/mosr/user/bind/account/info/${userId}`,
method: 'get'
})
}

View File

@@ -49,6 +49,7 @@
<script setup lang="jsx"> <script setup lang="jsx">
import {getResearchUser, getAllocationDetails} from "@/api/expense-manage"; import {getResearchUser, getAllocationDetails} from "@/api/expense-manage";
import {exportExcel} from "@/utils/export-excel"; import {exportExcel} from "@/utils/export-excel";
import {ElNotification} from "element-plus";
const route = useRoute() const route = useRoute()
const tableIns = ref() const tableIns = ref()
@@ -159,6 +160,13 @@ const concatColumn = (columnIndex, length, rowIndex) => {
const init = () => { const init = () => {
loading.value = true loading.value = true
getAllocationDetails(route.query.id).then(res => { getAllocationDetails(route.query.id).then(res => {
if(res.code!==1000){
ElNotification({
title: '提示',
message: res.msg,
type: 'error'
})
}
columnInfo.value = res.data.columns columnInfo.value = res.data.columns
let tableDataLet = res.data.tableData; let tableDataLet = res.data.tableData;
let personInfoKey = [] let personInfoKey = []

View File

@@ -160,17 +160,17 @@ import UserPicker from "@/views/workflow/process/common/UserPicker.vue";
const userList = ref([]) const userList = ref([])
const changeDiagram = ref(false) const changeDiagram = ref(false)
const rules = reactive({ const rules = reactive({
shareName: [{required: true, message: '请输入分摊名称', trigger: ['blur', 'change']}], shareName: [{required: true, message: '请输入分摊名称', trigger: ['blur', 'change']}],
apportionmentMonth: [{required: true, message: '请选择月份', trigger: ['blur', 'change']}], apportionmentMonth: [{required: true, message: '请选择月份', trigger: ['blur', 'change']}],
projectId: [{required: true, message: '请选择项目名称', trigger: ['blur', 'change']}], projectId: [{required: true, message: '请选择项目名称', trigger: ['blur', 'change']}],
// researchPersonnel: [{required: true, message: '请选择研发人员', trigger: ['blur', 'change']}], // researchPersonnel: [{required: true, message: '请选择研发人员', trigger: ['blur', 'change']}],
wagesPayable: [{required: true, message: '请输入应发工资', trigger: ['blur', 'change']}], wagesPayable: [{required: true, message: '请输入应发工资', trigger: ['blur', 'change']}],
performance: [{required: true, message: '请输入绩效', trigger: ['blur', 'change']}], performance: [{required: true, message: '请输入绩效', trigger: ['blur', 'change']}],
reserveFund: [{required: true, message: '请输入公积金', trigger: ['blur', 'change']}], reserveFund: [{required: true, message: '请输入公积金', trigger: ['blur', 'change']}],
socialSecurity: [{required: true, message: '请输入社保', trigger: ['blur', 'change']}], socialSecurity: [{required: true, message: '请输入社保', trigger: ['blur', 'change']}],
annuity: [{required: true, message: '请输入年金', trigger: ['blur', 'change']}], annuity: [{required: true, message: '请输入年金', trigger: ['blur', 'change']}],
workday: [{required: true, message: '请输入工作日', trigger: ['blur', 'change']}], workday: [{required: true, message: '请输入工作日', trigger: ['blur', 'change']}],
researchDuration: [{required: true, message: '请输入研发时长', trigger: ['blur', 'change']}], researchDuration: [{required: true, message: '请输入研发时长', trigger: ['blur', 'change']}],
}) })
const processStore = useProcessStore() const processStore = useProcessStore()
const opentionData = ref() const opentionData = ref()
@@ -243,6 +243,7 @@ const handleAdd = () => {
projectId: '', projectId: '',
projectName: '', projectName: '',
researchPersonnel: '', researchPersonnel: '',
researchPersonnelName: '',
wagesPayable: null, wagesPayable: null,
performance: null, performance: null,
reserveFund: null, reserveFund: null,
@@ -251,6 +252,7 @@ const handleAdd = () => {
workday: '21.75', workday: '21.75',
researchDuration: null, researchDuration: null,
} }
currentReachPerson.value.name=''
formData.value.tableData.push(row) formData.value.tableData.push(row)
} }
const handleCopy = (row) => { const handleCopy = (row) => {
@@ -281,19 +283,29 @@ const handleSubmit = (instance) => {
type: 'error' type: 'error'
}) })
} }
let researchPersonnel = ''
formData.value.tableData.forEach(item => { formData.value.tableData.forEach(item => {
item.projectName = getProjectName(item.projectId) item.projectName = getProjectName(item.projectId)
researchPersonnel = item.researchPersonnel
if (item.performance == 0) { if (item.performance == 0) {
item.performance = null item.performance = null
} }
}) })
if (!researchPersonnel) {
ElNotification({
title: '提示',
message: '请选择研发人员',
type: 'error'
})
return;
}
let params = { let params = {
shareName: formData.value.shareName, shareName: formData.value.shareName,
apportionmentMonth: formData.value.apportionmentMonth, apportionmentMonth: formData.value.apportionmentMonth,
usrAllocations: formData.value.tableData, usrAllocations: formData.value.tableData,
deploymentId: processInstanceData.value.deploymentId, deploymentId: processInstanceData.value.deploymentId,
} }
// console.log('params', params, formData.value.tableData) console.log('params', params, formData.value.tableData)
const {code, msg} = await addAllocation(params) const {code, msg} = await addAllocation(params)
ElNotification({ ElNotification({
title: '提示', title: '提示',
@@ -318,17 +330,19 @@ const handleResubmit = (instance) => {
type: 'error' type: 'error'
}) })
} }
let newUsrAllocationsObj={} let newUsrAllocationsObj = {}
let newUsrAllocationsObjArray=[] let newUsrAllocationsObjArray = []
let researchPersonnel = ''
formData.value.tableData.forEach(item => { formData.value.tableData.forEach(item => {
item.allocationId = formData.value.allocationId item.allocationId = formData.value.allocationId
item.projectName = getProjectName(item.projectId) item.projectName = getProjectName(item.projectId)
researchPersonnel = item.researchPersonnel
if (item.performance == 0) { if (item.performance == 0) {
item.performance = null item.performance = null
} }
newUsrAllocationsObj={ newUsrAllocationsObj = {
projectId: item.projectId, projectId: item.projectId,
projectName:item.projectName, projectName: item.projectName,
researchPersonnel: item.researchPersonnel, researchPersonnel: item.researchPersonnel,
wagesPayable: item.wagesPayable, wagesPayable: item.wagesPayable,
performance: item.performance, performance: item.performance,
@@ -340,6 +354,14 @@ const handleResubmit = (instance) => {
} }
newUsrAllocationsObjArray.push(newUsrAllocationsObj) newUsrAllocationsObjArray.push(newUsrAllocationsObj)
}) })
if (!researchPersonnel) {
ElNotification({
title: '提示',
message: '请选择研发人员',
type: 'error'
})
return;
}
let params = { let params = {
allocationId: formData.value.allocationId, allocationId: formData.value.allocationId,
shareName: formData.value.shareName, shareName: formData.value.shareName,

View File

@@ -1,14 +1,16 @@
<template> <template>
<fvSearchForm ref="form" :searchConfig="searchConfig" @search="search"></fvSearchForm> <fvSearchForm ref="form" :searchConfig="searchConfig" @search="search"></fvSearchForm>
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick"></fvTable> <fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick"></fvTable>
<user-picker :multiple="true" ref="userPicker" title="请选择研发人员" v-model:value="userList" @ok="selected"/>
</template> </template>
<script setup lang="jsx"> <script setup lang="jsx">
import Tag from '@/components/Tag.vue' import Tag from '@/components/Tag.vue'
import fvSelect from '@/fvcomponents/fvSelect/index.vue' import fvSelect from '@/fvcomponents/fvSelect/index.vue'
import UserPicker from "@/views/workflow/process/common/UserPicker.vue";
import { useAuthStore } from '@/stores/userstore.js' import { useAuthStore } from '@/stores/userstore.js'
import { getDeptOpt, getSubCompOpt } from '../../../api/user/user.js'; import { getDeptOpt, getSubCompOpt,bindAccount,getBindAccount } from '@/api/user/user.js';
import { ElMessageBox } from 'element-plus'; import {ElMessageBox, ElNotification} from 'element-plus';
const authStore = useAuthStore() const authStore = useAuthStore()
const router = useRouter() const router = useRouter()
@@ -75,11 +77,14 @@ const searchConfig = ref([
]) ])
const tableIns = ref() const tableIns = ref()
const currentId = ref('')
const userList = ref([])
const userPicker = ref()
const auths = { const auths = {
edit: ['admin:user:edit'], edit: ['admin:user:edit'],
del: ['admin:user:del'], del: ['admin:user:del'],
add: ['admin:user:add'], add: ['admin:user:add'],
bindUser: ['admin:bind:account'],
} }
const tableConfig = reactive({ const tableConfig = reactive({
@@ -118,12 +123,14 @@ const tableConfig = reactive({
prop: 'accountType', prop: 'accountType',
label: '主子账号', label: '主子账号',
align: 'center', align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => (<Tag dictType={'account_type'} value={row.accountType} />) currentRender: ({row, index}) => (<Tag dictType={'account_type'} value={row.accountType} />)
}, },
{ {
prop: 'state', prop: 'state',
label: '状态', label: '状态',
align: 'center', align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => (<Tag dictType={'normal_disable'} value={row.state} />) currentRender: ({row, index}) => (<Tag dictType={'normal_disable'} value={row.state} />)
}, },
{ {
@@ -137,6 +144,7 @@ const tableConfig = reactive({
fixed: 'right', fixed: 'right',
width: '150', width: '150',
align: 'center', align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => { currentRender: ({row, index}) => {
return ( return (
<div> <div>
@@ -146,7 +154,11 @@ const tableConfig = reactive({
<el-button type="danger" v-perm={auths.del} link onClick={()=>handleDel(row)}>删除</el-button> : <el-button type="danger" v-perm={auths.del} link onClick={()=>handleDel(row)}>删除</el-button> :
null null
} }
{
row.accountType == 0 ?
<el-button type="primary" v-perm={auths.bindUser} link onClick={()=>handleBindAccount(row)}>绑定账号</el-button> :
null
}
</div> </div>
) )
} }
@@ -207,7 +219,46 @@ const handleDel = (row) => {
// const { code } = await // const { code } = await
}).catch(()=>{}) }).catch(()=>{})
} }
const handleBindAccount=(row)=>{
currentId.value = row.userId
getBindAccount(row.userId).then(res=>{
if(res.code != 1000){
ElNotification({
title: '提示',
message: res.msg,
type: 'error'
})
}else {
userList.value = res.data
nextTick(()=>{
userPicker.value.showUserPicker()
})
}
})
}
const selected = (select) => {
let userInfoList = []
for (let val of select) {
let userInfo = {
id: val.id,
name: val.name
}
userInfoList.push(userInfo)
}
userList.value = userInfoList
let ids=userList.value.map(item=>item.id)
let params={
id:currentId.value,
ids:ids
}
bindAccount(params).then(res=>{
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
})
}
const headBtnClick = (key) => { const headBtnClick = (key) => {
switch(key) { switch(key) {
case 'add': handleAdd() case 'add': handleAdd()

View File

@@ -192,8 +192,12 @@ const showUserPicker = () => {
value: "0" value: "0"
}; };
dataList.value = []; dataList.value = [];
console.log('_value.value',_value.value)
if(props.setNullToSelectList){ if(props.setNullToSelectList){
selectList.value = [] selectList.value = []
}else {
selectList.value =_value.value
} }
chooseId.value = 0; chooseId.value = 0;
radio.value = 0; radio.value = 0;