parent
2cdbde7910
commit
2447347288
@ -0,0 +1,114 @@
|
||||
package com.example.controller;
|
||||
|
||||
import com.example.common.Result;
|
||||
import com.example.entity.Account;
|
||||
import com.example.entity.CarrierDestruction;
|
||||
import com.example.service.CarrierDestructionService;
|
||||
import com.example.utils.TokenUtils;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 载体销毁申请Controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/destruction")
|
||||
public class CarrierDestructionController {
|
||||
|
||||
@Resource
|
||||
private CarrierDestructionService destructionService;
|
||||
|
||||
/**
|
||||
* 提交销毁申请
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
public Result submit(@RequestBody CarrierDestruction destruction) {
|
||||
// 获取当前用户信息
|
||||
Account currentUser = TokenUtils.getCurrentUser();
|
||||
destruction.setApplicantId(currentUser.getId());
|
||||
destruction.setApplicantName(currentUser.getName());
|
||||
|
||||
destructionService.submitApplication(destruction);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批销毁申请
|
||||
*/
|
||||
@PostMapping("/approve")
|
||||
public Result approve(@RequestBody CarrierDestruction destruction) {
|
||||
// 获取当前用户信息
|
||||
Account currentUser = TokenUtils.getCurrentUser();
|
||||
|
||||
destructionService.approve(
|
||||
destruction.getId(),
|
||||
destruction.getStatus(),
|
||||
destruction.getApprovalOpinion(),
|
||||
currentUser.getId(),
|
||||
currentUser.getName()
|
||||
);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除
|
||||
*/
|
||||
@DeleteMapping("/delete/{id}")
|
||||
public Result deleteById(@PathVariable Integer id) {
|
||||
destructionService.deleteById(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*/
|
||||
@GetMapping("/selectById/{id}")
|
||||
public Result selectById(@PathVariable Integer id) {
|
||||
CarrierDestruction destruction = destructionService.selectById(id);
|
||||
return Result.success(destruction);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有
|
||||
*/
|
||||
@GetMapping("/selectAll")
|
||||
public Result selectAll(CarrierDestruction destruction) {
|
||||
List<CarrierDestruction> list = destructionService.selectAll(destruction);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/selectPage")
|
||||
public Result selectPage(@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(required = false) Integer applicantId,
|
||||
@RequestParam(required = false) String status) {
|
||||
PageInfo<CarrierDestruction> page = destructionService.selectPage(pageNum, pageSize, applicantId, status);
|
||||
return Result.success(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我的申请
|
||||
*/
|
||||
@GetMapping("/myApplications")
|
||||
public Result myApplications(@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize) {
|
||||
Account currentUser = TokenUtils.getCurrentUser();
|
||||
PageInfo<CarrierDestruction> page = destructionService.selectPage(pageNum, pageSize, currentUser.getId(), null);
|
||||
return Result.success(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询待审批数量
|
||||
*/
|
||||
@GetMapping("/countPending")
|
||||
public Result countPending() {
|
||||
int count = destructionService.countPending();
|
||||
return Result.success(count);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package com.example.mapper;
|
||||
|
||||
import com.example.entity.CarrierDestruction;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 载体销毁申请Mapper接口
|
||||
*/
|
||||
public interface CarrierDestructionMapper {
|
||||
|
||||
/**
|
||||
* 新增销毁申请
|
||||
*/
|
||||
int insert(CarrierDestruction destruction);
|
||||
|
||||
/**
|
||||
* 根据ID删除
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
/**
|
||||
* 更新销毁申请
|
||||
*/
|
||||
int updateById(CarrierDestruction destruction);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*/
|
||||
CarrierDestruction selectById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询所有销毁申请
|
||||
*/
|
||||
List<CarrierDestruction> selectAll(CarrierDestruction destruction);
|
||||
|
||||
/**
|
||||
* 根据申请人ID查询
|
||||
*/
|
||||
List<CarrierDestruction> selectByApplicantId(@Param("applicantId") Integer applicantId);
|
||||
|
||||
/**
|
||||
* 根据状态查询
|
||||
*/
|
||||
List<CarrierDestruction> selectByStatus(@Param("status") String status);
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.example.mapper.CarrierDestructionMapper">
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, carrier_id as carrierId, carrier_name as carrierName, carrier_serial_no as carrierSerialNo,
|
||||
applicant_id as applicantId, applicant_name as applicantName, reason, status,
|
||||
approver_id as approverId, approver_name as approverName, approval_opinion as approvalOpinion,
|
||||
approval_time as approvalTime, create_time as createTime, update_time as updateTime
|
||||
</sql>
|
||||
|
||||
<!-- 新增销毁申请 -->
|
||||
<insert id="insert" parameterType="com.example.entity.CarrierDestruction" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO carrier_destruction
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="carrierId != null">carrier_id,</if>
|
||||
<if test="carrierName != null">carrier_name,</if>
|
||||
<if test="carrierSerialNo != null">carrier_serial_no,</if>
|
||||
<if test="applicantId != null">applicant_id,</if>
|
||||
<if test="applicantName != null">applicant_name,</if>
|
||||
<if test="reason != null">reason,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="approverId != null">approver_id,</if>
|
||||
<if test="approverName != null">approver_name,</if>
|
||||
<if test="approvalOpinion != null">approval_opinion,</if>
|
||||
<if test="approvalTime != null">approval_time,</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="carrierId != null">#{carrierId},</if>
|
||||
<if test="carrierName != null">#{carrierName},</if>
|
||||
<if test="carrierSerialNo != null">#{carrierSerialNo},</if>
|
||||
<if test="applicantId != null">#{applicantId},</if>
|
||||
<if test="applicantName != null">#{applicantName},</if>
|
||||
<if test="reason != null">#{reason},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="approverId != null">#{approverId},</if>
|
||||
<if test="approverName != null">#{approverName},</if>
|
||||
<if test="approvalOpinion != null">#{approvalOpinion},</if>
|
||||
<if test="approvalTime != null">#{approvalTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 根据ID删除 -->
|
||||
<delete id="deleteById">
|
||||
DELETE FROM carrier_destruction WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<!-- 更新销毁申请 -->
|
||||
<update id="updateById" parameterType="com.example.entity.CarrierDestruction">
|
||||
UPDATE carrier_destruction
|
||||
<set>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="approverId != null">approver_id = #{approverId},</if>
|
||||
<if test="approverName != null">approver_name = #{approverName},</if>
|
||||
<if test="approvalOpinion != null">approval_opinion = #{approvalOpinion},</if>
|
||||
<if test="approvalTime != null">approval_time = #{approvalTime},</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 根据ID查询 -->
|
||||
<select id="selectById" resultType="com.example.entity.CarrierDestruction">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM carrier_destruction
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- 查询所有销毁申请 -->
|
||||
<select id="selectAll" resultType="com.example.entity.CarrierDestruction">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM carrier_destruction
|
||||
<where>
|
||||
<if test="carrierId != null">AND carrier_id = #{carrierId}</if>
|
||||
<if test="applicantId != null">AND applicant_id = #{applicantId}</if>
|
||||
<if test="status != null and status != ''">AND status = #{status}</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据申请人ID查询 -->
|
||||
<select id="selectByApplicantId" resultType="com.example.entity.CarrierDestruction">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM carrier_destruction
|
||||
WHERE applicant_id = #{applicantId}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据状态查询 -->
|
||||
<select id="selectByStatus" resultType="com.example.entity.CarrierDestruction">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM carrier_destruction
|
||||
WHERE status = #{status}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.example.mapper.CarrierDestructionMapper">
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, carrier_id as carrierId, carrier_name as carrierName, carrier_serial_no as carrierSerialNo,
|
||||
applicant_id as applicantId, applicant_name as applicantName, reason, status,
|
||||
approver_id as approverId, approver_name as approverName, approval_opinion as approvalOpinion,
|
||||
approval_time as approvalTime, create_time as createTime, update_time as updateTime
|
||||
</sql>
|
||||
|
||||
<!-- 新增销毁申请 -->
|
||||
<insert id="insert" parameterType="com.example.entity.CarrierDestruction" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO carrier_destruction
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="carrierId != null">carrier_id,</if>
|
||||
<if test="carrierName != null">carrier_name,</if>
|
||||
<if test="carrierSerialNo != null">carrier_serial_no,</if>
|
||||
<if test="applicantId != null">applicant_id,</if>
|
||||
<if test="applicantName != null">applicant_name,</if>
|
||||
<if test="reason != null">reason,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="approverId != null">approver_id,</if>
|
||||
<if test="approverName != null">approver_name,</if>
|
||||
<if test="approvalOpinion != null">approval_opinion,</if>
|
||||
<if test="approvalTime != null">approval_time,</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="carrierId != null">#{carrierId},</if>
|
||||
<if test="carrierName != null">#{carrierName},</if>
|
||||
<if test="carrierSerialNo != null">#{carrierSerialNo},</if>
|
||||
<if test="applicantId != null">#{applicantId},</if>
|
||||
<if test="applicantName != null">#{applicantName},</if>
|
||||
<if test="reason != null">#{reason},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="approverId != null">#{approverId},</if>
|
||||
<if test="approverName != null">#{approverName},</if>
|
||||
<if test="approvalOpinion != null">#{approvalOpinion},</if>
|
||||
<if test="approvalTime != null">#{approvalTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 根据ID删除 -->
|
||||
<delete id="deleteById">
|
||||
DELETE FROM carrier_destruction WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<!-- 更新销毁申请 -->
|
||||
<update id="updateById" parameterType="com.example.entity.CarrierDestruction">
|
||||
UPDATE carrier_destruction
|
||||
<set>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="approverId != null">approver_id = #{approverId},</if>
|
||||
<if test="approverName != null">approver_name = #{approverName},</if>
|
||||
<if test="approvalOpinion != null">approval_opinion = #{approvalOpinion},</if>
|
||||
<if test="approvalTime != null">approval_time = #{approvalTime},</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 根据ID查询 -->
|
||||
<select id="selectById" resultType="com.example.entity.CarrierDestruction">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM carrier_destruction
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- 查询所有销毁申请 -->
|
||||
<select id="selectAll" resultType="com.example.entity.CarrierDestruction">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM carrier_destruction
|
||||
<where>
|
||||
<if test="carrierId != null">AND carrier_id = #{carrierId}</if>
|
||||
<if test="applicantId != null">AND applicant_id = #{applicantId}</if>
|
||||
<if test="status != null and status != ''">AND status = #{status}</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据申请人ID查询 -->
|
||||
<select id="selectByApplicantId" resultType="com.example.entity.CarrierDestruction">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM carrier_destruction
|
||||
WHERE applicant_id = #{applicantId}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据状态查询 -->
|
||||
<select id="selectByStatus" resultType="com.example.entity.CarrierDestruction">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM carrier_destruction
|
||||
WHERE status = #{status}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,219 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="margin-bottom: 20px">
|
||||
<el-button type="primary" @click="handleAdd">
|
||||
<i class="el-icon-plus"></i> 提交销毁申请
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<div class="search">
|
||||
<el-select v-model="status" placeholder="请选择状态" style="width: 150px" clearable>
|
||||
<el-option label="待审批" value="PENDING" />
|
||||
<el-option label="已通过" value="APPROVED" />
|
||||
<el-option label="已拒绝" value="REJECTED" />
|
||||
</el-select>
|
||||
<el-button type="primary" style="margin-left: 10px" @click="load(1)">查询</el-button>
|
||||
<el-button type="info" style="margin-left: 10px" @click="reset">重置</el-button>
|
||||
</div>
|
||||
|
||||
<div class="table">
|
||||
<el-table :data="tableData" stripe>
|
||||
<el-table-column prop="id" label="ID" width="60" sortable></el-table-column>
|
||||
<el-table-column prop="carrierName" label="载体名称" width="150"></el-table-column>
|
||||
<el-table-column prop="carrierSerialNo" label="序列号" width="150"></el-table-column>
|
||||
<el-table-column prop="reason" label="销毁原因" min-width="200" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="status" label="状态" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status === 'PENDING'" type="warning" size="small">待审批</el-tag>
|
||||
<el-tag v-else-if="scope.row.status === 'APPROVED'" type="success" size="small">已通过</el-tag>
|
||||
<el-tag v-else-if="scope.row.status === 'REJECTED'" type="danger" size="small">已拒绝</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="approverName" label="审批人" width="120"></el-table-column>
|
||||
<el-table-column prop="approvalOpinion" label="审批意见" width="150" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="createTime" label="申请时间" width="160"></el-table-column>
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="primary" @click="handleView(scope.row)">查看</el-button>
|
||||
<el-button v-if="scope.row.status === 'PENDING'" size="mini" type="danger" @click="handleDelete(scope.row.id)">撤回</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="pagination">
|
||||
<el-pagination
|
||||
background
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageNum"
|
||||
:page-size="pageSize"
|
||||
layout="total, prev, pager, next"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 提交申请对话框 -->
|
||||
<el-dialog title="提交销毁申请" :visible.sync="formDialogVisible" width="600px" @close="resetForm">
|
||||
<el-form :model="form" :rules="rules" ref="formRef" label-width="100px">
|
||||
<el-form-item label="选择载体" prop="carrierId">
|
||||
<el-select v-model="form.carrierId" placeholder="请选择载体" filterable style="width: 100%">
|
||||
<el-option
|
||||
v-for="carrier in carrierList"
|
||||
:key="carrier.id"
|
||||
:label="`${carrier.name} - ${carrier.serialNo}`"
|
||||
:value="carrier.id">
|
||||
<span style="float: left">{{ carrier.name }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ carrier.serialNo }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="销毁原因" prop="reason">
|
||||
<el-input
|
||||
v-model="form.reason"
|
||||
type="textarea"
|
||||
:rows="5"
|
||||
placeholder="请详细说明载体销毁的原因"
|
||||
maxlength="500"
|
||||
show-word-limit>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer">
|
||||
<el-button @click="formDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="save">提交申请</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 查看详情对话框 -->
|
||||
<el-dialog title="销毁申请详情" :visible.sync="detailDialogVisible" width="700px">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="申请ID">{{ currentRow.id }}</el-descriptions-item>
|
||||
<el-descriptions-item label="状态">
|
||||
<el-tag v-if="currentRow.status === 'PENDING'" type="warning" size="small">待审批</el-tag>
|
||||
<el-tag v-else-if="currentRow.status === 'APPROVED'" type="success" size="small">已通过</el-tag>
|
||||
<el-tag v-else-if="currentRow.status === 'REJECTED'" type="danger" size="small">已拒绝</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="载体名称">{{ currentRow.carrierName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="载体序列号">{{ currentRow.carrierSerialNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请人">{{ currentRow.applicantName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请时间">{{ currentRow.createTime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="销毁原因" :span="2">
|
||||
<div style="white-space: pre-wrap">{{ currentRow.reason }}</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审批人">{{ currentRow.approverName || '—' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="审批时间">{{ currentRow.approvalTime || '—' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="审批意见" :span="2">
|
||||
<div style="white-space: pre-wrap">{{ currentRow.approvalOpinion || '—' }}</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div slot="footer">
|
||||
<el-button @click="detailDialogVisible = false">关闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'CarrierDestructionApply',
|
||||
data() {
|
||||
return {
|
||||
status: '',
|
||||
tableData: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
formDialogVisible: false,
|
||||
detailDialogVisible: false,
|
||||
form: {},
|
||||
currentRow: {},
|
||||
carrierList: [],
|
||||
rules: {
|
||||
carrierId: [{ required: true, message: '请选择载体', trigger: 'change' }],
|
||||
reason: [{ required: true, message: '请填写销毁原因', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.load(1)
|
||||
},
|
||||
methods: {
|
||||
async load(pageNum) {
|
||||
if (pageNum) this.pageNum = pageNum
|
||||
const res = await this.$request.get('/destruction/myApplications', {
|
||||
params: {
|
||||
pageNum: this.pageNum,
|
||||
pageSize: this.pageSize,
|
||||
status: this.status
|
||||
}
|
||||
})
|
||||
this.tableData = res.data?.list || []
|
||||
this.total = res.data?.total || 0
|
||||
},
|
||||
reset() {
|
||||
this.status = ''
|
||||
this.load(1)
|
||||
},
|
||||
async handleAdd() {
|
||||
// 加载在库载体列表
|
||||
const res = await this.$request.get('/carrier/selectAll', {
|
||||
params: { status: 'IN_STOCK' }
|
||||
})
|
||||
this.carrierList = res.data || []
|
||||
this.formDialogVisible = true
|
||||
},
|
||||
async save() {
|
||||
this.$refs.formRef.validate(async (valid) => {
|
||||
if (valid) {
|
||||
await this.$request.post('/destruction/submit', this.form)
|
||||
this.$message.success('申请提交成功')
|
||||
this.formDialogVisible = false
|
||||
this.load(1)
|
||||
}
|
||||
})
|
||||
},
|
||||
handleView(row) {
|
||||
this.currentRow = row
|
||||
this.detailDialogVisible = true
|
||||
},
|
||||
handleDelete(id) {
|
||||
this.$confirm('确定要撤回此申请吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
await this.$request.delete('/destruction/delete/' + id)
|
||||
this.$message.success('撤回成功')
|
||||
this.load(this.pageNum)
|
||||
})
|
||||
},
|
||||
handleCurrentChange(pageNum) {
|
||||
this.load(pageNum)
|
||||
},
|
||||
resetForm() {
|
||||
this.form = {}
|
||||
this.$refs.formRef && this.$refs.formRef.resetFields()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.search {
|
||||
padding: 10px;
|
||||
background-color: #fff;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.table {
|
||||
padding: 10px;
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
margin-top: 10px;
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in new issue