hdy
2024-07-10 a4362dfe3e0e9c6fad426685da0065455799d018
提交 | 用户 | 时间
0cceb6 1 <template>
Y 2   <div class="app-container">
3     <el-row :gutter="3">
4       <el-col :span="6">
5         <el-card shadow="always" class="boxSize">
6           <div class="centerImg">
7             <img style="width: 140px;height: 30px;" src="@/assets/logo/jcdm2.png" alt="dark">
8             <!--            <span class="nextLine" style="font-weight: bold">{{currentTime}}</span>-->
9           </div>
10
11         </el-card>
12       </el-col>
13       <el-col :span="3">
14         <el-card shadow="always" class="boxSize">
15           <span class="centerText" style="height: 60px">{{locationCode}}</span>
16         </el-card>
17       </el-col>
18       <el-col :span="15">
19         <el-card shadow="always" class="boxSize">
20           <span class="centerText" >{{locationName}}</span>
21         </el-card>
22       </el-col>
23     </el-row>
24    <el-row :gutter="0"  >
25      <el-col :span="14">
26        <el-card   class="box-card" style="margin-top: 5px" >
ada5f3 27          <el-form :model="form" size="large" :inline="true" label-width="68px" @submit.native.prevent>
Y 28                <el-form-item label-width="200" label="发动机码" :prop="form.engineNo"  style="align-content: center">
29                  <input v-model="form.engineNo"
30                         ref="inputdata"
31                         style="height: 39px; width: 300px"
32                         placeholder="请输入发动机码"
33                  />
0cceb6 34                </el-form-item>
ada5f3 35          </el-form>
0cceb6 36              <el-form ref="form" :model="form"  label-width="25%"  >
Y 37                <el-form-item   prop="productType"style="margin-top: 30px" >
38                   <span slot="label" style="font-size:22px;color:black"><strong>机型</strong></span>
39                  <el-input disabled style="font-size:20px"  value="form.productType" v-model="form.productType" placeholder="" />
40                </el-form-item>
41              </el-form>
42              <el-form ref="form" :model="form"  label-width="25%"  >
43                <el-form-item   prop="orderNo" style="margin-top: 30px">
44                <span  slot="label" style="font-size:22px;color:black"><strong>工单编号</strong></span>
45                  <el-input disabled style="font-size:20px" v-model="form.orderNo" placeholder="" />
46                </el-form-item>
47              </el-form>
48              <el-form ref="form" :model="form"  label-width="25%"  >
49                <el-form-item   prop="currentWorkstation" style="margin-top: 30px">
50                <span slot="label" style="font-size:22px;color:black"><strong>质量状态</strong></span>
51                  <el-input disabled style="font-size:20px" v-model:value="form.add" placeholder="" />
52                </el-form-item>
53              </el-form>
54          <el-divider></el-divider>
55
56          <el-row :gutter="10" class="mb8" type="flex" justify="center"  style="text-align: center">
57            <el-col :span="1.5">
ada5f3 58              <el-button plain  :disabled="buttondisabled" type="primary" style="width:400px;height:160px" v-hasPermi="['bs:formula:add']">
0cceb6 59                <span   class="el-icon-thumb"   style="font-size:40px;color:black"></span>
Y 60                <span style="font-size:45px;color:black"><strong>强制上线</strong></span>
61              </el-button>
62            </el-col>
63          </el-row>
64        </el-card>
65      </el-col>
66
67      <el-col :span="10"  inline style="margin-top: 5px">
68          <el-card class="custom-content" style="height: 530px" >
69          <el-col :span="14"style="  ">
70            <span style="font-size:25px"><strong>质量数据</strong></span>
71            <el-divider></el-divider>
72            {{this.form.engineCheckList}}
73          </el-col>
74          </el-card>
75      </el-col>
76    </el-row>
77   </div>
78 </template>
79 <script>
80
81 import { listOrderScheduling, getOrderScheduling, delOrderScheduling, addOrderScheduling, updateOrderScheduling } from "@/api/main/bs/orderScheduling/orderScheduling";
8069b5 82 import {listPassingStationCollection, getPassingStationCollection, delPassingStationCollection, addPassingStationCollection, updatePassingStationCollection,initializedData } from "@/api/main/da/passingStationCollection/passingStationCollection";
0cceb6 83 import {listLineInfo} from "@/api/main/bs/lineInfo/lineInfo";
Y 84 import {getIp, listStationConf} from "@/api/main/sc/stationConf";
85
86 export default {
87   components: { },
88   options: [],
89   props: [],
90   data() {
91     return {
92       options: [],
93       total: 0,
94       engineCheckList:[],
95       showFlag:false,
96       buttondisabled:true,
a4362d 97       locationCode: "未配置IP",
0cceb6 98       locationName: "未配置工位",
Y 99
ada5f3 100       scannerFlag: false,
Y 101       barcode: "",
0cceb6 102
Y 103       // 查询参数
104       queryParams: {
105         pageNum: 1,
106         pageSize: 10,
107         engineNo: null,
108         productType:null,
109         orderNo:null,
110         qualityStatus:null,
111         currentWorkstation: null,
112         add: null,
113         engineCheckList:'暂无数据',
114       },
115       // 表单参数
116       form: {
117         engineNo: null,
118         productType:null,
119         orderNo:null,
120         qualityStatus:null,
121         currentWorkstation: null,
122         add: null,
123         engineCheckList:'暂无数据',
124       },
125       add: null,
126     };
127   },
128   computed: {},
129   watch: {},
ada5f3 130
Y 131   beforeDestroy() {
132     this.$refs.inputdata.removeEventListener('keydown',this.handleScannerInput)
0cceb6 133   },
Y 134   mounted() {
ada5f3 135     this.setFocus()
Y 136     this.$refs.inputdata.addEventListener('keydown',this.handleScannerInput)
0cceb6 137     this.getStationConf();
Y 138   },
139   methods: {
ada5f3 140
Y 141     refresh() {
142       location.reload();
143     },
144     setFocus(){
145       this.$nextTick(()=>{
146         this.$refs.inputdata.focus()
147       })
148     },
149     handleScannerInput(event){
150       if (this.scannerFlag){
151         this.form.engineNo = ''
152         this.$refs.inputdata.value = ''
153         this.scannerFlag = false
154       }
155       const input = event.target
156       const inputValue = input.value
157       this.form.engineNo = inputValue
158       if (event.key === 'Enter'){
159         this.scannerFlag = true
160         console.log("条码:",this.form.engineNo)
161         if(this.form.engineNo !== null && this.form.engineNo !== undefined) {
a4362d 162           console.log("条码2:",this.locationCode)
8069b5 163             initializedData({sfcCode:this.form.engineNo,locationCode:this.locationCode}).then(res =>{
a4362d 164               if(res.code===500){
H 165                   this.$createElement;
166               }else {
167                 addPassingStationCollection({sfcCode:this.form.engineNo,locationCode:this.locationCode}).then(res =>{
168                   console.log("rrrrr",res)})
169                 this.$message({
170                   message: '扫码成功',
171                   type: 'success'
172                 });
173               }
8069b5 174             })
ada5f3 175         }else{
Y 176           this.reset();
177           this.buttondisabled = true
178           const h = this.$createElement;
179           this.$message({
180             message: h('p',null, [
181               h('span', null, '警告 '),
182               h('i', { style: 'color: black' }, '输入的发动机号有误'),
183               h()]),
184             type: 'error',
185             center: true,
186             offset:300
187           });
188         }
8069b5 189
ada5f3 190       }
8069b5 191       // this.AddEngineNo();
ada5f3 192     },
Y 193
8069b5 194     handleScannerInput111(event){
H 195       const param = {
196         sfcCode: this.from.engineNo,
197       }
198       addPassingStationCollection(param).then(response => {
199       });
200     },
201
202
203     // AddEngineNo(){
204     //   const param = {
205     //     locationCode: this.from.locationCode,
206     //     sfcCode: this.from.engineNo,
207     //     // locationCode:"OP110",
208     //     // sfcCode:"666",
209     //
210     //   }
211     //       addPassingStationCollection(param).then(response =>{});
212     // },
ada5f3 213
0cceb6 214     getStationConf() {
Y 215       getIp().then(response => {
216         let queryParams = {
217           ipAddress: response.msg,
218         }
219         listStationConf(queryParams).then(response => {
220           this.locationName = response.rows[0].processesName
221           this.locationCode = response.rows[0].processesCode
222         });
223
224       });
225
226     },
227     reset() {
228       this.form = {
229         engineNo:null,
230         productType:null,
231         orderNo:null,
232         qualityStatus:null,
233         currentWorkstation: null,
234         add: null,
235         engineCheckList:'暂无数据',
236       };
237       this.resetForm("form");
238     },
239     EngineNohandleChange(){
ada5f3 240       console.log('条码:',this.form.engineNo)
0cceb6 241       if(this.form.engineNo !== null && this.form.engineNo !== undefined){
Y 242         setSNCode(this.form.engineNo,this.locationCode)
243       }
244     },
245
246   },
247   }
248
249 </script>
250 <style scoped>
251 ::v-deep .el-input__inner{
252   height: 40px;
253 }
254 ::v-deep .el-form-item__label {
255   line-height: 40px;
256 }
257 .custom-content {
258   height: 50%; /* 设置高度为50% */
259 }
260
261 .boxSize{
262   height: 60px;
263 }
264 .centerText{
265   color: black;
266   font-weight: bold;
267   font-size: 20px;
268   display: flex;
269   justify-content: center;
270   margin-top: 5px
271 }
8069b5 272
0cceb6 273 </style>