Browse Source

成本测算修改

duy 2 years ago
parent
commit
32bcaaa9cd

+ 37 - 30
src/api/modules/project/cost.js

@@ -1,4 +1,4 @@
-import {httpApi} from "../../request/httpApi";
+import { httpApi } from '../../request/httpApi'
 
 export default {
     //获取分页
@@ -6,72 +6,79 @@ export default {
         return httpApi({
             url: '/api/blade-control/projectCostBudgetStats/page',
             method: 'get',
-            params: form
-        }, msg);
+            params: form,
+        }, msg)
     },
     //获取详情
     async getBudgetStatsById(form, msg = true) {
         return httpApi({
             url: '/api/blade-control/projectCostBudgetStats/getBudgetStatsById',
             method: 'get',
-            params: form
-        }, msg);
+            params: form,
+        }, msg)
     },
     //查询预览测算
     async getBudgetList(form, msg = true) {
         return httpApi({
             url: '/api/blade-control/projectCostBudgetStats/budgetList',
             method: 'get',
-            params: form
-        }, msg);
+            params: form,
+        }, msg)
     },
     //获取未做预算的项目列表
     async getProjectList(form, msg = true) {
         return httpApi({
             url: '/api/blade-control/projectCostBudgetStats/getProjectList',
             method: 'get',
-            params: form
-        }, msg);
+            params: form,
+        }, msg)
     },
     //获取费用分类
     async getCostTypeDict(form, msg = true) {
         return httpApi({
             url: '/api/blade-control/projectCostBudgetStats/getCostTypeDict',
             method: 'get',
-            params: form
-        }, msg);
+            params: form,
+        }, msg)
     },
     //获取岗位字典
     async getPostDict(form, msg = true) {
         return httpApi({
             url: '/api/blade-control/projectCostBudgetStats/getPostDict',
             method: 'get',
-            params: form
-        }, msg);
+            params: form,
+        }, msg)
     },
     //获取项目环节
     async getProcessList(form, msg = true) {
         return httpApi({
             url: '/api/blade-control/projectCostBudgetStats/getProcessList',
             method: 'get',
-            params: form
-        }, msg);
+            params: form,
+        }, msg)
     },
     //获取预算分类
     async getSecondSubject(form, msg = true) {
         return httpApi({
             url: '/api/blade-control/annualBudget/getSecondSubject',
             method: 'get',
-            params: form
-        }, msg);
+            params: form,
+        }, msg)
+    },
+    async getSecondSubject2(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-control/annualBudget/getSecondSubject2',
+            method: 'get',
+            params: form,
+        }, msg)
     },
     //获取任务明细
     async getChlidList(form, msg = true) {
         return httpApi({
             url: '/api/blade-control/dictinfo/child-list',
             method: 'get',
-            params: form
-        }, msg);
+            params: form,
+        }, msg)
     },
     ///新增或修改成本测算
     async AddOrUpdate(form, msg = true) {
@@ -79,40 +86,40 @@ export default {
             url: '/api/blade-control/projectCostBudgetStats/AddOrUpdate',
             method: 'post',
             data: form,
-            isDelay: true
-        }, msg);
+            isDelay: true,
+        }, msg)
     },
     //删除成本预算
     async deleteByStatsId(form, msg = true) {
         return httpApi({
             url: '/api/blade-control/projectCostBudgetStats/deleteByStatsId',
             method: 'get',
-            params: form
-        }, msg);
+            params: form,
+        }, msg)
     },
     //成本测算审批提交
     async submitApprove(form, msg = true) {
         return httpApi({
             url: '/api/blade-control/approve/cost/budget/submit',
             method: 'get',
-            params: form
-        }, msg);
+            params: form,
+        }, msg)
     },
     //获取费用支出所属分类
     async getCostType(form, msg = true) {
         return httpApi({
             url: '/api/blade-control/projectCostBudget/getCostType',
             method: 'get',
-            params: form
-        }, msg);
+            params: form,
+        }, msg)
     },
     //获取参建方
     async getUnitType(form, msg = true) {
         return httpApi({
             url: '/api/blade-control/projectCostBudget/getUnitType',
             method: 'get',
-            params: form
-        }, msg);
+            params: form,
+        }, msg)
     },
     //成本测算-统计一行金额
     async saveCountMoney(form, msg = true) {
@@ -120,7 +127,7 @@ export default {
             url: '/api/blade-control/projectCostBudget/saveCountMoney',
             method: 'post',
             data: form,
-        }, msg);
+        }, msg)
     },
 }
 

+ 93 - 94
src/views/home/task/components/cost-budget.vue

