newCreateAndDistribute #2
|
|
@ -104,7 +104,6 @@ export default {
|
|||
standId: store.getters.getStandId,
|
||||
displayGoods: false,// 是否显示料号输入
|
||||
// displayVehicleType1Selection: false,// 是否显示料箱类型选择
|
||||
// timer: '',
|
||||
labelPosition: 'top',
|
||||
workFormRef: ref(),
|
||||
workFormEntity: reactive({
|
||||
|
|
@ -131,21 +130,9 @@ export default {
|
|||
]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// this.timer = setInterval(() => {
|
||||
// // this.getAllTasks()
|
||||
// }, 2000)
|
||||
},
|
||||
beforeUnmount() {
|
||||
// clearInterval(this.timer)
|
||||
},
|
||||
methods: {
|
||||
vehicleType2ChangeHandle() {
|
||||
if (this.workFormEntity.vehicleType2 == '间接物料') {
|
||||
this.displayGoods = true
|
||||
} else {
|
||||
this.displayGoods = false
|
||||
}
|
||||
this.displayGoods = this.workFormEntity.vehicleType2 === '间接物料';
|
||||
},
|
||||
resetForms() {
|
||||
this.workFormEntity = reactive({
|
||||
|
|
@ -156,7 +143,7 @@ export default {
|
|||
})
|
||||
},
|
||||
confirmTask() {
|
||||
if (this.workFormEntity.vehicleType2 == '') {
|
||||
if (this.workFormEntity.vehicleType2 === '') {
|
||||
errorBox('请选择物料种类')
|
||||
return
|
||||
}
|
||||
|
|
@ -173,7 +160,7 @@ export default {
|
|||
}
|
||||
callEmptyVehicle(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
if (response.code === 0) {
|
||||
ElMessage.success(response.message)
|
||||
this.resetForms()
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@
|
|||
<el-row>
|
||||
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号"
|
||||
:suffix-icon="Search"/>
|
||||
<el-select-v2 v-model="vehicleTypeQuery" style="width: 158px; margin-right: 10px;"
|
||||
placeholder="物料类型" :options="vehicleTypeOptions" @change="search()"></el-select-v2>
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
<!-- <el-button type="warning" style="width: 201px; background-color: red; color: #000;" @click="setIndirect()">一键设置间接物料相关信息</el-button> -->
|
||||
|
|
@ -248,6 +250,7 @@ export default {
|
|||
pageSize: 10,
|
||||
total: 0,
|
||||
goodsIdQuery: '',
|
||||
vehicleTypeQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
uploadDialogVisible: false,
|
||||
|
|
@ -255,7 +258,21 @@ export default {
|
|||
goodsFormEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
goodsFormRef: ref(),
|
||||
rules: reactive({})
|
||||
rules: reactive({}),
|
||||
vehicleTypeOptions: [
|
||||
{
|
||||
value: "",
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: "直接物料",
|
||||
label: '直接物料'
|
||||
},
|
||||
{
|
||||
value: "间接物料",
|
||||
label: '间接物料'
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -282,6 +299,7 @@ export default {
|
|||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
goodsType: this.vehicleTypeQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getGoodsInfoByPage(request).then(res => {
|
||||
|
|
|
|||
|
|
@ -1,406 +1,432 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="workOrderQuery" style="width: 256px; margin-right: 10px;" placeholder="工单"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="smallBoxQuery" style="width: 256px; margin-right: 10px;" placeholder="小工位"
|
||||
:suffix-icon="Search" />
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button style="background-color: #00CED1; color: #000;"
|
||||
@click="openUploadDialog()">导入</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="ordersList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="workOrderQuery" style="width: 256px; margin-right: 10px;" placeholder="工单"
|
||||
:suffix-icon="Search"/>
|
||||
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号"
|
||||
:suffix-icon="Search"/>
|
||||
<el-input v-model="smallBoxQuery" style="width: 256px; margin-right: 10px;" placeholder="小工位"
|
||||
:suffix-icon="Search"/>
|
||||
<el-date-picker v-model="planStartDateQuery" type="date" placeholder="计划开工日期" :shortcuts="shortcuts"
|
||||
style="width: 158px; margin-right: 10px;" clearable />
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button style="background-color: #00CED1; color: #000;"
|
||||
@click="openUploadDialog()">导入
|
||||
</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br/>
|
||||
<el-table :data="ordersList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.orderId" v-model="orderId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="workOrder" label="工单" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsId" label="料号" min-width="120px" />
|
||||
<el-table-column prop="supplyArea" label="小工位" fixed="left" min-width="120px" />
|
||||
<el-table-column prop="item" label="Item" min-width="120px" />
|
||||
<el-table-column prop="description" label="描述" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="sLoc" label="SLoc" min-width="120px" />
|
||||
<el-table-column prop="type" label="Type" min-width="120px" />
|
||||
<el-table-column prop="originStatus" label="Status" min-width="120px" />
|
||||
<el-table-column prop="sortString" label="SortStrng" min-width="120px" />
|
||||
<el-table-column prop="requirementQuantity" label="需求数量" sortable min-width="120px" />
|
||||
<el-table-column prop="goodsUnit" label="单位" min-width="120px" />
|
||||
<el-table-column v-if="isAddReqmtDate" prop="planStartDate" label="开工时间" min-width="120px" />
|
||||
<el-table-column prop="orderStatus" label="状态" min-width="120px" />
|
||||
<el-table-column prop="lackQuantity" label="缺少数量" min-width="120px" />
|
||||
<el-table-column prop="pickedQuantity" label="已拣数量" min-width="120px" />
|
||||
<el-table-column prop="finishTime" label="计划完成时间" :formatter="timeFormat" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="userName" label="操作人员" min-width="120px" />
|
||||
<el-table-column fixed="right" label="操作" width="240px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowOrders(scope.row)">编辑</el-button>
|
||||
<el-button plain type="danger" @click="deleteCurrentRowOrders(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">
|
||||
<div
|
||||
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||
<el-form ref="ordersFormRef" :model="ordersFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="id" prop="orderId">
|
||||
<el-input v-model="ordersFormEntity.orderId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工单" prop="workOrder">
|
||||
<el-input v-model="ordersFormEntity.workOrder" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="小工位" prop="supplyArea">
|
||||
<el-input v-model="ordersFormEntity.supplyArea" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="料号" prop="goodsId">
|
||||
<el-input v-model="ordersFormEntity.goodsId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="需求数量" prop="requirementQuantity">
|
||||
<el-input-number v-model.number="ordersFormEntity.requirementQuantity"
|
||||
controls-position="right" :min="0" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态" prop="orderStatus">
|
||||
<el-input-number v-model.number="ordersFormEntity.orderStatus"
|
||||
controls-position="right" :min="0" :max="4" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="缺少数量" prop="lackQuantity">
|
||||
<el-input-number v-model.number="ordersFormEntity.lackQuantity"
|
||||
controls-position="right" :min="0" :max="ordersFormEntity.requirementQuantity" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="已拣数量" prop="pickedQuantity">
|
||||
<el-input-number v-model.number="ordersFormEntity.pickedQuantity"
|
||||
controls-position="right" :min="0" :max="ordersFormEntity.requirementQuantity" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="isAddReqmtDate" :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="计划开工时间" prop="planStartDate">
|
||||
<el-date-picker
|
||||
v-model="ordersFormEntity.planStartDate"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
style="width: 100%;"
|
||||
value-format="YYYY-MM-DD"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.orderId" v-model="orderId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderId" label="id" fixed="left" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="workOrder" label="工单" fixed="left" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="goodsId" label="料号" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="supplyArea" label="小工位" fixed="left" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="item" label="Item" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="description" label="描述" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="sLoc" label="SLoc" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="type" label="Type" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="originStatus" label="Status" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="sortString" label="SortStrng" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="requirementQuantity" label="需求数量" sortable min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="goodsUnit" label="单位" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="planStartDate" label="开工时间" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="orderStatus" label="状态" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="lackQuantity" label="缺少数量" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="pickedQuantity" 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="lastUpdateTime" label="最新更新时间" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="userName" label="操作人员" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="lastUpdateReason" label="来源" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column fixed="right" label="操作" width="240px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowOrders(scope.row)">编辑</el-button>
|
||||
<el-button plain type="danger" @click="deleteCurrentRowOrders(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">
|
||||
<div
|
||||
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||
<el-form ref="ordersFormRef" :model="ordersFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="id" prop="orderId">
|
||||
<el-input v-model="ordersFormEntity.orderId" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工单" prop="workOrder">
|
||||
<el-input v-model="ordersFormEntity.workOrder" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="小工位" prop="supplyArea">
|
||||
<el-input v-model="ordersFormEntity.supplyArea" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="料号" prop="goodsId">
|
||||
<el-input v-model="ordersFormEntity.goodsId" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="需求数量" prop="requirementQuantity">
|
||||
<el-input-number v-model.number="ordersFormEntity.requirementQuantity"
|
||||
controls-position="right" :min="0" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态" prop="orderStatus">
|
||||
<el-input-number v-model.number="ordersFormEntity.orderStatus"
|
||||
controls-position="right" :min="0" :max="4" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="缺少数量" prop="lackQuantity">
|
||||
<el-input-number v-model.number="ordersFormEntity.lackQuantity"
|
||||
controls-position="right" :min="0" :max="ordersFormEntity.requirementQuantity"
|
||||
clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="已拣数量" prop="pickedQuantity">
|
||||
<el-input-number v-model.number="ordersFormEntity.pickedQuantity"
|
||||
controls-position="right" :min="0" :max="ordersFormEntity.requirementQuantity"
|
||||
clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="计划开工时间" prop="planStartDate">
|
||||
<el-date-picker
|
||||
v-model="ordersFormEntity.planStartDate"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
style="width: 100%;"
|
||||
value-format="YYYY-MM-DD"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitOrdersInfo(ordersFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="uploadDialogVisible" title="工单" width="40%" draggable :show-close="true">
|
||||
<fieldset class="title-area">
|
||||
<legend>上次更新</legend>
|
||||
<div style="padding: 5px;">
|
||||
<div style="display: flex; margin-bottom: 10px;">
|
||||
<div style="display: flex; width: 100%;">
|
||||
<div style="width: 30%; align-content: center;">时间:</div>
|
||||
<el-input v-model="uploadRecord.uploadTime" readonly />
|
||||
</div>
|
||||
<div style="display: flex; width: 100%; margin-left: 5px;">
|
||||
<div style="width: 30%; align-content: center;">人员:</div>
|
||||
<el-input v-model="uploadRecord.uploadUser" readonly />
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; width: 100%;">
|
||||
<div style="width: 13%; align-content: center;">文件名:</div>
|
||||
<el-input type="textarea" :rows="1" v-model="uploadRecord.fileName" :maxlength="-1"
|
||||
:show-word-limit="false" :autosize="{ minRows: 1, maxRows: 4 }" readonly>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="title-area">
|
||||
<legend>再次更新</legend>
|
||||
<UploadExcelOrders></UploadExcelOrders>
|
||||
</fieldset>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="uploadDialogVisible" title="工单" width="40%" draggable :show-close="true">
|
||||
<fieldset class="title-area">
|
||||
<legend>上次更新</legend>
|
||||
<div style="padding: 5px;">
|
||||
<div style="display: flex; margin-bottom: 10px;">
|
||||
<div style="display: flex; width: 100%;">
|
||||
<div style="width: 30%; align-content: center;">时间:</div>
|
||||
<el-input v-model="uploadRecord.uploadTime" readonly/>
|
||||
</div>
|
||||
<div style="display: flex; width: 100%; margin-left: 5px;">
|
||||
<div style="width: 30%; align-content: center;">人员:</div>
|
||||
<el-input v-model="uploadRecord.uploadUser" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; width: 100%;">
|
||||
<div style="width: 13%; align-content: center;">文件名:</div>
|
||||
<el-input type="textarea" :rows="1" v-model="uploadRecord.fileName" :maxlength="-1"
|
||||
:show-word-limit="false" :autosize="{ minRows: 1, maxRows: 4 }" readonly>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="title-area">
|
||||
<legend>再次更新</legend>
|
||||
<UploadExcelOrders></UploadExcelOrders>
|
||||
</fieldset>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getOrders, deleteOrders, updateOrders } from '@/api/kateWork.js'
|
||||
import {getOrders, deleteOrders, updateOrders} from '@/api/kateWork.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import {ElMessageBox, ElMessage} from 'element-plus'
|
||||
import {errorBox} from '@/utils/myMessageBox.js'
|
||||
import {ref, reactive} from 'vue'
|
||||
import {dateFormatter, timeFormatter} from '@/utils/formatter.js'
|
||||
import UploadExcelOrders from '@/excel/UploadExcelOrders.vue'
|
||||
import { queryUploadRecord } from '@/api/excel.js'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import {queryUploadRecord} from '@/api/excel.js'
|
||||
import {Search} from '@element-plus/icons-vue'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'kateOrders',
|
||||
data() {
|
||||
return {
|
||||
ordersList: [],
|
||||
currentPage: 1,
|
||||
uploadRecord: reactive({
|
||||
fileName: '',
|
||||
uploadTime: '',
|
||||
uploadUser: ''
|
||||
}),
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
workOrderQuery: '',
|
||||
goodsIdQuery: '',
|
||||
smallBoxQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
uploadDialogVisible: false,
|
||||
orderId: '',
|
||||
ordersFormEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
ordersFormRef: ref(),
|
||||
rules: reactive({}),
|
||||
isAddReqmtDate: false
|
||||
name: 'kateOrders',
|
||||
data() {
|
||||
return {
|
||||
ordersList: [],
|
||||
currentPage: 1,
|
||||
uploadRecord: reactive({
|
||||
fileName: '',
|
||||
uploadTime: '',
|
||||
uploadUser: ''
|
||||
}),
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
workOrderQuery: '',
|
||||
goodsIdQuery: '',
|
||||
smallBoxQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
uploadDialogVisible: false,
|
||||
orderId: '',
|
||||
ordersFormEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
ordersFormRef: ref(),
|
||||
rules: reactive({}),
|
||||
shortcuts: [
|
||||
{
|
||||
text: '今天',
|
||||
value: new Date(),
|
||||
},
|
||||
{
|
||||
text: '昨天',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24)
|
||||
return date
|
||||
},
|
||||
},
|
||||
],
|
||||
planStartDateQuery: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
supplyArea: this.smallBoxQuery.trim(),
|
||||
planStartDate: dateFormatter(this.planStartDateQuery),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getOrders(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.ordersList = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询工单错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
supplyArea: this.smallBoxQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getOrders(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.ordersList = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询工单错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
reset() {
|
||||
this.workOrderQuery = ''
|
||||
this.goodsIdQuery = ''
|
||||
this.smallBoxQuery = ''
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
reset() {
|
||||
this.workOrderQuery = ''
|
||||
this.goodsIdQuery = ''
|
||||
this.smallBoxQuery = ''
|
||||
this.search()
|
||||
},
|
||||
editCurrentRowOrders(row) {
|
||||
this.orderId = row.orderId
|
||||
this.ordersFormEntity = {
|
||||
orderId: row.orderId,
|
||||
workOrder: row.workOrder,
|
||||
goodsId: row.goodsId,
|
||||
supplyArea: row.supplyArea,
|
||||
requirementQuantity: row.requirementQuantity,
|
||||
orderStatus: row.orderStatus,
|
||||
lackQuantity: row.lackQuantity,
|
||||
pickedQuantity: row.pickedQuantity,
|
||||
planStartDate: row.planStartDate
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
deleteCurrentRowOrders(row) {
|
||||
this.orderId = row.orderId
|
||||
ElMessageBox.confirm(
|
||||
'该操作会删除选择的工单数据。\n是否继续',
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
const params = {
|
||||
orderId: this.orderId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
deleteOrders(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage.success('删除工单信息成功。')
|
||||
this.search()
|
||||
},
|
||||
editCurrentRowOrders(row) {
|
||||
this.orderId = row.orderId
|
||||
this.ordersFormEntity = {
|
||||
orderId: row.orderId,
|
||||
workOrder: row.workOrder,
|
||||
goodsId: row.goodsId,
|
||||
supplyArea: row.supplyArea,
|
||||
requirementQuantity: row.requirementQuantity,
|
||||
orderStatus: row.orderStatus,
|
||||
lackQuantity: row.lackQuantity,
|
||||
pickedQuantity: row.pickedQuantity,
|
||||
planStartDate: row.planStartDate
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
deleteCurrentRowOrders(row) {
|
||||
this.orderId = row.orderId
|
||||
ElMessageBox.confirm(
|
||||
'该操作会删除选择的工单数据。\n是否继续',
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
const params = {
|
||||
orderId: this.orderId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
deleteOrders(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage.success('删除工单信息成功。')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('删除工单信息成功')
|
||||
})
|
||||
}).catch(() => {
|
||||
ElMessage.info('操作取消')
|
||||
})
|
||||
},
|
||||
submitOrdersInfo(formData) {
|
||||
const params = {
|
||||
orderId: formData.orderId,
|
||||
workOrder: formData.workOrder,
|
||||
goodsId: formData.goodsId,
|
||||
supplyArea: formData.supplyArea,
|
||||
requirementQuantity: formData.requirementQuantity,
|
||||
orderStatus: formData.orderStatus,
|
||||
lackQuantity: formData.lackQuantity,
|
||||
pickedQuantity: formData.pickedQuantity,
|
||||
planStartDate: formData.planStartDate,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateOrders(params).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.orderId = row.orderId
|
||||
},
|
||||
openUploadDialog() {
|
||||
// 请求上传记录
|
||||
const param = {
|
||||
userName: store.getters.getUserName,
|
||||
fileDescription: 'ORDERS',
|
||||
isAsc: false,
|
||||
sortBy: 'upload_time'
|
||||
}
|
||||
queryUploadRecord(param).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
if (res.data.returnData.total > 0) {
|
||||
this.uploadRecord = res.data.returnData.lists[0]
|
||||
} else {
|
||||
this.uploadRecord = reactive({
|
||||
fileName: '',
|
||||
uploadTime: '',
|
||||
uploadUser: ''
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.uploadRecord = reactive({
|
||||
fileName: '',
|
||||
uploadTime: '',
|
||||
uploadUser: ''
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('发生异常')
|
||||
})
|
||||
this.uploadDialogVisible = true
|
||||
},
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('删除工单信息成功')
|
||||
})
|
||||
}).catch(() => {
|
||||
ElMessage.info('操作取消')
|
||||
})
|
||||
},
|
||||
submitOrdersInfo(formData) {
|
||||
const params = {
|
||||
orderId: formData.orderId,
|
||||
workOrder: formData.workOrder,
|
||||
goodsId: formData.goodsId,
|
||||
supplyArea: formData.supplyArea,
|
||||
requirementQuantity: formData.requirementQuantity,
|
||||
orderStatus: formData.orderStatus,
|
||||
lackQuantity: formData.lackQuantity,
|
||||
pickedQuantity: formData.pickedQuantity,
|
||||
planStartDate: formData.planStartDate,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateOrders(params).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.orderId = row.orderId
|
||||
},
|
||||
openUploadDialog() {
|
||||
// 请求上传记录
|
||||
const param = {
|
||||
userName: store.getters.getUserName,
|
||||
fileDescription: 'ORDERS',
|
||||
isAsc: false,
|
||||
sortBy: 'upload_time'
|
||||
}
|
||||
queryUploadRecord(param).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
if (res.data.returnData.total > 0) {
|
||||
this.uploadRecord = res.data.returnData.lists[0]
|
||||
} else {
|
||||
this.uploadRecord = reactive({
|
||||
fileName: '',
|
||||
uploadTime: '',
|
||||
uploadUser: ''
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.uploadRecord = reactive({
|
||||
fileName: '',
|
||||
uploadTime: '',
|
||||
uploadUser: ''
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('发生异常')
|
||||
})
|
||||
this.uploadDialogVisible = true
|
||||
},
|
||||
},
|
||||
}
|
||||
</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 {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.title-area {
|
||||
display: flex;
|
||||
/* min-height: 10%; */
|
||||
max-height: max-content;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
/* min-height: 10%; */
|
||||
max-height: max-content;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,384 +1,395 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="queryKey" style="width: 158px; margin-right: 10px;" placeholder="箱号"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="locationQuery" style="width: 158px; margin-right: 10px;" placeholder="位置"
|
||||
:suffix-icon="Search" />
|
||||
<el-select-v2 v-model="isEmptyQuery" style="width: 158px; margin-right: 10px;" placeholder="是否空箱"
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="queryKey" style="width: 158px; margin-right: 10px;" placeholder="箱号"
|
||||
:suffix-icon="Search"/>
|
||||
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号"
|
||||
:suffix-icon="Search"/>
|
||||
<el-input v-model="locationQuery" style="width: 158px; margin-right: 10px;" placeholder="位置"
|
||||
:suffix-icon="Search"/>
|
||||
<el-select-v2 v-model="isEmptyQuery" style="width: 158px; margin-right: 10px;" placeholder="是否空箱"
|
||||
:options="isEmptyOptions" @change="search()"></el-select-v2>
|
||||
<el-select-v2 v-model="vehicleTypeQuery" style="width: 158px; margin-right: 10px;"
|
||||
<el-select-v2 v-model="vehicleTypeQuery" style="width: 158px; margin-right: 10px;"
|
||||
placeholder="物料类型" :options="vehicleTypeOptions" @change="search()"></el-select-v2>
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
<el-row v-if="selVehicle == null">
|
||||
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="vehicles" stripe border v-loading="loading" class="table-class" max-height="550px"
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
<el-row v-if="selVehicle == null">
|
||||
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br/>
|
||||
<el-table :data="vehicles" stripe border v-loading="loading" class="table-class" max-height="550px"
|
||||
highlight-current-row @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }" @sort-change="handleSortChange">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.vehicleId" v-model="vehicleId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="vehicleId" label="托盘号" fixed="left" min-width="120px" />
|
||||
<el-table-column prop="currentLocation" label="库位" fixed="left" :formatter="locationFormat"
|
||||
min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="vehicleStatus" label="状态" :formatter="vehicleStatusFormat" min-width="120px" />
|
||||
<el-table-column prop="isEmpty" label="空托" :formatter="isEmptyFormat" min-width="120px" />
|
||||
<el-table-column prop="lastInTime" label="最近入库时间" sortable="custom" :formatter="timeFormat"
|
||||
min-width="120px" />
|
||||
<el-table-column prop="vehicleType" label="物料类型" fixed="left" :formatter="vehicleTypeFormat"
|
||||
min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="details" label="绑定关系" :formatter="jsonFormat" min-width="180px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column fixed="right" label="操作" width="120px" v-if="selVehicle == null">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowVehicle(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="vehicleFormRef" :model="vehicleFormEntity" :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="vehicleId">
|
||||
<el-input v-model="vehicleFormEntity.vehicleId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="库位" prop="locationId">
|
||||
<el-input v-model="vehicleFormEntity.currentLocation" placeholder="请输入库位号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="空箱" prop="isEmpty">
|
||||
<el-select-v2 v-model="vehicleFormEntity.isEmpty" placeholder="请选择是否空托"
|
||||
:options="isEmptyOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态" prop="vehicleStatus">
|
||||
<el-select-v2 v-model="vehicleFormEntity.vehicleStatus" placeholder="请选择料箱状态"
|
||||
:options="vehicleStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="物料类型" prop="vehicleType">
|
||||
<el-select-v2 v-model="vehicleFormEntity.vehicleType" placeholder="选择物料类型"
|
||||
:options="vehicleTypeOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="绑定关系" prop="details">
|
||||
<el-input type="textarea" :rows="2" v-model="vehicleFormEntity.details" placeholder=""
|
||||
:maxlength="-1" :show-word-limit="false" :autosize="{ minRows: 2, maxRows: 4 }">
|
||||
</el-input>
|
||||
</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.vehicleId" v-model="vehicleId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="vehicleId" label="托盘号" fixed="left" min-width="120px"/>
|
||||
<el-table-column prop="currentLocation" label="库位" fixed="left" :formatter="locationFormat"
|
||||
min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="vehicleStatus" label="状态" :formatter="vehicleStatusFormat" min-width="120px"/>
|
||||
<el-table-column prop="isEmpty" label="空托" :formatter="isEmptyFormat" min-width="120px"/>
|
||||
<el-table-column prop="lastInTime" label="最近入库时间" sortable="custom" :formatter="timeFormat"
|
||||
min-width="120px"/>
|
||||
<el-table-column prop="vehicleType" label="物料类型" fixed="left" :formatter="vehicleTypeFormat"
|
||||
min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="goodsInfo" label="绑定关系" :formatter="jsonFormat" min-width="180px"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column fixed="right" label="操作" width="120px" v-if="selVehicle == null">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowVehicle(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="vehicleFormRef" :model="vehicleFormEntity" :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="vehicleId">
|
||||
<el-input v-model="vehicleFormEntity.vehicleId" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="库位" prop="locationId">
|
||||
<el-input v-model="vehicleFormEntity.currentLocation" placeholder="请输入库位号"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="空箱" prop="isEmpty">
|
||||
<el-select-v2 v-model="vehicleFormEntity.isEmpty" placeholder="请选择是否空托"
|
||||
:options="isEmptyOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态" prop="vehicleStatus">
|
||||
<el-select-v2 v-model="vehicleFormEntity.vehicleStatus" placeholder="请选择料箱状态"
|
||||
:options="vehicleStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="物料类型" prop="vehicleType">
|
||||
<el-select-v2 v-model="vehicleFormEntity.vehicleType" placeholder="选择物料类型"
|
||||
:options="vehicleTypeOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="绑定关系" prop="goodsInfo">
|
||||
<el-input type="textarea" :rows="2" v-model="vehicleFormEntity.goodsInfo" placeholder=""
|
||||
:maxlength="-1" :show-word-limit="false" :autosize="{ minRows: 2, maxRows: 4 }">
|
||||
</el-input>
|
||||
</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="submitVehicleInfo(vehicleFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getAllVehicles, updateVehicleInfo } from '@/api/vehicle'
|
||||
import {getAllVehicles, updateVehicleInfo} from '@/api/vehicle'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { vehicleStatusFormatter, locationFormatter, dateFormatter, timeFormatter, jsonFormatter } from '@/utils/formatter.js'
|
||||
import { toUnderScoreCase } from '@/utils/stringUtils.js'
|
||||
import {errorBox} from '@/utils/myMessageBox.js'
|
||||
import {ElMessage} from 'element-plus'
|
||||
import {Search} from '@element-plus/icons-vue'
|
||||
import {ref, reactive} from 'vue'
|
||||
import {
|
||||
vehicleStatusFormatter,
|
||||
locationFormatter,
|
||||
dateFormatter,
|
||||
timeFormatter,
|
||||
jsonFormatter
|
||||
} from '@/utils/formatter.js'
|
||||
import {toUnderScoreCase} from '@/utils/stringUtils.js'
|
||||
// import uploadVehicles from '@/excel/uploadVehicles.vue'
|
||||
import { downloadVehicleExcel } from '@/api/excel.js'
|
||||
import {downloadVehicleExcel} from '@/api/excel.js'
|
||||
import store from '@/store'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'vehicle',
|
||||
props: ['selVehicle'],
|
||||
emits: ['update:selVehicle'],
|
||||
data() {
|
||||
return {
|
||||
vehicles: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: '',
|
||||
isAsc: true,
|
||||
queryKey: '',
|
||||
locationQuery: '',
|
||||
isEmptyQuery: -99,
|
||||
vehicleTypeQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
vehicleId: '',
|
||||
vehicleFormEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
vehicleFormRef: ref(),
|
||||
rules: reactive({
|
||||
vehicleId: [
|
||||
{ required: true, message: '请输入箱号' }
|
||||
],
|
||||
currentLocation: [
|
||||
{ required: true, message: '请输入库位' }
|
||||
]
|
||||
}),
|
||||
// 是否空箱
|
||||
isEmptyOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '带料'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '空箱'
|
||||
}
|
||||
],
|
||||
vehicleTypeOptions: [
|
||||
{
|
||||
value: "",
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: "直接物料",
|
||||
label: '直接物料'
|
||||
},
|
||||
{
|
||||
value: "间接物料",
|
||||
label: '间接物料'
|
||||
}
|
||||
],
|
||||
// 料箱状态
|
||||
vehicleStatusOptions: [
|
||||
{
|
||||
value: 1,
|
||||
label: '入库中'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '在库中'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '出库中'
|
||||
},
|
||||
{
|
||||
value: 99,
|
||||
label: '异常'
|
||||
},
|
||||
]
|
||||
name: 'vehicle',
|
||||
props: ['selVehicle'],
|
||||
emits: ['update:selVehicle'],
|
||||
data() {
|
||||
return {
|
||||
vehicles: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: '',
|
||||
isAsc: true,
|
||||
queryKey: '',
|
||||
locationQuery: '',
|
||||
goodsIdQuery: '',
|
||||
isEmptyQuery: -99,
|
||||
vehicleTypeQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
vehicleId: '',
|
||||
vehicleFormEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
vehicleFormRef: ref(),
|
||||
rules: reactive({
|
||||
vehicleId: [
|
||||
{required: true, message: '请输入箱号'}
|
||||
],
|
||||
currentLocation: [
|
||||
{required: true, message: '请输入库位'}
|
||||
]
|
||||
}),
|
||||
// 是否空箱
|
||||
isEmptyOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '带料'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '空箱'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const tableRequest = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
sortBy: this.sortBy,
|
||||
isAsc: this.isAsc,
|
||||
vehicleId: this.queryKey.trim(),
|
||||
currentLocation: this.locationQuery.trim(),
|
||||
vehicleType: this.vehicleTypeQuery.trim(),
|
||||
isEmpty: this.isEmptyQuery == -99 ? null : this.isEmptyQuery,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getAllVehicles(tableRequest).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.vehicles = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询料箱信息错误')
|
||||
})
|
||||
this.loading = false
|
||||
],
|
||||
vehicleTypeOptions: [
|
||||
{
|
||||
value: "",
|
||||
label: '全部'
|
||||
},
|
||||
handleSortChange(data) {
|
||||
this.sortBy = toUnderScoreCase(data.prop)
|
||||
this.isAsc = data.order == 'ascending'
|
||||
this.search()
|
||||
{
|
||||
value: "直接物料",
|
||||
label: '直接物料'
|
||||
},
|
||||
vehicleStatusFormat: (row, column, cellValue, index) => {
|
||||
return vehicleStatusFormatter(cellValue)
|
||||
{
|
||||
value: "间接物料",
|
||||
label: '间接物料'
|
||||
}
|
||||
],
|
||||
// 料箱状态
|
||||
vehicleStatusOptions: [
|
||||
{
|
||||
value: 1,
|
||||
label: '入库中'
|
||||
},
|
||||
locationFormat: (row, column, cellValue, index) => {
|
||||
return locationFormatter(cellValue)
|
||||
{
|
||||
value: 2,
|
||||
label: '在库中'
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
{
|
||||
value: 3,
|
||||
label: '出库中'
|
||||
},
|
||||
vehicleTypeFormat: (row, column, cellValue, index) => {
|
||||
if (cellValue == "间接物料") {
|
||||
return '间接物料'
|
||||
} else {
|
||||
return '直接物料'
|
||||
}
|
||||
},
|
||||
isEmptyFormat: (row, column, cellValue, index) => {
|
||||
if (cellValue == 0) {
|
||||
return '带料'
|
||||
}
|
||||
if (cellValue == 1) {
|
||||
return '空箱'
|
||||
}
|
||||
},
|
||||
jsonFormat: (row, column, cellValue, index) => {
|
||||
return jsonFormatter(cellValue)
|
||||
},
|
||||
reset() {
|
||||
this.queryKey = ''
|
||||
this.locationQuery = ''
|
||||
this.search()
|
||||
},
|
||||
editCurrentRowVehicle(row) {
|
||||
this.vehicleFormEntity = {
|
||||
vehicleId: row.vehicleId,
|
||||
currentLocation: row.currentLocation,
|
||||
isEmpty: row.isEmpty,
|
||||
vehicleStatus: row.vehicleStatus,
|
||||
vehicleType: row.vehicleType == "间接物料" ? "间接物料" : "直接物料",
|
||||
details: jsonFormatter(row.details),
|
||||
lastInTime: row.lastInTime
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submitVehicleInfo(formData) {
|
||||
const request = {
|
||||
vehicleId: formData.vehicleId,
|
||||
currentLocation: formData.currentLocation,
|
||||
isEmpty: formData.isEmpty,
|
||||
vehicleStatus: formData.vehicleStatus,
|
||||
vehicleType: formData.vehicleType,
|
||||
details: formData.details,
|
||||
lastInTime: formData.lastInTime,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateVehicleInfo(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.vehicleId = row.vehicleId
|
||||
this.$emit('update:selVehicle', row)
|
||||
},
|
||||
exportExcel() {
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
vehicleId: this.queryKey.trim(),
|
||||
currentLocation: this.locationQuery.trim(),
|
||||
vehicleType: this.vehicleTypeQuery.trim(),
|
||||
isEmpty: this.isEmptyQuery == -99 ? null : this.isEmptyQuery,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
downloadVehicleExcel(request).then(res => {
|
||||
const link = document.createElement('a');//创建a标签
|
||||
try {
|
||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||
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('导出失败')
|
||||
})
|
||||
{
|
||||
value: 99,
|
||||
label: '异常'
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const tableRequest = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
sortBy: this.sortBy,
|
||||
isAsc: this.isAsc,
|
||||
vehicleId: this.queryKey.trim(),
|
||||
currentLocation: this.locationQuery.trim(),
|
||||
vehicleType: this.vehicleTypeQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
isEmpty: this.isEmptyQuery == -99 ? null : this.isEmptyQuery,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getAllVehicles(tableRequest).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.vehicles = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询料箱信息错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
handleSortChange(data) {
|
||||
this.sortBy = toUnderScoreCase(data.prop)
|
||||
this.isAsc = data.order == 'ascending'
|
||||
this.search()
|
||||
},
|
||||
vehicleStatusFormat: (row, column, cellValue, index) => {
|
||||
return vehicleStatusFormatter(cellValue)
|
||||
},
|
||||
locationFormat: (row, column, cellValue, index) => {
|
||||
return locationFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
vehicleTypeFormat: (row, column, cellValue, index) => {
|
||||
if (cellValue == "间接物料") {
|
||||
return '间接物料'
|
||||
} else {
|
||||
return '直接物料'
|
||||
}
|
||||
},
|
||||
isEmptyFormat: (row, column, cellValue, index) => {
|
||||
if (cellValue == 0) {
|
||||
return '带料'
|
||||
}
|
||||
if (cellValue == 1) {
|
||||
return '空箱'
|
||||
}
|
||||
},
|
||||
jsonFormat: (row, column, cellValue, index) => {
|
||||
console.log(cellValue)
|
||||
return jsonFormatter(cellValue)
|
||||
},
|
||||
reset() {
|
||||
this.queryKey = ''
|
||||
this.locationQuery = ''
|
||||
this.search()
|
||||
},
|
||||
editCurrentRowVehicle(row) {
|
||||
this.vehicleFormEntity = {
|
||||
vehicleId: row.vehicleId,
|
||||
currentLocation: row.currentLocation,
|
||||
isEmpty: row.isEmpty,
|
||||
vehicleStatus: row.vehicleStatus,
|
||||
vehicleType: row.vehicleType == "间接物料" ? "间接物料" : "直接物料",
|
||||
goodsInfo: jsonFormatter(row.goodsInfo),
|
||||
lastInTime: row.lastInTime
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submitVehicleInfo(formData) {
|
||||
const request = {
|
||||
vehicleId: formData.vehicleId,
|
||||
currentLocation: formData.currentLocation,
|
||||
isEmpty: formData.isEmpty,
|
||||
vehicleStatus: formData.vehicleStatus,
|
||||
vehicleType: formData.vehicleType,
|
||||
goodsInfo: formData.goodsInfo,
|
||||
lastInTime: formData.lastInTime,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateVehicleInfo(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.vehicleId = row.vehicleId
|
||||
this.$emit('update:selVehicle', row)
|
||||
},
|
||||
exportExcel() {
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
vehicleId: this.queryKey.trim(),
|
||||
currentLocation: this.locationQuery.trim(),
|
||||
vehicleType: this.vehicleTypeQuery.trim(),
|
||||
isEmpty: this.isEmptyQuery == -99 ? null : this.isEmptyQuery,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
downloadVehicleExcel(request).then(res => {
|
||||
const link = document.createElement('a');//创建a标签
|
||||
try {
|
||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||
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>
|
||||
|
||||
<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%;
|
||||
/* font-size: 5px; */
|
||||
width: 100%;
|
||||
/* font-size: 5px; */
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.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>
|
||||
Loading…
Reference in New Issue
Block a user