春风项目四线(合箱线、总装线)
yyt
2024-05-23 04b8eff075a04db23e6f908855699b4d2954588c
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
182
183
184
<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-button size="large" type="primary" >上线</el-button>-->
<!--          <el-button size="large" type="danger">下线</el-button>-->
          <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: 460px">
              <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: 460px; 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="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,
      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
      }
      console.log('+++++++++++++++=++++++',event)
      const input = event.target
      const inputValue = input.value
      this.queryParams.productionNotice = inputValue
      console.log('----------------------',this.queryParams.productionNotice)
      if (event.key === 'Enter'){
        this.scannerFlag = true
        //扫描完成
        engineNoIsInModel({engineNo:this.queryParams.productionNotice,
          model:this.singleSelect.typeZ,orderNo:this.singleSelect.workOrderNo
        }).then(res => {
          console.log('rerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrs----',res)
          if (res.data===500){
            console.log('====---===')
            this.$message({
              message:res.msg,
              type:'warning'
            })
          }else {
            this.$message({
              message:'操作成功',
              type:'success'
            })
            this.getListData()
          }
        })
      }
    },
    //查询列表
    getListData(){
      console.log('this.queryParams.workOrderNo',this.singleSelect.workOrderNo)
      this.queryParams.orderNo = this.singleSelect.workOrderNo
      console.log('this.queryParams',this.queryParams)
      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() {
    console.log('singleSelect111',this.singleSelect)
    this.getListData()
    this.setFocus()
    this.$refs.inputdata.addEventListener('keydown',this.handleScannerInput)
  },
  beforeDestroy() {
    this.$refs.inputdata.removeEventListener('keydown',this.handleScannerInput)
  }
}
</script>