| <template> | 
|   <PageLayout | 
|     title="投诉举报" | 
|     class="cooperation-page-wrapper" | 
|     hasBorder | 
|     :needAuth="false" | 
|     developing | 
|   > | 
|     <ContentScrollView :paddingH="false"> | 
|       <nut-form :model-value="form" ref="formRef" :rules="rules"> | 
|         <nut-form-item label="企业名称:" class="bole-form-item" prop="companyName" required> | 
|           <nut-input | 
|             v-model.trim="form.companyName" | 
|             class="nut-input-text bole-input-text" | 
|             placeholder="请输入企业名称" | 
|             type="text" | 
|             :max-length="35" | 
|             show-word-limit | 
|           /> | 
|         </nut-form-item> | 
|         <nut-form-item label="联系人:" class="bole-form-item" prop="contact" required> | 
|           <nut-input | 
|             v-model.trim="form.contact" | 
|             class="nut-input-text bole-input-text" | 
|             placeholder="请输入联系人姓名" | 
|             type="text" | 
|             :max-length="10" | 
|             show-word-limit | 
|           /> | 
|         </nut-form-item> | 
|         <nut-form-item label="联系电话:" class="bole-form-item" prop="contactPhone" required> | 
|           <nut-input | 
|             v-model.trim="form.contactPhone" | 
|             class="nut-input-text bole-input-text" | 
|             placeholder="请输入联系人电话" | 
|             type="text" | 
|           /> | 
|         </nut-form-item> | 
|         <nut-form-item label="投诉说明:" class="bole-form-item alignTop" prop="remark" required> | 
|           <nut-textarea | 
|             placeholder="请输入举报投诉的说明" | 
|             placeholderClass="bole-input-text-placeholder" | 
|             autoSize | 
|             class="bole-input-textarea" | 
|             v-model="form.remark" | 
|             :max-length="500" | 
|             show-word-limit | 
|           > | 
|           </nut-textarea> | 
|         </nut-form-item> | 
|       </nut-form> | 
|     </ContentScrollView> | 
|     <PageFooter :isOnlyAction="false"> | 
|       <PageFooterBtn type="primary" @click="handleConfirm">提交</PageFooterBtn> | 
|     </PageFooter> | 
|   </PageLayout> | 
| </template> | 
|   | 
| <script setup lang="ts"> | 
| import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types'; | 
| import { CooperateTypeText, CooperateApplyTypeEnum } from '@12333/constants'; | 
| import { FormValidator, Message } from '@12333/utils'; | 
| import Taro from '@tarojs/taro'; | 
| import { useUser } from '@/hooks'; | 
|   | 
| defineOptions({ | 
|   name: 'complaint', | 
| }); | 
|   | 
| const { userDetail } = useUser(); | 
|   | 
| const form = reactive({ | 
|   companyName: userDetail.value?.customerName ?? '', | 
|   contact: userDetail.value?.contacter ?? '', | 
|   contactPhone: userDetail.value?.phoneNumber ?? '', | 
|   remark: '', | 
| }); | 
|   | 
| const rules = reactive<FormRules>({ | 
|   companyName: [{ required: true, message: '请输入企业名称' }], | 
|   contact: [{ required: true, message: '请输入联系人姓名' }], | 
|   contactPhone: [ | 
|     { required: true, message: '请输入联系电话' }, | 
|     { message: '请输入正确的联系电话', validator: FormValidator.validatorTelNumber }, | 
|   ], | 
|   remark: [{ required: true, message: '请输入举报投诉的说明' }], | 
| }); | 
|   | 
| const formRef = ref<any>(null); | 
|   | 
| function handleConfirm() { | 
|   if (!formRef.value) return; | 
|   formRef.value.validate().then(({ valid, errors }: any) => { | 
|     if (valid) { | 
|       createPlatformCooperationApply(); | 
|     } | 
|   }); | 
| } | 
|   | 
| async function createPlatformCooperationApply() { | 
|   try { | 
|     // let params: API.CreatePlatformCooperationApplyInput = { | 
|     //   title: CooperateTypeText.Complaint, | 
|     //   contact: form.contact, | 
|     //   contactPhone: form.contactPhone, | 
|     //   applyDescription: form.remark, | 
|     //   companyName: form.companyName, | 
|     //   applyType: CooperateApplyTypeEnum.Complaint, | 
|     // }; | 
|     // let res = await cooperationApplyServices.createPlatformCooperationApply(params); | 
|     // if (res) { | 
|     //   await Message.confirm({ | 
|     //     message: '信息已提交,请耐心等待工作人员的联系', | 
|     //   }); | 
|     //   Taro.navigateBack({ | 
|     //     delta: 1, | 
|     //   }); | 
|     // } | 
|   } catch (error) {} | 
| } | 
| </script> |