空管耐用品库存管理前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

358 lines
8.7 KiB

5 months ago
<template>
<div>
<basic-container>
4 months ago
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
ref="crud"
v-model="form"
:page.sync="page"
:permission="permissionList"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
>
<template slot-scope="scope" slot="menu">
<el-button
v-if="scope.row.status == '未归还'"
type="text"
size="small"
@click.stop="handleReturn(scope.row)"
>归还
</el-button>
<el-button
type="text"
size="small"
@click.stop="handleScrap(scope.row)"
v-if="scope.row.status == '未归还'"
>报废
</el-button>
</template>
</avue-crud>
</basic-container>
5 months ago
<!-- 归还 -->
4 months ago
<el-dialog
title="归还"
:visible.sync="dialogReturnVisible"
width="30%"
:close-on-click-modal="false"
:append-to-body="true"
>
5 months ago
<el-form ref="form" :model="returnForm" label-width="100px">
<el-form-item label="归还数量">
4 months ago
<el-input-number
v-model="returnForm.count"
:min="1"
></el-input-number>
5 months ago
</el-form-item>
<el-form-item label="归还理由">
4 months ago
<el-input
v-model="returnForm.rmark"
type="textarea"
:rows="3"
placeholder="请输入内容"
></el-input>
5 months ago
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogReturnVisible = false"> </el-button>
<el-button type="primary" @click="returnSave()"> </el-button>
</span>
</el-dialog>
4 months ago
<!-- 报废 -->
<el-dialog
title="报废"
:visible.sync="dialogScrapVisible"
width="30%"
:close-on-click-modal="false"
:append-to-body="true"
>
<el-form ref="form" :model="scrapForm" label-width="100px">
<el-form-item label="报废数量">
<el-input-number v-model="scrapForm.count" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="报废理由">
<el-input
v-model="scrapForm.rmark"
type="textarea"
:rows="3"
placeholder="请输入内容"
></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogScrapVisible = false"> </el-button>
<el-button type="primary" @click="scrapSave()"> </el-button>
</span>
</el-dialog>
5 months ago
</div>
</template>
<script>
import { mapGetters } from "vuex";
4 months ago
import { getList } from "@/api/materials/expend";
5 months ago
export default {
data() {
return {
form: {},
selectionList: [],
query: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
4 months ago
total: 0,
5 months ago
},
option: {
4 months ago
height: "auto",
5 months ago
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 6,
border: true,
index: true,
selection: true,
viewBtn: true,
dialogClickModal: false,
menu: true,
selection: false,
printBtn: false,
refreshBtn: false,
gridBtn: false,
gridBackgroundImage: false,
gridSpan: false,
filterBtn: false,
columnBtn: false,
column: [
{
label: "编号",
prop: "no",
},
{
label: "部门",
prop: "str8",
search: true,
4 months ago
type: "select",
dicData: [
{
label: "部门一",
value: 0,
},
{
label: "部门二",
value: 1,
},
],
5 months ago
},
{
label: "名称",
prop: "name",
search: true,
},
{
label: "规格型号",
prop: "xh",
},
{
label: "类别",
prop: "lb",
},
{
label: "计量单位",
prop: "unit",
},
{
label: "数量",
prop: "number",
},
{
label: "单价",
prop: "dj",
},
{
label: "金额",
prop: "pice",
4 months ago
},
{
5 months ago
label: "状态",
prop: "status",
4 months ago
},
{
5 months ago
label: "归还时间",
prop: "time",
4 months ago
},
],
5 months ago
},
data: [],
dialogReturnVisible: false,
returnInfo: {},
returnForm: {
count: 0,
4 months ago
rmark: "",
5 months ago
},
4 months ago
dialogScrapVisible: false,
5 months ago
scrapInfo: {},
scrapForm: {
count: 0,
4 months ago
rmark: "",
5 months ago
},
dialogLogVisible: false,
4 months ago
activeName: "first",
5 months ago
tableData: [],
ckTable: [
4 months ago
{ str1: "3", str2: "2025-04-09", str3: "部门一" },
{ str1: "37", str2: "2025-04-03", str3: "部门一" },
5 months ago
],
rkTable: [
4 months ago
{ str1: "5", str2: "2025-03-19", str3: "部门二" },
{ str1: "12", str2: "2025-03-19", str3: "部门二" },
5 months ago
],
bfTable: [
4 months ago
{ str1: "9", str2: "2025-03-19", str3: "部门三" },
{ str1: "19", str2: "2025-03-19", str3: "部门三" },
5 months ago
],
};
},
computed: {
...mapGetters(["userInfo", "permission"]),
permissionList() {
return {
addBtn: false,
viewBtn: false,
delBtn: false,
4 months ago
editBtn: false,
5 months ago
};
},
ids() {
let ids = [];
4 months ago
this.selectionList.forEach((ele) => {
5 months ago
ids.push(ele.id);
});
return ids.join(",");
4 months ago
},
5 months ago
},
mounted() {
4 months ago
this.tableData = this.ckTable;
5 months ago
},
methods: {
handleLog() {
4 months ago
this.dialogLogVisible = true;
5 months ago
},
handleTabClick(tab, event) {
console.log(tab, event);
4 months ago
if (this.activeName == "first") {
this.tableData = this.ckTable;
5 months ago
}
4 months ago
if (this.activeName == "second") {
this.tableData = this.rkTable;
5 months ago
}
4 months ago
if (this.activeName == "third") {
this.tableData = this.bfTable;
5 months ago
}
},
handlePreview(name) {
4 months ago
this.$router.push({
path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.design.reportUrl}/preview?_u=blade-${name}`,
});
5 months ago
},
handleDesign(name) {
4 months ago
this.$router.push({
path: `/myiframe/urlPath?name=designer-${name}&src=${this.website.design.reportUrl}/designer?_u=blade-${name}`,
});
5 months ago
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
4 months ago
this.data.push(
{
no: "00100001",
name: "物品1",
xh: "1",
lb: "耐用品",
unit: "11",
number: "1",
dj: "11",
pice: "11",
status: "未归还",
str8: "部门一",
},
{
no: "00100002",
name: "物品2",
xh: "2",
lb: "耐用品",
unit: "22",
number: "1",
dj: "11",
pice: "22",
status: "已归还",
time: "2024-01-04",
str8: "部门二",
}
);
this.loading = false;
5 months ago
},
// 归还
handleReturn(row) {
4 months ago
this.dialogReturnVisible = true;
this.returnInfo = JSON.parse(JSON.stringify(row));
5 months ago
},
returnSave() {
4 months ago
this.dialogReturnVisible = false;
5 months ago
this.$message({
type: "success",
4 months ago
message: "归还成功",
5 months ago
});
},
// 报废
4 months ago
handleScrap(row) {
this.dialogScrapVisible = true;
this.scrapInfo = JSON.parse(JSON.stringify(row));
5 months ago
},
4 months ago
scrapSave() {
this.dialogScrapVisible = false;
5 months ago
this.$message({
type: "success",
4 months ago
message: "报废成功",
5 months ago
});
4 months ago
},
},
5 months ago
};
</script>