|
@@ -8,8 +8,8 @@
|
|
|
<div class="my-title">查看</div>
|
|
|
<div style="margin-left: 20px;margin-right: 20px">
|
|
|
<!-- 工作流 -->
|
|
|
- <div v-show="dataForm.workFlowBusinessExt">
|
|
|
- <el-steps :active="dataForm.workFlowBusinessExt&&dataForm.workFlowBusinessExt.workFlowProcessStepList?dataForm.workFlowBusinessExt.workFlowProcessStepList.length + 2:0" align-center style="margin-bottom: 20px">
|
|
|
+ <div v-show="flowVisible">
|
|
|
+ <el-steps :active="flowVisible?dataList[0].workFlowBusinessExt.workFlowProcessStepList.length:0" align-center style="margin-bottom: 20px">
|
|
|
<template v-for="(item, i) in stepList">
|
|
|
<el-step :icon="item.icon" :title="item.title" :description="item.description"></el-step>
|
|
|
</template>
|
|
@@ -37,34 +37,10 @@
|
|
|
<el-row style="margin-top: 20px">
|
|
|
<el-form :inline="true" :model="dataForm1" @keyup.enter.native="queryData()">
|
|
|
<el-form-item label="仓库名称" prop="warehouseId">
|
|
|
- <el-select
|
|
|
- v-model="dataForm1.warehouseId"
|
|
|
- filterable
|
|
|
- remote
|
|
|
- :remote-method="remoteWarehouse"
|
|
|
- placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in optionsWh"
|
|
|
- :key="item.code"
|
|
|
- :label="item.value"
|
|
|
- :value="item.code">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <warehouse-component v-model="dataForm1.warehouseId" :warehouse-id="dataForm1.warehouseId" @warehouseSelected="warehouseChanged"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="货架名称" prop="shelveId">
|
|
|
- <el-select
|
|
|
- v-model="dataForm1.shelveId"
|
|
|
- filterable
|
|
|
- remote
|
|
|
- :remote-method="remoteShelve"
|
|
|
- placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in optionsShelve"
|
|
|
- :key="item.code"
|
|
|
- :label="item.value"
|
|
|
- :value="item.code">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <shelve-component ref="shelveCom" v-model="dataForm1.shelveId" :warehouse-id="dataForm1.warehouseId" :shelve-id="dataForm1.shelveId"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button @click="queryData()">查询</el-button>
|
|
@@ -159,22 +135,23 @@
|
|
|
import uploadComponent from '../common/upload-component'
|
|
|
import { dealStepData, dealStepLogs } from '@/api/util'
|
|
|
import ApproveComponent from '../common/approve-component'
|
|
|
- import {getInventoryDetail, getWarehouseList, getShelveList} from '@/api/warehouse'
|
|
|
+ import {getInventoryDetail} from '@/api/warehouse'
|
|
|
+ import WarehouseComponent from '../common/warehouse-component'
|
|
|
+ import ShelveComponent from '../common/shelve-component'
|
|
|
export default {
|
|
|
name: 'inventory-detail',
|
|
|
components: {
|
|
|
- EDesc, EDescItem, uploadComponent, ApproveComponent
|
|
|
+ EDesc, EDescItem, uploadComponent, ApproveComponent, ShelveComponent, WarehouseComponent
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
visible: false,
|
|
|
+ flowVisible: false,
|
|
|
isFlow: false,
|
|
|
id: 0,
|
|
|
dataForm: {},
|
|
|
dataForm1: {},
|
|
|
dataList: [],
|
|
|
- optionsWh: [],
|
|
|
- optionsShelve: [],
|
|
|
fileList: [],
|
|
|
fileList1: [],
|
|
|
stepList: [],
|
|
@@ -221,20 +198,19 @@
|
|
|
this.dataForm = {}
|
|
|
this.fileList = []
|
|
|
this.fileList1 = []
|
|
|
- this.stepList = []
|
|
|
- this.logList = []
|
|
|
this.dataForm1 = {}
|
|
|
- this.getDetails(businessType)
|
|
|
// 获取详情
|
|
|
- this.queryData()
|
|
|
+ this.queryData(businessType)
|
|
|
},
|
|
|
// 查询
|
|
|
- queryData () {
|
|
|
+ queryData (businessType) {
|
|
|
this.pageIndex = 1
|
|
|
- this.getDataList()
|
|
|
+ this.stepList = []
|
|
|
+ this.logList = []
|
|
|
+ this.getDataList(businessType)
|
|
|
},
|
|
|
// 获取数据列表
|
|
|
- getDataList () {
|
|
|
+ getDataList (businessType) {
|
|
|
this.dataListLoading = true
|
|
|
let params = {
|
|
|
'current': this.pageIndex,
|
|
@@ -253,6 +229,14 @@
|
|
|
this.dataForm.checkerName = item.checkerName
|
|
|
this.dataForm.dcheckerName = item.dcheckerName
|
|
|
this.dataForm.notes = item.notes
|
|
|
+ // 流程图展示
|
|
|
+ if (item.workFlowBusinessExt) {
|
|
|
+ this.flowVisible = true
|
|
|
+ dealStepData(this.dataList[0].workFlowBusinessExt.workFlowProcessStepList, this.stepList)
|
|
|
+ dealStepLogs(this.dataList[0].workFlowBusinessExt.processLogList, this.logList)
|
|
|
+ }
|
|
|
+ // 初始化审批Form
|
|
|
+ this.showApproveForm(businessType, this.id)
|
|
|
}
|
|
|
} else {
|
|
|
this.dataList = []
|
|
@@ -276,64 +260,6 @@
|
|
|
selectionChangeHandle (val) {
|
|
|
this.dataListSelections = val
|
|
|
},
|
|
|
- // 仓库列表
|
|
|
- async remoteWarehouse (query) {
|
|
|
- let warehouseName = query || null
|
|
|
- await getWarehouseList({'warehouseName': warehouseName}).then(({data}) => {
|
|
|
- if (data && data.code === '200') {
|
|
|
- this.dataForm1 = {}
|
|
|
- this.optionsWh = []
|
|
|
- data.data.records.forEach((item) => {
|
|
|
- this.optionsWh.push({
|
|
|
- code: item.warehouseId,
|
|
|
- value: item.warehouseName
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 货架列表
|
|
|
- async remoteShelve (query) {
|
|
|
- let name = query || null
|
|
|
- let warehouseId = this.dataForm1.warehouseId || null
|
|
|
- await getShelveList({'name': name, 'warehouseId': warehouseId}).then(({data}) => {
|
|
|
- if (data && data.code === '200') {
|
|
|
- this.optionsShelve = []
|
|
|
- data.data.records.forEach((item) => {
|
|
|
- this.optionsShelve.push({
|
|
|
- code: item.shelveId,
|
|
|
- value: item.name
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- getDetails (businessType) {
|
|
|
- getInventoryDetail(this.id).then(({data}) => {
|
|
|
- if (data && data.code === '200') {
|
|
|
- this.dataList = data.data.records
|
|
|
- this.totalPage = Number(data.data.total)
|
|
|
- if (this.dataList.length > 0) {
|
|
|
- let item = this.dataList[0]
|
|
|
- this.dataForm.inventoryCode = item.inventoryCode
|
|
|
- this.dataForm.checkerName = item.checkerName
|
|
|
- this.dataForm.dcheckerName = item.dcheckerName
|
|
|
- this.dataForm.notes = item.notes
|
|
|
- }
|
|
|
- // 流程图展示
|
|
|
- if (data.data.workFlowBusinessExt) {
|
|
|
- dealStepData(data.data.workFlowBusinessExt.workFlowProcessStepList, this.stepList)
|
|
|
- dealStepLogs(data.data.workFlowBusinessExt.processLogList, this.logList)
|
|
|
- }
|
|
|
- // 初始化审批Form
|
|
|
- this.showApproveForm(businessType, this.id)
|
|
|
- } else {
|
|
|
- this.dataList = []
|
|
|
- this.totalPage = 0
|
|
|
- }
|
|
|
- this.dataListLoading = false
|
|
|
- })
|
|
|
- },
|
|
|
// 初始化审批Form
|
|
|
showApproveForm (businessType, businessId) {
|
|
|
if (this.isFlow) {
|
|
@@ -362,6 +288,10 @@
|
|
|
approveFinished () {
|
|
|
this.visible = false
|
|
|
this.$emit('approveFinished')
|
|
|
+ },
|
|
|
+ warehouseChanged (item) {
|
|
|
+ this.dataForm1.warehouseId = item
|
|
|
+ this.$refs.shelveCom.init(item)
|
|
|
}
|
|
|
}
|
|
|
}
|