项目初始化
This commit is contained in:
479
ruoyi-ui/src/views/in/job/index.vue
Normal file
479
ruoyi-ui/src/views/in/job/index.vue
Normal file
@@ -0,0 +1,479 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="任务ID" prop="jobId">
|
||||
<el-input
|
||||
v-model="queryParams.jobId"
|
||||
placeholder="请输入任务ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择任务状态" >
|
||||
<el-option
|
||||
v-for="dict in dict.type.mydo_job_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务号" prop="taskNo">
|
||||
<el-input
|
||||
v-model="queryParams.taskNo"
|
||||
placeholder="请输入任务号"
|
||||
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="执行阶段" prop="executionPhase">
|
||||
<el-select v-model="queryParams.executionPhase" placeholder="请选择执行阶段" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.execution_phase_type"
|
||||
: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.in_job_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.startTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择开始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="finishTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.finishTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择结束时间">
|
||||
</el-date-picker>
|
||||
</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="仓库" prop="warehouseId"><!--仓库-->
|
||||
<el-select
|
||||
v-model="queryParams.warehouseId"
|
||||
placeholder="请选择仓库"
|
||||
clearable
|
||||
@change="handleQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.warehouseId"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseId"
|
||||
/>
|
||||
</el-select>
|
||||
</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="danger"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click="handleCompletedManually({type: 'invalid'})"
|
||||
v-hasPermi="['job:mydoJob:manualInvalidation']"
|
||||
>手动作废</el-button><!--手动作废-->
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click="handleCompletedManually({type: 'completed'})"
|
||||
v-hasPermi="['job:mydoJob:manualCompleted']"
|
||||
>手动完成</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" @row-click="handleRowClick" highlight-current-row :current-row="currentRow"
|
||||
max-height="400">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="任务ID" align="left" prop="jobId" fixed />
|
||||
<el-table-column label="任务状态" align="left" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mydo_job_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上线类型" align="left" prop="onLineType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.on_line_type" :value="scope.row.onLineType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务类型" align="left" prop="inOrOut">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.in_job_type" :value="scope.row.inOrOut"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务号" align="left" prop="taskNo" />
|
||||
<!-- <el-table-column :label="$t('inJob.supplierName')" align="left" prop="supplierName" key="supplierId" value="supplierName" /> // 供应商-->
|
||||
<!-- <el-table-column :label="$t('inJob.departmentName')" align="left" prop="departmentName" /> // 部门-->
|
||||
<el-table-column label="托盘码" align="left" prop="trayCode" />
|
||||
<el-table-column label="货位" align="left" prop="cargoSpaceName" />
|
||||
<el-table-column label="优先级" align="left" prop="priority" />
|
||||
<el-table-column label="执行阶段" align="left" prop="executionPhase">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.execution_phase_type" :value="scope.row.executionPhase"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入口ID" align="left" prop="entranceId" />
|
||||
<el-table-column label="仓库" align="left" prop="warehouseName" />
|
||||
<el-table-column label="创建时间" align="left" prop="createTime" width="180"/>
|
||||
<!-- <template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
<el-table-column label="开始时间" align="left" prop="startTime" width="180"/>
|
||||
<!-- <template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
<el-table-column label="结束时间" align="left" prop="finishTime" width="180"/>
|
||||
<!-- <template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.finishTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<el-table v-loading="detailLoading" :data="mydoJobDetailList" @selection-change="handleSelectionChange"
|
||||
max-height="300"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="任务明细ID" align="left" prop="jobDetailId" />
|
||||
<el-table-column label="任务ID" align="left" prop="jobId" />
|
||||
<el-table-column label="单据ID" align="left" prop="inOrOutId" />
|
||||
<el-table-column label="子单据ID" align="left" prop="inOrOutDId" />
|
||||
<el-table-column label="物料编码" align="left" prop="productId" />
|
||||
<el-table-column label="物料描述" align="left" prop="extraField.materialDesc" />
|
||||
<el-table-column label="英文描述" align="left" prop="extraField.englishDesc" />
|
||||
<el-table-column label="箱号" align="left" prop="extraField.cartonNo" />
|
||||
<el-table-column label="包装方式" align="left" prop="extraField.packingMethod" />
|
||||
<!-- <el-table-column label="净重" align="right" width="120px" prop="extraField.netWeight" />-->
|
||||
<!-- <el-table-column label="总净重" align="right" prop="extraField.totalNetWeight" />-->
|
||||
<!-- <el-table-column label="毛重" align="right" prop="extraField.grossWeight" />-->
|
||||
<el-table-column label="入库数量" align="right" prop="inQuantity" />
|
||||
<!-- <el-table-column :label="$t('inJob.inDate')" align="left" prop="inDate" width="180"> // 入库时间-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <span>{{ parseTime(scope.row.inDate, '{y}-{m}-{d}') }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="detailTotal>0"
|
||||
:total="detailTotal"
|
||||
:page.sync="queryDetailParams.pageNum"
|
||||
:limit.sync="queryDetailParams.pageSize"
|
||||
@pagination="getDetailList"
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listMydoJob,manualInvalidation,manualCompleted, getMydoJob, delMydoJob, addMydoJob, updateMydoJob } from "@/api/job/inmydoJob"
|
||||
import { listMydoJobDetail } from "@/api/job/mydoJobDetail"
|
||||
import {listWarehouse} from "@/api/bas/warehouse";
|
||||
|
||||
export default {
|
||||
name: "MydoJob",
|
||||
dicts: ['execution_phase_type', 'in_job_type', 'on_line_type', 'mydo_job_status'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
detailLoading:false,
|
||||
warehouseOptions:[],
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
detailTotal: 0,
|
||||
// 任务表表格数据
|
||||
mydoJobList: [],
|
||||
// 子任务表表格数据
|
||||
mydoJobDetailList:[],
|
||||
// 当前选中行
|
||||
currentRow:null,
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
jobId: null,
|
||||
status: '1',
|
||||
onLineType: null,
|
||||
taskNo: null,
|
||||
supplierId: null,
|
||||
customerId: null,
|
||||
departmentId: null,
|
||||
trayCode: null,
|
||||
roadwayId: null,
|
||||
cargoSpaceId: null,
|
||||
targetRoadwayId: null,
|
||||
targetCargoSpaceId: null,
|
||||
lineId: null,
|
||||
workshopId: null,
|
||||
priority: null,
|
||||
executionPhase: null,
|
||||
inOrOut: null,
|
||||
createTime: null,
|
||||
startTime: null,
|
||||
finishTime: null,
|
||||
entranceId: null,
|
||||
exitId: null,
|
||||
classId: null,
|
||||
warehouseId: null,
|
||||
faultFlag: null,
|
||||
inOut:"1"
|
||||
},
|
||||
queryDetailParams:{
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
jobId: null,
|
||||
status: null,
|
||||
},
|
||||
queryWarehouseParams:{
|
||||
pageNum: 1,
|
||||
pageSize: 99,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 获取字典数据后,设置默认值
|
||||
this.getList()
|
||||
this.getWarehouseList()
|
||||
},
|
||||
methods: {
|
||||
/** 获取仓库列表 */
|
||||
getWarehouseList() {
|
||||
listWarehouse(this.queryWarehouseParams).then(response => {
|
||||
this.warehouseOptions = response.rows;
|
||||
if (this.warehouseOptions.length > 0) {
|
||||
this.handleQuery();
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 查询任务表列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listMydoJob(this.queryParams).then(response => {
|
||||
this.mydoJobList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
// 如果有数据,自动选中第一行
|
||||
if (this.mydoJobList.length > 0) {
|
||||
this.handleRowClick(this.mydoJobList[0]);
|
||||
} else {
|
||||
this.mydoJobDetailList = []
|
||||
this.detailLoading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
jobId: null,
|
||||
status: null,
|
||||
onLineType: null,
|
||||
taskNo: null,
|
||||
supplierId: null,
|
||||
customerId: null,
|
||||
departmentId: null,
|
||||
trayCode: null,
|
||||
roadwayId: null,
|
||||
cargoSpaceId: null,
|
||||
targetRoadwayId: null,
|
||||
targetCargoSpaceId: null,
|
||||
lineId: null,
|
||||
workshopId: null,
|
||||
priority: null,
|
||||
executionPhase: null,
|
||||
inOrOut: null,
|
||||
createTime: null,
|
||||
startTime: null,
|
||||
finishTime: null,
|
||||
entranceId: null,
|
||||
exitId: null,
|
||||
classId: null,
|
||||
warehouseId: null,
|
||||
faultFlag: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
// 清空子表数据和当前选中行
|
||||
this.mydoJobDetailList = []
|
||||
this.detailTotal = 0
|
||||
this.currentRow = null
|
||||
this.queryDetailParams.jobId = null
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
// 清空子表数据
|
||||
this.mydoJobDetailList = [];
|
||||
this.detailTotal = 0;
|
||||
this.currentRow = null;
|
||||
this.queryDetailParams.jobId = null;
|
||||
// 重新查询主表数据
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
// 只处理主表的多选
|
||||
if (selection.length > 0 && selection[0].hasOwnProperty('jobDetailId')) {
|
||||
return;
|
||||
}
|
||||
this.ids = selection.map(item => item.jobId);
|
||||
this.single = selection.length!==1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
|
||||
// 手动完成/作废
|
||||
handleCompletedManually(row) {
|
||||
const jobIds = this.ids;
|
||||
if (jobIds.length === 0) {
|
||||
this.$modal.msgError('请选择要操作的数据');
|
||||
return;
|
||||
}
|
||||
if (jobIds.length > 1) {
|
||||
this.$modal.msgError('请选择一条数据进行操作');
|
||||
return;
|
||||
}
|
||||
var data = {
|
||||
"jobId": jobIds[0],
|
||||
}
|
||||
if (row.type === 'invalid'){
|
||||
//手动作废
|
||||
manualInvalidation(data).then(response => {
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
this.getList();
|
||||
})
|
||||
|
||||
|
||||
}else if (row.type === 'completed'){
|
||||
//手动完成
|
||||
manualCompleted(data).then(response => {
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
this.getList();
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('job/mydoJob/export', {
|
||||
...this.queryParams
|
||||
}, `mydoJob_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 行点击事件处理 */
|
||||
handleRowClick(row) {
|
||||
// 设置当前选中行
|
||||
this.currentRow = row;
|
||||
// 更新子表格查询参数
|
||||
this.queryDetailParams.jobId = row.jobId;
|
||||
this.queryDetailParams.status = row.status;
|
||||
// 查询子表格数据
|
||||
this.getDetailList();
|
||||
},
|
||||
/** 查询子任务表列表 */
|
||||
getDetailList() {
|
||||
// 如果没有选中的主任务,不加载子任务
|
||||
if (!this.queryDetailParams.jobId) {
|
||||
this.mydoJobDetailList = [];
|
||||
this.detailTotal = 0;
|
||||
this.detailLoading = false;
|
||||
return;
|
||||
}
|
||||
this.detailLoading = true;
|
||||
listMydoJobDetail(this.queryDetailParams).then(response => {
|
||||
this.mydoJobDetailList = response.rows;
|
||||
this.detailTotal = response.total;
|
||||
this.detailLoading = false;
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-table >>> .current-row {
|
||||
background-color: #f0f9eb;
|
||||
}
|
||||
.el-form-item >>> .el-form-item__label {
|
||||
white-space: nowrap;
|
||||
width: auto;
|
||||
min-width: fit-content;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user