|  | @ -1,6 +1,6 @@ | 
		
	
		
			
				|  |  | <template> |  |  | <template> | 
		
	
		
			
				|  |  |   <div> |  |  |   <div> | 
		
	
		
			
				|  |  |     <el-dialog ref="dialogTable" title="新增盘点" :visible.sync="addFormVisible" class="dialog-table"> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |     <el-dialog ref="dialogTable" title="新增盘点" :visible.sync="addFormVisible" :close-on-click-modal="false" class="dialog-table" @close="handleClose"> | 
		
	
		
			
				|  |  |       <span class="dialog-right-top" /> |  |  |       <span class="dialog-right-top" /> | 
		
	
		
			
				|  |  |       <span class="dialog-left-bottom" /> |  |  |       <span class="dialog-left-bottom" /> | 
		
	
		
			
				|  |  |       <div class="setting-dialog"> |  |  |       <div class="setting-dialog"> | 
		
	
	
		
			
				|  | @ -42,31 +42,40 @@ | 
		
	
		
			
				|  |  |           </el-form-item> |  |  |           </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 10px;height:30px" @click="handleBuild">生成盘点单</el-button> | 
		
	
		
			
				|  |  |         </el-form> |  |  |         </el-form> | 
		
	
		
			
				|  |  |         <el-table :data="tableData" height="calc(100vh - 595px)" :cell-class-name="cell"> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |         <el-table v-loading="loading" :data="tableData" height="299px" :cell-class-name="cell"> | 
		
	
		
			
				|  |  |           <el-table-column type="index" align="center" label="序号" width="80" /> |  |  |           <el-table-column type="index" align="center" label="序号" width="80" /> | 
		
	
		
			
				|  |  |           <el-table-column prop="checkState" align="center" label="状态" width="120"> |  |  |  | 
		
	
		
			
				|  |  |             <template slot-scope="scope"> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |           <el-table-column align="center" label="状态" width="100"> | 
		
	
		
			
				|  |  |  |  |  |             <template> | 
		
	
		
			
				|  |  |               <!-- 未盘点 --> |  |  |               <!-- 未盘点 --> | 
		
	
		
			
				|  |  |               <span class="clear">{{ scope.row.checkState }}</span> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |               <span class="clear">未盘点</span> | 
		
	
		
			
				|  |  |  |  |  |             </template> | 
		
	
		
			
				|  |  |  |  |  |           </el-table-column> | 
		
	
		
			
				|  |  |  |  |  |           <el-table-column prop="child" align="center" label="子条数目" width="100" /> | 
		
	
		
			
				|  |  |  |  |  |           <el-table-column prop="categoryType" align="center" label="门类级别" width="100"> | 
		
	
		
			
				|  |  |  |  |  |             <template slot-scope="scope"> | 
		
	
		
			
				|  |  |  |  |  |               <span v-if="scope.row.categoryType === 5" style="width:56px">文件级</span> | 
		
	
		
			
				|  |  |  |  |  |               <span v-if="scope.row.categoryType === 4" style="width:56px">卷内级</span> | 
		
	
		
			
				|  |  |  |  |  |               <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="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="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"> | 
		
	
		
			
				|  |  |  |  |  |             <template slot-scope="scope"> | 
		
	
		
			
				|  |  |  |  |  |               <div>{{ scope.row.createTime | parseTime }}</div> | 
		
	
		
			
				|  |  |             </template> |  |  |             </template> | 
		
	
		
			
				|  |  |           </el-table-column> |  |  |           </el-table-column> | 
		
	
		
			
				|  |  |           <el-table-column prop="" align="center" label="子条数目" width="100" /> |  |  |  | 
		
	
		
			
				|  |  |           <el-table-column prop="" align="center" label="门类级别" width="100" /> |  |  |  | 
		
	
		
			
				|  |  |           <el-table-column prop="" align="center" label="门类名称" width="120" /> |  |  |  | 
		
	
		
			
				|  |  |           <el-table-column prop="" align="center" label="全宗号" width="100" /> |  |  |  | 
		
	
		
			
				|  |  |           <el-table-column prop="" align="center" label="档号" width="180" /> |  |  |  | 
		
	
		
			
				|  |  |           <el-table-column prop="" align="center" label="归档年度" width="100" /> |  |  |  | 
		
	
		
			
				|  |  |           <el-table-column prop="" label="题名" align="center" width="180" /> |  |  |  | 
		
	
		
			
				|  |  |           <el-table-column prop="" label="保密程度" align="center" width="85" /> |  |  |  | 
		
	
		
			
				|  |  |           <el-table-column prop="" label="部门" align="center" width="120" /> |  |  |  | 
		
	
		
			
				|  |  |           <el-table-column prop="" label="盒名称" align="center" width="85" /> |  |  |  | 
		
	
		
			
				|  |  |           <el-table-column prop="" label="所在位置" align="center" width="150" /> |  |  |  | 
		
	
		
			
				|  |  |           <el-table-column prop="" label="创建时间" align="center" width="150" /> |  |  |  | 
		
	
		
			
				|  |  |         </el-table> |  |  |         </el-table> | 
		
	
		
			
				|  |  |         <!-- 分页器 记得加上!!!!!!!!!!!!!!!!!!!!!! --> |  |  |  | 
		
	
		
			
				|  |  |         <!-- !!!!!!!!!!!!!!!!!!!!!!!! --> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |         <el-pagination :page-size.sync="page.size" :total="page.total" :current-page.sync="page.page" style="margin-top: 8px;" layout="total, prev, pager, next, sizes" @size-change="sizeChangeHandler($event)" @current-change="pageChangeHandler" /> | 
		
	
		
			
				|  |  |         <div slot="footer" class="dialog-footer"> |  |  |         <div slot="footer" class="dialog-footer"> | 
		
	
		
			
				|  |  |           <el-button @click="handleSave">保存</el-button> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |           <el-button :disabled="!(tableData.length)" @click="handleSave">保存</el-button> | 
		
	
		
			
				|  |  |         </div> |  |  |         </div> | 
		
	
		
			
				|  |  |       </div> |  |  |       </div> | 
		
	
		
			
				|  |  |     </el-dialog> |  |  |     </el-dialog> | 
		
	
	
		
			
				|  | @ -78,11 +87,16 @@ import Treeselect from '@riophae/vue-treeselect' | 
		
	
		
			
				|  |  | import '@riophae/vue-treeselect/dist/vue-treeselect.css' |  |  | import '@riophae/vue-treeselect/dist/vue-treeselect.css' | 
		
	
		
			
				|  |  | import { menu } from '@/api/storeManage/levelManage/level' |  |  | import { menu } from '@/api/storeManage/levelManage/level' | 
		
	
		
			
				|  |  | import { getCategoryTree } from '@/api/category/category' |  |  | import { getCategoryTree } from '@/api/category/category' | 
		
	
		
			
				|  |  |  |  |  | import { previewArrange, addArrange } from '@/api/archivesManage/archivesCheck' | 
		
	
		
			
				|  |  |  |  |  | import { crud } from '@crud/crud' | 
		
	
		
			
				|  |  |  |  |  | 
 | 
		
	
		
			
				|  |  | export default { |  |  | export default { | 
		
	
		
			
				|  |  |   name: 'AddCheck', |  |  |   name: 'AddCheck', | 
		
	
		
			
				|  |  |   components: { Treeselect }, |  |  |   components: { Treeselect }, | 
		
	
		
			
				|  |  |  |  |  |   mixins: [crud()], | 
		
	
		
			
				|  |  |   data() { |  |  |   data() { | 
		
	
		
			
				|  |  |     return { |  |  |     return { | 
		
	
		
			
				|  |  |  |  |  |       loading: false, | 
		
	
		
			
				|  |  |       menusIds: [], |  |  |       menusIds: [], | 
		
	
		
			
				|  |  |       tableData: [], |  |  |       tableData: [], | 
		
	
		
			
				|  |  |       checkForm: {}, |  |  |       checkForm: {}, | 
		
	
	
		
			
				|  | @ -97,8 +111,18 @@ export default { | 
		
	
		
			
				|  |  |       oldCategory: [], |  |  |       oldCategory: [], | 
		
	
		
			
				|  |  |       allCategory: [], |  |  |       allCategory: [], | 
		
	
		
			
				|  |  |       category: [], |  |  |       category: [], | 
		
	
		
			
				|  |  |       showTags: true |  |  |  | 
		
	
		
			
				|  |  | 
 |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       showTags: true, | 
		
	
		
			
				|  |  |  |  |  |       page: { | 
		
	
		
			
				|  |  |  |  |  |         total: 0, | 
		
	
		
			
				|  |  |  |  |  |         size: 10, | 
		
	
		
			
				|  |  |  |  |  |         page: 1 | 
		
	
		
			
				|  |  |  |  |  |       }, | 
		
	
		
			
				|  |  |  |  |  |       params: { | 
		
	
		
			
				|  |  |  |  |  |         page: null, | 
		
	
		
			
				|  |  |  |  |  |         size: null, | 
		
	
		
			
				|  |  |  |  |  |         deviceIds: null, | 
		
	
		
			
				|  |  |  |  |  |         categoryIds: null | 
		
	
		
			
				|  |  |  |  |  |       } | 
		
	
		
			
				|  |  |     } |  |  |     } | 
		
	
		
			
				|  |  |   }, |  |  |   }, | 
		
	
		
			
				|  |  |   created() { |  |  |   created() { | 
		
	
	
		
			
				|  | @ -153,12 +177,100 @@ export default { | 
		
	
		
			
				|  |  |         this.oldCategory = JSON.parse(JSON.stringify(this.allCategory)) |  |  |         this.oldCategory = JSON.parse(JSON.stringify(this.allCategory)) | 
		
	
		
			
				|  |  |       }) |  |  |       }) | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     // 生成盘点单 | 
		
	
		
			
				|  |  |     handleBuild() { |  |  |     handleBuild() { | 
		
	
		
			
				|  |  |       console.log(this.selectArea, this.category) |  |  |  | 
		
	
		
			
				|  |  |       console.log(this.selectAreaValue, this.categoryValue) |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       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 | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     handleSave() { |  |  |     handleSave() { | 
		
	
		
			
				|  |  |  |  |  |       const params = this.getParams() | 
		
	
		
			
				|  |  |  |  |  |       console.log(params, '---') | 
		
	
		
			
				|  |  |  |  |  |       // 新增盘点 | 
		
	
		
			
				|  |  |  |  |  |       addArrange(params).then(res => { | 
		
	
		
			
				|  |  |  |  |  |         console.log(res, '新增成功') | 
		
	
		
			
				|  |  |  |  |  |         // this.tableData = res.detaills | 
		
	
		
			
				|  |  |  |  |  |         if (res) { | 
		
	
		
			
				|  |  |  |  |  |           this.crud.refresh() | 
		
	
		
			
				|  |  |  |  |  |           this.$message({ | 
		
	
		
			
				|  |  |  |  |  |             message: '新增成功', | 
		
	
		
			
				|  |  |  |  |  |             type: 'success' | 
		
	
		
			
				|  |  |  |  |  |           }) | 
		
	
		
			
				|  |  |           this.addFormVisible = false |  |  |           this.addFormVisible = false | 
		
	
		
			
				|  |  |  |  |  |           this.crud.refresh() | 
		
	
		
			
				|  |  |  |  |  |         } else { | 
		
	
		
			
				|  |  |  |  |  |           this.$message.error('新增失败') | 
		
	
		
			
				|  |  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |  |       }) | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     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 }) | 
		
	
		
			
				|  |  |  |  |  |             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 = 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, | 
		
	
		
			
				|  |  |  |  |  |           'region': region | 
		
	
		
			
				|  |  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |  |         // console.log(params) | 
		
	
		
			
				|  |  |  |  |  |         return params | 
		
	
		
			
				|  |  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     // 预盘点 | 
		
	
		
			
				|  |  |  |  |  |     doPreArrange(params) { | 
		
	
		
			
				|  |  |  |  |  |       previewArrange(params).then(res => { | 
		
	
		
			
				|  |  |  |  |  |         console.log(res, '---预盘点') | 
		
	
		
			
				|  |  |  |  |  |         this.tableData = res.content | 
		
	
		
			
				|  |  |  |  |  |         this.page.total = res.totalElements | 
		
	
		
			
				|  |  |  |  |  |       }) | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     // 每页条数改变 | 
		
	
		
			
				|  |  |  |  |  |     sizeChangeHandler(e) { | 
		
	
		
			
				|  |  |  |  |  |       this.loading = true | 
		
	
		
			
				|  |  |  |  |  |       this.page.size = e | 
		
	
		
			
				|  |  |  |  |  |       this.page.page = 1 | 
		
	
		
			
				|  |  |  |  |  |       this.params.size = e | 
		
	
		
			
				|  |  |  |  |  |       this.params.page = 0 | 
		
	
		
			
				|  |  |  |  |  |       this.doPreArrange(this.params) | 
		
	
		
			
				|  |  |  |  |  |       this.loading = false | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     // 当前页改变 | 
		
	
		
			
				|  |  |  |  |  |     pageChangeHandler(e) { | 
		
	
		
			
				|  |  |  |  |  |       this.loading = true | 
		
	
		
			
				|  |  |  |  |  |       this.page.page = e | 
		
	
		
			
				|  |  |  |  |  |       this.params.page = e - 1 | 
		
	
		
			
				|  |  |  |  |  |       this.doPreArrange(this.params) | 
		
	
		
			
				|  |  |  |  |  |       this.loading = false | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     // 选择门类 |  |  |     // 选择门类 | 
		
	
		
			
				|  |  |     selectChange(val) { |  |  |     selectChange(val) { | 
		
	
	
		
			
				|  | @ -184,6 +296,9 @@ export default { | 
		
	
		
			
				|  |  |       if (columnIndex === 1) { |  |  |       if (columnIndex === 1) { | 
		
	
		
			
				|  |  |         return 'fail-clear' |  |  |         return 'fail-clear' | 
		
	
		
			
				|  |  |       } |  |  |       } | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     handleClose() { | 
		
	
		
			
				|  |  |  |  |  | 
 | 
		
	
		
			
				|  |  |     } |  |  |     } | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  |   } |  |  |   } | 
		
	
	
		
			
				|  | 
 |