Pārlūkot izejas kodu

更改用户显示姓名

qinhb 1 nedēļu atpakaļ
vecāks
revīzija
17893381ea

+ 1 - 1
src/layout/components/header.vue

@@ -44,7 +44,7 @@
 
         <el-dropdown ref="dropdown1" trigger="contextmenu" @command="handleCommand">
           <div @click="showClick">
-            <div class="name">{{ userStore.user.username }}</div>
+            <div class="name">{{ userStore.user.nickName }}</div>
             <div class="work">{{ userStore.user.station }}</div>
           </div>
           <!--          <img-->

+ 1 - 0
src/store/modules/dictionary.ts

@@ -20,6 +20,7 @@ export const useDictionaryStore = defineStore(
       "station_task_state",
       "device_type",
       "out_time_reason",
+        "user_name_list"
     ];
     const dicts = ref<{ [key: string]: any[] }>({});
 

+ 5 - 1
src/views/pro-operation/inspect/index.vue

@@ -18,7 +18,7 @@
     </div>
     <div v-else class="checkForm">
       <div v-if="!editStatus" class="headerName">
-        <div class="titleText">当前检验人:{{ checkName }}</div>
+        <div class="titleText">当前检验人:{{ nickName }}</div>
         <div
           class="titleText"
           style="margin-right: 15%; display: flex; align-items: center"
@@ -164,6 +164,7 @@ const formRef = ref(null);
 const formData = ref({});
 provide("formData", formData);
 const checkName = ref(null);
+const nickName = ref(null);
 const checkType = ref("first_check");
 const editStatus = ref(false);
 const editCheck = async (row) => {
@@ -330,6 +331,7 @@ const handleSubmit = () => {
 const logOff = () => {
   checkName.value = "";
   inspectStore.checkName = "";
+  nickName.value = ""
 };
 
 // const drawingData = ref<any>([]);
@@ -344,6 +346,8 @@ const checkUserVal = async () => {
     ElMessage.success("记录成功!请开展检验操作");
     inspectStore.checkName = data.userName;
     checkName.value = data.userName;
+
+    nickName.value = data.nickName;
   } else {
     ElMessage.error(msg);
   }

+ 3 - 0
src/views/traceability/components/brazeCom.vue

@@ -58,6 +58,9 @@ const option = {
     {
       label: "操作人",
       prop: "updator",
+      type: "select",
+      dicData: dicts.user_name_list,
+      props: {"label": "dictLabel","value":"dictValue"},
     },
     {
       label: "操作时间",

+ 5 - 1
src/views/traceability/components/fault.vue

@@ -11,7 +11,11 @@
           {{ scope.row.type === 0 ? "报故" : "问题反馈"}}
         </template>
       </el-table-column>
-      <el-table-column prop="creator" label="报故人" />
+      <el-table-column prop="creator" label="报故人">
+        <template #default="scope">
+          {{dictS.getLableByValue('user_name_list',scope.row.creator)}}
+        </template>
+      </el-table-column>
       <el-table-column prop="stationName" label="报故工位" />
       <el-table-column prop="created" label="报故时间" />
       <el-table-column prop="disposalMeasures" label="处理结果">

+ 7 - 2
src/views/traceability/components/traceability.vue

@@ -6,7 +6,11 @@
       <el-table-column prop="currentState" label="状态" />
       <el-table-column prop="realStartWhen" label="开始时间" />
       <el-table-column prop="realEndWhen" label="结束时间" />
-      <el-table-column prop="creator" label="操作人" />
+      <el-table-column prop="creator" label="操作人">
+        <template #default="scope">
+          {{getLableByValue('user_name_list',scope.row.creator)}}
+        </template>
+      </el-table-column>
       <el-table-column prop="standardWorktime" label="工时" />
       <el-table-column prop="operationSort" label="工步" />
       <template #empty>
@@ -26,7 +30,7 @@
 </template>
 
 <script lang="ts" setup>
-import { useProcessStore } from "@/store";
+import { useProcessStore ,useDictionaryStore} from "@/store";
 import { getInfo } from "@/api/process/traceability";
 const store = useProcessStore();
 const page = ref(1);
@@ -34,6 +38,7 @@ const limit = ref(10);
 const total = ref(10);
 const tableData = ref([]);
 const tableHeight = ref(null);
+const { getLableByValue} = useDictionaryStore();
 //动态控制表格高度
 const setTableHeight = () => {
   tableHeight.value =