WorkOrderDetailModal.vue
4.36 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
<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="workNo" 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="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="unit" placeholder="" disabled=""></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="供应商编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- <a-input placeholder="请输入工作令号" v-model="queryParam.workNo"></a-input>-->
<j-popup v-model="suppiler_code" code="getPmaaucByT100" field="partnerid"
orgFields="partnerid,partnershortname"
destFields="partnerid,partnershortname" :multi="true" :trigger-change="true"
@callback="findCarNumberClick"/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="供应商名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-model="suppiler_name" placeholder="" disabled=""></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="委外数量" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number v-model="qty" placeholder="请输入委外数量" style="width: 100%"/>
</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: "",
workNo: "",
weiwai: "",
suppiler_code: "",
materialCode: "",
suppiler_name: "",
unit: "",
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) {
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
this.materialCode = record.no
this.unit = record.unit
this.qty = record.sfba013
this.workNo = record.sfbadocno
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>