|
|
|
|
@ -1,12 +1,25 @@ |
|
|
|
|
<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" > |
|
|
|
|
<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" |
|
|
|
|
> |
|
|
|
|
<!-- @row-click="rowSelect" --> |
|
|
|
|
<template slot-scope="scope" slot="menuLeft"> |
|
|
|
|
<el-button size="small" type="primary" @click="handleDesign()">新增出库单 |
|
|
|
|
<el-button size="small" type="primary" @click="handleDesign()" |
|
|
|
|
>新增出库单 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template slot-scope="scope" slot="demandEndInfo"> |
|
|
|
|
@ -18,35 +31,54 @@ |
|
|
|
|
> |
|
|
|
|
<span v-else>无</span> |
|
|
|
|
</template> |
|
|
|
|
<template slot-scope="scope" slot="outTypeInfo"> |
|
|
|
|
<!-- <template slot-scope="scope" slot="outTypeInfo"> |
|
|
|
|
<span v-if="scope.row.optionType=='YH'">发放单</span> |
|
|
|
|
<span v-if="scope.row.optionType=='NY'">出库单</span> |
|
|
|
|
</template> |
|
|
|
|
</template> --> |
|
|
|
|
<template #menu="scope"> |
|
|
|
|
<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> |
|
|
|
|
<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> |
|
|
|
|
<outDialog v-if="outDialogVisible" :repairVisible='outDialogVisible' :outDialogTiltle="outDialogTiltle" |
|
|
|
|
:outDialogType="outDialogType" @handleCloseDetail="handleCloseDetail" type="一级库" @submitSuccess="handleSubmitSuccess" |
|
|
|
|
:id="id"> |
|
|
|
|
<outDialog |
|
|
|
|
v-if="outDialogVisible" |
|
|
|
|
:repairVisible="outDialogVisible" |
|
|
|
|
:outDialogTiltle="outDialogTiltle" |
|
|
|
|
:outDialogType="outDialogType" |
|
|
|
|
@handleCloseDetail="handleCloseDetail" |
|
|
|
|
type="一级库" |
|
|
|
|
@submitSuccess="handleSubmitSuccess" |
|
|
|
|
:id="id" |
|
|
|
|
> |
|
|
|
|
</outDialog> |
|
|
|
|
|
|
|
|
|
<!-- 需求单明细 --> |
|
|
|
|
<needDialog :showDialog="purchaseOpen" v-if="purchaseOpen" @closeDialog="closeDialog" |
|
|
|
|
:purchaseTitle="purchaseTitle" :id="id"> |
|
|
|
|
<needDialog |
|
|
|
|
:showDialog="purchaseOpen" |
|
|
|
|
v-if="purchaseOpen" |
|
|
|
|
@closeDialog="closeDialog" |
|
|
|
|
:purchaseTitle="purchaseTitle" |
|
|
|
|
:id="id" |
|
|
|
|
> |
|
|
|
|
</needDialog> |
|
|
|
|
</basic-container> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { getList } from "@/api/firstOrder/outbound"; |
|
|
|
|
import outDialog from './components/outDialog.vue'; |
|
|
|
|
import needDialog from './components/needDialog.vue'; |
|
|
|
|
import outDialog from "./components/outDialog.vue"; |
|
|
|
|
import needDialog from "./components/needDialog.vue"; |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
outDialog, |
|
|
|
|
needDialog |
|
|
|
|
needDialog, |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
@ -57,10 +89,10 @@ export default { |
|
|
|
|
page: { |
|
|
|
|
pageSize: 10, |
|
|
|
|
currentPage: 1, |
|
|
|
|
total: 0 |
|
|
|
|
total: 0, |
|
|
|
|
}, |
|
|
|
|
option: { |
|
|
|
|
height: 'auto', |
|
|
|
|
height: "auto", |
|
|
|
|
calcHeight: 30, |
|
|
|
|
tip: false, |
|
|
|
|
searchShow: true, |
|
|
|
|
@ -99,7 +131,7 @@ export default { |
|
|
|
|
return "无"; |
|
|
|
|
} |
|
|
|
|
return value; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "出库单号", |
|
|
|
|
@ -114,6 +146,11 @@ export default { |
|
|
|
|
width: 140, |
|
|
|
|
headerAlign: "center", |
|
|
|
|
align: "center", |
|
|
|
|
formatter: (row, column, cellValue) => { |
|
|
|
|
if (row.optionType === "YH") return "发放单"; |
|
|
|
|
if (row.optionType === "NY") return "出库单"; |
|
|
|
|
return ""; |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "出库日期", |
|
|
|
|
@ -121,10 +158,10 @@ export default { |
|
|
|
|
search: true, |
|
|
|
|
type: "datetime", |
|
|
|
|
searchRange: true, |
|
|
|
|
startPlaceholder: '开始时间', |
|
|
|
|
startPlaceholder: "开始时间", |
|
|
|
|
endPlaceholder: "结束时间", |
|
|
|
|
format: 'yyyy-MM-dd HH:mm:ss', |
|
|
|
|
valueFormat: 'yyyy-MM-dd HH:mm:ss', |
|
|
|
|
format: "yyyy-MM-dd HH:mm:ss", |
|
|
|
|
valueFormat: "yyyy-MM-dd HH:mm:ss", |
|
|
|
|
width: 140, |
|
|
|
|
headerAlign: "center", |
|
|
|
|
align: "center", |
|
|
|
|
@ -140,17 +177,19 @@ export default { |
|
|
|
|
label: "物资类型", |
|
|
|
|
prop: "materialType", |
|
|
|
|
search: false, |
|
|
|
|
type: 'select', |
|
|
|
|
type: "select", |
|
|
|
|
headerAlign: "center", |
|
|
|
|
align: "center", |
|
|
|
|
dicData: [{ |
|
|
|
|
label: '办公物资', |
|
|
|
|
value: '1' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '其他物资', |
|
|
|
|
value: '2' |
|
|
|
|
}] |
|
|
|
|
dicData: [ |
|
|
|
|
{ |
|
|
|
|
label: "办公物资", |
|
|
|
|
value: "1", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "其他物资", |
|
|
|
|
value: "2", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
// { |
|
|
|
|
// label: "部门", |
|
|
|
|
@ -169,7 +208,7 @@ export default { |
|
|
|
|
label: "出库人", |
|
|
|
|
prop: "shipperName", |
|
|
|
|
search: true, |
|
|
|
|
searchParam: 'inOperator', |
|
|
|
|
searchParam: "inOperator", |
|
|
|
|
align: "center", |
|
|
|
|
headerAlign: "center", |
|
|
|
|
}, |
|
|
|
|
@ -177,93 +216,89 @@ export default { |
|
|
|
|
{ |
|
|
|
|
label: "状态", |
|
|
|
|
prop: "status", |
|
|
|
|
type: 'select', |
|
|
|
|
type: "select", |
|
|
|
|
dicData: [ |
|
|
|
|
{ |
|
|
|
|
label: '暂存', |
|
|
|
|
value: 1 |
|
|
|
|
label: "暂存", |
|
|
|
|
value: 1, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '待审批', |
|
|
|
|
value: 2 |
|
|
|
|
label: "待审批", |
|
|
|
|
value: 2, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '已出库', |
|
|
|
|
value: 3 |
|
|
|
|
label: "已出库", |
|
|
|
|
value: 3, |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
] |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
data: [], |
|
|
|
|
outDialogVisible: false, |
|
|
|
|
outDialogTiltle: '出库', |
|
|
|
|
outDialogType: '',//弹框类型 |
|
|
|
|
outDialogTiltle: "出库", |
|
|
|
|
outDialogType: "", //弹框类型 |
|
|
|
|
purchaseOpen: false, |
|
|
|
|
purchaseTitle: '', |
|
|
|
|
inTitle: '', |
|
|
|
|
purchaseTitle: "", |
|
|
|
|
inTitle: "", |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
computed: {}, |
|
|
|
|
methods: { |
|
|
|
|
handleDesign() { |
|
|
|
|
this.outDialogVisible = true |
|
|
|
|
this.outDialogType = 'add' |
|
|
|
|
this.outDialogTiltle = '新增出库' |
|
|
|
|
this.outDialogVisible = true; |
|
|
|
|
this.outDialogType = "add"; |
|
|
|
|
this.outDialogTiltle = "新增出库"; |
|
|
|
|
}, |
|
|
|
|
// 详情 |
|
|
|
|
handleDetails(row) { |
|
|
|
|
console.log(row, 'row详情') |
|
|
|
|
this.outDialogVisible = true |
|
|
|
|
this.outDialogType = 'details' |
|
|
|
|
this.outDialogTiltle = '详情' |
|
|
|
|
this.id = row.id |
|
|
|
|
console.log(this.id,'详情的id') |
|
|
|
|
console.log(row, "row详情"); |
|
|
|
|
this.outDialogVisible = true; |
|
|
|
|
this.outDialogType = "details"; |
|
|
|
|
this.outDialogTiltle = "详情"; |
|
|
|
|
this.id = row.id; |
|
|
|
|
console.log(this.id, "详情的id"); |
|
|
|
|
}, |
|
|
|
|
// 编辑 |
|
|
|
|
handleEdit(row) { |
|
|
|
|
this.outDialogVisible = true |
|
|
|
|
this.outDialogType = 'edit' |
|
|
|
|
this.outDialogTiltle = '编辑' |
|
|
|
|
this.id = row.id |
|
|
|
|
this.outDialogVisible = true; |
|
|
|
|
this.outDialogType = "edit"; |
|
|
|
|
this.outDialogTiltle = "编辑"; |
|
|
|
|
this.id = row.id; |
|
|
|
|
}, |
|
|
|
|
// 需求单 |
|
|
|
|
purchaseFn(row) { |
|
|
|
|
console.log('xuqiudanchuku') |
|
|
|
|
this.purchaseOpen = true |
|
|
|
|
this.purchaseTitle = row.demandEndInfo + '需求单详情' |
|
|
|
|
this.id = row.id |
|
|
|
|
console.log(this.id,'需求单的id') |
|
|
|
|
console.log("xuqiudanchuku"); |
|
|
|
|
this.purchaseOpen = true; |
|
|
|
|
this.purchaseTitle = row.demandEndInfo + "需求单详情"; |
|
|
|
|
this.id = row.id; |
|
|
|
|
console.log(this.id, "需求单的id"); |
|
|
|
|
}, |
|
|
|
|
closeDialog() { |
|
|
|
|
this.purchaseOpen = false |
|
|
|
|
this.purchaseOpen = false; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
handleCloseDetail() { |
|
|
|
|
this.outDialogVisible = false |
|
|
|
|
this.outDialogVisible = false; |
|
|
|
|
}, |
|
|
|
|
handleExport() { |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "出库单导出成功!" |
|
|
|
|
}) |
|
|
|
|
message: "出库单导出成功!", |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 行点击事件 |
|
|
|
|
rowSelect() { |
|
|
|
|
this.outDialogVisible = true |
|
|
|
|
this.outDialogType = 'outbound' |
|
|
|
|
this.outDialogTiltle = '出库' |
|
|
|
|
this.outDialogVisible = true; |
|
|
|
|
this.outDialogType = "outbound"; |
|
|
|
|
this.outDialogTiltle = "出库"; |
|
|
|
|
}, |
|
|
|
|
searchReset() { |
|
|
|
|
this.query = {}; |
|
|
|
|
this.form.outDate = [] |
|
|
|
|
this.form.inOperatorName = '' |
|
|
|
|
this.form.inOperator = '' |
|
|
|
|
this.form.outDate = []; |
|
|
|
|
this.form.inOperatorName = ""; |
|
|
|
|
this.form.inOperator = ""; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
searchChange(params, done) { |
|
|
|
|
if (params && params.inOperatorName && !params.inOperator) { |
|
|
|
|
@ -294,7 +329,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
//新增提交或暂存后更新页面 |
|
|
|
|
handleSubmitSuccess() { |
|
|
|
|
this.onLoad(this.page) |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
}, |
|
|
|
|
//请求列表数据 |
|
|
|
|
onLoad(page, params = {}) { |
|
|
|
|
@ -303,21 +338,21 @@ export default { |
|
|
|
|
...params, |
|
|
|
|
...this.query, |
|
|
|
|
pageSize: page.pageSize, |
|
|
|
|
pageNum: page.currentPage |
|
|
|
|
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 => { |
|
|
|
|
console.log('列表', res.data.result) |
|
|
|
|
getList(page.currentPage, page.pageSize, queryParams).then((res) => { |
|
|
|
|
console.log("列表", res.data.result); |
|
|
|
|
this.data = res.data.result.list; |
|
|
|
|
this.loading = false; |
|
|
|
|
this.page.total = res.data.result.total; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|