zouling 4 months ago
parent
commit
dfc467c9f9

+ 10 - 1
user_ui/api/system/user.js

@@ -46,4 +46,13 @@ export function findVersion(data) {
     method: 'get',
     data: data
   })
-}
+}
+// 字典值yzdqId
+export function getDictionaryFn(data) {
+  return request({
+    url: '/system/dict/data/type/'+data,
+    method: 'get',
+	type:true
+  })
+}
+

+ 41 - 0
user_ui/api/work/news.js

@@ -0,0 +1,41 @@
+import request from '@/utils/request'
+
+// 投诉建议-新增wuYe:suggestion:add
+export function suggestionAdd(data) {
+  return request({
+    url: '/wuYe/suggestion',
+    method: 'post',
+    'data': data
+  })
+}
+// 投诉建议-修改wuYe:suggestion:edit
+export function suggestionlPut(data) {
+  return request({
+    url: '/wuYe/suggestion/put',
+    method: 'post',
+    'data': data
+  })
+}
+// 投诉建议-删除wuYe:suggestion:remove
+export function suggestionlDel(data) {
+  return request({
+    url: '/wuYe/suggestion/delete/'+data,
+    method: 'get',
+  })
+}
+// 投诉建议-列表wuYe:suggestion:list
+export function suggestionlList(data) {
+  return request({
+    url: '/wuYe/suggestion/list',
+    method: 'get',
+    'data': data
+  })
+}
+// 投诉建议-详情wuYe:suggestion:query
+export function suggestionlDet(data) {
+  return request({
+    url: '/wuYe/suggestion/'+data,
+    method: 'get',
+  })
+}
+

+ 0 - 6
user_ui/components/box/list.vue

@@ -125,12 +125,6 @@
 					return 0
 				}
 			},
