添加一行
@@ -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;
From 1a3d2bcf1a52777ed805535c83dd641e337c8852 Mon Sep 17 00:00:00 2001
From: odjbin <1042039504@qq.com>
Date: Sun, 23 Jun 2024 00:37:07 +0800
Subject: [PATCH 2/2] =?UTF-8?q?feat=20:=20=E9=A1=B9=E7=9B=AE=E5=AE=9E?=
=?UTF-8?q?=E6=96=BD-=E5=8F=B0=E8=B4=A6=E6=96=B0=E5=A2=9E=E8=A1=A8?=
=?UTF-8?q?=E6=A0=BC=E6=9B=B4=E6=96=B0=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/project-manage/index.js | 7 +
.../implementation/account.vue | 25 ++-
.../implementation/index.vue | 4 +-
.../implementation/updateTable.vue | 166 ++++++++++++++++++
4 files changed, 195 insertions(+), 7 deletions(-)
create mode 100644 src/views/project-management/implementation/updateTable.vue
diff --git a/src/api/project-manage/index.js b/src/api/project-manage/index.js
index 37ca9e1..ef1cd84 100644
--- a/src/api/project-manage/index.js
+++ b/src/api/project-manage/index.js
@@ -145,3 +145,10 @@ export const getPreProcess= () => {
method: "get"
});
};
+export const updateLedger = (data) => {
+ return request({
+ url: '/workflow/mosr/expense/ledger/replenishment',
+ method: "post",
+ data: data
+ });
+};
diff --git a/src/views/project-management/implementation/account.vue b/src/views/project-management/implementation/account.vue
index 42d202f..f6fa102 100644
--- a/src/views/project-management/implementation/account.vue
+++ b/src/views/project-management/implementation/account.vue
@@ -36,6 +36,10 @@ const schema = computed(() => {
]
})
const baseForm = ref()
+const tableIns = ref()
+const btns=ref([
+ {name: '表格更新', key: 'update', color: '#DED0B2', auth: ''}
+])
const searchConfig = reactive([
{
label: '时间',
@@ -146,17 +150,25 @@ const tableConfig = reactive({
currentRender: ({row}) => {
return
{toThousands(row.afterTax)}
}
- }
+ },
],
api: '/workflow/mosr/expense/ledger',
params: {
projectId: route.query.id
},
- btns: [
- {name: '上传费用', key: 'add', color: '#DED0B2', auth: ''}
- ]
+ btns: btns.value
})
-const tableIns = ref()
+if(route.query.state!=4){
+ btns.value.push({name: '上传费用', key: 'add', color: '#DED0B2', auth: ''})
+}
+const handleUpdateTable=()=>{
+ router.push({
+ name: 'Implementation/update',
+ query: {
+ id: route.query.id
+ }
+ })
+}
const getBaseInfo = async () => {
try {
const {code, data} = await getBaseInfoApi(route.query.id)
@@ -171,6 +183,9 @@ const headBtnClick = (key) => {
case 'add':
handleUploadFee()
break;
+ case 'update':
+ handleUpdateTable()
+ break;
}
}
const handleUploadFee = () => {
diff --git a/src/views/project-management/implementation/index.vue b/src/views/project-management/implementation/index.vue
index ca6c397..170a57d 100644
--- a/src/views/project-management/implementation/index.vue
+++ b/src/views/project-management/implementation/index.vue
@@ -344,11 +344,11 @@ const handleEdit = (row) => {
})
}
const handleStandingBook = (row) => {
- localStorage.setItem('projectName', row.projectName)
router.push({
name: 'Implementation/account',
query: {
- id: row.projectId
+ id: row.projectId,
+ state:row.state
}
})
}
diff --git a/src/views/project-management/implementation/updateTable.vue b/src/views/project-management/implementation/updateTable.vue
new file mode 100644
index 0000000..f37bf60
--- /dev/null
+++ b/src/views/project-management/implementation/updateTable.vue
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+ {{ tableForm.projectName }}
+
+
+
+
+ {{currentPerson.name}}
+
+ {{ currentPerson.name ? '更改' : '请选择研发人员' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 提交
+ 返回
+
+
+
+
+
+