123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- <template>
- <div class="repair">
- <div class="top-add" @click="goNavigator()">
- <i class="iconfont icon-xinzeng"></i>
- <span class="txt">新增派单</span>
- </div>
- <div class="info-repairList">
- <div
- class="info-item"
- v-for="item in recordList"
- :key="item.id"
- @click="jumpPageDetails(item.id)"
- >
- <div class="info-top">
- <div class="left">
- <img :src="item.fileUrl.url" alt="" />
- </div>
- <div class="right">
- <p class="tit">
- {{ item.description }}
- </p>
- <p class="txt">{{ item.companyName }}</p>
- </div>
- </div>
- <div class="info-bottom">
- <div class="left">
- <i class="iconfont icon-shijian"></i>
- <span>
- {{ item.createdAt }}
- </span>
- </div>
- <div class="right">
- <span
- v-if="item.status == 'unAcceptance'"
- class="normal-tip yd h-bg"
- >待派单</span
- >
- <span
- v-if="item.status != 'unAcceptance'"
- class="normal-tip yd z-bg"
- >已派单</span
- >
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { repairList, getByCodes } from "@/js_sdk/http.js";
- // import Base from "@/pages/base/base";
- export default {
- data() {
- return {
- BASE_URI: this.$constant.BASE_URI,
- dic_key: ["REPAIR_STATUS"],
- dic_SelectList: {},
- recordList: [],
- params: {
- // pageNum: 1,
- // pageSize: 10,
- // groupId: "870261874875170816",
- // createdBy: '877225455206268928' // auth.currUser().id
- },
- totalPage: 1,
- allData: [],
- repairList: [
- {
- title: "关于组织2020年无锡市服务业提质增效资金项目申报的通知",
- name: "无锡 XXXX有限公司",
- date: "2020-09-18 19:34:06",
- type: "1",
- },
- {
- title:
- "关于组织2020年无锡市服务业提质增效资金项目申报的通知关于组织2020年无锡市服务业提质增效资金项目申报的通知",
- name: "无锡 XXXX有限公司",
- date: "2020-09-18 19:34:06",
- type: "2",
- },
- ],
- };
- },
- mounted() {
- // if (window.history && window.history.pushState) {
- // // 向历史记录中插入了当前页
- // history.pushState(null, null, document.URL);
- // window.addEventListener("popstate", this.goBack, false);
- // }
- },
- onLoad() {},
- onShow() {
- this.getByCodes();
- },
- methods: {
- goNavigator(id) {
- uni.navigateTo({
- url: "/pages/subPackages/repairDispatch-app/add",
- });
- },
- jumpPageDetails(id) {
- uni.navigateTo({
- url: "/pages/subPackages/repairDispatch-app/detail?id=" + id,
- });
- },
- async getByCodes() {
- let that = this;
- let data = await getByCodes(JSON.stringify(this.dic_key));
- that.dic_SelectList = that.$common.handleDicList(data);
- that.selectData();
- },
- // auth.currUser().id
- selectData() {
- const _this = this;
- repairList(this.params).then((res) => {
- if (res.data) {
- _this.recordList = [];
- res.data.forEach(function (item) {
- const jsonMap = _this.getItemJson(item);
- _this.recordList.push(jsonMap);
- });
- }
- });
- },
- getItemJson: function (item) {
- const fileUrls =
- item.fileUrl && item.fileUrl.length > 0 ? item.fileUrl.split(",") : [];
- console.log(fileUrls);
- const fileUrl = {
- url:
- this.$constant.BASE_URI +
- "/wx/fileController/download/" +
- fileUrls[0],
- };
- item.fileUrl = fileUrl;
- // fileUrls.forEach((item) => {
- // item.url = this.$constant.BASE_URI + "/wx/fileController/download/" + item;
- // // item.isImage = true;
- // fileUrl.push({ url: item, isImage: true });
- // });
- // const fileUrls = item.fileUrl !== "" ? JSON.parse(item.fileUrl) : [];
- // console.log(fileUrls);
- // item.fileUrl = fileUrls;
- // item.createdAt = this.$common.transServDate(item.createdAt);
- // console.log(item.status);
- // console.log(this.dic_SelectList.REPAIR_STATUS);
- // let index = this.dic_SelectList.REPAIR_STATUS.findIdex((e)=>e.value==item.status)
- // item.statusName = this.dic_SelectList.REPAIR_STATUS[index];
- console.log(item);
- return item;
- },
- /**
- *
- */
- quickSelect(item) {
- if (this.quickSleced.val && this.quickSleced.val === item.val) {
- this.quickSleced = {};
- } else {
- this.quickSleced = item;
- }
- },
- /**
- * 上传文件
- */
- afterRead(file) {
- console.log(file);
- },
- /**
- * 设置状态样式
- */
- setStatusStyle(status) {
- let statusClass = null;
- switch (status) {
- case "unAcceptance":
- statusClass = "pending-btn";
- break;
- case "acceptance":
- statusClass = "accepted-btn";
- break;
- case "processed":
- statusClass = "processed-btn";
- break;
- case "evaluated":
- statusClass = "evaluated-btn";
- break;
- }
- return statusClass;
- },
- },
- /**
- * 过滤器
- */
- filters: {
- /**
- * 状态:0、待受理 1、已受理 2、已处理 3、已评价
- */
- statusFilter(val) {
- let res = null;
- switch (val) {
- case "unAcceptance":
- res = "待处理";
- break;
- case "acceptance":
- res = "已受理";
- break;
- case "processed":
- res = "已处理";
- break;
- case "evaluated":
- res = "已评价";
- break;
- }
- return res;
- },
- },
- };
- </script>
- <style lang="scss" type="text/scss" scoped>
- .repair {
- .top-add {
- background-color: #fff;
- padding: 30rpx;
- margin-bottom: 20rpx;
- text-align: right;
- box-shadow: 0rpx 5rpx 10rpx 0rpx rgba(0, 0, 0, 0.05);
- i {
- font-size: 36rpx;
- color: $text6;
- margin-right: 15rpx;
- }
- .txt {
- font-size: 32rpx;
- color: $text6;
- }
- }
- .info-repairList {
- height: calc(100vh - 124rpx);
- overflow-y: auto;
- .info-item {
- background-color: #fff;
- padding: 20rpx 30rpx;
- margin-bottom: 20rpx;
- .info-top {
- @include flex;
- .left {
- width: 286rpx;
- height: 168rpx;
- font-size: 0;
- border-radius: 10rpx;
- overflow: hidden;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .right {
- align-self: flex-start;
- width: 380rpx;
- .tit {
- width: 380rpx;
- font-size: 32rpx;
- line-height: 1.4;
- font-weight: bold;
- color: #333333;
- @include line-clamp;
- margin-bottom: 20rpx;
- }
- .txt {
- font-size: 28rpx;
- color: #666;
- }
- }
- }
- .info-bottom {
- margin-top: 20rpx;
- padding-top: 20rpx;
- border-top: 1rpx dashed #dbdbdb;
- @include flex;
- .left {
- i {
- font-size: 30rpx;
- color: #999999;
- margin-left: 10rpx;
- }
- span {
- font-size: 28rpx;
- color: #999999;
- }
- }
- .right {
- }
- }
- }
- }
- }
- </style>
|