|
|
@@ -47,7 +47,7 @@ export default {
|
|
47
|
47
|
},
|
|
48
|
48
|
editOrAdd: {
|
|
49
|
49
|
type: String,
|
|
50
|
|
- default: ''
|
|
|
50
|
+ default: ''// edit 编辑(有价格), editForm 编辑询价单(无价格), add 新增询价单
|
|
51
|
51
|
},
|
|
52
|
52
|
editInfo: {
|
|
53
|
53
|
type: Object,
|
|
|
@@ -124,7 +124,7 @@ export default {
|
|
124
|
124
|
// 编辑回显
|
|
125
|
125
|
initData() {
|
|
126
|
126
|
this.$nextTick(()=>{
|
|
127
|
|
- if (this.editOrAdd === 'edit') {
|
|
|
127
|
+ if (this.editOrAdd === 'edit' || this.editOrAdd === 'editForm') {
|
|
128
|
128
|
this.info = JSON.parse(JSON.stringify(this.editInfo))
|
|
129
|
129
|
this.showModal = true;
|
|
130
|
130
|
if(this.info.model && this.info.dictValue){
|
|
|
@@ -185,13 +185,20 @@ export default {
|
|
185
|
185
|
})
|
|
186
|
186
|
return
|
|
187
|
187
|
}
|
|
|
188
|
+ if(this.editOrAdd === 'edit' && !this.info.price){
|
|
|
189
|
+ uni.showToast({
|
|
|
190
|
+ title: '请输入价格',
|
|
|
191
|
+ icon: 'none'
|
|
|
192
|
+ })
|
|
|
193
|
+ return
|
|
|
194
|
+ }
|
|
188
|
195
|
const data = {
|
|
189
|
196
|
clueId: this.clueId,
|
|
190
|
197
|
dictValue: this.info.dictValue,
|
|
191
|
198
|
dictLabel: this.info.dictLabel,
|
|
192
|
199
|
model: this.info.model,
|
|
193
|
200
|
code: this.info.code,
|
|
194
|
|
- id: this.editOrAdd === 'edit' ? this.info.id : '',
|
|
|
201
|
+ id: (this.editOrAdd === 'edit' || this.editOrAdd === 'editForm') ? this.info.id : '',
|
|
195
|
202
|
price: this.editOrAdd === 'edit' ? this.info.price : '',
|
|
196
|
203
|
imgsUrl:this.info.imgsUrl,
|
|
197
|
204
|
status: this.editOrAdd === 'edit' ? '2' : '1',
|
|
|
@@ -209,7 +216,7 @@ export default {
|
|
209
|
216
|
})
|
|
210
|
217
|
},
|
|
211
|
218
|
showDialog() {
|
|
212
|
|
- if (this.editOrAdd === 'edit') {
|
|
|
219
|
+ if (this.editOrAdd === 'edit' || this.editOrAdd === 'editForm') {
|
|
213
|
220
|
this.initData();
|
|
214
|
221
|
}else{
|
|
215
|
222
|
this.clearForm()
|