Browse Source

1、添加了跳转要用到的几个字段

2、添加新建界面接口:根据客户对应业务员取仓库及销售类型
master
chenxuhui 7 years ago
parent
commit
1dfcb7b6ae
5 changed files with 74 additions and 52 deletions
  1. +18
    -8
      app.js
  2. +11
    -2
      pages/homePage/homePage.js
  3. +1
    -0
      pages/login/login.js
  4. +42
    -37
      pages/order/newBill/newBill.js
  5. +2
    -5
      pages/order/order.js

+ 18
- 8
app.js View File

@ -8,7 +8,23 @@ App({
} }
}); });
}, },
onShow: function (options) {
var that = this;
var path = options.path;
if (options.query.id) {
wx.reLaunch({
url: '/pages/login/login',
complete: function (res) {
that.globalData.shareInPath = path;
that.globalData.shareInParameter = options.query;
},
});
}
},
globalData: { globalData: {
shareInPath: "",
shareInParameter: {},
shareInState: 1,
winHeight:0, winHeight:0,
cookie: "", cookie: "",
decryptCookie: '', decryptCookie: '',
@ -20,13 +36,7 @@ App({
openID: "", openID: "",
appID: "wx0b897783b2588147", appID: "wx0b897783b2588147",
userID:"", userID:"",
// Phone: "",
// OpenId: "",
// AppName: "WeChat",
// AppId: "wx0b897783b2588147",
// BaseUrl: "https://miniprogram.food988.com/Rest.aspx",
// TranferBaseUrl:"https://miniprogram.food988.com/RequestTransfer.aspx",
// CustomerId:"",
selectStartDate:null,
selectEndDate:null,
}, },
}) })

+ 11
- 2
pages/homePage/homePage.js View File

@ -1,5 +1,5 @@
// pages/homePage/homePage.js // pages/homePage/homePage.js
var app = getApp()
var network = require("../../utils/net.js") var network = require("../../utils/net.js")
var timechage = require("../../utils/dateTimeUtil.js") var timechage = require("../../utils/dateTimeUtil.js")
@ -21,12 +21,21 @@ Page({
var that = this; var that = this;
// 添加接口请求当前余额 // 添加接口请求当前余额
GetUserProfile(function(res) { GetUserProfile(function(res) {
console.log(res);
if (res != null) { if (res != null) {
that.setData({ that.setData({
balance: res.result balance: res.result
}); });
} }
var shareURL = app.globalData.shareInPath;
if (shareURL) {
app.globalData.shareInState = 0,
wx.navigateTo({
url: "../../" + shareURL,
complete: function (res) {
},
})
}
}); });
}, },


+ 1
- 0
pages/login/login.js View File

@ -78,6 +78,7 @@ function setCurrentCustomerID (){
let method = getCurrentID; let method = getCurrentID;
let params = []; let params = [];
network.transfer_request(method, params, function (res) { network.transfer_request(method, params, function (res) {
console.log("当前客户信息==" + res.result);
app.globalData.userID = res.result; app.globalData.userID = res.result;
}) })
} }


+ 42
- 37
pages/order/newBill/newBill.js View File

