复制
@@ -125,7 +104,8 @@
-
+
添加一行
@@ -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: '提示',
diff --git a/src/views/project-management/implementation/uploadFee.vue b/src/views/project-management/implementation/uploadFee.vue
index f3662e5..68027a0 100644
--- a/src/views/project-management/implementation/uploadFee.vue
+++ b/src/views/project-management/implementation/uploadFee.vue
@@ -56,8 +56,8 @@
-
-
+
+
@@ -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)
}
diff --git a/src/views/workflow/process/common/UserPicker.vue b/src/views/workflow/process/common/UserPicker.vue
index 0639477..f20744a 100644
--- a/src/views/workflow/process/common/UserPicker.vue
+++ b/src/views/workflow/process/common/UserPicker.vue
@@ -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;