春风项目四线(合箱线、总装线)
yyt
2024-05-23 04b8eff075a04db23e6f908855699b4d2954588c
提交 | 用户 | 时间
d4f437 1 <template>
Y 2   <div class="app-container">
3     <el-card   class="box-card"  style="height: 60px" >
4       <template>
5         <div class="container" type="flex" justify="center" style="text-align:center">
696fd5 6           <el-divider><span style="font-size:30px;color:black"><strong>曲轴扫码上线</strong></span></el-divider>
d4f437 7         </div>
Y 8       </template>
9     </el-card>
10     <el-row :gutter="3">
11       <el-col :span="6">
12         <el-card shadow="always" class="boxSize">
13           <div class="centerImg">
14             <img style="width: 140px;height: 30px;" src="@/assets/logo/jcdm2.png" alt="dark">
15           </div>
16         </el-card>
17       </el-col>
18       <el-col :span="3">
19         <el-card shadow="always" class="boxSize">
20           <span class="centerText" style="height: 60px">{{locationCode}}</span>
21         </el-card>
22       </el-col>
23       <el-col :span="15">
24         <el-card shadow="always" class="boxSize">
25           <span class="centerText" >{{locationName}}</span>
26         </el-card>
27       </el-col>
28     </el-row>
29    <el-row :gutter="0"  >
30      <el-col :span="14">
31        <el-card   class="box-card" style="margin-top: 5px" >
32              <el-form ref="form" :model="form"  label-width="25%"   >
33                <el-form-item prop="engineNo" style="margin-top: 16px">
34                <span slot="label" style="font-size:22px;color:black;"><strong>曲轴码</strong></span>
04b8ef 35                  <el-input style="font-size:20px" v-model="form.barcode" placeholder="请扫描曲轴码" clearable  @input="EngineNohandleChange">
d4f437 36                    <el-button slot="append" plain type="info" @click="EngineNohandleChange" icon="el-icon-search"></el-button>
Y 37                  </el-input>
38                </el-form-item>
39              </el-form>
40              <el-form ref="form" :model="form"  label-width="25%"  >
41                <el-form-item   prop="productType"style="margin-top: 30px" >
42                   <span slot="label" style="font-size:22px;color:black"><strong>机型</strong></span>
43                  <el-input disabled style="font-size:20px"  value="form.productType" v-model="form.productType" placeholder="" />
44                </el-form-item>
45              </el-form>
46              <el-form ref="form" :model="form"  label-width="25%"  >
47                <el-form-item   prop="orderNo" style="margin-top: 30px">
48                <span  slot="label" style="font-size:22px;color:black"><strong>工单编号</strong></span>
49                  <el-input disabled style="font-size:20px" v-model="form.orderNo" placeholder="" />
50                </el-form-item>
51              </el-form>
52              <el-form ref="form" :model="form"  label-width="25%"  >
53                <el-form-item   prop="currentWorkstation" style="margin-top: 30px">
54                <span slot="label" style="font-size:22px;color:black"><strong>质量状态</strong></span>
55                  <el-input disabled style="font-size:20px" v-model:value="form.add" placeholder="" />
56                </el-form-item>
57              </el-form>
58          <el-divider></el-divider>
59
60          <el-row :gutter="10" class="mb8" type="flex" justify="center"  style="text-align: center">
61            <el-col :span="1.5">
62              <el-button plain  :disabled="buttondisabled" type="primary" style="width:400px;height:160px" v-hasPermi="['bs:formula:add']" @click="forceOnline">
63                <span   class="el-icon-thumb"   style="font-size:40px;color:black"></span>
64                <span style="font-size:45px;color:black"><strong>强制上线</strong></span>
65              </el-button>
696fd5 66 <!--             <el-button @click="print">打印</el-button>-->
Y 67 <!--             <el-button @click="test1">生成二维码</el-button>-->
d4f437 68            </el-col>
Y 69          </el-row>
70        </el-card>
71      </el-col>
72
73      <el-col :span="10"  inline style="margin-top: 5px">
74        <el-card class="custom-content"  style="height: 264px">
75          <el-col :span="14">
76            <span style="font-size:25px"><strong>质量状态</strong></span>
77            <el-divider></el-divider>
78            {{this.form.engineCheckList}}
79          </el-col>
80        </el-card>
81        <el-card class="custom-content" style="height: 264px" >
82          <el-col :span="14"style="  ">
83            <span style="font-size:25px"><strong>最终结果</strong></span>
84            <el-divider></el-divider>
85            {{queryParams.productType}}
86          </el-col>
87        </el-card>
88      </el-col>
89    </el-row>
90   </div>
91 </template>
92 <script>
93
94 import { listOrderScheduling, getOrderScheduling, delOrderScheduling, addOrderScheduling, updateOrderScheduling } from "@/api/main/bs/orderScheduling/orderScheduling";
95 import { listPassingStationCollection, getPassingStationCollection, delPassingStationCollection, addPassingStationCollection, updatePassingStationCollection } from "@/api/main/da/passingStationCollection/passingStationCollection";
96 import {listLineInfo} from "@/api/main/bs/lineInfo/lineInfo";
04b8ef 97 import { setBarcode } from "@/api/main/da/opcuaconfig/opcuaconfig";
d4f437 98 import {getIp, listStationConf} from "@/api/main/sc/stationConf";
696fd5 99 import QRCode from "qrcodejs2";
d4f437 100
Y 101 export default {
102   components: { },
103   options: [],
104   props: [],
105   data() {
106     return {
107       options: [],
108       total: 0,
109       engineCheckList:[],
110       showFlag:false,
111       buttondisabled:true,
112       locationCode: "未配置",
113       locationName: "未配置工位",
114
115       codeValue: "",
116       code: "",
117       lastTime: "",
118       nextTime: "",
119       lastCode: "",
120       nextCode: "",
121       dtmainId: "",
122
123       // 查询参数
124       queryParams: {
125         pageNum: 1,
126         pageSize: 10,
127         engineNo: null,
128         productType:null,
129         orderNo:null,
130         qualityStatus:null,
131         currentWorkstation: null,
132         add: null,
133         engineCheckList:'暂无数据',
134       },
135       // 表单参数
136       form: {
04b8ef 137         barcode: null,
d4f437 138         productType:null,
Y 139         orderNo:null,
140         qualityStatus:null,
141         currentWorkstation: null,
142         add: null,
143         engineCheckList:'暂无数据',
144       },
145       add: null,
146     };
147   },
148   computed: {},
149   watch: {},
150   created() {
151     window.document.onkeypress = (e) => {
152       if (window.event) {
153         this.nextCode = e.keyCode;
154       } else if (e.which) {
155         this.nextCode = e.which;
156       }
157       if (e.which === 13) {
158         // 键盘回车事件
159         if (this.code.length < 3) return; // 扫码枪的速度很快,手动输入的时间不会让code的长度大于2,所以这里不会对扫码枪有效
160         this.parseQRCode(this.code); // 获取到扫码枪输入的内容,做别的操作
161         this.lastCode = "";
162         this.lastTime = "";
163         return;
164       }
165       this.nextTime = new Date().getTime();
166       if (!this.lastTime && !this.lastCode) {
167         this.code = ""; // 清空上次的条形码
168         this.code += e.key;
169       }
170       if (this.lastCode && this.lastTime && this.nextTime - this.lastTime > 500) {
171         // 当扫码前有keypress事件时,防止首字缺失
172         this.code = e.key;
173       } else if (this.lastCode && this.lastTime) {
174         this.code += e.key;
175       }
176       this.lastCode = this.nextCode;
177       this.lastTime = this.nextTime;
178     };
179   },
180   mounted() {
181     this.getStationConf();
182   },
183   methods: {
184     getStationConf() {
185       getIp().then(response => {
186         let queryParams = {
187           ipAddress: response.msg,
188         }
189         listStationConf(queryParams).then(response => {
190           this.locationName = response.rows[0].processesName
191           this.locationCode = response.rows[0].processesCode
192         });
193       });
194     },
195     reset() {
196       this.form = {
04b8ef 197         barcode:null,
d4f437 198         productType:null,
Y 199         orderNo:null,
200         qualityStatus:null,
201         currentWorkstation: null,
202         add: null,
203         engineCheckList:'暂无数据',
204       };
205       this.resetForm("form");
206     },
207     EngineNohandleChange(){
04b8ef 208
Y 209       if(this.form.barcode !== null && this.form.barcode !== undefined){
210         setBarcode(this.form.barcode,this.locationCode)
d4f437 211       }
Y 212     },
213     parseQRCode(code) {
214       this.form.engineNo = code;
215     },
696fd5 216     // print() {
Y 217       // 本页面直接打印(有bug单岁先不要删)
218       // let oldStr = window.document.body.innerHTML;
219       // let newStr = document.getElementById('printMe').innerHTML;
220       // document.body.innerHTML = newStr;
221       // window.print();
222       // document.body.innerHTML = oldStr;
223       // return false;
224
225       // 新开页面打印
226       //  document.getElementById('canvasWrapper').innerHTML = '';
227     //   let newStr = document.getElementById('printMe').innerHTML;
228     //   let newWin = window.open('', '_blank');
229     //   newWin.document.body.innerHTML = newStr;
230     //   newWin.print();
231     //   return false;
232     // },
233     // test1(){
234     //   document.getElementById('canvasWrapper').innerHTML = ''
235     //   this.$nextTick(() => {
236     //     let qrCode = new QRCode('canvasWrapper',{
237     //       width: 80,
238     //       height: 80,
239     //       padding: 0,
240     //       margin: 0,
241     //       // text: this.packCode,
242     //       text:"88888",
243     //       colorDark: '#000',
244     //       colorLight: '#fff'
245     //     })
246     //   })
247     //   // console.log(this.packCode)
248     //   // this.print()
249     // },
d4f437 250   },
Y 251   }
252
253
254 </script>
255 <style scoped>
256 ::v-deep .el-input__inner{
257   height: 40px;
258 }
259 ::v-deep .el-form-item__label {
260   line-height: 40px;
261 }
262 .custom-content {
263   height: 50%; /* 设置高度为50% */
264 }
265
266 .boxSize{
267   height: 60px;
268 }
269 .centerText{
270   color: black;
271   font-weight: bold;
272   font-size: 20px;
273   display: flex;
274   justify-content: center;
275   margin-top: 5px
276 }
277 </style>