reportWork.vue
3.74 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
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="24">
<a-form-item label="生产料号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-model="materialCode" placeholder="" disabled=""></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="工艺" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-model="technologyName" placeholder=""></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="准备工时" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-model="readyComplete" placeholder=""></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="操作工时" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-model="technologyComplete" placeholder=""></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="完工数量" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number v-model="completeQty" placeholder=""></a-input-number>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import {addInquiry} from "../../../api/schedulerApi";
export default {
name: "WorkOrderDetailModal",
components: {},
props: {
mainId: {
type: String,
required: false,
default: ''
}
},
data() {
return {
form: this.$form.createForm(this),
title: "操作",
id: "",
qty: "",
weiwai: "",
completeQty: "",
technologyComplete: "",
readyComplete: "",
unit: "",
technologyName: "",
width: 800,
visible: false,
model: {},
searchOptions: [{
text: "是",
value: "1"
}, {
text: "否",
value: "0"
}],
labelCol: {
xs: {span: 24},
sm: {span: 5},
},
wrapperCol: {
xs: {span: 24},
sm: {span: 16},
},
confirmLoading: false,
validatorRules: {},
url: {
add: "/work_order/workOrder/addWorkOrderDetail",
edit: "/work_order/workOrder/editWorkOrderDetail",
}
}
},
created() {
},
methods: {
add() {
this.edit({});
},
edit(record) {
alert(JSON.stringify(record))
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
this.materialCode = record.no
this.technologyName = record.technologyName
this.id = record.id
},
close() {
this.$emit('close');
this.visible = false;
},
findCarNumberClick(row) {
this.suppiler_name = row.partnershortname;
this.suppiler_code = row.partnerid;
},
handleOk() {
let params = {
'woDetailId': this.id,
'supplierCode': this.suppiler_code,
'supplierName': this.suppiler_name,
'materialCode': this.materialCode,
'qty': this.qty,
}
addInquiry(params).then((res) => {
alert(JSON.stringify(res))
})
},
handleCancel() {
this.close()
},
popupCallback(row) {
this.form.setFieldsValue(pick(row, 'createBy', 'createTime', 'updateBy', 'updateTime', 'sfbadocno', 'sfbaseq', 'sfba001', 'sfba005', 'sfba006', 'sfba009', 'sfba013', 'sfba014', 'workOrderId'))
},
}
}
</script>