|
|
|
|
<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="handleLog(scope.row)"
|
|
|
|
|
>记录
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</avue-crud>
|
|
|
|
|
</basic-container>
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="记录"
|
|
|
|
|
:visible.sync="dialogLogVisible"
|
|
|
|
|
width="50%"
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
:append-to-body="true"
|
|
|
|
|
>
|
|
|
|
|
<el-tabs v-model="transactionType" @tab-click="handleTabClick">
|
|
|
|
|
<el-tab-pane label="出库" name="1"></el-tab-pane>
|
|
|
|
|
<el-tab-pane label="入库" name="2"></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="quantity" label="数量" >
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="operatorName" label="操作人" >
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="operationTime" label="时间" >
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="departmentName" label="部门"> </el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
// import { getList, remove } from "@/api/report/report";
|
|
|
|
|
|
|
|
|
|
import { getList, recordList } from "@/api/firstOrder/list";
|
|
|
|
|
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,
|
|
|
|
|
menuAlign: "left",
|
|
|
|
|
searchMenuPosition: "right",
|
|
|
|
|
menuWidth: 80,
|
|
|
|
|
column: [
|
|
|
|
|
{
|
|
|
|
|
label: "存货编号",
|
|
|
|
|
prop: "materialCode",
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "存货名称",
|
|
|
|
|
prop: "materialName",
|
|
|
|
|
search: true,
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "left",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "规格型号",
|
|
|
|
|
prop: "model",
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "left",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "类别",
|
|
|
|
|
prop: "type",
|
|
|
|
|
search: true,
|
|
|
|
|
type: "select",
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "center",
|
|
|
|
|
dicData: [
|
|
|
|
|
{
|
|
|
|
|
label: "易耗品",
|
|
|
|
|
value: "YH",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "耐用品",
|
|
|
|
|
value: "NY",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "计量单位",
|
|
|
|
|
prop: "unit",
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "数量",
|
|
|
|
|
prop: "num",
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "单价",
|
|
|
|
|
prop: "unitPrice",
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "金额",
|
|
|
|
|
prop: "amount",
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "描述",
|
|
|
|
|
prop: "remark",
|
|
|
|
|
headerAlign: "center",
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
data: [],
|
|
|
|
|
dialogLogVisible: false,
|
|
|
|
|
transactionType: "1",
|
|
|
|
|
tableData: [],
|
|
|
|
|
ckTable: [],
|
|
|
|
|
rkTable: [],
|
|
|
|
|
currentRow: null,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
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;
|
|
|
|
|
this.tableData = this.rkTable;
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async handleLog(row) {
|
|
|
|
|
this.dialogLogVisible = true;
|
|
|
|
|
this.currentRow = row;
|
|
|
|
|
const params = {
|
|
|
|
|
oneFromId: row.id,
|
|
|
|
|
transactionType: this.transactionType,
|
|
|
|
|
};
|
|
|
|
|
const pageNum = this.page.currentPage;
|
|
|
|
|
const pageSize = this.page.pageSize;
|
|
|
|
|
const res = await recordList(
|
|
|
|
|
pageNum,
|
|
|
|
|
pageSize,
|
|
|
|
|
Object.assign({}, this.query, params)
|
|
|
|
|
);
|
|
|
|
|
this.tableData = res.data.result.list;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleTabClick() {
|
|
|
|
|
//出库
|
|
|
|
|
if (this.transactionType == "1") {
|
|
|
|
|
this.tableData = this.ckTable;
|
|
|
|
|
}
|
|
|
|
|
// 入库
|
|
|
|
|
if (this.transactionType == "2") {
|
|
|
|
|
this.tableData = this.rkTable;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
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) => {
|
|
|
|
|
// const data = res.data.data;
|
|
|
|
|
this.data = res.data.result.list;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.page.total = res.data.result.total;
|
|
|
|
|
// this.selectionClear();
|
|
|
|
|
});
|
|
|
|
|
this.loading = false;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style></style>
|