123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391 |
- <template name="task">
- <view class="content">
- <view class="cu-bar search bg-white">
- <view class="search-form round" >
- <u-search placeholder="请输入合同编号、车牌号或派车编号" v-model="keyword"
- @search="searchKeyWord()"
- @custom="searchKeyWord()"
- ></u-search>
- </view>
- </view>
- <view style='background:#fff;padding:0 15px;'>
- <view @click='tabcarchange(1)' class='line' :class='statusFlag==1?"active":""'>未完成</view>
- <view @click='tabcarchange(3)' class='line' :class='statusFlag==3?"active":""'>已完成</view>
- </view>
- <view class="introduce-section">
- <view v-for="(item, index) in taskInfo" :key="index" class="guess-item" @click="navToDetailPage(item)">
- <view class="title flex">
- <text >{{item.messageTitle}}</text>
- <view class="title-tip-a" v-if="statusFlag==3">已完成</view>
- <view class="title-tip" v-if="statusFlag==1">未完成</view>
- </view>
- <view class="flex title_b">
- <view class="title">
- {{item.messageContent}}
- </view>
- </view>
- <u-tag :text="item.taskType" type="success" v-if="item.taskType == '出库任务'"/>
- <u-tag :text="item.taskType" type="primary" v-if="item.taskType == '入库任务'"/>
- </view>
- <view v-show="isSole">
- <uni-load-more :status="loadStatus"></uni-load-more>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex';
- export default {
- name: "task",
-
- data() {
- return {
- PageCur: "task",
- taskInfo: [],
- pages: 1, //页数
- limit: 10, //每次取条目数
- loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
- isLoadMore: false, //是否加载中
- isSole:false,
- showTran: true,
- scrollTop: 0,
- isContent:true,
- statusFlag: 1,
- current: 1,
- warehouseInOutInfo: {
- pageSize: 10,
- currentPage: 1
- },
- data: {
- pageSize: 10,
- currentPage: 1
- },
- keyword:""
- };
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- onShow() {
- this.getIndexBuyData()
- // this.userInfo = uni.getStorageSync("userInfo")
- this.warehouseInOutInfo.phone = this.userInfo.phone
- },
- onReachBottom() { //上拉触底函数
- if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
- if(this.statusFlag==1){
- this.warehouseInOutInfo.currentPage += 1
- }else{
- this.data.currentPage+=1
- }
-
- this.getIndexBuyData()
- }
- },
- // onLoad(options) {
- // this.getIndexBuyData()
- // },
- filters: {
- formatDate (date) {
- var date=new Date(date)
- var time=new Date()
- var newdate=''
- if(time.getMonth() + 1>=10){
- newdate=time.getFullYear()+'-'+(time.getMonth()+1)+'-'+time.getDate()
- }else{
- newdate=time.getFullYear()+'-0'+(time.getMonth()+1)+'-'+time.getDate()
- }
- //把时间戳改为yyyy-MM-dd格式
- //判断是否今天
- var datatime=''
- if(date.getMonth() + 1>=10){
- datatime=date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()
- }else{
- datatime=date.getFullYear()+'-0'+(date.getMonth()+1)+'-'+date.getDate()
- }
- if(datatime == newdate){
- var h = date.getHours();
- h = h < 10 ? '0' + h : h;
- var m = date.getMinutes();
- m = m < 10 ? '0' + m : m;
- var s = date.getSeconds();
- s = s < 10 ? '0' + s : s;
- return h + ':' + m + ':' + s;
- }else{
- if(date.getMonth() + 1>=10){
- return date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()
- }else{
- return date.getFullYear()+'-0'+(date.getMonth()+1)+'-'+date.getDate()
- }
- }
- let o = {
- 'Y': date.getFullYear(),
- 'M+': date.getMonth() + 1,
- 'd+': date.getDate(),
- }
- },
- },
- methods: {
- searchKeyWord(){
- if(!this.keyword){
- this.$api.msg('关键字不能为空')
- }
- uni.showLoading({
- title:"正在加载"
- })
- this.$api.doRequest('get', '/warehouseInOutInfo/selectInfoByKeyWord', this.warehouseInOutInfo).then(res => {
- if (res.data.code == 200) {
- this.taskInfo = res.data.data
- uni.hideLoading()
- } else {
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 2000
- })
- uni.hideLoading()
- }
- }).catch(res => {
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 2000
- })
- uni.hideLoading()
- })
- },
- getIndexBuyData(status) {
- const that = this
- var pages = that.pages
- var limit = that.limit
- var url=''
- uni.showLoading({
- title:"正在加载"
- })
- var data={}
- this.warehouseInOutInfo.statusFlag = this.statusFlag
- this.warehouseInOutInfo.phone = this.userInfo.phone
- this.warehouseInOutInfo.pcFlag = 0
- if(this.statusFlag==1){
- data=this.warehouseInOutInfo
- url='/noticeTask/query/noticeTasks'
- }else{
- data=this.data
- url='/commonUser/query/findHisPageNoticeTasks'
- }
- //this.warehouseInOutInfo.status = this.status
- this.$api.doRequest('get', url, data).then(res => {
- if (res.data.code == 200) {
- let data = res.data.data.records
- //采购信息
- if (data.length > 0) {
- if(status){
- that.taskInfo=data
- }else{
- that.taskInfo = that.taskInfo.concat(data)
- }
-
-
- } else {
- if (that.pages > 1) {
- that.pages -= 1
- }
-
- that.isLoadMore = false
- that.loadStatus = 'nomore'
- }
- for(var i=0;i<this.taskInfo.length;i++){
- if(this.taskInfo[i].businessType=='WAREHOUSE'){
- if(this.taskInfo[i].businessCode=='INOUTTASK-TASK-APPROVE'){
- this.taskInfo[i].messageTitle='出入库任务'
- }
- }else if(this.taskInfo[i].businessType=='REPORT'){
- if(this.taskInfo[i].businessCode=='PROCUREMENT-RECEIPT-REPORT'){
- this.taskInfo[i].messageTitle='采购入库统计'
- }else if(this.taskInfo[i].businessCode=='PROCUREMENT-CLOSE-REPORT'){
- this.taskInfo[i].messageTitle='采购平仓统计'
- }else if(this.taskInfo[i].businessCode=='SALE-RECEIPT-REPORT'){
- this.taskInfo[i].messageTitle='销售出库统计'
- }else if(this.taskInfo[i].businessCode=='SALE-CLOSE-REPORT'){
- this.taskInfo[i].messageTitle='销售平仓统计'
- }
- }else if(this.taskInfo[i].businessType=='PROCUREMENT'){
- if(this.taskInfo[i].businessCode=='PROCUREMENT-ORDER-APPROVE'){
- this.taskInfo[i].messageTitle='采购订单'
- }
- }else if(this.taskInfo[i].businessType=='SALE'){
- if(this.taskInfo[i].businessCode=='SALE-ORDER-APPROVE'){
- this.taskInfo[i].messageTitle='销售订单'
- }
- }
- }
- if(res.data.data.records.length==0){
- that.isSole=true
- }else{
- that.isSole=false
- }
- uni.hideLoading()
- } else {
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 2000
- })
- }
- }).catch(res => {
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 2000
- })
- })
- },
- tabcarchange(statusFlag) {
- this.statusFlag = statusFlag
- this.pageSize = 1
- this.getIndexBuyData(1)
- },
- navToDetailPage(item) {
- if(item.businessCode=='PROCUREMENT-ORDER-APPROVE'){
- uni.navigateTo({
- url:'/pages/task/procurement_details?id='+item.businessId
- })
- }else if(item.businessCode=='SALE-ORDER-APPROVE'){
- uni.navigateTo({
- url:'/pages/task/sale_details?id='+item.businessId
- })
- }else if(item.businessCode=='PROCUREMENT-RECEIPT-REPORT'){
- uni.navigateTo({
- url:'/pages/task/procurement_report_details?id='+item.businessId
- })
- }else if(item.businessCode=='PROCUREMENT-CLOSE-REPORT'){
- uni.navigateTo({
- url:'/pages/task/procurement_close_details?id='+item.businessId
- })
- }else if(item.businessCode=='SALE-RECEIPT-REPORT'){
- uni.navigateTo({
- url:'/pages/task/sale_report_details?id='+item.businessId
- })
- }else if(item.businessCode=='SALE-CLOSE-REPORT'){
- uni.navigateTo({
- url:'/pages/task/sale_close_details?id='+item.businessId
- })
- }
-
- // if(item.taskType == "入库任务"){
-
- // if(item.statusFlag == 3){
- // uni.navigateTo({
- // url: `/pageD/warehousings/warehousingDetails?id=${item.id}`
- // })
- // }else{
- // uni.navigateTo({
- // url: `/pageD/warehousings/warehousings?id=${item.id}&goodsName=${item.goodsName}&contractNo=${item.contractNo}&startWeight=${item.startWeight}&carNo=${item.carNo}&tranCarNo=${item.tranCarNo}&warehouseName=${item.warehouseName}&addressUrl=${item.addressUrl}&inOutDate=${item.inOutDate}&binNumber=${item.binNumber}`
- // })
- // }
- // }else if(item.taskType == "出库任务"){
- // if(item.statusFlag == 3){
- // uni.navigateTo({
- // url: `/pageD/warehousings/ex_warehouse_detail?id=${item.id}`
- // })
- // }else{
- // uni.navigateTo({
- // url: `/pageD/warehousings/ex_warehouse?id=${item.id}&goodsName=${item.goodsName}&contractNo=${item.contractNo}&consignee=${item.consignee}&carNo=${item.carNo}&tranCarNo=${item.tranCarNo}&boxNo=${item.boxNo}&titleNo=${item.titleNo}`
- // })
- // }
- // }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .tag {
- background:#F5F6F9;
- padding: 5px;
- color:#333333;
- display: inline-flex;
- font-size: 22rpx;
- border-radius: 3px;
- margin: 3px;
- }
- .introduce-section .title_b .title-tip{
- font-size: 13px;
- height:40px;
- line-height: 40px;
- flex: 2.5;
- }
- .introduce-section .title_b .title{
- font-size: 13px;
- height:40px;
- padding:10px 0;
- flex: 2.5;
- }
- .introduce-section .title_b .title-tip-b{
- flex: 1;
- font-size: 13px;
- color: #878C9C;
- height:40px;
- line-height: 40px;
- }
- .introduce-section .title text{
- font-size: 17px;
- font-weight: bold;
- height:50px;
- line-height: 50px;
- flex: 2.5;
- border-bottom:1px solid #EEEEEE;
- }
- .introduce-section .title .title-tip{
- flex: 1;
- font-size: 15px;
- 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;
- }
- .introduce-section .guess-item{
- border-radius:4px;
- background: #fff;
- padding: 0upx 30upx 20upx;
- margin:10px;
- padding-bottom: 20upx;
- border-bottom: 1px solid #ccc;
- }
- .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:1px solid #22C572;
- }
- /deep/.u-action-active{
- margin-right:6px;
- }
- </style>
|