123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <template>
- <div class="repairAcceptance">
- <div class="whiteBoard">
- <div class="addRepair" @tap="addRepair">新增报修 <van-icon name="add" style="margin-left: 8rpx"/></div>
- <div class="repairItem" v-for="item in recordList" @click="toDetail(item)">
- <div class="repairItemTitleRow">
- <span class="titleName">{{item.description}}</span>
- <span class="rowTags" :class="getStatus(item)==='已评价'?'yclTags':getStatus(item)==='暂存'?'zcTags':getStatus(item)==='待评价'?'dpjTags':''">{{getStatus(item)}}</span>
- </div>
- <div class="companyBox">
- <img src="https://www.idea-co-sf.com/gardenProduct/image/gs.svg" class="gsIcon">
- <span class="companyName">{{item.companyName}}</span>
- </div>
- <div class="upTimeBox">上报时间:{{ item.createdAt }}</div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { repairHandleList,getUserLocalStorageInfo,getByCodes } from "@/js_sdk/http";
- export default {
- name: "repairAcceptance",
- data(){
- return{
- dc_key: ['REPAIR_STATUS'],
- getUserLocalStorageInfo: getUserLocalStorageInfo(),
- recordList:[
- // {name:'上月水费不太对,怀疑水表异常',type:'待受理'},
- // {name:'空调坏了,不能使用',type:'待处理'},
- // {name:'空调坏了,不能使用',type:'已处理'},
- ],
- params: {
- pageNum: 1,
- pageSize: 10,
- // dispatchUserId: getUserLocalStorageInfo().userId,
- handleUserId: getUserLocalStorageInfo().userId,
- },
- checkList:[]
- }
- },
- onShow(){
- this.getByCodes()
- },
- mounted(){
- },
- methods:{
- getStatus(item){
- if (item.userType === '1') {
- if (item.statusName === '已处理') {
- return item.evaluateStatus === 1 ? '待评价' : '已评价';
- }
- }
- // 如果不满足上述条件,则直接返回 item.statusName
- return item.statusName;
- },
- onPullDownRefresh() {
- this.getByCodes()
- setTimeout(function () {
- uni.stopPullDownRefresh();
- }, 1000);
- },
- async getByCodes() {
- let data = await getByCodes(JSON.stringify(this.dc_key));
- this.dic_SelectList = this.$common.handleDicList(data);
- this.checkList = this.dic_SelectList.REPAIR_STATUS
- this.getList()
- },
- getList(){
- this.recordList = []
- const _this = this
- repairHandleList(this.params).then((res) => {
- if (res.code=='409'){
- uni.clearStorageSync();
- uni.reLaunch({
- url: "/pages/login/login",
- });
- }
- if (res.data) {
- res.data.forEach(function(item) {
- const jsonMap = _this.getItemJson(item)
- _this.recordList.push(jsonMap)
- })
- }
- })
- },
- addRepair(){
- uni.navigateTo({
- url:'/pages/subPackages/todo/addRepair'
- })
- },
- toDetail(item) {
- uni.navigateTo({
- url:'/pages/subPackages/todo/dispatch?item=' + JSON.stringify(item)
- })
- },
- getItemJson: function(item) {
- item.createdAt = this.$common.transServDate(item.createdAt)
- let transformedObject = this.checkList.reduce((acc, obj) => {
- acc[obj.value] = obj.label;
- return acc;
- }, {});
- item.statusName = transformedObject[item.status]
- return item
- },
- }
- }
- </script>
- <style lang="scss">
- .repairAcceptance{
- .whiteBoard{
- background: white;
- margin-top: 24rpx;
- box-sizing: border-box;
- padding: 32rpx;
- min-height: 1424rpx;
- .addRepair{
- display: flex;
- justify-content: flex-end;
- align-items: center;
- color: rgba(3, 101, 249, 1);
- }
- .repairItem{
- background: rgba(245, 247, 250, 1);
- border-radius: 16rpx;
- width: 686rpx;
- height: 224rpx;
- padding: 32rpx 0 24rpx 0;
- box-sizing: border-box;
- margin-top: 24rpx;
- .repairItemTitleRow{
- display: flex;
- justify-content: space-between;
- padding: 0 32rpx;
- .titleName{
- color: rgba(34, 34, 34, 1);
- font-size: 32rpx;
- font-weight: 600;
- }
- .rowTags{
- display: flex;
- align-items: center;
- justify-content: center;
- color: #0365F9;
- font-size: 28rpx;
- width: 112rpx;
- height: 48rpx;
- background: rgba(3, 101, 249, 0.20);
- border-radius: 4rpx;
- }
- .yclTags{
- color: rgba(34, 181, 101, 1);
- background: rgba(34, 181, 101, 0.20);
- }
- .zcTags{
- color: rgba(255, 107, 24, 1);
- background: rgba(254, 134, 67, 0.20);
- }
- .dpjTags{
- color: rgb(151, 24, 255);
- background: rgba(151, 24, 255, 0.20);
- }
- }
- .companyBox{
- display: flex;
- align-items: center;
- padding: 8rpx 32rpx 24rpx 32rpx;
- .gsIcon{
- width: 32rpx;
- height: 32rpx;
- }
- .companyName{
- font-size: 28rpx;
- color: rgba(102, 102, 102, 1);
- margin-left: 8rpx;
- }
- }
- .upTimeBox{
- padding: 16rpx 32rpx 0 32rpx;
- border-top: 1px solid rgba(230, 230, 230, 1);
- color: rgba(102, 102, 102, 1);
- font-size: 28rpx;
- }
- }
- }
- }
- </style>
|