| | |
| | | data: submitData |
| | | } |
| | | }).then(res => { |
| | | |
| | | if(res.status==0){ |
| | | uni.showToast({ |
| | | title: '保存成功', |
| | | icon: 'success', |
| | | duration: 2000 |
| | | }) |
| | | }else{ |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: res.message, |
| | | confirmText: "确定", |
| | | showCancel: false, |
| | | success: (res) => { |
| | | |
| | | } |
| | | }) |
| | | } |
| | | }).catch(() => { |
| | | this.isLoading = false; // 出现错误时结束加载 |
| | | }); |
| | | |
| | | uni.showToast({ |
| | | title: '保存成功', |
| | | icon: 'success', |
| | | duration: 2000 |
| | | }) |
| | | |
| | | |
| | | } finally { |
| | | this.isSubmitting = false |
| | | } |
| | | }, |
| | | validateForm() { |
| | | for (const item of this.components) { |
| | | if (item.selectedSpec === -1 || item.selectedMfg === -1) { |
| | | return { |
| | | valid: false, |
| | | msg: `${item.name} 未完成选择` |
| | | } |
| | | } |
| | | } |
| | | // for (const item of this.components) { |
| | | // if (item.selectedSpec === -1 || item.selectedMfg === -1) { |
| | | // return { |
| | | // valid: false, |
| | | // msg: `${item.name} 未完成选择` |
| | | // } |
| | | // } |
| | | // } |
| | | return { valid: true } |
| | | }, |
| | | onLoad(options) { |