Forráskód Böngészése

不合格品台账

damon227 1 éve
szülő
commit
2d1c3ff1a1

+ 18 - 10
src/views/modules/quality/unqualified.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <template>
+    <template v-if="!inboundVisible">
       <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
         <el-form-item label="物料名称">
           <el-input
@@ -73,7 +73,7 @@
         >
         </el-table-column>
         <el-table-column
-          prop="disqualificationCnt"
+          prop="damageCnt"
           header-align="center"
           align="center"
           :show-tooltip-when-overflow="true"
@@ -81,7 +81,7 @@
         >
         </el-table-column>
         <el-table-column
-          prop="measureStateStr"
+          prop="stateStr"
           header-align="center"
           align="center"
           :show-tooltip-when-overflow="true"
@@ -97,10 +97,10 @@
         >
           <template slot-scope="scope">
             <el-button
-              v-if="isAuth('quality:unqualified:update')"
+              v-if="isAuth('quality:unqualified:putin')"
               type="text"
               size="small"
-              @click="updateHandle(scope.row)"
+              @click="inboundHandle(scope.row)"
               >入库</el-button
             >
           </template>
@@ -117,16 +117,19 @@
       >
       </el-pagination>
     </template>
+    <stock-order-inbound ref="inbound" v-if="inboundVisible" @onChose="onChose"/>
   </div>
 </template>
 
 <script>
 import {getUnqList} from '@/api/quality'
+import StockOrderInbound from '../warehouse/stock-order-inbound'
 export default {
   name: 'quality-unqualified',
+  components: {StockOrderInbound},
   data () {
     return {
-      updateVisible: false,
+      inboundVisible: false,
       dataForm: {},
       dataList: [],
       pageIndex: 1,
@@ -141,7 +144,7 @@ export default {
   },
   methods: {
     onChose () {
-      this.updateVisible = false
+      this.inboundVisible = false
     },
     search () {
       this.pageIndex = 1
@@ -170,6 +173,9 @@ export default {
         if (data && data.code === '200') {
           this.dataList = data.data.records
           this.totalPage = Number(data.data.total)
+          this.dataList.forEach(item => {
+            item.stateStr = item.state === '1' ? '待入库' : item.state === '2' ? '已入库' : ''
+          })
         } else {
           this.dataList = []
           this.totalPage = 0
@@ -177,10 +183,12 @@ export default {
         this.dataListLoading = false
       })
     },
-    updateHandle (item) {
-      this.updateVisible = true
+    inboundHandle (item) {
+      item.sourceCategory = '4'
+      item.cnt = item.damageCnt
+      this.inboundVisible = true
       this.$nextTick(() => {
-        this.$refs.update.init(item)
+        this.$refs.inbound.init(0, false, item)
       })
     }
   }

+ 1 - 0
src/views/modules/warehouse/in-handle.vue

@@ -161,6 +161,7 @@
       }
     },
     methods: {
+      init (item) {},
       // 获取数据列表
       getDataList () {
         this.dataListLoading = true

+ 2 - 1
src/views/modules/warehouse/stock-order-inbound.vue

@@ -145,7 +145,8 @@
         optionsSourceCategory: [
           {code: '1', value: '采购入库'},
           {code: '2', value: '生产入库'},
-          {code: '3', value: '委外入库'}
+          {code: '3', value: '委外入库'},
+          {code: '4', value: '不合格品入库'}
         ]
       }
     },