Browse Source

bugfix:200

chrislee 1 năm trước cách đây
mục cha
commit
ef56c7a4ba

+ 4 - 2
src/views/modules/order/dispatch.vue

@@ -182,7 +182,7 @@
     <!--送达弹窗 -->
     <dispatch-arrived v-if="arrivedVisible" ref="arrivedPage" @onChose="onChose" @refreshDataList="getDataList"/>
     <!-- 发货详情 -->
-    <dispatch-detail v-if="detailVisible" ref="detail" @onChose="onChose"/>
+    <prod-management-details v-if="detailVisible" ref="detail" @onChose="onChose"/>
   </div>
 </template>
 
@@ -193,10 +193,12 @@ import AttachDetail from '../common/attach-detail'
 import NoticeChangeSetting from './dispatch-notice-change-setting'
 import DispatchArrived from './dispatch-arrived'
 import DispatchDetail from './dispatch-detail'
+import ProdManagementDetails from '@/views/modules/production/prod-management-details'
 export default {
     // 发货管理
   name: 'dispatch',
   components: {
+    ProdManagementDetails,
     AttachDetail,
     PreviewComponent,
     NoticeChangeSetting,
@@ -293,7 +295,7 @@ export default {
     detailHandle (row) {
       this.detailVisible = true
       this.$nextTick(() => {
-        this.$refs.detail.init(row.prodProductionId)
+        this.$refs.detail.init(row.prodProductionId, 3)
       })
     },
     // 发货通知人设置

+ 1 - 1
src/views/modules/production/monitoring.vue

@@ -212,7 +212,7 @@ export default {
       detail (id) {
         this.detailsVisible = true
         this.$nextTick(() => {
-          this.$refs.details.init(id)
+          this.$refs.details.init(id, 1)
         })
       },
       outsourceDetail (row) {

+ 43 - 11
src/views/modules/production/prod-management-details.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="production">
-      <div class="my-title">生产监控详情</div>
+      <div class="my-title">详情</div>
     <div v-for="(item, index) in dataList">
       <el-table
         :data="item.nodeList"
@@ -125,10 +125,12 @@
 </template>
 
 <script>
-import { getMonitoringDetail } from '@/api/production'
+import {getMonitoringDetail, getRecordingDetail} from '@/api/production'
+import { getProductionDetail } from '@/api/sale'
 import AttachDetail from '@/views/modules/common/attach-detail'
 import AttachDetailDialog from '@/views/modules/common/attach-detail-dialog'
 import InspectTypeDialog from '@/views/modules/production/inspect-type-dialog'
+import {getProdInfoById} from '@/api/trace'
 export default {
   name: 'prod-management-details',
   components: {InspectTypeDialog, AttachDetailDialog, AttachDetail},
@@ -154,15 +156,45 @@ export default {
       this.$emit('onChose')
     },
     // 初始化表单
-    async init (id) {
-      await getMonitoringDetail(id).then(async ({ data }) => {
-        if (data && data.code === '200') {
-          this.dataList = data.data
-        } else {
-          this.$message.error(data.msg)
-          this.handleClose()
-        }
-      })
+    async init (id, type) {
+      // type: 详情来源,1: 生产监控;2:生产记录;3:发货管理;4:追溯中心
+      if (type === 1) {
+        await getMonitoringDetail(id).then(async ({ data }) => {
+          if (data && data.code === '200') {
+            this.dataList = data.data
+          } else {
+            this.$message.error(data.msg)
+            this.handleClose()
+          }
+        })
+      } else if (type === 2) {
+        await getRecordingDetail(id).then(async ({data}) => {
+          if (data && data.code === '200') {
+            this.dataList = data.data
+          } else {
+            this.$message.error(data.msg)
+            this.handleClose()
+          }
+        })
+      } else if (type === 3) {
+        await getProductionDetail(id).then(async ({data}) => {
+          if (data && data.code === '200') {
+            this.dataList = data.data
+          } else {
+            this.$message.error(data.msg)
+            this.handleClose()
+          }
+        })
+      } else if (type === 4) {
+        await getProdInfoById(id).then(async ({data}) => {
+          if (data && data.code === '200') {
+            this.dataList = data.data
+          } else {
+            this.$message.error(data.msg)
+            this.handleClose()
+          }
+        })
+      }
     },
     handleClose () {
       this.$emit('close')

+ 5 - 4
src/views/modules/production/recording.vue

@@ -87,16 +87,17 @@
       </el-pagination>
     </template>
     <!-- 弹窗, 查看 -->
-    <detail v-if="detailsVisible" ref="details" @close="closeDialogEvent" @refreshDataList="getDataList" @onChose="onChose"/>
+    <prod-management-details v-if="detailsVisible" ref="details" @close="closeDialogEvent" @refreshDataList="getDataList" @onChose="onChose"/>
   </div>
 </template>
 
 <script>
   import Detail from './recording-details'
   import { getRecordingList } from '@/api/production'
-  export default {
+  import ProdManagementDetails from '@/views/modules/production/prod-management-details'
+export default {
     name: 'recording',
-    components: {Detail},
+    components: {ProdManagementDetails, Detail},
     data () {
       return {
         detailsVisible: false,
@@ -175,7 +176,7 @@
       details (id) {
         this.detailsVisible = true
         this.$nextTick(() => {
-          this.$refs.details.init(id)
+          this.$refs.details.init(id, 2)
         })
       },
       closeDialogEvent () {

+ 10 - 4
src/views/modules/trace/order-detail.vue

@@ -116,7 +116,7 @@
     </span>
 
     <!-- 弹窗, 新增 / 修改 -->
-    <product-detail v-if="prodVisible" ref="detail" @onChose="onChildClose"/>
+    <prod-management-details v-if="prodVisible" ref="detail" @onChose="onChildClose"/>
   </div>
   <!-- </el-dialog> -->
 </template>
@@ -129,10 +129,16 @@
   import uploadComponent from '../common/upload-component'
   import ApproveComponent from '../common/approve-component'
   import ProductDetail from './product-detail'
-  export default {
+  import ProdManagementDetails from '@/views/modules/production/prod-management-details'
+export default {
     name: 'order-detail',
     components: {
-      EDesc, EDescItem, uploadComponent, ApproveComponent, ProductDetail
+      ProdManagementDetails,
+      EDesc,
+      EDescItem,
+      uploadComponent,
+      ApproveComponent,
+      ProductDetail
     },
     data () {
       return {
@@ -243,7 +249,7 @@
       prodDetailHandle (productdId, prodCode) {
         this.prodVisible = true
         this.$nextTick(() => {
-          this.$refs.detail.init(productdId, prodCode)
+          this.$refs.detail.init(productdId, 4)
         })
       }
     }