二级库模块前后端修改

This commit is contained in:
76164 2024-07-24 18:50:46 +08:00
parent 1e37e8aea8
commit 805f69de95
12 changed files with 267 additions and 130 deletions

View File

@ -86,5 +86,7 @@ public class MaPartType extends BaseEntity {
// @Excel(name = "年份") // @Excel(name = "年份")
private String year; private String year;
private String firstLevel;
} }

View File

@ -0,0 +1,11 @@
package com.bonus.sgzb.base.service;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
public interface ExcelService {
Map<String, Map<String, List<String>>> readExcelFile(String filePath);
}

View File

@ -54,9 +54,10 @@ public class SecondaryWarehouseController extends BaseController {
*/ */
@ApiOperation(value = "出库/退库操作") @ApiOperation(value = "出库/退库操作")
@PostMapping("/operate") @PostMapping("/operate")
@Log(title = "二级库管理--出库退库操作", businessType = BusinessType.MATERIAL) @Log(title = "二级库管理--出库退库操作")
public AjaxResult operate(TeamLeaseInfo bean){ public AjaxResult operate(@RequestBody TeamLeaseInfo bean){
return toAjax(service.addOperate(bean)); int i = service.addNewOperate(bean);
return toAjax(i);
} }
/** /**

View File

@ -11,7 +11,7 @@ import lombok.Data;
@Data @Data
public class SecondaryWarehouse { public class SecondaryWarehouse {
/** /**
* *
*/ */
private Long id; private Long id;
/** /**
@ -100,6 +100,7 @@ public class SecondaryWarehouse {
*/ */
@Excel(name = "计量单位") @Excel(name = "计量单位")
private String nuitName; private String nuitName;
private String keyword; private String keyword;
/** /**
@ -111,6 +112,14 @@ public class SecondaryWarehouse {
/** /**
* 领用数量 * 领用数量
*/ */
@Excel(name = "领用数量") private Integer Num;
/**
* 领用数量
*/
private Integer receiveNum; private Integer receiveNum;
/**
* 库存数量
*/
private Integer stockNum;
} }

View File

@ -1,8 +1,12 @@
package com.bonus.sgzb.material.domain; package com.bonus.sgzb.material.domain;
import com.bonus.sgzb.common.core.annotation.Excel; import com.bonus.sgzb.common.core.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/** /**
* @author c liu * @author c liu
@ -11,7 +15,7 @@ import lombok.Data;
@Data @Data
public class TeamLeaseInfo { public class TeamLeaseInfo {
/** /**
* *
*/ */
private Long id; private Long id;
/** /**
@ -27,6 +31,14 @@ public class TeamLeaseInfo {
*机具id *机具id
*/ */
private String maId; private String maId;
/**
*领料人
*/
private String pickName;
/**
*出库人
*/
private String nickName;
/** /**
* 查询时间 * 查询时间
*/ */
@ -108,5 +120,9 @@ public class TeamLeaseInfo {
*/ */
private String queryType; private String queryType;
private int outNum;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date outTime;
} }

View File

@ -32,4 +32,12 @@ public interface SecondaryWarehouseMapper {
* @return * @return
*/ */
List<TeamLeaseInfo> getRecordsFive(TeamLeaseInfo bean); List<TeamLeaseInfo> getRecordsFive(TeamLeaseInfo bean);
// List<TeamLeaseInfo> getNewRecordsFive(TeamLeaseInfo bean);
int addNewOperate(TeamLeaseInfo bean);
Integer selectStockNum(SecondaryWarehouse secondaryWarehouse);
List<TeamLeaseInfo> getNewRecords(TeamLeaseInfo bean);
} }

View File

@ -12,9 +12,13 @@ import java.util.List;
public interface SecondaryWarehouseService { public interface SecondaryWarehouseService {
List<SecondaryWarehouse> getList(SecondaryWarehouse bean); List<SecondaryWarehouse> getList(SecondaryWarehouse bean);
int addOperate(TeamLeaseInfo bean); // int addOperate(TeamLeaseInfo bean);
List<TeamLeaseInfo> getOperateList(TeamLeaseInfo bean); List<TeamLeaseInfo> getOperateList(TeamLeaseInfo bean);
List<TeamLeaseInfo> getRecords(TeamLeaseInfo bean); List<TeamLeaseInfo> getRecords(TeamLeaseInfo bean);
// List<TeamLeaseInfo> getNewRecords(TeamLeaseInfo bean);
int addNewOperate(TeamLeaseInfo bean);
} }

