|
|
|
@ -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> |