空管耐用品库存管理前端
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.

290 lines
7.0 KiB

6 months ago
<template>
<div>
<basic-container>
5 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="isBorrow" slot-scope="scope">
<span v-if="scope.row.isBorrow == '0'">已借出</span>
<span v-else-if="scope.row.isBorrow == '1'">已归还</span>
<span v-else-if="scope.row.isBorrow == '2'">已报废</span>
</template>
5 months ago
<template slot-scope="scope" slot="menu">
<el-button
v-if="scope.row.isBorrow == '0'"
5 months ago
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.isBorrow == '0'"
5 months ago
>报废
</el-button>
</template>
</avue-crud>
</basic-container>
5 months ago
5 months ago
<!-- 归还 -->
<returnDialog
v-if="returnShow"
:showDialog="returnShow"
:rowDta="returnInfo"
@closeDialog="closeDialog"
:durableFormId="returnInfo.id"
5 months ago
@submitSuccess="handleRefresh"
5 months ago
></returnDialog>
5 months ago
<!-- 报废 -->
5 months ago
<scrapDialog
v-if="scrapShow"
:showDialog="scrapShow"
:rowDta="scrapInfo"
@closeDialog="closeDialog"
:durableFormId="scrapInfo.id"
5 months ago
@submitSuccess="handleRefresh"
5 months ago
></scrapDialog>
6 months ago
</div>
</template>
<script>
import { mapGetters } from "vuex";
5 months ago
import { getList } from "@/api/materials/expend";
5 months ago
import returnDialog from "./components/returnDialog.vue";
import scrapDialog from "./components/scrapDialog.vue";
6 months ago
export default {
5 months ago
components: {
returnDialog,
scrapDialog,
},
6 months ago
data() {
return {
5 months ago
returnShow: false, //归还
scrapShow: false, //报废
6 months ago
form: {},
selectionList: [],
query: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
5 months ago
total: 0,
6 months ago
},
option: {
5 months ago
height: "auto",
6 months ago
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 18,
6 months ago
border: true,
index: true,
// selection: true,
5 months ago
viewBtn: false,
addBtn: false,
editBtn: false,
delBtn: false,
6 months ago
dialogClickModal: false,
menu: true,
selection: false,
printBtn: false,
refreshBtn: false,
gridBtn: false,
gridBackgroundImage: false,
gridSpan: false,
filterBtn: false,
columnBtn: false,
menuAlign: "left",
searchMenuPosition: "right",
menuWidth: 120,
6 months ago
column: [
{
label: "部门",
prop: "department",
headerAlign: "center",
align: "center",
},
6 months ago
{
label: "编号",
prop: "materialCode",
headerAlign: "center",
align: "center",
// width: 160,
6 months ago
},
{
label: "名称",
prop: "materialName",
6 months ago
search: true,
headerAlign: "center",
align: "center",
searchLabelWidth: 50
6 months ago
},
{
label: "规格型号",
prop: "model",
headerAlign: "center",
align: "center",
6 months ago
},
{
label: "类别",
prop: "type",
headerAlign: "center",
align: "center",
type: "select",
dicDta: [
{
label: "易耗品",
value: "YH",
},
{
label: "耐用品",
value: "NY",
},
],
6 months ago
},
{
label: "计量单位",
prop: "unit",
headerAlign: "center",
align: "center",
6 months ago
},
{
label: "数量",
prop: "num",
headerAlign: "center",
align: "center",
6 months ago
},
{
label: "单价",
prop: "unitPrice",
headerAlign: "center",
align: "center",
6 months ago
},
// {
// label: "金额",
// prop: "amount",
// headerAlign: "center",
// align: "center",
// },
5 months ago
{
6 months ago
label: "状态",
prop: "isBorrow",
headerAlign: "center",
align: "center",
5 months ago
},
{
6 months ago
label: "归还时间",
prop: "returnTime",
headerAlign: "center",
align: "center",
5 months ago
},
],
6 months ago
},
data: [],
dialogReturnVisible: false,
returnInfo: {},
returnForm: {
count: 0,
5 months ago
rmark: "",
6 months ago
},
5 months ago
dialogScrapVisible: false,
6 months ago
scrapInfo: {},
scrapForm: {
count: 0,
5 months ago
rmark: "",
6 months ago
},
dialogLogVisible: false,
5 months ago
activeName: "first",
6 months ago
tableData: [],
ckTable: [
5 months ago
{ str1: "3", str2: "2025-04-09", str3: "部门一" },
{ str1: "37", str2: "2025-04-03", str3: "部门一" },
6 months ago
],
rkTable: [
5 months ago
{ str1: "5", str2: "2025-03-19", str3: "部门二" },
{ str1: "12", str2: "2025-03-19", str3: "部门二" },
6 months ago
],
bfTable: [
5 months ago
{ str1: "9", str2: "2025-03-19", str3: "部门三" },
{ str1: "19", str2: "2025-03-19", str3: "部门三" },
6 months ago
],
};
},
5 months ago
6 months ago
mounted() {
5 months ago
this.tableData = this.ckTable;
6 months ago
},
methods: {
5 months ago
// 关闭弹窗
closeDialog() {
this.returnShow = false;
this.scrapShow = false;
6 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();
},
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;
getList(
page.currentPage,
page.pageSize,
Object.assign(params, this.query)
).then((res) => {
5 months ago
this.data = res.data.result.list
this.page.total = res.data.result.total
})
5 months ago
this.loading = false;
6 months ago
},
// 归还
handleReturn(row) {
5 months ago
this.returnShow = true;
5 months ago
this.returnInfo = JSON.parse(JSON.stringify(row));
6 months ago
},
5 months ago
6 months ago
// 报废
5 months ago
handleScrap(row) {
5 months ago
this.scrapShow = true;
5 months ago
this.scrapInfo = JSON.parse(JSON.stringify(row));
6 months ago
},
5 months ago
handleRefresh() {
this.onLoad(this.page, this.query);
},
5 months ago
},
6 months ago
};
</script>