Parcourir la source

成本测算获取部门

duy il y a 2 ans
Parent
commit
4680f1b9e3
3 fichiers modifiés avec 38 ajouts et 11 suppressions
  1. 7 0
      src/api/modules/other.js
  2. 12 11
      src/views/program/section/form.vue
  3. 19 0
      src/views/project/cost/form.vue

+ 7 - 0
src/api/modules/other.js

@@ -38,3 +38,10 @@ export const getDictInfo = (code) => httpApi({
         code
     }
 }, false);
+//获取部门列表
+export const getdepartmentList = (form, msg = true) => httpApi({
+    url: '/api/blade-system/dept/list',
+    method: 'get',
+    params: form
+}, msg);
+

+ 12 - 11
src/views/program/section/form.vue

@@ -111,7 +111,8 @@ const getDepartmentPlan=async()=>{
         }
     )
     if (!error && code === 200) {
-        console.log(getObjValue(data),'详情');
+        console.log(getArrValue(data),'详情');
+        tableData.value=getArrValue(data)
      
        
 
@@ -137,17 +138,17 @@ const tabChange = ({key}) => {
 //获取数据
 const tableLoading = ref(false)
 const tableColumn = [
-    {key: 'key1', name: '所属项目', minWidth: '160'},
-    {key: 'key2', name: '项目环节', width: '160', align: 'center'},
-    {key: 'key3', name: '预算类型', width: '160', align: 'center'},
-    {key: 'key4', name: '任务明细', width: '160', align: 'center'},
-    {key: 'key5', name: '任务类型', width: '160', align: 'center'},
-    {key: 'key6', name: '任务描述', minWidth: '160', isTooltip: true},
-    {key: 'key8', name: '完成指标', width: '160', align: 'center'},
-    {key: 'key9', name: '任务人', width: '160', align: 'center'},
+    {key: 'projectName', name: '所属项目', minWidth: '160'},
+    {key: 'projectProcessValue', name: '项目环节', width: '160', align: 'center'},
+    {key: 'budgetTypeValue', name: '预算类型', width: '160', align: 'center'},
+    {key: 'taskDetailValue', name: '任务明细', width: '160', align: 'center'},
+    {key: 'planTaskType', name: '任务类型', width: '160', align: 'center'},
+    {key: 'planTaskDesc', name: '任务描述', minWidth: '160', isTooltip: true},
+    {key: 'planTarget', name: '完成指标', width: '160', align: 'center'},
+    {key: 'taskUser', name: '任务人', width: '160', align: 'center'},
     {key: 'key10', name: '计划起止日期', width: '220', align: 'center'},
-    {key: 'key11', name: '预计差旅费(元)', width: '180', align: 'center'},
-    {key: 'key12', name: '状态', width: '100', align: 'center'},
+    {key: 'budgetTravelExpense', name: '预计差旅费(元)', width: '180', align: 'center'},
+    {key: 'statusValue', name: '状态', width: '100', align: 'center'},
     {key: 'action', name: '操作', width: '160', align: 'center', fixed: 'right'},
 ]
 const tableData = ref([

+ 19 - 0
src/views/project/cost/form.vue

@@ -54,6 +54,11 @@
               
                 <HcTable :isIndex="false" :column="tableColumn" :datas="tableData">
 
+                    <template #deptId="{row,index}">  
+                            <el-select  v-model="row.deptId" block placeholder="请选择">
+                                <el-option v-for="item in departMent" :label="item.deptName" :value="item.id"/>
+                             </el-select>
+                    </template>
                     <template #costType="{row,index}">  
                             <el-select  v-model="row.costType" block placeholder="请选择">
                                 <el-option v-for="item in costTypeList" :label="item.dictName" :value="item.dictValue"/>
@@ -144,6 +149,7 @@ import {onActivated, ref,watch} from "vue";
 import {useRouter, useRoute} from 'vue-router'
 import costApi from '~api/project/cost.js';
 import {getArrValue,getObjValue,formValidate} from "js-fast-way"
+import { getdepartmentList} from "~api/other";
 //初始变量
 const router = useRouter()
 const useRoutes = useRoute()
@@ -171,6 +177,7 @@ onActivated(() => {
     getCostTypeDict()
    
     getPostDict()
+    getdepartmentListData()
 
 
   
@@ -260,6 +267,17 @@ const getPostDict=async(type)=>{
         postTypeList.value={}
     }
 }
+//费用分摊部门
+const departMent = ref([])
+const getdepartmentListData = async () => {
+    const {error, code, data} = await getdepartmentList()
+    //判断状态
+    if (!error && code === 200) {
+        departMent.value = getArrValue(data)
+    } else {
+        departMent.value = []
+    }
+}
 //测算表格数据
 const constructUnitData=ref([])
 const bulidUnitData=ref([])
@@ -342,6 +360,7 @@ const tabChange = ({key}) => {
 
 //成本测算表格
 const tableColumn = [
+    {key: 'deptId', name: '费用分摊部门', width: '160', align: 'center'},
     {key: 'costType', name: '费用分类', width: '160', align: 'center'},
     {key: 'projectProcess', name: '项目环节', width: '160', align: 'center'},
     {key: 'budgetType', name: '预算类型', width: '160', align: 'center'},