瀏覽代碼

bugfix: 188/189

chrislee 1 年之前
父節點
當前提交
c783efb778
共有 1 個文件被更改,包括 45 次插入23 次删除
  1. 45 23
      src/views/modules/production/monitoring.vue

+ 45 - 23
src/views/modules/production/monitoring.vue

@@ -1,7 +1,7 @@
 <!-- 生产监控管理 -->
 <template>
   <div class="production">
-    <template v-if="!detailsVisible">
+    <template v-if="!detailsVisible && !outsourceVisible && !purchaseVisible">
       <el-form :inline="true" :model="dataForm" @keyup.enter.native="queryPage()">
         <el-form-item label="合同号">
           <el-input v-model="dataForm.orderCode" placeholder="合同号" clearable/>
@@ -101,7 +101,7 @@
           width="80"
           label="操作">
           <template slot-scope="scope">
-            <el-button v-if="isAuth('prod:monitoring:info')" type="text" size="small" @click="detail(scope.row.id, scope.row.prodCode, true)">查看</el-button>
+            <el-button v-if="isAuth('prod:monitoring:info')" type="text" size="small" @click="detailHandle(scope.row)">查看</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -117,18 +117,24 @@
     </template>
     <!-- 弹窗, 查看 -->
     <detail v-if="detailsVisible" ref="details" @close="closeDialogEvent" @refreshDataList="getDataList" @onChose="onChose"/>
+    <purchase-detail v-if="purchaseVisible" ref="purchase" @refreshDataList="getDataList" @onChose="onChose"/>
+    <outsource-detail  v-if="outsourceVisible" ref="outsource" @refreshDataList="getDataList" @onChose="onChose"/>
   </div>
 </template>
 
 <script>
   import Detail from './monitoring-details'
   import { getMonitoringList } from '@/api/production'
-  export default {
+  import PurchaseDetail from '@/views/modules/sale/purchase-detail'
+import OutsourceDetail from '@/views/modules/sale/outsource-detail'
+export default {
     name: 'monitoring',
-    components: {Detail},
+    components: {OutsourceDetail, PurchaseDetail, Detail},
     data () {
       return {
         detailsVisible: false,
+        purchaseVisible: false,
+        outsourceVisible: false,
         dataForm: {},
         dataList: [],
         pageIndex: 1,
@@ -136,33 +142,18 @@
         totalPage: 0,
         dataListLoading: false,
         dataListSelections: [],
-        // // 状态:1:待排产,2:生产中,3:生产完成
-        // optionsState: [
-        //   {
-        //     code: '1',
-        //     value: '待排产'
-        //   },
-        //   {
-        //     code: '2',
-        //     value: '生产中'
-        //   },
-        //   {
-        //     code: '3',
-        //     value: '生产完成'
-        //   }
-        // ],
         optionsState: [
           {
-            code: '1', value: '待核料'
+            code: '2', value: '待处理'
           },
           {
-            code: '2', value: '采购'
+            code: '3', value: '采购'
           },
           {
-            code: '3', value: '委外'
+            code: '4', value: '委外'
           },
           {
-            code: '4', value: '生产'
+            code: '5', value: '生产'
           }
         ]
       }
@@ -173,6 +164,8 @@
     methods: {
       onChose () {
         this.detailsVisible = false
+        this.outsourceVisible = false
+        this.purchaseVisible = false
       },
       // 查询
       queryPage () {
@@ -221,6 +214,18 @@
           this.$refs.details.init(id, prodCode, disable)
         })
       },
+      outsourceDetail (row) {
+        this.outsourceVisible = true
+        this.$nextTick(() => {
+          this.$refs.outsource.init(row.tableId)
+        })
+      },
+      purchaseDetail (row) {
+        this.purchaseVisible = true
+        this.$nextTick(() => {
+          this.$refs.purchase.init(row.tableId)
+        })
+      },
       // 创建新物料
       createNewProduct () {
         this.$message.warning('功能暂未开放')
@@ -232,6 +237,23 @@
         if (!row.state) return ''
         const item1 = this.optionsState.find((item) => item.code === row.state.toString())
         return item1 ? item1.value : ''
+      },
+      detailHandle (row) {
+        if (!row || !row.state) return
+        let s = Number(row.state)
+        switch (s) {
+          case 3:
+          // 调用采购详情页
+            this.purchaseDetail(row)
+            break
+          case 4:
+          // 调用委外详情页
+            this.outsourceDetail(row)
+            break
+          default:
+          // 详情
+            this.detail(row.id, row.prodCode, true)
+        }
       }
     }
   }