| | |
| | | created() { |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | activated() { |
| | | // this.doLayout(); |
| | | this.$nextTick(() => { |
| | | this.$refs.dataTable.doLayout() |
| | | }) |
| | | }, |
| | | watch: { |
| | | tableHeadDataFateher: { |
| | |
| | | } |
| | | }) |
| | | this.tableHeadFindDatas = newval; |
| | | console.log('newval',newval) |
| | | console.log('newval',this.tableHeadFindData) |
| | | }, |
| | | }, |
| | | total: { |
| | |
| | | } |
| | | }, |
| | | openVis(visible) { |
| | | console.log(visible) |
| | | this[visible] = true |
| | | }, |
| | | handelBtnClick(event) { |
| | |
| | | if (this.selectRow.length <= 0) { |
| | | this.$message.warning("请选择一条数据"); |
| | | } else { |
| | | let hasEditing = this.selectRow.some(item => item.lcstatus == 'Released'); |
| | | let hasEditing = this.selectRow.every(item => item.lcstatus == 'Released'); |
| | | let showMessage = true; |
| | | this.selectRow.forEach(item => { |
| | | if (this.selectRow.length === 1 && item.lcstatus === "Disabled" && showMessage) { |
| | | this.$message.warning('选择的数据中状态无需再执行当前操作'); |
| | | showMessage = false; |
| | | } else if (this.selectRow.length >1 && !hasEditing && showMessage) { |
| | | } else if (this.selectRow.length >=1 && !hasEditing && showMessage) { |
| | | this.$message.warning('您选择的数据全部为【发布状态】才可以发起流程'); |
| | | showMessage = false; |
| | | } else if (this.selectRow.length >= 1 && hasEditing && showMessage) { |
| | | } else if (this.selectRow.length > 1 && hasEditing && showMessage) { |
| | | processTS({ templateId: this.templateOid, buttonTypeKey: 'PUBLIC' }).then(res => { |
| | | if (res.data.records != [] && res.data.code != 200) { |
| | | this.userName = localStorage.getItem("username"); |
| | |
| | | if (this.selectRow.length <= 0) { |
| | | this.$message.warning("请选择一条数据"); |
| | | } else { |
| | | |
| | | let hasEditing = this.selectRow.every(item => item.lcstatus == 'Disabled'); |
| | | console.log('hasEditing',hasEditing) |
| | | let showMessage = true; |
| | | this.selectRow.forEach(item => { |
| | | if (this.selectRow.length === 1 && item.lcstatus !== "Disabled" && showMessage) { |
| | | this.$message.warning('选择的数据中状态无需再执行当前操作'); |
| | | showMessage = false; |
| | | } else if (this.selectRow.length >=1 && hasEditing && showMessage) { |
| | | processTS({ templateId: this.templateOid, buttonTypeKey: 'PUBLIC' }).then(res => { |
| | | if (res.data.records != [] && res.data.code != 200) { |
| | | this.userName = localStorage.getItem("username"); |
| | | this.parameter.template = this.userName + "启用" + "[物品]"; |
| | | this.parameter.type = 'Released' |
| | | this.title = '启用编码数据' |
| | | this.visibleDeactivate = true; |
| | | } else { |
| | | if (showMessage) { |
| | | showMessage = false; // 标记已执行过操作 |
| | | this.$confirm('当前分类没有添加流程模板,是否不用流程审批直接执行?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const index = this.$route.query.id.indexOf('@'); |
| | | const result = this.$route.query.id.substring(0, index); |
| | | const oid = this.selectRow.map(obj => obj.oid).join(","); |
| | | changeStatus({ oid: oid, btmname: result, lcStatus: 'Released' }).then(res => { |
| | | console.log(res); |
| | | if(res.data.code == 200 ){ |
| | | this.$message.success('启用成功') |
| | | this.onLoad() |
| | | } |
| | | }); |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消' |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } else if (this.selectRow.length >1 && !hasEditing && showMessage) { |
| | | this.$message.warning('您选择的数据全部为【停用状态】才可以发起流程'); |
| | | showMessage = false; |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | //回收 |
| | |
| | | if (this.selectRow.length <= 0) { |
| | | this.$message.warning("请选择一条数据"); |
| | | } else { |
| | | |
| | | // 编辑中-只能发布,不能回收 |
| | | // 审核中-什么都不能做 |
| | | // 已发布-停用、回收 |
| | | // 停用-只能启用、回收 |
| | | const disabledCount = this.selectRow.filter(item => item.lcstatus === 'Disabled').length; |
| | | const releasedCount = this.selectRow.filter(item => item.lcstatus === 'Released').length; |
| | | console.log('hasEditing',disabledCount,releasedCount) |
| | | let showMessage = true; |
| | | this.selectRow.forEach(item => { |
| | | if (this.selectRow.length === 1 && item.lcstatus == "TakeBack" && showMessage) { |
| | | this.$message.warning('选择的数据中状态无需再执行当前操作'); |
| | | showMessage = false; |
| | | } else if (this.selectRow.length >=1 && (disabledCount === this.selectRow.length || releasedCount === this.selectRow.length) || (disabledCount > 0 && releasedCount > 0) && showMessage) { |
| | | //disabledCount 和 releasedCount 中任意一个等于 this.selectRow 数组的长度 则表示全部是同一种状态,返回 true 如果disabledCount 和 releasedCount 都大于0,则表示既有Disabled也有Released返回 true |
| | | processTS({ templateId: this.templateOid, buttonTypeKey: 'PUBLIC' }).then(res => { |
| | | if (res.data.records != [] && res.data.code != 200) { |
| | | this.userName = localStorage.getItem("username"); |
| | | this.parameter.template = this.userName + "回收" + "[物品]"; |
| | | this.parameter.type = 'TakeBack' |
| | | this.title = '回收编码数据' |
| | | this.visibleDeactivate = true; |
| | | } else { |
| | | if (showMessage) { |
| | | showMessage = false; // 标记已执行过操作 |
| | | this.$confirm('当前分类没有添加流程模板,是否不用流程审批直接执行?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const index = this.$route.query.id.indexOf('@'); |
| | | const result = this.$route.query.id.substring(0, index); |
| | | const oid = this.selectRow.map(obj => obj.oid).join(","); |
| | | changeStatus({ oid: oid, btmname: result, lcStatus: 'TakeBack' }).then(res => { |
| | | console.log(res); |
| | | if(res.data.code == 200 ){ |
| | | this.$message.success('回收成功') |
| | | this.onLoad() |
| | | } |
| | | }); |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消' |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } else if (this.selectRow.length >=1 && !(disabledCount === this.selectRow.length || releasedCount === this.selectRow.length) || (disabledCount > 0 && releasedCount > 0) && showMessage) { |
| | | this.$message.warning('您选择的数据全部为【停用状态或发布状态】才可以发起流程'); |
| | | showMessage = false; |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | handleSizeChange(val) { |