correlationDialog.vue
7.68 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
<template>
<div>
<GLDialog bigTitle="关联技师"
:visible.sync="dialogShow"
class="detail-content-warn"
width="700px"
mode="big"
:close-on-click-modal="false"
:before-close="handleClose"
@onOk="handleAddConfirm"
@onCancel="dialogShow = false">
<div v-loading="loading">
<div class="form_div">
<div class="tipsDiv">
<div class="tipsText">
<img src="../images/icon-warning.png"
class="imgCla" />
首次登记出库将标记为出库时间,若产生物料多退少补请更正实际出库数量
</div>
</div>
<el-form label-width="160px"
:model="infoForm"
ref="editRef"
:rules="formRules"
:inline="true">
<el-form-item label="选择领料技师:"
prop="technician">
<el-select v-model="infoForm.technician"
filterable
placeholder="请选择"
class="default-width">
<el-option v-for="(item, key) in baseData.technicianList"
:key="key"
:label="item.staffName"
:value="item.staffPhone"></el-option>
</el-select>
</el-form-item>
<el-form-item label="出库商品:">
{{ paramsObj.upgradeGoodsName }}
</el-form-item>
<el-form-item label="实际出库数量:"
prop="reduceStockNum">
<el-input-number v-model="infoForm.reduceStockNum"
placeholder="输入数值"
:precision="2"
:step="0.01"
:min="0"
:max="999999.99"></el-input-number>
<span class="unit">{{ infoForm.unit }}</span>
</el-form-item>
<el-form-item label="备注:">
<el-input v-model="infoForm.remark"
type="textarea"
maxlength="50"
placeholder="请输入备注"
show-word-limit
:rows="4"
class="default-width" />
</el-form-item>
</el-form>
</div>
</div>
</GLDialog>
</div>
</template>
<script>
import { baseConfig } from '@/main'
export default {
name: 'CorrelationDialog',
components: {},
props: {
visible: {
type: Boolean,
default: false
},
paramsObj: {
type: Object,
default: null
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit('dialogClose', { flag: val })
}
}
},
mounted() {
this.getData()
this.getRoleTechnicianList()
},
data() {
return {
sessionInfo: this.$globalState.session,
dialogConfig: {
config: {
title: '关联技师',
width: '600px'
}
},
infoForm: {
technician: '',
reduceStockNum: '',
remark: '',
unit: ''
},
editChildRef: 'editChildRef',
formRules: {
technician: [{ required: true, message: '请选择领料技师', trigger: 'change' }],
reduceStockNum: [{ required: true, message: '请输入0~999999的数字,支持小数2位', trigger: 'change' }]
},
loading: true,
baseData: {
technicianList: []
}
}
},
methods: {
getData() {
this.infoForm.reduceStockNum = this.paramsObj.reduceStockNum
this.infoForm.remark = this.paramsObj.remark
this.infoForm.unit = this.$membraneTypeList.includes(this.paramsObj.goodsType) ? '米' : '件'
},
// 查询领料技师
getRoleTechnicianList() {
const params = {}
params.yqMerchantId = this.paramsObj.yqMerchantId
this.$apis.stockManage.getRoleTechnician(params).then(res => {
this.baseData.technicianList = res
this.loading = false
if (this.paramsObj.technicianPhone) {
this.infoForm.technician = this.paramsObj.technicianPhone
}
})
},
handleAddConfirm() {
this.$refs.editRef.validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.infoForm)
params.id = this.paramsObj.id
params.technicianPhone = params.technician
params.technicianName = this.baseData.technicianList.find(item => item.staffPhone === params.technician)?.staffName
this.$apis.stockManage.technicianUpdate(params).then(res => {
this.$notify({
type: 'success',
title: '操作成功'
})
this.dialogShow = true
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.detail-content-warn {
.div-title {
width: 1040px;
height: 30px;
border-bottom: 1px solid #e5e5e5;
font-size: 16px;
font-weight: 600;
color: #333333;
margin: 10px 0 20px 0;
}
.el-icon-circle-close {
color: #ffffff;
}
.form_div {
color: #333333;
.tipsDiv {
display: flex;
justify-content: center; /* 水平居中 */
align-items: center; /* 垂直居中 */
// flex-direction: column;
background: #f47f131a;
height: 28px;
margin-bottom: 25px;
.tipsText {
display: flex;
align-items: center; /* 垂直居中 */
// font-weight: 500;
font-size: 13px;
color: #ff8d1a;
}
.imgCla {
margin-right: 8px;
width: 20px;
height: 20px;
}
}
.el-form-item__content {
display: inline-block;
width: calc(100% - 150px);
line-height: 24px;
}
.el-form-item__label {
padding: 0;
line-height: 24px;
}
.el-form-item {
width: 100%;
margin-bottom: 20px;
}
.edit-sub-block {
// padding: 0 10px;
.detail-txt {
display: inline-block;
width: 200px;
vertical-align: bottom;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-form-item__content {
max-width: calc(100% - 110px);
word-break: break-all;
}
.itemDiv {
display: flex;
.halfItem {
width: 33%;
}
}
.onLineItem {
::v-deep .el-form-item__content {
max-width: 80%;
}
}
}
.edit-sub-block-two {
.el-form-item__label {
padding: 0;
}
.el-form-item {
// width: 300px;
margin: 0px;
}
}
.busi-info {
box-sizing: border-box;
width: 890px;
border-radius: 4px;
border: 1px solid #e5e5e5;
padding: 6px 0;
color: #333333;
font-size: 14px;
margin-bottom: 14px;
.info-row {
height: 20px;
line-height: 20px;
margin-bottom: 16px;
}
.info-row:last-child {
margin-bottom: 0;
}
.info-item {
display: inline-block;
width: 50%;
height: 20px;
line-height: 20px;
margin-bottom: 6px;
.item-label {
display: inline-block;
width: 150px;
color: #666666;
text-align: right;
}
}
}
}
.receiptBtn {
margin-left: 20px;
}
.imgCon {
text-align: center;
margin-bottom: 50px;
}
.imgSize {
width: 1040px;
}
.default-width {
width: 350px;
}
.unit {
padding-left: 10px;
}
}
</style>