View File

@ -25,15 +25,24 @@ public class SecondaryWarehouseServiceImpl implements SecondaryWarehouseService
@Override @Override
public List<SecondaryWarehouse> getList(SecondaryWarehouse bean) { public List<SecondaryWarehouse> getList(SecondaryWarehouse bean) {
return mapper.getList(bean); List<SecondaryWarehouse> list = mapper.getList(bean);
for (SecondaryWarehouse secondaryWarehouse : list) {
Integer warehouse = mapper.selectStockNum(secondaryWarehouse);
if (warehouse == null) {
warehouse = 0;
}
secondaryWarehouse.setReceiveNum(warehouse);
secondaryWarehouse.setStockNum(secondaryWarehouse.getNum() - secondaryWarehouse.getReceiveNum());
}
return list;
} }
@Override // @Override
public int addOperate(TeamLeaseInfo bean) { // public int addOperate(TeamLeaseInfo bean) {
Long userid = SecurityUtils.getLoginUser().getUserid(); // Long userid = SecurityUtils.getLoginUser().getUserid();
bean.setCreateBy(String.valueOf(userid)); // bean.setCreateBy(String.valueOf(userid));
return mapper.addOperate(bean); // return mapper.addOperate(bean);
} // }
@Override @Override
public List<TeamLeaseInfo> getOperateList(TeamLeaseInfo bean) { public List<TeamLeaseInfo> getOperateList(TeamLeaseInfo bean) {
@ -42,25 +51,38 @@ public class SecondaryWarehouseServiceImpl implements SecondaryWarehouseService
@Override @Override
public List<TeamLeaseInfo> getRecords(TeamLeaseInfo bean) { public List<TeamLeaseInfo> getRecords(TeamLeaseInfo bean) {
List<TeamLeaseInfo> list = new ArrayList<>(); return mapper.getNewRecords(bean);
if (STRING_1.equals(bean.getQueryType())){
//进场数量
list = mapper.getRecordsOne(bean);
} else if (STRING_2.equals(bean.getQueryType())) {
//退场数量
list = mapper.getRecordsTwo(bean);
} else if (STRING_3.equals(bean.getQueryType())) {
//场内库存
list = mapper.getRecordsThree(bean);
} else if (STRING_4.equals(bean.getQueryType())) {
//已出库数量
list = mapper.getRecordsFour(bean);
} else if (STRING_5.equals(bean.getQueryType())) {
//已退库数量
list = mapper.getRecordsFive(bean);
} else {
throw new ServiceException("查询出错");
}
return list;
} }
@Override
public int addNewOperate(TeamLeaseInfo bean) {
Long userid = SecurityUtils.getLoginUser().getUserid();
bean.setCreateBy(String.valueOf(userid));
return mapper.addNewOperate(bean);
}
// @Override
// public List<TeamLeaseInfo> getNewRecords(TeamLeaseInfo bean) {
// List<TeamLeaseInfo> list = new ArrayList<>();
// if (STRING_1.equals(bean.getQueryType())){
// //进场数量
// list = mapper.getRecordsOne(bean);
// } else if (STRING_2.equals(bean.getQueryType())) {
// //退场数量
// list = mapper.getRecordsTwo(bean);
// } else if (STRING_3.equals(bean.getQueryType())) {
// //场内库存
// list = mapper.getRecordsThree(bean);
// } else if (STRING_4.equals(bean.getQueryType())) {
// //已出库数量
// list = mapper.getRecordsFour(bean);
// } else if (STRING_5.equals(bean.getQueryType())) {
// //已退库数量
// list = mapper.getNewRecordsFive(bean);
// } else {
// throw new ServiceException("查询出错");
// }
// return list;
// }
} }

View File

