春风项目四线(合箱线、总装线)
yyt
2024-05-23 04b8eff075a04db23e6f908855699b4d2954588c
提交 | 用户 | 时间
d4f437 1 <template>
Y 2   <div class="app-container">
3     <div style="height: 100%;width: 100%">
4       <el-card class="box-card">
5         <el-form :model="queryParams" size="large" :inline="true" label-width="68px" @submit.native.prevent>
6           <el-form-item label-width="200" label="箱体码" :prop="queryParams.productionNotice"  style="align-content: center">
7             <input v-model="queryParams.productionNotice"
8                       ref="inputdata"
9                    style="height: 39px; width: 300px"
10                    placeholder="请扫描箱体码"
11                      />
12           </el-form-item>
13 <!--          <el-button size="large" type="primary" >上线</el-button>-->
14 <!--          <el-button size="large" type="danger">下线</el-button>-->
15           <el-button size="large" type="info" @click="refresh">返回</el-button>
16         </el-form>
17       </el-card>
18       <el-row :gutter="0">
19         <el-col :span="6">
20           <div >
21             <el-card style="height: 460px">
22               <el-descriptions class="margin-top" :column="1" direction="horizontal">
23                 <el-descriptions-item label="生产订单">{{singleSelect.workOrderNo}}</el-descriptions-item>
24                 <el-descriptions-item label="机型" :span="2">{{singleSelect.typeZ}}</el-descriptions-item>
25                 <el-descriptions-item label="计划数量">
26                   {{singleSelect.planQty}}
27                 </el-descriptions-item>
28                 <el-descriptions-item label="上线数量">{{onlineNum}}</el-descriptions-item>
29                 <el-descriptions-item label="完成数量">{{finishNum}}</el-descriptions-item>
30                 <el-descriptions-item label="不合格数">{{unReachNum}}</el-descriptions-item>
31               </el-descriptions>
32             </el-card>
33           </div>
34         </el-col>
35         <el-col :span="18">
36           <div>
37             <el-card style="height: 460px; overflow: auto">
38               <el-table border :data="orderSchedulingList">
39                 <el-table-column
40                   type="index"
41                   label="序号"
42                   width="50"></el-table-column>
43                 <el-table-column label="生产订单" align="center" prop="orderNo" width="130">
44
45                 </el-table-column>
46                 <el-table-column label="发动机号" align="center" prop="engineNo" width="150">
47
48                 </el-table-column>
49                 <el-table-column label="机型" align="center" prop="model">
50
51                 </el-table-column>
52                 <el-table-column label="生产状态" align="center" prop="productionStatus">
53                   <template slot-scope="scope">
54                     <dict-tag :options="dict.type.order_scheduling_produce_status" :value="scope.row.productionStatus"/>
55                   </template>
56                 </el-table-column>
57                 <el-table-column label="质量状态" align="center" prop="qualityStatus">
58                   <template slot-scope="scope">
59                     <dict-tag :options="dict.type.quality_status" :value="scope.row.qualityStatus"/>
60                   </template>
61                 </el-table-column>
62
63
64                 <el-table-column label="操作人" align="center" prop="operator">
65                 </el-table-column>
66                 <el-table-column label="操作时间" align="center" prop="operateTime" width="160">
67                   <template slot-scope="scope">
68                     <span>{{ parseTime(scope.row.operateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
69                   </template>
70                 </el-table-column>
71
72               </el-table>
73               <pagination
74                 v-show="total>0"
75                 :total="total"
76                 :page.sync="queryParams.pageNum"
77                 :limit.sync="queryParams.pageSize"
78                 @pagination="getListData"
79               />
80             </el-card>
81           </div>
82         </el-col>
83       </el-row>
84     </div>
85   </div>
86 </template>
87
88 <script>
89
90 import { engineNoIsInModel, getSumDataMethod, listOrderScheduling3 } from "../../../../api/main/bs/orderScheduling/orderScheduling";
91 export default {
92   name: 'Detail',
93   props: ['singleSelect'],
94   dicts: ['order_scheduling_produce_status','quality_status','print_status','material_type'],
95   data(){
96     return{
97       // 总条数
98       total: 0,
99       queryParams: {
100         orderNo:'',
101         pageNum: 1,
102         pageSize: 10,
103       },
104       orderSchedulingList: [],
105       onlineNum: 0,
106       finishNum: 0,
107       unReachNum: 0,
108       scannerFlag: false
109     }
110   },
111   methods:{
112     handleQuery(){
113
114     },
115     refresh() {
116       location.reload();
117     },
118     setFocus(){
119       this.$nextTick(()=>{
120         this.$refs.inputdata.focus()
121       })
122     },
123     handleScannerInput(event){
124       if (this.scannerFlag){
125         this.queryParams.productionNotice = ''
126         this.$refs.inputdata.value = ''
127         this.scannerFlag = false
128       }
129       console.log('+++++++++++++++=++++++',event)
130       const input = event.target
131       const inputValue = input.value
132       this.queryParams.productionNotice = inputValue
133       console.log('----------------------',this.queryParams.productionNotice)
134       if (event.key === 'Enter'){
135         this.scannerFlag = true
136         //扫描完成
137         engineNoIsInModel({engineNo:this.queryParams.productionNotice,
138           model:this.singleSelect.typeZ,orderNo:this.singleSelect.workOrderNo
139         }).then(res => {
140           console.log('rerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrs----',res)
141           if (res.data===500){
142             console.log('====---===')
143             this.$message({
144               message:res.msg,
145               type:'warning'
146             })
147           }else {
148             this.$message({
149               message:'操作成功',
150               type:'success'
151             })
152             this.getListData()
153           }
154         })
155       }
156     },
157     //查询列表
158     getListData(){
159       console.log('this.queryParams.workOrderNo',this.singleSelect.workOrderNo)
160       this.queryParams.orderNo = this.singleSelect.workOrderNo
161       console.log('this.queryParams',this.queryParams)
162       listOrderScheduling3(this.queryParams).then(res => {
163         this.orderSchedulingList = res.rows
164         this.total = res.total
165       })
166       getSumDataMethod(this.queryParams).then(res =>{
167         console.log('res',res)
168         this.onlineNum = res.data.onlineNum
169         this.finishNum = res.data.finishNum
170         this.unReachNum = res.data.unqualified
171       })
172     }
173   },
174   mounted() {
175     console.log('singleSelect111',this.singleSelect)
176     this.getListData()
177     this.setFocus()
178     this.$refs.inputdata.addEventListener('keydown',this.handleScannerInput)
179   },
180   beforeDestroy() {
181     this.$refs.inputdata.removeEventListener('keydown',this.handleScannerInput)
182   }
183 }
184 </script>