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