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