三期差了一个接口

This commit is contained in:
2025-03-10 21:02:00 +08:00
parent 038cf04f4c
commit 5379f60c45
11 changed files with 144 additions and 286 deletions

View File

@@ -99,22 +99,35 @@ public class SysOaCostController extends BaseController {
/**
// /**
// * 查询所有项目成本
// */
// @SaCheckPermission("oa:oaCost:list")
// @GetMapping("/list")
// public TableDataInfo<SysOaCostAllVo> AllList(@RequestParam(required = false) String projectName) {
// return iSysOaCostService.AllList(projectName);
// }
/**
* 查询所有项目成本
*/
@SaCheckPermission("oa:oaCost:list")
@GetMapping("/list")
public TableDataInfo<SysOaCostAllVo> AllList(@RequestParam(required = false) String projectName, @RequestParam(required = false)String createTime) {
return iSysOaCostService.AllList(projectName, createTime);
public TableDataInfo<SysOaCostAllVo> AllList(SysOaCostBo bo,PageQuery pageQuery) {
return iSysOaCostService.calcProjectCostList(bo,pageQuery);
}
/**
* 查询详情
*/
@SaCheckPermission("oa:oaCost:query")
@GetMapping("/{projectId}")
public TableDataInfo<SysOaCostRow> getDetail(@NotNull(message = "项目id不能为空")
public R<SysOaCostRow> getDetail(@NotNull(message = "项目id不能为空")
@PathVariable Long projectId) {
return iSysOaCostService.getDetail(projectId);
return R.ok(iSysOaCostService.getDetail(projectId));
}
/**

View File

@@ -69,5 +69,10 @@ public class SysOaCostBo extends BaseEntity {
*/
private Long claimId;
/**
* 项目名称
*/
private String projectName;
}

View File

@@ -43,4 +43,6 @@ public class SysOaCostAllVo {
private Long financeId;
private Double peopleDay;
}

View File

@@ -14,7 +14,7 @@ public class SysOaCostList {
private Long userId;
private String nickName;
private Double laborCost;
private Double attendenceNum;
private Double attendanceNum;
/**
* materialList

View File

@@ -4,9 +4,12 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.oa.domain.SysOaOutWarehouse;
import com.ruoyi.oa.domain.SysOaProject;
import com.ruoyi.oa.domain.bo.SysOaProjectBo;
import com.ruoyi.oa.domain.vo.SysOaCostAllVo;
import com.ruoyi.oa.domain.vo.SysOaOutWarehouseListVo;
import com.ruoyi.oa.domain.vo.SysOaProjectVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
@@ -31,4 +34,7 @@ public interface SysOaProjectMapper extends BaseMapperPlus<SysOaProjectMapper, S
List<SysOaProjectVo> getProjectDataByMonthAndDate(@Param("firstDay") Date firstDay, @Param("lastDay") Date lastDay);
Page<SysOaCostAllVo> selectListToCost(@Param("page") Page<SysOaProject> page,@Param(Constants.WRAPPER) QueryWrapper<SysOaProjectBo> queryWrapper);
}

View File

@@ -7,7 +7,6 @@ import com.ruoyi.oa.domain.bo.SysOaCostBo;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.domain.PageQuery;
import javax.validation.constraints.NotNull;
import java.util.Collection;
import java.util.List;
@@ -57,8 +56,16 @@ public interface ISysOaCostService {
/**
* 查询详情
*/
TableDataInfo<SysOaCostRow> getDetail(Long projectId);
SysOaCostRow getDetail(Long projectId);
/**
* 项目成本分析改进
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<SysOaCostAllVo> calcProjectCostList(SysOaCostBo bo, PageQuery pageQuery);
}

View File

@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.oa.domain.*;
import com.ruoyi.oa.domain.bo.SysOaProjectBo;
import com.ruoyi.oa.domain.vo.*;
import com.ruoyi.oa.mapper.*;
import com.ruoyi.system.mapper.SysUserMapper;
@@ -24,7 +25,6 @@ import java.math.BigDecimal;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* 项目成本分析Service业务层处理
@@ -143,13 +143,11 @@ public class SysOaCostServiceImpl implements ISysOaCostService {
@Override
public TableDataInfo<SysOaCostAllVo> AllList(String projectName, String createTime) {
log.info("查询所有项目对应的/物料费用/工资费用/差旅费用//其他费用");
LambdaQueryWrapper<SysOaProject> lqw = Wrappers.lambdaQuery(SysOaProject.class);
if (StringUtils.isNotBlank(projectName)) {
lqw.like(SysOaProject::getProjectName, projectName);
}
List<SysOaProject> projects = projectMapper.selectList(lqw);
log.info(" 查询projects: {}", projects);
if (projects.isEmpty()) {
return TableDataInfo.build();
}
@@ -159,22 +157,16 @@ public class SysOaCostServiceImpl implements ISysOaCostService {
SysOaCostAllVo sysOaCostAllVo = new SysOaCostAllVo();
Long projectId = project.getProjectId();
sysOaCostAllVo.setProjectId(projectId);
sysOaCostAllVo.setProjectName(project.getProjectName());
// 2、 查询所有项目对应的物料
List<SysOaOutWarehouse> outWarehouses = outWarehouseMapper.List(projectId);
Double materialCost = 0.0;
if (!outWarehouses.isEmpty()) {
Map<Long, SysOaWarehouse> warehouseMap = warehouseMapper.selectList(Wrappers.lambdaQuery(SysOaWarehouse.class)).stream().collect(Collectors.toMap(SysOaWarehouse::getId, Function.identity()));
log.info("查询所有项目对应的物料:{}",warehouseMap);
materialCost = outWarehouses.stream().map(v -> {
Long warehouseId = v.getWarehouseId();
BigDecimal amount = BigDecimal.valueOf(v.getAmount());
SysOaWarehouse warehouse = warehouseMap.get(warehouseId);
if (warehouse == null) {
log.error("仓库信息不存在仓库ID: " + warehouseId);
return BigDecimal.ZERO;
}
BigDecimal price = BigDecimal.valueOf(warehouse.getPrice());
@@ -182,7 +174,6 @@ public class SysOaCostServiceImpl implements ISysOaCostService {
}).reduce(BigDecimal.ZERO, BigDecimal::add).doubleValue();
}
sysOaCostAllVo.setMaterialCost(materialCost);
// 3、 查询所有项目对应的工资费用
LambdaQueryWrapper<SysOaAttendance> lqw2 = Wrappers.lambdaQuery(SysOaAttendance.class);
lqw2.eq(SysOaAttendance::getProjectId, projectId);
@@ -196,7 +187,7 @@ public class SysOaCostServiceImpl implements ISysOaCostService {
double attendanceDay = Optional.ofNullable(attendance.getAttendanceDay()).orElse(0L);
double dayLength = Optional.ofNullable(attendance.getDayLength()).orElse(0.0);
double hour = Optional.ofNullable(attendance.getHour()).orElse(0.0);
return attendanceDay * dayLength * 9 + hour;
return (attendanceDay * dayLength * 9 + hour)/9;
})
));
// 获取user表中的劳务费用
@@ -207,7 +198,6 @@ public class SysOaCostServiceImpl implements ISysOaCostService {
Long userId = v.getUserId();
SysUser user = userMap.get(userId);
if (user == null) {
log.warn("用户ID信息不存在用户ID: {}", userId);
return BigDecimal.ZERO;
}
Long laborCost = Optional.ofNullable(user.getLaborCost()).orElse(0L);
@@ -218,9 +208,7 @@ public class SysOaCostServiceImpl implements ISysOaCostService {
}).reduce(BigDecimal.ZERO, BigDecimal::add).doubleValue();
}
sysOaCostAllVo.setUserCost(userCost);
// 4、 查询所有项目对应的差旅费用
List<SysOaClaim> claims = claimMapper.List(projectId);
Double claimCost = 0.0;
if (!claims.isEmpty()) {
@@ -232,12 +220,7 @@ public class SysOaCostServiceImpl implements ISysOaCostService {
sysOaCostAllVo.setCost(materialCost + userCost + claimCost);
// 6、 将 sysOaCostAllVo 添加到 sysOaCostAllVos 中
sysOaCostAllVos.add(sysOaCostAllVo);
log.info("查询项目对应的费用信息:{}", sysOaCostAllVo);
if (sysOaCostAllVo.getProjectId() == 1862663507129614338L) {
log.info("查询项目对应的费用信息:{}", sysOaCostAllVo);
}
}
log.info("查询所有项目对应的费用信息:{}", sysOaCostAllVos);
return TableDataInfo.build(sysOaCostAllVos);
}
@@ -246,7 +229,7 @@ public class SysOaCostServiceImpl implements ISysOaCostService {
* 查询详情
*/
@Override
public TableDataInfo<SysOaCostRow> getDetail(Long projectId) {
public SysOaCostRow getDetail(Long projectId) {
SysOaCostRow sysOaCostRow = new SysOaCostRow();
List<SysOaCostList> UserCostList = new ArrayList<>();
@@ -293,7 +276,7 @@ public class SysOaCostServiceImpl implements ISysOaCostService {
sysOaCostList.setUserId(userId);
sysOaCostList.setNickName(user.getNickName());
sysOaCostList.setLaborCost(laborCost * dayNum);
sysOaCostList.setAttendenceNum(dayNum);
sysOaCostList.setAttendanceNum(dayNum);
UserCostList.add(sysOaCostList);
}
@@ -324,7 +307,6 @@ public class SysOaCostServiceImpl implements ISysOaCostService {
lqw2.eq(SysOaClaim::getProjectId, projectId);
List<SysOaClaimVo> claims = claimMapper.selectVoList(lqw2);
Map<Long, SysOaClaimVo> claimMap = claims.stream().collect(Collectors.toMap(SysOaClaimVo::getClaimId, Function.identity()));
log.info("查询项目对应的差旅详情:{}", claims);
Set<Long> claimIds = claimMap.keySet();
if (!claims.isEmpty()) {
for (Long claimId : claimIds) {
@@ -337,15 +319,22 @@ public class SysOaCostServiceImpl implements ISysOaCostService {
ClaimList.add(sysOaCostList);
}
}
sysOaCostRow.setUserCostList(UserCostList);
sysOaCostRow.setMaterialList(MaterialList);
sysOaCostRow.setClaimList(ClaimList);
sysOaCostRow.setOtherList(OtherList);
List<SysOaCostRow> rows = new java.util.ArrayList<>(Collections.singletonList(sysOaCostRow));
return TableDataInfo.build(rows);
return sysOaCostRow;
}
@Override
public TableDataInfo<SysOaCostAllVo> calcProjectCostList(SysOaCostBo bo, PageQuery pageQuery) {
// 查询所有的项目拿到项目之后分别计算他们的各种成本联查四表
QueryWrapper<SysOaProjectBo> queryWrapper = new QueryWrapper<>();
queryWrapper.like(bo.getProjectName()!=null,"sop.project_name", bo.getProjectName());
queryWrapper.orderByDesc("sop.create_time");
Page<SysOaCostAllVo> sysOaCostAllVos = projectMapper.selectListToCost(pageQuery.build(),queryWrapper);
// 查询user laborCost 查attendance 拿签到
return TableDataInfo.build(sysOaCostAllVos);
}
}

View File

@@ -115,6 +115,39 @@
and soa.del_flag = '0'
group by sop.project_id,create_time
</select>
<select id="selectListToCost" resultType="com.ruoyi.oa.domain.vo.SysOaCostAllVo">
SELECT
sop.project_name,sop.project_num,sop.project_id,
(
SELECT COALESCE(SUM(soc.cost),0)
FROM sys_oa_claim soc
WHERE soc.project_id = sop.project_id
) AS claimCost,
(
SELECT COALESCE(SUM(soow.amount * sow.price),0)
FROM sys_oa_out_warehouse soow
JOIN sys_oa_warehouse sow ON soow.id = sow.id
WHERE soow.project_id = sop.project_id
) AS materialCost,
(
SELECT COALESCE(ROUND(SUM((soa.day_length * 9 + soa.hour) / 9),1), 0)
FROM sys_oa_attendance soa
WHERE soa.project_id = sop.project_id
) AS peopleDay,
(
SELECT COALESCE(SUM(ROUND((soa.day_length * 9 + soa.hour) / 9, 1) * su.labor_cost),0)
FROM sys_oa_attendance soa
JOIN sys_user su ON soa.user_id = su.user_id
WHERE soa.project_id = sop.project_id
) AS userCost
FROM sys_oa_project sop
${ew.getCustomSqlSegment}
</select>
</mapper>

View File

@@ -22,7 +22,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<select id="selectVoByIdAndXml" resultMap="SysOaWarehouseResult" parameterType="Long">
select id, inventory, model, unit, name, brand, specifications, remark, create_time, create_by, update_time, update_by, del_flag from sys_oa_warehouse where id = #{id}
select id, inventory, model, unit, name, brand, specifications, remark, create_time, create_by, update_time, update_by, del_flag
from sys_oa_warehouse
where id = #{id}
</select>

View File

@@ -95,13 +95,14 @@ export function delFinance(financeId) {
}
/**
*
*
* @returns 获取进出账管理列表
*/
export function getCostDetailList() {
export function getCostDetailList(query) {
return request({
url: '/oa/cost/list',
method: 'get'
method: 'get',
params:query
})
}
@@ -117,9 +118,9 @@ export function getCostDetailById(costId) {
}
/**
*
*
* @param {*} data 创建成本详情
* @returns
* @returns
*/
export function createCostDetail(data) {
return request({
@@ -130,13 +131,13 @@ export function createCostDetail(data) {
}
/**
*
*
* @param {*} costId 删除成本详情
* @returns
* @returns
*/
export function deleteCostDetail(costId) {
return request({
url: `/oa/cost/${costId}`,
method: 'delete'
})
}
}

View File

@@ -1,83 +1,39 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<!-- <el-form-item label="项目名" prop="projectId">-->
<!-- <el-input-->
<!-- v-model="queryParams.projectId"-->
<!-- placeholder="请输入项目名"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item>
<!-- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>-->
<el-form-item label="项目名" prop="projectName">
<el-input
v-model="queryParams.projectName"
placeholder="请输入项目名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['oa:oaOutWarehouse:add']"
>新增
</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['oa:oaOutWarehouse:remove']"
>删除
</el-button>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['oa:oaOutWarehouse:export']"
>导出
</el-button>
</el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="costList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="索引" align="center" type="index"/>
<el-table-column label="项目编号" align="center" prop="projectId"/>
<el-table-column label="序号" align="center" type="index"/>
<el-table-column label="项目名" align="center" prop="projectName"/>
<el-table-column label="成本" align="center" prop="cost"/>
<el-table-column label="成本类型" align="center" prop="costType"/>
<el-table-column label="备注" align="center" prop="remark"/>
<!-- <el-table-column label="备注" align="center" prop="remark">
<el-table-column label="人力花费" align="center" prop="userCost"/>
<el-table-column label="人天计算" align="center" prop="peopleDay"/>
<el-table-column label="报销花费" align="center" prop="claimCost"/>
<el-table-column label="物料花费" align="center" prop="materialCost"/>
<el-table-column label="综合成本" align="center" prop="cost">
<template slot-scope="scope">
<div v-if="scope.row.projectName!==null">
<el-tooltip class="item" effect="dark" :content="'点击查看'+scope.row.projectName+'的出库情况'" placement="bottom">
<el-button
size="mini"
type="text"
@click="handleSearch(scope.row)"
> {{ scope.row.projectName }}
</el-button>
</el-tooltip>
</div>
<div v-else>未关联项目</div>
<div>{{scope.row.materialCost+scope.row.userCost+scope.row.claimCost}}</div>
</template>
</el-table-column> -->
<el-table-column label="创建时间" align="center" prop="createTime"/>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@@ -205,88 +161,32 @@
</el-descriptions> -->
<el-tabs v-model="activeName" type="card">
<el-tab-pane label="claim成本" name="claim">
<el-tab-pane label="报销花费详情" name="claim">
<el-table v-loading="loading" :data="detailData.claimList">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="索引" align="center" type="index"/>
<el-table-column label="成本" align="center" prop="cost"/>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column> -->
<el-table-column label="花费" align="center" prop="cost"/>
<el-table-column label="申请人" align="center" prop="nickName"/>
<el-table-column label="备注" align="center" prop="remark"/>
</el-table>
</el-tab-pane>
<el-tab-pane label="material成本" name="material">
<el-tab-pane label="物料花费详情" name="material">
<el-table v-loading="loading" :data="detailData.materialList">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="索引" align="center" type="index"/>
<el-table-column label="成本" align="center" prop="cost"/>
<el-table-column label="材料品牌" align="center" prop="materialVo.brand"/>
<el-table-column label="材料型号" align="center" prop="materialVo.model"/>
<el-table-column label="材料名称" align="center" prop="materialVo.name"/>
<el-table-column label="材料库存" align="center" prop="materialVo.inventory"/>
<el-table-column label="材料单价" align="center" prop="materialVo.price"/>
<el-table-column label="材料单位" align="center" prop="materialVo.unit"/>
<el-table-column label="材料规格" align="center" prop="materialVo.specifications"/>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column> -->
<el-table-column label="材料编号" align="center" prop="materialId"/>
<el-table-column label="材料单价" align="center" prop="price"/>
<el-table-column label="物料名" align="center" prop="name"/>
<el-table-column label="出库数量" align="center" prop="amount"/>
</el-table>
</el-tab-pane>
<el-tab-pane label="other成本" name="other">
<el-table :data="detailData.otherList">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="索引" align="center" type="index"/>
<el-table-column label="成本" align="center" prop="cost"/>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column> -->
</el-table>
</el-tab-pane>
<el-tab-pane label="user成本" name="user">
<el-tab-pane label="人力成本" name="user">
<el-table :data="detailData.userCostList">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="索引" align="center" type="index"/>
<el-table-column label="成本" align="center" prop="cost"/>
<el-table-column label="人员名称" align="center" prop="userVo.userName"/>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column> -->
<el-table-column label="人员名称" align="center" prop="nickName"/>
<el-table-column label="人员成本" align="center" prop="laborCost"/>
<el-table-column label="签到次数" align="center" prop="attendanceNum"/>
</el-table>
</el-tab-pane>
</el-tabs>
@@ -298,35 +198,6 @@
<!-- 添加或修改仓库出库对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<!-- <el-form-item
label="绑定项目"
>
<el-radio-group v-model="projectFlag" :disabled="drawer">
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
v-if="projectFlag&&!drawer"
prop="projectId"
label="项目名"
>
<el-select v-model="form.projectId" placeholder="请选择项目">
<el-option
v-for="item in projectList"
:key="item.projectId"
:label="item.projectName"
:value="item.projectId">
</el-option>
</el-select>
</el-form-item>
<el-form-item
v-if="drawer"
label="项目名"
>
<el-input :value="selectedProject.projectName" disabled></el-input>
</el-form-item> -->
<el-form-item label="项目ID">
<el-input v-model="form.projectId"></el-input>
</el-form-item>
@@ -347,58 +218,6 @@
v-model="form.remark">
</el-input>
</el-form-item>
<!-- <el-form-item
v-for="(item, index) in form.outWareHouseList"
:label="'出库物料' + (index+1)"
:key="item.warehouseId"
:prop="'outWareHouseList.' + index + '.warehouseId'"
>
<el-row>
<el-col :span="8">物料名</el-col>
<el-col :span="4">当前库存</el-col>
<el-col :span="8">出库数量</el-col>
<el-col :span="4">操作</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-select
v-model="item.warehouseId"
filterable
remote
reserve-keyword
@change="(e)=>handleGetInventory(e,index)"
placeholder="请输入关键词"
:remote-method="remoteMethod"
:loading="loading">
<el-option
v-for="item in oaWarehouseList"
:key="item.id"
:label="item.name"
:value="item.id">
<span style="">{{ item.name }}</span>
<span style="color: #8492a6; font-size: 13px" v-if="item.model!==undefined">-{{ item.model }}</span>
<span style="color: #8492a6; font-size: 13px" v-if="item.brand!==undefined">-{{ item.brand }}</span>
</el-option>
</el-select>
</el-col>
<el-col :span="3">
<el-tag type="info" v-if="item.inventory===undefined">请选择物料</el-tag>
<el-tag type="info" v-else>{{ item.inventory }}</el-tag>
</el-col>
<el-col :span="6">
<el-input-number v-model="item.amount" :min="1" :max="item.inventory"></el-input-number>
</el-col>
<el-col :span="6" style="display: flex;justify-content: center" >
<el-button @click.prevent="removeDomain(item)">删除</el-button>
</el-col>
</el-row>
</el-form-item> -->
<!-- <el-form-item>
<el-button @click="addDomain">新增成本</el-button>
<el-button @click="reset()">重置</el-button>
</el-form-item> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
@@ -425,11 +244,14 @@
<el-table v-loading="loading" :data="oaOutWarehouseList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="序号" align="center" type="index"/>
<el-table-column label="出库单" align="center" prop="id"/>
<el-table-column label="物料名" align="center" prop="warehouseName"/>
<el-table-column label="物料名" align="center" prop="name"/>
<el-table-column label="出库数量" align="center" prop="amount"/>
<el-table-column label="出库时间" align="center" prop="createTime"/>
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="物料单价" align="center" prop="price"/>
<el-table-column label="总计花费" align="center" prop="remark">
<template slot-scope="scope">
<div>{{scope.row.amount*scope.row.price}}</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@@ -536,8 +358,8 @@ export default {
getList() {
this.loading = true;
getCostDetailList().then(res => {
console.log(res.rows)
getCostDetailList(this.queryParams).then(res => {
console.log(res)
this.costList = res.rows
this.total = res.total
this.loading = false
@@ -734,32 +556,10 @@ export default {
})
},
// 查看出库详情
handleSearch(item) {
this.loading = true
this.searchItem = item;
this.form.projectId = item.projectId;
this.selectedProject = item;
queryOutWarehouseByProjectId(item.projectId).then(response => {
this.oaOutWarehouseList = response.rows;
this.drawer = true;
this.loading = false;
})
},
// 查看出库单独条目详情
showDetail(row){
// getOaOutWarehouse(row.id).then(response => {
// console.log(response.data);
// this.outDetail = response.data;
// this.projectDetail = response.data.project;
// this.warehouseDetail = response.data.warehouse;
// })
// this.detail=true;
getCostDetailById(row.projectId).then(response => {
console.log(response.rows[0]);
this.detailData = response.rows[0];
this.detailData = response.data;
this.detail=true;
})
}