Selaa lähdekoodia

将生产管理中所需的API,以及生产管理-部件详情中DTO(其他之后提交会进行移动)移动到admin/productionManagement目录中

wyoujia 1 vuosi sitten
vanhempi
commit
12b63fd357

+ 0 - 97
admin.ui.plus-master/src/api/admin/data-contracts.ts

@@ -4613,100 +4613,3 @@ export interface ComponentGetPageDto{
    status: number
 
 }
-
-/**
- * @name: 数据对象接口
- * @description: 生产管理 - 部件详情 - 基本信息item
- * @author wyoujia
- * @date 2023-29-24 16:29:22
-*/
-export interface goodsInformationBasicItem{
-  /**基本信息-标题 */
-  goodsTitle: string | null
-  /**基本信息-值 */
-  goodsValue: string | null
-}
-
-/**
- * @name: 数据对象接口
- * @description: 图片对象 title - imgUrl
- * @author wyoujia
- * @date 2023-21-24 17:21:21
-*/
-export interface imageInter {
-  /**图片url */
-  imgUrl: string| null
-  /**图片title */
-  title: string | null
-}
-/**
- * @name: 数据对象接口
- * @description: 生产管理 - 部件详情 - 基本信息
- * @author wyoujia
- * @date 2023-23-24 16:23:48
-*/
-export interface goodsInformationBasic {
-  /**基本信息item */
-  basicInfo: goodsInformationBasicItem [] | null
-  /**基本信息图片 */
-  goodsImg: imageInter
-}
-
-/**
- * @name: 数据对象接口
- * @description: 生产管理 - 部件详情 - 生产日志
- * @author wyoujia
- * @date 2023-44-24 16:44:02
-*/
-export interface productionLog {
-  /**生产时间 */
-  dateOfManufacture: Date | null,
-  /**操作人 */
-  operator: string | null,
-  /**工序 */
-  workingProcedure: string | null,
-  /**状态 */
-  state: number | null,
-  /**生产图片 */
-  productionPictures: string | null,
-  /**备注 */
-  remarks: string | null
-}
-
-/**
- * @name: 数据对象接口
- * @description: 生产管理 - 部件详情 - 报警日志
- * @author wyoujia
- * @date 2023-48-24 16:48:49
-*/
-export interface alarmLog {
-  /**报警日期 */
-  alarmDate: Date | null,
-  /**事件名称 */
-  eventName: string | null,
-  /**备注 */
-  remarks: string | null,
-  /**状态 */
-  state: number | null
-}
-
-/**
- * @name: 数据对象接口
- * @description: 生产管理 - 部件详情
- * @author wyoujia
- * @date 2023-53-24 16:53:14
-*/
-export interface adminProductGoodsInfoDto {
-  /**显示加载效果 */
-  loading: false,
-  /**图片是否方法显示 */
-  showBig:false
-  /**放大图片的url */
-  imageUrl: string | null
-  /**基础信息 */
-  basicInformation: goodsInformationBasic,
-  /**生产日志 */
-  productionLog: productionLog[] | null,
-  /**报警日志 */
-  alarmLog: alarmLog [] | null,
-}

+ 2 - 2
admin.ui.plus-master/src/api/admin/Component.ts → admin.ui.plus-master/src/api/admin/productionManagement/Component.ts

