453 lines
17 KiB
Vue
453 lines
17 KiB
Vue
<template>
|
||
<div class="app-container">
|
||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
|
||
<el-form-item label="wcs任务号" prop="taskNo">
|
||
<el-input v-model="queryParams.taskNo" placeholder="请输入wcs任务号" clearable @keyup.enter.native="handleQuery" />
|
||
</el-form-item>
|
||
|
||
<el-form-item label="wms任务号" prop="wmsTaskNo">
|
||
<el-input v-model="queryParams.wmsTaskNo" placeholder="请输入wms任务号" clearable @keyup.enter.native="handleQuery" />
|
||
</el-form-item>
|
||
|
||
<el-form-item label="托盘条码" prop="trayCode">
|
||
<el-input v-model="queryParams.trayCode" placeholder="请输入条码" clearable @keyup.enter.native="handleQuery" />
|
||
</el-form-item>
|
||
|
||
<el-form-item label="货位ID" prop="cargoSpaceId">
|
||
<el-input v-model="queryParams.cargoSpaceId" placeholder="请输入货位ID" clearable @keyup.enter.native="handleQuery"/>
|
||
</el-form-item>
|
||
|
||
<el-form-item label="任务状态" prop="status">
|
||
<el-select v-model="queryParams.status" placeholder="请选择任务状态" clearable>
|
||
<el-option v-for="dict in dict.type.job_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||
</el-select>
|
||
</el-form-item>
|
||
|
||
<el-form-item label="任务类型" prop="inOrOut">
|
||
<el-select v-model="queryParams.inOrOut" placeholder="请选择任务类型" clearable>
|
||
<el-option v-for="dict in dict.type.job_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||
</el-select>
|
||
</el-form-item>
|
||
|
||
<!-- <el-form-item label="巷道ID" prop="roadwayId">
|
||
<el-input v-model="queryParams.roadwayId" placeholder="请输入巷道ID" clearable @keyup.enter.native="handleQuery" />
|
||
</el-form-item> -->
|
||
<!-- <el-form-item label="去向" prop="targetRoadwayId">-->
|
||
<!-- <el-input-->
|
||
<!-- v-model="queryParams.targetRoadwayId"-->
|
||
<!-- placeholder="请输入去向"-->
|
||
<!-- clearable-->
|
||
<!-- @keyup.enter.native="handleQuery"-->
|
||
<!-- />-->
|
||
<!-- </el-form-item>-->
|
||
<!-- <el-form-item label="目标货位ID" prop="targetCargoSpaceId">-->
|
||
<!-- <el-input-->
|
||
<!-- v-model="queryParams.targetCargoSpaceId"-->
|
||
<!-- placeholder="请输入目标货位ID"-->
|
||
<!-- clearable-->
|
||
<!-- @keyup.enter.native="handleQuery"-->
|
||
<!-- />-->
|
||
<!-- </el-form-item>-->
|
||
<!-- <el-form-item label="优先级" prop="priority">-->
|
||
<!-- <el-input-->
|
||
<!-- v-model="queryParams.priority"-->
|
||
<!-- placeholder="请输入优先级"-->
|
||
<!-- clearable-->
|
||
<!-- @keyup.enter.native="handleQuery"-->
|
||
<!-- />-->
|
||
<!-- </el-form-item>-->
|
||
<!-- <el-form-item label="执行阶段" prop="executionPhase">-->
|
||
<!-- <el-input-->
|
||
<!-- v-model="queryParams.executionPhase"-->
|
||
<!-- placeholder="请输入执行阶段"-->
|
||
<!-- clearable-->
|
||
<!-- @keyup.enter.native="handleQuery"-->
|
||
<!-- />-->
|
||
<!-- </el-form-item>-->
|
||
<!-- <el-form-item label="任务类型" prop="inOrOut">-->
|
||
<!-- <el-input-->
|
||
<!-- v-model="queryParams.inOrOut"-->
|
||
<!-- placeholder="请输入任务类型"-->
|
||
<!-- clearable-->
|
||
<!-- @keyup.enter.native="handleQuery"-->
|
||
<!-- />-->
|
||
<!-- </el-form-item>-->
|
||
<!-- <el-form-item label="开始时间" prop="startTime">-->
|
||
<!-- <el-input-->
|
||
<!-- v-model="queryParams.startTime"-->
|
||
<!-- placeholder="请输入开始时间"-->
|
||
<!-- clearable-->
|
||
<!-- @keyup.enter.native="handleQuery"-->
|
||
<!-- />-->
|
||
<!-- </el-form-item>-->
|
||
<!-- <el-form-item label="结束时间" prop="finishTime">-->
|
||
<!-- <el-input-->
|
||
<!-- v-model="queryParams.finishTime"-->
|
||
<!-- placeholder="请输入结束时间"-->
|
||
<!-- clearable-->
|
||
<!-- @keyup.enter.native="handleQuery"-->
|
||
<!-- />-->
|
||
<!-- </el-form-item>-->
|
||
<!-- <el-form-item label="入口ID" prop="entranceId">-->
|
||
<!-- <el-input-->
|
||
<!-- v-model="queryParams.entranceId"-->
|
||
<!-- placeholder="请输入入口ID"-->
|
||
<!-- clearable-->
|
||
<!-- @keyup.enter.native="handleQuery"-->
|
||
<!-- />-->
|
||
<!-- </el-form-item>-->
|
||
<!-- <el-form-item label="出口ID" prop="exitId">-->
|
||
<!-- <el-input-->
|
||
<!-- v-model="queryParams.exitId"-->
|
||
<!-- placeholder="请输入出口ID"-->
|
||
<!-- clearable-->
|
||
<!-- @keyup.enter.native="handleQuery"-->
|
||
<!-- />-->
|
||
<!-- </el-form-item>-->
|
||
<!--<!– <el-form-item label="仓库ID" prop="warehouseId">-->
|
||
<!-- <el-input-->
|
||
<!-- v-model="queryParams.warehouseId"-->
|
||
<!-- placeholder="请输入仓库ID"-->
|
||
<!-- clearable-->
|
||
<!-- @keyup.enter.native="handleQuery"-->
|
||
<!-- />-->
|
||
<!-- </el-form-item>-->
|
||
<!-- <el-form-item label="重分标志" prop="faultFlag">-->
|
||
<!-- <el-input-->
|
||
<!-- v-model="queryParams.faultFlag"-->
|
||
<!-- placeholder="请输入重分标志"-->
|
||
<!-- clearable-->
|
||
<!-- @keyup.enter.native="handleQuery"-->
|
||
<!-- />-->
|
||
<!-- </el-form-item>–>-->
|
||
<el-form-item>
|
||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||
</el-form-item>
|
||
</el-form>
|
||
|
||
<el-row :gutter="10" class="mb8">
|
||
<el-col :span="1.5">
|
||
<el-button type="success" plain icon="el-icon-check" size="mini" :disabled="multiple" @click="outhandFinish"
|
||
v-hasPermi="['job:mydoJob:outhandFinish']">手动完成
|
||
</el-button>
|
||
</el-col>
|
||
<el-col :span="1.5">
|
||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
|
||
@click="cancelTask" v-hasPermi="['job:mydoJob:remove']">手动作废
|
||
</el-button>
|
||
</el-col>
|
||
<el-col :span="1.5">
|
||
<el-button type="primary" plain icon="el-icon-edit" size="mini" :disabled="single"
|
||
@click="onResendTaskClicked" v-hasPermi="['job:mydoJob:resendTaskToEntrance']">入库重新下发
|
||
</el-button>
|
||
</el-col>
|
||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||
</el-row>
|
||
|
||
<el-table v-loading="loading" :data="mydoJobList" @selection-change="handleSelectionChange">
|
||
<el-table-column type="selection" width="55" align="center" />
|
||
<el-table-column label="任务ID" align="center" prop="jobId" />
|
||
<el-table-column label="任务状态" align="center" prop="status">
|
||
<template slot-scope="scope">
|
||
<dict-tag :options="dict.type.job_status" :value="scope.row.status" />
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="wcs任务号" align="center" prop="taskNo" />
|
||
<el-table-column label="wms任务号" align="center" prop="wmsTaskNo" />
|
||
<el-table-column label="巷道ID" align="center" prop="roadwayId" />
|
||
<el-table-column label="货位ID" align="center" prop="cargoSpaceId" />
|
||
<el-table-column label="托盘条码" align="center" prop="trayCode" />
|
||
<!-- <el-table-column label="优先级" align="center" prop="priority" /> -->
|
||
<el-table-column label="执行阶段" align="center" prop="executionPhase">
|
||
<template slot-scope="scope">
|
||
<dict-tag :options="dict.type.job_ep" :value="scope.row.executionPhase" />
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="任务类型" align="center" prop="inOrOut">
|
||
<template slot-scope="scope">
|
||
<dict-tag :options="dict.type.job_type" :value="scope.row.inOrOut" />
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="开始时间" align="center" prop="startTime" />
|
||
<el-table-column label="结束时间" align="center" prop="finishTime" />
|
||
<el-table-column label="入口ID" align="center" prop="entranceId" />
|
||
<el-table-column label="出口ID" align="center" prop="exitId" />
|
||
<!-- <el-table-column label="仓库ID" align="center" prop="warehouseId" />-->
|
||
<!-- <el-table-column label="重分标志" align="center" prop="faultFlag" />-->
|
||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||
<template slot-scope="scope">
|
||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||
v-hasPermi="['job:mydoJob:edit']">修改</el-button>
|
||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||
v-hasPermi="['job:mydoJob:remove']">删除</el-button>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
|
||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||
@pagination="getList" />
|
||
|
||
<!-- 添加或修改作业信息对话框 -->
|
||
<el-dialog :title="title" :visible.sync="open" width="400px" append-to-body>
|
||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||
<el-form-item label="任务号" prop="taskNo">
|
||
<el-input v-model="form.taskNo" placeholder="请输入任务号" style="width: 220px" />
|
||
</el-form-item>
|
||
<el-form-item label="状态" prop="status">
|
||
<el-select v-model="form.status" placeholder="请修改状态">
|
||
<el-option v-for="dict in dict.type.job_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item label="执行阶段" prop="executionPhase">
|
||
<el-select v-model="form.executionPhase" placeholder="请修改执行阶段">
|
||
<el-option v-for="dict in dict.type.job_ep" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item label="优先级" prop="priority">
|
||
<el-input v-model="form.priority" placeholder="请输入优先级" type="number" style="width: 220px" />
|
||
</el-form-item>
|
||
</el-form>
|
||
<div slot="footer" class="dialog-footer">
|
||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||
<el-button @click="cancel">取 消</el-button>
|
||
</div>
|
||
</el-dialog>
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
import { listMydoJob, getMydoJob, delMydoJob, addMydoJob, updateMydoJob, listMydoJobFinish, handFinish, resendTaskToEntrance } from "@/api/job/mydoJob"
|
||
|
||
export default {
|
||
name: "MydoJob",
|
||
dicts: ['job_status','job_type', 'job_ep'],
|
||
data() {
|
||
return {
|
||
// 遮罩层
|
||
loading: true,
|
||
// 选中数组
|
||
ids: [],
|
||
// 非单个禁用
|
||
single: true,
|
||
// 非多个禁用
|
||
multiple: true,
|
||
// 显示搜索条件
|
||
showSearch: true,
|
||
// 总条数
|
||
total: 0,
|
||
// 作业信息表格数据
|
||
mydoJobList: [],
|
||
// 弹出层标题
|
||
title: "",
|
||
// 是否显示弹出层
|
||
open: false,
|
||
// 查询参数
|
||
queryParams: {
|
||
pageNum: 1,
|
||
pageSize: 10,
|
||
status: null,
|
||
taskNo: null,
|
||
wmsTaskNo: null, //@@@ FT568 入库请求wms返回的任务号
|
||
roadwayId: null,
|
||
cargoSpaceId: null,
|
||
targetRoadwayId: null,
|
||
targetCargoSpaceId: null,
|
||
priority: null,
|
||
executionPhase: null,
|
||
inOrOut: null,
|
||
startTime: null,
|
||
finishTime: null,
|
||
entranceId: null,
|
||
exitId: null,
|
||
warehouseId: null,
|
||
faultFlag: null,
|
||
trayCode: null
|
||
},
|
||
// 表单参数
|
||
form: {},
|
||
// 表单校验
|
||
rules: {
|
||
status: [
|
||
{ required: true, message: "任务状态不能为空", trigger: "change" }
|
||
],
|
||
taskNo: [
|
||
{ required: true, message: "任务号不能为空", trigger: "blur" }
|
||
],
|
||
}
|
||
}
|
||
},
|
||
created() {
|
||
this.getList()
|
||
},
|
||
methods: {
|
||
/** 查询作业信息列表 */
|
||
getList() {
|
||
this.loading = true
|
||
if (this.queryParams.status === '4' || this.queryParams.status === '5') {
|
||
listMydoJobFinish(this.queryParams).then(response => {
|
||
this.mydoJobList = response.rows
|
||
this.total = response.total
|
||
this.loading = false
|
||
})
|
||
} else {
|
||
listMydoJob(this.queryParams).then(response => {
|
||
this.mydoJobList = response.rows
|
||
this.total = response.total
|
||
this.loading = false
|
||
})
|
||
}
|
||
|
||
},
|
||
// 取消按钮
|
||
cancel() {
|
||
this.open = false
|
||
this.reset()
|
||
},
|
||
// 表单重置
|
||
reset() {
|
||
this.form = {
|
||
jobId: null,
|
||
status: null,
|
||
taskNo: null,
|
||
wmsTaskNo: null, //@@@ FT568 入库请求wms返回的任务号
|
||
roadwayId: null,
|
||
cargoSpaceId: null,
|
||
targetRoadwayId: null,
|
||
targetCargoSpaceId: null,
|
||
priority: null,
|
||
executionPhase: null,
|
||
inOrOut: null,
|
||
createTime: null,
|
||
startTime: null,
|
||
finishTime: null,
|
||
entranceId: null,
|
||
exitId: null,
|
||
warehouseId: null,
|
||
faultFlag: null,
|
||
trayCode: null
|
||
}
|
||
this.resetForm("form")
|
||
},
|
||
/** 搜索按钮操作 */
|
||
handleQuery() {
|
||
this.queryParams.pageNum = 1
|
||
this.getList()
|
||
},
|
||
/** 重置按钮操作 */
|
||
resetQuery() {
|
||
this.resetForm("queryForm")
|
||
this.handleQuery()
|
||
},
|
||
// 多选框选中数据
|
||
handleSelectionChange(selection) {
|
||
this.ids = selection.map(item => item.jobId)
|
||
this.single = selection.length !== 1
|
||
this.multiple = !selection.length
|
||
},
|
||
/** 新增按钮操作 */
|
||
handleAdd() {
|
||
this.reset()
|
||
this.open = true
|
||
this.title = "添加作业信息"
|
||
},
|
||
/** 修改按钮操作 */
|
||
handleUpdate(row) {
|
||
this.reset()
|
||
const jobId = row.jobId || this.ids
|
||
getMydoJob(jobId).then(response => {
|
||
this.form = response.data
|
||
this.open = true
|
||
this.title = "修改作业信息"
|
||
})
|
||
},
|
||
/** 提交按钮 */
|
||
submitForm() {
|
||
this.$refs["form"].validate(valid => {
|
||
if (valid) {
|
||
if (this.form.jobId != null) {
|
||
updateMydoJob(this.form).then(response => {
|
||
this.$modal.msgSuccess("修改成功")
|
||
this.open = false
|
||
this.getList()
|
||
})
|
||
} else {
|
||
addMydoJob(this.form).then(response => {
|
||
this.$modal.msgSuccess("新增成功")
|
||
this.open = false
|
||
this.getList()
|
||
})
|
||
}
|
||
}
|
||
})
|
||
},
|
||
/** 删除按钮操作 */
|
||
handleDelete(row) {
|
||
const jobIds = row.jobId || this.ids
|
||
this.$modal.confirm('是否确认删除编号为"' + jobIds + '"的任务?(此操作可能影响任务回传,需要人工向wms维护人员通知作业处理情况)').then(function () {
|
||
return delMydoJob(jobIds)
|
||
}).then(() => {
|
||
this.getList()
|
||
this.$modal.msgSuccess("操作成功")
|
||
}).catch(() => { })
|
||
},
|
||
|
||
cancelTask() {
|
||
if (this.ids.length === 0) {
|
||
this.$modal.msgError("请选择需要手动作废的任务");
|
||
return;
|
||
}
|
||
console.log(this.ids.join(','))
|
||
|
||
this.$modal.confirm('是否确认手动作废选中的任务?').then(() => {
|
||
return delMydoJob(this.ids.join(','))
|
||
}).then(() => {
|
||
this.getList();
|
||
this.$modal.msgSuccess("手动作废成功");
|
||
}).catch(error => {
|
||
// console.error('手动作废失败:', error);
|
||
// this.$modal.msgError(`手动作废失败:${error.message || '未知错误'}`);
|
||
});
|
||
},
|
||
|
||
outhandFinish() {
|
||
if (this.ids.length === 0) {
|
||
this.$modal.msgError("请选择需要手动完成的任务");
|
||
return;
|
||
}
|
||
|
||
console.log(this.ids.join(','))
|
||
|
||
this.$modal.confirm('是否确认手动完成选中的任务?').then(() => {
|
||
return handFinish(this.ids.join(','));
|
||
}).then(() => {
|
||
this.$modal.msgSuccess("手动完成成功");
|
||
this.getList();
|
||
}).catch(() => { });
|
||
},
|
||
|
||
onResendTaskClicked() {
|
||
if (!this.ids || this.ids.length === 0) {
|
||
this.$modal.msgError("请选择需要重新下发的任务");
|
||
return;
|
||
}
|
||
const jobId = this.ids[0];
|
||
console.log(jobId)
|
||
this.$modal.confirm('是否确认重新下发选中的任务?').then(() => {
|
||
return resendTaskToEntrance(jobId);
|
||
}).then(() => {
|
||
this.$modal.msgSuccess("重新下发成功");
|
||
this.getList();
|
||
}).catch(() => { });
|
||
},
|
||
|
||
/** 导出按钮操作 */
|
||
handleExport() {
|
||
this.download('job/mydoJob/export', {
|
||
...this.queryParams
|
||
}, `mydoJob_${new Date().getTime()}.xlsx`)
|
||
}
|
||
}
|
||
}
|
||
</script>
|