@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getList" resultType="com.bonus.sgzb.material.domain.SecondaryWarehouse"> <select id="getList" resultType="com.bonus.sgzb.material.domain.SecondaryWarehouse">
SELECT SELECT
bui.unit_id AS unitId, bui.unit_id AS unitId,
lod.id as id,
tta.agreement_id AS agreementId, tta.agreement_id AS agreementId,
bui.unit_name AS unitName, bui.unit_name AS unitName,
bp.lot_name AS proName, bp.lot_name AS proName,
@ -18,12 +19,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt.type_name AS modelName, mt.type_name AS modelName,
mt.unit_name AS nuitName, mt.unit_name AS nuitName,
lod.type_id AS typeId, lod.type_id AS typeId,
SUM( lod.out_num ) AS jcNum, IFNULL(SUM( lod.out_num ),0) AS Num
receive_num as receiveNmu,
-- SUM( CASE WHEN sai.`status` = '1' THEN sai.num ELSE 0 END ) AS tcNum,
-- SUM( CASE WHEN sai.`status` = '0' THEN sai.num ELSE 0 END ) - IFNULL( tli.num, 0 ) + IFNULL( tli2.num, 0 ) AS kcNum,
IFNULL( tli.num, 0 ) AS ckNum,
IFNULL( tli2.num, 0 ) AS zkNum
from lease_out_details lod from lease_out_details lod
left join lease_apply_info lai on lod.parent_id=lai.id left join lease_apply_info lai on lod.parent_id=lai.id
left join tm_task_agreement tta on lai.task_id=tta.task_id left join tm_task_agreement tta on lai.task_id=tta.task_id
@ -32,10 +29,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
LEFT JOIN ma_type mt ON lod.type_id = mt.type_id LEFT JOIN ma_type mt ON lod.type_id = mt.type_id
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
LEFT JOIN ( SELECT SUM( num ) AS num, agreement_id, type_id FROM team_lease_info WHERE type = '1' GROUP BY agreement_id, type_id ) tli ON tli.agreement_id = tta.agreement_id
AND tli.type_id = lod.type_id
LEFT JOIN ( SELECT SUM( num ) AS num, agreement_id, type_id FROM team_lease_info WHERE type = '2' GROUP BY agreement_id, type_id ) tli2 ON tli2.agreement_id = tta.agreement_id
AND tli2.type_id = lod.type_id
WHERE 1=1 WHERE 1=1
<if test="unitId != null and unitId != ''"> <if test="unitId != null and unitId != ''">
and bui.unit_id = #{unitId} and bui.unit_id = #{unitId}
@ -187,4 +180,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and DATE(tli.create_time) = #{startTime} and DATE(tli.create_time) = #{startTime}
</if> </if>
</select> </select>
</mapper> <select id="selectStockNum" resultType="java.lang.Integer">
SELECT
(
SUM(
IF
( rd.type = 1, rd.out_num, 0 )) - SUM(
IF
( rd.type = 2, rd.out_num, 0 ))) AS receiveNum
FROM
receive_detail rd
WHERE
parent_id = #{id}
</select>
<select id="getNewRecords" resultType="com.bonus.sgzb.material.domain.TeamLeaseInfo">
select mt.type_name modelName,
mt2.type_name typeName,
su.nick_name nickName,
rd.out_num outNum,
rd.pick_name pickName,
rd.out_time outTime
from receive_detail rd
left join ma_type mt on rd.type_id = mt.type_id
left join ma_type mt2 on mt.parent_id = mt2.type_id
left join sys_user su on rd.out_name = su.user_id
where 1=1
<if test="typeId != null and typeId != ''">
and mt2.type_id = #{typeId}
</if>
<if test="modelId != null and modelId != ''">
and mt.type_id = #{modelId}
</if>
</select>
<insert id="addNewOperate">
insert into receive_detail (parent_id,type_id,out_num,out_time,type,out_name)
values (#{id},#{typeId},#{outNum},now(),#{type},#{createBy});
</insert>
</mapper>

View File

@ -20,11 +20,11 @@ export function getOperateList(query) {
// 出库/退库操作 // 出库/退库操作
export function operate(query) { export function operate(data) {
return request({ return request({
url: '/material/secondaryWarehouse/operate', url: '/material/secondaryWarehouse/operate',
method: 'post', method: 'post',
params: query data
}) })
} }

View File

@ -148,6 +148,7 @@
</el-table-column> --> </el-table-column> -->
<el-table-column <el-table-column
align="center" align="center"
key="1"
label="序号" label="序号"
type="index" type="index"
:index=" :index="
@ -157,12 +158,15 @@
<el-table-column <el-table-column
label="单位名称" label="单位名称"
align="center" align="center"
key="2"
prop="unitName" prop="unitName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column
label="工程名称" label="工程名称"
align="center" align="center"
key="3"
prop="proName" prop="proName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
v-if="leaseType == 0" v-if="leaseType == 0"
@ -170,86 +174,76 @@
<el-table-column <el-table-column
label="类型名称" label="类型名称"
align="center" align="center"
key="4"
prop="typeName" prop="typeName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column
label="规格型号" label="规格型号"
align="center" align="center"
key="5"
prop="modelName" prop="modelName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column
label="计量单位" label="计量单位"
align="center" align="center"
key="6"
prop="nuitName" prop="nuitName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column
label="进场数量" label="总量"
align="center" align="center"
prop="jcNum" key="7"
:show-overflow-tooltip="true"
> prop="num"
<template slot-scope="scope"> :show-overflow-tooltip="true"
<span v-if="leaseType == 1"
class="clickText"
@click="openRecords(scope.row, 1)"
>{{ scope.row.jcNum }}</span
>
</template>
</el-table-column>
<el-table-column
label="退场数量"
align="center"
prop="tcNUm"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<span
class="clickText"
@click="openRecords(scope.row, 2)"
>{{ scope.row.tcNUm }}</span
>
</template>
</el-table-column>
<el-table-column
label="场内库存量"
align="center"
prop="kcNum"
:show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column
label="已出库数量" label="库存数量"
align="center" align="center"
prop="ckNum" key="8"
:show-overflow-tooltip="true"
> prop="stockNum"
<template slot-scope="scope"> :show-overflow-tooltip="true"
<span v-if="leaseType == 1"
class="clickText" />
@click="openRecords(scope.row, 4)"
>{{ scope.row.ckNum }}</span
>
</template>
</el-table-column>
<el-table-column <el-table-column
label="已退库数量" label="领用数量"
align="center" align="center"
prop="zkNum" key="9"
prop="receiveNum"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
v-if="leaseType == 1"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span <span
class="clickText" class="clickText"
@click="openRecords(scope.row, 5)" @click="openRecords(scope.row, 5)"
>{{ scope.row.zkNum }}</span >{{ scope.row.receiveNum }}</span
> >
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
label="在用数量"
align="center"
key="10"
prop="receiveNum"
:show-overflow-tooltip="true"
v-if="leaseType == 0"
/>
<el-table-column <el-table-column
label="操作" label="操作"
align="center" align="center"
key="11"
width="150" width="150"
v-if="leaseType == 1" v-if="leaseType == 1"
> >
@ -258,7 +252,7 @@
size="mini" size="mini"
type="primary" type="primary"
@click="handleOut(scope.row)" @click="handleOut(scope.row)"
v-if="parseInt(scope.row.kcNum) > 0" v-if="parseInt(scope.row.stockNum) > 0"
> >
出库 出库
</el-button> </el-button>
@ -267,9 +261,9 @@
type="warning" type="warning"
@click="handleIn(scope.row)" @click="handleIn(scope.row)"
v-if=" v-if="
parseInt(scope.row.ckNum) > 0 && parseInt(scope.row.receiveNum) > 0 &&
parseInt(scope.row.zkNum) < parseInt(scope.row.stockNum) <
parseInt(scope.row.ckNum) parseInt(scope.row.num)
" "
> >
退库 退库
@ -322,8 +316,8 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="出库数量" prop="num"> <el-form-item label="出库数量" prop="outNum">
<el-input v-model="form.num" placeholder="请输入出库数量" maxlength="20" /> <el-input v-model="form.outNum" placeholder="请输入出库数量" maxlength="20" />
</el-form-item> </el-form-item>
<el-form-item label="班组名称" prop="teamName"> <el-form-item label="班组名称" prop="teamName">
<el-input <el-input
@ -384,13 +378,13 @@
disabled disabled
/> />
</el-form-item> </el-form-item>
<el-form-item label="已出库数量" prop="ckNum"> <!-- <el-form-item label="已出库数量" prop="ckNum">
<el-input v-model="nform.ckNum" disabled /> <el-input v-model="nform.ckNum" disabled />
</el-form-item> </el-form-item>-->
<el-form-item label="退库数量" prop="num"> <el-form-item label="退库数量" prop="outNum">
<el-input <el-input
v-model="nform.num" v-model="nform.outNum"
placeholder="请输入退库数量" placeholder="请输入退库数量"
maxlength="50" maxlength="50"
/> />
@ -440,7 +434,7 @@
:inline="true" :inline="true"
label-width="80px" label-width="80px"
> >
<el-form-item label="记录时间" prop="startTime"> <!-- <el-form-item label="记录时间" prop="startTime">
<el-date-picker <el-date-picker
v-model="dialogQuery.startTime" v-model="dialogQuery.startTime"
style="width: 240px" style="width: 240px"
@ -448,7 +442,7 @@
type="date" type="date"
placeholder="记录时间" placeholder="记录时间"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>-->
<el-form-item label="类型名称" prop="typeName"> <el-form-item label="类型名称" prop="typeName">
<el-input v-model="dialogQuery.typeName" disabled /> <el-input v-model="dialogQuery.typeName" disabled />
</el-form-item> </el-form-item>
@ -500,23 +494,29 @@
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column
label="数量" label="出库数量"
align="center" align="center"
prop="num" prop="outNum"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column
label="记录时间" label="领料人员"
align="center" align="center"
prop="startTime" prop="pickName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column
label="操作类型" label="出库人员"
align="center" align="center"
prop="" prop="outName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column
label="出库时间"
align="center"
prop="outTime"
:show-overflow-tooltip="true"
/>
</el-table> </el-table>
<pagination <pagination
@ -589,7 +589,7 @@ export default {
form: {}, form: {},
// //
rules: { rules: {
num: [ outNum: [
{ {
required: true, required: true,
message: '出库数量不能为空', message: '出库数量不能为空',
@ -617,7 +617,7 @@ export default {
// 退 // 退
nform: {}, nform: {},
nrules: { nrules: {
num: [ outNum: [
{ {
required: true, required: true,
message: '退库数量不能为空', message: '退库数量不能为空',
@ -769,15 +769,16 @@ export default {
//1 //1
this.reset() this.reset()
// this.form = row; // this.form = row;
// console.log(row) console.log(row)
this.$set(this.form, 'id', row.id)
this.$set(this.form, 'agreementId', row.agreementId) this.$set(this.form, 'agreementId', row.agreementId)
this.$set(this.form, 'unitId', row.unitId) this.$set(this.form, 'unitId', row.unitId)
this.$set(this.form, 'typeId', row.typeId) this.$set(this.form, 'typeId', row.typeId)
this.$set(this.form, 'unitName', row.unitName) this.$set(this.form, 'unitName', row.unitName)
this.$set(this.form, 'typeName', row.typeName) this.$set(this.form, 'typeName', row.typeName)
this.$set(this.form, 'modelName', row.modelName) this.$set(this.form, 'modelName', row.modelName)
this.$set(this.form, 'zkNum', row.zkNum) this.$set(this.form, 'zkNum', row.stockNum)
this.$set(this.form, 'kcNum', row.kcNum) this.$set(this.form, 'kcNum', row.num)
// console.log(this.form) // console.log(this.form)
this.openOut = true this.openOut = true
this.title = '出库' this.title = '出库'
@ -785,7 +786,9 @@ export default {
handleIn(row) { handleIn(row) {
//2 //2
this.reset() this.reset()
console.log(row)
// this.nform = row; // this.nform = row;
this.$set(this.nform, 'id', row.id)
this.$set(this.nform, 'agreementId', row.agreementId) this.$set(this.nform, 'agreementId', row.agreementId)
this.$set(this.nform, 'unitId', row.unitId) this.$set(this.nform, 'unitId', row.unitId)
this.$set(this.nform, 'typeId', row.typeId) this.$set(this.nform, 'typeId', row.typeId)
@ -811,6 +814,7 @@ export default {
let param = {} let param = {}
param = this.form param = this.form
param.type = 1 param.type = 1
console.log(param)
operate(param).then((response) => { operate(param).then((response) => {
this.$modal.msgSuccess('操作成功') this.$modal.msgSuccess('操作成功')
this.openOut = false this.openOut = false
@ -846,19 +850,19 @@ export default {
openRecords(row, type) { openRecords(row, type) {
this.title = undefined this.title = undefined
this.openRecord = true this.openRecord = true
this.queryType = type /*this.queryType = type
this.dialogQuery.typeName = row.typeName this.dialogQuery.typeName = row.typeName
this.dialogQuery.agreementId = row.agreementId this.dialogQuery.agreementId = row.agreementId
this.dialogQuery.modelName = row.modelName this.dialogQuery.modelName = row.modelName
this.dialogQuery.unitId = row.unitId this.dialogQuery.unitId = row.unitId
this.dialogQuery.typeId = row.typeId this.dialogQuery.typeId = row.typeId*/
this.getDialogList() this.getDialogList()
}, },
/** 查询列表 */ /** 查询列表 */
getDialogList() { getDialogList() {
this.dialogQuery.queryType = this.queryType this.dialogQuery.queryType = this.queryType
getRecords(this.dialogQuery).then((response) => { getRecords().then((response) => {
this.dialogList = response.rows this.dialogList = response.rows
this.dialogTotal = response.total this.dialogTotal = response.total
}) })

View File

@ -260,10 +260,11 @@
> >
<el-upload <el-upload
ref="excelUpload" ref="excelUpload"
:http-request="(file) => excelUpload(file)" action="#"
:http-request="(file) => uploadExcel(file)"
accept=".xlsx, .xls" accept=".xlsx, .xls"
:limit="1" :limit="1"
:file-list="excelList" :file-list="fileList"
> >
<el-button size="small" type="primary">点击上传</el-button> <el-button size="small" type="primary">点击上传</el-button>
</el-upload> </el-upload>
@ -284,8 +285,14 @@
align-items: center; align-items: center;
margin-top: 20px margin-top: 20px
"> ">
<el-button type="primary" style="margin-right: 15px;">确定</el-button> <el-button
<el-button>取消</el-button> type="primary"
style="margin-right: 6px;"
@click="confirmUpload"
>确定</el-button>
<el-button
@click="closeExcelDialog"
>取消</el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -376,16 +383,34 @@ export default {
}, },
isEdit: false, isEdit: false,
// excel // excel
excelList: [] fileList: [],
excelList: {}
} }
}, },
created() { created() {
this.getList() this.getList()
}, },
methods: { methods: {
/** 确认上传excel */
confirmUpload() {
console.log(this.fileList)
fileUpLoad(this.excelList).then(res => {
console.log(res)
if (res.code == 200) {
this.$modal.msgSuccess(res.msg)
this.openUpload = false
this.reset()
this.getList()
} else {
this.$modal.msgError(res.msg)
}
}).catch(err => {
console.log(err)
})
},
/** 上传excel文件 */ /** 上传excel文件 */
uploadExcel(file) { uploadExcel(obj) {
console.log(file) this.excelList = obj
}, },
/** 上传excel文件前 */ /** 上传excel文件前 */
beforeExcelUpload(file) { beforeExcelUpload(file) {
@ -399,6 +424,11 @@ export default {
excelError() { excelError() {
console.log('上传失败') console.log('上传失败')
}, },
/** 关闭excel弹窗 */
closeExcelDialog() {
this.excelList = {}
this.openUpload = false
},
/** 查询部门列表 */ /** 查询部门列表 */
getList() { getList() {
console.log(this.queryParams) console.log(this.queryParams)
@ -464,7 +494,7 @@ export default {
handleUploadExcel() { handleUploadExcel() {
this.reset() this.reset()
this.openUpload = true this.openUpload = true
}, },
/** 展开/折叠操作 */ /** 展开/折叠操作 */
toggleExpandAll() { toggleExpandAll() {
this.refreshTable = false this.refreshTable = false