| | |
| | | //示例:调用后台接口 |
| | | if (res.status) { |
| | | this.$Message.success('创建任务成功') |
| | | console.log(res) |
| | | this.refresh() //刷新表格 |
| | | } else { |
| | | this.$Message.error(res.message) //错误提示 |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | var btnSupplementationData = this.buttons.find(x => x.value == "SupplementationData"); |
| | | if (btnSupplementationData != null) { |
| | |
| | | //修改颜色 |
| | | if (column.field == 'roadwayNo') { |
| | | column.formatter = (row) => { |
| | | console.log("🚀 ~ this.columns.forEach ~ row:", row) |
| | | return '<span style="color: #2d8cf0;">' + row?.locationInfo?.roadwayNo + '</span>' |
| | | // return '<span style="color: #2d8cf0;">' + row?.locationInfo?.roadwayNo + '</span>' |
| | | return row?.locationInfo?.roadwayNo |
| | | } |
| | | } |
| | | if (column.field == 'materielCode') { |
| | | column.formatter = (row) => { |
| | | // return '<span style="color: #2d8cf0;">' + row?.locationInfo?.roadwayNo + '</span>' |
| | | return row?.stockInfoDetails[0]?.materielCode |
| | | } |
| | | } |
| | | //格式化日期 |
| | |
| | | onInited() { |
| | | //框架初始化配置后 |
| | | //如果要配置明细表,在此方法操作 |
| | | //this.detailOptions.columns.forEach(column=>{ }); |
| | | this.detailOptions.columns.forEach(column=>{ |
| | | console.log(column) |
| | | }); |
| | | }, |
| | | searchBefore(param) { |
| | | //界面查询前,可以给param.wheres添加查询参数 |
| | |
| | | return true |
| | | }, |
| | | searchAfter(result) { |
| | | //查询后,result返回的查询数据,可以在显示到表格前处理表格的值 |
| | | console.log(result) |
| | | return true |
| | | }, |
| | | addBefore(formData) { |
| | |
| | | // this.$refs.table.$refs.table.toggleRowSelection(row) //单击行时选中当前行; |
| | | }, |
| | | modelOpenAfter(row) { |
| | | |
| | | //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据 |
| | | //(1)判断是编辑还是新建操作: this.currentAction=='Add'; |
| | | //(2)给弹出框设置默认值 |