| 
					
				 | 
			
			
				@@ -98,12 +98,20 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         label="报损说明"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </el-table-column> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <el-table-column 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        prop="-" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        prop="createTime" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         header-align="center" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         align="center" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         min-width="160" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         label="报损时间"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </el-table-column> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <el-table-column 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        prop="state" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        header-align="center" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        align="center" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        :formatter="formatState" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        min-width="120" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        label="状态"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </el-table-column> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <el-table-column 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         fixed="right" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         header-align="center" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -111,7 +119,8 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         width="140" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         label="操作"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <template slot-scope="scope"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <el-button type="text" size="small" @click="detailHandle(scope.row.recordId)">查看</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-button v-if="isAuth('prod:damage:info')" type="text" size="small" @click="detailHandle(scope.row.recordId)">查看</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-button v-if="isAuth('prod:damage:again') && Number(scope.row.state) !== 2" type="text" size="small" @click="reScheduleHandle(scope.row.recordId)">重新排产</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </el-table-column> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </el-table> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -130,7 +139,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   import Detail from './damage-details' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  import { getDamageList } from '@/api/production' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  import { getDamageList, reSchedule } from '@/api/production' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     name: 'damage', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     components: {Detail}, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -206,6 +215,30 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.$nextTick(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           this.$refs.detail.init(id) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 状态 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      formatState (row) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!row.state) return '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (Number(row.state) === 1) return '未重新排产' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (Number(row.state) === 2) return '已重新排产' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 重新排产 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      reScheduleHandle (id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        reSchedule(id).then(({data}) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          if (data && data.code === '200') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.$message({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              message: '操作成功', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              type: 'success', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              duration: 1500, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              onClose: () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                this.getDataList() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.$message.error(data.msg) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   } 
			 |