|
|
|
@ -3,14 +3,22 @@ var network = require("../../../utils/net.js") |
|
|
|
var dateTimePicker = require('../../../utils/dateTimePicker.js'); |
|
|
|
var utilll = require('../../../utils/util.js'); |
|
|
|
|
|
|
|
var getAccountingUnit = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetAccountingUnit"; |
|
|
|
var getCustomer = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetCustomer"; |
|
|
|
var getDept = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetDepartment"; |
|
|
|
var getGoods = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetGoodsWithUnitPrice"; |
|
|
|
var getSaleKind = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetSaleKind" |
|
|
|
|
|
|
|
var insert = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/SaleForecastRpc/Insert'; |
|
|
|
|
|
|
|
function GetAccountingUnit(that, inputValue) { |
|
|
|
let method = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetAccountingUnit"; |
|
|
|
let method = getAccountingUnit; |
|
|
|
let params = [{ |
|
|
|
"InputValue": inputValue, |
|
|
|
"PageIndex": 0, |
|
|
|
"PageSize": 100 |
|
|
|
}]; |
|
|
|
network.transfer_request(method, params, function (res) { |
|
|
|
network.transfer_request(method, params, function(res) { |
|
|
|
that.setData({ |
|
|
|
currency: res.result, |
|
|
|
unit: res.result |
|
|
|
@ -22,13 +30,13 @@ function GetAccountingUnit(that, inputValue) { |
|
|
|
} |
|
|
|
|
|
|
|
function GetCustomer(that, inputValue) { |
|
|
|
let method = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetCustomer"; |
|
|
|
let method = getCustomer; |
|
|
|
let params = [{ |
|
|
|
"InputValue": inputValue, |
|
|
|
"PageIndex": 0, |
|
|
|
"PageSize": 100 |
|
|
|
}]; |
|
|
|
network.transfer_request(method, params, function (res) { |
|
|
|
network.transfer_request(method, params, function(res) { |
|
|
|
that.setData({ |
|
|
|
currency: res.result, |
|
|
|
customer: res.result |
|
|
|
@ -40,13 +48,13 @@ function GetCustomer(that, inputValue) { |
|
|
|
} |
|
|
|
|
|
|
|
function GetDepartment(that, inputValue) { |
|
|
|
let method = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetDepartment"; |
|
|
|
let method = getDept; |
|
|
|
let params = [{ |
|
|
|
"InputValue": inputValue, |
|
|
|
"PageIndex": 0, |
|
|
|
"PageSize": 100 |
|
|
|
}]; |
|
|
|
network.transfer_request(method, params, function (res) { |
|
|
|
network.transfer_request(method, params, function(res) { |
|
|
|
that.setData({ |
|
|
|
currency: res.result, |
|
|
|
department: res.result |
|
|
|
@ -58,13 +66,13 @@ function GetDepartment(that, inputValue) { |
|
|
|
} |
|
|
|
|
|
|
|
function GetSaleKind(that, v) { |
|
|
|
let method = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetSaleKind"; |
|
|
|
let method = getSaleKind; |
|
|
|
let params = [{ |
|
|
|
"InputValue": v, |
|
|
|
"PageIndex": 0, |
|
|
|
"PageSize": 100 |
|
|
|
}]; |
|
|
|
network.transfer_request(method, params, function (res) { |
|
|
|
network.transfer_request(method, params, function(res) { |
|
|
|
that.setData({ |
|
|
|
currency: res.result, |
|
|
|
saletype: res.result |
|
|
|
@ -78,7 +86,7 @@ function GetSaleKind(that, v) { |
|
|
|
function GetGoodsWithUnitPrice(that, v, date) { |
|
|
|
let unitID = that.data.unit[that.data.isUnit].ID; |
|
|
|
let customerID = that.data.customer[that.data.customerIndex].ID; |
|
|
|
let method = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetGoodsWithUnitPrice"; |
|
|
|
let method = getGoods; |
|
|
|
let params = [{ |
|
|
|
"Input": v, |
|
|
|
"PageIndex": 0, |
|
|
|
@ -87,7 +95,7 @@ function GetGoodsWithUnitPrice(that, v, date) { |
|
|
|
"AccountingUnit_ID": unitID, |
|
|
|
"Date": date |
|
|
|
}]; |
|
|
|
network.transfer_request(method, params, function (res) { |
|
|
|
network.transfer_request(method, params, function(res) { |
|
|
|
that.setData({ |
|
|
|
goods: res.result, |
|
|
|
}) |
|
|
|
@ -144,7 +152,7 @@ Page({ |
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
*/ |
|
|
|
onLoad: function (options) { |
|
|
|
onLoad: function(options) { |
|
|
|
var that = this; |
|
|
|
|
|
|
|
// 获取完整的年月日 时分秒,以及默认显示的数组
|
|
|
|
@ -164,7 +172,7 @@ Page({ |
|
|
|
*/ |
|
|
|
wx.getSystemInfo({ |
|
|
|
|
|
|
|
success: function (res) { |
|
|
|
success: function(res) { |
|
|
|
that.setData({ |
|
|
|
winWidth: res.windowWidth, |
|
|
|
winHeight: res.windowHeight |
|
|
|
@ -177,14 +185,14 @@ Page({ |
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面显示 |
|
|
|
*/ |
|
|
|
onShow: function () { |
|
|
|
onShow: function() { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 滑动切换tab |
|
|
|
*/ |
|
|
|
bindChange: function (e) { |
|
|
|
bindChange: function(e) { |
|
|
|
|
|
|
|
var that = this; |
|
|
|
that.setData({ |
|
|
|
@ -195,7 +203,7 @@ Page({ |
|
|
|
/** |
|
|
|
* 点击tab切换 |
|
|
|
*/ |
|
|
|
swichNav: function (e) { |
|
|
|
swichNav: function(e) { |
|
|
|
|
|
|
|
var that = this; |
|
|
|
|
|
|
|
@ -208,10 +216,10 @@ Page({ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
getAddrs: function (e) { |
|
|
|
getAddrs: function(e) { |
|
|
|
this.data.addrs = e.detail.value; |
|
|
|
}, |
|
|
|
add: function (e) { |
|
|
|
add: function(e) { |
|
|
|
|
|
|
|
let newobj = { |
|
|
|
Goods_Name: "请选择存货" |
|
|
|
@ -225,7 +233,7 @@ Page({ |
|
|
|
obj: aaa, |
|
|
|
}) |
|
|
|
}, |
|
|
|
deleteItem: function (e) { |
|
|
|
deleteItem: function(e) { |
|
|
|
let idx = e.target.dataset.idx; |
|
|
|
let deleteobj = this.data.obj; |
|
|
|
deleteobj.splice(idx, 1) |
|
|
|
@ -234,7 +242,7 @@ Page({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
getGoodsNum: function (e) { |
|
|
|
getGoodsNum: function(e) { |
|
|
|
//值:
|
|
|
|
//e.detail.value
|
|
|
|
//设置的id
|
|
|
|
@ -264,7 +272,7 @@ Page({ |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
getSecondNum: function (e) { |
|
|
|
getSecondNum: function(e) { |
|
|
|
let value = e.detail.value; |
|
|
|
let idx = e.target.dataset.idx; |
|
|
|
|
|
|
|
@ -288,12 +296,12 @@ Page({ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
getPrice: function (e) { |
|
|
|
getPrice: function(e) { |
|
|
|
let value = e.detail.value; |
|
|
|
let idx = e.target.dataset.idx; |
|
|
|
this.data.obj[idx].Price = Number(value); |
|
|
|
}, |
|
|
|
powerDrawer: function (e) { |
|
|
|
powerDrawer: function(e) { |
|
|
|
let that = this; |
|
|
|
let x = e.currentTarget.dataset.x; |
|
|
|
if (x == "会计部门") { |
|
|
|
@ -314,7 +322,7 @@ Page({ |
|
|
|
// }
|
|
|
|
this.util(currentStatu) |
|
|
|
}, |
|
|
|
powerDrawer1: function (e) { |
|
|
|
powerDrawer1: function(e) { |
|
|
|
let that = this; |
|
|
|
let currentStatu = e.currentTarget.dataset.statu; |
|
|
|
|
|
|
|
@ -331,7 +339,7 @@ Page({ |
|
|
|
this.util1(currentStatu) |
|
|
|
|
|
|
|
}, |
|
|
|
itemclick: function (e) { |
|
|
|
itemclick: function(e) { |
|
|
|
var that = this; |
|
|
|
var name = e.currentTarget.dataset.name; |
|
|
|
var id = e.currentTarget.dataset.id; |
|
|
|
@ -360,7 +368,7 @@ Page({ |
|
|
|
showModalStatus: false, |
|
|
|
}) |
|
|
|
}, |
|
|
|
itemclick1: function (e) { |
|
|
|
itemclick1: function(e) { |
|
|
|
var that = this; |
|
|
|
var name = e.currentTarget.dataset.name; |
|
|
|
var id = e.currentTarget.dataset.data.SaleGoods_ID; |
|
|
|
@ -388,7 +396,7 @@ Page({ |
|
|
|
obj: that.data.obj |
|
|
|
}) |
|
|
|
}, |
|
|
|
select: function (e) { |
|
|
|
select: function(e) { |
|
|
|
var that = this; |
|
|
|
var which = e.currentTarget.dataset.item; |
|
|
|
var value = e.detail.value; |
|
|
|
@ -402,14 +410,14 @@ Page({ |
|
|
|
GetSaleKind(that, value) |
|
|
|
} |
|
|
|
}, |
|
|
|
select1: function (e) { |
|
|
|
select1: function(e) { |
|
|
|
var that = this; |
|
|
|
var value = e.detail.value; |
|
|
|
let timestamp = Date.parse(new Date()); |
|
|
|
let date = "/Date(" + timestamp + "+0800)/"; |
|
|
|
GetGoodsWithUnitPrice(that, value, date) |
|
|
|
}, |
|
|
|
submitForm: function () { |
|
|
|
submitForm: function() { |
|
|
|
let unitID = this.data.unit[this.data.isUnit].ID; |
|
|
|
let customerID = this.data.customer[this.data.customerIndex].ID; |
|
|
|
let departmentID = this.data.department[this.data.departmentIndex].ID; |
|
|
|
@ -491,7 +499,7 @@ Page({ |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let method = '/MainSystem/B3MiniProgramRpc/Rpcs/EmployeeRpc/SaleForecastRpc/Insert'; |
|
|
|
let method = insert; |
|
|
|
let params = [{ |
|
|
|
"Customer_ID": customerID, |
|
|
|
// "LoadTime": update,
|
|
|
|
@ -504,20 +512,19 @@ Page({ |
|
|
|
"Details": detailsArray |
|
|
|
|
|
|
|
}]; |
|
|
|
network.transfer_request(method, params, function (res) { |
|
|
|
network.transfer_request(method, params, function(res) { |
|
|
|
if (res.result != null) { |
|
|
|
wx.showModal({ |
|
|
|
title: '新建订单No.' + res.result, |
|
|
|
content: '新建成功,是否返回首页', |
|
|
|
success: function (res) { |
|
|
|
if (res.cancel) { |
|
|
|
} else { |
|
|
|
success: function(res) { |
|
|
|
if (res.cancel) {} else { |
|
|
|
wx.navigateBack({ |
|
|
|
delta: 1 |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
fail: function (res) { } |
|
|
|
fail: function(res) {} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
@ -529,7 +536,7 @@ Page({ |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
util: function (currentStatu) { |
|
|
|
util: function(currentStatu) { |
|
|
|
/* 动画部分 */ |
|
|
|
// 第1步:创建动画实例
|
|
|
|
var animation = wx.createAnimation({ |
|
|
|
@ -550,7 +557,7 @@ Page({ |
|
|
|
}) |
|
|
|
|
|
|
|
// 第5步:设置定时器到指定时候后,执行第二组动画
|
|
|
|
setTimeout(function () { |
|
|
|
setTimeout(function() { |
|
|
|
// 执行第二组动画
|
|
|
|
animation.opacity(1).rotateX(0).step(); |
|
|
|
// 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象
|
|
|
|
@ -577,7 +584,7 @@ Page({ |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
util1: function (currentStatu) { |
|
|
|
util1: function(currentStatu) { |
|
|
|
/* 动画部分 */ |
|
|
|
// 第1步:创建动画实例
|
|
|
|
var animation = wx.createAnimation({ |
|
|
|
@ -598,7 +605,7 @@ Page({ |
|
|
|
}) |
|
|
|
|
|
|
|
// 第5步:设置定时器到指定时候后,执行第二组动画
|
|
|
|
setTimeout(function () { |
|
|
|
setTimeout(function() { |
|
|
|
// 执行第二组动画
|
|
|
|
animation.opacity(1).rotateX(0).step(); |
|
|
|
// 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象
|
|
|
|
|