Просмотр исходного кода

出差管理关联预算计划修改

duy 2 лет назад
Родитель
Сommit
d05492e1cc
1 измененных файлов с 14 добавлено и 7 удалено
  1. 14 7
      src/views/attendance/business-trip/info.vue

+ 14 - 7
src/views/attendance/business-trip/info.vue

@@ -157,7 +157,7 @@
         >
             <HcTable :column="tableBudgetColumn" :datas="tableBudgetData" :loading="tableBudgetLoading">
                 <template #action="{ row, index }">
-                    <el-button v-if="row.relevance" size="small" type="danger" @click="rowDisassociate(row)">
+                    <el-button v-if="row.isRelevance" size="small" type="danger" @click="rowDisassociate(row)">
                         取消关联
                     </el-button>
                     <el-button v-else size="small" type="primary" @click="rowRelevance(row)">
@@ -502,15 +502,20 @@ const budgetCloseClick = () => {
     budgetModal.value = false
 }
 const budgetSaveClick = () => {
-
+    // const index = budgetIndex.value
+    const ids = relatedIds.value.join(',')
+    formModel.value.budgetPlanIds = ids
+    window.$message.success('操作成功')
+    budgetModal.value = false
+    console.log( formModel.value, ' formModel.value.value.details')
 }
 
 //关联预算计划表格
 const tableBudgetColumn = [
-    { key: 'key1', name: '任务所属项目' },
-    { key: 'key2', name: '状态', width: '120', align: 'center' },
-    { key: 'key3', name: '任务描述' },
-    { key: 'key4', name: '完成指标', width: '120', align: 'center' },
+    { key: 'projectName', name: '任务所属项目' },
+    { key: 'statusName', name: '状态', width: '120', align: 'center' },
+    { key: 'planTaskDesc', name: '任务描述' },
+    { key: 'planTarget', name: '完成指标', width: '120', align: 'center' },
     { key: 'action', name: '操作', width: '100', align: 'center' },
 ]
 
@@ -531,7 +536,9 @@ const getBudgetTableData = async (projectId) => {
 const isRowRelevance = async (data) => {
     const res = getArrValue(data)
     const ids = relatedIds.value
+    console.log(relatedIds.value, 'relatedIds.value')
     res.forEach(item => {
+        console.log(item.id, 'item.id')
         item.isRelevance = ids.includes(item.id)
     })
     return res
@@ -584,7 +591,7 @@ const detailsObj = {
     projectId: '', // 所属项目
     submitStatus: null, // 审提交状态 1=暂存 2=提交审批
     journeyList: [detailsObj1],
-    budgetPlanIds:'', //预算计划ID
+    budgetPlanIds:null, //预算计划ID
 }
 const fellowTravelerUserIds = ref([])
 //处理表单数据