Browse Source

数控程序管理

damon227 1 year ago
parent
commit
6400933d5b

+ 8 - 0
src/api/program.js

@@ -8,3 +8,11 @@ export function getList (params) {
     params: params
   })
 }
+
+// 数据程序管理详情
+export function getDetail (programId) {
+  return request({
+    url: request.adornUrl(`/biz-service/pro-program/info/${programId}`),
+    method: 'get'
+  })
+}

+ 16 - 4
src/views/modules/tech/program-add-or-update.vue

@@ -9,9 +9,9 @@
     >
       <el-row>
         <el-col :span="6">
-          <el-form-item label="物料名称" prop="productName">
+          <el-form-item label="物料名称" prop="productId">
             <el-select
-              v-model="dataForm.productName"
+              v-model="dataForm.productId"
               filterable
               remote
               clearable
@@ -21,7 +21,7 @@
                 v-for="item in materialList"
                 :key="item.materialId"
                 :label="item.materialName"
-                :value="item.materialName"
+                :value="item.materialId"
               >
               </el-option>
             </el-select>
@@ -135,14 +135,26 @@ export default {
     }
   },
   created () {
-    this.getMaterialList()
   },
   methods: {
     init (id, item) {
       this.id = id || 0
       if (item) {
+        if (item.cxbList) {
+          item.cxbList.forEach(t => { t.name = t.fileName })
+        }
+        if (item.cxsqList) {
+          item.cxsqList.forEach(t => { t.name = t.fileName })
+        }
+        if (item.fzyzList) {
+          item.fzyzList.forEach(t => { t.name = t.fileName })
+        }
+        if (item.skjgList) {
+          item.skjgList.forEach(t => { t.name = t.fileName })
+        }
         this.dataForm = {...item}
       }
+      this.getMaterialList()
     },
     onChose () {
       this.$emit('onChose')

+ 61 - 0
src/views/modules/tech/program-detail.vue

@@ -0,0 +1,61 @@
+<template>
+  <div>
+    <div class="my-title">查看</div>
+    <div>
+      <e-desc title="基本信息" column="3">
+        <e-desc-item label="方案编码">{{ dataForm.taskCode }}</e-desc-item>
+        <e-desc-item label="物料名称">{{}} </e-desc-item>
+        <e-desc-item label="程序编号">{{}} </e-desc-item>
+
+        <e-desc-item label="程序说明">{{ dataForm.taskName }}</e-desc-item>
+      </e-desc>
+      <e-desc title="附件">
+        <upload-component
+          :display="true"
+          :display-title="false"
+          :accept="'*'"
+          :file-obj-list="dataForm.fileList"
+        />
+      </e-desc>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="onChose">返回</el-button>
+    </span>
+  </div>
+</template>
+
+<script>
+import EDesc from '../common/e-desc'
+import EDescItem from '../common/e-desc-item'
+import uploadComponent from '../common/upload-component'
+import {getDetail} from '@/api/program'
+export default {
+  name: 'tech-program-detail',
+  components: { EDesc, EDescItem, uploadComponent },
+  data () {
+    return {
+      id: '',
+      dataForm: {}
+    }
+  },
+  methods: {
+    async init (id) {
+      this.id = id || 0
+      this.getDetail()
+    },
+    onChose () {
+      this.$emit('onChose')
+    },
+    getDetail () {
+      getDetail(this.id).then(({data}) => {
+        if (data && data.code === '200') {
+          this.dataForm = data.data
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 12 - 5
src/views/modules/tech/program.vue

@@ -58,7 +58,7 @@
             align="center"
             min-width="140"
             :show-tooltip-when-overflow="true"
-            label="程序编"
+            label="程序编"
         >
         </el-table-column>
         <el-table-column
@@ -197,7 +197,7 @@
                 <el-button
                     type="text"
                     size="small"
-                    @click="showDetail(scope.row.taskId)"
+                    @click="showDetail(scope.row.programId)"
                     >查看</el-button>
                 <el-button
                     v-if="isAuth('work:clt:start')"
@@ -210,7 +210,8 @@
       </el-table>
     </template>
     <attach-detail-dialog ref="attachDetail" />
-    <program-add-or-update ref="addOrUpdate" v-if="addOrUpdateVisible"></program-add-or-update>
+    <program-add-or-update ref="addOrUpdate" v-if="addOrUpdateVisible" @onChose="onChose" @refreshDataList="getMaterialList"></program-add-or-update>
+    <program-detail ref="detail" v-if="detailVisible" @onChose="onChose"></program-detail>
   </div>
 </template>
 
@@ -219,9 +220,10 @@ import { getMaterialList } from '@/api/material'
 import { getList } from '@/api/program'
 import AttachDetailDialog from '../common/attach-detail-dialog'
 import ProgramAddOrUpdate from './program-add-or-update'
+import ProgramDetail from './program-detail'
 export default {
   name: 'program',
-  components: {AttachDetailDialog, ProgramAddOrUpdate},
+  components: {AttachDetailDialog, ProgramAddOrUpdate, ProgramDetail},
   data () {
     return {
       addOrUpdateVisible: false,
@@ -274,7 +276,12 @@ export default {
         this.$refs.addOrUpdate.init(id, item)
       })
     },
-    showDetail (id) {},
+    showDetail (id) {
+      this.detailVisible = true
+      this.$nextTick(() => {
+        this.$refs.detail.init(id)
+      })
+    },
     attachDetails (attachList) {
       this.$refs.attachDetail.init(attachList)
     }

+ 0 - 1
src/views/modules/works/work-center-detail.vue

@@ -92,7 +92,6 @@ export default {
   },
   methods: {
     async init (taskId) {
-      console.log(taskId, '----------')
       this.taskId = taskId
       this.getTaskDetail()
     },