Przeglądaj źródła

fix:优化 在线索里面第二次点击询价的时候只编辑表单,不编辑价格

zhangxin 1 miesiąc temu
rodzic
commit
5b59c343f2

+ 11 - 4
components/add-inquiry-dialog/index.vue

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

+ 1 - 1
pages/clue/post/index.vue

@@ -169,7 +169,7 @@ export default {
169
 					clueId: item.id,
169
 					clueId: item.id,
170
 					type:1
170
 					type:1
171
 				}
171
 				}
172
-				this.editOrAdd = 'edit'
172
+				this.editOrAdd = 'editForm'
173
 				uni.$u.api.inquiryDetail(data).then(res=>{
173
 				uni.$u.api.inquiryDetail(data).then(res=>{
174
 					if(res.code === 200){
174
 					if(res.code === 200){
175
 						this.$nextTick(()=>{
175
 						this.$nextTick(()=>{