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

269 lines
6.8 KiB

5 months ago
<template>
<div>
<basic-container>
4 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">
5 months ago
<template slot-scope="scope" slot="menu">
3 months ago
<el-button type="text" @click.stop="handleLog(scope.row)">记录
5 months ago
</el-button>
</template>
5 months ago
</avue-crud>
</basic-container>
<!-- 记录 -->
<recordDialog v-if="recordShow" :showDialog="recordShow" @closeDialog="closeDialog" :rowData="rowData">
</recordDialog>
5 months ago
</div>
</template>
<script>
import recordDialog from "./components/recordDialog.vue";
import { getList, recordList } from "@/api/firstOrder/list";
5 months ago
export default {
components: {
recordDialog,
},
5 months ago
data() {
return {
rowData: {}, //行数据
recordShow: false, //记录弹窗
5 months ago
form: {},
selectionList: [],
query: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
total: 0,
5 months ago
},
3 months ago
logPage: { // 记录弹窗分页参数
currentPage: 1,
pageSize: 10,
total: 0
},
5 months ago
option: {
height: "auto",
5 months ago
calcHeight: 30,
tip: false,
searchShow: true,
4 months ago
searchMenuSpan: 12,
5 months ago
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,
5 months ago
column: [
{
label: "存货编号",
prop: "materialCode",
headerAlign: "center",
align: "center",
5 months ago
},
{
label: "存货名称",
prop: "materialName",
5 months ago
search: true,
headerAlign: "center",
align: "left",
5 months ago
},
{
label: "规格型号",
4 months ago
prop: "model",
headerAlign: "center",
align: "left",
5 months ago
},
{
label: "类别",
prop: "type",
5 months ago
search: true,
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: "数量",
4 months ago
prop: "num",
headerAlign: "center",
align: "center",
5 months ago
},
{
label: "单价",
4 months ago
prop: "unitPrice",
headerAlign: "center",
align: "center",
3 months ago
formatter: (row, column) => {
const value = row.unitPrice;
if (value === null || value === undefined || value === "") {
return "-";
}
return value;
}
5 months ago
},
3 months ago
// {
// label: "金额",
// prop: "amount",
// headerAlign: "center",
// align: "center",
// },
{
label: "描述",
prop: "remark",
headerAlign: "center",
align: "center",
4 months ago
formatter: (row, column) => {
const value = row.remark;
if (value === null || value === undefined || value === "") {
return "无";
}
return value;
}
},
],
5 months ago
},
data: [],
dialogLogVisible: false,
transactionType: "1",
5 months ago
tableData: [],
ckTable: [],
rkTable: [],
currentRow: null,
5 months ago
};
},
computed: {
permissionList() {
return {
addBtn: false,
viewBtn: false,
delBtn: false,
editBtn: false,
5 months ago
};
},
ids() {
let ids = [];
this.selectionList.forEach((ele) => {
5 months ago
ids.push(ele.id);
});
return ids.join(",");
},
5 months ago
},
mounted() {
4 months ago
this.ckTable = [];
this.rkTable = [];
this.tableData = [];
5 months ago
},
methods: {
// 记录弹框关闭
closeDialog() {
this.recordShow = false;
4 months ago
},
handleLog(row) {
console.log(228998)
this.recordShow = true;
this.rowData = row;
console.log(22298766)
4 months ago
},
formatTime(row, column, cellValue) {
if (!cellValue) return '';
const date = new Date(cellValue);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
5 months ago
},
3 months ago
handleLogSizeChange(pageSize) {
this.logPage.pageSize = pageSize;
this.logPage.currentPage = 1; // 重置为第一页
3 months ago
},
// 弹窗当前页改变事件
handleLogCurrentChange(currentPage) {
this.logPage.currentPage = currentPage;
3 months ago
},
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) => {
4 months ago
// const data = res.data.data;
this.data = res.data.result.list;
4 months ago
this.loading = false;
this.page.total = res.data.result.total;
// this.selectionClear();
});
this.loading = false;
},
},
5 months ago
};
</script>
<style lang="scss" scoped></style>