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

324 lines
8.7 KiB

5 months ago
<template>
<basic-container>
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" :page.sync="page"
4 months ago
:permission="permissionList"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad">
5 months ago
<!-- @row-click="rowSelect" -->
<template slot-scope="scope" slot="menuLeft">
4 months ago
<el-button size="small" plain @click="handleDesign()">新增入库单
5 months ago
</el-button>
4 months ago
<el-button size="small" plain @click="handleExport()">入库单导出
5 months ago
</el-button>
</template>
4 months ago
<template slot-scope="scope" slot="purchaseEndInfo">
<el-button type="text" @click.stop="purchaseFn(scope.row)" v-if="scope.row.purchaseEndInfo != ''">{{
scope.row.purchaseEndInfo }}</el-button>
5 months ago
<span v-else></span>
</template>
<template #menu="scope">
<el-button type="text" @click.stop="handleDetails(scope.row)">详情</el-button>
4 months ago
<el-button type="text" v-if="scope.row.str7 == 1" @click.stop="handleEdit(scope.row)">编辑</el-button>
5 months ago
</template>
</avue-crud>
<!-- 新增 -->
<inDialog v-if="inDialogVisible" :repairVisible='inDialogVisible' :inDialogTiltle="inDialogTiltle"
4 months ago
:inDialogType="inDialogType" @handleCloseDetail="handleCloseDetail" type="一级库" :id='id'>
5 months ago
</inDialog>
<!-- 采购单详情 -->
4 months ago
<purchaseDialog :showDialog="purchaseOpen" v-if="purchaseOpen" @closeDialog="closeDialog"
4 months ago
:purchaseTitle="purchaseTitle" :id='id'></purchaseDialog>
5 months ago
</basic-container>
</template>
<script>
4 months ago
import { getList } from "@/api/firstOrder/inbound";
5 months ago
import { mapGetters } from "vuex";
import inDialog from './components/inDialog.vue';
import purchaseDialog from './components/purchaseDialog.vue';
export default {
components: {
inDialog,
purchaseDialog
},
data() {
return {
4 months ago
// form: {},
form: { inDate: [], inOperatorName: '', inOperator: '' },
5 months ago
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,
selection: false,
printBtn: false,
refreshBtn: false,
gridBtn: false,
gridBackgroundImage: false,
gridSpan: false,
filterBtn: false,
columnBtn: false,
4 months ago
menuWidth: 120,
menu: true,
5 months ago
column: [
4 months ago
{
5 months ago
label: "采购单名称",
4 months ago
prop: "purchaseEndInfo",
4 months ago
width: 180,
5 months ago
},
{
4 months ago
label: "仓库名称",
prop: "warehouseName",
5 months ago
},
{
label: "入库单号",
4 months ago
prop: "orderNo",
width: 110
5 months ago
},
{
4 months ago
label: "入库日期",
prop: "inDate",
5 months ago
search: true,
4 months ago
type: "datetime",
searchRange: true,
5 months ago
startPlaceholder: '开始时间',
endPlaceholder: "结束时间",
4 months ago
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
4 months ago
width: 120,
4 months ago
// searchParam: 'startTime',
// searchEndParam: 'endTime'
5 months ago
},
{
label: "入库人",
4 months ago
prop: "inOperatorName",
5 months ago
search: true,
4 months ago
searchParam: 'inOperator'
5 months ago
},
{
4 months ago
label: "来源",
prop: "source",
search: false,
},
{
label: "事由",
prop: "reason",
search: false,
5 months ago
},
{
4 months ago
label: "物资类型",
prop: "materialType",
5 months ago
search: false,
4 months ago
type: 'select',
4 months ago
dicData: [{
label: '办公物资',
value: '1'
},
{
label: '其他物资',
value: '2'
}]
4 months ago
},
{
label: "审批人员",
4 months ago
prop: "approvers",
5 months ago
},
{
4 months ago
label: "状态",
prop: "status",
type: 'select',
4 months ago
dicData: [
{
label: '暂存',
value: 1
},
{
label: '待审批',
4 months ago
value: 2
4 months ago
},
{
label: '已审批',
4 months ago
value: 3
4 months ago
},
]
5 months ago
},
]
},
4 months ago
data: [
// {
// caigoudanmingcheng: "2025年第一季度采购单",
// str1: '类型一',
// str2: '00000001',
// str3: '2025-03-01',
// str4: '员工一',
// str5: '员工二',
// str6: '采购',
// str7: '1',
// }, {
// caigoudanmingcheng: "2025年第二季度采购单",
// str1: '类型二',
// str2: '00000002',
// str3: '2025-03-02',
// str4: '员工一',
// str5: '员工二',
// str6: '采购',
// str7: '2',
// }, {
// caigoudanmingcheng: "",
// str1: '类型三',
// str2: '00000002',
// str3: '2025-03-02',
// str4: '员工一',
// str5: '员工二',
// str6: '单项',
// str7: '3',
// }, {
// caigoudanmingcheng: "",
// str1: '类型三',
// str2: '00000002',
// str3: '2025-03-02',
// str4: '员工一',
// str5: '员工二',
// str6: '单项',
// str7: '1',
// }
],
5 months ago
inDialogVisible: false,
inDialogTiltle: '入库',
inDialogType: '',//弹框类型
4 months ago
purchaseOpen: false,
purchaseTitle: '',
inTitle: '',
5 months ago
};
},
computed: {
4 months ago
5 months ago
},
methods: {
4 months ago
handleDesign() {
4 months ago
debugger
5 months ago
this.inDialogType = 'add'
this.inDialogTiltle = '新增入库'
4 months ago
this.inDialogVisible = true
5 months ago
},
// 详情
4 months ago
handleDetails(row) {
5 months ago
this.inDialogVisible = true
4 months ago
this.inDialogType = 'details'
5 months ago
this.inDialogTiltle = '详情'
},
// 编辑
4 months ago
handleEdit(row) {
5 months ago
this.inDialogVisible = true
4 months ago
this.inDialogType = 'edit'
5 months ago
this.inDialogTiltle = '编辑'
4 months ago
this.id = row.id
5 months ago
},
// 采购单
4 months ago
purchaseFn(row) {
5 months ago
this.purchaseOpen = true
4 months ago
this.purchaseTitle = row.purchaseEndInfo + '采购单详情'
this.id = row.id
console.log(row, this.id,1)
5 months ago
},
4 months ago
closeDialog() {
5 months ago
this.purchaseOpen = false
},
handleCloseDetail() {
this.inDialogVisible = false
},
handleExport(name) {
this.$message({
type: "success",
message: "出库单导出成功!"
});
},
// 行点击事件
rowSelect(row) {
this.inDialogVisible = true
this.inDialogType = 'inbound'
this.inDialogTiltle = '入库'
},
searchReset() {
this.query = {};
4 months ago
this.form.inDate = []
this.form.inOperatorName = ''
this.form.inOperator = ''
5 months ago
this.onLoad(this.page);
4 months ago
5 months ago
},
searchChange(params, done) {
4 months ago
if (params && params.inOperatorName && !params.inOperator) {
params.inOperator = params.inOperatorName;
delete params.inOperatorName;
}
5 months ago
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();
},
4 months ago
5 months ago
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;
4 months ago
const queryParams = {
...params,
...this.query,
pageSize: page.pageSize,
pageNum: page.currentPage
};
if (queryParams.inDate && Array.isArray(queryParams.inDate)) {
queryParams.startTime = queryParams.inDate[0];
queryParams.endTime = queryParams.inDate[1];
delete queryParams.inDate;
}
getList(page.currentPage, page.pageSize, queryParams).then(res => {
4 months ago
console.log('列表', res.data.result)
4 months ago
this.data = res.data.result.list;
this.loading = false;
this.page.total = res.data.result.total;
});
5 months ago
}
}
};
</script>
<style></style>