@@ -1,13 +1,12 @@
 <!--  -->
 <template>
     <div>
-        <HcTable :column="basetableColumn" :datas="basetableData" :isIndex="false" >
-        </HcTable>
-        <HcCard actionUi="text-center" class="mt-4">
+        <HcTable :column="basetableColumn" :datas="basetableData" :is-index="false" />
+        <HcCard action-ui="text-center" class="mt-4">
             <template #extra>
-                <HcNewSwitch :datas="tabTab" :keys="tabKey" @change="tabChange" :round="false" />
+                <HcNewSwitch :datas="tabTab" :keys="tabKey" :round="false" @change="tabChange" />
             </template>
-            <HcTable :isIndex="false" :column="tableColumn" :datas="tableData">
+            <HcTable :is-index="false" :column="tableColumn" :datas="tableData">
                 <template #deptId="{ row, index }">
                     <el-select v-model="row.deptId" block placeholder="请选择" disabled>
                         <el-option v-for="item in departMent" :label="item.deptName" :value="item.id" />
@@ -28,91 +27,90 @@
                         <el-option v-for="item in budgetTypeList" :label="item.dictName" :value="item.dictValue" />
                     </el-select>
                 </template>
-                <template #taskDetail="{ row, index }" >
+                <template #taskDetail="{ row, index }">
                     <el-select v-model="row.taskDetail" :getdata="budgetTypeChange(row?.budgetType, index)" disabled>
                         <el-option v-for="item in taskDetailList[index]" :label="item.dictName" :value="item.dictValue" />
                     </el-select>
                 </template>
-                <template #budgetDays="{ row, index }" >
-                    <el-input v-model="row.budgetDays" disabled/>
+                <template #budgetDays="{ row, index }">
+                    <el-input v-model="row.budgetDays" disabled />
                 </template>
-                <template #postType="{ row, index }" >
+                <template #postType="{ row, index }">
                     <el-select v-model="row.postType" disabled>
                         <el-option v-for="item in postTypeList" :label="item.dictName" :value="item.id" />
                     </el-select>
                 </template>
 
-                <template #staffCount="{ row, index }" >
-                    <el-input v-model="row.staffCount"  disabled/>
+                <template #staffCount="{ row, index }">
+                    <el-input v-model="row.staffCount" disabled />
                 </template>
-                <template #budgetStaffCost="{ row, index }" >
+                <template #budgetStaffCost="{ row, index }">
                     <el-input v-model="row.budgetStaffCost" disabled />
                 </template>
                 <template #budgetTravelExpense="{ row, index }">
-                    <el-input v-model="row.budgetTravelExpense" disabled/>
+                    <el-input v-model="row.budgetTravelExpense" disabled />
                 </template>
                 <template #outsourceUnitPrice="{ row, index }">
-                    <el-input v-model="row.outsourceUnitPrice" disabled/>
+                    <el-input v-model="row.outsourceUnitPrice" disabled />
                 </template>
                 <template #outsourcePeopleCount="{ row, index }">
-                    <el-input v-model="row.outsourcePeopleCount" disabled/>
+                    <el-input v-model="row.outsourcePeopleCount" disabled />
                 </template>
                 <template #outsourceCountMoney="{ row, index }">
                     <el-input v-model="row.outsourceCountMoney" disabled />
                 </template>
                 <template #otherBudgetMoney="{ row, index }">
-                    <el-input v-model="row.otherBudgetMoney" disabled/>
+                    <el-input v-model="row.otherBudgetMoney" disabled />
                 </template>
                 <template #budgetCountMoney="{ row, index }">
-                    <el-input v-model="row.budgetCountMoney" disabled/>
+                    <el-input v-model="row.budgetCountMoney" disabled />
                 </template>
                 <template #budgetRemark="{ row, index }">
-                    <el-input v-model="row.budgetRemark" disabled/>
+                    <el-input v-model="row.budgetRemark" disabled />
                 </template>
                 <template #key15="{ row, index }">
                     <el-input v-model="row.key15" disabled />
                 </template>
-       
             </HcTable>
         </HcCard>
     </div>
 </template>
 
 <script setup>
-import { ref, watch, onActivated } from 'vue'
-import { getProjectList,getdepartmentList } from "~api/other";
-import { getArrValue } from "js-fast-way";
-import costApi from '~api/project/cost.js';
+import { onActivated, ref, watch } from 'vue'
+import { getProjectList, getdepartmentList } from '~api/other'
+import { getArrValue } from 'js-fast-way'
+import costApi from '~api/project/cost.js'
 
