春风项目四线(合箱线、总装线)
wujian
2024-01-31 c74dcb8dca7b9e3eded0d20299f19a26a6b70974
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<template>
  <div class="app-container">
    <el-card class="box-card" >
      <el-row>
        <el-divider><span style="font-size: 30px">发动机返修标记系统</span></el-divider>
      </el-row>
      <el-row style="margin-top: 10px">
        <el-form :model="queryParams.sfcCode" ref="queryForm" :inline="true" label-width="68px" >
          <el-form-item label-width="120" label="发动机号:" prop="orderNo">
            <el-input
              v-model="queryParams.sfcCode"
              placeholder="请输入发动机号"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item style="margin-left: 20px">
            <el-button type="primary" icon="el-icon-refresh" @click="handleQuery">查询</el-button>
            <el-button type="primary" icon="el-icon-scissors" @click="repairProgressHandleQuery">返修进度</el-button>
          </el-form-item>
        </el-form>
      </el-row>
    </el-card>
    <el-row>
      <el-col :span="20">
        <el-card style="margin-top: 10px; height: 490px;" class="box-card">
          <el-tabs v-model="activeName">
            <el-tab-pane label="过站采集" name="first">
              <el-table max-height="410px" border ref="multipleTable" :data="passingStationCollectionList"  @selection-change="handleSelectionChange">
                <el-table-column type="selection" width="55" align="center" />
<!--                <el-table-column label="工单编号" width="120" align="center" prop="workOrderNo">
                </el-table-column>-->
                <el-table-column label="发动机号" min-width="160" align="center" prop="sfcCode">
                </el-table-column>
