kz-ui-base 1.0.65 → 1.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,16 @@ export function listRelatedResource(workUnitId) {
11
11
  })
12
12
  }
13
13
 
14
+ export function listRelatedEquipment(workUnitId) {
15
+ return request({
16
+ url: '/fd/wuEquipment/listByDto',
17
+ method: 'get',
18
+ params: {
19
+ workUnitId
20
+ }
21
+ })
22
+ }
23
+
14
24
  // 查询作业单元列表
15
25
  export function listWorkUnit(query) {
16
26
  return request({
@@ -0,0 +1,10 @@
1
+ import request from '@utils/request'
2
+
3
+
4
+ export function pageByWorkUnitIdAndWuEquipment(data) {
5
+ return request({
6
+ url: '/fd/wuEquipment/pageByWorkUnitIdAndWuEquipment',
7
+ method: 'post',
8
+ data: data
9
+ })
10
+ }
@@ -0,0 +1,49 @@
1
+ import request from "@utils/request";
2
+ export function insertDefectReason(data) {
3
+ return request({
4
+ url: `qms/defectReasonHdr/insertDefectReasonHdr`,
5
+ method: "post",
6
+ data: data,
7
+ });
8
+ }
9
+
10
+ export function updateDefectReason(data) {
11
+ return request({
12
+ url: `qms/defectReasonHdr/updateDefectReasonHdr`,
13
+ method: "post",
14
+ data: data,
15
+ });
16
+ }
17
+
18
+ export function listDefectReason(query) {
19
+ return request({
20
+ url: '/qms/defectReasonHdr/list',
21
+ method: 'get',
22
+ params: query
23
+ })
24
+ }
25
+
26
+ export function deleteDefectReason(data) {
27
+ return request({
28
+ url: '/qms/defectReasonHdr/deleteDefectReasonHdr',
29
+ method: 'post',
30
+ data: data
31
+ })
32
+ }
33
+
34
+
35
+ export function listDefectReasonDtl(query) {
36
+ return request({
37
+ url: '/qms/defectReasonDtl/listDefectReasonDtl',
38
+ method: 'get',
39
+ params: query
40
+ })
41
+ }
42
+
43
+ export function listDefectReasonByDefectItemId(query) {
44
+ return request({
45
+ url: '/qms/defectReasonHdr/listDefectReasonByDefectItemId',
46
+ method: 'get',
47
+ params: query
48
+ })
49
+ }
@@ -20,8 +20,8 @@
20
20
  >
21
21
  <el-form-item label="地磅品牌" prop="brand">
22
22
  <el-select v-model="form.brand" placeholder="请选择地磅品牌">
23
- <el-option label="上海耀华" value="上海耀华" />
24
- <el-option label="托利多" value="托利多" />
23
+ <el-option label="上海耀华" value="Yaohua" />
24
+ <el-option label="托利多" value="Toledo" />
25
25
  <!-- 添加更多品牌选项 -->
26
26
  </el-select>
27
27
  </el-form-item>
@@ -68,7 +68,7 @@ export default {
68
68
  return {
69
69
  visible: false,
70
70
  form: {
71
- brand: '上海耀华',
71
+ brand: '',
72
72
  portName: '',
73
73
  baudRate: 9600
74
74
  },
@@ -80,7 +80,11 @@ export default {
80
80
  parts.push(`波特率:${this.portConfig.baudRate}`)
81
81
  }
82
82
  if (this.portConfig.brand) {
83
- parts.push(`品牌:${this.portConfig.brand}`)
83
+ const brandMap = {
84
+ 'Yaohua': '上海耀华',
85
+ 'Toledo': '托利多'
86
+ }
87
+ parts.push(`品牌:${brandMap[this.portConfig.brand]}`)
84
88
  }
85
89
 
86
90
  return parts.length > 0 ? parts.join(' | ') : null
@@ -32,9 +32,7 @@ class VueWebSocketManager {
32
32
  }
33
33
 
34
34
  openDownload = () => {
35
- this.thatVue.$modal.confirm('若您未安装过MES插件,请先点击确定下载安装插件').then(function() {
36
- window.location.href = 'http://itipsources.oss-cn-shanghai.aliyuncs.com/download/MesToolSetup.msi'
37
- })
35
+ this.thatVue.$modal.msgWarning('若您未安装过MES插件,请联系管理员安装')
38
36
  }
39
37
 
40
38
  // 初始化
@@ -64,52 +64,35 @@ const listPorts = async() => {
64
64
  })
65
65
  }
66
66
 
67
- const startWeighing = ({ portName, baudRate }, callBack) => {
67
+ const startWeighing = ({ portName, baudRate, brand }, callBack) => {
68
68
  vm.$on('weigh-device-received', (payload) => {
69
69
  console.log('weigh-device-received:', payload)
70
- if (payload.Type === 'ST') {
70
+ if (brand === 'Yaohua') {
71
+ if (payload.Type === 'ST') {
72
+ callBack(payload.Value)
73
+ } else if (payload.Type === 'US') {
74
+ console.log('称重设备不稳定')
75
+ } else if (payload.Type === 'OL') {
76
+ console.log('称重设备超载')
77
+ } else {
78
+ console.log('weigh-device-received error:', payload)
79
+ }
80
+ } else if (brand === 'Toledo') {
71
81
  callBack(payload.Value)
72
- } else if (payload.Type === 'US') {
73
- console.log('称重设备不稳定')
74
- } else if (payload.Type === 'OL') {
75
- console.log('称重设备超载')
76
82
  } else {
77
- console.log('weigh-device-received error:', payload)
83
+ console.log(`weigh-device-received error: unknown brand: ${brand}`)
78
84
  }
79
85
  })
80
86
  webSocketManager.webSocketSendMsg(JSON.stringify({
81
87
  Type: 'OpenPort',
82
88
  Payload: {
83
89
  Port: portName,
84
- BaudRate: baudRate
90
+ BaudRate: baudRate,
91
+ Brand: brand
85
92
  }
86
93
  }))
87
94
  }
88
95
 
89
- function parseYaoHauProtocol(data) {
90
- const result = {
91
- status: data.slice(0, 2).toString(),
92
- weightType: data.slice(3, 5).toString(),
93
- weight: '',
94
- unit: ''
95
- }
96
-
97
- // 解析重量
98
- for (let i = 6; i <= 13; i++) {
99
- if (data[i] !== ' ') { // 0x20 是空格的 ASCII 码
100
- result.weight += data[i]
101
- }
102
- }
103
- console.log('result.weight: ', result.weight)
104
- // 去除重量两边的空格,并转换为数字
105
- result.weight = parseFloat(result.weight.trim())
106
-
107
- // 解析单位
108
- result.unit = data.slice(14).toString().trim()
109
-
110
- return result
111
- }
112
-
113
96
  const stopWeighing = (port) => {
114
97
  webSocketManager.webSocketSendMsg(JSON.stringify({
115
98
  Type: 'ClosePort',
@@ -2837,10 +2837,10 @@ export default class listBasePage extends Vue {
2837
2837
  // console.log("1");
2838
2838
  // done();
2839
2839
  //},
2840
- //close: () => {
2841
- // //关闭后触发
2842
- // console.log("2");
2843
- //},
2840
+ close: () => {
2841
+ //关闭后触发
2842
+ this.getList()
2843
+ },
2844
2844
  confirm: (result) => {
2845
2845
  //显式$emit('confirm')时触发
2846
2846
  console.log("3 ", result);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kz-ui-base",
3
- "version": "1.0.65",
3
+ "version": "1.0.67",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,451 @@
1
+ <template>
2
+ <base-dialog :visible.sync="visible" width="1200px" title="设备选择" append-to-body @on-confirm="handleConfirm"
3
+ @on-cancel="cancel">
4
+ <div class="eam-system-container">
5
+ <eam-list-panel :showSearchbar="showSearch" :hasToolbar="false" name="ll">
6
+ <!-- 搜索栏 -->
7
+ <template #searchbar>
8
+ <el-form ref="queryForm" :model="searchParams" label-width="80px" :inline="true">
9
+ <!-- <el-form-item label="构成部位" prop="assetModelComponentId">
10
+ <treeselect v-model="searchParams.assetModelComponentId" :options="assetModelComponentTreeList"
11
+ :normalizer="normalizer" placeholder="请选择" style="width: 180px" />
12
+ </el-form-item> -->
13
+ <!-- <el-form-item label="备件编号" prop="partsCode">
14
+ <el-input v-model="searchParams.partsCode" placeholder="请输入" style="width: 180px" />
15
+ </el-form-item>
16
+ <el-form-item label="备件名称" prop="partsName">
17
+ <el-input v-model="searchParams.partsName" placeholder="请输入" style="width: 180px" />
18
+ </el-form-item> -->
19
+ <el-form-item label="设备编号" prop="assetNo">
20
+ <el-input v-model="searchParams.assetNo" style="width: 200px !important" placeholder="请输入设备编号"
21
+ clearable />
22
+ </el-form-item>
23
+ <el-form-item label="设备名称" prop="assetName">
24
+ <el-input v-model="searchParams.assetName" style="width: 200px !important" placeholder="请输入设备名称"
25
+ clearable />
26
+ </el-form-item>
27
+ <el-form-item>
28
+ <el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
29
+ <el-button type="primary" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
30
+ </el-form-item>
31
+ </el-form>
32
+ </template>
33
+
34
+ <!-- 工具栏 -->
35
+ <template #toolbar> </template>
36
+
37
+ <!-- 内容 -->
38
+ <el-table ref="multipleTable" v-loading="tableLoading" :height="tableDataHeight" :data="listData"
39
+ style="width: 100%;margin-top: 10px;" highlight-current-row
40
+ @row-click="clickRow" @selection-change="handleSelectionChange" @select="handleSelect"
41
+ :row-style="rowStyle">
42
+ <el-table-column type="selection" width="55" align="center" />
43
+ <el-table-column type="index" label="序号" width="55" align="center" />
44
+ <!-- <el-table-column label="图片" align="center" width="90">
45
+ <template slot-scope="scope">
46
+ <el-row justify="center">
47
+ <div class="image-view">
48
+ <el-image :src="scope.row.assetImageList.length > 0
49
+ ? scope.row.assetImageList[0].filePreviewNode
50
+ : ''
51
+ " :preview-src-list="scope.row.assetImageList.map((item) => {
52
+ return item.filePreviewNode;
53
+ })
54
+ ">
55
+ <div slot="error" class="image-slot">
56
+ <i class="el-icon-picture-outline" />
57
+ </div>
58
+ </el-image>
59
+ </div>
60
+ </el-row>
61
+ </template>
62
+ </el-table-column> -->
63
+
64
+ <el-table-column label="设备分类" align="left" header-align="center" min-width="150">
65
+ <template slot-scope="scope">{{
66
+ assetCategoryFormat(scope.row)
67
+ }}</template>
68
+ </el-table-column>
69
+ <el-table-column label="设备编号" prop="assetNo" align="left" header-align="center" min-width="130">
70
+ <!-- <template slot-scope="scope">
71
+ <el-link type="primary" @click="handleLookDetail(scope.row, scope.$index)"><span> {{ scope.row.assetNo
72
+ }}</span></el-link>
73
+ </template> -->
74
+ </el-table-column>
75
+ <el-table-column label="设备名称" prop="assetName" align="left" header-align="center"
76
+ :show-overflow-tooltip="true" min-width="120" />
77
+ <el-table-column label="出厂编号" prop="factoryManufacturingNo" align="left" header-align="center"
78
+ min-width="120" />
79
+ <el-table-column label="出厂日期" prop="factoryManufacturingDate" align="left" header-align="center"
80
+ min-width="100">
81
+ <template slot-scope="scope">
82
+ <span v-if="scope.row.factoryManufacturingDate">{{
83
+ scope.row.factoryManufacturingDate.substring(0, 10)
84
+ }}</span>
85
+ </template>
86
+ </el-table-column>
87
+ <el-table-column label="设备来源" prop="assetSourceCode" align="left" header-align="center" min-width="120">
88
+ <template slot-scope="scope">
89
+ <span>{{
90
+ getDictLabelByValue(
91
+ "asset_source_code",
92
+ scope.row.assetSourceCode
93
+ )
94
+ }}</span>
95
+ </template>
96
+ </el-table-column>
97
+ <el-table-column label="固定资产编号" prop="erpAssetNo" align="left" header-align="center" min-width="120" />
98
+ <el-table-column label="旧设备编号" prop="originalAssetNo" align="left" header-align="center" min-width="120" />
99
+ <el-table-column label="启用日期" prop="startUsingDate" align="left" header-align="center" min-width="100">
100
+ <template slot-scope="scope">
101
+ <span v-if="scope.row.startUsingDate">{{
102
+ scope.row.startUsingDate.substring(0, 10)
103
+ }}</span>
104
+ </template>
105
+ </el-table-column>
106
+ <el-table-column label="设备状态" align="center" prop="assetStatusCode" min-width="100">
107
+ <template slot-scope="scope">
108
+ {{
109
+ getDictLabelByValue(
110
+ "ASSET_STATE",
111
+ scope.row.assetStatusCode
112
+ )
113
+ }}
114
+ </template>
115
+ </el-table-column>
116
+ <el-table-column label="是否关键过程设备" prop="isCriticalProcessEquipment" align="left" header-align="center"
117
+ min-width="120">
118
+ <template slot-scope="scope">
119
+ {{
120
+ getDictLabelByValue(
121
+ "sys_yes_no_number",
122
+ scope.row.isCriticalProcessEquipment
123
+ )
124
+ }}
125
+ </template>
126
+ </el-table-column>
127
+ <el-table-column label="是否工检共用设备" prop="isEngInspShared" align="left" header-align="center" min-width="120">
128
+ <template slot-scope="scope">
129
+ {{
130
+ getDictLabelByValue(
131
+ "sys_yes_no_number",
132
+ scope.row.isEngInspShared
133
+ )
134
+ }}
135
+ </template>
136
+ </el-table-column>
137
+ <el-table-column label="设备组织" prop="assetSiteId" align="left" header-align="center" min-width="120">
138
+ <template slot-scope="scope">
139
+ {{ getSiteNameByIdOrNo(scope.row.assetSiteId) }}
140
+ </template>
141
+ </el-table-column>
142
+ </el-table>
143
+
144
+ <!-- 分页栏 -->
145
+ <template #pagebar>
146
+ <pagination v-show="searchParams.total > 0" background :total="searchParams.total"
147
+ :page.sync="searchParams.pageNum" :limit.sync="searchParams.pageSize" @pagination="getList" />
148
+ </template>
149
+ </eam-list-panel>
150
+ </div>
151
+ </base-dialog>
152
+ </template>
153
+ <script>
154
+ import { heightMixin } from "@/mixin/heightMixin";
155
+ import { Component, Prop, Mixins } from "vue-property-decorator";
156
+ import EamListPanel from '@srcComponents/eam/eam-capi/EamListPanel.vue';
157
+ import { listEmAssetInfo, } from "@srcApi/eam/asset/EmAssetInfo";
158
+ import { tableHandleSelect, tableOnSelectionChange, tableRowClick, tableRowStyle } from "@/utils/index";
159
+ import { ListAssetCategory } from "@srcApi/eam/manage/emMstCategory";
160
+ import { getSiteNameByIdOrNo as getSiteNameByIdOrNoR, } from "kz-ui-base/common/src/utils/cache/fdCache";
161
+ import { getDictLabelByValue as getDictLabelByValueR, } from "kz-ui-base/common/src/api/common/common";
162
+
163
+ @Component({
164
+ components: {
165
+ EamListPanel,
166
+ },
167
+ })
168
+
169
+ export default class PartModel extends Mixins(heightMixin) {
170
+ @Prop()
171
+ value;
172
+ @Prop()
173
+ searchObj;
174
+ @Prop({ default: false })
175
+ multipleChoice;
176
+ @Prop({
177
+ type: Object,
178
+ default: () => ({}),
179
+ })
180
+ setting;
181
+
182
+ // data 方法中返回响应式数据
183
+ // data() {
184
+ // return {
185
+ // showSearch: true,
186
+ // };
187
+ // }
188
+ //EamListPanel=EamListPanel;
189
+
190
+ //assetModelId = null;
191
+ //assetModelComponentId = null;
192
+
193
+
194
+ tableLoading = false;
195
+ visible = false;
196
+ dialogType = 2;
197
+ showSearch = true;
198
+ listData = [];
199
+ searchParams = {
200
+ pageNum: 1,
201
+ pageSize: 10,
202
+ total: 0,
203
+ assetNo: null,
204
+ assetName: null,
205
+ };
206
+ // 构成部位下拉树
207
+ assetTypeList = [];
208
+ // 勾选框的勾选行
209
+ currentEntities = [];
210
+
211
+ getSiteNameByIdOrNo(assetSiteId) {
212
+ let t = getSiteNameByIdOrNoR(assetSiteId);
213
+ console.log(t)
214
+ return t
215
+ }
216
+
217
+ getDictLabelByValue(dictType, dictValue) {
218
+ return getDictLabelByValueR(dictType, dictValue);
219
+ }
220
+
221
+ getList() {
222
+ this.tableLoading = true;
223
+ if (this.searchObj != null) {
224
+ for (let prop in this.searchObj) {
225
+ this.searchParams[prop] = this.searchObj[prop];
226
+ }
227
+ }
228
+ listEmAssetInfo({ ...this.searchParams }).then((res) => {
229
+ this.listData = res.data;
230
+ this.tableLoading = false;
231
+ this.searchParams.total = res.total;
232
+ });
233
+ }
234
+
235
+ // 设备分类树型翻译
236
+ assetCategoryFormat(row) {
237
+ function deepQuery(tree, id) {
238
+ var isGet = false;
239
+ var retNode = null;
240
+ function deepSearch(tree, id) {
241
+ for (var i = 0; i < tree.length; i++) {
242
+ if (tree[i].children && tree[i].children.length > 0) {
243
+ deepSearch(tree[i].children, id);
244
+ }
245
+ if (id === tree[i].id || isGet) {
246
+ isGet || (retNode = tree[i]);
247
+ isGet = true;
248
+ break;
249
+ }
250
+ }
251
+ }
252
+ deepSearch(tree, id);
253
+ return retNode;
254
+ }
255
+
256
+ return (
257
+ deepQuery(this.assetTypeList, row.assetCategoryId) &&
258
+ deepQuery(this.assetTypeList, row.assetCategoryId).label
259
+ );
260
+ }
261
+
262
+ // 获取设备分类列表
263
+ getAssetType() {
264
+ ListAssetCategory().then((res) => {
265
+ this.assetTypeList = res;
266
+ });
267
+ }
268
+
269
+ created() {
270
+ // this.assetModelId = this.setting.data.assetModelId
271
+ // this.searchParams.assetModelComponentId = this.setting.data.assetModelComponentId
272
+ // this.getComponentList();
273
+ // this.getList();
274
+ // console.log(this.value);
275
+ this.getAssetType()
276
+ }
277
+
278
+ mounted() {
279
+ //this.assetModelId = this.setting.data && this.setting.data.assetModelId
280
+ //this.searchParams.assetModelComponentId = this.setting.data && this.setting.data.assetModelComponentId
281
+ //this.getComponentList();
282
+ this.getList();
283
+ //console.log(this.value);
284
+ }
285
+
286
+
287
+ handleConfirm() {
288
+ if (this.multipleChoice) {
289
+ this.$closeDialog(true, this.currentEntities);
290
+ } else {
291
+ this.$closeDialog(true, this.currentEntities?.[0]);
292
+ }
293
+ }
294
+
295
+ // 查询
296
+ handleQuery() {
297
+ this.searchParams.pageNum = 1
298
+ this.getList()
299
+ }
300
+ // 重置
301
+ resetQuery() {
302
+ this.searchParams = {
303
+ pageNum: 1,
304
+ pageSize: 10,
305
+ total: 0,
306
+ partsCategoryId: null,
307
+ partsCode: null,
308
+ partsName: null,
309
+ }
310
+ this.getList()
311
+ }
312
+
313
+ cancel() {
314
+ this.$closeDialog();
315
+ }
316
+
317
+ // 转换位置信息数据结构
318
+ normalizer(node) {
319
+ if (node.children && !node.children.length) {
320
+ delete node.children
321
+ }
322
+ return {
323
+ id: node.id,
324
+ label: node.label,
325
+ children: node.children,
326
+ }
327
+ }
328
+
329
+ clickRow(row) {
330
+ //this.$set(this, 'currentEntity', row);
331
+ // this.$set(this,'currentEntities', [row]);
332
+ tableRowClick(row, this.multipleChoice, this.$refs.multipleTable, this.currentEntities)
333
+ }
334
+
335
+ handleSelectionChange(val) {
336
+ this.currentEntities = val;
337
+ tableOnSelectionChange(val, this.multipleChoice, this.$refs.multipleTable)
338
+ }
339
+
340
+ /** 手动勾选数据行的 Checkbox 时触发的事件*/
341
+ handleSelect(selection, row) {
342
+ tableHandleSelect(selection, row, this.$refs.multipleTable)
343
+ }
344
+
345
+ rowStyle({ row, rowIndex }) {
346
+ tableRowStyle({ row, rowIndex })
347
+ }
348
+ }
349
+ </script>
350
+ <style lang="scss" scoped>
351
+ .box {
352
+ padding: 24px;
353
+ margin-bottom: 16px;
354
+ }
355
+
356
+ .dia-btn2 {
357
+ display: flex;
358
+
359
+ .dia-btns {
360
+ width: 20px;
361
+ height: 20px;
362
+ }
363
+ }
364
+
365
+ .dia-bg {
366
+ background-color: #f5f7fa;
367
+ padding: 14px;
368
+ }
369
+
370
+ .dia-back {
371
+ position: relative;
372
+ padding: 20px 14px;
373
+ margin-bottom: 14px;
374
+ }
375
+
376
+ .dia-attach {
377
+ display: flex;
378
+ width: 170px;
379
+ height: 86px;
380
+ border-radius: 6px;
381
+ background-color: #f5f7fa;
382
+ padding: 24px;
383
+ margin-right: 30px;
384
+
385
+ img {
386
+ width: 23px;
387
+ height: 28px;
388
+ margin-right: 14px;
389
+ }
390
+
391
+ .dia-attach-tit {
392
+ font-size: 14px;
393
+ color: #30343a;
394
+ margin-bottom: 5px;
395
+ }
396
+
397
+ .dia-attach-tit2 {
398
+ font-size: 12px;
399
+ color: #616569;
400
+ }
401
+ }
402
+
403
+ .dia-tit {
404
+ padding-left: 8px;
405
+ border-left: 2px solid #3d7fff;
406
+ color: #30343a;
407
+ margin-bottom: 25px;
408
+ }
409
+
410
+ .dia-attach {
411
+ display: flex;
412
+ width: 170px;
413
+ height: 86px;
414
+ border-radius: 6px;
415
+ background-color: #f5f7fa;
416
+ padding: 24px;
417
+ margin-right: 30px;
418
+
419
+ img {
420
+ width: 23px;
421
+ height: 28px;
422
+ margin-right: 14px;
423
+ }
424
+
425
+ .dia-attach-tit {
426
+ font-size: 14px;
427
+ color: #30343a;
428
+ margin-bottom: 5px;
429
+ }
430
+
431
+ .dia-attach-tit2 {
432
+ font-size: 12px;
433
+ color: #616569;
434
+ }
435
+ }
436
+
437
+ .dia-upload {
438
+ display: flex;
439
+ justify-content: center;
440
+ align-items: center;
441
+ width: 86px;
442
+ height: 86px;
443
+ border-radius: 6px;
444
+ background-color: #f5f7fa;
445
+
446
+ img {
447
+ width: 24px;
448
+ height: 24px;
449
+ }
450
+ }
451
+ </style>
@@ -0,0 +1,222 @@
1
+ <template>
2
+ <base-dialog
3
+ :visible.sync="visible"
4
+ width="960px"
5
+ title="设备选择"
6
+ append-to-body
7
+ @on-confirm="handleConfirm"
8
+ @on-cancel="handleCancel"
9
+ >
10
+ <div class="body__container">
11
+ <el-form
12
+ ref="queryForm"
13
+ :model="listQueryParams"
14
+ :inline="true"
15
+ label-width="80px"
16
+ size="small"
17
+ >
18
+ <el-row class="mb8">
19
+ <el-col :span="8">
20
+ <el-form-item label="设备编号" prop="equipmentNo">
21
+ <el-input v-model="listQueryParams.equipmentNo" clearable/>
22
+ </el-form-item>
23
+ </el-col>
24
+ <el-col :span="8">
25
+ <el-form-item label="设备名称" prop="equipmentName">
26
+ <el-input v-model="listQueryParams.equipmentName" clearable/>
27
+ </el-form-item>
28
+ </el-col>
29
+ <el-col :span="8">
30
+ <el-form-item align="right">
31
+ <el-button
32
+ type="primary"
33
+ icon="el-icon-search"
34
+ size="mini"
35
+ @click="handleQuery"
36
+ >查询
37
+ </el-button>
38
+ <el-button
39
+ icon="el-icon-refresh"
40
+ size="mini"
41
+ @click="resetQuery"
42
+ >重置
43
+ </el-button>
44
+ </el-form-item>
45
+ </el-col>
46
+ </el-row>
47
+ </el-form>
48
+ <el-table
49
+ ref="multipleTable"
50
+ v-loading="loading"
51
+ :border="true"
52
+ :data="listData"
53
+ height="320"
54
+ max-height="320"
55
+ highlight-current-row
56
+ :header-cell-style="{'text-align':'center'}"
57
+ :row-style="rowStyle"
58
+ @row-click="rowClick"
59
+ @select="handleSelect"
60
+ @selection-change="onSelectionChange"
61
+ >
62
+ <el-table-column type="selection" min-width="50" align="center" />
63
+ <el-table-column prop="workUnitNo" label="作业单元编号" min-width="100" align="left" show-overflow-tooltip />
64
+ <el-table-column prop="workUnitName" label="作业单元名称" min-width="100" align="left" show-overflow-tooltip />
65
+ <el-table-column prop="equipmentNo" label="设备名称" min-width="100" align="left" show-overflow-tooltip/>
66
+ <el-table-column prop="equipmentName" label="设备名称" min-width="100" align="left" show-overflow-tooltip/>
67
+ </el-table>
68
+ <pagination
69
+ :total="listQueryParams.total"
70
+ :page.sync="listQueryParams.pageNum"
71
+ :limit.sync="listQueryParams.pageSize"
72
+ @pagination="getList"
73
+ />
74
+ </div>
75
+ </base-dialog>
76
+ </template>
77
+
78
+ <script>
79
+ import {tableHandleSelect, tableOnSelectionChange, tableRowClick, tableRowStyle} from "@/utils/index";
80
+ import {pageByWorkUnitIdAndWuEquipment} from "@srcApi/fd/wuEquipment";
81
+
82
+ export default {
83
+ name: "EquipmentModal",
84
+ props: {
85
+ workCenterId: {
86
+ type: String,
87
+ default: undefined
88
+ },
89
+ multipleChoice: {
90
+ type: Boolean,
91
+ default: false
92
+ },
93
+ },
94
+ data() {
95
+ return {
96
+ visible: false,
97
+ loading: false,
98
+ dialogType: '2',
99
+ listQueryParams: {
100
+ pageNum: 1,
101
+ pageSize: 10,
102
+ total: 0,
103
+ equipmentNo: '',
104
+ equipmentName: ''
105
+ },
106
+ listData: [],
107
+ multipleSelection: []
108
+ }
109
+ },
110
+ computed: {},
111
+ watch: {},
112
+ mounted() {},
113
+ created() {
114
+ this.init()
115
+ },
116
+ methods: {
117
+ init() {
118
+ this.getList()
119
+ },
120
+ handleQuery() {
121
+ this.getList()
122
+ },
123
+ resetQuery() {
124
+ Object.assign(this.$data.listQueryParams, this.$options.data().listQueryParams)
125
+ this.resetForm('queryForm')
126
+ this.handleQuery()
127
+ },
128
+ getList() {
129
+ this.loading = true
130
+ const pageNum = this.listQueryParams.pageNum ? this.listQueryParams.pageNum : 1;
131
+ const pageSize = this.listQueryParams.pageSize ? this.listQueryParams.pageSize : 10;
132
+ const params = {
133
+ workCenterId: this.workCenterId,
134
+ equipmentNo: this.listQueryParams.equipmentNo,
135
+ equipmentName: this.listQueryParams.equipmentName,
136
+ pageNum: pageNum,
137
+ pageSize: pageSize
138
+ }
139
+ pageByWorkUnitIdAndWuEquipment(params).then(response => {
140
+ this.listQueryParams.total = Number(response.total);
141
+ this.listData = response.rows;
142
+ }).finally(() => {
143
+ this.loading = false
144
+ })
145
+ },
146
+ handleConfirm() {
147
+ if (!this.multipleSelection || this.multipleSelection.length === 0) {
148
+ this.msgError("请选择一笔设备数据!");
149
+ } else {
150
+ if(this.multipleChoice) {
151
+ this.$closeDialog(true, this.multipleSelection)
152
+ } else {
153
+ this.$closeDialog(true, this.multipleSelection?.[0])
154
+ }
155
+ }
156
+ },
157
+ handleCancel() {
158
+ this.$closeDialog()
159
+ },
160
+
161
+ /** 手动勾选数据行的 Checkbox 时触发的事件*/
162
+ handleSelect(selection, row) {
163
+ tableHandleSelect(selection, row, this.$refs.multipleTable)
164
+ },
165
+ /** 行点击事件*/
166
+ rowClick(row, column, event) {
167
+ tableRowClick(row, this.multipleChoice, this.$refs.multipleTable, this.multipleSelection)
168
+ },
169
+ /** 明细复选框选中事件 */
170
+ onSelectionChange(val) {
171
+ this.multipleSelection = val
172
+ tableOnSelectionChange(val, this.multipleChoice, this.$refs.multipleTable)
173
+ },
174
+
175
+ rowStyle({ row, rowIndex }) {
176
+ tableRowStyle({ row, rowIndex })
177
+ }
178
+ }
179
+ }
180
+ </script>
181
+
182
+ <style lang="scss" scoped>
183
+ ::v-deep .el-dialog__body {
184
+ padding: 0;
185
+ }
186
+
187
+ ::v-deep .el-divider--horizontal {
188
+ margin: 0;
189
+ }
190
+
191
+ .body__container {
192
+ padding: 24px;
193
+ }
194
+
195
+ .custom-dialog {
196
+ display: flex;
197
+ flex-direction: column;
198
+
199
+ position: absolute;
200
+ top: 50%;
201
+ left: 50%;
202
+ margin: 0 !important;
203
+ transform: translate(-50%, -50%);
204
+ max-height: calc(100% - 30px);
205
+ max-width: calc(100% - 30px);
206
+
207
+ .el-dialog__body {
208
+ padding-top: 10px;
209
+ padding-bottom: 10px;
210
+ overflow: auto;
211
+ }
212
+ }
213
+
214
+ .el-form-item {
215
+ display: flex;
216
+ width: 100%;
217
+
218
+ ::v-deep &__content {
219
+ flex: 1;
220
+ }
221
+ }
222
+ </style>
@@ -21,7 +21,7 @@
21
21
  <el-row class="mb8">
22
22
  <el-col :span="6">
23
23
  <el-form-item label="组织" prop="siteId">
24
- <el-select v-model="listQueryParams.siteId">
24
+ <el-select v-model="listQueryParams.siteId" :disabled="siteIdDisabled">
25
25
  <el-option v-for="dict in siteOptions"
26
26
  :key="dict.id"
27
27
  :label="dict.componentName"
@@ -145,7 +145,11 @@ export default {
145
145
  defectGroupOptions: []
146
146
  }
147
147
  },
148
- computed: {},
148
+ computed: {
149
+ siteIdDisabled() {
150
+ return !!this.siteId
151
+ }
152
+ },
149
153
  created() {
150
154
  if (!!this.siteId) {
151
155
  this.listQueryParams.siteId = this.siteId
@@ -35,22 +35,52 @@
35
35
  </el-col>
36
36
  </el-row>
37
37
  <el-form :model="ngEntity" ref="checkEntityNgs" :disabled="!isShowConfirm">
38
- <el-table :border="true" max-height="400" width="100%" stripe :data="ngEntity.defectList">
38
+ <el-table :border="true" max-height="400" width="100%" stripe :data="ngEntity.defectList"
39
+ :header-cell-style="{'text-align':'center'}">
39
40
  <el-table-column type="index" label="序号" width="50" align="center" />
40
- <el-table-column prop="defectGroupNo" label="缺陷组代码" align="center" :min-width="200"/>
41
- <el-table-column prop="defectGroupName" label="缺陷组名称" align="center" :min-width="200"/>
42
- <el-table-column prop="defectItemNo" label="缺陷项代码" align="center" :min-width="200"/>
43
- <el-table-column prop="defectItemName" label="缺陷项名称" align="center" :min-width="200">
41
+ <el-table-column prop="defectGroupNo" label="缺陷组编号" align="left" :min-width="80" show-overflow-tooltip/>
42
+ <el-table-column prop="defectGroupName" label="缺陷组名称" align="left" :min-width="80" show-overflow-tooltip/>
43
+ <el-table-column prop="defectItemNo" label="缺陷项编号" align="left" :min-width="80" show-overflow-tooltip/>
44
+ <el-table-column prop="defectItemName" label="缺陷项名称" align="left" :min-width="160" show-overflow-tooltip>
44
45
  <template slot-scope="scope">
45
46
  <el-form-item
46
47
  style="margin:0" :rules="ngsRules.defectItemName" :disabled="scope.row.isSelect"
47
48
  :prop="'defectList.' + scope.$index + '.defectItemName'"
48
49
  >
49
- <el-input v-model="scope.row.defectItemName" />
50
+ <template v-if="!scope.row.isSelect">
51
+ <el-input v-model="scope.row.defectItemName" :disabled="scope.row.isSelect"/>
52
+ </template>
53
+ <template v-else>
54
+ <span>{{ scope.row.defectItemName }}</span>
55
+ </template>
50
56
  </el-form-item>
51
57
  </template>
52
58
  </el-table-column>
53
- <el-table-column fixed="right" align="center" :min-width="120" prop="operation" label="操作">
59
+ <el-table-column prop="defectReason" label="不良原因" align="left" :min-width="200">
60
+ <template slot-scope="scope">
61
+ <template v-if="scope.row.isSelect">
62
+ <el-select
63
+ v-model="scope.row.defectReasonIds"
64
+ multiple filterable clearable
65
+ placeholder="请选择不良原因"
66
+ style="width: 100%;"
67
+ >
68
+ <el-option
69
+ v-for="item in scope.row.defectReasonOptions"
70
+ :key="item.id"
71
+ :label="item.defectReason"
72
+ :value="item.id"
73
+ />
74
+ </el-select>
75
+ </template>
76
+ </template>
77
+ </el-table-column>
78
+ <el-table-column prop="defectItemNo" label="备注" align="left" :min-width="160" show-overflow-tooltip>
79
+ <template slot-scope="scope">
80
+ <el-input v-model="scope.row.remark" clearable show-overflow-tooltip/>
81
+ </template>
82
+ </el-table-column>
83
+ <el-table-column fixed="right" align="center" :min-width="60" prop="operation" label="操作">
54
84
  <template slot-scope="scope">
55
85
  <el-button style="padding: 0px" size="mini" type="text"
56
86
  @click.stop="handleRemove(scope.$index)">删除</el-button>
@@ -64,7 +94,7 @@
64
94
 
65
95
  <script>
66
96
  import DefectModal from "@srcViews/qms/components/modal/DefectModal.vue";
67
-
97
+ import {listDefectReasonByDefectItemId} from "@srcApi/qms/defectReason";
68
98
  export default {
69
99
  name: "MesDefectModifyModal",
70
100
  props: {
@@ -116,7 +146,7 @@ export default {
116
146
  self.$lockSubmit()
117
147
  self.$refs["checkEntityNgs"].validate((valid) => {
118
148
  if (valid) {
119
- self.$closeDialog(true, this.ngEntity.defectList)
149
+ self.$closeDialog(true, self.ngEntity.defectList)
120
150
  self.$unlockSubmit()
121
151
  }else {
122
152
  self.$unlockSubmit()
@@ -131,12 +161,16 @@ export default {
131
161
  this.$openDialog(DefectModal)({
132
162
  siteId: self.siteId,
133
163
  multipleChoice: true,
134
- onDone: (data) => {
164
+ onDone: async (data) => {
135
165
  if (data?.length > 0) {
136
- data.forEach(defect => {
137
- defect.isSelect = true //是否通过弹窗新增
166
+ for (const defect of data) {
167
+ // 是否通过弹窗新增
168
+ defect.isSelect = true
169
+ // 获取缺陷项对应的不良属性
170
+ const res = await listDefectReasonByDefectItemId({defectItemId: defect.defectItemId})
171
+ defect.defectReasonOptions = res.data
138
172
  self.ngEntity.defectList.push(defect)
139
- })
173
+ }
140
174
  }
141
175
  }
142
176
  })