春风项目四线(合箱线、总装线)
wujian
2024-08-18 8876c234904459d038a2b282b3fdc30e006f9925
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<template>
  <div class="app-container">
    <div style="height: 100%;width: 100%">
      <el-card class="box-card">
        <el-form :model="queryParams" size="large" :inline="true" label-width="68px" @submit.native.prevent>
          <el-form-item label-width="200" label="箱体码" :prop="queryParams.productionNotice"  style="align-content: center">
            <input v-model="queryParams.productionNotice"
                      ref="inputdata"
                   style="height: 39px; width: 300px"
                   placeholder="请扫描箱体码"
                     />
          </el-form-item>
          <el-checkbox class="custom-size" style="margin-left: 40px; margin-right: 40px" v-model="repairFlag">返修</el-checkbox>
          <el-button size="large" type="info" @click="refresh">返回</el-button>
        </el-form>
      </el-card>
      <el-row :gutter="0">
        <el-col :span="6">
          <div >
            <el-card style="height: 560px">
              <el-descriptions class="margin-top" :column="1" direction="horizontal">
                <el-descriptions-item label="生产订单">{{singleSelect.workOrderNo}}</el-descriptions-item>
                <el-descriptions-item label="机型" :span="2">{{singleSelect.typeZ}}</el-descriptions-item>
                <el-descriptions-item label="计划数量">
                  {{singleSelect.planQty}}
                </el-descriptions-item>
                <el-descriptions-item label="上线数量">{{onlineNum}}</el-descriptions-item>
                <el-descriptions-item label="完成数量">{{finishNum}}</el-descriptions-item>
                <el-descriptions-item label="不合格数">{{unReachNum}}</el-descriptions-item>
              </el-descriptions>
            </el-card>
          </div>
        </el-col>
        <el-col :span="18">
          <div>
            <el-card style="height: 560px; overflow: auto">
              <el-table border :data="orderSchedulingList">
                <el-table-column
                  type="index"
                  label="序号"
                  width="50"></el-table-column>
                <el-table-column label="生产订单" align="center" prop="orderNo" width="130">
 
                </el-table-column>
                <el-table-column label="发动机号" align="center" prop="engineNo" width="150">
 
                </el-table-column>
                <el-table-column label="箱体码" align="center" prop="boxCode" width="250">
 
                </el-table-column>
                <el-table-column label="机型" align="center" prop="model">
 
                </el-table-column>
                <el-table-column label="生产状态" align="center" prop="productionStatus">
                  <template slot-scope="scope">
                    <dict-tag :options="dict.type.order_scheduling_produce_status" :value="scope.row.productionStatus"/>
                  </template>
                </el-table-column>
                <el-table-column label="质量状态" align="center" prop="qualityStatus">
                  <template slot-scope="scope">
                    <dict-tag :options="dict.type.quality_status" :value="scope.row.qualityStatus"/>
                  </template>
                </el-table-column>
 
 
                <el-table-column label="操作人" align="center" prop="operator">
                </el-table-column>
                <el-table-column label="操作时间" align="center" prop="operateTime" width="160">
                  <template slot-scope="scope">
                    <span>{{ parseTime(scope.row.operateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
                  </template>
                </el-table-column>
 
              </el-table>
              <pagination
                v-show="total>0"
                :total="total"
                :page.sync="queryParams.pageNum"
                :limit.sync="queryParams.pageSize"
                @pagination="getListData"
              />
            </el-card>
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>
 
<script>
 
import { engineNoIsInModel, getSumDataMethod, listOrderScheduling3 } from "../../../../api/main/bs/orderScheduling/orderScheduling";
export default {
  name: 'Detail',
  props: ['singleSelect'],
  dicts: ['order_scheduling_produce_status','quality_status','print_status','material_type'],
  data(){
    return{
      // 总条数
      total: 0,
      repairFlag:false,
      queryParams: {
        orderNo:'',
        pageNum: 1,
        pageSize: 10,
      },
      orderSchedulingList: [],
      onlineNum: 0,
      finishNum: 0,
      unReachNum: 0,
      scannerFlag: false
    }
  },
  methods:{
    handleQuery(){
 
    },
    refresh() {
      location.reload();
    },
    setFocus(){
      this.$nextTick(()=>{
        this.$refs.inputdata.focus()
      })
    },
    handleScannerInput(event){
      if (this.scannerFlag){
        this.queryParams.productionNotice = ''
        this.$refs.inputdata.value = ''
        this.scannerFlag = false
      }
      const input = event.target
      const inputValue = input.value
      this.queryParams.productionNotice = inputValue
      if (event.key === 'Enter'){
        this.scannerFlag = true
        //扫描完成
        engineNoIsInModel({engineNo:this.queryParams.productionNotice,
          model:this.singleSelect.typeZ,orderNo:this.singleSelect.workOrderNo,repairFlag:this.repairFlag
        }).then(res => {
          if (res.data===500){
            this.$message({
              message:res.msg,
              type:'warning'
            })
          }else {
            this.$message({
              message:'操作成功',
              type:'success'
            })
            this.repairFlag = false
            this.getListData()
          }
        })
      }
    },
    //查询列表
    getListData(){
      this.queryParams.orderNo = this.singleSelect.workOrderNo
      listOrderScheduling3(this.queryParams).then(res => {
        this.orderSchedulingList = res.rows
        this.total = res.total
      })
      getSumDataMethod(this.queryParams).then(res =>{
        console.log('res',res)
        this.onlineNum = res.data.onlineNum
        this.finishNum = res.data.finishNum
        this.unReachNum = res.data.unqualified
      })
    }
  },
  mounted() {
    this.getListData()
    this.setFocus()
    this.$refs.inputdata.addEventListener('keydown',this.handleScannerInput)
  },
  beforeDestroy() {
    this.$refs.inputdata.removeEventListener('keydown',this.handleScannerInput)
  }
}
</script>