Merge pull request 'fix : 修复用户切换报错提示、税后余额数字输入框、新增分摊时研发人员传参' (#384) from dd into master
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/384
This commit is contained in:
@@ -97,7 +97,7 @@ const handleVisitedP = () => {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: res.code === 1000 ? 'success' : 'error'
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
accountList.value = res.data
|
||||
|
||||
@@ -39,19 +39,10 @@
|
||||
<el-table-column prop="researchPersonnel" label="研发人员" width="230">
|
||||
<template #default="scope">
|
||||
<el-form-item prop="researchPersonnel">
|
||||
{{ chooseUserInfo() }}
|
||||
<el-button @click="showPersonnelPicker">
|
||||
{{ chooseUserInfo() == null ? '请选择研发人员' : '更改' }}
|
||||
{{ scope.row.researchPersonnelName ? scope.row.researchPersonnelName : currentReachPerson.name }}
|
||||
<el-button @click="showPersonnelPicker(scope.row,scope.$index)">
|
||||
{{ scope.row.researchPersonnelName || currentReachPerson.name ? '更改' : '请选择研发人员' }}
|
||||
</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>
|
||||
@@ -64,7 +55,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="performance" label="绩效" width="175">
|
||||
<template #default="scope">
|
||||
<el-form-item prop="time" :rules="scope.row.performance?'1':rules.performance">
|
||||
<el-form-item prop="time">
|
||||
<el-input-number v-model="scope.row.performance" placeholder="请输入绩效" :controls="false"/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -104,18 +95,6 @@
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="time" label="时间">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <el-input v-model="scope.row.time" placeholder="请输入时间" clearable>-->
|
||||
<!-- </el-input>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column prop="subtotal" label="小计">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <el-input v-model="scope.row.subtotal" placeholder="请输入小计" clearable>-->
|
||||
<!-- </el-input>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column prop="oper" label="操作">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" @click="handleCopy(scope.row)" link style="font-size: 18px">复制</el-button>
|
||||
@@ -125,7 +104,8 @@
|
||||
</el-table>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<user-picker :multiple="true" ref="userPicker" title="请选择研发人员" v-model:value="userList" @ok="selected"/>
|
||||
<user-picker :multiple="false" ref="userPicker" title="请选择研发人员" v-model:value="userList" @ok="selected"
|
||||
:setNullToSelectList="true"/>
|
||||
|
||||
<div style="width:100%;text-align: center;padding: 10px">
|
||||
<el-button type="primary" @click="handleAdd" link style="font-size: 18px">添加一行</el-button>
|
||||
@@ -220,22 +200,26 @@ const formData = ref({
|
||||
})
|
||||
const userPicker = ref()
|
||||
const form = ref()
|
||||
const currentReachPerson = ref({})
|
||||
const currentRow = ref()
|
||||
const currentIndex = ref()
|
||||
const nameOptions = ref([])
|
||||
const researchOptions = ref([])
|
||||
const showPersonnelPicker = () => {
|
||||
const showPersonnelPicker = (row, index) => {
|
||||
currentRow.value = row
|
||||
currentIndex.value = index
|
||||
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
|
||||
for (const selectElement of select) {
|
||||
currentReachPerson.value = selectElement
|
||||
}
|
||||
formData.value.tableData.forEach((item, index) => {
|
||||
if (index == currentIndex.value) {
|
||||
item.researchPersonnel = currentReachPerson.value.id
|
||||
item.researchPersonnelName = currentReachPerson.value.name
|
||||
}
|
||||
})
|
||||
}
|
||||
const getResearchOptions = async () => {
|
||||
const res = await getResearchUser()
|
||||
@@ -288,17 +272,20 @@ 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)
|
||||
if (item.performance == 0) {
|
||||
item.performance = null
|
||||
}
|
||||
})
|
||||
let params = {
|
||||
shareName: formData.value.shareName,
|
||||
@@ -306,20 +293,20 @@ const handleSubmit = (instance) => {
|
||||
usrAllocations: formData.value.tableData,
|
||||
deploymentId: processInstanceData.value.deploymentId,
|
||||
}
|
||||
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'
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
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
|
||||
@@ -334,6 +321,9 @@ const handleResubmit = (instance) => {
|
||||
formData.value.tableData.forEach(item => {
|
||||
item.allocationId = formData.value.allocationId
|
||||
item.projectName = getProjectName(item.projectId)
|
||||
if (item.performance == 0) {
|
||||
item.performance = null
|
||||
}
|
||||
})
|
||||
let params = {
|
||||
allocationId: formData.value.allocationId,
|
||||
@@ -342,7 +332,7 @@ const handleResubmit = (instance) => {
|
||||
usrAllocations: formData.value.tableData,
|
||||
deploymentId: processInstanceData.value.deploymentId,
|
||||
}
|
||||
// console.log('params',params)
|
||||
console.log('params', params)
|
||||
const {code, msg} = await editAllocation(params)
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
|
||||
@@ -56,8 +56,8 @@
|
||||
<el-table-column prop="afterTax" label="税后余额(元)" width="220">
|
||||
<template #default="scope">
|
||||
<el-form-item prop="afterTax" :rules="scope.row.afterTax?'1':rules.afterTax">
|
||||
<el-input v-model="scope.row.afterTax" placeholder="请输入税后余额" clearable>
|
||||
</el-input>
|
||||
<el-input-number v-model="scope.row.afterTax" placeholder="请输入税后余额" :controls="false">
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -127,7 +127,7 @@ const tableForm = reactive({
|
||||
projectCost: '',
|
||||
researchStage: '',
|
||||
digest: '',
|
||||
afterTax: ''
|
||||
afterTax: null
|
||||
}
|
||||
]
|
||||
})
|
||||
@@ -148,7 +148,7 @@ const handleAdd = () => {
|
||||
projectCost: '',
|
||||
researchStage: '',
|
||||
digest: '',
|
||||
afterTax: ''
|
||||
afterTax: null
|
||||
}
|
||||
tableForm.tableData.push(row)
|
||||
}
|
||||
|
||||
@@ -88,6 +88,11 @@ const props = defineProps({
|
||||
showCheckbox: { //是否显示左侧选择框
|
||||
default: true,
|
||||
type: Boolean
|
||||
},
|
||||
//打开弹窗时是否重置选中数据
|
||||
setNullToSelectList: {
|
||||
default: false,
|
||||
type: Boolean
|
||||
}
|
||||
});
|
||||
const radio = ref(0);
|
||||
@@ -151,7 +156,6 @@ const getList = (flag) => {
|
||||
}
|
||||
}
|
||||
getMosrDept(params).then(res => {
|
||||
console.log('selectItem.type', selectItem.type)
|
||||
// if (res.data) {
|
||||
if (selectItem.type === -1) {
|
||||
dataList.value = res.data;
|
||||
@@ -189,7 +193,9 @@ const showUserPicker = () => {
|
||||
value: "0"
|
||||
};
|
||||
dataList.value = [];
|
||||
// selectList.value = []
|
||||
if(props.setNullToSelectList){
|
||||
selectList.value = []
|
||||
}
|
||||
chooseId.value = 0;
|
||||
radio.value = 0;
|
||||
visible.value = true;
|
||||
|
||||
Reference in New Issue
Block a user