| | |
| | | |
| | | //此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码 |
| | | import gridBodyExtension from './extend/gridBodyExtension.vue' |
| | | import gridBodyExtension from "./extend/gridBodyExtension.vue"; |
| | | |
| | | let extension = { |
| | | components: { |
| | | //查询界面扩展组件 |
| | | gridHeader: '', |
| | | gridHeader: "", |
| | | gridBody: gridBodyExtension, |
| | | gridFooter: '', |
| | | gridFooter: "", |
| | | //新建、编辑弹出框扩展组件 |
| | | modelHeader: '', |
| | | modelBody: '', |
| | | modelFooter: '', |
| | | modelHeader: "", |
| | | modelBody: "", |
| | | modelFooter: "", |
| | | }, |
| | | tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写) |
| | | tableAction: "", //指定某张表的权限(这里填写表名,默认不用填写) |
| | | buttons: { view: [], box: [], detail: [] }, //扩展的按钮 |
| | | methods: { |
| | | //下面这些方法可以保留也可以删除 |
| | | onInit() { |
| | | //添加"手动创建任务"按钮 |
| | | this.buttons.push({ |
| | | name: '手动创建任务', |
| | | icon: 'el-icon-plus', |
| | | type: 'primary', |
| | | value: 'ManualCreateTask', |
| | | name: "手动创建任务", |
| | | icon: "el-icon-plus", |
| | | type: "primary", |
| | | value: "ManualCreateTask", |
| | | onClick: () => { |
| | | this.$refs.gridBody.open(); |
| | | } |
| | | }, |
| | | }); |
| | | //添加"手动下发"按钮 |
| | | this.buttons.push({ |
| | | name: '手动下发', |
| | | icon: 'el-icon-s-promotion', |
| | | type: 'primary', |
| | | value: 'DispatchTasksToWCS', |
| | | name: "手动下发", |
| | | icon: "el-icon-s-promotion", |
| | | type: "primary", |
| | | value: "DispatchTasksToWCS", |
| | | onClick: () => { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) return this.$error("请先选择任务"); |
| | | this.$refs.gridBody.openDispatch(rows); |
| | | } |
| | | }, |
| | | }); |
| | | |
| | | let TaskHandCancelBtn = this.buttons.find(x => x.value == 'TaskHandCancel'); |
| | | let TaskHandCancelBtn = this.buttons.find( |
| | | (x) => x.value == "TaskHandCancel", |
| | | ); |
| | | if (TaskHandCancelBtn) { |
| | | TaskHandCancelBtn.onClick = function () { |
| | | let rows = this.$refs.table.getSelected(); |
| | |
| | | .post("api/Task/TaskCancel?taskNum="+param, "数据处理中...") |
| | | .then((x) => { |
| | | if (x.status) { |
| | | this.$Message.success('任务取消成功.'); |
| | | this.$Message.success("任务取消成功."); |
| | | this.refresh(); |
| | | } else { |
| | | return this.$error(x.message); |
| | | } |
| | | }); |
| | | }; |
| | | } |
| | | } |
| | | let TaskHandCompletedBtn = this.buttons.find(x => x.value == 'TaskHandCompleted'); |
| | | let TaskHandCompletedBtn = this.buttons.find( |
| | | (x) => x.value == "TaskHandCompleted", |
| | | ); |
| | | if (TaskHandCompletedBtn) { |
| | | TaskHandCompletedBtn.onClick = function () { |
| | | let rows = this.$refs.table.getSelected(); |
| | |
| | | .post("api/Task/TaskCompleted?taskNum="+param, "数据处理中...") |
| | | .then((x) => { |
| | | if (x.status) { |
| | | this.$Message.success('任务手动完成'); |
| | | this.$Message.success("任务手动完成"); |
| | | this.refresh(); |
| | | } else { |
| | | return this.$error(x.message); |
| | | } |
| | | }); |
| | | } |
| | | }; |
| | | } |
| | | }, |
| | | onInited() { |
| | |
| | | searchBefore(param) { |
| | | //界面查询前,可以给param.wheres添加查询参数 |
| | | //返回false,则不会执行查询 |
| | | |
| | | // 第一个过滤条件 |
| | | const roadwayFilter1 = { |
| | | name: "roadway", |
| | | value: "ZJSC1", |
| | | displayType: "notequal", |
| | | }; |
| | | |
| | | // 第二个过滤条件 |
| | | const roadwayFilter2 = { |
| | | name: "roadway", |
| | | value: "FJSC1", |
| | | displayType: "notequal", |
| | | }; |
| | | |
| | | if (!param.wheres) { |
| | | param.wheres = []; |
| | | } |
| | | |
| | | // 将两个过滤条件添加到查询参数中 |
| | | param.wheres.push(roadwayFilter1); |
| | | param.wheres.push(roadwayFilter2); |
| | | return true; |
| | | }, |
| | | searchAfter(result) { |
| | |
| | | //(3)this.editFormFields.字段='xxx'; |
| | | //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值 |
| | | //看不懂就把输出看:console.log(this.editFormOptions) |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | export default extension; |