|
|
|
|
<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"
|
|
|
|
|
>
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
<!-- 归还 -->
|
|
|
|
|
<returnDialog
|
|
|
|
|
v-if="returnShow"
|
|
|
|
|
:showDialog="returnShow"
|
|
|
|
|
:rowDta="returnInfo"
|
|
|
|
|
@closeDialog="closeDialog"
|
|
|
|
|
></returnDialog>
|
|
|
|
|
<!-- 报废 -->
|
|
|
|
|
<scrapDialog
|
|
|
|
|
v-if="scrapShow"
|
|
|
|
|
:showDialog="scrapShow"
|
|
|
|
|
:rowDta="scrapInfo"
|
|
|
|
|
@closeDialog="closeDialog"
|
|
|
|
|
></scrapDialog>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { mapGetters } from "vuex";
|
|
|
|
|
import { getList } from "@/api/materials/expend";
|
|
|
|
|
|
|
|
|
|
import returnDialog from "./components/returnDialog.vue";
|
|
|
|
|
import scrapDialog from "./components/scrapDialog.vue";
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
returnDialog,
|
|
|
|
|
scrapDialog,
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
returnShow: false, //归还
|
|
|
|
|
scrapShow: false, //报废
|
|
|
|
|
|
|
|
|
|
form: {},
|
|
|
|
|
selectionList: [],
|
|
|
|
|
query: {},
|
|
|
|
|
loading: true,
|
|
|
|
|
page: {
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
currentPage: 1,
|
|
|
|
|
total: 0,
|
|
|
|
|
},
|
|
|
|
|
option: {
|
|
|
|
|
height: "auto",
|
|
|
|
|
calcHeight: 30,
|
|
|
|
|
tip: false,
|
|
|
|
|
searchShow: true,
|
|
|
|
|
searchMenuSpan: 6,
|
|
|
|
|
border: true,
|
|
|
|
|
index: true,
|
|
|
|
|
selection: true,
|
|
|
|
|
viewBtn: false,
|
|
|
|
|
addBtn: false,
|
|
|
|
|
editBtn: false,
|
|
|
|
|
delBtn: false,
|
|
|
|
|
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: 140,
|
|
|
|
|
column: [
|
|
|
|
|
{
|
|
|
|
|
label: "编号",
|
|
|
|
|
prop: "no",
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "部门",
|
|
|
|
|
prop: "str8",
|
|
|
|
|
search: true,
|
|
|
|
|
type: "select",
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "center",
|
|
|
|
|
dicData: [
|
|
|
|
|
{
|
|
|
|
|
label: "部门一",
|
|
|
|
|
value: 0,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "部门二",
|
|
|
|
|
value: 1,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "名称",
|
|
|
|
|
prop: "name",
|
|
|
|
|
search: true,
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "规格型号",
|
|
|
|
|
prop: "xh",
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "类别",
|
|
|
|
|
prop: "lb",
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "计量单位",
|
|
|
|
|
prop: "unit",
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "数量",
|
|
|
|
|
prop: "number",
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "单价",
|
|
|
|
|
prop: "dj",
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "金额",
|
|
|
|
|
prop: "pice",
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "状态",
|
|
|
|
|
prop: "status",
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "归还时间",
|
|
|
|
|
prop: "time",
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
data: [],
|
|
|
|
|
dialogReturnVisible: false,
|
|
|
|
|
returnInfo: {},
|
|
|
|
|
returnForm: {
|
|
|
|
|
count: 0,
|
|
|
|
|
rmark: "",
|
|
|
|
|
},
|
|
|
|
|
dialogScrapVisible: false,
|
|
|
|
|
scrapInfo: {},
|
|
|
|
|
scrapForm: {
|
|
|
|
|
count: 0,
|
|
|
|
|
rmark: "",
|
|
|
|
|
},
|
|
|
|
|
dialogLogVisible: false,
|
|
|
|
|
activeName: "first",
|
|
|
|
|
tableData: [],
|
|
|
|
|
|
|
|
|
|
ckTable: [
|
|
|
|
|
{ str1: "3", str2: "2025-04-09", str3: "部门一" },
|
|
|
|
|
{ str1: "37", str2: "2025-04-03", str3: "部门一" },
|
|
|
|
|
],
|
|
|
|
|
rkTable: [
|
|
|
|
|
{ str1: "5", str2: "2025-03-19", str3: "部门二" },
|
|
|
|
|
{ str1: "12", str2: "2025-03-19", str3: "部门二" },
|
|
|
|
|
],
|
|
|
|
|
bfTable: [
|
|
|
|
|
{ str1: "9", str2: "2025-03-19", str3: "部门三" },
|
|
|
|
|
{ str1: "19", str2: "2025-03-19", str3: "部门三" },
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
|
this.tableData = this.ckTable;
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 关闭弹窗
|
|
|
|
|
closeDialog() {
|
|
|
|
|
this.returnShow = false;
|
|
|
|
|
this.scrapShow = false;
|
|
|
|
|
},
|
|
|
|
|
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;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
},
|
|
|
|
|
// 归还
|
|
|
|
|
handleReturn(row) {
|
|
|
|
|
this.returnShow = true;
|
|
|
|
|
this.returnInfo = JSON.parse(JSON.stringify(row));
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 报废
|
|
|
|
|
handleScrap(row) {
|
|
|
|
|
this.scrapShow = true;
|
|
|
|
|
this.scrapInfo = JSON.parse(JSON.stringify(row));
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|