//author:jxx
|
//此处是对表单的方法,组件,权限操作按钮等进行任意扩展(方法扩展可参照SellOrder.js)
|
import addTaskss from "@/views/dialog/addTask.vue"
|
import addTaskss2 from "@/views/dialog/addTask2.vue"
|
let extension = {
|
components: {//动态扩充组件或组件路径
|
//表单header、content、footer对应位置扩充的组件
|
gridHeader: addTaskss,//{ template: "<div>扩展组xx件</div>" },
|
gridBody: addTaskss2,
|
gridFooter: '',
|
//弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件
|
modelHeader: '',
|
modelBody: '',
|
modelFooter: ''
|
},
|
buttons: { view: [], box: [], detail: [] },//扩展的按钮
|
buttons: { view: [], box: [], detail: [] },//扩展的按钮
|
methods: {//事件扩展
|
onInit() {
|
this.maxBtnLength = 6;
|
let ManualCompletion = this.buttons.find(r => r.value == "ManualCompletion");
|
if (null != ManualCompletion) {
|
ManualCompletion.onClick = function () {
|
let rows = this.$refs.table.getSelected();
|
if (rows.length == 0) {
|
return this.$error("请选择要完成的数据!");
|
} else if (rows.length > 1) {
|
return this.$error("只能选择单条数据");
|
}
|
let request = {
|
taskID: rows[0].agv_tasknum,
|
}
|
this.http.post("/api/WCS/UpdateAGVTaskState", request, "正在完成任务....").then(x => {
|
if (x.code != 0) return this.$error(x.message);
|
this.$success("完成任务成功!");
|
this.refresh();
|
});
|
}
|
};
|
let CancelManually = this.buttons.find(r => r.value == "CancelManually");
|
if (null != CancelManually) {
|
CancelManually.onClick = function () {
|
let rows = this.$refs.table.getSelected();
|
if (rows.length == 0) {
|
return this.$error("请选择要取消的数据!");
|
} else if (rows.length > 1) {
|
return this.$error("只能选择单条数据");
|
}
|
let request = {
|
taskID: rows[0].agv_tasknum,
|
}
|
this.http.post("/api/WCS/DeleteAGVTaskState", request, "正在取消任务....").then(x => {
|
if (x.code != 0) return this.$error(x.message);
|
this.$success("取消任务成功!");
|
this.refresh();
|
});
|
}
|
};
|
this.buttons.splice(1, 0, {
|
name: "正负及烘烤1/2手动任务",
|
icon: 'md-refresh',
|
type: 'primary',
|
onClick: function () {
|
this.$refs.gridHeader.detialBox = true;
|
}
|
}),this.buttons.splice(1, 0, {
|
name: "正负及烘烤其他手动任务",
|
icon: 'md-refresh',
|
type: 'primary',
|
onClick: function () {
|
this.$refs.gridBody.detialBox = true;
|
}
|
})
|
}
|
}
|
};
|
export default extension;
|