123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703 |
- <template>
- <view>
- <view class="content">
- <view class="content1-top">
- <view class="top2">
- <view class="left">
- <view @click='tabcarchange(1)' class='line' :class='searchType==1?"active":""'>未完成</view>
- <view @click='tabcarchange(3)' class='line' :class='searchType==3?"active":""'>已完成</view>
- </view>
- <view class="right uni-button">
- <button v-if="searchType==3" style="line-height: 28px;margin-right: 5px;"
- class="right-contrent1" @click="requestFunds">请款</button>
- <button style="line-height: 28px;" class="right-contrent1" @click="trackAddition">添加</button>
- </view>
- </view>
- </view>
- </view>
- <mescroll-body ref="mescrollRef" :down="downOption" @down="downCallback" @up="upCallback" @init="mescrollInit">
- <view style="display: flex;align-items: center;" v-for="(item,index) in shortDetail.shortFillingList" :key="index" @click='getInfo(item)'>
- <view style="width: 30px;">
- <label @click.stop='emptyclick'>
- <checkbox-group v-model="show2" class="fuxuankuang" @change="checkedChange(item,$event,index)" v-if="searchType==3">
- <checkbox :checked='item.checked' :value="'cd'+index" style="transform:scale(0.7)" :disabled="item.travelStatus == '已申请'" />
- </checkbox-group>
- </label>
- </view>
- <view class="good-list flex">
- <view style="padding: 0 35rpx 0rpx 35rpx;">
- <view class="flex align-center" style="width: 103%;margin-left: 12px;">
- <view class="item1">
- <view class="ssx">{{$helper.getProvinceAbbreviation(item.originProvince)}}</view>
- <view class="level2-title" style="font-size: 14px;">{{$helper.filterUrban(item.originCity)}}
- {{$helper.filterArea(item.originArea)}}
- </view>
- </view>
- <image class="jt-icon item2" src="@/static/images/fuel/jt.png" mode='widthFix'>
- </image>
- <view class="item3">
- <view class="ssx">{{$helper.getProvinceAbbreviation(item.destinationProvince)}}</view>
- <view class="level2-title">{{$helper.filterUrban(item.destinationCity)}}
- {{$helper.filterArea(item.destinationArea)}}
- </view>
- </view>
- <view class="wenzi audit1" v-if="item.travelStatus">{{item.travelStatus}}</view>
- </view>
- <view class="yf-style">
- <view style='background:#F9F9FA;padding:0 30rpx 20rpx;border-radius:10rpx;' class="left">
- <view style='justify-content:space-between;font-weight:600;' class="flex">
- <view style="min-width: 130px;margin: 10px 0;">车牌号 : {{item.carNo}}</view>
- <view style="width: 90px;margin: 12px 0;">里程</view>
- </view>
- <view>{{item.createDate.split(" ")[0]}}
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </mescroll-body>
- <view v-if='show1' class="shade">
- <view class="wrap1">
- <view class="alert-top">
- <view class="title1">
- 请款
- </view>
- <u-icon name="close" class="close" color="#8890B1" @click="close()"></u-icon>
- </view>
- <view style='overflow-y: scroll;height:740rpx;' class="content1">
- <view class="c-row">
- <view class="title2">请款金额</view>
- <view class="con-list">
- <input type="digit" style="width: 100px;margin-left: 60px;"
- v-model='shortDetail.amountRequested' placeholder="请输入请款金额">
- <view style="width: 0px;margin-left: 162px;margin-top: -20px;">元</view></input>
- </view>
- </view>
- <view class="c-row">
- <view class="title2">仓库名称</view>
- <view class="con-list">
- <view @click='show=true'>{{shortDetail.warehouseName}}</view>
- <u-picker :range="warehouseBaseInfoList" range-key="warehouseName"
- @confirm='targetLPicker($event)' v-model="show" mode="selector">
- </u-picker>
- </view>
- </view>
- <view class="c-row">
- <view class="title2">备注</view>
- </view>
- <view class="con-list">
- <u-input class='textarea' v-model="shortDetail.remark" :type="type" :border="border"
- :height="height" :auto-height="autoHeight" />
- <view style='right:10px;bottom:20px;color:#AFB3BF;'>
- {{shortDetail.remark.length}}/150个字
- </view>
- </view>
- <view class="c-row">
- <view class="title2">加油凭证</view>
- </view>
- <view class="voucher">
- <u-upload class="upload" ref="upload" name='fileName' :form-data="{companyId: pcUserInfo.compId,
- modelId: '',
- vesselId: ''}" :action="action" :show-tips="false" :max-size="maxSize" :max-count="9"
- :size-type="['compressed']" @on-success="getImgUrl($event,index)" @on-error="onError"
- @on-remove="onRemove($event,index)" @on-uploaded="isAdd = true" :limitType ="['png', 'jpg', 'jpeg', 'webp', 'gif']"
- @on-progress="onProgress"></u-upload>
- <!-- <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="9"
- :size-type="['compressed']" @on-success="getImgUrl($event,index)" @on-error="onError"
- @on-remove="onRemove($event,index)" @on-uploaded="isAdd = true" :before-upload="filterFileType"
- @on-progress="onProgress"></upload> -->
- </view>
- </view>
- <view @click="close()" class="cancel">取消</view>
- <view @click='requestFundsSubmit()' class="confirm">确定</view>
- </view>
- </view>
- <u-modal v-model="show3" @confirm='submit' content="确定提交请款信息?" :show-cancel-button='true' ></u-modal>
- </view>
- </template>
- <script>
- import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
- import * as config from '../../config'
- export default {
- mixins: [MescrollMixin],
- data() {
- return {
- show2: false,
- show3:false,
- searchType: 1,
- pageSize: 10,
- show1: false,
- show: false,
- currentPage: 1,
- canReset:"",
- mescroll: null,
- downOption: {
- auto: false //是否在初始化后,自动执行downCallback; 默认true
- },
- pcUserInfo :uni.getStorageSync('pcUserInfo'),
- shortDetail: {
- addressUrlArray:[],
- shortFillingList: [{
- destinationProvince: "",
- carNo: "",
- originProvince: "",
- createDate: "",
- travelStatus: "",
- mileage: "",
- sendWarehouse: "",
- receiveWarehouse: "",
- }],
- amountRequested: '',
- warehouseName: '请选择仓库名称',
- remark: '',
- },
- action: config.def().baseUrlNew+ 'appendix/api/uploadFiles',
- maxSize: 50 * 1024 * 1024, //限制文件大小 50M
- warehouseType: '1',
- warehouseBaseInfoList: [],
- type: 'textarea',
- border: true,
- height: 150,
- autoHeight: true,
-
- infoList:[],
- }
- },
- onLoad() {
- this.getWarehouse()
- },
- onShow() {
- this.getList()
- this.$nextTick(function() {
- this.canReset && this.mescroll.resetUpScroll() // 重置列表数据为第一页
- this.canReset && this.mescroll.scrollTo(0, 0) // 重置列表数据为第一页时,建议把滚动条也重置到顶部,避免无法再次翻页的问题
- this.canReset = true // 过滤第一次的onShow事件,避免初始化界面时重复触发upCallback, 无需配置auto:false
- });
- },
- methods: {
- mescrollInit(mescroll) {
- console.log("mescroll", mescroll)
- this.mescroll = mescroll;
- },
- downCallback() {
- this.mescroll.resetUpScroll();
- },
- emptyclick(){
-
- },
- /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
- upCallback(page) {
- // if(page.num==1) this.fuelFilling = []
- this.$api.doRequest('get', '/shortFillingInfo/selectShortFilling', {
- pageSize: page.size,
- currentPage: page.num,
- // pcFlag: 0,
- searchType: this.searchType,
- compId: uni.getStorageSync('pcUserInfo').compId,
- commonId: uni.getStorageSync('pcUserInfo').userId,
- }).then(res => {
- if (res.data.code == 200) {
- for (var i = 0; i < res.data.data.records.length; i++) {
- res.data.data.records[i].checked=false
- }
- let curPageData = res.data.data.records;
- let curPageLen = curPageData.length;
- let totalPage = res.data.data.total;
- if (page.num == 1) this.shortDetail.shortFillingList = [];
- this.shortDetail.shortFillingList = this.shortDetail.shortFillingList.concat(curPageData);
- console.log(curPageLen, totalPage)
- this.mescroll.endByPage(curPageLen, totalPage);
- // if (type == 'down') {
- // this.mescroll.endSuccess();
- // this.fuelFilling = []
- // }
- // this.mescroll.endBySize(res.data.data.records.length, res.data.data.total);
- // this.fuelFilling = this.fuelFilling.concat(res.data.data.records)
-
- }
- })
- //联网加载数据
- // this.getList(page.size, page.num, 'up')
- },
- getImgUrl(res) {
- this.shortDetail.addressUrlArray.push(res.data.appendixPath)
- // if(this.fillingDetail.fillingDetailInfoList[index].addressUrl){
- // this.fillingDetail.fillingDetailInfoList[index].addressUrl = this.fillingDetail.fillingDetailInfoList[index].addressUrl +","+res
- // }else{
- // this.fillingDetail.fillingDetailInfoList[index].addressUrl = res
- // }
-
- // console.log('------------res-----------')
- },
- onError(error) {
- alert(error)
- console.log('------------error-----------')
- console.log(error)
- },
- onProgress(e) {
- console.log(e)
- },
- onRemove(index, num) {
- this.shortDetail.addressUrlArray.splice(index, 1)
-
- },
- checkedChange(item,e,index) {
- if (item.travelStatus == '已报销') {
- this.show2 = false
- this.$api.msg('已报销的不可再选')
- return
- }else{
- if(e.detail.value[0]&&e.detail.value[0].indexOf(index)!=-1){
- this.shortDetail.shortFillingList[index].checked=true
- }else{
- this.shortDetail.shortFillingList[index].checked=false
- }
- }
-
- console.log(this.shortDetail.shortFillingList,)
- },
- tabcarchange(searchType) {
- this.searchType = searchType
- this.pageSize = 10
- this.getList()
- },
- trackAddition() {
- uni.navigateTo({
- url: '/pages/shortDistance/short_track_addition'
- })
- },
- getList() {
- this.$api.doRequest('get', '/shortFillingInfo/selectShortFilling', {
- pageSize: this.pageSize,
- currentPage: this.currentPage,
- // pcFlag: 0,
- searchType: this.searchType,
- compId: uni.getStorageSync('pcUserInfo').compId,
- commonId: uni.getStorageSync('pcUserInfo').userId,
- }).then(res => {
- if (res.data.code == 200) {
- for (var i = 0; i < res.data.data.records.length; i++) {
- res.data.data.records[i].checked=false
- }
- this.shortDetail.shortFillingList = res.data.data.records
- }
- })
- },
- getWarehouse() {
- this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouse', {
- compId: uni.getStorageSync("pcUserInfo").compId,
- warehouseType: '1'
- }).then(res => {
- if (res.data.data.length != 0) {
- this.warehouseBaseInfoList = res.data.data
- }
- })
- },
- targetLPicker(e) {
- this.shortDetail.warehouseName = this.warehouseBaseInfoList[e[0]].warehouseName
- },
- requestFunds() {
- console.log(this.shortDetail.shortFillingList)
- var arr=this.shortDetail.shortFillingList.filter((item)=>{return item.checked==true})
- console.log(arr)
- this.infoList=arr
- if(arr.length==0){
- this.$api.msg('请选择一条要请款的条目')
- return
- }
- this.show1 = true
- },
- close() {
- this.show1 = false
- },
- getInfo(item) {
- if (item.travelStatus == '已结束') {
- return
- } else {
- uni.navigateTo({
- url: '/pages/shortDistance/short_track_addition?id=' + item.id
- })
- }
- },
- requestFundsSubmit() {
- this.show3=true
- },
- submit(){
- var that = this
- let dataInfo={}
- dataInfo.amountRequested = that.shortDetail.amountRequested
- dataInfo.warehouseName = that.shortDetail.warehouseName
- dataInfo.remark = that.shortDetail.remark
- dataInfo.addressUrl = that.shortDetail.addressUrlArray.toString()
- // dataInfo.compId = uni.getStorageSync('pcUserInfo').compId
- // dataInfo.commonId = uni.getStorageSync('pcUserInfo').userId
- // dataInfo.empName = uni.getStorageSync('userInfo').userName
- dataInfo.shortFillingInfoList = that.infoList
- that.$api.doRequest('post', '/shortFillingInfo/api/shortRequestFunds',
- dataInfo
- )
- .then(res => {
- if (res.data.code == 200) {
- that.$api.msg('提交成功')
- that.show3=false
- that.show1=false
- } else {
- that.$api.msg('提交失败')
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .content {
- padding-bottom: 50rpx;
- }
- .tag {
- background: #F5F6F9;
- padding: 5px;
- color: #333333;
- display: inline-flex;
- font-size: 22rpx;
- border-radius: 3px;
- margin: 3px;
- }
- .introduce-section .title {
- justify-content: space-between;
- align-items: flex-start;
- }
- .introduce-section .title text {
- font-size: 28rpx;
- }
- .introduce-section .title .title-tip {
- flex: 1;
- font-size: 28rpx;
- color: #FE6430;
- font-weight: 500;
- height: 50px;
- line-height: 50px;
- border-bottom: 1px solid #EEEEEE;
- }
- .introduce-section .title .title-tip-a {
- flex: 1;
- font-size: 15px;
- color: #AFB3BF;
- font-weight: 500;
- height: 50px;
- line-height: 50px;
- border-bottom: 1px solid #EEEEEE;
- }
- .line {
- display: inline-block;
- padding: 5px;
- position: relative;
- font-size: 17px;
- }
- .line.active {
- font-size: 19px;
- font-weight: 900;
- }
- .line.active:after {
- content: '';
- display: block;
- position: absolute;
- width: 18px;
- left: 50%;
- transform: translateX(-50%);
- bottom: 0;
- border-bottom: 3px solid #22C572;
- }
- /deep/.u-action-active {
- margin-right: 6px;
- }
- .content1-top {
- background: white;
- padding: 10px 16px 0 10px;
- border-radius: 0 0 15px 15px;
- padding-bottom: 10px;
- position:fixed;
- z-index:10;
- width:100%;
- }
- .top2 {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .right.uni-button {
- display: flex;
- align-items: center;
- font-weight: normal;
- .right-contrent1 {
- background: #22C572;
- height: 25px;
- font-size: 14px;
- color: #fff;
- }
- }
- }
- .good-list {
- width:89%;
- margin-right: 10rpx;
- background-color: white;
- padding: 33px 10px 25px 0px;
- border-radius: 30rpx;
- box-shadow: 0px 5rpx 20rpx #E3E3E3;
- margin-bottom: 10px;
- .item1,
- .item3 {
- // width: 40%;
- display: flex;
- .text {
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- }
- }
- .item1 .text {
- text-align: left;
- }
- .item3 .text {
- text-align: right;
- }
- }
- .fuxuankuang {
- margin-top: 10px;
- }
- .xf-iamge {
- width: 74rpx;
- height: 43rpx;
- position: absolute;
- top: -20rpx;
- right: 0;
- }
- .level2-title {
- font-size: 28rpx;
- width: 84px;
- }
- .jt-icon {
- position: relative;
- top: 6rpx;
- width: 60rpx;
- margin: 0 20rpx;
- }
- .ssx {
- width: 20px;
- height: 20px;
- background: linear-gradient(180deg, #C8D7E5 0%, #AFC1D6 100%);
- font-size: 13px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
- margin-right: 5px;
- }
- .item1 .ssx{
- background:#22C572;
- }
- .item3 .ssx{
- background:#FE6430;
- }
- .level2-title {
- font-weight: 700;
- color: #000000;
- }
- .wenzi {
- margin-top: -65px;
- margin-left:-20px;
- text-align: right;
- border-radius: 5px;
- height: 5px;
- }
- .audit1 {
- color: #22C572;
- width:43px;
- // margin-right:10px;
- }
- .audit2 {
- color: #22C572;
- }
- .audit3 {
- color: #AFB3BF;
- }
- .c-row {
- display: flex;
- -webkit-box-align: center;
- align-items: center;
- // padding: 0px 15px;
- position: relative;
- }
- .shade {
- position: fixed;
- top: 0;
- left: 0;
- height: 100%;
- width: 100%;
- background: rgba(0, 0, 0, 0.4);
- z-index: 3;
- .wrap1 {
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- margin: auto;
- background: #fff;
- width: calc(100% - 198rpx);
- height: 476px;
- border-radius: 20rpx;
- input {
- font-size: 14px;
- }
- .alert-top {
- padding: 33rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- position: relative;
- }
- .title1 {
- font-size: 32rpx;
- font-weight: 600;
- color: #333333;
- }
- .close {
- position: absolute;
- right: 33rpx;
- }
- }
- .title2 {
- padding: 10px 16px;
- }
- .con-list {
- -webkit-box-flex: 1;
- flex: 1;
- display: flex;
- -webkit-box-orient: vertical;
- -webkit-box-direction: normal;
- flex-direction: column;
- color: #303133;
- line-height: 20px;
- text-align: right;
- padding-right: 10px;
- }
- .cancel {
- position: absolute;
- display: inline-block;
- width: 50%;
- text-align: center;
- bottom: 0;
- padding: 10px;
- border-top: 1px solid #eee;
- font-size: 34rpx;
- }
- .confirm {
- position: absolute;
- display: inline-block;
- width: 50%;
- text-align: center;
- bottom: 0;
- padding: 10px;
- border-top: 1px solid #eee;
- font-size: 34rpx;
- }
- .cancel {
- left: 0;
- border-right: 1px solid #eee;
- color: #ff0000;
- }
- .confirm {
- right: 0;
- color: #22C572;
- }
- .bottom-btn {
- width: 100%;
- position: fixed;
- bottom: 0;
- display: flex;
- z-index: 2;
- left: 0;
- background-color: #f8f8f8;
- flex-direction: column;
- .btn1,
- .btn2 {
- width: 100%;
- margin-bottom: 26rpx;
- border-radius: 90rpx;
- }
- .btn1 {
- background: white;
- color: #00C265;
- }
- }
- }
- .textarea {
- background: #F9F9FA;
- border: 1px solid #EEEEEE;
- margin-left: 10px;
- }
- .voucher{
- margin-left: 20rpx;
- }
- /deep/.mescroll-body{
- margin-top:50px;
- }
- </style>
|