This commit is contained in:
赵正易 2024-11-13 10:55:03 +08:00
parent 00849b04ff
commit 50ed889135
3 changed files with 33 additions and 8 deletions

View File

@ -52,8 +52,10 @@
<el-table-column prop="createdTime" label="创建时间" :show-overflow-tooltip="true" v-if="columns.showColumn('createdTime')" />
<el-table-column prop="updatedBy" label="更新人" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('updatedBy')" />
<el-table-column prop="updatedTime" label="更新时间" :show-overflow-tooltip="true" v-if="columns.showColumn('updatedTime')" />
<el-table-column label="操作" width="160">
<el-table-column label="操作" width="260">
<template #default="scope">
<el-button type="warning" size="small" v-hasPermi="['billofmaterials:edit']" @click="handleLightUp(scope.row)">亮灯</el-button>
<el-button type="info" size="small" v-hasPermi="['billofmaterials:edit']" @click="handleLightDown(scope.row)">灭灯</el-button>
<el-button type="success" size="small" icon="edit" title="编辑" v-hasPermi="['billofmaterials:edit']" @click="handleUpdate(scope.row)"></el-button>
<el-button type="danger" size="small" icon="delete" title="删除" v-hasPermi="['billofmaterials:delete']" @click="handleDelete(scope.row)"></el-button>
</template>
@ -297,5 +299,28 @@ function handleDelete(row) {
})
}
/// ================= =================
import { doLightUp, doLightDown } from '@/api/PBL/plc.js'
function handleLightUp(row) {
const params = { workorder: '模拟数据', orderNumber: '模拟数据', assemblyPartNumber: row.productcode, version: row.version }
doLightUp(params).then((res) => {
if (res.code === 200 && res.data) {
proxy.$modal.msgSuccess('亮灯操作成功')
getList()
}
})
}
function handleLightDown(row) {
const params = { scan_code: row.mirrorshellCode }
doLightDown(params).then((res) => {
if (res.code === 200 && res.data) {
proxy.$modal.msgSuccess('关灯操作成功')
getList()
}
})
}
/// =============================================
handleQuery()
</script>

View File

@ -4,13 +4,13 @@
<el-table height="240" :data="dataList" v-loading="loading" ref="tableRef" highlight-current-row @mouseover.native="clearScroll" @mouseleave.native="createScroll">
<el-table-column type="index" width="50" align="center" />
<el-table-column prop="shelfCode" label="货架号" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="operationer" label="操作类别" :show-overflow-tooltip="true">
<el-table-column prop="lightOperation" label="操作类别" :show-overflow-tooltip="true">
<template #default="scope">
<el-tag v-if="scope.row.operationer === 1" type="success">亮灯</el-tag>
<el-tag v-if="scope.row.operationer === 2" type="info">灭灯</el-tag>
<el-tag v-if="scope.row.lightOperation === 1" type="success">亮灯</el-tag>
<el-tag v-if="scope.row.lightOperation === 2" type="info">灭灯</el-tag>
</template>
</el-table-column>
<el-table-column prop="lightOperation" label="操作内容" align="center" :show-overflow-tooltip="true" />
<!-- <el-table-column prop="operationer" label="操作来源" align="center" :show-overflow-tooltip="true" /> -->
<el-table-column prop="createdTime" label="操作时间" align="center" :show-overflow-tooltip="true" />
</el-table>
</div>
@ -24,7 +24,7 @@ const dataList = ref([])
const queryParams = reactive({
pageNum: 1,
pageSize: 10,
timeRange: [proxy.dayjs().subtract(1, 'day').format('YYYY-MM-DD 00:00:00'), proxy.dayjs().format('YYYY-MM-DD 23:59:59')],
timeRange: [proxy.dayjs().subtract(1, 'day').format('YYYY-MM-DD 00:00:00'), proxy.dayjs().add(1, 'day').format('YYYY-MM-DD 23:59:59')],
sort: 'createdTime',
sortType: 'desc'
})

View File

@ -29,11 +29,11 @@
<el-table-column type="index" width="50" align="center" />
<el-table-column prop="lightOperation" label="操作内容" align="center" v-if="columns.showColumn('lightOperation')">
<template #default="scope">
{{ scope.row.operationer == 1 ? '亮灯' : '灭灯' }}
{{ scope.row.lightOperation == 1 ? '亮灯' : '灭灯' }}
</template>
</el-table-column>
<el-table-column prop="shelfCode" label="货架号" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('shelfCode')" />
<el-table-column prop="operationer" label="操作类别" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('operationer')"> </el-table-column>
<el-table-column prop="operationer" label="操作" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('operationer')"> </el-table-column>
<el-table-column prop="createdTime" label="创建时间" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('createdTime')" />
<el-table-column label="操作" width="160" align="center">
<template #default="scope">