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

369 lines
9.9 KiB

5 months ago
<template>
<div>
<basic-container>
<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"
>
5 months ago
<template slot-scope="scope" slot="menu">
<!-- <el-button type="text" size="small" @click.stop="handleReturn(scope.row)">归还
</el-button> -->
4 months ago
<el-button type="text" size="small" @click.stop="handleLog(scope.row)"
>记录
5 months ago
</el-button>
</template>
</avue-crud>
</basic-container>
<!-- 归还 -->
<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="归还数量">
<el-input-number
v-model="returnForm.count"
:min="1"
></el-input-number>
5 months ago
</el-form-item>
<el-form-item label="归还理由">
<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>
<!-- 报废 -->
<el-dialog
title="报废"
:visible.sync="dialogScrapVisible"
width="30%"
:close-on-click-modal="false"
:append-to-body="true"
>
5 months ago
<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>
5 months ago
</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>
<!-- 记录 -->
<el-dialog
title="记录"
:visible.sync="dialogLogVisible"
width="60%"
:close-on-click-modal="false"
:append-to-body="true"
>
5 months ago
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="入库" name="first"></el-tab-pane>
<el-tab-pane label="出库" name="second"></el-tab-pane>
<el-tab-pane label="报废" name="third"></el-tab-pane>
</el-tabs>
<el-table :data="tableData" style="width: 100%">
<el-table-column type="index" width="50"> </el-table-column>
5 months ago
<el-table-column prop="str1" label="数量" width="180">
</el-table-column>
<el-table-column prop="str2" label="时间" width="180">
</el-table-column>
<el-table-column prop="str3" label="部门"> </el-table-column>
<el-table-column prop="str4" label="操作人"> </el-table-column>
5 months ago
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogLogVisible = false"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { getList } from "@/api/secondOrder/list.js";
5 months ago
import { mapGetters } from "vuex";
export default {
data() {
return {
form: {},
selectionList: [],
query: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
total: 0,
5 months ago
},
option: {
height: "auto",
5 months ago
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 6,
border: true,
index: true,
selection: true,
viewBtn: false,
addBtn: false,
editBtn: false,
delBtn: false,
5 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",
5 months ago
column: [
{
5 months ago
label: "部门",
prop: "department",
5 months ago
search: true,
headerAlign: "center",
align: "center",
// type: "select",
// dicData: [
// {
// label: "部门一",
// value: 0,
// },
// {
// label: "部门二",
// value: 1,
// },
// ],
5 months ago
},
{
label: "物资编号",
prop: "materialCode",
headerAlign: "center",
align: "center",
5 months ago
},
{
label: "物资名称",
prop: "materialName",
headerAlign: "center",
align: "center",
5 months ago
search: true,
},
{
label: "规格型号",
prop: "model",
headerAlign: "center",
align: "center",
5 months ago
},
{
label: "类别",
prop: "type",
type: "select",
headerAlign: "center",
align: "center",
dicData: [
{
label: "易耗品",
value: "YH",
},
{
label: "耐用品",
value: "NY",
},
],
5 months ago
},
{
label: "计量单位",
prop: "unit",
headerAlign: "center",
align: "center",
5 months ago
},
{
label: "数量",
prop: "num",
headerAlign: "center",
align: "center",
5 months ago
},
{
label: "单价",
prop: "unitPrice",
headerAlign: "center",
align: "center",
5 months ago
},
{
label: "金额",
prop: "amount",
headerAlign: "center",
align: "center",
},
],
5 months ago
},
data: [],
dialogReturnVisible: false,
returnInfo: {},
returnForm: {
count: 0,
rmark: "",
5 months ago
},
dialogScrapVisible: false,
5 months ago
scrapInfo: {},
scrapForm: {
count: 0,
rmark: "",
5 months ago
},
dialogLogVisible: false,
activeName: "first",
5 months ago
tableData: [],
ckTable: [
{ str1: "3", str2: "2025-04-09", str3: "部门一", str4: "操作人1" },
{ str1: "37", str2: "2025-04-03", str3: "部门一", str4: "操作人1" },
5 months ago
],
rkTable: [
{ str1: "5", str2: "2025-03-19", str3: "部门二", str4: "操作人1" },
{ str1: "12", str2: "2025-03-19", str3: "部门二", str4: "操作人1" },
5 months ago
],
bfTable: [
{ str1: "9", str2: "2025-03-19", str3: "部门三", str4: "操作人1" },
{ str1: "19", str2: "2025-03-19", str3: "部门三", str4: "操作人1" },
5 months ago
],
};
},
5 months ago
mounted() {
this.tableData = this.ckTable;
5 months ago
},
methods: {
handleLog() {
this.dialogLogVisible = true;
5 months ago
},
handleTabClick(tab, event) {
console.log(tab, event);
if (this.activeName == "first") {
this.tableData = this.ckTable;
5 months ago
}
if (this.activeName == "second") {
this.tableData = this.rkTable;
5 months ago
}
if (this.activeName == "third") {
this.tableData = this.bfTable;
5 months ago
}
},
handlePreview(name) {
this.$router.push({
path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.design.reportUrl}/preview?_u=blade-${name}`,
});
5 months ago
},
handleDesign(name) {
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;
getList(
page.currentPage,
page.pageSize,
Object.assign(params, this.query)
).then((res) => {
this.data = res.data.result.list;
this.loading = false;
this.page.total = res.data.result.total;
});
this.loading = false;
5 months ago
},
// 归还
handleReturn(row) {
this.dialogReturnVisible = true;
this.returnInfo = JSON.parse(JSON.stringify(row));
5 months ago
},
returnSave() {
this.dialogReturnVisible = false;
5 months ago
this.$message({
type: "success",
message: "归还成功",
5 months ago
});
},
// 报废
handleScrap(row) {
this.dialogScrapVisible = true;
this.scrapInfo = JSON.parse(JSON.stringify(row));
5 months ago
},
scrapSave() {
this.dialogScrapVisible = false;
5 months ago
this.$message({
type: "success",
message: "报废成功",
5 months ago
});
},
},
5 months ago
};
</script>
<style></style>