@ -15,11 +15,9 @@ var getStore = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetStore"
var getTakeGoodsType = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetTakeGoods_Type" var getTakeGoodsType = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetTakeGoods_Type"
var getGoodsDetail = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetGoodsDetailWithPrice" var getGoodsDetail = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetGoodsDetailWithPrice"
var getCustomerInfo = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/GetCustomerRefDto" var getCustomerInfo = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/GetCustomerRefDto"
let insert = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/Insert' let insert = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/Insert'
var getUserPrifile = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/AccountRpc/GetUserPrifile" var getUserPrifile = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/AccountRpc/GetUserPrifile"
var getEmployeePrifile = "/MainSystem/B3MiniProgramRpc/XuRpcs/Customer/AccountRpc/GetEmployeePrifile"
// 获取完整的年月日 时分秒,以及默认显示的数组' // 获取完整的年月日 时分秒,以及默认显示的数组'
function setTime(that) { function setTime(that) {
// 精确到分的处理,将数组的秒去掉 // 精确到分的处理,将数组的秒去掉
@ -36,7 +34,7 @@ function setTime(that) {
} }
function GetBaseInfoList(that, method, params) { function GetBaseInfoList(that, method, params) {
network.transfer_request(method, params, function (res) {
network.transfer_request(method, params, function(res) {
that.setData({ that.setData({
currency: res.result currency: res.result
}); });
@ -50,7 +48,7 @@ function GetGoodsInfo(that, dmo, detail) {
"AccountingUnit_ID": dmo.AccountingUnit_ID, "AccountingUnit_ID": dmo.AccountingUnit_ID,
"Date": dmo.LoadTime, "Date": dmo.LoadTime,
}] }]
network.transfer_request(getGoodsDetail, params, function (res) {
network.transfer_request(getGoodsDetail, params, function(res) {
detail.Goods_SecondUnit = res.result.Goods_SecondUnit; detail.Goods_SecondUnit = res.result.Goods_SecondUnit;
detail.Goods_UnitConvertDirection = res.result.Goods_UnitConvertDirection; detail.Goods_UnitConvertDirection = res.result.Goods_UnitConvertDirection;
detail.Goods_MainUnitRatio = res.result.Goods_MainUnitRatio; detail.Goods_MainUnitRatio = res.result.Goods_MainUnitRatio;
@ -72,9 +70,9 @@ function GetGoodsInfo(that, dmo, detail) {
}); });
} }
function GetCustomerInfo(that, dmo) {
var params = [app.globalData.userID, ["Name","Department_ID", "Department_Name", "Employee_ID", "Employee_Name", "AccountingUnit_ID", "AccountingUnit_Name", "TakeGoods_Type", "Address"]]
network.transfer_request(getCustomerInfo, params, function (res) {
function GetCustomerInfo(that, dmo, succession) {
var params = [app.globalData.userID, ["Name", "Department_ID", "Department_Name", "Employee_ID", "Employee_Name", "AccountingUnit_ID", "AccountingUnit_Name", "TakeGoods_Type", "Address"]]
network.transfer_request(getCustomerInfo, params, function(res) {
var obj = JSON.parse(res.result); var obj = JSON.parse(res.result);
dmo.Customer_ID = app.globalData.userID; dmo.Customer_ID = app.globalData.userID;
dmo.Customer_Name = obj.Name; dmo.Customer_Name = obj.Name;
@ -92,6 +90,7 @@ function GetCustomerInfo(that, dmo) {
that.setData({ that.setData({
dmo: dmo dmo: dmo
}); });
succession();
}); });
} }
@ -110,19 +109,18 @@ Page({
backPage: "", backPage: "",
}, },
onLoad: function (options) {
onLoad: function(options) {
var that = this; var that = this;
var dmo = this.data.dmo; var dmo = this.data.dmo;
setTime(that); setTime(that);
this.getUserPrifile(function(res){
GetCustomerInfo(that, dmo);
GetCustomerInfo(that, dmo, function(res) {
that.getEmployeePrifile();
}); });
}, },
getUserPrifile: function (succession) {
getEmployeePrifile: function() {
var that = this; var that = this;
network.transfer_request(getUserPrifile, [], function (res) {
succession();
network.transfer_request(getEmployeePrifile, [this.data.dmo.Employee_ID], function(res) {
that.data.dmo.SaleKind_ID = res.result.Order_SaleKind_ID; that.data.dmo.SaleKind_ID = res.result.Order_SaleKind_ID;
that.data.dmo.SaleKind_Name = res.result.Order_SaleKind_Name; that.data.dmo.SaleKind_Name = res.result.Order_SaleKind_Name;
that.data.dmo.Store_ID = res.result.Order_Store_ID; that.data.dmo.Store_ID = res.result.Order_Store_ID;
@ -133,7 +131,7 @@ Page({
}); });
}, },
onShow: function () {
onShow: function() {
var that = this; var that = this;
if (this.data.backPage == "goodsNameChoosePage") { if (this.data.backPage == "goodsNameChoosePage") {
var goodsArr = app.globalData.goodsNameArray; var goodsArr = app.globalData.goodsNameArray;
@ -156,7 +154,7 @@ Page({
/** /**
* 滑动切换tab * 滑动切换tab
*/ */
bindChange: function (e) {
bindChange: function(e) {
this.setData({ this.setData({
currentTab: e.detail.current currentTab: e.detail.current
}); });
@ -164,7 +162,7 @@ Page({
/** /**
* 点击tab切换 * 点击tab切换
*/ */
swichNav: function (e) {
swichNav: function(e) {
if (this.data.currentTab === e.target.dataset.current) { if (this.data.currentTab === e.target.dataset.current) {
return false; return false;
} else { } else {
@ -182,7 +180,7 @@ Page({
}, },
// 添加一个时间转换 // 添加一个时间转换
timeConversion: function () {
timeConversion: function() {
let year = this.data.dateTimeArray1[0][this.data.dateTime1[0]] let year = this.data.dateTimeArray1[0][this.data.dateTime1[0]]
let month = this.data.dateTimeArray1[1][this.data.dateTime1[1]] let month = this.data.dateTimeArray1[1][this.data.dateTime1[1]]
let date = this.data.dateTimeArray1[2][this.data.dateTime1[2]] let date = this.data.dateTimeArray1[2][this.data.dateTime1[2]]
@ -196,21 +194,21 @@ Page({
dmo: this.data.dmo, dmo: this.data.dmo,
}) })
}, },
getAddrs: function (e) {
getAddrs: function(e) {
this.data.dmo.DeliverAddress = e.detail.value; this.data.dmo.DeliverAddress = e.detail.value;
this.setData({ this.setData({
dmo: this.data.dmo dmo: this.data.dmo
}); });
}, },
getRemark: function (e) {
getRemark: function(e) {
this.data.dmo.Remark = e.detail.value; this.data.dmo.Remark = e.detail.value;
this.setData({ this.setData({
dmo: this.data.dmo dmo: this.data.dmo
}); });
}, },
powerDrawer: function (e) {
powerDrawer: function(e) {
let x = e.currentTarget.dataset.x; let x = e.currentTarget.dataset.x;
if (x == "存货") { if (x == "存货") {
var dmo = this.data.dmo; var dmo = this.data.dmo;
@ -234,13 +232,13 @@ Page({
}, },
// 遮罩存货输入框 // 遮罩存货输入框
select: function (e) {
select: function(e) {
var value = e.detail.value; var value = e.detail.value;
var x = this.data.which; var x = this.data.which;
this.showDialog(x, value); this.showDialog(x, value);
}, },
showDialog: function (x, value) {
showDialog: function(x, value) {
var method = null; var method = null;
let params = [{ let params = [{
"InputValue": value, "InputValue": value,
@ -277,11 +275,11 @@ Page({
GetBaseInfoList(this, method, params); GetBaseInfoList(this, method, params);
}, },
dialogClose: function (e) {
dialogClose: function(e) {
this.util(); this.util();
}, },
itemclick: function (e) {
itemclick: function(e) {
var flag = true; var flag = true;
var x = this.data.which; var x = this.data.which;
var item = e.currentTarget.dataset.item; var item = e.currentTarget.dataset.item;
@ -333,7 +331,7 @@ Page({
this.util(); this.util();
}, },
getGoodsNum: function (e) {
getGoodsNum: function(e) {
let idx = e.target.dataset.idx; let idx = e.target.dataset.idx;
var detail = this.data.dmo.Details[idx]; var detail = this.data.dmo.Details[idx];
let value = Number(e.detail.value); let value = Number(e.detail.value);
@ -355,7 +353,7 @@ Page({
}) })
}, },
getSecondNum: function (e) {
getSecondNum: function(e) {
let idx = e.target.dataset.idx; let idx = e.target.dataset.idx;
var detail = this.data.dmo.Details[idx]; var detail = this.data.dmo.Details[idx];
let value = Number(e.detail.value); let value = Number(e.detail.value);
@ -378,7 +376,7 @@ Page({
}, },
// //
getPrice: function (e) {
getPrice: function(e) {
let idx = e.target.dataset.idx; let idx = e.target.dataset.idx;
let value = Number(e.detail.value); let value = Number(e.detail.value);
if (isNaN(value)) { if (isNaN(value)) {
@ -394,7 +392,7 @@ Page({
}, },
// 删除 // 删除
deleteItem: function (e) {
deleteItem: function(e) {
let idx = e.target.dataset.idx; let idx = e.target.dataset.idx;
this.data.dmo.Details.splice(idx, 1) this.data.dmo.Details.splice(idx, 1)
this.setData({ this.setData({
@ -403,7 +401,7 @@ Page({
}, },
// 点击添加存货 // 点击添加存货
add: function (e) {
add: function(e) {
// 新增获取存货 // 新增获取存货
var dmo = this.data.dmo; var dmo = this.data.dmo;
if (dmo.Customer_ID == null) { if (dmo.Customer_ID == null) {
@ -424,7 +422,7 @@ Page({
}, },
// 提交 // 提交
submitForm: function () {
submitForm: function() {
var dmo = this.data.dmo; var dmo = this.data.dmo;
if (dmo.Customer_ID == null) { if (dmo.Customer_ID == null) {
wx.showToast({ wx.showToast({
@ -475,7 +473,7 @@ Page({
return; return;
} }
*/ */
// if (dmo.DeliverAddress == "") { // if (dmo.DeliverAddress == "") {
// wx.showToast({ // wx.showToast({
// title: '请填写送货地址', // title: '请填写送货地址',
@ -483,6 +481,13 @@ Page({
// return; // return;
// } // }
if (dmo.Details.length <= 0) {
wx.showToast({
title: '存货不能为空',
})
return;
}
for (var i = 0; i < dmo.Details.length; i++) { for (var i = 0; i < dmo.Details.length; i++) {
if (dmo.Details[i].SaleGoods_ID == null) { if (dmo.Details[i].SaleGoods_ID == null) {
wx.showToast({ wx.showToast({
@ -515,25 +520,25 @@ Page({
"ID": dmo.ID "ID": dmo.ID
}]; }];
network.transfer_request(method, params, function (res) {
network.transfer_request(method, params, function(res) {
if (res.result != null) { if (res.result != null) {
wx.showModal({ wx.showModal({
title: '新建订单No.' + res.result, title: '新建订单No.' + res.result,
content: '新建成功,是否返回首页', content: '新建成功,是否返回首页',
success: function (res) {
success: function(res) {
if (res.confirm) { if (res.confirm) {
wx.navigateBack({ wx.navigateBack({
delta: 1 delta: 1
}) })
} }
}, },
fail: function (res) { }
fail: function(res) {}
}) })
} }
}) })
}, },
util: function () {
util: function() {
/* 动画部分 */ /* 动画部分 */
// 第1步:创建动画实例 // 第1步:创建动画实例
var animation = wx.createAnimation({ var animation = wx.createAnimation({
@ -550,7 +555,7 @@ Page({
animationData: animation.export() animationData: animation.export()
}) })
// 第5步:设置定时器到指定时候后,执行第二组动画 // 第5步:设置定时器到指定时候后,执行第二组动画
setTimeout(function () {
setTimeout(function() {
// 执行第二组动画 // 执行第二组动画
animation.opacity(1).rotateX(0).step(); animation.opacity(1).rotateX(0).step();
// 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象 // 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象


+ 2
- 5
pages/order/order.js View File

@ -9,7 +9,7 @@ var getListPath = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/GetList
var deleteItem = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/Delete" var deleteItem = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/Delete"
// 未审核订单列表 // 未审核订单列表
function getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, successaction) {
function getUnCheckOrderList(that, UnCheckPageIndex, PageSize, successaction) {
let getArr = []; let getArr = [];
let method = getListPath; let method = getListPath;
let params = [{ let params = [{
@ -49,7 +49,7 @@ function getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, successact
} }
// 已审核订单列表 // 已审核订单列表
function getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize) {
function getCheckedOrderList(that, CheckedPageIndex, PageSize) {
let getArr = []; let getArr = [];
let method = getListPath; let method = getListPath;
@ -144,9 +144,6 @@ Page({
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function() { onUnload: function() {
PageSize = 10
app.globalData.selectCustomer_ID = null
app.globalData.selectStartDate = null app.globalData.selectStartDate = null
app.globalData.selectEndDate = null app.globalData.selectEndDate = null


Loading…
Cancel
Save