@@ -16,8 +16,8 @@ import {
   ResultOutputFileEntity,
   ResultOutputListFileEntity,
   ResultOutputPageComponentGetPageOutPut,
-} from './data-contracts'
-import { ContentType, HttpClient, RequestParams } from './http-client'
+} from '../data-contracts'
+import { ContentType, HttpClient, RequestParams } from '../http-client'
 
 export class ComponentApi<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
   /**

+ 177 - 0
admin.ui.plus-master/src/api/admin/productionManagement/ComponentDetails.ts

@@ -0,0 +1,177 @@
+import {HttpClient} from "/@/api/admin/http-client";
+
+export class ComponentDetails<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
+  /**
+  * No description
+  *
+  * @tags data
+  * @name getBasicInfo
+  * @summary  获取产品详情基础信息
+  * @request GET:
+  * @secure
+  */
+
+  timer = 500
+  getBasicInfo = (params : string) : any  => {
+    // eslint-disable-next-line no-console
+    console.log(params)
+    return new Promise((resolve) => {
+      setTimeout(() => {
+        resolve({
+          basicInfo: [
+            {
+              goodsTitle: "部件名称",
+              goodsValue: "TQC+主板12321312312311231231231231232312312312123"
+            },
+            {
+              goodsTitle: "部件类型",
+              goodsValue: "计控主板12312312311231231231231232323123112312312312312323231231231123123123123123232"
+            },
+            {
+              goodsTitle: "物料号",
+              goodsValue: "TOK-20021203"
+            },
+            {
+              goodsTitle: "生产料号",
+              goodsValue: "SC202307051"
+            },
+            {
+              goodsTitle: "序列号",
+              goodsValue: "20121221"
+            },
+            {
+              goodsTitle: "软件版本",
+              goodsValue: ""
+            },
+            {
+              goodsTitle: "厂商名称",
+              goodsValue: "托肯恒山"
+            },
+            {
+              goodsTitle: "中化密钥状态",
+              goodsValue: "已绑定"
+            },
+            {
+              goodsTitle: "团标密钥状态",
+              goodsValue: "已备案"
+            },
+            {
+              goodsTitle: "状态",
+              goodsValue: "正常"
+            },
+            {
+              goodsTitle: "创建时间",
+              goodsValue: "2023-07-05"
+            },
+            {
+              goodsTitle: "生产时间",
+              goodsValue: "2023-07-05"
+            },
+            {
+              goodsTitle: "备注",
+              goodsValue: ""
+            },
+            {
+              goodsTitle: "检测时间",
+              goodsValue: "2023-07-06"
+            },
+            {
+              goodsTitle: "检测员",
+              goodsValue: "生产员"
+            }
+          ],
+          goodsImg: {
+            imgUrl: "https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg",
+            title: "哈哈"
+          }
+        })
+      },this.timer)
+
+    })
+
+  }
+
+  /**
+  * No description
+  *
+  * @tags data
+  * @name getProductionLog
+  * @summary  获取产品详情生产日志
+  * @request GET:
+  * @secure
+  */
+
+  getProductionLog = ( params: string ) : any => {
+    // eslint-disable-next-line no-console
+    console.log(params)
+    return new Promise((resolve) => {
+      setTimeout(()=> {
+        resolve([
+          {
+            dateOfManufacture:"2023-07-05",
+            operator:"蒋工1",
+            workingProcedure:"团标密钥灌注1",
+            state:true,
+            productionPictures:"111",
+            remarks:"222"
+          },
+          {
+            dateOfManufacture:"2023-07-05",
+            operator:"蒋工2",
+            workingProcedure:"团标密钥灌注2",
+            state:true,
+            productionPictures:"111",
+            remarks:"222"
+          },
+          {
+            dateOfManufacture:"2023-07-05",
+            operator:"蒋工3",
+            workingProcedure:"团标密钥灌3",
+            state:true,
+            productionPictures:"2323",
+            remarks:"333"
+          }
+        ])
+      },this.timer)
+
+    })
+  }
+
+  /**
+  * No description
+  *
+  * @tags
+  * @name getAlarmLog
+  * @summary 获取产品详情报警日志
+  * @request GET:
+  * @secure
+  */
+  getAlarmLog = ( params:string ) : any => {
+    // eslint-disable-next-line no-console
+    console.log(params)
+    return new Promise((resolve) => {
+      setTimeout(()=> {
+        resolve([
+          {
+            alarmDate:"23-07-06 09:14",
+            eventName:"通讯异常1",
+            remarks:"",
+            state:false
+          },
+          {
+            alarmDate:"23-07-06 09:14",
+            eventName:"通讯异常2",
+            remarks:"",
+            state:false
+          },
+          {
+            alarmDate:"23-07-06 09:14",
+            eventName:"通讯异常3",
+            remarks:"",
+            state:false
+          }
+        ])
+      },this.timer)
+    })
+  }
+}

+ 101 - 0
admin.ui.plus-master/src/api/admin/productionManagement/ComponentDetailsDto.ts

