vue-cli init
This commit is contained in:
@@ -0,0 +1,231 @@
|
||||
<template>
|
||||
<view>
|
||||
<button type="primary" @click="onShowDatePicker('range')">单据日期 {{range[0]}} - {{range[1]}}</button>
|
||||
<view class="u-demo-block">
|
||||
<view class="u-page__tag-item">
|
||||
<u-search v-model="searchBillNo" :show-action="false"
|
||||
@custom="onTabChange" @search="onTabChange"
|
||||
placeholder="请输入单号或往来单位">
|
||||
</u-search>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<u-sticky>
|
||||
<div style="height: 43px; border-bottom: 1rpx solid #eeeeee; background-color: #FFFFFF;">
|
||||
<u-tabs :list="tabList" name="title" active-color="red" :is-scroll="false"
|
||||
:current="activeTabIndex" @change="onTabChange"></u-tabs>
|
||||
</div>
|
||||
</u-sticky>
|
||||
<dataNull v-if="ItemDataList.length == 0" src="/static/img/chahua/gjNull.png" title="暂无相关移仓资料" title1="请添加或者更换搜索添加">
|
||||
</dataNull>
|
||||
<scroll-view v-else scroll-y="true" :style="{height: scrollHeight}"
|
||||
refresher-enabled :refresher-threshold="200" :refresher-triggered="triggered" refresher-background="gray">
|
||||
<view v-for="(item, index) in ItemDataList" :key="index" @click="cardClickFun(item, index)">
|
||||
<GoodsBusinessStationMoveItem :item="item" :isSelect="isSelect" :index="index"></GoodsBusinessStationMoveItem>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<addBtn url="./storeGoodsBusinessStationMoveAdd"></addBtn>
|
||||
<mx-date-picker :show="showPicker" :type="BillDatetype" :value="BillDatevalue"
|
||||
:show-tips="true" :begin-text="'开始'" :end-text="'结束'"
|
||||
:show-seconds="false" @confirm="BillDateConfirm" @cancel="BillDateConfirm" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let that = '';
|
||||
import addBtn from '@/components/addBtn/addBtn.vue'
|
||||
import GoodsBusinessStationMoveItem from '@/components/card/storeGoodsBusinessStationMoveItem.vue';
|
||||
import util from '../../common/util';
|
||||
import MxDatePicker from "@/components/mx-datepicker/mx-datepicker.vue";
|
||||
export default {
|
||||
components: {
|
||||
GoodsBusinessStationMoveItem,
|
||||
MxDatePicker
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabList: [
|
||||
{title: '未审核', status: '0'},
|
||||
{title: '已审核', status: '1'},
|
||||
],
|
||||
activeTabIndex: 0,
|
||||
ItemDataList: [],
|
||||
pageIndex: 1,
|
||||
isMore: true,
|
||||
scrollHeight: '667px',
|
||||
triggered: false,
|
||||
isSelect: false,
|
||||
searchBillNo: '',
|
||||
showPicker: false,
|
||||
BillBeginDate: new Date(new Date()-24*60*60*1000).toLocaleDateString(),
|
||||
BillEndDate: new Date().toLocaleDateString(),
|
||||
range: [new Date(new Date()-24*60*60*1000).toLocaleDateString(), new Date().toLocaleDateString()],
|
||||
BillDatetype: 'range',
|
||||
BillDatevalue: ''
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
that = this;
|
||||
uni.getSystemInfo({
|
||||
success(res) {
|
||||
that.scrollHeight = res.windowHeight - 40 + 'px';
|
||||
}
|
||||
})
|
||||
that.StoreGoodsBusinessStationMoveData();
|
||||
},
|
||||
watch: {
|
||||
activeTabIndex: {
|
||||
deep: true, // 深度监听
|
||||
handler(newVal, oldVal) {
|
||||
console.log("activeTabIndex参数改变,即将刷新...", `新值:${newVal}`, `旧值:${oldVal}`);
|
||||
this.onTabChange(newVal);
|
||||
}
|
||||
}
|
||||
},
|
||||
// 上拉加载
|
||||
onReachBottom: function () {
|
||||
console.log("activeTabIndex参数改变,即将刷新..." + this.activeTabIndex);
|
||||
/*
|
||||
if (this.pagination.hasNextPage) {
|
||||
this.doInfinite()
|
||||
}
|
||||
*/
|
||||
},
|
||||
/* onBackPress() {
|
||||
uni.$off('deleteCardFun', that.deleteCardFun);
|
||||
uni.$off('updateBjdListByIndex', that.updateBjdListByIndex)
|
||||
uni.$off('addBjdItemInListFun', that.addBjdItemInListFun);
|
||||
}, */
|
||||
methods: {
|
||||
onTabChange(index) {
|
||||
const _self = this;
|
||||
this.activeTabIndex = index;
|
||||
if (this.activeTabIndex == 0) {
|
||||
console.log("---->>未审核<<----");
|
||||
this.StoreGoodsBusinessStationMoveData();
|
||||
} else {
|
||||
console.log("---->>已审核<<----");
|
||||
this.StoreGoodsBusinessStationMoveDataCommit();
|
||||
}
|
||||
},
|
||||
|
||||
onShowDatePicker(type){//显示
|
||||
this.BillDatetype = type;
|
||||
this.showPicker = true;
|
||||
this.BillDatevalue = this[type];
|
||||
},
|
||||
|
||||
BillDateConfirm(e) {//选择
|
||||
this.showPicker = false;
|
||||
if(e) {
|
||||
this[this.BillDatetype] = e.value;
|
||||
this.BillBeginDate = e.value[0];
|
||||
this.BillEndDate = e.value[1];
|
||||
}
|
||||
},
|
||||
|
||||
StoreGoodsBusinessStationMoveData: function() {
|
||||
that.ItemDataList = [];
|
||||
let aCommitStatus = 0;
|
||||
if (this.activeTabIndex == 0) {
|
||||
aCommitStatus = 0
|
||||
}
|
||||
else if (this.activeTabIndex == 1) {
|
||||
aCommitStatus = 1
|
||||
};
|
||||
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/opensql',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
sql_command_id: 'APP.GetStoreGoodsBusinessStationMoveDataSQL',
|
||||
params: [{
|
||||
name: 'CommitStatus',
|
||||
value: aCommitStatus
|
||||
}, {
|
||||
name: 'BillNo',
|
||||
value: '%' + this.searchBillNo + '%'
|
||||
}, {
|
||||
name: 'LOGINID',
|
||||
value: getApp().globalData.LoginID
|
||||
}]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
this.triggered = false;
|
||||
let data = res.data.data;
|
||||
//console.log("---->" + JSON.stringify(res.data));
|
||||
that.ItemDataList = [];
|
||||
that.ItemDataList = that.ItemDataList.concat(data);
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
StoreGoodsBusinessStationMoveDataCommit: function() {
|
||||
that.ItemDataList = [];
|
||||
let aCommitStatus = 0;
|
||||
if (this.activeTabIndex == 0) {
|
||||
aCommitStatus = 0
|
||||
}
|
||||
else if (this.activeTabIndex == 1) {
|
||||
aCommitStatus = 1
|
||||
};
|
||||
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/opensql',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
sql_command_id: 'APP.GetStoreGoodsBusinessStationMoveDataCommitSQL',
|
||||
params: [{
|
||||
name: 'CommitStatus',
|
||||
value: aCommitStatus
|
||||
}, {
|
||||
name: 'BillNo',
|
||||
value: '%' + this.searchBillNo + '%'
|
||||
}, {
|
||||
name: 'BeginDate',
|
||||
value: this.BillBeginDate
|
||||
}, {
|
||||
name: 'EndDate',
|
||||
value: this.BillEndDate
|
||||
}, {
|
||||
name: 'LOGINID',
|
||||
value: getApp().globalData.LoginID
|
||||
}]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
this.triggered = false;
|
||||
let data = res.data.data;
|
||||
that.ItemDataList = [];
|
||||
//console.log("---->" + JSON.stringify(res.data));
|
||||
that.ItemDataList = that.ItemDataList.concat(data);
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
// 卡片点击方法
|
||||
cardClickFun: function(item, index) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/storegoods/storeGoodsBusinessStationMoveDetail?billid=' + item.BillMasterID
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #F8F8F8;
|
||||
}
|
||||
button{
|
||||
margin: 20upx;
|
||||
font-size: 28upx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user