|
|
|
|
<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 type="text" size="small" @click.stop="handleReturn(scope.row)">归还
|
|
|
|
|
</el-button> -->
|
|
|
|
|
|
|
|
|
|
<el-button type="text" size="small" @click.stop="handleLog(scope.row)">记录
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
</avue-crud>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</basic-container>
|
|
|
|
|
<!-- 归还 -->
|
|
|
|
|
<el-dialog title="归还" :visible.sync="dialogReturnVisible" width="30%" :close-on-click-modal="false"
|
|
|
|
|
:append-to-body="true">
|
|
|
|
|
<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>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="归还理由">
|
|
|
|
|
<el-input v-model="returnForm.rmark" type="textarea" :rows="3" placeholder="请输入内容"></el-input>
|
|
|
|
|
</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">
|
|
|
|
|
<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>
|
|
|
|
|
<!-- 记录 -->
|
|
|
|
|
<el-dialog title="记录" :visible.sync="dialogLogVisible" width="60%" :close-on-click-modal="false"
|
|
|
|
|
:append-to-body="true">
|
|
|
|
|
<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>
|
|
|
|
|
<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>
|
|
|
|
|
</el-table>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="dialogLogVisible = false">取 消</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { getList, remove } from "@/api/report/report";
|
|
|
|
|
import { mapGetters } from "vuex";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
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: true,
|
|
|
|
|
dialogClickModal: false,
|
|
|
|
|
menu: true,
|
|
|
|
|
selection: false,
|
|
|
|
|
printBtn: false,
|
|
|
|
|
refreshBtn: false,
|
|
|
|
|
gridBtn: false,
|
|
|
|
|
gridBackgroundImage: false,
|
|
|
|
|
gridSpan: false,
|
|
|
|
|
filterBtn: false,
|
|
|
|
|
columnBtn: false,
|
|
|
|
|
column: [
|
|
|
|
|
{
|
|
|
|
|
label: "部门",
|
|
|
|
|
prop: "str8",
|
|
|
|
|
search: true,
|
|
|
|
|
type: 'select',
|
|
|
|
|
dicData: [{
|
|
|
|
|
label: '部门一',
|
|
|
|
|
value: 0
|
|
|
|
|
}, {
|
|
|
|
|
label: '部门二',
|
|
|
|
|
value: 1
|
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "存货编号",
|
|
|
|
|
prop: "no",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "存货名称",
|
|
|
|
|
prop: "name",
|
|
|
|
|
search: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "规格型号",
|
|
|
|
|
prop: "xh",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "类别",
|
|
|
|
|
prop: "lb",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "计量单位",
|
|
|
|
|
prop: "unit",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "数量",
|
|
|
|
|
prop: "number",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "单价",
|
|
|
|
|
prop: "dj",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "金额",
|
|
|
|
|
prop: "pice",
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
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: '部门一',str4:'操作人1'},
|
|
|
|
|
{str1: '37', str2: '2025-04-03', str3: '部门一',str4:'操作人1'}
|
|
|
|
|
],
|
|
|
|
|
rkTable: [
|
|
|
|
|
{str1: '5',str2: '2025-03-19',str3: '部门二',str4:'操作人1'},
|
|
|
|
|
{str1: '12',str2: '2025-03-19',str3: '部门二',str4:'操作人1'},
|
|
|
|
|
],
|
|
|
|
|
bfTable: [
|
|
|
|
|
{str1: '9',str2: '2025-03-19',str3: '部门三',str4:'操作人1'},
|
|
|
|
|
{str1: '19',str2: '2025-03-19',str3: '部门三',str4:'操作人1'},
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
...mapGetters(["userInfo", "permission"]),
|
|
|
|
|
permissionList() {
|
|
|
|
|
return {
|
|
|
|
|
addBtn: false,
|
|
|
|
|
viewBtn: false,
|
|
|
|
|
delBtn: false,
|
|
|
|
|
editBtn: false
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
ids() {
|
|
|
|
|
let ids = [];
|
|
|
|
|
this.selectionList.forEach(ele => {
|
|
|
|
|
ids.push(ele.id);
|
|
|
|
|
});
|
|
|
|
|
return ids.join(",");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.tableData = this.ckTable
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
handleLog() {
|
|
|
|
|
this.dialogLogVisible = true
|
|
|
|
|
},
|
|
|
|
|
handleTabClick(tab, event) {
|
|
|
|
|
console.log(tab, event);
|
|
|
|
|
if(this.activeName=='first'){
|
|
|
|
|
this.tableData = this.ckTable
|
|
|
|
|
}
|
|
|
|
|
if(this.activeName=='second'){
|
|
|
|
|
this.tableData = this.rkTable
|
|
|
|
|
}
|
|
|
|
|
if(this.activeName=='third'){
|
|
|
|
|
this.tableData = this.bfTable
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handlePreview(name) {
|
|
|
|
|
this.$router.push({ path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.design.reportUrl}/preview?_u=blade-${name}` });
|
|
|
|
|
},
|
|
|
|
|
handleDesign(name) {
|
|
|
|
|
this.$router.push({ path: `/myiframe/urlPath?name=designer-${name}&src=${this.website.design.reportUrl}/designer?_u=blade-${name}` });
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
this.data.push({
|
|
|
|
|
no: '00100001',
|
|
|
|
|
name: '物品1',
|
|
|
|
|
xh: '1',
|
|
|
|
|
lb: '易耗品',
|
|
|
|
|
unit: '11',
|
|
|
|
|
number: '1',
|
|
|
|
|
dj: '11',
|
|
|
|
|
pice: '11'
|
|
|
|
|
}, {
|
|
|
|
|
no: '00100002',
|
|
|
|
|
name: '物品2',
|
|
|
|
|
xh: '2',
|
|
|
|
|
lb: '耐用品',
|
|
|
|
|
unit: '22',
|
|
|
|
|
number: '2',
|
|
|
|
|
dj: '11',
|
|
|
|
|
pice: '22'
|
|
|
|
|
})
|
|
|
|
|
this.loading = false
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// 归还
|
|
|
|
|
handleReturn(row) {
|
|
|
|
|
this.dialogReturnVisible = true
|
|
|
|
|
this.returnInfo = JSON.parse(JSON.stringify(row))
|
|
|
|
|
},
|
|
|
|
|
returnSave() {
|
|
|
|
|
this.dialogReturnVisible = false
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "success",
|
|
|
|
|
message: "归还成功"
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 报废
|
|
|
|
|
handleScrap(row){
|
|
|
|
|
this.dialogScrapVisible = true
|
|
|
|
|
this.scrapInfo = JSON.parse(JSON.stringify(row))
|
|
|
|
|
},
|
|
|
|
|
scrapSave(){
|
|
|
|
|
this.dialogScrapVisible = false
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "success",
|
|
|
|
|
message: "报废成功"
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style></style>
|