|
@@ -1,5 +1,5 @@
|
|
|
<script lang="ts" setup>
|
|
|
-import { addQuestionReportData,REPORTDATA, getQuestionTypeList, pageQuestionReportData } from '@/api/questionReqort'
|
|
|
+import { addQuestionReportData,REPORTDATA, getQuestionTypeList, pageQuestionReportData,getPerson } from '@/api/questionReqort'
|
|
|
import { AddQuestionReportDataReq, QuestionListRes, QuestionType, QuestionTypeListRes } from '@/api/questionReqort/types'
|
|
|
import { onMounted, ref } from 'vue'
|
|
|
import GridAddress from '@/components/address/gridAddress/index.vue'
|
|
@@ -11,30 +11,40 @@ const active = ref(0)
|
|
|
|
|
|
const formData = ref<AddQuestionReportDataReq & { location?: string }>({})
|
|
|
const range = ref<{ text: string; value: string }[]>([])
|
|
|
+const rangePerson = ref([]) as any
|
|
|
+
|
|
|
+const changeQuestionType = (e:any) => {
|
|
|
+ formData.value = {};
|
|
|
+ formData.value.questionType = e;
|
|
|
+}
|
|
|
+
|
|
|
const rules = ref({
|
|
|
questionType: [{ required: true, message: '请选择类型' }],
|
|
|
- questionTitle: [{ required: true, message: '请输入标题' }],
|
|
|
+ // questionTitle: [{ required: true, message: '请输入标题' }],
|
|
|
contactPerson: [{ required: true, message: '请输入联系人' }],
|
|
|
+ contactPhone: [{ required: true, message: '请输入联系人电话' }],
|
|
|
questionContent: [{ required: true, message: '请输入内容' }],
|
|
|
addrName: [{ required: true, message: '请输入所在地' }],
|
|
|
})
|
|
|
|
|
|
/** 上报问题 */
|
|
|
const addressList = ref([])
|
|
|
-const handleAddressFinish = (value) => {
|
|
|
+const handleAddressFinish = async(value) => {
|
|
|
formData.value.addrName = value.selectedOptions[value.tabIndex].areaName
|
|
|
addressList.value = value
|
|
|
+ const { data } = await getPerson({parentCode:value.value})
|
|
|
+ console.log('data==',data)
|
|
|
}
|
|
|
const submit = async () => {
|
|
|
console.log(`output->formData.value`,formData.value)
|
|
|
if (!formData.value.questionType) {
|
|
|
- showNotify('请选择类型')
|
|
|
- return
|
|
|
- }
|
|
|
- if (!formData.value.questionTitle) {
|
|
|
- showNotify('请输入标题')
|
|
|
+ showNotify('请选择问题类型')
|
|
|
return
|
|
|
}
|
|
|
+ // if (!formData.value.questionTitle) {
|
|
|
+ // showNotify('请输入标题')
|
|
|
+ // return
|
|
|
+ // }
|
|
|
if (!formData.value.questionContent) {
|
|
|
showNotify('请输入内容')
|
|
|
return
|
|
@@ -43,12 +53,20 @@ const submit = async () => {
|
|
|
showNotify('请输入联系人姓名')
|
|
|
return
|
|
|
}
|
|
|
+ if (!formData.value.contactPhone) {
|
|
|
+ showNotify('请输入联系人电话')
|
|
|
+ return
|
|
|
+ }
|
|
|
if (!addressList.value || addressList.value.length === 0) {
|
|
|
showNotify('请选择所在地')
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ console.log('formData.value',formData.value)
|
|
|
+ return
|
|
|
const { data } = await addQuestionReportData({
|
|
|
...formData.value,
|
|
|
+ personList:formData.value.person1+','+formData.value.person2,
|
|
|
streetCode: addressList.value.selectedOptions[1] ? addressList.value.selectedOptions[1].areaCode : '',
|
|
|
streetName: addressList.value.selectedOptions[1] ? addressList.value.selectedOptions[1].areaName : '',
|
|
|
communityCode: addressList.value.selectedOptions[2] ? addressList.value.selectedOptions[2].areaCode : '',
|
|
@@ -75,7 +93,7 @@ const reportCY = async (params:any) => {
|
|
|
const { data } = await REPORTDATA({
|
|
|
data:{
|
|
|
otherTaskNum:params.uuid.replace(/-/g,''),
|
|
|
- eventTitle:params.questionTitle,
|
|
|
+ // eventTitle:params.questionTitle,
|
|
|
eventDesc:params.questionContent,
|
|
|
eventTypeCode:'109000',
|
|
|
eventTypeName:'民事纠纷',
|
|
@@ -141,6 +159,7 @@ const hanleSelectArea = () => {
|
|
|
}
|
|
|
|
|
|
onMounted(async () => {
|
|
|
+ // 问题类型下拉
|
|
|
const { data } = await getQuestionTypeList({
|
|
|
page: 1,
|
|
|
limit: 9999,
|
|
@@ -156,6 +175,18 @@ onMounted(async () => {
|
|
|
} else {
|
|
|
range.value = []
|
|
|
}
|
|
|
+// 负责人下拉
|
|
|
+ rangePerson.value = [{
|
|
|
+ text: '张三',
|
|
|
+ value: '张三',
|
|
|
+ }, {
|
|
|
+ text: '李四',
|
|
|
+ value: '李四',
|
|
|
+ }, {
|
|
|
+ text: '王五',
|
|
|
+ value: '王五',
|
|
|
+ }]
|
|
|
+
|
|
|
})
|
|
|
</script>
|
|
|
|
|
@@ -165,25 +196,39 @@ onMounted(async () => {
|
|
|
<view class="tab-container">
|
|
|
<uni-forms ref="questionReportFormRef" :modelValue="formData" :rules="rules" label-align="right" label-width="80">
|
|
|
<uni-forms-item label="问题类型" required name="questionType">
|
|
|
- <uni-data-select v-model="formData.questionType" :localdata="range"></uni-data-select>
|
|
|
+ <uni-data-select v-model="formData.questionType" :localdata="range" @change="changeQuestionType"></uni-data-select>
|
|
|
</uni-forms-item>
|
|
|
<!-- 问题标题 -->
|
|
|
- <uni-forms-item label="问题标题" required name="questionTitle">
|
|
|
+ <!-- <uni-forms-item label="问题标题" required name="questionTitle">
|
|
|
<uni-easyinput v-model="formData.questionTitle" placeholder="请输入标题"></uni-easyinput>
|
|
|
+ </uni-forms-item> -->
|
|
|
+ <!-- 当事人 -->
|
|
|
+ <uni-forms-item v-if="formData.questionType=='矛盾纠纷'" label="当事人1" required name="person1">
|
|
|
+ <uni-easyinput v-model="formData.person1" placeholder="请输入当事人"></uni-easyinput>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item v-if="formData.questionType=='矛盾纠纷'" label="当事人2" required name="person2">
|
|
|
+ <uni-easyinput v-model="formData.person2" placeholder="请输入当事人"></uni-easyinput>
|
|
|
</uni-forms-item>
|
|
|
<!-- 问题内容 -->
|
|
|
- <uni-forms-item label="问题内容" required name="questionContent">
|
|
|
- <uni-easyinput v-model="formData.questionContent" :maxlength="-1" type="textarea" placeholder="请输入内容"></uni-easyinput>
|
|
|
+ <uni-forms-item label="问题描述" required name="questionContent">
|
|
|
+ <uni-easyinput v-model="formData.questionContent" :maxlength="-1" type="textarea" placeholder="请输入问题描述"></uni-easyinput>
|
|
|
</uni-forms-item>
|
|
|
<!-- 问题所在地 -->
|
|
|
<uni-forms-item label="所在地" required name="addrName">
|
|
|
<uni-easyinput v-model="formData.addrName" placeholder="请输入所在地" @focus="hanleSelectArea"></uni-easyinput>
|
|
|
<GridAddress v-model="areaShow" @finish="handleAddressFinish"></GridAddress>
|
|
|
</uni-forms-item>
|
|
|
+ <!-- 负责人下拉 -->
|
|
|
+ <uni-forms-item label="负责人" required name="person">
|
|
|
+ <uni-data-select v-model="formData.chargerName" :localdata="rangePerson"></uni-data-select>
|
|
|
+ </uni-forms-item>
|
|
|
<!-- 联系人姓名 -->
|
|
|
<uni-forms-item label="联系人姓名" required name="contactPerson">
|
|
|
<uni-easyinput v-model="formData.contactPerson" placeholder="联系人姓名"></uni-easyinput>
|
|
|
</uni-forms-item>
|
|
|
+ <uni-forms-item label="联系人电话" required name="contactPhone">
|
|
|
+ <uni-easyinput v-model="formData.contactPhone" placeholder="联系人电话"></uni-easyinput>
|
|
|
+ </uni-forms-item>
|
|
|
</uni-forms>
|
|
|
<van-button class="w-full mb-3" type="primary" @click="submit">提交</van-button>
|
|
|
</view>
|
|
@@ -193,7 +238,7 @@ onMounted(async () => {
|
|
|
<van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="questList">
|
|
|
<view v-for="item in list" :key="item.uuid" class="list-item-style">
|
|
|
<view class="top">
|
|
|
- <view class="title">{{ item.questionTitle }}</view>
|
|
|
+ <view class="title">{{ item.questionContent }}</view>
|
|
|
<van-button plain hairline size="mini" type="primary" @click="handleGoDetail(item)">查看详情</van-button>
|
|
|
</view>
|
|
|
<view>定位:{{ item.addrName }}</view>
|
|
@@ -203,8 +248,7 @@ onMounted(async () => {
|
|
|
class="max-w-[100px] text-ellipsis overflow-hidden text-nowrap !block !leading-[25px]"
|
|
|
color="#CFFECE"
|
|
|
text-color="black"
|
|
|
- >{{ item.questionType }}</van-tag
|
|
|
- >
|
|
|
+ >{{ item.questionType }}</van-tag>
|
|
|
<van-tag v-if="item?.status === 0" color="red">未解答</van-tag>
|
|
|
<van-tag v-if="item?.status === 1" color="green">已解答</van-tag>
|
|
|
</view>
|