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

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/370
This commit is contained in:
2024-06-21 04:33:41 +00:00
3 changed files with 70 additions and 42 deletions

View File

@@ -10,7 +10,7 @@
<el-button @click="getList()">搜索</el-button> <el-button @click="getList()">搜索</el-button>
</template> </template>
</el-input> </el-input>
<fvCheckbox :options="checkOptions" v-model="checkList" @change="checkBoxChange"/> <fvCheckbox style="margin-left: 10px" :options="checkOptions" v-model="checkList" @change="checkBoxChange"/>
<!-- 人员选择 --> <!-- 人员选择 -->
<el-empty :image-size="100" description="似乎没有数据" v-show="dataList.length === 0"/> <el-empty :image-size="100" description="似乎没有数据" v-show="dataList.length === 0"/>
<el-scrollbar style="height:87%;"> <el-scrollbar style="height:87%;">

View File

@@ -39,15 +39,19 @@
<el-table-column prop="researchPersonnel" label="研发人员" width="230"> <el-table-column prop="researchPersonnel" label="研发人员" width="230">
<template #default="scope"> <template #default="scope">
<el-form-item prop="time" :rules="scope.row.researchPersonnel?'1':rules.researchPersonnel"> <el-form-item prop="time" :rules="scope.row.researchPersonnel?'1':rules.researchPersonnel">
<el-select v-model="scope.row.researchPersonnel" placeholder="请选择研发人员" clearable> {{ chooseUserInfo() }}
<el-option <el-button @click="showPersonnelPicker">
v-for="item in researchOptions" {{ chooseUserInfo() == null ? '请选择研发人员' : '更改' }}
:key="item.value" </el-button>
:label="item.label" <!-- <el-select v-model="scope.row.researchPersonnel" placeholder="请选择研发人员" clearable>-->
:value="item.value" <!-- <el-option-->
> <!-- v-for="item in researchOptions"-->
</el-option> <!-- :key="item.value"-->
</el-select> <!-- :label="item.label"-->
<!-- :value="item.value"-->
<!-- >-->
<!-- </el-option>-->
<!-- </el-select>-->
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
@@ -121,12 +125,14 @@
</el-table> </el-table>
</el-row> </el-row>
</el-form> </el-form>
<user-picker :multiple="true" ref="userPicker" title="请选择研发人员" v-model:value="userList" @ok="selected"/>
<div style="width:100%;text-align: center;padding: 10px"> <div style="width:100%;text-align: center;padding: 10px">
<el-button type="primary" @click="handleAdd" link style="font-size: 18px">添加一行</el-button> <el-button type="primary" @click="handleAdd" link style="font-size: 18px">添加一行</el-button>
</div> </div>
<div class="approval-record"> <div class="approval-record">
<div class="approval-title"> <div class="approval-title">
<baseTitle title="审批记录" v-if="processDiagramViewer&& opentionData.operationList"></baseTitle> <baseTitle title="审批记录" v-if="processDiagramViewer&& opentionData?.operationList"></baseTitle>
<div v-else></div> <div v-else></div>
<div style="display: flex;align-items: center;justify-content: flex-end;"> <div style="display: flex;align-items: center;justify-content: flex-end;">
<div class="base-title">流程图</div> <div class="base-title">流程图</div>
@@ -138,8 +144,8 @@
</div> </div>
<div class="process"> <div class="process">
<operation-render <operation-render
v-if="processDiagramViewer&& opentionData.operationList && opentionData.operationList.length > 0&&!changeDiagram" v-if="processDiagramViewer&& opentionData?.operationList && opentionData?.operationList.length > 0&&!changeDiagram"
:operation-list="opentionData.operationList" :operation-list="opentionData?.operationList"
:state="opentionData.state"/> :state="opentionData.state"/>
<process-diagram-viewer mode="view" v-if="processDiagramViewer&&changeDiagram"/> <process-diagram-viewer mode="view" v-if="processDiagramViewer&&changeDiagram"/>
</div> </div>
@@ -167,7 +173,11 @@ import {
import {useProcessStore} from '@/stores/processStore.js'; import {useProcessStore} from '@/stores/processStore.js';
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue'; import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
import OperationRender from '@/views/workflow/common/OperationRender.vue' import OperationRender from '@/views/workflow/common/OperationRender.vue'
import {ref} from "vue";
import UserPicker from "@/views/workflow/process/common/UserPicker.vue";
const userList = ref([])
const changeDiagram = ref(false) const changeDiagram = ref(false)
const rules = reactive({ const rules = reactive({
shareName: [{required: true, message: '请输入分摊名称', trigger: 'blur'}], shareName: [{required: true, message: '请输入分摊名称', trigger: 'blur'}],
@@ -208,10 +218,25 @@ const formData = ref({
} }
] ]
}) })
const userPicker = ref()
const form = ref() const form = ref()
const nameOptions = ref([]) const nameOptions = ref([])
const researchOptions = ref([]) const researchOptions = ref([])
const showPersonnelPicker = () => {
userPicker.value.showUserPicker()
}
const chooseUserInfo = () => {
if (userList.value.length > 0) {
return userList.value.map(item => {
return item.name
}).join('')
} else {
return null
}
}
const selected = (select) => {
userList.value = select
}
const getResearchOptions = async () => { const getResearchOptions = async () => {
const res = await getResearchUser() const res = await getResearchUser()
researchOptions.value = res.data researchOptions.value = res.data
@@ -263,17 +288,18 @@ const handleDelete = (index) => {
formData.value.tableData.splice(index, 1) formData.value.tableData.splice(index, 1)
} }
const handleSubmit = (instance) => { const handleSubmit = (instance) => {
if (!instance) return // if (!instance) return
instance.validate(async (valid) => { // instance.validate(async (valid) => {
if (!valid) { // if (!valid) {
return ElNotification({ // return ElNotification({
title: '提示', // title: '提示',
message: '请完善数据,再提交!', // message: '请完善数据,再提交!',
type: 'error' // type: 'error'
}) // })
} // }
formData.value.tableData.forEach(item => { formData.value.tableData.forEach(item => {
item.projectName = getProjectName(item.projectId) item.projectName = getProjectName(item.projectId)
// item.researchPersonnel
}) })
let params = { let params = {
shareName: formData.value.shareName, shareName: formData.value.shareName,
@@ -281,20 +307,20 @@ const handleSubmit = (instance) => {
usrAllocations: formData.value.tableData, usrAllocations: formData.value.tableData,
deploymentId: processInstanceData.value.deploymentId, deploymentId: processInstanceData.value.deploymentId,
} }
// console.log('params',params) console.log('params',params,formData.value.tableData)
const {code, msg} = await addAllocation(params) // const {code, msg} = await addAllocation(params)
ElNotification({ // ElNotification({
title: '提示', // title: '提示',
message: msg, // message: msg,
type: code === 1000 ? 'success' : 'error' // type: code === 1000 ? 'success' : 'error'
}) // })
if (code === 1000) { // if (code === 1000) {
tagsViewStore.delVisitedViews(router.currentRoute.value.path) // tagsViewStore.delVisitedViews(router.currentRoute.value.path)
router.push({ // router.push({
name: 'Expense/share' // name: 'Expense/share'
}) // })
} // }
}) // })
} }
const handleResubmit = (instance) => { const handleResubmit = (instance) => {
if (!instance) return if (!instance) return
@@ -333,7 +359,7 @@ const handleResubmit = (instance) => {
}) })
} }
const getDetailInfo = () => { const getDetailInfo = () => {
loading.value = true loading.value = true
getAllocationDetail(route.query.id).then(res => { getAllocationDetail(route.query.id).then(res => {
ElNotification({ ElNotification({
@@ -400,10 +426,10 @@ const init = async () => {
const handleBack = () => { const handleBack = () => {
history.back() history.back()
} }
onMounted( () => { onMounted(() => {
init() init()
if (route.query.id) { if (route.query.id) {
getDetailInfo() getDetailInfo()
} }
}) })
</script> </script>

View File

@@ -51,6 +51,9 @@
<div class="org-items"> <div class="org-items">
<el-empty :image-size="100" description="请点击左侧列表选择数据" v-show="selectList.length === 0"/> <el-empty :image-size="100" description="请点击左侧列表选择数据" v-show="selectList.length === 0"/>
<div v-for="(selectItem, selectIndex) in selectList" :key="selectIndex" class="org-item"> <div v-for="(selectItem, selectIndex) in selectList" :key="selectIndex" class="org-item">
<el-icon :color="selectItem.accountType==='0'?'#95d475':'#409eff'" size="20">
<UserFilled/>
</el-icon>
{{ selectItem.name }}-{{ selectItem.companyName }} {{ selectItem.name }}-{{ selectItem.companyName }}
<el-icon @click="noSelected(selectItem)" size="20" style="margin-left: 10px;cursor: pointer;"> <el-icon @click="noSelected(selectItem)" size="20" style="margin-left: 10px;cursor: pointer;">
<CircleClose/> <CircleClose/>
@@ -125,7 +128,6 @@ const _value = computed({
}); });
watch(() => filterText.value, (newVal) => { watch(() => filterText.value, (newVal) => {
console.log('filterText.value', newVal)
filterText.value = newVal filterText.value = newVal
}); });