newCreateAndDistribute #2
|
|
@ -16,7 +16,25 @@ const updateStandInfo = (params) => {
|
|||
})
|
||||
}
|
||||
|
||||
const switchToCreate = (params) => {
|
||||
return request({
|
||||
url: '/stand/switchToCreate',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const switchToDistribute = (params) => {
|
||||
return request({
|
||||
url: '/stand/switchToDistribute',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
getStandsByPage,
|
||||
updateStandInfo
|
||||
updateStandInfo,
|
||||
switchToCreate,
|
||||
switchToDistribute
|
||||
}
|
||||
|
|
@ -13,6 +13,8 @@
|
|||
placeholder="是否允许平地机" :options="yesOrNoOptions" @change="search()"></el-select-v2>
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
<el-button style="width: 130px;" @click="switchCreate()">一键切换创建工作</el-button>
|
||||
<el-button style="width: 130px;" @click="switchDistribute()">一键切换分配工作</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br/>
|
||||
|
|
@ -156,6 +158,10 @@ import {Search} from '@element-plus/icons-vue'
|
|||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
<script>
|
||||
import {switchToCreate, switchToDistribute} from "@/api/stand";
|
||||
import myLoading from "@/utils/loading";
|
||||
import {successBox} from "@/utils/myMessageBox";
|
||||
|
||||
export default {
|
||||
name: 'standSettings',
|
||||
data() {
|
||||
|
|
@ -268,6 +274,46 @@ export default {
|
|||
})
|
||||
this.loading = false
|
||||
},
|
||||
switchCreate() {
|
||||
const request = {
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
myLoading.open('处理中,请稍等...')
|
||||
switchToCreate(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code === 0) {
|
||||
successBox(response.message)
|
||||
} else {
|
||||
errorBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('一键切换创建工作异常')
|
||||
}).finally(() => {
|
||||
myLoading.close()
|
||||
this.search()
|
||||
})
|
||||
},
|
||||
switchDistribute() {
|
||||
const request = {
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
myLoading.open('处理中,请稍等...')
|
||||
switchToDistribute(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code === 0) {
|
||||
successBox(response.message)
|
||||
} else {
|
||||
errorBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('一键切换分配工作异常')
|
||||
}).finally(() => {
|
||||
myLoading.close()
|
||||
this.search()
|
||||
})
|
||||
},
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
|
|
|
|||
366
src/layout/workDateTable.vue
Executable file
366
src/layout/workDateTable.vue
Executable file
|
|
@ -0,0 +1,366 @@
|
|||
<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-select-v2 v-model="sourceQuery" style="width: 158px; margin-right: 10px;"
|
||||
placeholder="请选择查询来源" :options="sourceOptions" @change="search()"></el-select-v2>
|
||||
<el-date-picker v-model="workDateQuery" 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="workDateList" 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.id" v-model="id"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="id" label="id" fixed="left" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="workDate" label="工作日" fixed="left" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="remark" label="备注" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column fixed="right" label="操作" width="240px">
|
||||
<template v-slot="scope">
|
||||
<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="workDateFormEntity" :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="工作日期" prop="workDate">
|
||||
<el-date-picker
|
||||
v-model="workDateFormEntity.workDate"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
style="width: 100%;"
|
||||
value-format="YYYY-MM-DD"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="料号" prop="remark">
|
||||
<el-input v-model="workDateFormEntity.remark" clearable />
|
||||
</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="submitAdd(workDateFormEntity)">
|
||||
确定
|
||||
</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>
|
||||
<UploadExcelWorkDate></UploadExcelWorkDate>
|
||||
</fieldset>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
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 UploadExcelOrders from '@/excel/UploadExcelOrders.vue'
|
||||
import {queryUploadRecord} from '@/api/excel.js'
|
||||
import {Search} from '@element-plus/icons-vue'
|
||||
import UploadExcelWorkDate from "@/excel/UploadExcelWorkDate.vue";
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'workDate',
|
||||
data() {
|
||||
return {
|
||||
workDateList: [],
|
||||
currentPage: 1,
|
||||
uploadRecord: reactive({
|
||||
fileName: '',
|
||||
uploadTime: '',
|
||||
uploadUser: ''
|
||||
}),
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sourceQuery: '',
|
||||
workDateQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
uploadDialogVisible: false,
|
||||
id: '',
|
||||
workDateFormEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
workDateFormRef: ref(),
|
||||
rules: reactive({}),
|
||||
shortcuts: [
|
||||
{
|
||||
text: '今天',
|
||||
value: new Date(),
|
||||
},
|
||||
{
|
||||
text: '昨天',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24)
|
||||
return date
|
||||
},
|
||||
},
|
||||
],
|
||||
sourceOptions: [
|
||||
{
|
||||
value: 1,
|
||||
label: '当前使用'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '数据库'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
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
|
||||
},
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
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()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('删除工单信息成功')
|
||||
})
|
||||
}).catch(() => {
|
||||
ElMessage.info('操作取消')
|
||||
})
|
||||
},
|
||||
submitAdd(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;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
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;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,306 +1,309 @@
|
|||
<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: 158px; margin-right: 10px; height: 32px;" placeholder="工单号"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="workCenterQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="工位/小盒子"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="goodsIdQuery" type="textarea" :rows="1" style="width: 158px; margin-right: 10px; height: 32px;"
|
||||
placeholder="请输入料号,多个料号请换行输入" class="goods-id-textarea" />
|
||||
<el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="站台号"
|
||||
:suffix-icon="Search" />
|
||||
<el-date-picker v-model="workDateQuery" type="date" placeholder="工作起始日期" :shortcuts="shortcuts"
|
||||
style="width: 158px; margin-right: 10px;" clearable />
|
||||
<el-date-picker v-model="workEndDateQuery" type="date" placeholder="工作结束日期" :shortcuts="shortcuts"
|
||||
style="width: 158px; margin-right: 10px;" clearable />
|
||||
<el-select-v2 v-model="lackStatusQuery" style="width: 158px; margin-right: 10px;"
|
||||
<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: 158px; margin-right: 10px; height: 32px;"
|
||||
placeholder="工单号"
|
||||
:suffix-icon="Search"/>
|
||||
<el-input v-model="workCenterQuery" style="width: 158px; margin-right: 10px; height: 32px;"
|
||||
placeholder="工位/小盒子"
|
||||
:suffix-icon="Search"/>
|
||||
<el-input v-model="goodsIdQuery" type="textarea" :rows="1"
|
||||
style="width: 158px; margin-right: 10px; height: 32px;"
|
||||
placeholder="请输入料号,多个料号请换行输入" class="goods-id-textarea"/>
|
||||
<el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="站台号"
|
||||
:suffix-icon="Search"/>
|
||||
<el-date-picker v-model="workDateQuery" type="date" placeholder="工作起始日期" :shortcuts="shortcuts"
|
||||
style="width: 158px; margin-right: 10px;" clearable/>
|
||||
<el-date-picker v-model="workEndDateQuery" type="date" placeholder="工作结束日期" :shortcuts="shortcuts"
|
||||
style="width: 158px; margin-right: 10px;" clearable/>
|
||||
<el-select-v2 v-model="lackStatusQuery" style="width: 158px; margin-right: 10px;"
|
||||
placeholder="请选择缺料状态" :options="lackStatusOptions" @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>
|
||||
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="workSummaryList" stripe border v-loading="loading" class="table-class"
|
||||
<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: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br/>
|
||||
<el-table :data="workSummaryList" 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.workFlowId" v-model="workFlowId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="workFlowId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="workStation" label="站台号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="workOrder" label="工单号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="workCenter" label="工位/小盒子" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="goodsId" label="料号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="needNum" label="需求数量" min-width="120px" />
|
||||
<el-table-column prop="pickedNum" label="已拣数量" min-width="120px" />
|
||||
<el-table-column prop="lackNum" label="缺件数量" min-width="120px" />
|
||||
<el-table-column prop="eLocationId" label="拣货位置" min-width="120px" />
|
||||
<el-table-column prop="lackStatus" label="缺料状态" fixed="right" :formatter="lackStatusFormat"
|
||||
min-width="120px" />
|
||||
<el-table-column prop="workStatus" label="工作状态" :formatter="workStatusFormat" min-width="120px" />
|
||||
<el-table-column prop="workDate" label="工作日期" :formatter="dateFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="opUser" label="操作用户" min-width="120px" />
|
||||
</el-table>
|
||||
<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-config-provider>
|
||||
</div>
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.workFlowId" v-model="workFlowId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="workFlowId" label="id" fixed="left" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="workStation" label="站台号" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="workOrder" label="工单号" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="workCenter" label="工位/小盒子" show-overflow-tooltip min-width="120px"/>
|
||||
<el-table-column prop="goodsId" label="料号" min-width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="needNum" label="需求数量" min-width="120px"/>
|
||||
<el-table-column prop="pickedNum" label="已拣数量" min-width="120px"/>
|
||||
<el-table-column prop="lackNum" label="缺件数量" min-width="120px"/>
|
||||
<el-table-column prop="eLocationId" label="拣货位置" min-width="120px"/>
|
||||
<el-table-column prop="lackStatus" label="缺料状态" fixed="right" :formatter="lackStatusFormat"
|
||||
min-width="120px"/>
|
||||
<el-table-column prop="workStatus" label="工作状态" :formatter="workStatusFormat" min-width="120px"/>
|
||||
<el-table-column prop="workDate" label="工作日期" :formatter="dateFormat" min-width="120px"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="opUser" label="操作用户" min-width="120px"/>
|
||||
</el-table>
|
||||
<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-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getWorkSummary } from '@/api/kateWork.js'
|
||||
import { downloadWorkSummaryExcel } from '@/api/excel.js'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import {getWorkSummary} from '@/api/kateWork.js'
|
||||
import {downloadWorkSummaryExcel} from '@/api/excel.js'
|
||||
import {errorBox} from '@/utils/myMessageBox.js'
|
||||
import {dateFormatter, timeFormatter} from '@/utils/formatter.js'
|
||||
import {Search} from '@element-plus/icons-vue'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'workSummary',
|
||||
data() {
|
||||
return {
|
||||
workSummaryList: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
workOrderQuery: '',
|
||||
workCenterQuery: '',
|
||||
goodsIdQuery: '',
|
||||
standIdQuery: '',
|
||||
workDateQuery: null,
|
||||
workEndDateQuery: null,
|
||||
shortcuts: [
|
||||
{
|
||||
text: '今天',
|
||||
value: new Date(),
|
||||
},
|
||||
{
|
||||
text: '昨天',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24)
|
||||
return date
|
||||
},
|
||||
},
|
||||
],
|
||||
lackStatusQuery: -99,
|
||||
loading: true,
|
||||
workFlowId: '',
|
||||
lackStatusOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '不缺'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '缺料'
|
||||
}
|
||||
],
|
||||
name: 'workSummary',
|
||||
data() {
|
||||
return {
|
||||
workSummaryList: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
workOrderQuery: '',
|
||||
workCenterQuery: '',
|
||||
goodsIdQuery: '',
|
||||
standIdQuery: '',
|
||||
workDateQuery: null,
|
||||
workEndDateQuery: null,
|
||||
shortcuts: [
|
||||
{
|
||||
text: '今天',
|
||||
value: new Date(),
|
||||
},
|
||||
{
|
||||
text: '昨天',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24)
|
||||
return date
|
||||
},
|
||||
},
|
||||
],
|
||||
lackStatusQuery: -99,
|
||||
loading: true,
|
||||
workFlowId: '',
|
||||
lackStatusOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '不缺'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '缺料'
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
workStation: this.standIdQuery.trim(),
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
workCenter: this.workCenterQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim().split('\n').filter(id => id.trim() !== '').join(','),
|
||||
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
|
||||
workDate: timeFormatter(this.workDateQuery),
|
||||
workEndDate: timeFormatter(this.workEndDateQuery),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getWorkSummary(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.workSummaryList = 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,
|
||||
workStation: this.standIdQuery.trim(),
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
workCenter: this.workCenterQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim().split('\n').filter(id => id.trim() !== '').join(','),
|
||||
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
|
||||
workDate: timeFormatter(this.workDateQuery),
|
||||
workEndDate: timeFormatter(this.workEndDateQuery),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getWorkSummary(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.workSummaryList = 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)
|
||||
},
|
||||
lackStatusFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 0:
|
||||
return '不缺'
|
||||
case 1:
|
||||
return '缺料'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
workStatusFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 0:
|
||||
return '未开始'
|
||||
case 1:
|
||||
return '正在做'
|
||||
case 2:
|
||||
return '已完成'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
this.standIdQuery = ''
|
||||
this.workOrderQuery = ''
|
||||
this.workCenterQuery = ''
|
||||
this.goodsIdQuery = ''
|
||||
this.workDateQuery = null
|
||||
this.search()
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.workFlowId = row.workFlowId
|
||||
},
|
||||
exportExcel() {
|
||||
const request = {
|
||||
workStation: this.standIdQuery.trim(),
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
workCenter: this.workCenterQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim().split('\n').filter(id => id.trim() !== '').join(','),
|
||||
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
|
||||
workDate: timeFormatter(this.workDateQuery),
|
||||
workEndDate: timeFormatter(this.workEndDateQuery),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
downloadWorkSummaryExcel(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'//隐藏
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
lackStatusFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 0:
|
||||
return '不缺'
|
||||
case 1:
|
||||
return '缺料'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
workStatusFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 0:
|
||||
return '未开始'
|
||||
case 1:
|
||||
return '正在做'
|
||||
case 2:
|
||||
return '已完成'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
this.standIdQuery = ''
|
||||
this.workOrderQuery = ''
|
||||
this.workCenterQuery = ''
|
||||
this.goodsIdQuery = ''
|
||||
this.workDateQuery = null
|
||||
this.search()
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.workFlowId = row.workFlowId
|
||||
},
|
||||
exportExcel() {
|
||||
const request = {
|
||||
workStation: this.standIdQuery.trim(),
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
workCenter: this.workCenterQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim().split('\n').filter(id => id.trim() !== '').join(','),
|
||||
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
|
||||
workDate: timeFormatter(this.workDateQuery),
|
||||
workEndDate: timeFormatter(this.workEndDateQuery),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
downloadWorkSummaryExcel(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('导出失败')
|
||||
})
|
||||
},
|
||||
// 兼容不同浏览器的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%;
|
||||
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;
|
||||
}
|
||||
|
||||
/* 专门为料号文本域添加样式 */
|
||||
.goods-id-container {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.goods-id-textarea {
|
||||
vertical-align: top;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.goods-id-textarea :deep(.el-textarea__inner) {
|
||||
font-size: 12px;
|
||||
line-height: 1.2;
|
||||
padding: 5px;
|
||||
height: 32px !important;
|
||||
min-height: 32px !important;
|
||||
resize: none;
|
||||
font-size: 12px;
|
||||
line-height: 1.2;
|
||||
padding: 5px;
|
||||
height: 32px !important;
|
||||
min-height: 32px !important;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
/* 确保其他输入框保持一致的高度 */
|
||||
.el-input {
|
||||
height: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.el-input :deep(.el-input__wrapper) {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -44,7 +44,7 @@ const routes = [
|
|||
{ path: '/stockUpdateRecord', component: () => import('@/layout/stockUpdateRecord.vue') },// 库存更新记录
|
||||
{ path: '/roleUser', component: () => import('@/layout/role_user.vue') },// 角色——用户列表
|
||||
{ path: '/rolePermission', component: () => import('@/layout/role_permission.vue') },// 角色——权限列表
|
||||
|
||||
{ path: '/workDateTable', component: () => import('@/layout/workDateTable.vue') },// 工作日历
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user