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

354 lines
9.2 KiB

5 months ago
<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"
@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">
<el-button size="small" type="primary" @click="handleDesign()"
>新增入库单
5 months ago
</el-button>
<!-- <el-button size="small" type="primary" @click="handleExport()"
>入库单导出
</el-button> -->
5 months ago
</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="approvalProcessFn(scope.row)"
>审批流程</el-button
>
<el-button type="text" @click.stop="handleDetails(scope.row)"
>详情</el-button
>
<el-button
type="text"
v-if="scope.row.status == 1"
@click.stop="handleEdit(scope.row)"
>编辑</el-button
>
5 months ago
</template>
</avue-crud>
<!-- 新增 -->
<inDialog
v-if="inDialogVisible"
:repairVisible="inDialogVisible"
:inDialogTiltle="inDialogTiltle"
:inDialogType="inDialogType"
@handleCloseDetail="handleCloseDetail"
type="一级库"
:id="id"
@submitSuccess="handleSubmitSuccess"
>
5 months ago
</inDialog>
<!-- 采购单详情 -->
<purchaseDialog
:showDialog="purchaseOpen"
v-if="purchaseOpen"
@closeDialog="closeDialog"
:purchaseTitle="purchaseTitle"
:id="id"
></purchaseDialog>
<!-- 审批流程 -->
<approvalProcessDialog
:showDialog="approvalProcessShow"
v-if="approvalProcessShow"
@closeDialog="closeDialog"
></approvalProcessDialog>
5 months ago
</basic-container>
</template>
<script>
4 months ago
import { getList } from "@/api/firstOrder/inbound";
// import { mapGetters } from "vuex";
import inDialog from "./components/inDialog.vue";
import purchaseDialog from "./components/purchaseDialog.vue";
import approvalProcessDialog from "./components/approvalProcessDialog.vue";
5 months ago
export default {
components: {
inDialog,
purchaseDialog,
approvalProcessDialog,
5 months ago
},
data() {
return {
4 months ago
// form: {},
form: { inDate: [], inOperatorName: "", inOperator: "" },
5 months ago
selectionList: [],
query: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
total: 0,
5 months ago
},
option: {
height: "auto",
5 months ago
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 6,
border: true,
index: true,
4 months ago
viewBtn: false,
editBtn: false,
delBtn: false,
addBtn: false,
5 months ago
dialogClickModal: false,
selection: false,
printBtn: false,
refreshBtn: false,
gridBtn: false,
gridBackgroundImage: false,
gridSpan: false,
filterBtn: false,
columnBtn: false,
menuWidth: 190,
4 months ago
menu: true,
menuAlign: "left",
searchMenuPosition: "right",
excelBtn: true,
5 months ago
column: [
4 months ago
{
5 months ago
label: "采购单名称",
4 months ago
prop: "purchaseEndInfo",
4 months ago
width: 150,
align: "center",
formatter: (row, column) => {
const value = row.purchaseEndInfo;
if (value === null || value === undefined || value === "") {
return "无"; // 空值时显示“无”
}
return value; // 有值时显示原内容
}
5 months ago
},
{
label: "入库单号",
4 months ago
prop: "orderNo",
4 months ago
width: 160,
align: "center"
5 months ago
},
{
4 months ago
label: "入库日期",
prop: "inDate",
5 months ago
search: true,
4 months ago
type: "datetime",
searchRange: true,
startPlaceholder: "开始时间",
5 months ago
endPlaceholder: "结束时间",
4 months ago
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
4 months ago
width: 160,
align: "center"
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',
align: "center"
5 months ago
},
{
4 months ago
label: "来源",
prop: "source",
search: false,
4 months ago
align: "center"
4 months ago
},
{
label: "事由",
prop: "reason",
search: false,
4 months ago
align: "center"
5 months ago
},
{
4 months ago
label: "物资类型",
prop: "materialType",
5 months ago
search: false,
4 months ago
type: 'select',
4 months ago
align: "center",
4 months ago
dicData: [{
label: '办公物资',
value: '1'
},
{
label: '其他物资',
value: '2'
}]
4 months ago
},
{
label: "审批人员",
4 months ago
prop: "approvers",
4 months ago
align: "center"
5 months ago
},
{
4 months ago
label: "状态",
prop: "status",
type: 'select',
4 months ago
align: "center",
4 months ago
dicData: [
{
label: "暂存",
value: 1,
4 months ago
},
{
label: "待审批",
value: 2,
4 months ago
},
{
label: "已审批",
value: 3,
4 months ago
},
],
5 months ago
},
],
5 months ago
},
data: [],
5 months ago
inDialogVisible: false,
inDialogTiltle: "入库",
inDialogType: "", //弹框类型
4 months ago
purchaseOpen: false,
purchaseTitle: "",
inTitle: "",
approvalProcessShow: false, //审批详情
5 months ago
};
},
computed: {},
5 months ago
methods: {
approvalProcessFn(row) {
this.approvalProcessShow = true;
},
4 months ago
handleDesign() {
this.inDialogType = "add";
this.inDialogTiltle = "新增入库";
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 = '详情'
this.id = row.id
4 months ago
console.log(this.id, 'id')
5 months ago
},
// 编辑
4 months ago
handleEdit(row) {
this.inDialogVisible = true;
this.inDialogType = "edit";
this.inDialogTiltle = "编辑";
this.id = row.id;
5 months ago
},
// 采购单
4 months ago
purchaseFn(row) {
this.purchaseOpen = true;
this.purchaseTitle = row.purchaseEndInfo + "采购单详情";
this.id = row.id;
5 months ago
},
4 months ago
closeDialog() {
this.purchaseOpen = false;
this.approvalProcessShow = false;
5 months ago
},
handleCloseDetail() {
this.inDialogVisible = false;
5 months ago
},
handleExport() {
5 months ago
this.$message({
type: "success",
message: "出库单导出成功!",
5 months ago
});
},
// 行点击事件
rowSelect() {
this.inDialogVisible = true;
this.inDialogType = "inbound";
this.inDialogTiltle = "入库";
5 months ago
},
searchReset() {
this.query = {};
this.form.inDate = [];
this.form.inOperatorName = "";
this.form.inOperator = "";
5 months ago
this.onLoad(this.page);
},
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);
},
//新增提交或暂存后更新页面
handleSubmitSuccess() {
this.onLoad(this.page);
},
//请求列表数据
5 months ago
onLoad(page, params = {}) {
this.loading = true;
4 months ago
const queryParams = {
...params,
...this.query,
pageSize: page.pageSize,
pageNum: page.currentPage,
4 months ago
};
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) => {
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>