diff --git a/src/views/modules/generator/mtcctaskruninfo-add-or-update.vue b/src/views/modules/generator/mtcctaskruninfo-add-or-update.vue index 949b4e4..5fe67f8 100644 --- a/src/views/modules/generator/mtcctaskruninfo-add-or-update.vue +++ b/src/views/modules/generator/mtcctaskruninfo-add-or-update.vue @@ -11,7 +11,7 @@ @keyup.enter.native="dataFormSubmit()" label-width="80px" > - + - - + + + + + + + + + + + - + - + oninput = "value=value.replace(/[^\d]/g,'')" + --> @@ -67,29 +80,30 @@ export default { id: 0, taskType: '', model: '', - // startPoint: '', - // endPoint: '', + startPoint: '', + endPoint: '', num: '', unit: '', remarks: '', dateNum: '' }, + PointArr: [], dataRule: { - taskType: [ - { required: true, message: '任务类型不能为空', trigger: 'blur' } - ], + // taskType: [ + // { required: true, message: '任务类型不能为空', trigger: 'blur' } + // ], model: [ { required: true, message: '型号不能为空', trigger: 'blur' } ], num: [ { required: true, message: '数量不能为空', trigger: 'blur' } + ], + startPoint: [ + { required: true, message: '起点不能为空', trigger: 'change' } + ], + endPoint: [ + { required: true, message: '终点不能为空', trigger: 'change' } ] - // startPoint: [ - // { required: true, message: '起点不能为空', trigger: 'blur' } - // ], - // endPoint: [ - // { required: true, message: '终点不能为空', trigger: 'blur' } - // ] } } }, @@ -100,13 +114,19 @@ export default { }, methods: { init (id) { - if (this.inout === 1) { - this.dataForm.taskType = 0 - } else if (this.inout === 2) { - this.dataForm.taskType = 1 - } + // if (this.inout === 1) { + // this.dataForm.taskType = 0 + // } else if (this.inout === 2) { + // this.dataForm.taskType = 1 + // } this.dataForm.id = id || 0 this.visible = true + this.$http({ + url: this.$http.adornUrl('/generator/mtccwarehousrank/list'), + method: 'post' + }).then(({data}) => { + this.PointArr = data.list + }) this.$nextTick(() => { this.$refs['dataForm'].resetFields() if (this.dataForm.id) { @@ -148,11 +168,11 @@ export default { method: 'post', data: this.$http.adornData({ 'id': this.dataForm.id || undefined, - 'taskType': this.dataForm.taskType, + // 'taskType': this.dataForm.taskType, 'model': this.dataForm.model, 'num': this.dataForm.num, - // 'startPoint': this.dataForm.startPoint, - // 'endPoint': this.dataForm.endPoint, + 'startPoint': this.dataForm.startPoint, + 'endPoint': this.dataForm.endPoint, 'remarks': this.dataForm.remarks, 'dateNum': this.dataForm.dateNum }) diff --git a/src/views/modules/generator/mtcctaskruninfo.vue b/src/views/modules/generator/mtcctaskruninfo.vue index ab88d1f..bab289f 100644 --- a/src/views/modules/generator/mtcctaskruninfo.vue +++ b/src/views/modules/generator/mtcctaskruninfo.vue @@ -10,7 +10,7 @@ --> 刷新 - 执行演示任务 + 批量删除 --> + + 执行单托盘演示任务 + 执行多托盘演示任务 + 暂停演示任务 + + + 已执行任务记数:{{showTaskMsg}} + --> - + >演示任务弹窗 {{taskMsg}} 取 消 - + --> { - if (data.code === 0 && data) { - this.dialogVisible = false - } else { - this.$message.error(data.msg) - this.taskMsg = data.msg - this.showTaskBtn = true - } - }) + showTask (type) { + // this.dialogVisible = true + // this.taskMsg = '演示任务正在执行,请勿操作' + // this.showTaskBtn = false + // this.$http({ + // url: this.$http.adornUrl('/generator/mtcctaskruninfo/runExampleTask'), + // method: 'post' + // }).then(({ data }) => { + // if (data.code === 0 && data) { + // this.dialogVisible = false + // } else { + // this.$message.error(data.msg) + // this.taskMsg = data.msg + // this.showTaskBtn = true + // } + // }) + if (type === 0) { + this.$http({ + url: this.$http.adornUrl('/generator/mtcctaskruninfo/setOff'), + method: 'post' + }).then(({ data }) => { + if (data && data.code === 0) { + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500 + }) + } else { + this.$message.error(data.msg) + } + }) + } else if (type === 1) { + this.$http({ + url: this.$http.adornUrl('/generator/mtcctaskruninfo/runOneTask'), + method: 'post' + }).then(({ data }) => { + if (data && data.code === 0) { + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500 + }) + } else { + this.$message.error(data.msg) + } + }) + } else if (type === 2) { + this.$http({ + url: this.$http.adornUrl('/generator/mtcctaskruninfo/runExampleTask'), + method: 'post' + }).then(({ data }) => { + if (data && data.code === 0) { + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500 + }) + } else { + this.$message.error(data.msg) + } + }) + } }, // 多选 selectionChangeHandle (val) { @@ -407,16 +462,26 @@ export default { }, showSTaskInfo () { this.$http({ - url: this.$http.adornUrl( - '/generator/mtcctaskruninfodet/taskruninfodetlist' - ), + url: this.$http.adornUrl('/generator/mtcctaskruninfo/alreadyRun'), method: 'post' }).then(({ data }) => { if (data && data.code === 0) { - this.sTaskInfo = data.list - this.sTaskInfoNum = this.sTaskInfo.length + this.showTaskMsg = data.msg + } else { + this.$message.error(data.msg) } }) + // this.$http({ + // url: this.$http.adornUrl( + // '/generator/mtcctaskruninfodet/taskruninfodetlist' + // ), + // method: 'post' + // }).then(({ data }) => { + // if (data && data.code === 0) { + // this.sTaskInfo = data.list + // this.sTaskInfoNum = this.sTaskInfo.length + // } + // }) }, sTaskClick () { this.openSTask = !this.openSTask