From 0283efebdf4050f6613e00e62c1a21e83e323fce Mon Sep 17 00:00:00 2001
From: yibo <361071264@qq.com>
Date: Mon, 3 Dec 2018 10:43:13 +0800
Subject: [PATCH] .
---
pages/order/detail/detail.wxml | 2 +-
pages/order/newBill/newBill.js | 73 ++++++++++++++++++----------------
2 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/pages/order/detail/detail.wxml b/pages/order/detail/detail.wxml
index 8fcacf6..48ba0dd 100644
--- a/pages/order/detail/detail.wxml
+++ b/pages/order/detail/detail.wxml
@@ -139,7 +139,7 @@
-
+
diff --git a/pages/order/newBill/newBill.js b/pages/order/newBill/newBill.js
index 3600156..9985bdb 100644
--- a/pages/order/newBill/newBill.js
+++ b/pages/order/newBill/newBill.js
@@ -22,8 +22,8 @@ let insert = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/Insert'
function setTime(that) {
// 精确到分的处理,将数组的秒去掉
var obj1 = dateTimePicker.dateTimePicker(2018, 2030);
- var lastArray =obj1.dateTimeArray.pop();
- var lastTime =obj1.dateTime.pop();
+ var lastArray = obj1.dateTimeArray.pop();
+ var lastTime = obj1.dateTime.pop();
that.setData({
dateTimeArray1: obj1.dateTimeArray,
@@ -34,21 +34,21 @@ function setTime(that) {
}
function GetBaseInfoList(that, method, params) {
- network.transfer_request(method, params, function (res) {
+ network.transfer_request(method, params, function(res) {
that.setData({
currency: res.result
});
});
}
-function GetGoodsInfo(that,dmo, detail) {
+function GetGoodsInfo(that, dmo, detail) {
var params = [{
"Goods_ID": detail.SaleGoods_ID,
"Customer_ID": dmo.Customer_ID,
"AccountingUnit_ID": dmo.AccountingUnit_ID,
"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_UnitConvertDirection = res.result.Goods_UnitConvertDirection;
detail.Goods_MainUnitRatio = res.result.Goods_MainUnitRatio;
@@ -70,15 +70,18 @@ function GetGoodsInfo(that,dmo, detail) {
});
}
-function GetCustomerInfo(that,dmo) {
+function GetCustomerInfo(that, dmo) {
var params = [dmo.Customer_ID, ["Department_ID", "Department_Name", "Employee_ID", "Employee_Name", "TakeGoods_Type", "Address"]]
- network.transfer_request(getCustomerInfo, params, function (res) {
+ network.transfer_request(getCustomerInfo, params, function(res) {
var obj = JSON.parse(res.result);
dmo.Department_ID = obj.Department_ID;
dmo.Department_Name = obj.Department_Name;
dmo.Employee_ID = obj.Employee_ID;
dmo.Employee_Name = obj.Employee_Name;
- dmo.TakeGoods_Type = obj.TakeGoods_Type;
+ if (obj.TakeGoods_Type != null)
+ dmo.TakeGoods_Type = obj.TakeGoods_Type.Name;
+ else
+ dmo.TakeGoods_Type = "";
dmo.DeliverAddress = obj.Address;
that.setData({
dmo: dmo
@@ -94,13 +97,13 @@ Page({
which: '',
rowIdx: -1,
dmo: {
- Details:[],
+ Details: [],
},
dateTimeArray1: null,
dateTime1: null
},
- onLoad: function (options) {
+ onLoad: function(options) {
var that = this;
setTime(that)
},
@@ -108,7 +111,7 @@ Page({
/**
* 滑动切换tab
*/
- bindChange: function (e) {
+ bindChange: function(e) {
this.setData({
currentTab: e.detail.current
});
@@ -116,7 +119,7 @@ Page({
/**
* 点击tab切换
*/
- swichNav: function (e) {
+ swichNav: function(e) {
if (this.data.currentTab === e.target.dataset.current) {
return false;
} else {
@@ -134,7 +137,7 @@ Page({
},
// 添加一个时间转换
- timeConversion: function () {
+ timeConversion: function() {
let year = this.data.dateTimeArray1[0][this.data.dateTime1[0]]
let month = this.data.dateTimeArray1[1][this.data.dateTime1[1]]
let date = this.data.dateTimeArray1[2][this.data.dateTime1[2]]
@@ -148,21 +151,21 @@ Page({
dmo: this.data.dmo,
})
},
- getAddrs: function (e) {
+ getAddrs: function(e) {
this.data.dmo.DeliverAddress = e.detail.value;
this.setData({
dmo: this.data.dmo
});
},
- getRemark: function (e) {
+ getRemark: function(e) {
this.data.dmo.Remark = e.detail.value;
this.setData({
dmo: this.data.dmo
});
},
- powerDrawer: function (e) {
+ powerDrawer: function(e) {
let x = e.currentTarget.dataset.x;
if (x == "存货") {
var dmo = this.data.dmo;
@@ -186,13 +189,13 @@ Page({
},
// 遮罩存货输入框
- select: function (e) {
+ select: function(e) {
var value = e.detail.value;
var x = this.data.whicwhichh;
this.showDialog(x, value);
},
- showDialog: function (x, value) {
+ showDialog: function(x, value) {
var method = null;
let params = [{
"InputValue": value,
@@ -229,11 +232,11 @@ Page({
GetBaseInfoList(this, method, params);
},
- dialogClose: function (e) {
+ dialogClose: function(e) {
this.util();
},
- itemclick: function (e) {
+ itemclick: function(e) {
var flag = true;
var x = this.data.which;
var item = e.currentTarget.dataset.item;
@@ -242,8 +245,8 @@ Page({
case "购货客户":
dmo.Customer_ID = item.ID;
dmo.Customer_Name = item.Name;
- flag =false;
- GetCustomerInfo(this,dmo);
+ flag = false;
+ GetCustomerInfo(this, dmo);
break;
case "会计部门":
dmo.AccountingUnit_ID = item.ID;
@@ -274,7 +277,7 @@ Page({
detail.SaleGoods_ID = item.ID;
detail.Goods_Name = item.Name;
flag = false;
- GetGoodsInfo(this,dmo, detail);
+ GetGoodsInfo(this, dmo, detail);
break;
}
if (flag) {
@@ -285,7 +288,7 @@ Page({
this.util();
},
- getGoodsNum: function (e) {
+ getGoodsNum: function(e) {
let idx = e.target.dataset.idx;
var detail = this.data.dmo.Details[idx];
let value = Number(e.detail.value);
@@ -307,7 +310,7 @@ Page({
})
},
- getSecondNum: function (e) {
+ getSecondNum: function(e) {
let idx = e.target.dataset.idx;
var detail = this.data.dmo.Details[idx];
let value = Number(e.detail.value);
@@ -330,7 +333,7 @@ Page({
},
//
- getPrice: function (e) {
+ getPrice: function(e) {
let idx = e.target.dataset.idx;
let value = Number(e.detail.value);
if (isNaN(value)) {
@@ -346,7 +349,7 @@ Page({
},
// 删除
- deleteItem: function (e) {
+ deleteItem: function(e) {
let idx = e.target.dataset.idx;
this.data.dmo.Details.splice(idx, 1)
this.setData({
@@ -355,7 +358,7 @@ Page({
},
// 点击添加存货
- add: function (e) {
+ add: function(e) {
let newobj = {};
this.data.dmo.Details.push(newobj);
this.setData({
@@ -364,7 +367,7 @@ Page({
},
// 提交
- submitForm: function () {
+ submitForm: function() {
var dmo = this.data.dmo;
if (dmo.Customer_ID == null) {
wx.showToast({
@@ -458,25 +461,25 @@ Page({
"ID": dmo.ID
}];
- 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.confirm){
+ success: function(res) {
+ if (res.confirm) {
wx.navigateBack({
delta: 1
})
}
},
- fail: function (res) { }
+ fail: function(res) {}
})
}
})
},
- util: function () {
+ util: function() {
/* 动画部分 */
// 第1步:创建动画实例
var animation = wx.createAnimation({
@@ -493,7 +496,7 @@ Page({
animationData: animation.export()
})
// 第5步:设置定时器到指定时候后,执行第二组动画
- setTimeout(function () {
+ setTimeout(function() {
// 执行第二组动画
animation.opacity(1).rotateX(0).step();
// 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象