<!--                <el-table-column label="产品编号" align="center" prop="productCode">
                </el-table-column>
                <el-table-column label="产线编号" align="center" prop="productionLine">
                </el-table-column>-->
                <el-table-column label="工位编号" align="center" prop="locationCode">
                </el-table-column>
                <el-table-column label="入站时间" align="center" prop="inboundTime" width="160">
                  <template slot-scope="scope">
                    <span>{{ parseTime(scope.row.inboundTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="出站时间" align="center" prop="outboundTime" width="160">
                  <template slot-scope="scope">
                    <span>{{ parseTime(scope.row.outboundTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="是否合格" align="center" prop="outRsSign">
                </el-table-column>
<!--                <el-table-column label="NG原因" align="center" prop="outMsgSign">
                </el-table-column>-->
                <el-table-column label="采集时间" align="center" prop="collectionTime" width="160">
                  <template slot-scope="scope">
                    <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
                  </template>
                </el-table-column>
<!--                <el-table-column label="节拍时间" align="center" prop="beatTime">
                </el-table-column>-->
              </el-table>
            </el-tab-pane>
            <el-tab-pane label="返修记录" name="second" @tab-click="handleClick">
              <el-table max-height="410px" border :data="repairRecordList">
                <el-table-column label="发动机号" min-width="160" align="center" prop="boxCode" />
                <el-table-column label="工位号" align="center" prop="processesCode" />
                <el-table-column label="返修结果" align="center" prop="repairResults" />
                <el-table-column label="原结果" align="center" prop="originalResult" />
                <el-table-column label="返修时间" align="center"  prop="repairTime" />
              </el-table>
            </el-tab-pane>
          </el-tabs>
 
        </el-card>
      </el-col>
      <el-col :span="4">
        <el-card style="margin-top: 10px; min-height: 490px">
          <el-row class="centered-row">
            <el-button type="success" style="margin-top: 10px;width:120px;height:40px" icon="el-icon-s-grid" @click="selectAll" >选 择 所 有</el-button>
          </el-row>
          <el-row class="centered-row">
            <el-button type="success" style="margin-top: 10px;width:120px;height:40px" icon="el-icon-close" @click="clearAll">取 消 选 择</el-button>
          </el-row>
          <el-row class="centered-row">
            <el-button type="success" style="margin-top: 10px;width:120px;height:40px" icon="el-icon-document-remove" @click="selectUnqualified">选择不合格</el-button>
          </el-row>
          <el-row class="centered-row">
            <el-button type="success" style="margin-top: 10px;width:120px;height:40px" icon="el-icon-s-flag" @click="markComplete">标 记 完 成</el-button>
          </el-row>
          <el-row class="centered-row">
          <el-button type="success" style="margin-top: 10px;width:120px;height:40px" icon="el-icon-files" @click="repairRecord">返 修 记 录</el-button>
        </el-row>
          <el-row class="centered-row">
            <el-button type="success" style="margin-top: 10px;width:120px;height:40px" icon="el-icon-date" @click="operationLog" >操 作 日 志</el-button>
          </el-row>
        </el-card>
      </el-col>
    </el-row>
 
 
  </div>
</template>
 
<script>
import {
  noPageList,
  insertRepairRecordByIds
} from "@/api/main/da/passingStationCollection/passingStationCollection";
import {noPagelist} from "@/api/main/rm/repairRecord/repairRecord";
import {warning} from "@riophae/vue-treeselect/src/utils";
export default {
  name: "index",
  dicts: ['sys_normal_disable'],
  data(){
    return{
 
      loading: false,//刷新修改
 
      activeName: 'first',
 
      // 返修记录表格数据
      repairRecordList: [],
      // 是否显示弹出层
      open: false,
      // 产品过站采集表格数据
      passingStationCollectionList: [],
      // 查询参数
      queryParams: {
        sfcCode: '',
        outRsSign: '',
      },
      ids: [],
      allSelected: false,
      boxCode: '',
      // rules: {
      //   boxCode: [
      //     { required: true, message: "状态不能为空", trigger: "blur" }
      //   ]
      // },
    }
  },
  mounted() {
    // this.getList()
  },
  methods:{
    handleClick(tab, event) {
      console.log(tab, event);
      this.$modal.msgSuccess(tab,event);
 
    },
    // 取消按钮
    cancel() {
      this.open = false;
    },
    selectAll(){
      this.passingStationCollectionList.forEach(row => {
        this.$refs.multipleTable.toggleRowSelection(row);
      });
    },
    clearAll(){
      this.$refs.multipleTable.clearSelection();
    },
    selectUnqualified(){
      let outRsSign = this.passingStationCollectionList.filter(row => row.outRsSign === '合格')
      outRsSign.forEach(row => {
        this.$refs.multipleTable.toggleRowSelection(row);
      })
      this.$modal.msgSuccess('选择不合格');
    },
    markComplete(){
      if(this.ids.length === 0){
        this.$message({
          message: '未标记!',
          type: 'warning'
        })
      }else {
        this.loading = true; // 开始加载数据
        this.$modal.msgSuccess('标记完成');
 
        let queryParams = {
          ids: this.ids
        }
        this.repairRecordList = []
        insertRepairRecordByIds(queryParams).then(response => {
               this.initRepairRecord(); // 刷新返修记录
               this.loading = false; // 结束加载数据
        }).catch(() => {
          this.loading = false; // 结束加载数据
        });
        // this.initRepairRecord()
        // this.getList();
      }
      this. handleQuery();
    },
    repairRecord(){
      this.$modal.msgSuccess('返修记录');
    },
    operationLog(){
      this.$modal.msgSuccess('操作日志');
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    repairProgressHandleQuery(){
      this.activeName = 'second'
    },
    initRepairRecord(){
      /** 查询返修记录列表 */
      let queryParams = {
        boxCode: this.queryParams.sfcCode
      }
 
      noPagelist(queryParams).then(response => {
        this.repairRecordList = response.rows;
      });
 
    },
    /** 搜索按钮操作 */
    handleQuery() {
      let sfcCode = this.queryParams.sfcCode
      if(sfcCode === null||sfcCode ===''){
        this.$message({
          message: '请填写发动机号!',
          type: 'warning'
        });
      }else {
        // this.$modal.msgSuccess('搜索');
        this.getList();
        this.initRepairRecord();
      }
    },
    /** 查询产品过站采集列表 */
    getList() {
      noPageList(this.queryParams).then(response => {
        this.passingStationCollectionList = response.rows;
      });
    },
 
  },
}
</script>
 
<style scoped>
::v-deep .el-form-item__label{
  font-size: large;
}
.el-icon-close {
  margin-left: 20px;
}
.centered-row {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}
</style>