Browse Source

盘盈列表

master
xuhuajiao 1 month ago
parent
commit
c829808c08
  1. 10
      src/api/asset/index.js
  2. 183
      src/views/assetManage/stocktaking/index.vue

10
src/api/asset/index.js

@ -35,6 +35,15 @@ export function FetchStockTakeDetailsByTaskId(params) {
})
}
// 获取盘盈列表
export function FetchStockTakeSuperfluousByTaskId(params) {
return request({
url: 'api/stocktake/getStockTakeSuperfluousByTaskId',
method: 'get',
params
})
}
// 结算盘点单
export function FetchStockSettle(ids) {
return request({
@ -66,6 +75,7 @@ export default {
add,
FetchAssetInfoDetailsByMark,
FetchStockTakeDetailsByTaskId,
FetchStockTakeSuperfluousByTaskId,
FetchStockSettle,
FetchDeleteStockTake,
FetchDeleteAssetInfoPhotoById

183
src/views/assetManage/stocktaking/index.vue

@ -259,31 +259,124 @@
</el-table>
<!-- 盘点清单 -->
<div class="inventory-list">
<!-- <div>
<h3>盘点清单</h3>
<h3>盘盈列表</h3>
</div> -->
<ul class="tab-nav">
<li :class="{'active-tab-nav': tabIndex == 0}" @click="changeActiveTab(0)">盘点清单</li>
<li :class="{'active-tab-nav': tabIndex == 1}" @click="changeActiveTab(1)">盘盈列表</li>
</ul>
<el-table v-loading="inventoryLoading" stripe style="width: 100%;" height="calc(100vh - 460px)" :data="inventoryList">
<el-table-column label="序号" align="center" width="55">
<template slot-scope="scope">
{{ (inventoryPage - 1) * inventoryPageSize + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="taskResult" label="结果">
<el-table-column v-if="tabIndex === 0" prop="taskResult" label="结果">
<template slot-scope="scope">
<el-tag v-if="scope.row.taskResult === 0">未盘</el-tag>
<el-tag v-if="scope.row.taskResult === 1" type="success">正常</el-tag>
<el-tag v-if="scope.row.taskResult === 2" type="error">盘亏</el-tag>
</template>
</el-table-column>
<el-table-column prop="assetMark" label="资产编码" min-width="220px" :show-overflow-tooltip="true" />
<el-table-column prop="assetName" label="资产名称" min-width="180px" :show-overflow-tooltip="true" />
<el-table-column prop="taskRemark" label="盘点备注" min-width="100px" />
<el-table-column prop="capitalStatus" label="资产状态" min-width="100px" />
<el-table-column prop="capitaltypename" label="资产类型" min-width="100px" />
<el-table-column prop="departmentname" label="使用部门" min-width="260px" :show-overflow-tooltip="true" />
<el-table-column prop="resourcename" label="使用人" min-width="100px" :show-overflow-tooltip="true" />
<el-table-column v-else prop="taskResult" label="结果">
<template>
<el-tag class="other-tag">盘盈</el-tag>
</template>
</el-table-column>
<el-table-column prop="assetMark" label="资产编码" min-width="220px" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="tabIndex === 0">{{ scope.row.assetMark }}</span>
<span v-else>
{{
(scope.row.assetInfo && scope.row.assetInfo.mark)
? scope.row.assetInfo.mark
: (scope.row.superfluous && scope.row.superfluous.mark) || '-'
}}
</span>
</template>
</el-table-column>
<el-table-column prop="assetName" label="资产名称" min-width="180px" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="tabIndex === 0">{{ scope.row.assetName }}</span>
<span v-else>
{{ scope.row.assetInfo ? scope.row.assetInfo.name : '' }}
</span>
</template>
</el-table-column>
<el-table-column prop="taskRemark" label="盘点备注" min-width="100px">
<template slot-scope="scope">
<span v-if="tabIndex === 0">{{ scope.row.taskRemark }}</span>
<span v-else>
{{ scope.row.assetInfo ? scope.row.assetInfo.capitalStatus : '' }}
</span>
</template>
</el-table-column>
<el-table-column prop="capitalStatus" label="资产状态" min-width="100px">
<template slot-scope="scope">
<span v-if="tabIndex === 0">{{ scope.row.capitalStatus }}</span>
<span v-else>
{{ scope.row.assetInfo ? scope.row.assetInfo.capitalStatus : '' }}
</span>
</template>
</el-table-column>
<el-table-column prop="capitaltypename" label="资产类型" min-width="100px">
<template slot-scope="scope">
<span v-if="tabIndex === 0">{{ scope.row.capitaltypename }}</span>
<span v-else>
{{ scope.row.assetInfo ? scope.row.assetInfo.capitaltypename : '' }}
</span>
</template>
</el-table-column>
<el-table-column prop="departmentname" label="使用部门" min-width="260px" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="tabIndex === 0">{{ scope.row.departmentname }}</span>
<span v-else>
{{ scope.row.assetInfo ? scope.row.assetInfo.departmentname : '' }}
</span>
</template>
</el-table-column>
<el-table-column prop="resourcename" label="使用人" min-width="100px" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="tabIndex === 0">{{ scope.row.resourcename }}</span>
<span v-else>
{{ scope.row.assetInfo ? scope.row.assetInfo.resourcename : '' }}
</span>
</template>
</el-table-column>
<!-- <el-table-column prop="blongsubcompanyname" label="所属单位" min-width="180px" :show-overflow-tooltip="true" />
<el-table-column prop="blongdepartmentname" label="所属部门" min-width="180px" :show-overflow-tooltip="true" /> -->
<el-table-column prop="glrname" label="管理人" min-width="100px" :show-overflow-tooltip="true" />
<el-table-column prop="cfd" label="存放地" min-width="260px" :show-overflow-tooltip="true" />
<el-table-column prop="glrname" label="管理人" min-width="100px" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="tabIndex === 0">{{ scope.row.glrname }}</span>
<span v-else>
{{ scope.row.assetInfo ? scope.row.assetInfo.glrname : '' }}
</span>
</template>
</el-table-column>
<el-table-column prop="cfd" label="存放地" min-width="260px" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="tabIndex === 0">{{ scope.row.cfd }}</span>
<span v-else>
{{ scope.row.assetInfo ? scope.row.assetInfo.cfd : '' }}
</span>
</template>
</el-table-column>
<el-table-column v-if="tabIndex === 1" prop="taskTime" label="盘点时间" width="160px">
<template slot-scope="scope">
<!-- 有资产信息 显示 - -->
<span v-if="scope.row.assetInfo"> - </span>
<!-- 没有资产信息 安全显示时间没有时间也显示 - -->
<span v-else-if="scope.row.superfluous && scope.row.superfluous.taskTime">
{{ scope.row.superfluous.taskTime | parseTime }}
</span>
<!-- 都没有 显示 - -->
<span v-else> - </span>
</template>
</el-table-column>
</el-table>
<div style="margin-top: 10px; display: flex; justify-content: flex-end;">
<el-pagination
@ -308,7 +401,7 @@
<script>
// import { getAssetDeptTree } from '@/api/system/dept'
import crudAsset, { FetchInitAssetInfo, FetchStockTakeDetailsByTaskId, FetchStockSettle, FetchDeleteStockTake, add } from '@/api/asset/index'
import crudAsset, { FetchInitAssetInfo, FetchStockTakeDetailsByTaskId, FetchStockTakeSuperfluousByTaskId, FetchStockSettle, FetchDeleteStockTake, add } from '@/api/asset/index'
import { FetchWarehouseTree } from '@/api/assetDevice/index'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
@ -390,7 +483,8 @@ export default {
billNo: '',
warehouseId: '',
status: ''
}
},
tabIndex: 0
}
},
computed: {
@ -639,6 +733,7 @@ export default {
},
//
handleRowDblClick(row) {
this.tabIndex = 0
this.selectedTask = []
this.selectedTask.push(row)
this.detailDialogVisible = true
@ -647,6 +742,14 @@ export default {
//
this.fetchInventoryList()
},
changeActiveTab(index) {
this.tabIndex = index
if (this.tabIndex === 1) {
this.getStockTakeSuperfluousByTaskId()
} else {
this.fetchInventoryList()
}
},
//
fetchInventoryList() {
if (!this.selectedTask) return
@ -668,16 +771,46 @@ export default {
this.inventoryLoading = false
})
},
//
getStockTakeSuperfluousByTaskId() {
if (!this.selectedTask) return
this.inventoryLoading = true
const params = {
'taskId': this.selectedTask[0].id,
'pageNo': this.inventoryPage,
'pageSize': this.inventoryPageSize
}
FetchStockTakeSuperfluousByTaskId(params).then(res => {
console.log('dd', res.data.records)
this.inventoryList = res.data.records
this.inventoryTotal = res.data.total
this.inventoryLoading = false
}).catch(err => {
console.log(err)
this.$message({ message: '获取数据失败', type: 'error', offset: 8 })
this.inventoryLoading = false
})
},
//
handleInventorySizeChange(size) {
this.inventoryPage = 1
this.inventoryPageSize = size
if (this.tabIndex === 1) {
this.getStockTakeSuperfluousByTaskId()
} else {
this.fetchInventoryList()
}
},
//
handleInventoryCurrentChange(current) {
this.inventoryPage = current
if (this.tabIndex === 1) {
this.getStockTakeSuperfluousByTaskId()
} else {
this.fetchInventoryList()
}
},
//
addStockTakeBill() {
@ -742,6 +875,11 @@ export default {
border-color: #fcab9d !important;
color: #ed4a41!important;
}
&.other-tag{
color: #FF8329 !important;
background-color: #FFF3E5 !important;
border-color: #FEBD98 !important;
}
}
.task-detail {
@ -776,4 +914,25 @@ export default {
.el-table .el-button{
padding: 7px 10px !important;
}
.tab-nav{
display: flex;
justify-content: flex-start;
margin: 25px 0 18px 0;
font-size: 16px;
font-weight: bold;
color: #333;
// padding: 0 0 0 20px;
border-bottom: 1px solid #EDEFF3;
li{
margin-right: 30px;
cursor: default;
&.active-tab-nav{
padding-bottom: 10px;
color: #0348F3;
border-bottom: 3px solid #0348F3;
}
}
}
</style>
Loading…
Cancel
Save