-			topval:{
-				type:String,
-				default () {
-					return ''
-				}
-			}
 		},
 		data(){
 			return{

+ 2 - 2
user_ui/config.js

@@ -1,8 +1,8 @@
 // 应用全局配置
 module.exports = {
-  baseUrl: 'https://vue.ruoyi.vip/prod-api',
+  // baseUrl: 'https://vue.ruoyi.vip/prod-api',
   // baseUrl: 'http://47.99.82.249:5010/prod-api',
-  // baseUrl: 'http://192.168.101.245:8065',
+  baseUrl: 'http://192.168.101.245:8065',
   // baseUrlimg: 'http://114.99.127.243:2001',
   // 应用信息
   appInfo: {

+ 0 - 6
user_ui/goods/components/box/list.vue

@@ -42,12 +42,6 @@
 					return 0
 				}
 			},
-			topval:{
-				type:String,
-				default () {
-					return ''
-				}
-			}
 		},
 		data(){
 			return{

+ 0 - 6
user_ui/health/components/box/list.vue

@@ -42,12 +42,6 @@
 					return 0
 				}
 			},
-			topval:{
-				type:String,
-				default () {
-					return ''
-				}
-			}
 		},
 		data(){
 			return{

+ 1 - 1
user_ui/health/pages/health/add.vue

@@ -241,7 +241,7 @@
 <style lang="scss" scoped>
 	.bga{background-color: #46CB99;}
 .check /deep/ .uni-forms-item{min-height: 106rpx;box-sizing: border-box;display: flex;align-items: center;margin-bottom: 0;border-bottom: 2rpx solid #E6E6E6;padding:10rpx 0;}
-.check .cbox /deep/ .uni-forms-item:last-child{border: none;}
+// .check .cbox /deep/ .uni-forms-item:last-child{border: none;}
 .check /deep/ .uni-forms-item__label{font-weight: bold;font-size: 26rpx;color: #222327;flex: 0 0 auto;width: auto !important;}
 .check /deep/ .uni-easyinput{flex: 1;text-align: right;font-size: 26rpx;color: #222327;}
 .check /deep/ .uni-easyinput__content-textarea{min-height: 40rpx;font-size: 26rpx;}

+ 0 - 6
user_ui/mine/components/box/list.vue

@@ -117,12 +117,6 @@
 					return 0
 				}
 			},
-			topval:{
-				type:String,
-				default () {
-					return ''
-				}
-			}
 		},
 		data(){
 			return{

+ 6 - 9
user_ui/mine/pages/delivery/index.vue

@@ -5,12 +5,12 @@
 				<image :src="djtop"></image>本社区党员共<text>367</text>人
 			</view> -->
 			<view class="tabtop flexc">
-				<view class="tabt" :class="ttopval==ite.val?'act':''" v-for="(ite,idx) in ttoplist" :key="idx" @click="getTabtop(ite.val)">{{ite.tit}}</view>
+				<view class="tabt" :class="tabval==ite.val?'act':''" v-for="(ite,idx) in tablist" :key="idx" @click="getTabFn(ite.val)">{{ite.tit}}</view>
 			</view>
 		</view>
 		<!-- 列表 -->
 		<view class="carlists">
-			<box-list :datainfo="list" :topval="ttopval" :wtdt="wtdt" type='delivery' @getDetail="getDetail"></box-list>
+			<box-list :datainfo="list" :wtdt="wtdt" type='delivery' @getDetail="getDetail"></box-list>
 		</view>
 		<loading></loading>
 	</view>
@@ -32,8 +32,8 @@
 				pageNum: 1,
 				reachflag: true,
 				wtdt:'',
-				ttopval:'0',
-				ttoplist:[{tit:'在途快递',val:0},{tit:'最近签收',val:1}]
+				tabval:'0',
+				tablist:[{tit:'在途快递',val:0},{tit:'最近签收',val:1}]
 			}
 		},
 		onLoad: function() {
@@ -51,8 +51,8 @@
 			getDetail(){
 				this.$tab.navigateTo("/mine/pages/delivery/detail")
 			},
-			getTabtop(val){
-				this.ttopval=val
+			getTabFn(val){
+				this.tabval=val
 			},
 			getrefreshData(){
 				this.pageNum=1;
@@ -60,9 +60,6 @@
 				this.reachflag=true;
 				this.getDataFn()
 			},
-			getTabFn(val){
-				this.tabval=val
-			},
 			bindDateChangea(e){
 				var val=e.detail.value;
 				this.cxrq=val;

+ 8 - 0
user_ui/mine/pages/house/index.vue

@@ -9,6 +9,10 @@
 			<view class="flexc mb10" v-if="list.length">
 				<view class="tit">嗨,袁玥!</view>
 				<view class="tita flexcc">户主</view>
+				<view class="flex1"></view>
+				<view class="tbtns flex0 flexc" @click="getListFn">家庭成员
+					<image :src="more"></image>
+				</view>
 			</view>
 			<!-- 无 -->
 			<block v-else>
@@ -71,6 +75,7 @@
 		data(){
 			return{
 				housebg:require('@/mine/static/house/house.png'),
+				more:require("@/work/static/visitor/more.png"),
 				adrs:require('@/mine/static/house/adrs.png'),
 				backgroundColor: "transparent",
 				nvaHeight:44,
@@ -136,6 +141,9 @@
 		.txt{font-size: 26rpx;color: #272727;}
 		.tita{min-width: 86rpx;font-weight: 500;margin-left: 26rpx;font-size: 24rpx;color: #0156FE;height: 36rpx;border-radius: 18rpx;border: 2rpx solid #0156FE;}
 		.houseimg{width: 596rpx;height:204rpx;position: absolute;bottom: 0;right: -58rpx;}
+		.tbtns{font-weight: 500;font-size: 26rpx;color: #0256FD;
+			image{width: 20rpx;height: 16rpx;margin-left: 10rpx;}
+		}
 	}
 	.housebox{width: 100%;background: #FFFFFF;border-radius: 20rpx;padding: 36rpx 24rpx 16rpx;box-sizing: border-box;margin-bottom: 100rpx;
 		.hblist{display: flex;margin-bottom: 20rpx;

+ 30 - 10
user_ui/news/components/box/list.vue

@@ -20,21 +20,20 @@
 		</block>
 		<!-- 投诉建议 -->
 		<block v-if="type=='complaint'">
-			<view class="walists" v-for="(ite,idx) in datainfo" :key="idx" @click="getDetail"
+			<view class="walists" v-for="(ite,idx) in datainfo" :key="idx" @click="getDetail(ite.suggestionId)"
 				:data-idx="idx"
 				@touchstart="drawStart" @touchmove="drawMove" @touchend="drawEnd" :style="'right:'+ite.right+'px'"
 			>
 				<view class="watop watopcom">
 					<view class="watit">
-						<view class="tit">小区电梯老化</view>
-						<view class="txt co01" v-if="ite.type==1">待回复</view>
-						<view class="txt coa" v-if="ite.type==2">已回复</view>
+						<view class="tit">{{ite.title}}</view>
+						<view class="txt" :class="ite.status==1?'co01':'coa'">{{kaType(ite.status,tsjyList)}}</view>
 					</view>
-					<view class="wacoma overtwo">小区电梯时常发生问题,请物业派维修人员进行安全检 查,若无法排除问题,建议更换小区的电梯设备,避…</view>
-					<view class="wacomb">2024-11-18 08:16:54</view>
+					<view class="wacoma overtwo">{{ite.content}}</view>
+					<view class="wacomb">{{ite.createTime}}</view>
 				</view>
 				<!--  -->
-				<view class="spdel" v-if="ite.right>0" @click.stop="getDelFn()">删除</view>
+				<view class="spdel" v-if="ite.right>0&&checkPermi(['wuYe:suggestion:remove'])" @click.stop="getDelFn(ite.suggestionId)">删除</view>
 			</view>
 			<!-- checkPermi(['system:menuFood:remove'])&& -->
 			
@@ -72,6 +71,8 @@
 </template>
 
 <script>
+	import {selectDictValue} from "@/utils/common.js"
+	import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
 	import config from '@/config'
 	export default{
 		props:{
@@ -93,10 +94,10 @@
 					return 0
 				}
 			},
-			topval:{
-				type:String,
+			tsjyList:{
+				type:Array,
 				default () {
-					return ''
+					return []
 				}
 			}
 		},
@@ -115,6 +116,10 @@
 			
 		},
 		methods:{
+			checkPermi, checkRole,
+			kaType(data, list) {
+				return selectDictValue(list, data);
+			},
 			getDetail(e){
 				this.$emit('getDetail',e)
 			},
@@ -131,6 +136,21 @@
 					fail: function(err) {}
 				});
 			},
+			getDelFn(id){
+				var that=this;
+				uni.showModal({
+					title: '确认删除',
+					content: "是否确认删除",
+					cancelText: '取消',
+					confirmText: '确认',
+					success: function(res) {
+						if (res.confirm) {
+							that.$emit('getDelFn',id)
+						} else if (res.cancel) {
+						}
+					}
+				});
+			},
 			//开始触摸滑动
 			drawStart(e) {
 				// console.log("开始触发");

+ 103 - 33
user_ui/news/pages/complaint/add.vue

@@ -10,13 +10,13 @@
 						</view>
 						<view class="plr15">
 							</uni-forms-item>
-							<uni-forms-item label="标题" required="true"  name="phonenumber">
+							<uni-forms-item label="标题" required  name="title">
 								<view class="flexc">
-									<uni-easyinput v-model="datainfo.phonenumber" :inputBorder='false' placeholder="请输入标题信息" />
+									<uni-easyinput v-model="datainfo.title" :inputBorder='false' placeholder="请输入标题信息" />
 									<view class="rimg"></view>
 								</view>
 							</uni-forms-item>
-							<uni-easyinput type="textarea" autoHeight v-model="datainfo.companyIntroduction" :inputBorder='false' placeholder="请详细描述您的投诉建议内容(最多可输入200字哦)" />
+							<uni-easyinput type="textarea" autoHeight v-model="datainfo.content" :inputBorder='false' placeholder="请详细描述您的投诉建议内容(最多可输入200字哦)" />
 							<view class="voice mb28">
 								<view class="flexc">
 									<image :src="voice"></image>
@@ -26,22 +26,16 @@
 						</view>
 						<!-- 图片 -->
 						<view class="imgs">
-							<view class="img" @click="getPreview">
+						<!-- 	<view class="img" @click="getPreview">
 								<image :src="photo" class="pico"></image>
 								<image :src="del" class="del" @click="getDelFn"></image>
-							</view>
-							<view class="img" @click="getPreview">
-								<image :src="photo" class="pico"></image>
-								<image :src="del" class="del" @click="getDelFn"></image>
-							</view>
-							<view class="img" @click="getPreview">
-								<image :src="photo" class="pico"></image>
-								<image :src="del" class="del" @click="getDelFn"></image>
-							</view>
-							<view class="img" @click="getPreview">
-								<image :src="photo" class="pico"></image>
-								<image :src="del" class="del" @click="getDelFn"></image>
-							</view>
+							</view> -->
+							<block v-if="phofile&&phofile.length">
+								<view class="img" v-for="(ite,idx) in phofile" :key="idx" @click="getPreview(idx,phofile)">
+									<image :src="baseUrl+ite" class="pico"></image>
+									<image :src="del" class="del" @click.stop="getDelFn(idx)"></image>
+								</view>
+							</block>
 							<view class="addbox" @click="getaddImage">
 								<image :src="photo" class="pico"></image>
 								<view>添加图片</view>
@@ -49,7 +43,7 @@
 						</view>
 					</view>
 					<view class="plr15 flex0 mt30">
-						<view class="rhbtn " @click="getAddFn">提交信息</view>
+						<view class="rhbtn " @click="getSubmit">提交信息</view>
 					</view>
 				</view>
 			</view>
@@ -59,9 +53,11 @@
 </template>
 
 <script>
-	import config from '@/config'
-	const baseUrl = config.baseUrl
+	import config from '@/config.js'
 	import { addressPermi, addressRole } from "@/utils/permission"; // 权限判断函数
+	import {uploadIdentify,uploadmore} from '@/utils/common.js'
+	import {suggestionAdd,suggestionlPut} from "@/api/work/news.js"
+	
 	export default{
 		components:{},
 		data(){
@@ -72,19 +68,19 @@
 				voice: require('@/work/static/voice.png'),
 				photo:require("@/work/static/service/photo.png"),
 				del:require('@/work/static/service/rdel.png'),
-				list:[{tit:'123',isdefault:true},{tit:'212123',isdefault:false,isuser:true},],
-				text:"",
-				datainfo:{},
-				mjlist:[{tit:'80m²以内',val:'0'},{tit:'80-90m²',val:'1'},{tit:'90-119m²',val:'2'},{tit:'120-139m²',val:'3'},{tit:'140-159m²',val:'4'},{tit:'160m²以上',val:'5'},],
-				checkflag:true,
-				tabval:'0',
-				sexs: [{
-					text: '男',
-					value: 0
-				}, {
-					text: '女',
-					value: 1
-				}],
+				datainfo:{
+					// "suggestionId":"投诉建议ID",
+					"title":"",//投诉建议标题
+					"content":"",//投诉建议内容
+					"images":"",//投诉照片
+					// "status":"投诉建议状态:pending(待回复)、replied(已回复)",
+					"replyContent":"",//投诉建议的回复内容
+					// "type":"投诉建议类型",
+					// "isPublic":"投诉建议是否公开:Y(公开)、N(不公开)",
+					// "isDel":"是否删除:Y(删除)、N(不删除)"
+				},
+				phofile:[],
+				baseUrl:config.baseUrl,
 			}
 		},
 		onLoad: function() {
@@ -114,6 +110,80 @@
 				})
 				
 			},
+			getSubmit(){
+				var that=this;
+				var params=JSON.parse(JSON.stringify(this.datainfo))
+				var phofile=JSON.parse(JSON.stringify(this.phofile))
+				if(phofile&&phofile.length){
+					params.images=this.phofile.join(',');
+				}
+				if(!params.title){
+					this.$toast("请输入标题")
+					return
+				}
+				suggestionAdd(params).then(res=>{
+					if(res.code==200){
+						this.$toast("新增成功")
+						setTimeout(function(){
+							uni.$emit("refSuggestion")
+							uni.navigateBack({
+								delta:1
+							})
+						},1500)
+					}
+				})
+			},
+			getPreview(idx,arr) {
+				var newArr=[];
+				arr.forEach(ite=>{
+					var ds=this.baseUrl+ite
+					newArr.push(ds)
+				})
+				uni.previewImage({
+					urls: newArr,
+					current:idx,
+					success: function(data) {},
+					fail: function(err) {}
+				});
+			},
+			getDelFn(idx){
+				var that=this;
+				uni.showModal({
+					title: '确认删除',
+					content: "是否确认删除",
+					cancelText: '取消',
+					confirmText: '确认',
+					success: function(res) {
+						if (res.confirm) {
+							that.phofile.splice(idx,1)
+						} else if (res.cancel) {
+						}
+					}
+				});
+			},
+			getaddImage(e){
+				let that = this;
+				let file =[],count=9
+				uni.chooseImage({
+					// count: 1,
+					success:function(res){
+						let img= res.tempFilePaths;
+						if(img.length + file.length > count){
+							uni.showToast({
+								title: '最多上传'+count+'张图片',
+								icon: 'none',
+								duration: 2000
+							})
+						}else{
+							let imglen = res.tempFilePaths.length;
+							var fuwufile = [];
+							uploadmore('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
+								that.phofile = that.phofile.concat(rs);
+							})	
+						}
+					}
+				});
+			},
 		}
 	}
 </script>

+ 138 - 10
user_ui/news/pages/complaint/detail.vue

@@ -1,25 +1,37 @@
 <template>
 	<view class="comdetail">
 		<view class="cdbox mb12">
-			<image :src="replay" class="replay"></image>
+			<image :src="replay" class="replay" v-if="datainfo.status==2"></image>
 			<view class="cdtop">
-				<view class="tit">小区电梯老化</view>
-				<view class="txt">2024-11-18 08:16</view>
+				<view class="tit">{{datainfo.title}}</view>
+				<view class="txt">{{datainfo.createTime}}</view>
 			</view>
 			<view class="cdmain">
-				<view class="tit">小区电梯时常发生问题,请物业派维修人员进行安全检 查,若无法排除问题,建议更换小区的电梯设备,避免 后期发生人员伤害!</view>
+				<view class="tit">{{datainfo.content}}</view>
 				<view class="imgs">
-					<image :src="replay"></image>
+					<image :src="baseUrl+ite" v-for="(ite,idx) in phofile" :key="idx" @click="getPreviewImage(phofile,idx)"></image>
 				</view>
 			</view>
 		</view>
-		<!-- 步骤条 -->
-		<view class="hfbox mb12">
+		<view class="cdbox mb12 hfbox" v-if="datainfo.status==2">
 			<view class="hftop">
 				<image :src="hline"></image>
 				<view>回复</view>
 			</view>
-			<!--  -->
+			<view class="cdmain">
+				<view class="tit">{{datainfo.replyContent}}</view>
+				<block v-if="datainfo.suggestionFjList">
+					<view class="fjlists"  v-for="(fite,fidx) in datainfo.suggestionFjList" :key='fidx'>
+						<view class="flext" @click="getDown(fite.url)">
+							<view class="imgl"><image :src="filico" ></image></view>
+							<view class="tit">{{fite.name}}</view>
+						</view>
+					</view>
+				</block>	
+			</view>
+		</view>
+		<!-- 步骤条 -->
+		<!-- <view class="hfbox mb12" >
 			<view class="hfstep">
 				<view class="hfslist flex">
 					<view class="limg flexccc">
@@ -49,7 +61,7 @@
 					</view>
 				</view>
 			</view>
-		</view>
+		</view> -->
 		<!-- <view class="cdbtns">
 			<view class="btna">不予公开</view>
 			<view class="btnb" @click="getReplyFn">回复</view>
@@ -64,6 +76,7 @@
 	const baseUrl = config.baseUrl
 	import popUp from "@/work/components/popup/popup.vue"
 	import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
+	import {suggestionlDet} from "@/api/work/news.js"
 	export default{
 		components:{popUp},
 		data(){
@@ -72,11 +85,19 @@
 				hline:require('@/news/static/complaint/hline.png'),
 				cira:require('@/news/static/complaint/cira.png'),
 				cirb:require('@/news/static/complaint/cirb.png'),
+				filico:require('@/news/static/complaint/filico.png'),
 				baseUrl:config.baseUrl,
 				type:'',
+				datainfo:{},
+				id:'',
+				phofile:[],//图片合集
 			}
 		},
-		onLoad: function() {
+		onLoad: function(e) {
+			if(e.id){
+				this.id=e.id;
+				this.getDetail()
+			}
 		},
 		methods:{
 			checkPermi, checkRole,
@@ -106,6 +127,102 @@
 					}
 				});
 			},
+			getDetail(){
+				var that=this;
+				suggestionlDet(this.id).then(res=>{
+					if(res.code==200){
+						this.datainfo=res.data;
+						if(res.data&&res.data.images){
+							that.phofile=res.data.images.split(',')
+						}
+					}
+				})
+			},
+			getDown(path,name){
+				console.log(path,name)
+				// #ifdef APP-PLUS
+				self.getFilePermissions(function(res){
+					if(res==1){
+						uni.showLoading({
+							title: '加载中'
+						});
+						var url = baseUrl + path;
+						let dtask = plus.downloader.createDownload(url, {
+							filename: 'file://storage/emulated/0/'+baseName+'/' + name
+						}, (d, status) => {
+							//d为下载的文件对象
+							if (status == 200) {
+								uni.hideLoading();
+								uni.showToast({
+									icon: 'none',
+									mask: true,
+									title: '已保存到文件夹:/'+baseName+'/'+ name, //保存路径
+									duration: 3000,
+								});
+								
+								//下载成功,d.filename是文件在保存在本地的相对路径,使用下面的API可转为平台绝对路径
+								let fileSaveUrl = plus.io.convertLocalFileSystemURL(d.filename);
+								setTimeout(() => {
+									plus.runtime.openFile(d.filename); //选择软件打开文件
+								}, 1500)
+							} else {
+								//下载失败
+								uni.hideLoading();
+								plus.downloader.clear(); //清除下载任务
+								uni.showToast({
+									icon: 'none',
+									mask: true,
+									title: '下载失败,请稍后重试',
+								});
+							}
+						})
+						dtask.start();
+					}else{
+						uni.hideLoading();
+						uni.showToast({
+							title: '无法获取权限,文件下载将出错!',
+							icon: 'none',
+						})
+					}			
+				})
+				// #endif
+				// #ifndef APP-PLUS
+				this.getDownloader(path)
+				// #endif
+			},
+			getDownloader(e){
+				uni.showLoading({
+					title: '加载中'
+				});
+				var url=baseUrl+e;
+				let index1 = e.lastIndexOf("."); // 得到一个索引值
+				let index2 = e.length;
+				let type = e.substring(index1, index2);
+				if ((type.indexOf('jpg') > -1 || type.indexOf('jpeg') > -1 || type.indexOf('png') > -1)) {
+					uni.previewImage({
+						current: 0,
+						urls: [url],
+						// background: '#ffffff'
+					});
+					uni.hideLoading();
+				} else {
+				uni.downloadFile({
+					url: url,//文件的下载路径
+					success(result) {
+							uni.hideLoading()
+						var filePath = result.tempFilePath;
+						   uni.openDocument({
+						     filePath: filePath,
+						     showMenu: true,
+						     success: function (res) {
+						       // console.log('打开文档成功');
+						     }
+						   });
+					},
+					fail(res) {uni.hideLoading()}
+				})
+				}
+			},
 		}
 	}
 </script>
