Browse Source

销售预报单据长按删除操作完成

master
chenxuhui 7 years ago
parent
commit
f1bd44a5c3
3 changed files with 40 additions and 43 deletions
  1. +39
    -36
      pages/saleForecastList/saleForecastList.js
  2. +0
    -4
      pages/specialOrderApplication/specialOrderApplication.js
  3. +1
    -3
      pages/specialOrderApplication/specialOrderApplication.wxml

+ 39
- 36
pages/saleForecastList/saleForecastList.js View File

@ -7,6 +7,7 @@ var CheckedPageIndex = 0
var CheckedPageSize = 10
var getList = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/SaleForecastRpc/GetList'
var deleteItem = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/SaleForecastRpc/Delete"
// 未审核订单列表
function getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, successaction) {
@ -19,7 +20,7 @@ function getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, successact
"PageSize": UnCheckPageSize,
}];
network.transfer_request(method, params, function (res) {
network.transfer_request(method, params, function(res) {
successaction();
var array = res.result;
if (array.length <= 0) {
@ -66,7 +67,7 @@ function getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize) {
"PageSize": CheckedPageSize,
}];
// let params = [true, CheckedPageIndex, CheckedPageSize];
network.transfer_request(method, params, function (res) {
network.transfer_request(method, params, function(res) {
var array = res.result;
if (array.length <= 0) {
wx.showToast({
@ -101,7 +102,7 @@ Page({
Customer_ID: null,
},
createNew: function (e) {
createNew: function(e) {
wx.navigateTo({
url: 'newBill/newBill',
})
@ -110,7 +111,7 @@ Page({
/**
* 滑动切换tab
*/
bindChange: function (e) {
bindChange: function(e) {
var that = this;
that.setData({
currentTab: e.detail.current
@ -120,7 +121,7 @@ Page({
/**
* 点击tab切换
*/
swichNav: function (e) {
swichNav: function(e) {
var that = this;
if (this.data.currentTab === e.target.dataset.current) {
return false;
@ -131,7 +132,7 @@ Page({
}
},
//点击进入详情页面
transToOrderDetail: function (event) {
transToOrderDetail: function(event) {
var ID = event.currentTarget.dataset.detailitemid;
var State = event.currentTarget.dataset.detailitemstate;
wx.navigateTo({
@ -140,27 +141,29 @@ Page({
},
// 长按删除一条单据
longPressDelete:function(event){
var ID = event.currentTarget.dataset.detailitemid;
var State = event.currentTarget.dataset.detailitemstate;
longPressDelete: function(event) {
var that =this;
var itemID = event.currentTarget.dataset.detailitemid;
var state = event.currentTarget.dataset.detailitemstate;
if (!state) {
wx.showModal({
title: '提示',
content: '不能操作已审核单据',
})
return;
}
wx.showModal({
title: '提示',
content: '确定要删除此单据吗?',
success: function (res) {
content: '确定要删除'+ itemID +'号单据吗?',
success: function(res) {
if (res.confirm) {
console.log('点击确定了');
// 请求删除接口,执行删除逻辑
// //获取列表中要删除项的下标
// var index = e.currentTarget.dataset.index;
// var list = this.data.list;
// //移除列表中下标为index的项
// list.splice(index, 1);
// //更新列表的状态
// this.setData({
// list: list
// });
// images.splice(index, 1);
var params = [itemID];
network.transfer_request(deleteItem, params, function(res) {
wx.showToast({
title: '操作成功',
})
that.onShow();
})
} else if (res.cancel) {
console.log('点击取消了');
return false;
@ -174,7 +177,7 @@ Page({
},
//点击进入筛选页面
chose: function (e) {
chose: function(e) {
wx.navigateTo({
url: 'query/query',
})
@ -183,11 +186,11 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
},
onShow: function (options) {
onShow: function(options) {
this.setData({
checkedDataArr: [],
unCheckDataArr: [],
@ -196,7 +199,7 @@ Page({
var that = this;
UnCheckPageIndex = 0;
CheckedPageIndex = 0;
getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, function (res){
getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, function(res) {
getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize);
});
@ -205,24 +208,24 @@ Page({
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload: function() {
app.globalData.selectCustomer_ID = null
app.globalData.selectStartDate = null
app.globalData.selectEndDate = null
app.globalData.selectBillState = 0
},
//未审核订单滑动到底部加载
unCheckedScrollLower: function (event) {
unCheckedScrollLower: function(event) {
var that = this;
UnCheckPageIndex = UnCheckPageIndex + 1;
getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, function (res){
});
getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, function(res) {
});
},
//已审核订单滑动到底部加载
CheckedScrollLower: function (event) {
CheckedScrollLower: function(event) {
var that = this;
CheckedPageIndex = CheckedPageIndex + 1;
getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize);
@ -239,6 +242,6 @@ Page({
// CheckedPageIndex = CheckedPageIndex + 1;
// getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize);
// }
// },
})

+ 0
- 4
pages/specialOrderApplication/specialOrderApplication.js View File

@ -27,10 +27,6 @@ Page({
})
},
// 按搜索条件查询
goToSearch:function(){
},
// 页面滚动到顶
cscrollViewScrollUpper: function (){


+ 1
- 3
pages/specialOrderApplication/specialOrderApplication.wxml View File

@ -1,14 +1,12 @@
<!--pages/specialOrderApplication/specialOrderApplication.wxml-->
<view class='searchView'>
<view class='imput_goodsName' catchtap='goToSearch'>
<!-- <view class="section"> -->
<view class='imput_goodsName'>
<picker mode="date" value="{{date}}" start="2018-01-01" end="2037-12-31" bindchange="bindDateChange" fields='month'>
<view class="picker">
{{dates}}
</view>
</picker>
<!-- </view> -->
</view>
<view class='storageView' catchtap='creatNew'>新建</view>
</view>


Loading…
Cancel
Save