| | |
| | | //此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码 |
| | | |
| | | // import gridHeader from "./demo_Product/Dt_BillGroupStockDetail.vue"; |
| | | |
| | | import gridBody from "./extend/SupplementationData.vue" |
| | | let extension = { |
| | | components: { |
| | | //查询界面扩展组件 |
| | | gridHeader: '', |
| | | gridBody: '', |
| | | gridBody: gridBody, |
| | | gridFooter: '', |
| | | //新建、编辑弹出框扩展组件 |
| | | modelHeader: '', |
| | |
| | | //示例:调用后台接口 |
| | | 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) { |
| | | btnSupplementationData.onClick = () => { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) { |
| | | return this.$error("请选择数据!"); |
| | | } else if (rows.length > 1) { |
| | | return this.$error("只能选择单条数据"); |
| | | } |
| | | this.$refs.gridBody.open(rows[0].palletCode); |
| | | this.refresh(); |
| | | } |
| | | |
| | | } |
| | | //示例:在按钮的最前面添加一个按钮 |
| | | // this.buttons.unshift({ |
| | | // //也可以用push或者splice方法来修改buttons数组 |
| | |
| | | //修改颜色 |
| | | 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)给弹出框设置默认值 |