Merge pull request 'dj' (#369) from dj into master
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/369
This commit is contained in:
@@ -39,15 +39,19 @@
|
||||
<el-table-column prop="researchPersonnel" label="研发人员" width="230">
|
||||
<template #default="scope">
|
||||
<el-form-item prop="time" :rules="scope.row.researchPersonnel?'1':rules.researchPersonnel">
|
||||
<el-select v-model="scope.row.researchPersonnel" placeholder="请选择研发人员" clearable>
|
||||
<el-option
|
||||
v-for="item in researchOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
{{ chooseUserInfo() }}
|
||||
<el-button @click="showPersonnelPicker">
|
||||
{{ chooseUserInfo() == null ? '请选择研发人员' : '更改' }}
|
||||
</el-button>
|
||||
<!-- <el-select v-model="scope.row.researchPersonnel" placeholder="请选择研发人员" clearable>-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in researchOptions"-->
|
||||
<!-- :key="item.value"-->
|
||||
<!-- :label="item.label"-->
|
||||
<!-- :value="item.value"-->
|
||||
<!-- >-->
|
||||
<!-- </el-option>-->
|
||||
<!-- </el-select>-->
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -121,12 +125,14 @@
|
||||
</el-table>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<user-picker :multiple="true" ref="userPicker" title="请选择研发人员" v-model:value="userList" @ok="selected"/>
|
||||
|
||||
<div style="width:100%;text-align: center;padding: 10px">
|
||||
<el-button type="primary" @click="handleAdd" link style="font-size: 18px">添加一行</el-button>
|
||||
</div>
|
||||
<div class="approval-record">
|
||||
<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 style="display: flex;align-items: center;justify-content: flex-end;">
|
||||
<div class="base-title">流程图</div>
|
||||
@@ -138,8 +144,8 @@
|
||||
</div>
|
||||
<div class="process">
|
||||
<operation-render
|
||||
v-if="processDiagramViewer&& opentionData.operationList && opentionData.operationList.length > 0&&!changeDiagram"
|
||||
:operation-list="opentionData.operationList"
|
||||
v-if="processDiagramViewer&& opentionData?.operationList && opentionData?.operationList.length > 0&&!changeDiagram"
|
||||
:operation-list="opentionData?.operationList"
|
||||
:state="opentionData.state"/>
|
||||
<process-diagram-viewer mode="view" v-if="processDiagramViewer&&changeDiagram"/>
|
||||
</div>
|
||||
@@ -167,7 +173,11 @@ import {
|
||||
import {useProcessStore} from '@/stores/processStore.js';
|
||||
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.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 rules = reactive({
|
||||
shareName: [{required: true, message: '请输入分摊名称', trigger: 'blur'}],
|
||||
@@ -208,10 +218,25 @@ const formData = ref({
|
||||
}
|
||||
]
|
||||
})
|
||||
const userPicker = ref()
|
||||
const form = ref()
|
||||
const nameOptions = 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 res = await getResearchUser()
|
||||
researchOptions.value = res.data
|
||||
@@ -263,17 +288,18 @@ const handleDelete = (index) => {
|
||||
formData.value.tableData.splice(index, 1)
|
||||
}
|
||||
const handleSubmit = (instance) => {
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return ElNotification({
|
||||
title: '提示',
|
||||
message: '请完善数据,再提交!',
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
// if (!instance) return
|
||||
// instance.validate(async (valid) => {
|
||||
// if (!valid) {
|
||||
// return ElNotification({
|
||||
// title: '提示',
|
||||
// message: '请完善数据,再提交!',
|
||||
// type: 'error'
|
||||
// })
|
||||
// }
|
||||
formData.value.tableData.forEach(item => {
|
||||
item.projectName = getProjectName(item.projectId)
|
||||
// item.researchPersonnel
|
||||
})
|
||||
let params = {
|
||||
shareName: formData.value.shareName,
|
||||
@@ -281,20 +307,20 @@ const handleSubmit = (instance) => {
|
||||
usrAllocations: formData.value.tableData,
|
||||
deploymentId: processInstanceData.value.deploymentId,
|
||||
}
|
||||
// console.log('params',params)
|
||||
const {code, msg} = await addAllocation(params)
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: msg,
|
||||
type: code === 1000 ? 'success' : 'error'
|
||||
})
|
||||
if (code === 1000) {
|
||||
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||
router.push({
|
||||
name: 'Expense/share'
|
||||
})
|
||||
}
|
||||
})
|
||||
console.log('params',params,formData.value.tableData)
|
||||
// const {code, msg} = await addAllocation(params)
|
||||
// ElNotification({
|
||||
// title: '提示',
|
||||
// message: msg,
|
||||
// type: code === 1000 ? 'success' : 'error'
|
||||
// })
|
||||
// if (code === 1000) {
|
||||
// tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||
// router.push({
|
||||
// name: 'Expense/share'
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
}
|
||||
const handleResubmit = (instance) => {
|
||||
if (!instance) return
|
||||
@@ -333,7 +359,7 @@ const handleResubmit = (instance) => {
|
||||
})
|
||||
}
|
||||
|
||||
const getDetailInfo = () => {
|
||||
const getDetailInfo = () => {
|
||||
loading.value = true
|
||||
getAllocationDetail(route.query.id).then(res => {
|
||||
ElNotification({
|
||||
@@ -400,10 +426,10 @@ const init = async () => {
|
||||
const handleBack = () => {
|
||||
history.back()
|
||||
}
|
||||
onMounted( () => {
|
||||
init()
|
||||
onMounted(() => {
|
||||
init()
|
||||
if (route.query.id) {
|
||||
getDetailInfo()
|
||||
getDetailInfo()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -51,6 +51,9 @@
|
||||
<div class="org-items">
|
||||
<el-empty :image-size="100" description="请点击左侧列表选择数据" v-show="selectList.length === 0"/>
|
||||
<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 }}
|
||||
<el-icon @click="noSelected(selectItem)" size="20" style="margin-left: 10px;cursor: pointer;">
|
||||
<CircleClose/>
|
||||
@@ -125,7 +128,6 @@ const _value = computed({
|
||||
});
|
||||
|
||||
watch(() => filterText.value, (newVal) => {
|
||||
console.log('filterText.value', newVal)
|
||||
filterText.value = newVal
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user