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