WorkOrderDetailList.vue
11 KB
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
<template>
<a-card :bordered="false" :class="'cust-erp-sub-tab'">
<!-- 操作按钮区域 -->
<div class="table-operator" v-if="mainId">
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal"
@handleSuperQuery="handleSuperQuery"></j-super-query>
<a-button @click="submitToWarehouse" type="primary" icon="plus">生产领料</a-button>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:scroll="{x:true}"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
@expand="onExpand"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" height="25px" alt=""
style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action2" slot-scope="text, record">
<!-- <a @click="sendWorkToT100(record)">编辑</a>-->
</span>
<!-- <a-table-->
<!-- slot="expandedRowRender"-->
<!-- slot-scope="text"-->
<!-- :columns="innerColumns"-->
<!-- :data-source="innerData"-->
<!-- :pagination="false"-->
<!-- >-->
<!-- <span slot="action" slot-scope="text, record">-->
<!-- <a v-if="record.status==null||record.status=='0'" @click="editDetail(record)">转委外</a>-->
<!-- <a-divider type="vertical" v-if="record.status==null||record.status=='0'"/>-->
<!-- <a v-if="record.status==null||record.status=='0'" @click="workForm(record)">报工</a>-->
<!-- <a-divider type="vertical" v-if="record.status==null||record.status=='0'"/>-->
<!-- <a @click="sendReceiptToT100(record)">委外单推送测试</a>-->
<!-- <a-divider type="vertical"/>-->
<!-- <a @click="sendWorkToT100(record)">推送报工测试</a>-->
<!-- </span>-->
<!-- </a-table>-->
</a-table>
</div>
<workOrderDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></workOrderDetail-modal>
<report-work ref="workForm"></report-work>
<submit-warehouse ref="submitFrom"></submit-warehouse>
</a-card>
</template>
<script>
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import WorkOrderDetailModal from './modules/WorkOrderDetailModal'
import reportWork from "./modules/reportWork";
import {querySonDetailList, sendWork, sendWwReceipt} from "../../api/schedulerApi";
import submitWarehouse from "./modules/submitWarehouse";
export default {
name: "WorkOrderDetailList",
mixins: [JeecgListMixin],
components: {WorkOrderDetailModal, reportWork, submitWarehouse},
props: {
mainId: {
type: String,
default: '',
required: false
},
workCode: {
type: String,
default: '',
required: false
},
projectCode: {
type: String,
default: '',
required: false
}
},
watch: {
mainId: {
immediate: true,
handler(val) {
if (!this.mainId) {
this.clearList()
} else {
this.queryParam['workOrderId'] = val
this.loadData(1);
}
}
}
},
data() {
return {
description: '工单头表管理页面',
disableMixinCreated: true,
// 表头
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
},
{
title: '项次',
align: "center",
dataIndex: 'sfbaseq'
},
// {
// title: '上阶料号',
// align: "center",
// dataIndex: 'sfba001'
// },
{
title: 'bom料号',
align: "center",
dataIndex: 'sfba005'
},
{
title: 'bom名称',
align: "center",
dataIndex: 'bomName'
},
{
title: '发料料号',
align: "center",
dataIndex: 'sfba006'
},
{
title: '发料名称',
align: "center",
dataIndex: 'materielName'
},
{
title: '规格',
align: "center",
dataIndex: 'spec'
},
{
title: '重量',
align: "center",
dataIndex: 'weight'
},
{
title: '长度',
align: "center",
dataIndex: 'length'
},
{
title: '总应发数量',
align: "center",
dataIndex: 'sfba013'
},
{
title: '已发数量',
align: "center",
dataIndex: 'yfsl'
},
{
title: '单位',
align: "center",
dataIndex: 'sfba014'
},
{
title: '操作',
dataIndex: 'action',
align: "center",
scopedSlots: {customRender: 'action2'},
}
],
innerColumns: [
{
title: '#', dataIndex: '', key: 'rowIndex', width: 60, align: 'center', customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{title: '名称', align: 'center', dataIndex: 'name'},
{title: '工艺', align: 'center', dataIndex: 'technologyName'},
{title: '准备工时(分钟)', align: 'center', dataIndex: 'readyTime'},
{title: '操作工时(分钟)', align: 'center', dataIndex: 'technologyTime'},
{
title: '状态', align: 'center', dataIndex: 'status', customRender: function (text) {
if (text === 0) {
return '生产中'
} else if (text === 1) {
return '按时完成'
} else if (text === 2) {
return '超时完成'
}
}
},
{title: '排序', align: 'center', dataIndex: 'sequence'},
{title: '生产数量', align: 'center', dataIndex: 'qty'},
{title: '完成数量', align: 'center', dataIndex: 'completeQty'},
{title: '完成人', align: 'center', dataIndex: 'completeBy'},
{title: '是否报工', align: 'center', dataIndex: 'enable'},
{
title: '完成时间', align: 'center', dataIndex: 'completeDate', customRender: function (text) {
return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
}
},
{title: '延误原因', align: 'center', dataIndex: 'delayReason'},
{
title: '操作',
dataIndex: 'action',
align: 'center',
fixed: 'right',
width: 300,
scopedSlots: {customRender: 'action'}
}
],
innerData: [],
url: {
list: "/work_order/workOrder/listWorkOrderDetailByMainId",
delete: "/work_order/workOrder/deleteWorkOrderDetail",
deleteBatch: "/work_order/workOrder/deleteBatchWorkOrderDetail",
exportXlsUrl: "/work_order/workOrder/exportWorkOrderDetail",
importUrl: "/work_order/workOrder/importWorkOrderDetail",
},
dictOptions: {},
superFieldList: [],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl() {
return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`;
}
},
methods: {
submitToWarehouse() {
if (this.selectedRowKeys.length < 1) {
this.$message.warning('至少选择一条记录!');
return false;
}
let ids = this.selectedRowKeys.join(",");
this.$refs.submitFrom.edit(ids, this.workCode, this.projectCode);
},
clearList() {
this.dataSource = []
this.selectedRowKeys = []
this.ipagination.current = 1
},
editDetail(record) {
this.$refs.modalForm.edit(record);
},
workForm(record) {
this.$refs.workForm.edit(record, this.workCode);
},
onExpand(expanded, record) {
if (expanded) {
let params = {
'id': record.id
}
querySonDetailList(params).then((res) => {
if (res.success) {
this.innerData = res.result
}
})
this.expandedRowKeys = []
this.expandedRowKeys.push(record.id)
} else {
this.expandedRowKeys = []
}
},
sendWorkToT100(record) {
let params = {
'id': record.id
}
sendWork(params).then((res) => {
alert(JSON.stringify(res))
})
},
sendReceiptToT100(record) {
let params = {
'id': record.id
}
sendWwReceipt(params).then((res) => {
alert(JSON.stringify(res))
})
},
getSuperFieldList() {
let fieldList = [];
fieldList.push({type: 'string', value: 'sfaasite', text: '营运据点', dictCode: ''})
fieldList.push({type: 'string', value: 'sfaadocno', text: '单号', dictCode: ''})
fieldList.push({type: 'date', value: 'sfaadocdt', text: '单据日期'})
fieldList.push({type: 'string', value: 'sfaa002', text: '生管人员', dictCode: ''})
fieldList.push({type: 'string', value: 'sfaa003', text: '工单类型', dictCode: ''})
fieldList.push({type: 'string', value: 'sfaa005', text: '工单来源', dictCode: ''})
fieldList.push({type: 'string', value: 'sfaa010', text: '生产料号', dictCode: ''})
fieldList.push({type: 'BigDecimal', value: 'sfaa012', text: '生产数量', dictCode: ''})
fieldList.push({type: 'string', value: 'sfaa013', text: '生产单位', dictCode: ''})
fieldList.push({type: 'date', value: 'sfaa019', text: '预计开工日'})
fieldList.push({type: 'date', value: 'sfaa020', text: '预计完工日'})
fieldList.push({type: 'string', value: 'sfaa028', text: '项目编号', dictCode: ''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>