@@ -153,4 +270,15 @@
 		.hfstxt{font-weight: 500;font-size: 26rpx;color: #666666;line-height: 36rpx;}
 	}
 }
+.fjlists {display: flex;align-items: flex-start;justify-content: space-between;margin-bottom: 20rpx;
+		&:last-child{margin-bottom: 0;}
+		.imgl{width: 40rpx;height: 40rpx;display: flex;align-items: center;flex: 0 0 auto;
+			image{width: 26rpx;height: 24rpx;}
+		}
+		.tit{font-size: 26rpx;color: #222327;font-weight: 500;margin-top: 4rpx;word-break: break-all;}
+		.delimg{width: 40rpx;height:40rpx;margin-left: 16rpx;display: flex;align-items: center;justify-content: center;flex: 0 0 auto;
+			image{width: 24rpx;height: 24rpx;}
+		}
+		.txta{color: #28C529;font-weight: 500;line-height: 40rpx;flex: 0 0 auto;margin-left: 18rpx;padding: 0 6rpx;}
+	}
 </style>

+ 55 - 15
user_ui/news/pages/complaint/index.vue

@@ -2,12 +2,12 @@
 	<view class="car">
 		<view class="cartop">
 			<view class="tabtop flexc">
-				<view class="tabt" :class="ttopval==ite.val?'act':''" v-for="(ite,idx) in ttoplist" :key="idx" @click="getTabtop(ite.val)">{{ite.tit}}</view>
+				<view class="tabt" :class="tabval==ite.val?'act':''" v-for="(ite,idx) in tablist" :key="idx" @click="getTabFn(ite.val)">{{ite.tit}}</view>
 			</view>
 		</view>
 		<!-- 列表 -->
 		<view class="carlists">
-			<box-list :datainfo="list" :topval="ttopval" :wtdt="wtdt" type='complaint' @getDetail="getDetail"></box-list>
+			<box-list :datainfo="list" :tsjyList="tsjyList" :wtdt="wtdt" type='complaint' @getDetail="getDetail" @getDelFn="getDelFn"></box-list>
 		</view>
 		<view class="rfbtn" @click="getAddFn">新增投诉建议</view>
 		<loading></loading>
@@ -19,23 +19,33 @@
 	const baseUrl = config.baseUrl
 	import boxList from "@/news/components/box/list.vue"
 	import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
+	import {getDictionaryFn} from "@/api/system/user.js"
+	import {suggestionlList,suggestionlDel} from "@/api/work/news.js"
 	export default{
 		components:{boxList},
 		data(){
 			return{
 				cxrq:"",
 				text:'',
-				list:[{tit:'皖A IC520',type:1,right:0},{tit:'晋E KD783',type:2,right:0},],
+				list:[],
 				pageSize: 10,
 				pageNum: 1,
 				reachflag: true,
 				wtdt:'',
-				ttopval:'0',
-				ttoplist:[{tit:'全部',val:0},{tit:'待回复',val:1},{tit:'已回复',val:2}]
+				tabval:'-1',
+				tablist:[{tit:'全部',val:-1}],
+				tsjyList:[]
 			}
 		},
+		onUnload() {
+			uni.$off('refSuggestion')
+		},
 		onLoad: function() {
-		
+			uni.$on('refSuggestion',(res)=>{
+				this.getrefreshData()
+			})
+			this.init()
+			this.getDataFn()
 		},
 		// 上拉触底加载更多触发事件
 		onReachBottom() {
@@ -46,15 +56,30 @@
 		},
 		methods:{
 			checkPermi, checkRole,
-			getDetail(){
-				this.$tab.navigateTo("/news/pages/complaint/detail")
+			init(){
+				// 投诉建议类型
+				getDictionaryFn('complaint_types').then(res=>{
+					if(res.code==200){
+						this.tsjyList = res.data.map(v => {
+							var obj={
+								tit: v.dictLabel,
+								val: v.dictValue
+							}
+							this.tablist.push(obj)
+							return {
+								dictLabel: v.dictLabel,
+								dictValue: v.dictValue
+							}
+						})
+					}
+				})
+			},
+			getDetail(id){
+				this.$tab.navigateTo("/news/pages/complaint/detail?id="+id)
 			},
 			getAddFn(){
 				this.$tab.navigateTo("/news/pages/complaint/add")
 			},
-			getTabtop(val){
-				this.ttopval=val
-			},
 			getConfirm(){
 				this.getrefreshData()
 			},
@@ -70,19 +95,35 @@
 				this.getDataFn()
 			},
 			getTabFn(val){
-				this.tabval=val
+				this.tabval=val;
+				this.getrefreshData();
 			},
 			bindDateChangea(e){
 				var val=e.detail.value;
 				this.cxrq=val;
 			},
+			getDelFn(data){
+				console.log(11)
+				var that=this;
+				suggestionlDel(data).then(res=>{
+					if(res.code==200){
+						this.$toast("删除成功");
+						setTimeout(function(){
+							that.getrefreshData()
+						},1500)
+					}
+				})
+			},
 			getDataFn(){
 				var params={
 					pageSize:this.pageSize,
 					pageNum: this.pageNum,
+					isPublic:'Y'
+				}
+				if(this.tabval!=-1){
+					params.status=this.tabval;
 				}
-				params.noticeType=this.tabidx
-				getNoticeList(params).then(res=>{
+				suggestionlList(params).then(res=>{
 					if(res.code==200){
 						if (res.rows.length < this.pageSize) {
 							this.reachflag = false
@@ -101,7 +142,6 @@
 						newArr.forEach(ite=>{
 							ite.right=0;
 						})
-						// console.log(newArr,555)
 						if (this.pageNum == 1) {
 							this.list = newArr;
 						} else {

+ 6 - 9
user_ui/news/pages/news/newsdj.vue

@@ -5,12 +5,12 @@
 				<image :src="djtop"></image>本社区党员共<text>367</text>人
 			</view> -->
 			<view class="tabtop flexc">
-				<view class="tabt" :class="ttopval==ite.val?'act':''" v-for="(ite,idx) in ttoplist" :key="idx" @click="getTabtop(ite.val)">{{ite.tit}}</view>
+				<view class="tabt" :class="tabval==ite.val?'act':''" v-for="(ite,idx) in tablist" :key="idx" @click="getTabFn(ite.val)">{{ite.tit}}</view>
 			</view>
 		</view>
 		<!-- 列表 -->
 		<view class="carlists">
-			<box-list :datainfo="list" :topval="ttopval" :wtdt="wtdt" type='newsdj' @getDetail="getDetail"></box-list>
+			<box-list :datainfo="list"  :wtdt="wtdt" type='newsdj' @getDetail="getDetail"></box-list>
 		</view>
 		<loading></loading>
 	</view>
@@ -32,8 +32,8 @@
 				pageNum: 1,
 				reachflag: true,
 				wtdt:'',
-				ttopval:'0',
-				ttoplist:[{tit:'党建活动',val:0},{tit:'党建学习',val:1},{tit:'党建知识',val:2}]
+				tabval:'0',
+				tablist:[{tit:'党建活动',val:0},{tit:'党建学习',val:1},{tit:'党建知识',val:2}]
 			}
 		},
 		onLoad: function() {
@@ -51,8 +51,8 @@
 			getAddFn(){
 				this.$tab.navigateTo("/manage/pages/community/newsadddj")
 			},
-			getTabtop(val){
-				this.ttopval=val
+			getTabFn(val){
+				this.tabval=val
 			},
 			getrefreshData(){
 				this.pageNum=1;
@@ -60,9 +60,6 @@
 				this.reachflag=true;
 				this.getDataFn()
 			},
-			getTabFn(val){
-				this.tabval=val
-			},
 			bindDateChangea(e){
 				var val=e.detail.value;
 				this.cxrq=val;

+ 4 - 7
user_ui/news/pages/news/newssq.vue

@@ -2,7 +2,7 @@
 	<view class="car">
 		<view class="cartop">
 			<view class="tabtop flexc">
-				<view class="tabt" :class="ttopval==ite.val?'act':''" v-for="(ite,idx) in ttoplist" :key="idx" @click="getTabtop(ite.val)">{{ite.tit}}</view>
+				<view class="tabt" :class="tabval==ite.val?'act':''" v-for="(ite,idx) in tablist" :key="idx" @click="getTabFn(ite.val)">{{ite.tit}}</view>
 				<view class="numbox">
 					未读互动<text>27</text>
 				</view>
@@ -10,7 +10,7 @@
 		</view>
 		<!-- 列表 -->
 		<view class="carlists">
-			<box-list :datainfo="list" :topval="ttopval" :wtdt="wtdt" type='newssq' @getDetail="getDetail"></box-list>
+			<box-list :datainfo="list"  :wtdt="wtdt" type='newssq' @getDetail="getDetail"></box-list>
 		</view>
 		<loading></loading>
 	</view>
@@ -32,8 +32,8 @@
 				pageNum: 1,
 				reachflag: true,
 				wtdt:'',
-				ttopval:'0',
-				ttoplist:[{tit:'公告',val:0},{tit:'通知',val:1},{tit:'资讯',val:2}]
+				tabval:'0',
+				tablist:[{tit:'公告',val:0},{tit:'通知',val:1},{tit:'资讯',val:2}]
 			}
 		},
 		onLoad: function() {
@@ -51,9 +51,6 @@
 			getDetail(){
 				this.$tab.navigateTo("/news/pages/news/detail")
 			},
-			getTabtop(val){
-				this.ttopval=val
-			},
 			getrefreshData(){
 				this.pageNum=1;
 				this.list=[];

BIN
user_ui/news/static/complaint/filico.png


+ 1 - 0
user_ui/static/style.css

@@ -11,6 +11,7 @@
 .flexdc{display: flex;flex-direction: column;}
 .flexat{display: flex;align-items: flex-start;}
 .flexe{display: flex;justify-content: flex-end;}
+.flext{display: flex;align-items: flex-start;}
 image{display: block !important;}
 .bgbox{background-color: rgba(0, 0, 0, 0.5);position: fixed;left: 0;right: 0;top: 0;bottom: 0;z-index: 5;}
 .clearf::after {

+ 135 - 1
user_ui/utils/common.js

@@ -1,3 +1,9 @@
+import config from '@/config'
+import { getToken } from '@/utils/auth'
+import errorCode from '@/utils/errorCode'
+let timeout = 10000
+const baseUrl = config.baseUrl
+
 /**
 * 显示消息提示框
 * @param content 提示的标题
@@ -26,7 +32,65 @@ export function showConfirm(content) {
     })
   })
 }
-
+// 字典值匹配
+export function selectDictValue(datas, value) {
+	var actions = [];
+	Object.keys(datas).some((key) => {
+		if (datas[key].dictValue == ('' + value)) {
+			actions.push(datas[key].dictLabel);
+			return true;
+		}
+	})
+	return actions.join('');
+}
+// export function selectDictLabel(datas, value) {
+// 	var actions = [];
+// 	Object.keys(datas).some((key) => {
+// 		if (datas[key].dictLabel == ('' + value)) {
+// 			actions.push(datas[key].dictValue);
+// 			return true;
+// 		}
+// 	})
+// 	return actions.join('');
+// }
+export function selectValueKey(datas, value) {
+	var actions = [];
+	var idx=0;
+	Object.keys(datas).some((key) => {
+		if (datas[key].dictValue == ('' + value)) {
+			idx=key;
+			actions.push(datas[key].dictLabel);
+			return true;
+		}
+	})
+	var newObj={
+		actions:actions.join(''),
+		key:idx
+	}
+	return newObj
+}
+// export function selectValue(datas, value) {
+// 	var actions = [];
+// 	var idx=0;
+// 	Object.keys(datas).some((key) => {
+// 		if (datas[key].value == ('' + value)) {
+// 			actions.push(datas[key].label);
+// 			return true;
+// 		}
+// 	})
+// 	return actions.join('')
+// }
+// export function selectValuetext(datas, value) {
+// 	var actions = [];
+// 	var idx=0;
+// 	Object.keys(datas).some((key) => {
+// 		if (datas[key].value == ('' + value)) {
+// 			actions.push(datas[key].text);
+// 			return true;
+// 		}
+// 	})
+// 	return actions.join('')
+// }
 /**
 * 参数处理
 * @param params 参数
@@ -122,4 +186,74 @@ export function uploadIdentify(api, filePaths, successUp, failUp, i, length, fil
 		}
 	});
 
+}
+//上传图片
+export function uploadmore(api, filePaths, successUp, failUp, i, length, files, callback) {
+	const isToken = (config.headers || {}).isToken === false
+	config.header = config.header || {}
+	if (getToken() && !isToken) {
+	  config.header['Authorization'] = 'Bearer ' + getToken()
+	}
+	// get请求映射params参数
+	if (config.params) {
+	  let url = config.url + '?' + tansParams(config.params)
+	  url = url.slice(0, -1)
+	  config.url = url
+	}
+	
+	uni.showLoading({
+		title: '上传中'
+	})
+	var failfile = [];
+	uni.uploadFile({
+		timeout: config.timeout || timeout,
+		url: baseUrl + api, //仅为示例,非真实的接口地址
+		filePath: filePaths[i],
+		name: 'file',
+		header: config.header,
+		formData: config.formData,
+		success: function(resp) {
+			uni.hideLoading();
+			let result = JSON.parse(resp.data)
+			const code = result.code || 200
+			const msg = errorCode[code] || result.msg || errorCode['default']
+			// console.log(result.fileName,8)
+			if (result.code == 200) {
+				successUp++;
+				files[i] = result.fileName;
+			} else if(result.code==401) {
+				showConfirm("登录状态已过期,您可以继续留在该页面,或者重新登录?").then(res => {
+				  if (res.confirm) {
+				    store.dispatch('LogOut').then(res => {
+				      uni.reLaunch({ url: '/pages/login/login' })
+				    })
+				  }
+				})
+				callback('无效的会话,或者会话已过期,请重新登录。');
+			}else{
+				failfile = failfile.concat(filePaths[i])
+				failUp++;
+			}
+		},
+		fail: function(res) {
+			uni.hideLoading();
+			failfile = failfile.concat(filePaths[i])
+			failUp++;
+		},
+		complete: function(rsp) {
+			uni.hideLoading();
+			i++;
+			if (i == length) {
+				uni.showToast({
+					title: '上传成功',
+					icon: 'none',
+					duration: 2000
+				});
+				callback(files);
+			} else { //递归调用upload函数
+				uploadmore(api, filePaths, successUp, failUp, i, length, files, callback);
+			}
+		}
+	});
+
 }

+ 1 - 6
user_ui/work/components/box/list.vue

@@ -76,12 +76,7 @@
 					return 0
 				}
 			},
-			topval:{
-				type:String,
-				default () {
-					return ''
-				}
-			}
+			
 		},
 		data(){
 			return{

+ 4 - 7
user_ui/work/pages/service/warranty.vue

@@ -16,12 +16,12 @@
 				</view>
 			</view> -->
 			<view class="tabtop flexc">
-				<view class="tabt" :class="ttopval==ite.val?'act':''" v-for="(ite,idx) in ttoplist" :key="idx" @click="getTabtop(ite.val)">{{ite.tit}}</view>
+				<view class="tabt" :class="tabval==ite.val?'act':''" v-for="(ite,idx) in tablist" :key="idx" @click="getTabFn(ite.val)">{{ite.tit}}</view>
 			</view>
 		</view>
 		<!-- 列表 -->
 		<view class="carlists">
-			<box-list :datainfo="list" :topval="ttopval" :wtdt="wtdt" type='warranty' @getDetail="getDetail"></box-list>
+			<box-list :datainfo="list" :wtdt="wtdt" type='warranty' @getDetail="getDetail"></box-list>
 		</view>
 		<view class="rfbtn" @click="getAddFn">我要报修</view>
 		<loading></loading>
@@ -47,8 +47,8 @@
 				pageNum: 1,
 				reachflag: true,
 				wtdt:'',
-				ttopval:'0',
-				ttoplist:[{tit:'全部报修',val:0},{tit:'待指派',val:1},{tit:'处理中',val:2},{tit:'已完成',val:2}]
+				tabval:'0',
+				tablist:[{tit:'全部报修',val:0},{tit:'待指派',val:1},{tit:'处理中',val:2},{tit:'已完成',val:2}]
 			}
 		},
 		onLoad: function() {
@@ -69,9 +69,6 @@
 			getAddFn(){
 				this.$tab.navigateTo("/work/pages/service/warrantyadd")
 			},
-			getTabtop(val){
-				this.ttopval=val
-			},
 			getConfirm(){
 				this.getrefreshData()
 			},

+ 1 - 4
user_ui/work/pages/visitor/vlist.vue

@@ -2,7 +2,7 @@
 	<view class="car">
 		<!-- 列表 -->
 		<view class="carlists">
-			<box-list :datainfo="list" :topval="ttopval" :wtdt="wtdt" type='visitor' @getDetail="getDetail"></box-list>
+			<box-list :datainfo="list"  :wtdt="wtdt" type='visitor' @getDetail="getDetail"></box-list>
 		</view>
 		<loading></loading>
 	</view>
@@ -44,9 +44,6 @@
 			getDetail(){
 				this.$tab.navigateTo("/work/pages/visitor/vdetail")
 			},
-			getTabtop(val){
-				this.ttopval=val
-			},
 			getConfirm(){
 				this.getrefreshData()
 			},