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