仓库查看入库单

This commit is contained in:
xiaofajia 2024-12-04 16:14:11 +08:00
parent e8b7e1620c
commit af4e392e0b

View File

@ -109,6 +109,9 @@
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
>查看
</el-button>
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShowIn(scope.row)"
>查看入库单
</el-button>
<el-button @click="handleInWares(scope.row)" v-if="scope.row.soStatus === '02'" size="mini" type="text"
icon="el-icon-edit-outline"
>入库
@ -230,6 +233,40 @@
<el-button @click="dialogVisible = false">取消</el-button>
</div>
</el-dialog>
<el-dialog title="入库单" :visible.sync="inDialog" width="80%" v-dialogDrag append-to-body>
<el-table :data="inData" v-loading="inLoading2" :row-key="getRowKey" :expand-row-keys="expands" @expand-change="handleExpand" :stripe="true" :show-overflow-tooltip="true">
<el-table-column type="expand">
<template slot-scope="scope">
<el-table :data="inSoiList" v-loading="inLoading3" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="序号" align="center" width="55">
<template scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="名称" align="center" prop="repairWares.name" />
<el-table-column label="单价" align="center" prop="goodsPrice" />
<el-table-column label="入库数量" align="center" prop="goodsCount" />
</el-table>
</template>
</el-table-column>
<el-table-column label="序号" align="center" width="55">
<template scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="单号" align="center" prop="soNo" />
<el-table-column label="入库时间" align="center" prop="createTime">
<template slot-scope="scope">
{{parseTime(scope.row.createTime)}}
</template>
</el-table-column>
<el-table-column label="入库人" align="center" prop="userName" />
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="inDialog = false">关闭</el-button>
</div>
</el-dialog>
</div>
</template>
@ -245,6 +282,8 @@ import {getRepairSoiByIds, getMapBySoIdAndQuery} from "@/api/repair/stockOperate
import {createUniqueCodeByHead} from "@/utils/createUniqueCode";
import WarehouseChoose from "@/views/repair/Components/WarehouseChoose.vue";
import {getBaseTypeList} from "@/api/base/type";
import {getUserProfile} from "@/api/system/user";
import {parseTime} from "../../../../utils/ruoyi";
export default {
name: "SoIndex",
@ -342,12 +381,61 @@ export default {
isRefresh: false,
//
exportLoading: false,
inQueryParams:{
pageNo: 1,
pageSize: 10,
userId: null,
mainId: null,
},
inDialog: false,
inData: [],
inTotal: 0,
inLoading2: false,
expands: [],
getRowKey:(row) => {
return row.id
},
inSoiList: [],
inLoading3: false
}
},
mounted() {
this.pageSo();
},
methods: {
parseTime,
async handleExpand(row, expandedRows){
let that = this
if (expandedRows.length){
that.expands = []
if (row){
that.expands.push(row.id)
try {
that.inLoading3 = true
const resSo = await getRepairSoById(row.id)
const ids = resSo.data.goodsList.map(item => item.id)
const resSoi = await getRepairSoiByIds(ids)
this.inSoiList = resSoi.data
that.inLoading3 = false
}catch{}
}
}else {
that.expands = []
}
},
async handleShowIn(row){
try {
this.inDialog = true
this.inLoading2 = true
this.inQueryParams.mainId = row.id
const user = await getUserProfile();
this.inQueryParams.userId = user.data.id
const res = await getRepairSoPage(this.inQueryParams)
this.inData = res.data.records
this.inTotal = res.data.total
this.inLoading2 = false
}catch{}
},
setSelectedRows() {
this.$nextTick(() => {
Object.keys(this.$refs).forEach(key => {