| | |
| | | :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> |
| | |
| | | created() { |
| | | }, |
| | | 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: { |
| | |
| | | showMessage = false; |
| | | } else if (showMessage) { |
| | | processTS({templateId: this.templateOid, buttonTypeKey: 'PUBLIC'}).then(res => { |
| | | if (res.data.records != []) { |
| | | 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'; |
| | |
| | | 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.type = 'DISABLE'; |
| | | this.parameter.code=this.templateOid |
| | | this.title = '停用(冻结)编码数据' |
| | | this.visibleDeactivate = true; |
| | | } else { |
| | |
| | | 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.type = 'Released'; |
| | | this.parameter.code=this.templateOid |
| | | this.title = '启用编码数据' |
| | | this.visibleDeactivate = true; |
| | | } else { |
| | |
| | | } 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.type = 'TakeBack'; |
| | | this.parameter.code=this.templateOid |
| | | this.title = '回收编码数据' |
| | | this.visibleDeactivate = true; |
| | | } else { |
| | |
| | | }).then(() => { |
| | | const list=[]; |
| | | this.selectRow.forEach((item)=>{list.push(item.oid)}) |
| | | console.log(list) |
| | | deleteCode({codeClassifyOid:this.codeClassifyOid,oidList:list}).then(res=>{ |
| | | console.log(res) |
| | | if(res.data.code === 200){ |
| | |
| | | saveRow() { |
| | | this.editingRow = null; |
| | | }, |
| | | //表格错行问题 |
| | | doLayout() { |
| | | this.$nextTick(() => { |
| | | 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() |
| | | }); |
| | | }, |
| | | //多选 |