|
|
@@ -1,11 +1,15 @@
|
|
|
<template>
|
|
|
<div class="radioGroup">
|
|
|
<template v-for="(val, ind) in clueOptionList">
|
|
|
- <div class="title" v-if="val.customerClueName">
|
|
|
+ <!-- <div class="title" v-if="val.customerClueName">
|
|
|
<span class="van-f-red" v-if="val.isMust == 0">*</span>
|
|
|
{{ val.customerClueName }}
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<template v-if="val.answerType == 'dx'">
|
|
|
+ <div class="title" v-if="val.customerClueName">
|
|
|
+ <span class="van-f-red" v-if="val.isMust == 0">*</span>
|
|
|
+ {{ val.customerClueName }}
|
|
|
+ </div>
|
|
|
<van-radio-group v-model="val.searchValue" @change="radioGroupChange">
|
|
|
<template v-for="(item, index) in val.customerClueOptionList">
|
|
|
<van-radio :name="item.customerClueOptionId" :key="index" @click="radioClick">
|
|
|
@@ -19,8 +23,12 @@
|
|
|
</template>
|
|
|
</van-radio-group>
|
|
|
</template>
|
|
|
- <!-- 回答类型:wb-文本,sz-数字,rq-日期,zp-照片,dx -->
|
|
|
+ <!-- 回答类型:wb-文本,sz-数字,rq-日期,zp-照片,dx-单选,bg-表格 -->
|
|
|
<template v-if="val.answerType == 'wb'">
|
|
|
+ <div class="title" v-if="val.customerClueName">
|
|
|
+ <span class="van-f-red" v-if="val.isMust == 0">*</span>
|
|
|
+ {{ val.customerClueName }}
|
|
|
+ </div>
|
|
|
<template v-if="parentOptionList.searchValue == val.itemOptionParentId">
|
|
|
<van-field
|
|
|
v-model="val.answerValue"
|
|
|
@@ -38,7 +46,12 @@
|
|
|
</span>
|
|
|
</template>
|
|
|
</template>
|
|
|
+ <!-- 数字输入框 -->
|
|
|
<template v-if="val.answerType == 'sz'">
|
|
|
+ <div class="title" v-if="val.customerClueName">
|
|
|
+ <span class="van-f-red" v-if="val.isMust == 0">*</span>
|
|
|
+ {{ val.customerClueName }}
|
|
|
+ </div>
|
|
|
<van-field
|
|
|
class="fieldInput"
|
|
|
v-model="val.answerValue"
|
|
|
@@ -47,11 +60,71 @@
|
|
|
:error-message="val.remark"
|
|
|
type="number"></van-field>
|
|
|
</template>
|
|
|
+ <!-- 照片 -->
|
|
|
+ <template v-if="val.answerType == 'zp'">
|
|
|
+ <van-cell>
|
|
|
+ <template #title>
|
|
|
+ <span v-if="val.isMust == 0" class="van-f-red">*</span>
|
|
|
+ {{ val.customerClueName }}
|
|
|
+ <!-- 操作说明图片和电话 -->
|
|
|
+ <taskTips
|
|
|
+ v-if="val.contactPhone || val.examplePhoto"
|
|
|
+ :contactPhone="val.contactPhone"
|
|
|
+ :examplePhoto="val.examplePhoto">
|
|
|
+ </taskTips>
|
|
|
+ </template>
|
|
|
+ <template #right-icon>
|
|
|
+ <span v-if="val.isMust == '0'" style="color: red">图片必填</span>
|
|
|
+ <div class="uploadImg">
|
|
|
+ <complaintImg
|
|
|
+ uploadid="uploadid2"
|
|
|
+ :itemData="val"
|
|
|
+ @newimgarr="newimgarr1"
|
|
|
+ :customerClueId="val.customerClueId"
|
|
|
+ :customerClueItemId="val.customerClueItemId"
|
|
|
+ :required="false">
|
|
|
+ </complaintImg>
|
|
|
+ </div>
|
|
|
+ <!-- <van-icon color="#666" name="photograph" size="24" @click="imgClick(val)" /> -->
|
|
|
+ </template>
|
|
|
+ </van-cell>
|
|
|
+ <deletComplaintImg :itemData="val" @deleteImg="deleteImg"></deletComplaintImg>
|
|
|
+ </template>
|
|
|
+ <!-- 表格 -->
|
|
|
+ <template v-if="val.answerType == 'bg'">
|
|
|
+ <div class="title" v-if="val.customerClueName">
|
|
|
+ <span class="van-f-red" v-if="val.isMust == 0">*</span>
|
|
|
+ {{ val.customerClueName }}
|
|
|
+ </div>
|
|
|
+ <el-table :data="val.tableData.data" style="width: 100%; position: relative; left: -10px">
|
|
|
+ <el-table-column
|
|
|
+ v-for="(item, index) in val.tableData.title"
|
|
|
+ :prop="item.prop"
|
|
|
+ :label="item.label"
|
|
|
+ align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <template v-if="item.answerType == 'text'">
|
|
|
+ {{ scope.row[item.prop] }}
|
|
|
+ </template>
|
|
|
+ <template v-if="item.answerType == 'wb'">
|
|
|
+ <van-field v-model="scope.row[item.prop]" />
|
|
|
+ </template>
|
|
|
+ <template v-if="item.answerType == 'sz'">
|
|
|
+ <van-field v-model="scope.row[item.prop]" type="number" />
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </template>
|
|
|
</template>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import taskTips from '@/views/deviceWithin/taskTips';
|
|
|
+import deletComplaintImg from '@/components/deletComplaintImg';
|
|
|
+import complaintImg from '@/components/complaintImg';
|
|
|
export default {
|
|
|
+ components: { deletComplaintImg, taskTips, complaintImg },
|
|
|
name: 'radioGroup',
|
|
|
props: {
|
|
|
clueOptionList: {
|
|
|
@@ -70,6 +143,19 @@ export default {
|
|
|
data() {
|
|
|
return {};
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ clueOptionList: {
|
|
|
+ handler(val) {
|
|
|
+ val.forEach((item) => {
|
|
|
+ // bg表格数据存在remark
|
|
|
+ if (item.answerType == 'bg') {
|
|
|
+ this.$set(item, 'tableData', JSON.parse(item.remark));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ immediate: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
created() {
|
|
|
// console.log(this.clueOptionList);
|
|
|
},
|
|
|
@@ -116,6 +202,32 @@ export default {
|
|
|
radioClick(event) {
|
|
|
// console.log(event);
|
|
|
},
|
|
|
+ imgClick(val) {
|
|
|
+ this.show = true;
|
|
|
+ },
|
|
|
+ // 设置照片数据
|
|
|
+ newimgarr1(val) {
|
|
|
+ console.log(val);
|
|
|
+ let fileInfoList = [{ fileUrl: val.fileUrl, id: val.id }].concat(
|
|
|
+ val.itemData.fileInfoList ? val.itemData.fileInfoList : []
|
|
|
+ );
|
|
|
+ this.$set(val.itemData, 'fileInfoList', fileInfoList);
|
|
|
+ this.setFileIdList(val);
|
|
|
+ },
|
|
|
+ // 设置照片id
|
|
|
+ setFileIdList(val) {
|
|
|
+ let fileIdList = [];
|
|
|
+ let fileInfoList = val.itemData.fileInfoList || [];
|
|
|
+ fileInfoList.forEach((val) => {
|
|
|
+ fileIdList.push(val.id);
|
|
|
+ });
|
|
|
+ this.$set(val.itemData, 'fileIdList', fileIdList);
|
|
|
+ },
|
|
|
+ // 删除照片
|
|
|
+ deleteImg(val) {
|
|
|
+ val.itemData.fileInfoList.splice(val.index, 1);
|
|
|
+ this.setFileIdList(val);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -167,5 +279,13 @@ export default {
|
|
|
font-size: 12px;
|
|
|
padding: 3px 0;
|
|
|
}
|
|
|
+ .uploadImg {
|
|
|
+ width: 50px;
|
|
|
+ }
|
|
|
+ .el-table {
|
|
|
+ .el-table__cell {
|
|
|
+ padding: 3px 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|