春风项目四线(合箱线、总装线)
yyt
2024-05-22 696fd55ecc1243bce1d421d95cb9fba4b0a598b1
提交 | 用户 | 时间
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>
35                  <el-input style="font-size:20px" v-model="form.engineNo" placeholder="请扫描曲轴码" clearable  @input="EngineNohandleChange">
36                    <el-button slot="append" plain type="info" @click="EngineNohandleChange" icon="el-icon-search"></el-button>
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";
97 import { setSNCode } from "@/api/main/da/opcuaconfig/opcuaconfig";
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: {
137         engineNo: null,
138         productType:null,
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 = {
197         engineNo:null,
198         productType:null,
199         orderNo:null,
200         qualityStatus:null,
201         currentWorkstation: null,
202         add: null,
203         engineCheckList:'暂无数据',
204       };
205       this.resetForm("form");
206     },
207     EngineNohandleChange(){
208       if(this.form.engineNo !== null && this.form.engineNo !== undefined){
209         setSNCode(this.form.engineNo,this.locationCode)
210       }
211     },
212     parseQRCode(code) {
213       this.form.engineNo = code;
214     },
696fd5 215     // print() {
Y 216       // 本页面直接打印(有bug单岁先不要删)
217       // let oldStr = window.document.body.innerHTML;
218       // let newStr = document.getElementById('printMe').innerHTML;
219       // document.body.innerHTML = newStr;
220       // window.print();
221       // document.body.innerHTML = oldStr;
222       // return false;
223
224       // 新开页面打印
225       //  document.getElementById('canvasWrapper').innerHTML = '';
226     //   let newStr = document.getElementById('printMe').innerHTML;
227     //   let newWin = window.open('', '_blank');
228     //   newWin.document.body.innerHTML = newStr;
229     //   newWin.print();
230     //   return false;
231     // },
232     // test1(){
233     //   document.getElementById('canvasWrapper').innerHTML = ''
234     //   this.$nextTick(() => {
235     //     let qrCode = new QRCode('canvasWrapper',{
236     //       width: 80,
237     //       height: 80,
238     //       padding: 0,
239     //       margin: 0,
240     //       // text: this.packCode,
241     //       text:"88888",
242     //       colorDark: '#000',
243     //       colorLight: '#fff'
244     //     })
245     //   })
246     //   // console.log(this.packCode)
247     //   // this.print()
248     // },
d4f437 249   },
Y 250   }
251
252
253 </script>
254 <style scoped>
255 ::v-deep .el-input__inner{
256   height: 40px;
257 }
258 ::v-deep .el-form-item__label {
259   line-height: 40px;
260 }
261 .custom-content {
262   height: 50%; /* 设置高度为50% */
263 }
264
265 .boxSize{
266   height: 60px;
267 }
268 .centerText{
269   color: black;
270   font-weight: bold;
271   font-size: 20px;
272   display: flex;
273   justify-content: center;
274   margin-top: 5px
275 }
276 </style>