-onActivated(() => {
-
-  
-})
 //参数
 const props = defineProps({
     otherInfo: {
         type: Object,
-        default: {}
-    }
+        default: {},
+    },
+})
+onActivated(() => {
+
+  
 })
 const otherInfo = ref(props.otherInfo)
 //监听
 watch(() => [
     props.otherInfo,
 ], ([otherInfo]) => {
-    console.log(otherInfo, 'otherInfo');
+    console.log(otherInfo, 'otherInfo')
     getdepartmentListData()
     getCostTypeDict()
     getProcessList(otherInfo?.projectId)
     getPostDict()
     getBudgetTypeList()
 
-    constructUnitData.value=otherInfo?.constructUnit||[]
-    bulidUnitData.value=otherInfo?.buildUnit||[]
-    supervisorUnitData.value=otherInfo?.supervisorUnit||[]
-    tabKey.value='construction'
-    tableData.value=constructUnitData.value
-    basetableData.value=[
+    constructUnitData.value = otherInfo?.constructUnit || []
+    bulidUnitData.value = otherInfo?.buildUnit || []
+    supervisorUnitData.value = otherInfo?.supervisorUnit || []
+    tabKey.value = 'construction'
+    tableData.value = constructUnitData.value
+    basetableData.value = [
         {
             projectName: otherInfo?.projectName,
             projectCostTotal: otherInfo?.projectCostTotal,
@@ -122,7 +120,7 @@ watch(() => [
             maintainCostTotal: otherInfo?.maintainCostTotal,
             outsourceCostTotal: otherInfo?.outsourceCostTotal,
             manageCostTotal: otherInfo?.manageCostTotal,
-        }
+        },
     ]
 
 })
@@ -146,50 +144,50 @@ const tabKey = ref('construction')
 const tabTab = ref([
     { key: 'bulid', name: '施工单位成本' },
     { key: 'supervision', name: '监理单位成本' },
-    { key: 'construction', name: '建设单位成本' }
-]);
+    { key: 'construction', name: '建设单位成本' },
+])
 //测算表格数据
