123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- <template>
- <view class="content">
- <view class="topbar" v-show="isIphone">
- </view>
- <view class="status_bar">
- <view class="left" @click="goBack"><u-icon name="arrow-left"></u-icon>返回</view>
- <span style="font-size: 36rpx;">详情</span>
- <view class="right"></view>
- </view>
- <view class="mainCont">
- <view class="title">
- {{ info.packCode }}
- <span style="float: right; color: #bcbcbc" v-show="info.packState == '4'">已完成</span>
- <span style="float: right; color: #2D8CF0" v-show="info.packState == '3'">待验收</span>
- </view>
- <u-cell-group style="margin-bottom: 10px">
- <u-cell-item :arrow="false" :value-style="{textAlign: 'left',paddingLeft: '10px'}">
- <view slot="title"><span class="red"></span>科  室:</view>
- {{ info.positionName }}
- </u-cell-item>
- </u-cell-group>
- <u-cell-group style="margin-bottom: 10px">
- <u-cell-item :arrow="false" :value-style="{textAlign: 'left',paddingLeft: '10px'}">
- <view slot="title"><span class="red"></span>分  类:</view>
- {{ info.rubbishCategoryStr }}
- </u-cell-item>
- <u-cell-item :arrow="false" :value-style="{textAlign: 'left',paddingLeft: '10px'}">
- <view slot="title"><span class="red"></span>重  量:</view>
- {{ info.packWeight }}kg
- </u-cell-item>
- <u-cell-item :arrow="false" :value-style="{textAlign: 'left',paddingLeft: '10px'}">
- <view slot="title"><span class="red"></span>打 包 人:</view>
- {{ info.createUserName }}
- </u-cell-item>
- <u-cell-item :arrow="false" :value-style="{textAlign: 'left',paddingLeft: '10px'}">
- <view slot="title"><span class="red"></span>打包时间:</view>
- {{ info.createTime }}
- </u-cell-item>
- <u-cell-item :arrow="false" :value-style="{textAlign: 'left',paddingLeft: '10px'}">
- <view slot="title"><span class="red"></span>暂 存 点:</view>
- {{ info.provisionalName }}
- </u-cell-item>
- </u-cell-group>
- <view class="imgupload">
- <view>{{ info.packRemake }}</view>
- <view class="imgbox">
- <img v-for="(item,index) in fileList" :src="item.filePath" alt="">
- </view>
- <!-- <u-upload :action="action" :file-list="fileList"></u-upload> -->
- </view>
- <u-cell-group style="margin-bottom: 10px">
- <u-cell-item :arrow="false" :value-style="{textAlign: 'left',paddingLeft: '10px'}">
- <view slot="title"><span class="red"></span>收 集 人:</view>
- {{ info.collectUserName }}
- </u-cell-item>
- <u-cell-item :arrow="false" :value-style="{textAlign: 'left',paddingLeft: '10px'}">
- <view slot="title"><span class="red"></span>收集时间:</view>
- {{ info.updateTime }}
- </u-cell-item>
- </u-cell-group>
- <u-cell-group style="margin-bottom: 10px" v-show="info.checkUserName">
- <u-cell-item :arrow="false" :value-style="{textAlign: 'left',paddingLeft: '10px'}">
- <view slot="title"><span class="red"></span>验 收 人:</view>
- {{ info.checkUserName }}
- </u-cell-item>
- <u-cell-item :arrow="false" :value-style="{textAlign: 'left',paddingLeft: '10px'}">
- <view slot="title"><span class="red"></span>验收时间:</view>
- {{ info.checkTime }}
- </u-cell-item>
- </u-cell-group>
- <view class="imgupload" v-show="info.abnormalRemake">
- <view>异常内容:{{ info.abnormalRemake }}</view>
- <view class="imgbox">
- <img v-for="(item,index) in imgList2" :src="item.filePath" alt="">
- </view>
- <!-- <u-upload :action="action" :file-list="fileList"></u-upload> -->
- </view>
- <!-- <view class="imgupload" v-show="info.packState != '2'">
- <u-input v-model="remark" auto-height type="textarea" />
- <u-upload ref="upload" @on-remove="uploadRemove" @on-success="uploadSuccess" :header="uploadHeader"
- max-count="3" width="80px" height="80px" :custom-btn="true" :action="action" :file-list="fileList">
- <view slot="addBtn" class="slot-btn">
- <u-icon name="photo" size="60" :color="$u.color['lightColor']"></u-icon>
- </view>
- </u-upload>
- </view>
- <view class="bottomButton" @click="collectDo" v-show="info.packState != '2'">
- <view>收集</view>
- </view> -->
- </view>
- <u-toast ref="uToast" />
- </view>
- </template>
- <script>
- const NET = require('@/utils/request')
- const API = require('@/config/api')
- export default {
- data() {
- return {
- remark: "",
- action: API.uploadFile,
- fileList: [],
- imgList: [],
- imgList2: [],
- id: "",
- isIphone: false,
- uploadHeader: {
- Authorization: 'Bearer ' + uni.getStorageSync('token')
- },
- info: {},
- }
- },
- onLoad(options) {
- uni.getSystemInfo({
- success: (res) => {
- console.log(res)
- if (res.model == 'iPhone') {
- this.isIphone = true;
- }
- },
- fail: (err) => {
- console.log(err)
- }
- })
- this.id = options.id
- NET.request(API.getPackageInfo + '/' + options.id, {}).then(res => {
- this.info = res.data
- this.fileList = res.data.packFiles.filter(a => a.fileCategory == 1)
- this.imgList2 = res.data.packFiles.filter(a => a.fileCategory == 3)
- }).catch(error => {
- this.$refs.uToast.show({
- title: error.msg,
- type: 'warning',
- })
- })
- },
- onReady() {
- if (this.isIphone) {
- document.getElementsByClassName('mainCont')[0].style.height = document.getElementsByClassName('mainCont')[
- 0].clientHeight - 25 + 'px'
- }
- },
- methods: {
- goBack() {
- uni.navigateBack({
- delta: 1
- });
- },
- uploadSuccess(data, index) {
- console.log(data, index)
- if (data.code == 200) {
- data.data[0].fileType = 2
- data.data[0].fileCategory = 2
- this.imgList.push(data.data[0])
- } else {
- this.$refs.upload.remove(index)
- }
- },
- uploadRemove(index) {
- console.log(index);
- this.imgList.splice(index, 1)
- },
- collectDo() {
- let postData = {
- collectRemake: this.remark,
- collectFileList: this.imgList
- }
- NET.request(API.collectRubbishPackage + '/' + this.id, postData, 'POST').then(res => {
- this.$refs.uToast.show({
- title: '收集成功',
- type: 'success',
- })
- uni.navigateBack({
- delta: 1
- });
- }).catch(error => {
- this.$refs.uToast.show({
- title: error.msg,
- type: 'warning',
- })
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .mainCont {
- height: calc(100% - 80rpx);
- padding-bottom: 60px;
- overflow-y: scroll;
- }
- .title {
- height: 40px;
- line-height: 20px;
- padding: 10px;
- }
- .red {
- display: inline-block;
- width: 10px;
- height: 10px;
- color: red;
- }
- .imgupload {
- margin-bottom: 10px;
- padding: 10px 25px;
- background: #fff;
- .imgbox {
- img {
- width: 80px;
- height: 80px;
- margin: 10px 10px 10px 0;
- }
- }
- }
- .slot-btn {
- width: 80px;
- height: 80px;
- display: flex;
- justify-content: center;
- align-items: center;
- border: 1px solid #c0c4cc;
- border-radius: 5px;
- }
- /deep/ .u-cell__value {
- color: #1c1c1c;
- }
- </style>
|