| | |
| | | :label="item.label" |
| | | :prop="item.prop" :show-overflow-tooltip="true" |
| | | :sortable="item.sortable" |
| | | :width="item.label.length >= 4 ? '150' : item.label.length == 3 ? '120' : '90'" |
| | | :width="item.width" |
| | | align="center"> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | :type="edit" |
| | | :visible.sync="DataVisible"></FormTemplateDialog> |
| | | <!-- 发布--> |
| | | <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleFlow"></set-personnel> |
| | | <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleFlow" @onLoad="onLoad"></set-personnel> |
| | | <!-- 停用--> |
| | | <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleDeactivate"></set-personnel> |
| | | <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleDeactivate" @onLoad="onLoad"></set-personnel> |
| | | <!-- 启用--> |
| | | <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleEnable"></set-personnel> |
| | | <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleEnable" @onLoad="onLoad"></set-personnel> |
| | | <!-- 回收--> |
| | | <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleRecovery"></set-personnel> |
| | | <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleRecovery" @onLoad="onLoad"></set-personnel> |
| | | <!-- 高级查询--> |
| | | <advanced-query :options="this.options" :visible.sync="findvisible" |
| | | @echoContion="echoContion"></advanced-query> |
| | |
| | | </basic-container> |
| | | </template> |
| | | <script> |
| | | import {MasterTable, TableData, FindData, addSaveCode, editSaveCode} from "@/api/GetItem"; |
| | | import {MasterTable, TableData, FindData, addSaveCode, editSaveCode,deleteCode} from "@/api/GetItem"; |
| | | import {processTS,changeStatus} from "@/api/template/setPersonnel" |
| | | import {listCodeAttributeByClassId} from "@/api/integration/integration.js"; |
| | | import integrationTransfer from "@/views/integration/integrationTransfer"; |
| | |
| | | hasDownload: true, |
| | | hasUpload: true, |
| | | height: 100 |
| | | } |
| | | }, |
| | | result:'' |
| | | }; |
| | | }, |
| | | computed: {}, |
| | | created() { |
| | | const index = this.$route.query.id.indexOf('@'); |
| | | this.result = this.$route.query.id.substring(0, index); |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | activated() { |
| | | // this.doLayout(); |
| | | this.$nextTick(() => { |
| | | this.$refs.dataTable.doLayout() |
| | | }) |
| | | this.doLayout() |
| | | }, |
| | | updated() { |
| | | this.doLayout() |
| | | }, |
| | | watch: { |
| | | tableHeadDataFateher: { |
| | |
| | | handler(newval, oldval) { |
| | | this.tableData = newval; |
| | | this.searchResults = newval |
| | | this.doLayout() |
| | | }, |
| | | }, |
| | | tableHeadFindData: { |
| | |
| | | if (uniqueFlag === 'CODEENABLE') return this.Enable() |
| | | //回收 |
| | | if (uniqueFlag === 'CODERECYCLE') return this.Recovery() |
| | | //删除 |
| | | if (uniqueFlag === 'CODEDELETE') return this.enumDeleteRow() |
| | | // 相似项查询 |
| | | // if(uniqueFlag === 'CODEEDIT') return this.similarHandler() |
| | | }); |
| | |
| | | showMessage = false; |
| | | } else if (showMessage) { |
| | | processTS({templateId: this.templateOid, buttonTypeKey: 'PUBLIC'}).then(res => { |
| | | if (res.data.records != [] && res.data.code != 200) { |
| | | if (res.data.data.records && res.data.data.records.length!=0) { |
| | | this.userName = localStorage.getItem("username"); |
| | | this.parameter.template = this.userName + "-发布" + "[物品]"; |
| | | this.parameter.type = 'PUBLIC' |
| | | this.parameter.template = this.userName + '-发布['+this.result+'-' + this.selectRow[0].name + ']'; |
| | | this.parameter.type = 'PUBLIC'; |
| | | this.parameter.code=this.templateOid |
| | | this.title = '流程审批' |
| | | this.visibleFlow = true; |
| | | this.onLoad() |
| | | } else { |
| | | this.$confirm('当前分类没有添加流程模板,是否不用流程审批直接执行?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.userName = localStorage.getItem("username"); |
| | | this.parameter.template = this.userName + "-发布" + "[物品]"; |
| | | this.parameter.type = 'PUBLIC' |
| | | this.title = '流程审批' |
| | | this.visibleFlow = true; |
| | | this.onLoad() |
| | | const index = this.$route.query.id.indexOf('@'); |
| | | const result = this.$route.query.id.substring(0, index); |
| | | console.log(this.$route.query) |
| | | const oid = this.selectRow.map(obj => obj.oid).join(","); |
| | | changeStatus({ oid: oid, btmname: result, lcStatus: 'Released' }).then(res => { |
| | | if(res.data.code == 200 ){ |
| | | this.$message.success('发布成功') |
| | | this.onLoad() |
| | | } |
| | | }); |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | |
| | | 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) { |
| | | if (res.data.records != [] && res.data.data.records.length!=0) { |
| | | this.userName = localStorage.getItem("username"); |
| | | this.parameter.template = this.userName + "停用" + "[物品]"; |
| | | this.parameter.type = 'DISABLE' |
| | | this.parameter.template = this.userName + '-停用['+this.result+'-' + this.selectRow[0].name + ']'; |
| | | this.parameter.type = 'DISABLE'; |
| | | this.parameter.code=this.templateOid |
| | | this.title = '停用(冻结)编码数据' |
| | | this.visibleDeactivate = true; |
| | | } else { |
| | |
| | | const result = this.$route.query.id.substring(0, index); |
| | | const oid = this.selectRow.map(obj => obj.oid).join(","); |
| | | changeStatus({ oid: oid, btmname: result, lcStatus: 'Disabled' }).then(res => { |
| | | console.log(res); |
| | | if(res.data.code == 200 ){ |
| | | this.$message.success('停用成功') |
| | | this.onLoad() |
| | |
| | | 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) { |
| | |
| | | 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) { |
| | | if (res.data.data.records && res.data.data.records.length!=0) { |
| | | this.parameter=res.data.data.records[0] |
| | | this.userName = localStorage.getItem("username"); |
| | | this.parameter.template = this.userName + "启用" + "[物品]"; |
| | | this.parameter.type = 'Released' |
| | | this.parameter.template = this.userName + '-启用['+this.result+'-' + this.selectRow[0].name + ']'; |
| | | this.parameter.type = 'Released'; |
| | | this.parameter.code=this.templateOid |
| | | this.title = '启用编码数据' |
| | | this.visibleDeactivate = true; |
| | | } else { |
| | |
| | | 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() |
| | |
| | | // 停用-只能启用、回收 |
| | | 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) { |
| | |
| | | } 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) { |
| | | if (res.data.records != [] && res.data.data.records.length!=0) { |
| | | this.userName = localStorage.getItem("username"); |
| | | this.parameter.template = this.userName + "回收" + "[物品]"; |
| | | this.parameter.type = 'TakeBack' |
| | | this.parameter.template = this.userName + '-回收['+this.result+'-' + this.selectRow[0].name + ']'; |
| | | this.parameter.type = 'TakeBack'; |
| | | this.parameter.code=this.templateOid |
| | | this.title = '回收编码数据' |
| | | this.visibleDeactivate = true; |
| | | } else { |
| | |
| | | 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() |
| | |
| | | } |
| | | } |
| | | }); |
| | | } else if (this.selectRow.length >=1 && !(disabledCount === this.selectRow.length || releasedCount === this.selectRow.length) || (disabledCount > 0 && releasedCount > 0) && showMessage) { |
| | | } else if (showMessage && this.selectRow.length >1 && !(disabledCount === this.selectRow.length || releasedCount === this.selectRow.length) || (disabledCount > 0 && releasedCount > 0)) { |
| | | this.$message.warning('您选择的数据全部为【停用状态或发布状态】才可以发起流程'); |
| | | showMessage = false; |
| | | }else if(showMessage){ |
| | | this.$message.warning('您选择的数据为【停用状态或发布状态】才可以发起流程') |
| | | } |
| | | }); |
| | | } |
| | |
| | | }, |
| | | //删除 |
| | | enumDeleteRow(row) { |
| | | this.tableData.splice(row, 1); |
| | | this.$confirm('是否删除选中数据?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const list=[]; |
| | | this.selectRow.forEach((item)=>{list.push(item.oid)}) |
| | | deleteCode({codeClassifyOid:this.codeClassifyOid,oidList:list}).then(res=>{ |
| | | console.log(res) |
| | | if(res.data.code === 200){ |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '删除成功!' |
| | | }); |
| | | } |
| | | this.onLoad() |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消删除' |
| | | }); |
| | | }); |
| | | }, |
| | | // 将正在编辑的行的状态变为 null ,即退出编辑状态 |
| | | saveRow() { |
| | | this.editingRow = null; |
| | | }, |
| | | //表格错行问题 |
| | | doLayout() { |
| | | this.$nextTick(() => { |
| | | console.log(this.$refs) |
| | | this.$refs.crud.doLayout(); |
| | | }); |
| | | if (this.$refs.dataTable && this.$refs.dataTable.doLayout) { |
| | | this.$refs.dataTable.doLayout(); |
| | | } |
| | | }) |
| | | }, |
| | | //表格头渲染 |
| | | CrudHeaderRend() { |
| | |
| | | limit: this.page.pageSize, |
| | | }).then((res) => { |
| | | this.tableData = res.data.data; |
| | | this.doLayout() |
| | | }); |
| | | }, |
| | | //多选 |
| | |
| | | list.forEach((item) => { |
| | | this.parameter.ids.push(item.oid); |
| | | }); |
| | | console.log(this.selectRow) |
| | | }, |
| | | //选择 |
| | | handleSelection(list, row) { |
| | |
| | | codeClassifyOid: this.codeClassifyOid, |
| | | ...val, |
| | | }).then((res) => { |
| | | console.log(res); |
| | | this.tableData = res.data.data; |
| | | this.page.total = res.data.total |
| | | }); |
| | |
| | | //增加保存 |
| | | AddSumbit(val) { |
| | | this.addvisible = false; |
| | | console.log(val) |
| | | addSaveCode(val).then(res => { |
| | | console.log(res) |
| | | this.$nextTick(() => { |
| | | this.onLoad() |
| | | }) |
| | |
| | | }, |
| | | EditSumbit(val) { |
| | | this.editvisible = false; |
| | | console.log(val) |
| | | editSaveCode(val).then(res => { |
| | | console.log(res) |
| | | this.$nextTick(() => { |
| | | this.onLoad() |
| | | }) |