From 043a37b51d5da0c8762a6a28e649bc87d60bf0a7 Mon Sep 17 00:00:00 2001 From: hwh <332078369@qq.com> Date: 星期四, 12 九月 2024 16:42:08 +0800 Subject: [PATCH] · --- Web/src/views/wcs/wcsDevice/index.vue | 32 ++++++++++++++++++++++++++------ 1 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Web/src/views/wcs/wcsDevice/index.vue b/Web/src/views/wcs/wcsDevice/index.vue index adb4f8f..cabac56 100644 --- a/Web/src/views/wcs/wcsDevice/index.vue +++ b/Web/src/views/wcs/wcsDevice/index.vue @@ -37,7 +37,6 @@ style="margin-left:5px;"> 闅愯棌 </el-button> <el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddWcsDevice" v-auth="'wcsDevice:add'"> 鏂板 </el-button> - </el-button-group> </el-form-item> @@ -56,10 +55,16 @@ </template> </el-table-column> + <el-table-column prop="deviceType" label="浜や簰绫诲瀷" show-overflow-tooltip=""> + <template #default="scope"> + <el-tag :type="dv('DeviceTypeEnum', scope.row.deviceType)?.tagType"> {{ dv('DeviceTypeEnum', + scope.row.deviceType)?.name }}</el-tag> + </template> + </el-table-column> <el-table-column prop="level" label="璁惧绾у埆" show-overflow-tooltip=""> <template #default="scope"> <el-tag :type="dv('DeviceLevelEnum', scope.row.level)?.tagType"> {{ dv('DeviceLevelEnum', - scope.row.level)?.name}}</el-tag> + scope.row.level)?.name }}</el-tag> </template> </el-table-column> <el-table-column prop="dbNumber" label="DB鍖哄煙" show-overflow-tooltip="" /> @@ -69,7 +74,7 @@ <el-table-column prop="posType" label="娴佺▼瀛楃被鍨�" show-overflow-tooltip=""> <template #default="scope"> <el-tag :type="dv('PLCDataTypeEnum', scope.row.posType)?.tagType"> {{ dv('PLCDataTypeEnum', - scope.row.posType)?.name}}</el-tag> + scope.row.posType)?.name }}</el-tag> </template> </el-table-column> <el-table-column prop="ledIP" label="鏄剧ず灞廼p鍦板潃" show-overflow-tooltip="" /> @@ -79,13 +84,15 @@ <ModifyRecord :data="scope.row" /> </template> </el-table-column> - <el-table-column label="鎿嶄綔" width="140" align="center" fixed="right" show-overflow-tooltip="" + <el-table-column label="鎿嶄綔" width="220" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('wcsDevice:update') || auth('wcsDevice:delete')"> <template #default="scope"> <el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditWcsDevice(scope.row)" v-auth="'wcsDevice:update'"> 缂栬緫 </el-button> <el-button icon="ele-Delete" size="small" text="" type="primary" @click="delWcsDevice(scope.row)" v-auth="'wcsDevice:delete'"> 鍒犻櫎 </el-button> + <el-button icon="ele-Plus" size="small" text="" type="primary" @click="generateDevicePos(scope.row)" + v-auth="'wcsDevice:generate'"> 鐢熸垚鐐逛綅 </el-button> </template> </el-table-column> </el-table> @@ -112,7 +119,7 @@ import printDialog from '/@/views/system/print/component/hiprint/preview.vue' import editDialog from '/@/views/wcs/wcsDevice/component/editDialog.vue' -import { pageWcsDevice, deleteWcsDevice } from '/@/api/wcs/wcsDevice'; +import { pageWcsDevice, deleteWcsDevice, generatePos } from '/@/api/wcs/wcsDevice'; import { getWcsPlcPlcIdDropdown } from '/@/api/wcs/wcsDevice'; const showAdvanceQueryUI = ref(false); @@ -167,7 +174,20 @@ editWcsDeviceTitle.value = '缂栬緫璁惧淇℃伅'; editDialogRef.value.openDialog(row); }; - +//鐢熸垚鐐逛綅 +const generateDevicePos = (row: any) => { + ElMessageBox.prompt('璇疯緭鍏ヨ捣濮嬬偣浣�', '鐢熸垚鐐逛綅', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + }) + .then(async ({ value }) => { + await generatePos({ id: row.id, pos: value }); + ElMessage({ + type: 'success', + message: `鐢熸垚鐐逛綅鎴愬姛`, + }) + }) +} // 鍒犻櫎 const delWcsDevice = (row: any) => { ElMessageBox.confirm(`纭畾瑕佸垹闄ゅ悧?`, "鎻愮ず", { -- Gitblit v1.8.0