Compare commits
3 Commits
a698ec0e84
...
902964a2cf
| Author | SHA1 | Date | |
|---|---|---|---|
| 902964a2cf | |||
| 2d12eac2ed | |||
| 5e88f7afe6 |
|
|
@ -188,6 +188,15 @@ const downloadWorkSummaryExcel = (data) => {
|
|||
timeout: 600000
|
||||
})
|
||||
}
|
||||
const downloadWorkFlowExcel = (data) => {
|
||||
return request({
|
||||
url: '/excel/downloadWorkFlowExcel',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
uploadExcelStock,
|
||||
|
|
@ -209,5 +218,6 @@ export {
|
|||
uploadExcelBaseGoods,
|
||||
uploadExcelKanban,
|
||||
uploadWorkFlow,
|
||||
uploadExcelWorkDate
|
||||
uploadExcelWorkDate,
|
||||
downloadWorkFlowExcel
|
||||
}
|
||||
|
|
@ -68,36 +68,36 @@
|
|||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="小盒子" prop="smallBox">
|
||||
<el-input v-model="configFormEntity.smallBox" disabled />
|
||||
<el-input v-model="configFormEntity.smallBox" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="机型" prop="model">
|
||||
<el-input v-model="configFormEntity.model" disabled />
|
||||
<el-input v-model="configFormEntity.model" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="工位" prop="workCenter">
|
||||
<el-input v-model="configFormEntity.workCenter" disabled />
|
||||
<el-input v-model="configFormEntity.workCenter" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工位大盒子" prop="bigBox">
|
||||
<el-input v-model="configFormEntity.bigBox" disabled />
|
||||
<el-input v-model="configFormEntity.bigBox" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="车辆" prop="vehicle">
|
||||
<el-input v-model="configFormEntity.vehicle" disabled />
|
||||
<el-input v-model="configFormEntity.vehicle" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="线边架/车位置" prop="vehicleLocation">
|
||||
<el-input v-model="configFormEntity.vehicleLocation" disabled />
|
||||
<el-input v-model="configFormEntity.vehicleLocation" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
:suffix-icon="Search" />
|
||||
<el-select-v2 v-model="goodsTypeQuery" style="width: 158px; margin-right: 10px;" placeholder="物料类型"
|
||||
:options="goodsTypeOptions" @change="search()"></el-select-v2>
|
||||
<el-select-v2 v-model="stockStatusQuery" style="width: 158px; margin-right: 10px;" placeholder="库存状态"
|
||||
:options="stockStatusSearchOptions" @change="search()"></el-select-v2>
|
||||
<el-date-picker v-model="createTimeQuery" type="date" placeholder="选择上架日期" :shortcuts="shortcuts"
|
||||
style="width: 158px; margin-right: 10px;" clearable />
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
|
|
@ -222,6 +224,7 @@ export default {
|
|||
vehicleIdQuery: '',
|
||||
locationIdQuery: '',
|
||||
goodsTypeQuery: '',
|
||||
stockStatusQuery: -99,
|
||||
createTimeQuery: null,
|
||||
shortcuts: [
|
||||
{
|
||||
|
|
@ -296,6 +299,40 @@ export default {
|
|||
label: '库存锁定'
|
||||
}
|
||||
],
|
||||
stockStatusSearchOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '库存正常'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '出库中'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '盘点中'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '移库中'
|
||||
},
|
||||
{
|
||||
value: 4,
|
||||
label: '拣选中'
|
||||
},
|
||||
{
|
||||
value: 5,
|
||||
label: '回库中'
|
||||
},
|
||||
{
|
||||
value: 9,
|
||||
label: '库存锁定'
|
||||
}
|
||||
],
|
||||
goodsList: [],
|
||||
goodsTypeOptions: [
|
||||
{
|
||||
|
|
@ -427,6 +464,7 @@ export default {
|
|||
vehicleId: this.vehicleIdQuery.trim(),
|
||||
locationId: this.locationIdQuery.trim(),
|
||||
goodsType: this.goodsTypeQuery.trim(),
|
||||
stockStatus: this.stockStatusQuery == -99 ? null : this.stockStatusQuery,
|
||||
createTime: timeFormatter(this.createTimeQuery),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
|
|
@ -448,6 +486,8 @@ export default {
|
|||
this.goodsIdQuery = ''
|
||||
this.vehicleIdQuery = ''
|
||||
this.locationIdQuery = ''
|
||||
this.goodsTypeQuery = ''
|
||||
this.stockStatusQuery = -99
|
||||
this.createTimeQuery = null
|
||||
this.search()
|
||||
},
|
||||
|
|
@ -461,6 +501,7 @@ export default {
|
|||
vehicleId: this.vehicleIdQuery.trim(),
|
||||
locationId: this.locationIdQuery.trim(),
|
||||
goodsType: this.goodsTypeQuery.trim(),
|
||||
stockStatus: this.stockStatusQuery == -99 ? null : this.stockStatusQuery,
|
||||
createTime: timeFormatter(this.createTimeQuery),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,379 +1,388 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-row>
|
||||
<el-input v-model="goodsIdQuery" style="width: 196px; margin-right: 10px;" placeholder="料号" />
|
||||
<el-input v-model="vehicleIdQuery" style="width: 196px; margin-right: 10px;" placeholder="箱号" />
|
||||
<el-select-v2 v-model="taskTypeQuery" style="width: 196px; margin-right: 10px;" placeholder="请选择任务类型"
|
||||
:options="taskTypeOptions" @change="search()"></el-select-v2>
|
||||
<el-select-v2 v-model="taskStatusQuery" style="width: 196px; margin-right: 10px;" placeholder="请选择任务状态"
|
||||
:options="taskStatusOptions" @change="search()"></el-select-v2>
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
<br />
|
||||
<el-table :data="tasks" stripe border v-loading="loading" style="width: 100%" max-height="684px"
|
||||
class="table-class" :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-row>
|
||||
<el-input v-model="goodsIdQuery" style="width: 196px; margin-right: 10px;" placeholder="料号"/>
|
||||
<el-input v-model="vehicleIdQuery" style="width: 196px; margin-right: 10px;" placeholder="箱号"/>
|
||||
<el-select-v2 v-model="taskTypeQuery" style="width: 196px; margin-right: 10px;" placeholder="请选择任务类型"
|
||||
:options="taskTypeOptions" @change="search()"></el-select-v2>
|
||||
<el-select-v2 v-model="taskStatusQuery" style="width: 196px; margin-right: 10px;" placeholder="请选择任务状态"
|
||||
:options="taskStatusOptions" @change="search()"></el-select-v2>
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
<br/>
|
||||
<el-table :data="tasks" stripe border v-loading="loading" style="width: 100%" max-height="684px"
|
||||
class="table-class" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }"
|
||||
@row-click="getCurrentRow">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.taskId" v-model="taskId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="taskId" label="任务号" fixed="left" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="taskType" label="任务类型" fixed="left" :formatter="taskTypeFormat" min-width="120px" />
|
||||
<el-table-column prop="vehicleId" label="箱号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsRelated.goodsId" label="料号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsRelated.goodsName" label="料名" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="taskGroup" label="任务组" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="origin" label="起点" min-width="120px" />
|
||||
<el-table-column prop="destination" label="终点" min-width="120px" />
|
||||
<el-table-column prop="goodsRelated.opNum" label="操作数量" min-width="120px" />
|
||||
<el-table-column prop="goodsRelated.originNum" label="库存数量" min-width="120px" />
|
||||
<el-table-column prop="taskPriority" label="任务优先级" min-width="120px" />
|
||||
<el-table-column prop="preTask" label="前置任务" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="createTime" label="运行时长" :formatter="dueFormat" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="userName" label="操作人员姓名" min-width="120px" />
|
||||
<el-table-column prop="taskStatus" label="任务状态" fixed="right" :formatter="taskStatusFormat"
|
||||
min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowTask(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
<el-dialog v-model="dialogVisible" title="任务信息" width="40%" draggable :show-close="false">
|
||||
<el-form ref="taskFormRef" :model="taskFormEntity" :label-position="labelPosition" label-width="100px"
|
||||
style="max-width: 100%" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="任务号" prop="taskId">
|
||||
<el-input v-model="taskFormEntity.taskId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务优先级" prop="taskPriority">
|
||||
<el-input-number v-model.number="taskFormEntity.taskPriority" controls-position="right"
|
||||
:min="1" :max="9" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="料箱号" prop="vehicleId">
|
||||
<el-input v-model="taskFormEntity.vehicleId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="料号" prop="goodsId">
|
||||
<el-input v-model="taskFormEntity.goodsId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="起点" prop="origin">
|
||||
<el-input v-model="taskFormEntity.origin" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12" v-if="taskFormEntity.taskType == 1">
|
||||
<el-form-item label="终点" prop="destination">
|
||||
<el-select-v2 v-model="taskFormEntity.destination"
|
||||
:options="availableLocationOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="taskFormEntity.taskType == 2">
|
||||
<el-form-item label="终点" prop="destination">
|
||||
<el-input v-model="taskFormEntity.destination" disabled />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="终点" prop="destination">
|
||||
<el-input v-model="taskFormEntity.destination" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="任务类型" prop="taskType">
|
||||
<el-select-v2 v-model="taskFormEntity.taskType" placeholder="请选择任务类型" disabled
|
||||
:options="taskTypeOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务状态" prop="taskStatus">
|
||||
<el-select-v2 v-model="taskFormEntity.taskStatus" placeholder="请选择任务状态"
|
||||
:options="taskStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.taskId" v-model="taskId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="taskId" label="任务号" fixed="left" show-overflow-tooltip min-width="120px"/>
|
||||
<el-table-column prop="taskType" label="任务类型" fixed="left" :formatter="taskTypeFormat" min-width="120px"/>
|
||||
<el-table-column prop="vehicleId" label="箱号" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="goodsRelated.goodsId" label="料号" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="goodsRelated.goodsName" label="料名" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="taskGroup" label="任务组" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="origin" label="起点" min-width="120px"/>
|
||||
<el-table-column prop="destination" label="终点" min-width="120px"/>
|
||||
<el-table-column prop="goodsRelated.opNum" label="操作数量" min-width="120px"/>
|
||||
<el-table-column prop="goodsRelated.originNum" label="库存数量" min-width="120px"/>
|
||||
<el-table-column prop="taskPriority" label="任务优先级" min-width="120px"/>
|
||||
<el-table-column prop="preTask" label="前置任务" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="pickStand" label="下发站台" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="createTime" label="运行时长" :formatter="dueFormat" min-width="120px"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="userName" label="操作人员姓名" min-width="120px"/>
|
||||
<el-table-column prop="taskStatus" label="任务状态" fixed="right" :formatter="taskStatusFormat"
|
||||
min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowTask(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br/>
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search"/>
|
||||
<el-dialog v-model="dialogVisible" title="任务信息" width="40%" draggable :show-close="false">
|
||||
<el-form ref="taskFormRef" :model="taskFormEntity" :label-position="labelPosition" label-width="100px"
|
||||
style="max-width: 100%" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="任务号" prop="taskId">
|
||||
<el-input v-model="taskFormEntity.taskId" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务优先级" prop="taskPriority">
|
||||
<el-input-number v-model.number="taskFormEntity.taskPriority" controls-position="right"
|
||||
:min="1" :max="9" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="料箱号" prop="vehicleId">
|
||||
<el-input v-model="taskFormEntity.vehicleId" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="料号" prop="goodsId">
|
||||
<el-input v-model="taskFormEntity.goodsId" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="起点" prop="origin">
|
||||
<el-input v-model="taskFormEntity.origin" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12" v-if="taskFormEntity.taskType == 1">
|
||||
<el-form-item label="终点" prop="destination">
|
||||
<el-select-v2 v-model="taskFormEntity.destination"
|
||||
:options="availableLocationOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="taskFormEntity.taskType == 2">
|
||||
<el-form-item label="终点" prop="destination">
|
||||
<el-input v-model="taskFormEntity.destination" disabled />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="终点" prop="destination">
|
||||
<el-input v-model="taskFormEntity.destination" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="任务类型" prop="taskType">
|
||||
<el-select-v2 v-model="taskFormEntity.taskType" placeholder="请选择任务类型" disabled
|
||||
:options="taskTypeOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务状态" prop="taskStatus">
|
||||
<el-select-v2 v-model="taskFormEntity.taskStatus" placeholder="请选择任务状态"
|
||||
:options="taskStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitTaskInfo(taskFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getTasksByPage, updateTaskInfo } from '@/api/task.js'
|
||||
import { dateFormatter, taskStatusFormatter, timeFormatter, dueFormatter } from '@/utils/formatter.js'
|
||||
import {getTasksByPage, updateTaskInfo} from '@/api/task.js'
|
||||
import {dateFormatter, taskStatusFormatter, timeFormatter, dueFormatter} from '@/utils/formatter.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import {errorBox} from '@/utils/myMessageBox.js'
|
||||
import {ElMessage} from 'element-plus'
|
||||
import store from '@/store'
|
||||
import { ref, reactive } from 'vue'
|
||||
import {ref, reactive} from 'vue'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'taskMonitor',
|
||||
data() {
|
||||
return {
|
||||
tasks: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
goodsIdQuery: '',
|
||||
vehicleIdQuery: '',
|
||||
taskTypeQuery: -99,
|
||||
taskStatusQuery: -99,
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
taskFormEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
taskFormRef: ref(),
|
||||
rules: reactive({}),
|
||||
taskId: '',
|
||||
taskTypeOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '所有类型'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '入库'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '出库'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '盘点'
|
||||
},
|
||||
{
|
||||
value: 9,
|
||||
label: '移库'
|
||||
},
|
||||
],
|
||||
taskStatusOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '所有状态'
|
||||
},
|
||||
{
|
||||
value: -2,
|
||||
label: '重复入库'
|
||||
},
|
||||
{
|
||||
value: -1,
|
||||
label: '暂存'
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '新建待下发'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '已下发'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '开始执行'
|
||||
},
|
||||
{
|
||||
value: 8,
|
||||
label: '拣选中'
|
||||
},
|
||||
{
|
||||
value: 9,
|
||||
label: '盘点中'
|
||||
},
|
||||
{
|
||||
value: 100,
|
||||
label: '任务完成'
|
||||
},
|
||||
{
|
||||
value: 998,
|
||||
label: '任务取消'
|
||||
},
|
||||
{
|
||||
value: 999,
|
||||
label: '任务异常'
|
||||
}
|
||||
],
|
||||
availableLocationOptions: []
|
||||
name: 'taskMonitor',
|
||||
data() {
|
||||
return {
|
||||
tasks: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
goodsIdQuery: '',
|
||||
vehicleIdQuery: '',
|
||||
taskTypeQuery: -99,
|
||||
taskStatusQuery: -99,
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
taskFormEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
taskFormRef: ref(),
|
||||
rules: reactive({}),
|
||||
taskId: '',
|
||||
taskTypeOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '所有类型'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '入库'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '出库'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '盘点'
|
||||
},
|
||||
{
|
||||
value: 9,
|
||||
label: '移库'
|
||||
},
|
||||
],
|
||||
taskStatusOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '所有状态'
|
||||
},
|
||||
{
|
||||
value: -2,
|
||||
label: '重复入库'
|
||||
},
|
||||
{
|
||||
value: -1,
|
||||
label: '暂存'
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '新建待下发'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '已下发'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '开始执行'
|
||||
},
|
||||
{
|
||||
value: 8,
|
||||
label: '拣选中'
|
||||
},
|
||||
{
|
||||
value: 9,
|
||||
label: '盘点中'
|
||||
},
|
||||
{
|
||||
value: 100,
|
||||
label: '任务完成'
|
||||
},
|
||||
{
|
||||
value: 998,
|
||||
label: '任务取消'
|
||||
},
|
||||
{
|
||||
value: 999,
|
||||
label: '任务异常'
|
||||
}
|
||||
],
|
||||
availableLocationOptions: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
methods: {
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
taskStatusFormat: (row, column, cellValue, index) => {
|
||||
return taskStatusFormatter(cellValue)
|
||||
},
|
||||
taskTypeFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 1: return '入库'
|
||||
case 2: return '出库'
|
||||
case 3: return '盘点'
|
||||
case 9: return '移库'
|
||||
default: return '未知'
|
||||
}
|
||||
},
|
||||
dueFormat: (row, column, cellValue, index) => {
|
||||
return dueFormatter(cellValue)
|
||||
},
|
||||
search() {
|
||||
this.loading = true
|
||||
const tableRequest = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
taskType: this.taskTypeQuery == -99 ? null : this.taskTypeQuery,
|
||||
taskStatus: this.taskStatusQuery == -99 ? null : this.taskStatusQuery,
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
vehicleId: this.vehicleIdQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getTasksByPage(tableRequest).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.tasks = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
console.log(this.tasks)
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询任务错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
reset() {
|
||||
this.goodsIdQuery = ''
|
||||
this.vehicleIdQuery = ''
|
||||
},
|
||||
editCurrentRowTask(row) {
|
||||
console.log(row)
|
||||
// if (row.taskType == 1) {
|
||||
// this.availableLocationOptions = []
|
||||
// var currentOption = {
|
||||
// value: row.destination,
|
||||
// label: locationFormatter(row.destination)
|
||||
// }
|
||||
// this.availableLocationOptions.push(currentOption)
|
||||
// // 生成可用库位列表
|
||||
// const requestParam = {
|
||||
// areaId: 1
|
||||
// }
|
||||
// getAvailableLocations(requestParam).then(res => {
|
||||
// if (res.data.code == 0) {
|
||||
// for (const location of res.data.returnData) {
|
||||
// var newOption = {}
|
||||
// newOption.value = location.locationId
|
||||
// newOption.label = locationFormatter(location.locationId)
|
||||
// this.availableLocationOptions.push(newOption)
|
||||
// }
|
||||
// }
|
||||
// }).catch(err => {
|
||||
// errorBox('查找可用库位失败:' + err)
|
||||
// })
|
||||
// }
|
||||
this.taskFormEntity = {
|
||||
taskId: row.taskId,
|
||||
taskPriority: row.taskPriority,
|
||||
vehicleId: row.vehicleId,
|
||||
goodsId: row.goodsRelated == null ? '' : row.goodsRelated.goodsId,
|
||||
origin: row.origin,
|
||||
destination: row.destination,
|
||||
taskType: row.taskType,
|
||||
taskStatus: row.taskStatus,
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submitTaskInfo() {
|
||||
if (this.taskFormEntity.taskStatus == null || this.taskFormEntity.taskStatus == undefined) {
|
||||
errorBox('请选择任务状态')
|
||||
return
|
||||
}
|
||||
const request = {
|
||||
taskId: this.taskFormEntity.taskId,
|
||||
taskStatus: this.taskFormEntity.taskStatus,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateTaskInfo(request).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('修改任务成功')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('修改任务失败')
|
||||
})
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.taskId = row.taskId
|
||||
taskStatusFormat: (row, column, cellValue, index) => {
|
||||
return taskStatusFormatter(cellValue)
|
||||
},
|
||||
taskTypeFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 1:
|
||||
return '入库'
|
||||
case 2:
|
||||
return '出库'
|
||||
case 3:
|
||||
return '盘点'
|
||||
case 9:
|
||||
return '移库'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
dueFormat: (row, column, cellValue, index) => {
|
||||
return dueFormatter(cellValue)
|
||||
},
|
||||
search() {
|
||||
this.loading = true
|
||||
const tableRequest = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
taskType: this.taskTypeQuery == -99 ? null : this.taskTypeQuery,
|
||||
taskStatus: this.taskStatusQuery == -99 ? null : this.taskStatusQuery,
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
vehicleId: this.vehicleIdQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getTasksByPage(tableRequest).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.tasks = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
console.log(this.tasks)
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询任务错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
reset() {
|
||||
this.goodsIdQuery = ''
|
||||
this.vehicleIdQuery = ''
|
||||
},
|
||||
editCurrentRowTask(row) {
|
||||
console.log(row)
|
||||
// if (row.taskType == 1) {
|
||||
// this.availableLocationOptions = []
|
||||
// var currentOption = {
|
||||
// value: row.destination,
|
||||
// label: locationFormatter(row.destination)
|
||||
// }
|
||||
// this.availableLocationOptions.push(currentOption)
|
||||
// // 生成可用库位列表
|
||||
// const requestParam = {
|
||||
// areaId: 1
|
||||
// }
|
||||
// getAvailableLocations(requestParam).then(res => {
|
||||
// if (res.data.code == 0) {
|
||||
// for (const location of res.data.returnData) {
|
||||
// var newOption = {}
|
||||
// newOption.value = location.locationId
|
||||
// newOption.label = locationFormatter(location.locationId)
|
||||
// this.availableLocationOptions.push(newOption)
|
||||
// }
|
||||
// }
|
||||
// }).catch(err => {
|
||||
// errorBox('查找可用库位失败:' + err)
|
||||
// })
|
||||
// }
|
||||
this.taskFormEntity = {
|
||||
taskId: row.taskId,
|
||||
taskPriority: row.taskPriority,
|
||||
vehicleId: row.vehicleId,
|
||||
goodsId: row.goodsRelated == null ? '' : row.goodsRelated.goodsId,
|
||||
origin: row.origin,
|
||||
destination: row.destination,
|
||||
taskType: row.taskType,
|
||||
taskStatus: row.taskStatus,
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submitTaskInfo() {
|
||||
if (this.taskFormEntity.taskStatus == null || this.taskFormEntity.taskStatus == undefined) {
|
||||
errorBox('请选择任务状态')
|
||||
return
|
||||
}
|
||||
const request = {
|
||||
taskId: this.taskFormEntity.taskId,
|
||||
taskStatus: this.taskFormEntity.taskStatus,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateTaskInfo(request).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('修改任务成功')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('修改任务失败')
|
||||
})
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.taskId = row.taskId
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
margin: auto;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -3,13 +3,13 @@
|
|||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="workOrderQuery" style="width: 158px; margin-right: 10px;" placeholder="工单号"
|
||||
<el-input v-model="workOrderQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="工单号"
|
||||
:suffix-icon="Search"/>
|
||||
<el-input v-model="workCenterQuery" style="width: 158px; margin-right: 10px;" placeholder="工位/小盒子"
|
||||
<el-input v-model="workCenterQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="工位/小盒子"
|
||||
:suffix-icon="Search"/>
|
||||
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号"
|
||||
:suffix-icon="Search"/>
|
||||
<el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px;" placeholder="站台号"
|
||||
<el-input v-model="goodsIdQuery" type="textarea" :rows="1" style="width: 158px; margin-right: 10px; height: 32px;"
|
||||
placeholder="请输入料号,多个料号请换行输入" class="goods-id-textarea" />
|
||||
<el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="站台号"
|
||||
:suffix-icon="Search"/>
|
||||
<el-select-v2 v-model="lightStatusQuery" style="width: 158px; margin-right: 10px;"
|
||||
placeholder="请选择灯光状态" :options="lightStatusOptions" @change="search()"></el-select-v2>
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
||||
<el-button style="background-color: #00CED1; color: #000;"
|
||||
@click="openUploadDialog()">导入
|
||||
</el-button>
|
||||
|
|
@ -43,6 +44,7 @@
|
|||
<el-table-column prop="goodsId" label="料号" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="needNum" label="需求数量" min-width="120px"/>
|
||||
<el-table-column prop="pickedNum" label="已拣数量" min-width="120px"/>
|
||||
<el-table-column prop="distributedNum" label="已分配数量" min-width="120px"/>
|
||||
<el-table-column prop="lightStatus" label="亮灯状态" :formatter="lightStatusFormat" min-width="120px"/>
|
||||
<el-table-column prop="workStatus" label="工作状态" :formatter="workStatusFormat" min-width="120px"/>
|
||||
<el-table-column prop="machineType" label="机型" :formatter="machineTypeFormat" min-width="120px"/>
|
||||
|
|
@ -51,7 +53,7 @@
|
|||
show-overflow-tooltip/>
|
||||
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="opUser" label="操作用户" min-width="120px"/>
|
||||
<el-table-column prop="opUser" label="操作用户" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
|
||||
|
|
@ -121,7 +123,7 @@
|
|||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="任务状态" prop="lightStatus">
|
||||
<el-form-item label="亮灯状态" prop="lightStatus">
|
||||
<el-select-v2 v-model="workFlowFormEntity.lightStatus" placeholder="请选择亮灯状态"
|
||||
:options="lightStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
|
|
@ -151,6 +153,13 @@
|
|||
<el-input v-model="workFlowFormEntity.opUser" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="已分配数量" prop="distributedNum">
|
||||
<el-input-number v-model.number="workFlowFormEntity.distributedNum"
|
||||
controls-position="right" :min="0" :max="workFlowFormEntity.needNum"
|
||||
clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
|
@ -203,7 +212,7 @@ import {ref, reactive} from 'vue'
|
|||
import {dateFormatter, timeFormatter} from '@/utils/formatter.js'
|
||||
import {Search} from '@element-plus/icons-vue'
|
||||
import UploadExcelWorkFlow from '@/excel/UploadExcelWorkFlow.vue'
|
||||
import {queryUploadRecord} from '@/api/excel.js'
|
||||
import {queryUploadRecord, downloadWorkFlowExcel} from '@/api/excel.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
<script>
|
||||
|
|
@ -303,7 +312,7 @@ export default {
|
|||
workStation: this.standIdQuery.trim(),
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
workCenter: this.workCenterQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim().split('\n').filter(id => id.trim() !== '').join(','),
|
||||
lightStatus: this.lightStatusQuery == -99 ? null : this.lightStatusQuery,
|
||||
workStatus: this.workStatusQuery == -99 ? null : this.workStatusQuery,
|
||||
machineType: this.machineTypeQuery == -99 ? null : this.machineTypeQuery,
|
||||
|
|
@ -343,6 +352,8 @@ export default {
|
|||
},
|
||||
workStatusFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case -1:
|
||||
return '暂存'
|
||||
case 0:
|
||||
return '未开始'
|
||||
case 1:
|
||||
|
|
@ -381,6 +392,7 @@ export default {
|
|||
goodsId: row.goodsId,
|
||||
pickedNum: row.pickedNum,
|
||||
needNum: row.needNum,
|
||||
distributedNum: row.distributedNum,
|
||||
lightStatus: row.lightStatus,
|
||||
workStatus: row.workStatus,
|
||||
createTime: row.createTime,
|
||||
|
|
@ -393,6 +405,7 @@ export default {
|
|||
const params = {
|
||||
workFlowId: formData.workFlowId,
|
||||
pickedNum: formData.pickedNum,
|
||||
distributedNum: formData.distributedNum,
|
||||
lightStatus: formData.lightStatus,
|
||||
workStatus: formData.workStatus,
|
||||
userName: store.getters.getUserName
|
||||
|
|
@ -445,6 +458,41 @@ export default {
|
|||
})
|
||||
this.uploadDialogVisible = true
|
||||
},
|
||||
exportExcel() {
|
||||
const request = {
|
||||
workStation: this.standIdQuery.trim(),
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
workCenter: this.workCenterQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim().split('\n').filter(id => id.trim() !== '').join(','),
|
||||
lightStatus: this.lightStatusQuery == -99 ? null : this.lightStatusQuery,
|
||||
workStatus: this.workStatusQuery == -99 ? null : this.workStatusQuery,
|
||||
machineType: this.machineTypeQuery == -99 ? null : this.machineTypeQuery,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
downloadWorkFlowExcel(request).then(res => {
|
||||
const link = document.createElement('a');//创建a标签
|
||||
try {
|
||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||
let _fileName = "工作流报表" + dateFormatter(new Date) + ".xlsx"
|
||||
link.style.display = 'none'//隐藏
|
||||
|
||||
// 兼容不同浏览器的URL对象
|
||||
const url = window.URL || window.webkitURL || window.moxURL
|
||||
link.href = url.createObjectURL(blob)
|
||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
url.revokeObjectURL(link.href)//移除url对象
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
errorBox('下载文件失败')
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('导出失败')
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
@ -494,4 +542,28 @@ export default {
|
|||
flex-direction: column;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/* 专门为料号文本域添加样式 */
|
||||
.goods-id-textarea {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.goods-id-textarea :deep(.el-textarea__inner) {
|
||||
font-size: 12px;
|
||||
line-height: 1.2;
|
||||
padding: 5px;
|
||||
height: 32px !important;
|
||||
min-height: 32px !important;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
/* 确保其他输入框保持一致的高度 */
|
||||
.el-input {
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.el-input :deep(.el-input__wrapper) {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -3,13 +3,13 @@
|
|||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="workOrderQuery" style="width: 158px; margin-right: 10px;" placeholder="工单号"
|
||||
<el-input v-model="workOrderQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="工单号"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="workCenterQuery" style="width: 158px; margin-right: 10px;" placeholder="工位/小盒子"
|
||||
<el-input v-model="workCenterQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="工位/小盒子"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px;" placeholder="站台号"
|
||||
<el-input v-model="goodsIdQuery" type="textarea" :rows="1" style="width: 158px; margin-right: 10px; height: 32px;"
|
||||
placeholder="请输入料号,多个料号请换行输入" class="goods-id-textarea" />
|
||||
<el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="站台号"
|
||||
:suffix-icon="Search" />
|
||||
<el-date-picker v-model="workDateQuery" type="date" placeholder="工作起始日期" :shortcuts="shortcuts"
|
||||
style="width: 158px; margin-right: 10px;" clearable />
|
||||
|
|
@ -129,7 +129,7 @@ export default {
|
|||
workStation: this.standIdQuery.trim(),
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
workCenter: this.workCenterQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim().split('\n').filter(id => id.trim() !== '').join(','),
|
||||
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
|
||||
workDate: timeFormatter(this.workDateQuery),
|
||||
workEndDate: timeFormatter(this.workEndDateQuery),
|
||||
|
|
@ -193,10 +193,10 @@ export default {
|
|||
workStation: this.standIdQuery.trim(),
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
workCenter: this.workCenterQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim().split('\n').filter(id => id.trim() !== '').join(','),
|
||||
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
|
||||
workDate: timeFormatter(this.workDateQuery),
|
||||
workEndDate: timeFormatter(this.workEndDateQuery),
|
||||
workEndDate: timeFormatter(this.workEndDateQuery),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
downloadWorkSummaryExcel(request).then(res => {
|
||||
|
|
@ -274,4 +274,33 @@ export default {
|
|||
flex-direction: column;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/* 专门为料号文本域添加样式 */
|
||||
.goods-id-container {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.goods-id-textarea {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.goods-id-textarea :deep(.el-textarea__inner) {
|
||||
font-size: 12px;
|
||||
line-height: 1.2;
|
||||
padding: 5px;
|
||||
height: 32px !important;
|
||||
min-height: 32px !important;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
/* 确保其他输入框保持一致的高度 */
|
||||
.el-input {
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.el-input :deep(.el-input__wrapper) {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,28 +1,28 @@
|
|||
<template>
|
||||
<body id="login-page">
|
||||
<el-form class="login-container" :model="loginForm" label-position="left" label-width="0px">
|
||||
<h3 class="login_title">系统登录</h3>
|
||||
<el-form-item>
|
||||
<el-input type="text" v-model="loginForm.loginAccount" auto-complete="off" placeholder="账号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input type="password" v-model="loginForm.loginPassword" auto-complete="off" placeholder="密码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 100%">
|
||||
<el-button type="primary" style="width: 100%; border: none" @click="login">登录</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 100%">
|
||||
<el-button type="primary" style="width: 100%; border: none" @click="loginCate">卡特账号登录</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</body>
|
||||
<body id="login-page">
|
||||
<el-form class="login-container" :model="loginForm" label-position="left" label-width="0px">
|
||||
<h3 class="login_title">系统登录</h3>
|
||||
<el-form-item>
|
||||
<el-input type="text" v-model="loginForm.loginAccount" auto-complete="off" placeholder="账号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input type="password" v-model="loginForm.loginPassword" auto-complete="off" placeholder="密码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 100%">
|
||||
<el-button type="primary" style="width: 100%; border: none" @click="login">登录</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 100%">
|
||||
<el-button type="primary" style="width: 100%; border: none" @click="loginCate">卡特账号登录</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</body>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getUser, loginWithAuth, loginWithoutAuth } from '@/api/login.js'
|
||||
import { postToGetToken } from "@/api/kateLogin.js";
|
||||
import { ElMessage, ElLoading } from 'element-plus'
|
||||
import { reactive, onMounted } from 'vue';
|
||||
import {getUser, loginWithAuth, loginWithoutAuth} from '@/api/login.js'
|
||||
import {postToGetToken} from "@/api/kateLogin.js";
|
||||
import {ElMessage, ElLoading} from 'element-plus'
|
||||
import {reactive, onMounted} from 'vue';
|
||||
import store from '@/store'
|
||||
import router from '@/router'
|
||||
import crypto from 'crypto'
|
||||
|
|
@ -30,35 +30,37 @@ import loading from "@/utils/loading";
|
|||
// Dependency: Node.js crypto module
|
||||
// https://nodejs.org/api/crypto.html#crypto_crypto
|
||||
function base64URLEncode(str) {
|
||||
return str.toString('base64')
|
||||
.replace(/\+/g, '-')
|
||||
.replace(/\//g, '_')
|
||||
.replace(/=/g, '');
|
||||
return str.toString('base64')
|
||||
.replace(/\+/g, '-')
|
||||
.replace(/\//g, '_')
|
||||
.replace(/=/g, '');
|
||||
}
|
||||
|
||||
var verifier = base64URLEncode(crypto.randomBytes(32));
|
||||
// Dependency: Node.js crypto module
|
||||
// https://nodejs.org/api/crypto.html#crypto_crypto
|
||||
function sha256(buffer) {
|
||||
return crypto.createHash('sha256').update(buffer).digest();
|
||||
return crypto.createHash('sha256').update(buffer).digest();
|
||||
}
|
||||
|
||||
var challenge = base64URLEncode(sha256(verifier));
|
||||
|
||||
const loginForm = reactive({
|
||||
loginAccount: "",
|
||||
loginPassword: "",
|
||||
loginAccount: "",
|
||||
loginPassword: "",
|
||||
})
|
||||
// todo 参数待设置
|
||||
const oauthConstants = {
|
||||
client_id: 'f921b5f5-ba70-4bcb-8a4b-f3c7d90ec84e',// 客户端id,卡特提供
|
||||
// client_id: 'ASRS_ac_client',
|
||||
response_type: 'code',// 授权类型,固定为code
|
||||
state: '001',// 客户端当前状态,任意值
|
||||
scope: 'openid%20profile',// 权限范围,固定为openid
|
||||
grant_type: 'authorization_code',
|
||||
code_challenge: challenge,
|
||||
code_challenge_method: 'S256',
|
||||
// response_mode: "form_post",
|
||||
redirect_uri: 'https://csclasrs.ecorp.cat.com/wms'
|
||||
client_id: 'f921b5f5-ba70-4bcb-8a4b-f3c7d90ec84e',// 客户端id,卡特提供
|
||||
// client_id: 'ASRS_ac_client',
|
||||
response_type: 'code',// 授权类型,固定为code
|
||||
state: '001',// 客户端当前状态,任意值
|
||||
scope: 'openid%20profile',// 权限范围,固定为openid
|
||||
grant_type: 'authorization_code',
|
||||
code_challenge: challenge,
|
||||
code_challenge_method: 'S256',
|
||||
// response_mode: "form_post",
|
||||
redirect_uri: 'https://csclasrs.ecorp.cat.com/wms'
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -66,108 +68,112 @@ const oauthConstants = {
|
|||
const cateLoginUrl = `https://login.microsoftonline.com/caterpillar.onmicrosoft.com/oauth2/v2.0/authorize?client_id=${oauthConstants.client_id}&response_type=${oauthConstants.response_type}&code_challenge=${oauthConstants.code_challenge}&code_challenge_method=S256&grant_type=${oauthConstants.grant_type}&scope=${oauthConstants.scope}&state=${oauthConstants.state}&redirect_uri=${oauthConstants.redirect_uri}`
|
||||
// 登录
|
||||
const login = () => {
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
})
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
})
|
||||
loginWithAuth(loginForm).then(res => {
|
||||
loading.close()
|
||||
if (res.data.code === 0) {
|
||||
store.commit('mutationUser', res.data.returnData.user)// 用户信息
|
||||
store.commit('mutationMenu', res.data.returnData.menuList)// 菜单信息
|
||||
store.commit('mutationStandId', res.data.returnData.standId)
|
||||
// router.replace({ path: '/' })// 直接跳转到主页
|
||||
router.replace({ path: '/systemCenter' })// 跳转到系统选择的界面
|
||||
} else {
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
loading.close()
|
||||
ElMessage.error('登录失败!')
|
||||
})
|
||||
loading.close()
|
||||
if (res.data.code === 0) {
|
||||
store.commit('mutationUser', res.data.returnData.user)// 用户信息
|
||||
store.commit('mutationMenu', res.data.returnData.menuList)// 菜单信息
|
||||
store.commit('mutationStandId', res.data.returnData.standId)
|
||||
// router.replace({ path: '/' })// 直接跳转到主页
|
||||
router.replace({path: '/systemCenter'})// 跳转到系统选择的界面
|
||||
} else {
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
loading.close()
|
||||
ElMessage.error('登录失败!')
|
||||
})
|
||||
}
|
||||
|
||||
// 跳转卡特登录接口
|
||||
const loginCate = () => {
|
||||
store.commit('mutationAddVerify', verifier)// 添加认证信息
|
||||
// console.log(cateLoginUrl)
|
||||
window.location.href = cateLoginUrl// 打开新窗口
|
||||
// window.open(cateLoginUrl)// 不打开新窗口
|
||||
store.commit('mutationAddVerify', verifier)// 添加认证信息
|
||||
// console.log(cateLoginUrl)
|
||||
window.location.href = cateLoginUrl// 打开新窗口
|
||||
// window.open(cateLoginUrl)// 不打开新窗口
|
||||
}
|
||||
onMounted(() => {
|
||||
if (router.currentRoute.value.query.code !== undefined) {
|
||||
loading.open('请求登录中...')
|
||||
const tokenParam = {
|
||||
code_verifier: store.getters.getVerify,
|
||||
client_id: '609f8296-74ab-441e-904f-3a8508030511',
|
||||
// scope: 'openid',
|
||||
code: router.currentRoute.value.query.code,
|
||||
redirect_uri: 'https://csclasrs.ecorp.cat.com/wms',
|
||||
grant_type: 'authorization_code',
|
||||
// client_secret: 'o6h8Q~iLegnIBG.GzJngXk.03FYdBJzIoCtTtcwj',
|
||||
// response_type: 'id_token',
|
||||
// response_mode: 'form_post'
|
||||
}
|
||||
postToGetToken(tokenParam).then(res => {
|
||||
store.commit('mutationClearVerify', verifier)// 删除认证信息
|
||||
if (res.data.id_token !== undefined) {
|
||||
const codeInfo = {
|
||||
id_token: res.data.id_token
|
||||
}
|
||||
getUser(codeInfo).then(res => {
|
||||
if (res.data.code === 0) {
|
||||
store.commit('mutationUser', res.data.returnData.user)// 用户信息
|
||||
store.commit('mutationMenu', res.data.returnData.menuList)// 菜单信息
|
||||
store.commit('mutationStandId', res.data.returnData.standId)
|
||||
router.replace({ path: '/systemCenter' })
|
||||
} else {
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('登录失败!')
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('登录错误')
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const code = urlParams.get('code');
|
||||
console.log(code); // 输出 ?code= 后面的值
|
||||
if (code !== undefined && code !== null && code !== '') {
|
||||
console.log('跳转并尝试登录。code:' + code)
|
||||
loading.open('请求登录中...')
|
||||
const tokenParam = {
|
||||
code_verifier: store.getters.getVerify,
|
||||
client_id: 'f921b5f5-ba70-4bcb-8a4b-f3c7d90ec84e',
|
||||
// scope: 'openid',
|
||||
code: code,
|
||||
redirect_uri: 'https://csclasrs.ecorp.cat.com/wms',
|
||||
grant_type: 'authorization_code',
|
||||
// client_secret: 'o6h8Q~iLegnIBG.GzJngXk.03FYdBJzIoCtTtcwj',
|
||||
// response_type: 'id_token',
|
||||
// response_mode: 'form_post'
|
||||
}
|
||||
postToGetToken(tokenParam).then(res => {
|
||||
store.commit('mutationClearVerify', verifier)// 删除认证信息
|
||||
if (res.data.id_token !== undefined) {
|
||||
const codeInfo = {
|
||||
id_token: res.data.id_token
|
||||
}
|
||||
getUser(codeInfo).then(res => {
|
||||
if (res.data.code === 0) {
|
||||
store.commit('mutationUser', res.data.returnData.user)// 用户信息
|
||||
store.commit('mutationMenu', res.data.returnData.menuList)// 菜单信息
|
||||
store.commit('mutationStandId', res.data.returnData.standId)
|
||||
router.replace({path: '/systemCenter'})
|
||||
} else {
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('登录失败!')
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('登录错误')
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
#login-page {
|
||||
/* background: url("../assets/img/bg.jpg") no-repeat; */
|
||||
background-position: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-size: cover;
|
||||
position: fixed;
|
||||
/* background: url("../assets/img/bg.jpg") no-repeat; */
|
||||
background-position: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-size: cover;
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.login-container {
|
||||
border-radius: 15px;
|
||||
background-clip: padding-box;
|
||||
margin: 90px auto;
|
||||
width: 350px;
|
||||
padding: 35px 35px 15px 35px;
|
||||
background: #fff;
|
||||
border: 1px solid #eaeaea;
|
||||
box-shadow: 0 0 25px #cac6c6;
|
||||
border-radius: 15px;
|
||||
background-clip: padding-box;
|
||||
margin: 90px auto;
|
||||
width: 350px;
|
||||
padding: 35px 35px 15px 35px;
|
||||
background: #fff;
|
||||
border: 1px solid #eaeaea;
|
||||
box-shadow: 0 0 25px #cac6c6;
|
||||
}
|
||||
|
||||
.login_title {
|
||||
margin: 0px auto 40px auto;
|
||||
text-align: center;
|
||||
color: #505458;
|
||||
margin: 0px auto 40px auto;
|
||||
text-align: center;
|
||||
color: #505458;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user