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

276 lines
7.1 KiB

<template>
<basic-container>
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" :page.sync="page"
:permission="permissionList" @search-change="searchChange" @search-reset="searchReset"
@current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
<template slot-scope="scope" slot="menuLeft">
<el-button size="small" @click.stop="handleDesign()" type="primary">新增出库单
</el-button>
</template>
<template #menu="scope">
<el-button type="text" @click.stop="approvalProcessFn(scope.row)"
>审批流程</el-button
>
<el-button type="text" @click.stop="handleDetails(scope.row)"
>详情</el-button
>
</template>
<template slot-scope="scope" slot="xuqiudanmingcheng">
<el-button type="text" @click.stop="purchaseFn(scope.row)" v-if="scope.row.xuqiudanmingcheng != ''">{{
scope.row.xuqiudanmingcheng }}</el-button>
<span v-else>无</span>
</template>
</avue-crud>
<outDialog
v-if="outDialogVisible"
:repairVisible="outDialogVisible"
:outDialogTiltle="outDialogTiltle"
:outDialogType="outDialogType"
:rowData="rowData"
@handleCloseDetail="handleCloseDetail"
type="二级库"
>
</outDialog>
<!-- 需求单明细 -->
<needDialog :showDialog="purchaseOpen" v-if="purchaseOpen" @closeDialog="closeDialog"
:purchaseTitle="purchaseTitle">
</needDialog>
<!-- 审批流程 -->
<approvalProcessDialog
:showDialog="approvalProcessShow"
v-if="approvalProcessShow"
:rowData="rowData"
@closeDialog="closeDialog"
></approvalProcessDialog>
</basic-container>
</template>
<script>
import outDialog from "./components/outDialog.vue";
import needDialog from "./components/needDialog.vue";
import { getList } from "@/api/secondOrder/outbound";
import approvalProcessDialog from "./components/approvalProcessDialog.vue";
export default {
components: {
outDialog,
needDialog,
approvalProcessDialog,
},
data() {
return {
purchaseOpen: false,
purchaseTitle: "",
treeData: [], //组织树
defaultProps: {
children: "children",
label: "label",
},
form: {},
selectionList: [],
query: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
option: {
height: "auto",
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 18,
border: true,
index: true,
selection: true,
viewBtn: false,
addBtn: false,
editBtn: false,
delBtn: false,
dialogClickModal: false,
selection: false,
printBtn: false,
refreshBtn: false,
gridBtn: false,
gridBackgroundImage: false,
gridSpan: false,
filterBtn: false,
columnBtn: false,
menuAlign: "left",
searchMenuPosition: "right",
excelBtn: true,
menuWidth: 140,
column: [
{
label: "出库单号",
prop: "orderNo",
headerAlign: "center",
align: "center",
},
{
label: "出库时间",
prop: "outDate",
search: true,
type: "datetime",
headerAlign: "center",
align: "center",
},
{
label: "事由",
prop: "reason",
headerAlign: "center",
align: "center",
},
{
label: "物资类型",
prop: "materialType",
headerAlign: "center",
align: "center",
type: "select",
dicData: [
{
label: "办公物资",
value: "1",
},
{
label: "其他物资",
value: "2",
},
],
},
{
label: "部门",
prop: "department",
align: "center",
headerAlign: "center",
},
{
label: "出库人",
prop: "shipperName",
headerAlign: "center",
align: "center",
},
{
label: "状态",
prop: "status",
headerAlign: "center",
align: "center",
type: "select",
align: "center",
dicData: [
{
label: "待审批",
value: 2,
},
{
label: "已审批",
value: 3,
},
{
label: "审批失败",
value: 4,
},
],
},
],
},
data: [],
outDialogVisible: false,
outDialogTiltle: "出库",
outDialogType: "",
approvalProcessShow: false,
rowData:{},
};
},
methods: {
approvalProcessFn(row) {
this.approvalProcessShow = true;
this.rowData = row
},
// 详情
handleDetails(row) {
this.outDialogVisible = true;
this.outDialogType = "details";
this.outDialogTiltle = "详情";
this.rowData = row
},
purchaseFn(row) {
this.purchaseOpen = true;
this.purchaseTitle = row.xuqiudanmingcheng + "详情";
},
closeDialog() {
this.purchaseOpen = false;
this.approvalProcessShow = false
},
handleDesign() {
this.outDialogVisible = true;
this.outDialogType = "add";
this.outDialogTiltle = "新增出库";
},
//
handleCloseDetail() {
this.outDialogVisible = false;
this.onLoad(this.page);
},
handleExport(name) {
this.$message({
type: "success",
message: "出库单导出成功!",
});
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
this.$message({
type: "success",
message: "操作成功!",
});
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;
const queryParams = {
...params,
...this.query,
pageSize: page.pageSize,
pageNum: page.currentPage,
};
if (queryParams.outDate && Array.isArray(queryParams.outDate)) {
queryParams.startTime = queryParams.outDate[0];
queryParams.endTime = queryParams.outDate[1];
delete queryParams.outDate;
}
getList(page.currentPage, page.pageSize, queryParams).then((res) => {
this.data = res.data.result.list;
this.loading = false;
this.page.total = res.data.result.total;
});
},
},
};
</script>
<style></style>