hwh
2024-08-27 41ca2b65f055b9c7b8f3ce68418423bac15c8e46
Web/src/views/wcs/wcsPosition/index.vue
File was renamed from Web/src/views/wcs/wcsStation/index.vue
@@ -1,5 +1,5 @@
<template>
  <div class="wcsStation-container">
  <div class="wcsPosition-container">
    <el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
      <el-form :model="queryParams" ref="queryForm" labelWidth="90">
        <el-row>
@@ -28,15 +28,15 @@
          <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10">
            <el-form-item>
              <el-button-group style="display: flex; align-items: center;">
                <el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'wcsStation:page'"> 查询
                <el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'wcsPosition:page'"> 查询
                </el-button>
                <el-button icon="ele-Refresh" @click="() => queryParams = {}"> 重置 </el-button>
                <el-button icon="ele-ZoomIn" @click="changeAdvanceQueryUI" v-if="!showAdvanceQueryUI"
                  style="margin-left:5px;"> 高级查询 </el-button>
                <el-button icon="ele-ZoomOut" @click="changeAdvanceQueryUI" v-if="showAdvanceQueryUI"
                  style="margin-left:5px;"> 隐藏 </el-button>
                <el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddWcsStation"
                  v-auth="'wcsStation:add'"> 新增 </el-button>
                <el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddWcsPosition"
                  v-auth="'wcsPosition:add'"> 新增 </el-button>
              </el-button-group>
            </el-form-item>
@@ -57,8 +57,8 @@
        </el-table-column>
        <el-table-column prop="stationNum" label="工位号" show-overflow-tooltip="" />
        <el-table-column prop="plcPos" label="偏移量" show-overflow-tooltip="" /> <el-table-column prop="posType"
          label="流程字类型" show-overflow-tooltip="">
        <el-table-column prop="plcPos" label="偏移量" show-overflow-tooltip="" />
        <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>
@@ -72,12 +72,12 @@
          </template>
        </el-table-column>
        <el-table-column label="操作" width="140" align="center" fixed="right" show-overflow-tooltip=""
          v-if="auth('wcsStation:update') || auth('wcsStation:delete')">
          v-if="auth('wcsPosition:update') || auth('wcsPosition:delete')">
          <template #default="scope">
            <el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditWcsStation(scope.row)"
              v-auth="'wcsStation:update'"> 编辑 </el-button>
            <el-button icon="ele-Delete" size="small" text="" type="primary" @click="delWcsStation(scope.row)"
              v-auth="'wcsStation:delete'"> 删除 </el-button>
            <el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditWcsPosition(scope.row)"
              v-auth="'wcsPosition:update'"> 编辑 </el-button>
            <el-button icon="ele-Delete" size="small" text="" type="primary" @click="delWcsPosition(scope.row)"
              v-auth="'wcsPosition:delete'"> 删除 </el-button>
          </template>
        </el-table-column>
      </el-table>
@@ -85,23 +85,26 @@
        :total="tableParams.total" :page-sizes="[10, 20, 50, 100, 200, 500]" size="small" background=""
        @size-change="handleSizeChange" @current-change="handleCurrentChange"
        layout="total, sizes, prev, pager, next, jumper" />
      <printDialog ref="printDialogRef" :title="printWcsStationTitle" @reloadTable="handleQuery" />
      <editDialog ref="editDialogRef" :title="editWcsStationTitle" @reloadTable="handleQuery" />
      <printDialog ref="printDialogRef" :title="printWcsPositionTitle" @reloadTable="handleQuery" />
      <editDialog ref="editDialogRef" :title="editWcsPositionTitle" @reloadTable="handleQuery" />
    </el-card>
  </div>
</template>
<script lang="ts" setup="" name="wcsStation">
<script lang="ts" setup="" name="wcsPosition">
import { ref } from "vue";
import { ElMessageBox, ElMessage } from "element-plus";
import { auth } from '/@/utils/authFunction';
import { getDictLabelByVal as dv } from '/@/utils/dict-utils';
import ModifyRecord from '/@/components/table/modifyRecord.vue';
import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
import { getDictLabelByVal as dv } from '/@/utils/dict-utils';
import { formatDate } from '/@/utils/formatTime';
import ModifyRecord from '/@/components/table/modifyRecord.vue';
import printDialog from '/@/views/system/print/component/hiprint/preview.vue'
import editDialog from '/@/views/wcs/wcsStation/component/editDialog.vue'
import { pageWcsStation, deleteWcsStation } from '/@/api/wcs/wcsStation';
import { getWcsDeviceDeviceIdDropdown } from '/@/api/wcs/wcsStation';
import editDialog from '/@/views/wcs/wcsPosition/component/editDialog.vue'
import { pageWcsPosition, deleteWcsPosition } from '/@/api/wcs/wcsPosition';
import { getWcsDeviceDeviceIdDropdown } from '/@/api/wcs/wcsPosition';
const showAdvanceQueryUI = ref(false);
const printDialogRef = ref();
@@ -115,8 +118,8 @@
  total: 0,
});
const printWcsStationTitle = ref("");
const editWcsStationTitle = ref("");
const printWcsPositionTitle = ref("");
const editWcsPositionTitle = ref("");
// 改变高级查询的控件显示状态
const changeAdvanceQueryUI = () => {
@@ -126,7 +129,7 @@
// 查询操作
const handleQuery = async () => {
  loading.value = true;
  var res = await pageWcsStation(Object.assign(queryParams.value, tableParams.value));
  var res = await pageWcsPosition(Object.assign(queryParams.value, tableParams.value));
  tableData.value = res.data.result?.items ?? [];
  tableParams.value.total = res.data.result?.total;
  loading.value = false;
@@ -140,31 +143,31 @@
};
// 打开新增页面
const openAddWcsStation = () => {
  editWcsStationTitle.value = '添加设备工位';
const openAddWcsPosition = () => {
  editWcsPositionTitle.value = '添加设备点位管理';
  editDialogRef.value.openDialog({});
};
// 打开打印页面
const openPrintWcsStation = async (row: any) => {
  printWcsStationTitle.value = '打印设备工位';
const openPrintWcsPosition = async (row: any) => {
  printWcsPositionTitle.value = '打印设备点位管理';
}
// 打开编辑页面
const openEditWcsStation = (row: any) => {
  editWcsStationTitle.value = '编辑设备工位';
const openEditWcsPosition = (row: any) => {
  editWcsPositionTitle.value = '编辑设备点位管理';
  editDialogRef.value.openDialog(row);
};
// 删除
const delWcsStation = (row: any) => {
const delWcsPosition = (row: any) => {
  ElMessageBox.confirm(`确定要删除吗?`, "提示", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning",
  })
    .then(async () => {
      await deleteWcsStation(row);
      await deleteWcsPosition(row);
      handleQuery();
      ElMessage.success("删除成功");
    })