| | |
| | | @change="onChangeVisit" /> |
| | | </view> |
| | | <view class="form-item d-b-c border-b-e" v-if="is_checked_visit"> |
| | | <view class="item-title">被走访企业名称</view> |
| | | <input type="text" v-model="formData.visit_supplier_name" class="ww100" placeholder="商户没有入驻时,请输入被走访企业名称" /> |
| | | </view> |
| | | <view class="form-item d-b-c border-b-e" v-if="is_checked_visit"> |
| | | <view class="item-title">被走访企业</view> |
| | | <view class="d-s-c" @click="selectSupplier('visit')"> |
| | | <view class="make-item input-box flex-1">{{visit_supplier_name||'请选择'}}</view> |
| | |
| | | <view class="item-title">活动名额(人)</view> |
| | | <input type="number" v-model="formData.limit_num" class="tr flex-1" |
| | | placeholder='请输入活动名额,0表示不限制' /> |
| | | </view> |
| | | <view class="form-item d-b-c border-b-e" v-if="selectedCategory.limit_num > 0"> |
| | | <view class="gray9 pt10">该分类最多{{selectedCategory.limit_num}}人</view> |
| | | </view> |
| | | <view class="form-item d-b-c border-b-e"> |
| | | <view class="item-title">报名开始时间</view> |
| | |
| | | mounted() { |
| | | this.getData(); |
| | | }, |
| | | computed: { |
| | | selectedCategory() { |
| | | if (!this.category || this.category.length === 0 || this.category_index === '') { |
| | | return {}; |
| | | } |
| | | return this.category[this.category_index] || {}; |
| | | } |
| | | }, |
| | | methods: { |
| | | getData() { |
| | | let self = this; |
| | |
| | | // }); |
| | | // return false; |
| | | // } |
| | | |
| | | // 如果是走访活动,先检查差评 |
| | | if (formData.is_visit && (formData.visit_supplier_id || formData.visit_supplier_name)) { |
| | | uni.showLoading({ |
| | | title: '正在检查', |
| | | mask: true |
| | | }); |
| | | self._post('branch.admin.activity/checkNegativeComment', { |
| | | visit_supplier_id: formData.visit_supplier_id || 0, |
| | | visit_supplier_name: formData.visit_supplier_name || '', |
| | | activity_id: self.activity_id || 0 |
| | | }, function(res) { |
| | | uni.hideLoading(); |
| | | if (res.data.has_warning) { |
| | | // 显示确认对话框 |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: res.data.message, |
| | | confirmText: '继续走访', |
| | | cancelText: '取消', |
| | | success: function(modalRes) { |
| | | if (modalRes.confirm) { |
| | | // 用户确认继续,直接提交 |
| | | self.doSubmit(formData); |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | // 没有差评警告,直接提交 |
| | | self.doSubmit(formData); |
| | | } |
| | | }, function() { |
| | | // 检查失败,直接提交 |
| | | uni.hideLoading(); |
| | | self.doSubmit(formData); |
| | | }); |
| | | } else { |
| | | // 不是走访活动,直接提交 |
| | | self.doSubmit(formData); |
| | | } |
| | | }, |
| | | |
| | | // 实际提交表单 |
| | | doSubmit(formData) { |
| | | let self = this; |
| | | uni.showLoading({ |
| | | title: '正在提交', |
| | | mask: true |
| | |
| | | this.formData.category_id = this.category[this.category_index].category_id; |
| | | }, |
| | | |
| | | // 打开企业选择弹窗 |
| | | selectSupplier(e) { |
| | | this.supplier_type = e; |
| | | this.open_supplier = true; |
| | |
| | | }, |
| | | insertImage() { |
| | | this.isupload = true; |
| | | this.upload_type = 'insertImage' |
| | | |
| | | this.upload_type = 'insertImage'; |
| | | } |
| | | } |
| | | } |