-const constructUnitData=ref([])
-const bulidUnitData=ref([])
-const supervisorUnitData=ref([])
+const constructUnitData = ref([])
+const bulidUnitData = ref([])
+const supervisorUnitData = ref([])
 
 const tabChange = ({ key }) => {
     tabKey.value = key
-    if(key=='supervision'){
-        tableData.value=supervisorUnitData.value
-    }else if(key=='construction'){
-        tableData.value=constructUnitData.value
-    }else if(key=='bulid'){
-        tableData.value=bulidUnitData.value
+    if (key == 'supervision') {
+        tableData.value = supervisorUnitData.value
+    } else if (key == 'construction') {
+        tableData.value = constructUnitData.value
+    } else if (key == 'bulid') {
+        tableData.value = bulidUnitData.value
 
     }
 
 }
 //成本测算表格
 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'},
-    {key: 'taskDetail', name: '任务明细', width: '160',  align: 'center'},
-    {key: 'budgetDays', name: '预计工作量(小数/整数/天)', width: '160',  align: 'center'},
-    {key: 'postType', name: '投入岗位类型(日单价)', width: '160', align: 'center'},
-    {key: 'staffCount', name: '投入人员数量', width: '160', align: 'center'},
-    {key: 'budgetStaffCost', name: '预计人工成本(元)', width: '160', align: 'center'},
-    {key: 'budgetTravelExpense', name: '预计差旅费(元)', width: '160', align: 'center'},
-    {key: 'outsourceUnitPrice', name: '外包单价', width: '160', align: 'center'},
-    {key: 'outsourcePeopleCount', name: '外包数量', width: '160', align: 'center'},
-    {key: 'outsourceCountMoney', name: '外包金额', width: '160', align: 'center'},
-    {key: 'otherBudgetMoney', name: '其他预算金额', width: '160', align: 'center'},
-    {key: 'budgetCountMoney', name: '总预算金额', width: '160', align: 'center'},
-    {key: 'budgetRemark', name: '测算备注', width: '160', align: 'center'},
+    { 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' },
+    { key: 'taskDetail', name: '任务明细', width: '160', align: 'center' },
+    { key: 'budgetDays', name: '预计工作量(小数/整数/天)', width: '160', align: 'center' },
+    { key: 'postType', name: '投入岗位类型(日单价)', width: '160', align: 'center' },
+    { key: 'staffCount', name: '投入人员数量', width: '160', align: 'center' },
+    { key: 'budgetStaffCost', name: '预计人工成本(元)', width: '160', align: 'center' },
+    { key: 'budgetTravelExpense', name: '预计差旅费(元)', width: '160', align: 'center' },
+    { key: 'outsourceUnitPrice', name: '外包单价', width: '160', align: 'center' },
+    { key: 'outsourcePeopleCount', name: '外包数量', width: '160', align: 'center' },
+    { key: 'outsourceCountMoney', name: '外包金额', width: '160', align: 'center' },
+    { key: 'otherBudgetMoney', name: '其他预算金额', width: '160', align: 'center' },
+    { key: 'budgetCountMoney', name: '总预算金额', width: '160', align: 'center' },
+    { key: 'budgetRemark', name: '测算备注', width: '160', align: 'center' },
   
 ]
 const tableData = ref([])//成本测算表格
 //费用分摊部门
 const departMent = ref([])
 const getdepartmentListData = async () => {
-    const {error, code, data} = await getdepartmentList({deptType:2})
+    const { error, code, data } = await getdepartmentList({ deptType:2 })
     //判断状态
     if (!error && code === 200) {
         departMent.value = getArrValue(data)
@@ -198,71 +196,72 @@ const getdepartmentListData = async () => {
     }
 }
 //获取费用分类
-const costTypeList=ref([])
-const getCostTypeDict=async(type)=>{
-    const {error, code, data} = await costApi.getCostTypeDict()
+const costTypeList = ref([])
+const getCostTypeDict = async (type)=>{
+    const { error, code, data } = await costApi.getCostTypeDict()
     if (!error && code === 200) {
-        costTypeList.value=getArrValue(data)
+        costTypeList.value = getArrValue(data)
 
     } else {
-        costTypeList.value={}
+        costTypeList.value = {}
     }
 }
 //获取项目环节
-const processList=ref([])
-const getProcessList=async(projectId)=>{
-    const {error, code, data} = await costApi.getProcessList({projectId:projectId})
+const processList = ref([])
+const getProcessList = async (projectId)=>{
+    const { error, code, data } = await costApi.getProcessList({ projectId:projectId })
     if (!error && code === 200) {
-        processList.value=getArrValue(data)
+        processList.value = getArrValue(data)
 
     } else {
-        processList.value={}
+        processList.value = {}
     }
 }
 //获取预算分类getSecondSubject
-const budgetTypeList=ref([])
-const getBudgetTypeList=async()=>{
-    const {error, code, data} = await costApi.getSecondSubject()
+const budgetTypeList = ref([])
+const getBudgetTypeList = async ()=>{
+    const { error, code, data } = await costApi.getSecondSubject2()
     if (!error && code === 200) {
-        budgetTypeList.value=getArrValue(data)
+        budgetTypeList.value = getArrValue(data)
      
 
     } else {
-        budgetTypeList.value={}
+        budgetTypeList.value = {}
     }
 }
 //任务明细
-const taskDetailList=ref({})
-const budgetTypeChange=async(val,index)=>{
-    let id=''
+const taskDetailList = ref({})
+const budgetTypeChange = async (val, index)=>{
+    let id = ''
     budgetTypeList.value.forEach((ele)=>{
-        if(ele.dictValue===val){
-            id=ele.id
+        if (ele.dictValue === val) {
+            id = ele.id
         }
     })
-    if(id.length>0){
-        const {error, code, data} = await costApi.getChlidList({parentId:id,type:1})
+    if (id.length > 0) {
+        const { error, code, data } = await costApi.getChlidList({ parentId:id, type:1 })
         if (!error && code === 200) {
-            taskDetailList.value[index]=getArrValue(data)
+            taskDetailList.value[index] = getArrValue(data)
 
         } else {
-            taskDetailList.value[index]={}
+            taskDetailList.value[index] = {}
         }
     }
    
 }
 //获取岗位分类postTypeList
-const postTypeList=ref([])
-const getPostDict=async(type)=>{
-    const {error, code, data} = await costApi.getPostDict()
+const postTypeList = ref([])
+const getPostDict = async (type)=>{
+    const { error, code, data } = await costApi.getPostDict()
     if (!error && code === 200) {
-        postTypeList.value=getArrValue(data)
+        postTypeList.value = getArrValue(data)
     
 
 
     } else {
-        postTypeList.value={}
+        postTypeList.value = {}
     }
 }
 </script>
+
 <style lang='scss' scoped></style>

+ 1 - 1
src/views/project/cost/form.vue

@@ -227,7 +227,7 @@ const getProcessList = async (projectId)=>{
 //获取预算分类getSecondSubject
 const budgetTypeList = ref([])
 const getBudgetTypeList = async ()=>{
-    const { error, code, data } = await costApi.getSecondSubject()
+    const { error, code, data } = await costApi.getSecondSubject2()
     if (!error && code === 200) {
         budgetTypeList.value = getArrValue(data)