yibo 7 years ago
parent
commit
0283efebdf
2 changed files with 39 additions and 36 deletions
  1. +1
    -1
      pages/order/detail/detail.wxml
  2. +38
    -35
      pages/order/newBill/newBill.js

+ 1
- 1
pages/order/detail/detail.wxml View File

@ -139,7 +139,7 @@
<image class="ico" src="/imgs/tianjia.png"></image> <image class="ico" src="/imgs/tianjia.png"></image>
</view> </view>
<button class='submit' catchtap='submitForm'>保存</button>
<button class='submit' catchtap='submitForm' wx:if="{{dmo.BillState=='未审核'}}">保存</button>
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
</swiper> </swiper>


+ 38
- 35
pages/order/newBill/newBill.js View File

@ -22,8 +22,8 @@ let insert = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/Insert'
function setTime(that) { function setTime(that) {
// 精确到分的处理,将数组的秒去掉 // 精确到分的处理,将数组的秒去掉
var obj1 = dateTimePicker.dateTimePicker(2018, 2030); 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({ that.setData({
dateTimeArray1: obj1.dateTimeArray, dateTimeArray1: obj1.dateTimeArray,
@ -34,21 +34,21 @@ 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
}); });
}); });
} }
function GetGoodsInfo(that,dmo, detail) {
function GetGoodsInfo(that, dmo, detail) {
var params = [{ var params = [{
"Goods_ID": detail.SaleGoods_ID, "Goods_ID": detail.SaleGoods_ID,
"Customer_ID": dmo.Customer_ID, "Customer_ID": dmo.Customer_ID,
"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;
@ -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"]] 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); var obj = JSON.parse(res.result);
dmo.Department_ID = obj.Department_ID; dmo.Department_ID = obj.Department_ID;
dmo.Department_Name = obj.Department_Name; dmo.Department_Name = obj.Department_Name;
dmo.Employee_ID = obj.Employee_ID; dmo.Employee_ID = obj.Employee_ID;
dmo.Employee_Name = obj.Employee_Name; 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; dmo.DeliverAddress = obj.Address;
that.setData({ that.setData({
dmo: dmo dmo: dmo
@ -94,13 +97,13 @@ Page({
which: '', which: '',
rowIdx: -1, rowIdx: -1,
dmo: { dmo: {
Details:[],
Details: [],
}, },
dateTimeArray1: null, dateTimeArray1: null,
dateTime1: null dateTime1: null
}, },
onLoad: function (options) {
onLoad: function(options) {
var that = this; var that = this;
setTime(that) setTime(that)
}, },
@ -108,7 +111,7 @@ Page({
/** /**
* 滑动切换tab * 滑动切换tab
*/ */
bindChange: function (e) {
bindChange: function(e) {
this.setData({ this.setData({
currentTab: e.detail.current currentTab: e.detail.current
}); });
@ -116,7 +119,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 {
@ -134,7 +137,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]]
@ -148,21 +151,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;
@ -186,13 +189,13 @@ Page({
}, },
// 遮罩存货输入框 // 遮罩存货输入框
select: function (e) {
select: function(e) {
var value = e.detail.value; var value = e.detail.value;
var x = this.data.whicwhichh; var x = this.data.whicwhichh;
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,
@ -229,11 +232,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;
@ -242,8 +245,8 @@ Page({
case "购货客户": case "购货客户":
dmo.Customer_ID = item.ID; dmo.Customer_ID = item.ID;
dmo.Customer_Name = item.Name; dmo.Customer_Name = item.Name;
flag =false;
GetCustomerInfo(this,dmo);
flag = false;
GetCustomerInfo(this, dmo);
break; break;
case "会计部门": case "会计部门":
dmo.AccountingUnit_ID = item.ID; dmo.AccountingUnit_ID = item.ID;
@ -274,7 +277,7 @@ Page({
detail.SaleGoods_ID = item.ID; detail.SaleGoods_ID = item.ID;
detail.Goods_Name = item.Name; detail.Goods_Name = item.Name;
flag = false; flag = false;
GetGoodsInfo(this,dmo, detail);
GetGoodsInfo(this, dmo, detail);
break; break;
} }
if (flag) { if (flag) {
@ -285,7 +288,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);
@ -307,7 +310,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);
@ -330,7 +333,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)) {
@ -346,7 +349,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({
@ -355,7 +358,7 @@ Page({
}, },
// 点击添加存货 // 点击添加存货
add: function (e) {
add: function(e) {
let newobj = {}; let newobj = {};
this.data.dmo.Details.push(newobj); this.data.dmo.Details.push(newobj);
this.setData({ this.setData({
@ -364,7 +367,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({
@ -458,25 +461,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) {
if (res.confirm){
success: function(res) {
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({
@ -493,7 +496,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();
// 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象 // 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象


Loading…
Cancel
Save