@@ -0,0 +1,101 @@
+/**
+ * 生产管理 - 部件详情
+ *  数据对象的Dto
+ * */
+
+/**
+ * @name: 数据对象接口
+ * @description: 生产管理 - 部件详情 - 基本信息item
+ * @author wyoujia
+ * @date 2023-29-24 16:29:22
+ */
+export interface goodsInformationBasicItem{
+  /**基本信息-标题 */
+  goodsTitle: string | null
+  /**基本信息-值 */
+  goodsValue: string | null
+}
+
+/**
+ * @name: 数据对象接口
+ * @description: 图片对象 title - imgUrl
+ * @author wyoujia
+ * @date 2023-21-24 17:21:21
+ */
+export interface imageInter {
+  /**图片url */
+  imgUrl: string| null
+  /**图片title */
+  title: string | null
+}
+/**
+ * @name: 数据对象接口
+ * @description: 生产管理 - 部件详情 - 基本信息
+ * @author wyoujia
+ * @date 2023-23-24 16:23:48
+ */
+export interface goodsInformationBasic {
+  /**基本信息item */
+  basicInfo: goodsInformationBasicItem [] | null
+  /**基本信息图片 */
+  goodsImg: imageInter
+}
+
+/**
+ * @name: 数据对象接口
+ * @description: 生产管理 - 部件详情 - 生产日志
+ * @author wyoujia
+ * @date 2023-44-24 16:44:02
+ */
+export interface productionLog {
+  /**生产时间 */
+  dateOfManufacture: Date | null,
+  /**操作人 */
+  operator: string | null,
+  /**工序 */
+  workingProcedure: string | null,
+  /**状态 */
+  state: number | null,
+  /**生产图片 */
+  productionPictures: string | null,
+  /**备注 */
+  remarks: string | null
+}
+
+/**
+ * @name: 数据对象接口
+ * @description: 生产管理 - 部件详情 - 报警日志
+ * @author wyoujia
+ * @date 2023-48-24 16:48:49
+ */
+export interface alarmLog {
+  /**报警日期 */
+  alarmDate: Date | null,
+  /**事件名称 */
+  eventName: string | null,
+  /**备注 */
+  remarks: string | null,
+  /**状态 */
+  state: number | null
+}
+
+/**
+ * @name: 数据对象接口
+ * @description: 生产管理 - 部件详情
+ * @author wyoujia
+ * @date 2023-53-24 16:53:14
+ */
+export interface adminProductGoodsInfoDto {
+  /**显示加载效果 */
+  loading: boolean,
+  /**图片是否方法显示 */
+  showBig: boolean
+  /**放大图片的url */
+  imageUrl: string | null
+  /**基础信息 */
+  basicInformation: goodsInformationBasic,
+  /**生产日志 */
+  productionLog: productionLog[] | null,
+  /**报警日志 */
+  alarmLog: alarmLog [] | null,
+}

+ 2 - 2
admin.ui.plus-master/src/api/admin/ComponentType.ts → admin.ui.plus-master/src/api/admin/productionManagement/ComponentType.ts

@@ -16,8 +16,8 @@ import {
   ResultOutputFileEntity,
   ResultOutputListFileEntity,
   ResultOutputPageComponentGetPageOutPut,
-} from './data-contracts'
-import { ContentType, HttpClient, RequestParams } from './http-client'
+} from '../data-contracts'
+import { ContentType, HttpClient, RequestParams } from '../http-client'
 
 export class ComponentTypeApi<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
   /**

+ 19 - 0
admin.ui.plus-master/src/api/admin/productionManagement/README.md

@@ -0,0 +1,19 @@
+#### 简介
+
+	productionManagement 目录中的ts文件用于后端接口请求交互和转换前端页面对象处理
+	
+#### Component.ts
+
+	生产管理 - 部件电子档案 发送后端请求数据
+
+#### ComponentType.ts
+
+	生产管理 - 部件类型 发送后端请求数据
+
+#### ComponentDetails.ts
+
+	生产管理 - 部件详情发送后端请求数据
+
+#### ComponentDetailsDto.ts
+
+	生产管理 - 部件详情 数据对象的DTO

+ 39 - 24
admin.ui.plus-master/src/views/admin/product/goodInfo.vue

@@ -1,41 +1,41 @@
 <template>
-  <div class="goodInfo layout-pd" v-loading="goods.loading">
+  <div class="goodInfo layout-pd" >
     <el-row>
       <!-- 基础信息 -->
       <el-col :xs="24" >
         <el-card shadow="hover" header="基础信息">
-          <div class="basicInformation" >
+          <div class="basicInformation" v-loading="goods.loading">
             <div class="basicInformation-left">
-              <div v-for="(item, index) in goods.basicInformation" :key="index" class="item">
+              <div v-for="(item, index) in goods.basicInformation.basicInfo" :key="index" class="item">
                 <el-popover
                   placement="top-start"
-                  :title="item.title"
+                  :title="item.goodsTitle"
                   :width="200"
                   trigger="hover"
-                  :content="item.value"
+                  :content="item.goodsValue"
                 >
                   <template #reference>
-                    <span class="m-2">{{item.title}} : {{item.value}}</span>
+                    <span class="m-2">{{item.goodsTitle}} : {{item.goodsValue}}</span>
                   </template>
                 </el-popover>
               </div>
             </div>
-            <div class="basicInformation-right">
-              <div @click="showBigPic(goods.imageurl)">
+            <div class="basicInformation-right" v-if="goods.basicInformation.goodsImg">
+              <div @click="showBigPic(goods.basicInformation.goodsImg.imgUrl)">
                 <el-image loading="lazy"
                           alt="fgg"
                           class="img"
                           fit="fill"
-                          :src="goods.imageurl" />
+                          :src="goods.basicInformation.goodsImg.imgUrl" />
               </div>
-              <div class="text">312312</div>
+              <div class="text">{{goods.basicInformation.goodsImg.title}}</div>
             </div>
           </div>
         </el-card>
       </el-col>
 
       <!-- 生产日志 -->
-      <el-col :xs="24">
+      <el-col :xs="24" >
         <el-card shadow="hover" header="生产日志">
           <div class="productionLog">
             <el-table v-loading="goods.loading" :data="goods.productionLog" row-key="id" style="width: 100%">
@@ -45,7 +45,7 @@
               <el-table-column prop="state" label="状态"  />
               <el-table-column prop="productionPictures" label="生产图片">
                 <template #default="{ row }">
-                  <el-link @click="showPic(row.productionPictures)" :underline="false">点击查看</el-link>
+                  <el-link @click="showBigPic(row.productionPictures)" :underline="false">点击查看</el-link>
                 </template>
               </el-table-column>
               <el-table-column prop="remarks" label="备注"  />
@@ -55,7 +55,7 @@
       </el-col>
 
       <!-- 报警日志 -->
-      <el-col :span="24">
+      <el-col :span="24" >
         <el-card shadow="hover" header="报警日志">
           <div class="alarmLog">
             <el-table v-loading="goods.loading" :data="goods.alarmLog" row-key="id" style="width: 100%">
@@ -81,16 +81,17 @@
 
 <script setup lang="ts" name="goodInfo">
 import {onMounted, reactive} from "vue";
-import {adminProductGoodsInfoDto} from "/@/api/admin/data-contracts";
+import {adminProductGoodsInfoDto} from "/@/api/admin/productionManagement/ComponentDetailsDto";
+import {ComponentDetails} from "/@/api/admin/productionManagement/ComponentDetails";
 
 //组件的页面对象
 const goods:adminProductGoodsInfoDto = reactive({
   /**显示加载效果 */
   loading: false,
   /**图片是否方法显示 */
