|
|
@ -9,8 +9,9 @@ |
|
|
|
:model="checkForm" |
|
|
|
size="small" |
|
|
|
label-width="80px" |
|
|
|
:rules="rules" |
|
|
|
> |
|
|
|
<el-form-item label="选择区域" prop="selectArea" class="down-select" style="padding-top:1px"> |
|
|
|
<el-form-item label="选择区域" prop="selectArea" class="down-select" style="padding-top:1px;margin-right:20px"> |
|
|
|
<treeselect |
|
|
|
v-model="selectAreaValue" |
|
|
|
:options="selectArea" |
|
|
@ -40,7 +41,7 @@ |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-button type="primary" size="mini" style="margin:0 0 0 10px;height:30px" @click="handleBuild">生成盘点单</el-button> |
|
|
|
<el-button type="primary" size="mini" style="margin:0 0 0 20px;height:30px" @click="handleBuild">生成盘点单</el-button> |
|
|
|
</el-form> |
|
|
|
<el-table v-loading="loading" :data="tableData" height="299px" :cell-class-name="cell"> |
|
|
|
<el-table-column type="index" align="center" label="序号" width="80" /> |
|
|
@ -58,18 +59,18 @@ |
|
|
|
<span v-if="scope.row.categoryType === 3" style="width:56px">案卷级</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="categoryName" align="center" label="门类名称" width="120" /> |
|
|
|
<el-table-column prop="categoryName" align="center" show-overflow-tooltip label="门类名称" width="120" /> |
|
|
|
<el-table-column prop="fondsNo" align="center" label="全宗号" width="100" /> |
|
|
|
<el-table-column prop="archiveNo" align="center" label="档号" width="180" /> |
|
|
|
<el-table-column prop="archiveYear" align="center" label="归档年度" width="100" /> |
|
|
|
<el-table-column prop="maintitle" label="题名" align="center" width="180" /> |
|
|
|
<el-table-column prop="maintitle" show-overflow-tooltip label="题名" align="center" width="180" /> |
|
|
|
<el-table-column prop="securityClass" label="保密程度" align="center" width="85" /> |
|
|
|
<el-table-column prop="department" label="部门" align="center" width="120" /> |
|
|
|
<el-table-column prop="caseName" label="盒名称" align="center" width="85" /> |
|
|
|
<el-table-column prop="folderLocationDetails" label="所在位置" align="center" width="150" /> |
|
|
|
<el-table-column prop="createTime" label="创建时间" align="center" width="150"> |
|
|
|
<el-table-column prop="caseName" label="盒名称" show-overflow-tooltip align="center" width="120" /> |
|
|
|
<el-table-column prop="folderLocationDetails" show-overflow-tooltip label="所在位置" align="center" width="150" /> |
|
|
|
<el-table-column prop="create_time" label="创建时间" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div>{{ scope.row.createTime | parseTime }}</div> |
|
|
|
<div>{{ scope.row.create_time | parseTime }}</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -103,7 +104,6 @@ export default { |
|
|
|
addFormVisible: false, |
|
|
|
selectAreaValue: [], |
|
|
|
selectArea: [], |
|
|
|
// deviceTree:[], |
|
|
|
defaultProps: { children: 'children', label: 'label' }, |
|
|
|
nodeKey: 'id', |
|
|
|
defaultCheckedKeys: [], |
|
|
@ -122,6 +122,10 @@ export default { |
|
|
|
size: null, |
|
|
|
deviceIds: null, |
|
|
|
categoryIds: null |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
selectArea: [{ required: true, trigger: 'blur' }], |
|
|
|
category: [{ required: true, trigger: 'blur' }] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -135,7 +139,6 @@ export default { |
|
|
|
const deviceTree = [] |
|
|
|
let storeroom = {} |
|
|
|
let devices = [] |
|
|
|
// deviceTree.splice(0, deviceTree.length) |
|
|
|
data.forEach((item, i) => { |
|
|
|
if (!storeroom.id) { |
|
|
|
item.storeroomId.label = item.storeroomId.name |
|
|
@ -179,14 +182,21 @@ export default { |
|
|
|
}, |
|
|
|
// 生成盘点单 |
|
|
|
handleBuild() { |
|
|
|
this.loading = true |
|
|
|
const paramsNo = this.getParams() |
|
|
|
this.params.deviceIds = paramsNo.deviceIds |
|
|
|
this.params.categoryIds = paramsNo.categoryIds |
|
|
|
this.params.page = this.page.page - 1 |
|
|
|
this.params.size = this.page.size |
|
|
|
this.doPreArrange(this.params) |
|
|
|
this.loading = false |
|
|
|
if (this.selectAreaValue.length > 0 && this.categoryValue.length > 0) { |
|
|
|
this.loading = true |
|
|
|
const paramsNo = this.getParams() |
|
|
|
this.params.deviceIds = paramsNo.deviceIds |
|
|
|
this.params.categoryIds = paramsNo.categoryIds |
|
|
|
this.params.page = this.page.page - 1 |
|
|
|
this.params.size = this.page.size |
|
|
|
this.doPreArrange(this.params) |
|
|
|
this.loading = false |
|
|
|
} else { |
|
|
|
this.$message({ |
|
|
|
message: '区域和门类均不能为空', |
|
|
|
type: 'warning' |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
handleSave() { |
|
|
|
const params = this.getParams() |
|
|
@ -209,34 +219,27 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
getParams() { |
|
|
|
// console.log(this.selectArea, this.category) |
|
|
|
// console.log(this.selectAreaValue, this.categoryValue) |
|
|
|
const room = this.selectArea.map(item => { return item.id }) // 所有区域id |
|
|
|
// console.log(room, 'room') |
|
|
|
if (this.selectAreaValue.length > 0 && this.categoryValue.length > 0) { |
|
|
|
// const selRoom = this.selectAreaValue.filter(item => room.includes(item)) // 选择的区域id |
|
|
|
let deviceIds = this.selectAreaValue.filter(item => !room.includes(item)) // 选中的设备id |
|
|
|
const devIds = JSON.parse(JSON.stringify(deviceIds)) |
|
|
|
let region = [] |
|
|
|
this.selectArea.forEach(item => { |
|
|
|
if (this.selectAreaValue.includes(item.id)) { |
|
|
|
region.push(item.name) |
|
|
|
const arr = item.children.map(val => { return val.id }) |
|
|
|
const arr = item.children.map(val => { return val.id }) // 区域内所有设备 |
|
|
|
deviceIds = deviceIds.concat(arr) |
|
|
|
} |
|
|
|
if (devIds.length > 0) { |
|
|
|
item.children.forEach(val => { |
|
|
|
if (devIds.includes(val.id) && !region.includes(item.name)) { |
|
|
|
region.push(item.name) |
|
|
|
region.push(item.name) // 含设备的区域 |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
region = region.join(',') // 区域str |
|
|
|
const categoryIds = this.categoryValue.filter(item => item !== 0) |
|
|
|
// console.log(categoryIds, 'categoryIds') |
|
|
|
// console.log(deviceIds, 'deviceIds') |
|
|
|
// console.log(region, 'region') |
|
|
|
const params = { |
|
|
|
'categoryIds': categoryIds, |
|
|
|
'deviceIds': deviceIds, |
|
|
|