diff --git a/src/assets/styles/yxk-admin.scss b/src/assets/styles/yxk-admin.scss index 3bf8220..29297f0 100644 --- a/src/assets/styles/yxk-admin.scss +++ b/src/assets/styles/yxk-admin.scss @@ -636,7 +636,7 @@ .vue-treeselect__placeholder, .vue-treeselect__single-value{ height: 28px; - // line-height: 28px; + line-height: 28px; color: #fff; } .vue-treeselect__control{ diff --git a/src/views/archivesManage/archivesCheck/module/addCheck.vue b/src/views/archivesManage/archivesCheck/module/addCheck.vue index a6ba30d..6c352dd 100644 --- a/src/views/archivesManage/archivesCheck/module/addCheck.vue +++ b/src/views/archivesManage/archivesCheck/module/addCheck.vue @@ -11,67 +11,59 @@ label-width="80px" :rules="rules" > - + - - + - + + - --> + - - + 生成盘点单 - + - - + + - + - - + + @@ -133,34 +164,44 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css' import { menu } from '@/api/storeManage/levelManage/level' import { getCategoryTree } from '@/api/category/category' import { previewArrange, addArrange } from '@/api/archivesManage/archivesCheck' +import { FetchInitArchivesView } from '@/api/archivesManage/archivesList' +import { findInCase } from '@/api/archivesManage/caseManage' import { crud } from '@crud/crud' - +import detailDialog from '@/views/archivesManage/caseManage/caseList/module/detailDialog' export default { name: 'AddCheck', - components: { Treeselect }, + components: { Treeselect, detailDialog }, mixins: [crud()], data() { return { loading: false, menusIds: [], tableData: [], - checkForm: {}, + isCaseOrFile: 0, + checkForm: { + selectAreaValue: [], + categoryValue: null, + years: [], + checkType: null + }, addFormVisible: false, - selectAreaValue: [], - selectArea: [], + selectAreaOptions: [], defaultProps: { children: 'children', label: 'label' }, nodeKey: 'id', defaultCheckedKeys: [], - categoryValue: [], oldCategory: [], allCategory: [], category: [], showTags: true, - years: null, - yearsOptions: [ + yearsOptions: [], + checkOptions: [ { - value: '2023', - label: '2023' + label: '按盒盘点', + value: 1 + }, + { + label: '按件盘点', + value: 2 } ], page: { @@ -175,9 +216,10 @@ export default { categoryIds: null }, rules: { - selectArea: [{ required: true, trigger: 'blur' }], - categoryValue: [{ required: true, trigger: 'blur' }], - years: [{ required: true, trigger: 'blur' }] + selectAreaValue: [{ required: true, trigger: 'change', message: '请选择区域' }], + categoryValue: [{ required: true, trigger: 'change', message: '请选择门类' }], + years: [{ required: true, trigger: 'change', message: '请选择年度' }], + checkType: [{ required: true, trigger: 'change', message: '请选择盘点方式' }] } } }, @@ -215,7 +257,7 @@ export default { storeroom.children = devices deviceTree.push(storeroom) } - this.selectArea = deviceTree + this.selectAreaOptions = deviceTree }) }) }, @@ -242,52 +284,53 @@ export default { // this.oldCategory = JSON.parse(JSON.stringify(this.allCategory)) }) }, - // 选中触发(第一次回显的时候会触发,清除值的时候会触发, value值为undefined) input事件用于v-model双向绑定组件更新父组件值 - treeSelectInput(value, instanceId) { - console.log(value, 'input事件') - console.log('this.categoryValue', this.categoryValue) - console.log(this.value, 'this.value -- input') // 这个不需要 延迟 + treeSelectInput(value) { + console.log('this.categoryValue', this.checkForm.categoryValue) + if (this.checkForm.categoryValue) { + this.getYear() + } else { + this.yearsOptions = [] + this.checkForm.years = [] + } + }, + getYear() { + const params = { + 'categoryId': this.checkForm.categoryValue, + 'isdel': false, + 'page': 1, + 'size': 10 + } + FetchInitArchivesView(params).then(data => { + console.log(data.yearGroup) + if (data) { + this.yearsOptions = data.yearGroup.map(item => { + const json = {} + json.value = item + json.label = item + return json + }) + } + }) }, - // 选中触发(清除值的时候不会触发) - // treeSelectChange(raw, instanceId) { - // console.log(raw, '当前的对象') - // setTimeout(() => { // 如果用到this.value 需要setTimeout延迟一下拿到最新的值 - // console.log(this.value, 'this.value -- select') - // }) - // }, - // 移除选项时触发 当设置multiple为true时生效 raw为当前移除的对象 - // treeSelectDeselect(raw, instanceId) { - // console.log(raw, 'deselect-->>') - // }, - // 搜索 - // treeSelectSearch(searchQuery, instanceId) { - // console.log(searchQuery, '当前搜索的值') - // }, - // 展开触发 - // treeSelectOpen(instanceId) { - // console.log('展开了') - // }, - // 关闭触发 - // treeSelectClose(value, instanceId) { - // console.log(value, '当前的value值') - // }, // 生成盘点单 handleBuild() { - if (this.selectAreaValue.length > 0 && this.categoryValue.length > 0) { + this.$refs['form'].validate(valid => { + if (!valid) { + return + } this.loading = true const paramsNo = this.getParams() + if (paramsNo.checkType === 1) { + this.isCaseOrFile = 1 + } else { + this.isCaseOrFile = 2 + } 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() @@ -308,13 +351,13 @@ export default { }) }, getParams() { - const room = this.selectArea.map(item => { return item.id }) // 所有区域id - if (this.selectAreaValue.length > 0 && this.categoryValue.length > 0) { - let deviceIds = this.selectAreaValue.filter(item => !room.includes(item)) // 选中的设备id + const room = this.selectAreaOptions.map(item => { return item.id }) // 所有区域id + if (this.checkForm.selectAreaValue.length > 0 && this.checkForm.categoryValue.length > 0) { + let deviceIds = this.checkForm.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)) { + this.selectAreaOptions.forEach(item => { + if (this.checkForm.selectAreaValue.includes(item.id)) { region.push(item.name) const arr = item.children.map(val => { return val.id }) // 区域内所有设备 deviceIds = deviceIds.concat(arr) @@ -328,11 +371,12 @@ export default { } }) region = region.join(',') // 区域str - const categoryIds = this.categoryValue.filter(item => item !== 0) + // const categoryIds = this.checkForm.categoryValue.filter(item => item !== 0) const params = { - 'categoryIds': categoryIds, + 'categoryIds': this.checkForm.categoryValue, 'deviceIds': deviceIds, - 'region': region + 'region': region, + 'checkType': this.checkForm.checkType } return params } @@ -342,6 +386,7 @@ export default { previewArrange(params).then(res => { this.tableData = res.content this.page.total = res.totalElements + this.loading = false }) }, // 每页条数改变 @@ -363,33 +408,47 @@ export default { this.loading = false }, // 选择门类 - selectChange(val) { - const allCategory = JSON.parse(JSON.stringify(this.allCategory)) - if (val[val.length - 1] === 0) { // 选择全选 - this.categoryValue = allCategory - } else { - const arr1 = this.oldCategory.filter(item => item !== 0) - const arr2 = val.filter(item => item !== 0) - if (arr1.length === arr2.length) { // 取消全选 - this.categoryValue = [] - } else if (arr1.length < arr2.length && arr2.length === this.category.length - 1) { - this.categoryValue.unshift(0) // 除全选时都选中 此时加入全选 - } else { - this.categoryValue = this.categoryValue.filter(item => item !== 0) // 取消其他选项时 去除全选 - } - } - this.oldCategory = this.categoryValue - }, + // selectChange(val) { + // const allCategory = JSON.parse(JSON.stringify(this.allCategory)) + // if (val[val.length - 1] === 0) { // 选择全选 + // this.checkForm.categoryValue = allCategory + // } else { + // const arr1 = this.oldCategory.filter(item => item !== 0) + // const arr2 = val.filter(item => item !== 0) + // if (arr1.length === arr2.length) { // 取消全选 + // this.checkForm.categoryValue = [] + // } else if (arr1.length < arr2.length && arr2.length === this.category.length - 1) { + // this.checkForm.categoryValue.unshift(0) // 除全选时都选中 此时加入全选 + // } else { + // this.checkForm.categoryValue = this.checkForm.categoryValue.filter(item => item !== 0) // 取消其他选项时 去除全选 + // } + // } + // this.oldCategory = this.checkForm.categoryValue + // }, // 单元格样式 cell({ row, columnIndex }) { if (columnIndex === 1) { return 'fail-clear' } }, + handleCaseDbClick(row) { + this.$refs.detailDom.rowData = row + const params = { + caseId: row.id + } + findInCase(params).then(res => { + if (res) { + this.$refs.detailDom.tableData = res.archives + } + }) + this.$refs.detailDom.detailVisible = true + }, handleClose() { this.getTreeMenu() this.getCateMenu() this.tableData = [] + this.isCaseOrFile = 0 + this.$refs['form'].resetFields() }, normalizer(node) { if (node.children && !node.children.length) { @@ -398,7 +457,8 @@ export default { return { id: node.id, label: node.cnName, - children: node.children + children: node.children, + isDisabled: node.isType !== 3 && node.isType !== 5 } } @@ -411,6 +471,7 @@ export default { .el-form{ display: flex; + flex-wrap: wrap; padding-left: 12px; } ::v-deep .el-dialog{ @@ -419,7 +480,7 @@ export default { } ::v-deep .el-dialog .el-dialog__header .el-dialog__close::before{ position: absolute; - right: -160px; + right: -190px; bottom: -12px; } ::v-deep .el-dialog__body{ diff --git a/src/views/archivesManage/archivesList/index.vue b/src/views/archivesManage/archivesList/index.vue index 3c65712..4081b80 100644 --- a/src/views/archivesManage/archivesList/index.vue +++ b/src/views/archivesManage/archivesList/index.vue @@ -1,3 +1,4 @@ +