From e0912ef49e4e5d55028dc8e6373911718a65c7c6 Mon Sep 17 00:00:00 2001 From: 346149741 <346149741@qq.com> Date: 星期六, 22 六月 2024 19:01:09 +0800 Subject: [PATCH] 投诉 --- qiye/record/evaluate.vue | 164 +++++++++++++------- api/qiye.js | 14 + qiye/record/details.vue | 274 ++++++++++++++++++++++----------- 3 files changed, 295 insertions(+), 157 deletions(-) diff --git a/api/qiye.js b/api/qiye.js index f77b380..4286143 100644 --- a/api/qiye.js +++ b/api/qiye.js @@ -10,7 +10,15 @@ export function companyList(data){ return http.get('/enforce/order/companyList', {params: data}, { custom: { loading: true }}); } -// 鎵ф硶璁板綍璇︽儏 -export function order(id){ - return http.get('/enforce/order/'+id, { custom: { loading: true }}); +// 鑾峰彇鎵ф硶璇勪环閰嶇疆璇︽儏 +export function evaluate(){ + return http.get('/enforce/evaluate/detail', { custom: { loading: true }}); +} +// 淇濆瓨鎵ф硶璇勪环 +export function saveOrder(param) { + return http.post('/enforce/evaluate/saveOrder', param, { custom: { loading: true }}); +} +// 鍙戣捣鎶曡瘔 +export function orderComplaint(param) { + return http.post('/enforce/order/orderComplaint', param, { custom: { loading: true }}); } \ No newline at end of file diff --git a/qiye/record/details.vue b/qiye/record/details.vue index b283999..d1a0d4d 100644 --- a/qiye/record/details.vue +++ b/qiye/record/details.vue @@ -7,8 +7,10 @@ </u-navbar> <view class="donw-box"></view> <view class="page-main"> - <view class="title"> - 宸茶瘎浠� + <view class="title"> + <template v-if="msg.isEva==0">宸叉墽娉曞緟璇勪环</template> + <template v-if="msg.isEva==1">宸茶瘎浠�</template> + <template v-if="msg.orderStatus==2">寰呮墽娉�</template> </view> <view class="wbox"> <view class="item"> @@ -16,7 +18,7 @@ 鎵ф硶绫诲瀷 </view> <view class="v"> - 鍙告硶妫�鏌� + {{type}} </view> </view> <view class="item"> @@ -24,7 +26,7 @@ 鎵ф硶浜� </view> <view class="v"> - 鍒樻娆� + {{msg.executeUser}} </view> </view> <view class="item"> @@ -32,7 +34,7 @@ 鎵ф硶閮ㄩ棬 </view> <view class="v"> - 鍐滀笟灞� + {{msg.executeDeptName}} </view> </view> <view class="item"> @@ -40,7 +42,7 @@ 浼佷笟 </view> <view class="v"> - 姹夊涵閰掑簵 + {{msg.companyName}} </view> </view> </view> @@ -51,7 +53,7 @@ 鎵ф硶涓婚 </view> <view class="v"> - 姹夊涵閰掑簵鍙告硶妫�鏌�233鍙锋枃浠� + {{msg.enforceReason}} </view> </view> <view class="item"> @@ -59,18 +61,20 @@ 鎵ф硶杩囩▼ </view> </view> - <view class="imgbox"> - <img src="/static/i01.png" class="more" @click="imgclick('/static/i01.png')" alt="" /> + <view class="imgbox"> + <img v-for="(item,index) in img" :key="index" :src="item" class="more" alt="" @click="imgclick(item)" /> + + <!-- <img src="/static/i01.png" class="more" @click="imgclick('/static/i01.png')" alt="" /> <img src="/static/i02.png" class="more" alt="" /> <img src="/static/i03.png" class="more" alt="" /> - <img src="/static/i04.png" class="more" alt="" /> + <img src="/static/i04.png" class="more" alt="" /> --> </view> <view class="item"> <view class="k"> 鎵ф硶缁撴灉 </view> <view class="v" style="color: #EB4746;"> - 鍋滀笟鏁撮】 + {{msg.regionReason}} </view> </view> <view class="item"> @@ -78,88 +82,98 @@ 鎵ф硶鏃堕棿 </view> <view class="v"> - 2024-10-10 16:24 + {{msg.executeTime}} </view> </view> </view> <view style="height: 20rpx;"></view> - <view class="wbox2"> + <view class="wbox2" v-if="msg.isEva==1"> <view class="t"> 鎵ф硶璇勪环 - </view> - <view class="sbox"> - <view class="t2"> - 鏈鎵ф硶杩樻弧鎰忕▼搴� - </view> - <view class="xbox"> - <view @click="daxing(1)"> - <img src="/static/qiye/xing1.png" alt="" /> - <view> - 寰堢碂绯� - </view> - </view> - <view @click="daxing(2)"> - <img v-if="xing>=2" src="/static/qiye/xing1.png" alt="" /> - <img v-else src="/static/qiye/xing2.png" alt="" /> - <view :class="xing==2?'hei':''"> - 涓嶆弧鎰� - </view> - </view> - <view @click="daxing(3)"> - <img v-if="xing>=3" src="/static/qiye/xing1.png" alt="" /> - <img v-else src="/static/qiye/xing2.png" alt="" /> - <view :class="xing==3?'hei':''"> - 涓�鑸埇 - </view> - </view> - <view @click="daxing(4)"> - <img v-if="xing>=4" src="/static/qiye/xing1.png" alt="" /> - <img v-else src="/static/qiye/xing2.png" alt="" /> - <view :class="xing==4?'hei':''"> - 婊℃剰 - </view> - </view> - <view @click="daxing(5)"> - <img v-if="xing>=5" src="/static/qiye/xing1.png" alt="" /> - <img v-else src="/static/qiye/xing2.png" alt="" /> - <view :class="xing==5?'hei':''"> - 闈炲父婊℃剰 - </view> - </view> - </view> - <view class="line"></view> - </view> - <view class="sbox"> - <view class="t2"> - 杩欐槸涓�涓崟閫夐鐨勯骞诧紵 - </view> - <u-radio-group v-model="value"> - <u-radio name="orange">閫変腑</u-radio> - <u-radio name="1" :disabled="true">鏈�変腑</u-radio> - </u-radio-group> - <view class="line"></view> - </view> + </view> + <template v-for="(item,index) in qlist"> + <view class="sbox" v-if="item.questionType==2"> + <view class="t2"> + {{item.questionName}} + </view> + <view class="xbox"> + <view> + <img src="/static/qiye/xing1.png" alt="" /> + <view> + 寰堢碂绯� + </view> + </view> + <view> + <img v-if="item.getScore>=2" src="/static/qiye/xing1.png" alt="" /> + <img v-else src="/static/qiye/xing2.png" alt="" /> + <view :class="item.getScore==2?'hei':''"> + 涓嶆弧鎰� + </view> + </view> + <view> + <img v-if="item.getScore>=3" src="/static/qiye/xing1.png" alt="" /> + <img v-else src="/static/qiye/xing2.png" alt="" /> + <view :class="item.getScore==3?'hei':''"> + 涓�鑸埇 + </view> + </view> + <view> + <img v-if="item.getScore>=4" src="/static/qiye/xing1.png" alt="" /> + <img v-else src="/static/qiye/xing2.png" alt="" /> + <view :class="item.getScore==4?'hei':''"> + 婊℃剰 + </view> + </view> + <view> + <img v-if="item.getScore>=5" src="/static/qiye/xing1.png" alt="" /> + <img v-else src="/static/qiye/xing2.png" alt="" /> + <view :class="item.getScore==5?'hei':''"> + 闈炲父婊℃剰 + </view> + </view> + </view> + <view class="line"></view> + </view> + <view class="sbox" v-if="item.questionType==1"> + <view class="t2"> + {{item.questionName}} + </view> + <u-radio-group v-model="item.remark"> + <u-radio v-for="(aa, ii) in item.answerList" :key="ii" :name="aa.answerId" + :disabled="item.remark!=aa.answerId"> + {{aa.answerName}} + </u-radio> + </u-radio-group> + <!-- <u-radio-group v-model="value"> + <u-radio name="orange">閫変腑</u-radio> + <u-radio name="1" :disabled="true">鏈�変腑</u-radio> + </u-radio-group> --> + <view class="line"></view> + </view> + </template> + + <view class="sbox"> <view class="t2"> 瀵规垜浠殑璇勪环 </view> <view class="pjbox"> - 杩欐鎵ф硶闈炲父濂斤紝闈炲父濂斤紝杩欐鎵ф硶闈炲父濂斤紝闈炲父濂借繖娆℃墽娉曢潪甯稿ソ锛岄潪甯稿ソ + {{msg.evaluateVo.questionRemark}} </view> </view> </view> </view> <view class="bottom"> - <view class="one" v-if="type==1"> + <view class="one" v-if="msg.isEva==1"> <view class="b1" @click="open()"> 鎶曡瘔 </view> </view> - <view class="two" v-if="type==2"> + <view class="two" v-if="msg.isEva==0"> <view class="b2" @click="open()"> 鎶曡瘔 </view> - <view class="b3"> + <view class="b3" @click="pingjia()"> 鎴戣璇勪环 </view> </view> @@ -174,48 +188,86 @@ <view class="font"> 鎶曡瘔涓婚 </view> - <view> - <u-radio-group placement="row"> - <u-radio active-color="#3EB47A" label="aaa" name="3"></u-radio> - <u-radio active-color="#3EB47A" label="bbb" name="3"></u-radio> - </u-radio-group> + <view> + <u-radio-group v-model="complaintType"> + <u-radio v-for="(aa, ii) in list" :key="ii" :name="aa.dictCode"> + {{aa.dictLabel}} + </u-radio> + </u-radio-group> </view> <view class="font"> 鎶曡瘔鍐呭 </view> <view class="margin-top"> - <u-textarea placeholder="璇疯緭鍏�..."></u-textarea> + <u-textarea v-model="complaintReason" placeholder="璇疯緭鍏�..."></u-textarea> </view> </view> <view class="down"> - <view class="enter" @entery="entery">鎻愪氦</view> + <view class="enter" @click="entery()">鎻愪氦</view> </view> </view> </u-popup> </view> </template> -<script> +<script> + import { order } from '@/api/index.js' + import { getDicts } from '@/api/data.js' + import { config } from '@/common/config' + import { orderComplaint } from '@/api/qiye.js' export default { data() { - return { + return { + complaintType:'', + complaintReason:'', + id:'', + msg:{}, + type:'', + img:[], + baseUrl: config.baseUrl, xing: 5, value: 'orange', - type: 2, + //type: 2, show: false, - list: [{ - //todo 璇锋眰鎺ュ彛 - value: '1', - label: '姹�' - }, - { - value: '2', - label: '婀�' - } - ], + list: [ + ], + qlist:[] } + }, + onLoad(options) { + this.id = options.id + //this.getdata(options.id) + getDicts('complaint_type').then(val => { + this.list = val.data.data + console.log(this.list) + // const value = val.data.data.find(item => item.dictCode == this.msg.enforceType) + // this.type = value.dictLabel + }) + }, + onShow(options) { + this.getdata() }, - methods: { + methods: { + getdata(){ + order(this.id).then(val => { + this.msg = val.data.data + let arr = this.msg.regionImgs.split(","); + for(let i = 0;i<arr.length;i++){ + this.img.push(this.baseUrl+arr[i]) + } + this.qlist = this.msg.evaluateVo.questionList + for(let i = 0;i<this.qlist.length;i++){ + if(this.qlist[i].questionType==1&&this.qlist[i].remark){ + this.qlist[i].remark = Number(this.qlist[i].remark) + } + } + console.log(this.img) + getDicts('enforce_type').then(val => { + const value = val.data.data.find(item => item.dictCode == this.msg.enforceType) + this.type = value.dictLabel + }) + }) + }, daxing(a) { this.xing = a }, @@ -223,6 +275,11 @@ uni.previewImage({ urls: [url] }) + }, + pingjia(){ + uni.navigateTo({ + url: `/qiye/record/evaluate?id=${this.msg.orderId}` + }) }, open() { this.show = true @@ -232,7 +289,35 @@ this.$emit('cancel') }, entery() { - this.$emit('entery') + this.$emit('entery') + if(this.complaintType==''){ + uni.showToast({ + title: '璇烽�夋嫨鎶曡瘔涓婚', + icon: 'none' + }) + return + } + if(this.complaintReason==''){ + uni.showToast({ + title: '璇疯緭鍏ユ姇璇夊唴瀹�', + icon: 'none' + }) + return + } + let data = { + orderId:Number(this.id), + complaintType:this.complaintType, + complaintReason:this.complaintReason + } + console.log(data) + //return; + orderComplaint(data).then(val => { + uni.showToast({ + title: '鎻愪氦鎴愬姛', + icon: 'none' + }) + this.show = false + }) }, } @@ -364,9 +449,10 @@ /deep/ .u-radio-group { margin-top: 20rpx; - + flex-wrap: wrap; .u-radio { - margin-right: 20rpx; + margin-right: 20rpx; + margin-bottom: 20rpx; } } diff --git a/qiye/record/evaluate.vue b/qiye/record/evaluate.vue index e5b7151..5b648c4 100644 --- a/qiye/record/evaluate.vue +++ b/qiye/record/evaluate.vue @@ -3,88 +3,132 @@ <view class="wbox2"> <view class="t"> 鎵ф硶璇勪环 - </view> - <view class="sbox"> - <view class="t2"> - 鏈鎵ф硶杩樻弧鎰忕▼搴� - </view> - <view class="xbox"> - <view @click="daxing(1)"> - <img src="/static/qiye/xing1.png" alt="" /> - <view> - 寰堢碂绯� - </view> - </view> - <view @click="daxing(2)"> - <img v-if="xing>=2" src="/static/qiye/xing1.png" alt="" /> - <img v-else src="/static/qiye/xing2.png" alt="" /> - <view :class="xing==2?'hei':''"> - 涓嶆弧鎰� - </view> - </view> - <view @click="daxing(3)"> - <img v-if="xing>=3" src="/static/qiye/xing1.png" alt="" /> - <img v-else src="/static/qiye/xing2.png" alt="" /> - <view :class="xing==3?'hei':''"> - 涓�鑸埇 - </view> - </view> - <view @click="daxing(4)"> - <img v-if="xing>=4" src="/static/qiye/xing1.png" alt="" /> - <img v-else src="/static/qiye/xing2.png" alt="" /> - <view :class="xing==4?'hei':''"> - 婊℃剰 - </view> - </view> - <view @click="daxing(5)"> - <img v-if="xing>=5" src="/static/qiye/xing1.png" alt="" /> - <img v-else src="/static/qiye/xing2.png" alt="" /> - <view :class="xing==5?'hei':''"> - 闈炲父婊℃剰 - </view> - </view> - </view> - <view class="line"></view> - </view> - <view class="sbox"> - <view class="t2"> - 杩欐槸涓�涓崟閫夐鐨勯骞诧紵 - </view> - <u-radio-group v-model="value"> - <u-radio name="orange">閫変腑</u-radio> - <u-radio name="1" :disabled="true">鏈�変腑</u-radio> - </u-radio-group> - <view class="line"></view> - </view> + </view> + <template v-for="(item,index) in msg"> + <view class="sbox" v-if="item.questionType==2"> + <view class="t2"> + {{item.questionName}} + </view> + <view class="xbox"> + <view @click="daxing(index,1)"> + <img src="/static/qiye/xing1.png" alt="" /> + <view> + 寰堢碂绯� + </view> + </view> + <view @click="daxing(index,2)"> + <img v-if="item.getScore>=2" src="/static/qiye/xing1.png" alt="" /> + <img v-else src="/static/qiye/xing2.png" alt="" /> + <view :class="item.getScore==2?'hei':''"> + 涓嶆弧鎰� + </view> + </view> + <view @click="daxing(index,3)"> + <img v-if="item.getScore>=3" src="/static/qiye/xing1.png" alt="" /> + <img v-else src="/static/qiye/xing2.png" alt="" /> + <view :class="item.getScore==3?'hei':''"> + 涓�鑸埇 + </view> + </view> + <view @click="daxing(index,4)"> + <img v-if="item.getScore>=4" src="/static/qiye/xing1.png" alt="" /> + <img v-else src="/static/qiye/xing2.png" alt="" /> + <view :class="item.getScore==4?'hei':''"> + 婊℃剰 + </view> + </view> + <view @click="daxing(index,5)"> + <img v-if="item.getScore>=5" src="/static/qiye/xing1.png" alt="" /> + <img v-else src="/static/qiye/xing2.png" alt="" /> + <view :class="item.getScore==5?'hei':''"> + 闈炲父婊℃剰 + </view> + </view> + </view> + <view class="line"></view> + </view> + <view class="sbox" v-if="item.questionType==1"> + <view class="t2"> + {{item.questionName}} + </view> + <u-radio-group v-model="item.remark" @change="radioGroupChange"> + <u-radio v-for="(aa, ii) in item.answerList" :key="ii" :name="aa.answerId"> + {{aa.answerName}} + </u-radio> + </u-radio-group> + <view class="line"></view> + </view> + </template> + + <view class="sbox"> <view class="t2" style="margin-bottom: 30rpx;"> 瀵规垜浠殑璇勪环 </view> - <u-textarea placeholder="璇疯緭鍏�..."></u-textarea> + <u-textarea v-model="questionRemark" placeholder="璇疯緭鍏�..."></u-textarea> </view> </view> <view style="height: 200rpx;"></view> <view class="bottom"> - <view class="b1"> + <view class="b1" @click="submit()"> 鎻愪氦 </view> </view> </view> </template> -<script> +<script> + import { evaluate,saveOrder } from '@/api/qiye.js' + export default { data() { return { xing: 5, - value: 'orange', + value: 'orange', + msg:[], + questionRemark:'', + orderId:'' } + }, + onLoad(options) { + this.orderId = options.id + //this.getdata(options.id) + evaluate().then(val => { + this.msg = val.data.data.questionList + for(let i = 0;i<this.msg.length;i++){ + if(this.msg[i].questionType==2){ + this.msg[i].getScore = 5 + } + } + //console.log(this.msg) + }) }, methods: { - daxing(a) { - this.xing = a + daxing(i,a) { + this.msg[i].getScore = a + //this.xing = a }, - + radioGroupChange(e){ + //console.log(this.msg) + }, + submit(){ + let data = { + orderId:this.orderId, + questionList:this.msg, + questionRemark:this.questionRemark + } + console.log(data) + //return; + saveOrder(data).then(val => { + uni.showToast({ + title: '鎻愪氦鎴愬姛', + icon: 'none' + }) + setTimeout(() => { + uni.navigateBack() + }, 500) + }) + } } } </script> -- Gitblit v1.9.1