-  showBig:false,
+  showBig: false,
   /**放大图片的url */
-  imageUrl:"https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg",
+  imageUrl:"",
   /**基础信息 */
   basicInformation: {},
   /**生产日志 */
@@ -99,20 +100,34 @@ const goods:adminProductGoodsInfoDto = reactive({
   alarmLog: [],
 })
 
-
-//点击查看详细
-const showPic = (val: string) => {
-  showBigPic(val)
-}
-
-
 //查看大图
-const showBigPic = (val : string) => {
+const showBigPic = (val : string | null) => {
   // eslint-disable-next-line no-console
   console.log(val)
+  goods.imageUrl = val
+  goods.showBig = true
+}
+
+/**
+ * 初始化数据
+ */
+const init = async () =>{
+  goods.loading = true
+    const basicInformation = await new ComponentDetails().getBasicInfo("1")
+    const productionLog = await new ComponentDetails().getProductionLog("1")
+    const alarmLog =  await new ComponentDetails().getAlarmLog("1")
+    goods.basicInformation = basicInformation
+    goods.productionLog = productionLog
+    goods.alarmLog = alarmLog
+    goods.loading = false
+    console.log(goods.basicInformation)
+    console.log(goods.productionLog)
+    console.log(goods.alarmLog)
+    goods.loading = false
 }
 
 onMounted(() => {
+  init()
 })
 
 </script>

+ 2 - 2
admin.ui.plus-master/src/views/admin/product/index.vue

@@ -130,7 +130,7 @@
   <script lang="ts" setup name="admin/Component">
   import { ref, reactive, onMounted, onBeforeMount} from 'vue'  //computed, getCurrentInstance
   import { PageInputFileGetPageDto, ComponentGetPageOutPut } from '/src/api/admin/data-contracts'
-  import { ComponentApi } from '/src/api/admin/Component'
+  import { ComponentApi } from '/@/api/admin/productionManagement/Component'
   import dayjs from 'dayjs'
   import eventBus from '/src/utils/mitt'
   //import { isImage } from '/@/utils/test'
@@ -197,7 +197,7 @@
     const res = await new ComponentApi().getPage({ ...bomModel.pageInput, filter: bomModel.filterModel }).catch(() => {
         bomModel.loading = false
     })
-
+    console.log(res)
     bomModel.bomListData = res?.data?.list ?? []
     bomModel.total = res?.data?.total ?? 0
     bomModel.loading = false

+ 1 - 1
admin.ui.plus-master/src/views/admin/product/type.vue

@@ -126,7 +126,7 @@
   <script lang="ts" setup name="admin/product/bom">
   import { ref, reactive, onMounted, onBeforeMount, computed } from 'vue'
   import { PageInputFileGetPageDto, FileGetPageOutput } from '/src/api/admin/data-contracts'
-  import { ComponentTypeApi } from '/src/api/admin/ComponentType'
+  import { ComponentTypeApi } from '/@/api/admin/productionManagement/ComponentType'
   import dayjs from 'dayjs'
   import eventBus from '/src/utils/mitt'
   import { isImage } from '/src/utils/test'