chrislee 11 сар өмнө
parent
commit
e7ee729fcb

+ 2 - 0
src/views/modules/production/components/print-label.vue

@@ -104,6 +104,7 @@ export default {
     },
     onChose () {
       this.visible = false
+      this.$emit('onChose')
     },
     async modelChange (value) {
       const that = this
@@ -202,6 +203,7 @@ export default {
           // 打印
           this.sendPrint()
           this.onChose()
+          this.$emit('addOne', this.dataForm)
         }
       })
     }

+ 20 - 3
src/views/modules/production/monitoring.vue

@@ -119,11 +119,11 @@
           fixed="right"
           header-align="center"
           align="center"
-          width="120"
+          width="150"
           label="操作">
           <template slot-scope="scope">
             <el-button v-if="isAuth('prod:monitoring:info')" type="text" size="small" @click="detailHandle(scope.row)">查看</el-button>
-            <el-button type="text" size="small" @click="printLabel(scope.row)">打印标签</el-button>
+            <el-button type="text" size="small" @click="printLabel(scope.row)">打印标签 + {{scope.row.printCnt}}</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -142,7 +142,7 @@
     <purchase-detail v-if="purchaseVisible" ref="purchase" @refreshDataList="getDataList" @onChose="onChose"/>
     <outsource-detail  v-if="outsourceVisible" ref="outsource" @refreshDataList="getDataList" @onChose="onChose"/>
     <!-- 打印标签 -->
-    <print-label v-if="printLabelVisible" ref="printLabel" @onChose="onChose"/>
+    <print-label v-if="printLabelVisible" ref="printLabel" @onChose="onChose" @addOne="addOneClick"/>
   </div>
 </template>
 
@@ -211,6 +211,12 @@ export default {
         getMonitoringList(params).then(({data}) => {
           if (data && data.code === '200') {
             this.dataList = data.data.records
+            // 设置已打印标签数量的初始值
+            if (this.dataList) {
+              this.dataList.forEach((item) => {
+                item.printCnt = 0
+              })
+            }
             this.totalPage = Number(data.data.total)
           } else {
             this.dataList = []
@@ -288,6 +294,17 @@ export default {
           // 详情
             this.detail(row.id, row.prodCode, true)
         }
+      },
+      addOneClick (row) {
+        // this.dataList 中匹配 row.id,找到对应的数据
+        this.dataList.forEach((item) => {
+          if (item.id === row.id) {
+            if (!item.printCnt) {
+              item.printCnt = 0
+            }
+            item.printCnt += 1
+          }
+        })
       }
     }
   }

+ 20 - 3
src/views/modules/production/recording.vue

@@ -95,11 +95,11 @@
           fixed="right"
           header-align="center"
           align="center"
-          width="120"
+          width="140"
           label="操作">
           <template slot-scope="scope">
             <el-button v-if="isAuth('prod:record:info')" type="text" size="small" @click="details(scope.row.id)">查看</el-button>
-            <el-button type="text" size="small" @click="printLabel(scope.row)">打印标签</el-button>
+            <el-button type="text" size="small" @click="printLabel(scope.row)">打印标签 + {{scope.row.printCnt}}</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -116,7 +116,7 @@
     <!-- 弹窗, 查看 -->
     <prod-management-details v-if="detailsVisible" ref="details" @close="closeDialogEvent" @refreshDataList="getDataList" @onChose="onChose"/>
     <!-- 打印标签 -->
-    <print-label v-if="printLabelVisible" ref="printLabel" @onChose="onChose"/>
+    <print-label v-if="printLabelVisible" ref="printLabel" @onChose="onChose" @addOne="addOneClick"/>
   </div>
 </template>
 
@@ -182,6 +182,12 @@ export default {
         getRecordingList(params).then(({data}) => {
           if (data && data.code === '200') {
             this.dataList = data.data.records
+            // 设置已打印标签数量的初始值
+            if (this.dataList) {
+              this.dataList.forEach((item) => {
+                item.printCnt = 0
+              })
+            }
             this.totalPage = Number(data.data.total)
           } else {
             this.dataList = []
@@ -226,6 +232,17 @@ export default {
         if (!row.state) return ''
         const item1 = this.optionsState.find((item) => item.code === row.state.toString())
         return item1 ? item1.value : ''
+      },
+      addOneClick (row) {
+        // this.dataList 中匹配 row.id,找到对应的数据
+        this.dataList.forEach((item) => {
+          if (item.id === row.id) {
+            if (!item.printCnt) {
+              item.printCnt = 0
+            }
+            item.printCnt += 1
+          }
+        })
       }
     }
   }

+ 20 - 3
src/views/modules/production/scheduling.vue

@@ -162,7 +162,7 @@
           fixed="right"
           header-align="center"
           align="center"
-          width="220"
+          width="240"
           label="操作">
           <template slot-scope="scope">
             <el-button v-if="isAuth('prod:production:updateCheck') && Number(scope.row.prodState) === 0" type="text" size="small" @click="check(scope.row)">核料</el-button>
@@ -171,7 +171,7 @@
 <!--            <el-button v-if="isAuth('prod:production:examine') && Number(scope.row.prodState) === 1" type="text" size="small" @click="preCheck(scope.row.id)">试制前检查</el-button>-->
             <el-button v-if="isAuth('prod:production:plan') && Number(scope.row.prodState) === 2" type="text" size="small" @click="detail(scope.row.id, true)" v-reClick>排产</el-button>
 <!--            <el-button v-if="isAuth('pur:commDetail:save') && Number(scope.row.outsourcing) === 0" type="text" size="small" @click="outsourceHandle(scope.row.id)">委外生产</el-button>-->
-            <el-button type="text" size="small" @click="printLabel(scope.row)">打印标签</el-button>
+            <el-button type="text" size="small" @click="printLabel(scope.row)">打印标签 + {{scope.row.printCnt}}</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -198,7 +198,7 @@
     <!-- 对应工艺 -->
     <crafts-detail v-if="craftsVisible" ref="craftsDetail"/>
     <!-- 打印标签 -->
-    <print-label v-if="printLabelVisible" ref="printLabel" @onChose="onChose"/>
+    <print-label v-if="printLabelVisible" ref="printLabel" @onChose="onChose" @addOne="addOneClick"/>
   </div>
 </template>
 
@@ -320,6 +320,12 @@ export default {
         getSchedulingList(params).then(({data}) => {
           if (data && data.code === '200') {
             this.dataList = data.data.records
+            // 设置已打印标签数量的初始值
+            if (this.dataList) {
+              this.dataList.forEach((item) => {
+                item.printCnt = 0
+              })
+            }
             this.totalPage = Number(data.data.total)
           } else {
             this.dataList = []
@@ -434,6 +440,17 @@ export default {
             this.$message.error(data.msg)
           }
         })
+      },
+      addOneClick (row) {
+        // this.dataList 中匹配 row.id,找到对应的数据
+        this.dataList.forEach((item) => {
+          if (item.id === row.id) {
+            if (!item.printCnt) {
+              item.printCnt = 0
+            }
+            item.printCnt += 1
+          }
+        })
       }
     }
   }