|
|
|
@ -10,7 +10,10 @@ var getAccountingUnit = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetAccoun |
|
|
|
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 getSaleKind = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetSaleKind"; |
|
|
|
var getEmployee = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetEmployee"; |
|
|
|
var getStore = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetStore" |
|
|
|
var getTakeGoodsType = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetTakeGoods_Type" |
|
|
|
|
|
|
|
var load = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/Load"; |
|
|
|
let update = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/Update'; |
|
|
|
@ -100,6 +103,57 @@ function GetSaleKind(that, v) { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
function GetEmployee(that, v) { |
|
|
|
let method = getEmployee; |
|
|
|
let params = [{ |
|
|
|
"InputValue": v, |
|
|
|
"PageIndex": 0, |
|
|
|
"PageSize": 100 |
|
|
|
}]; |
|
|
|
network.transfer_request(method, params, function (res) { |
|
|
|
that.setData({ |
|
|
|
currency: res.result, |
|
|
|
employee: res.result |
|
|
|
}) |
|
|
|
}) |
|
|
|
that.setData({ |
|
|
|
which: "业务员" |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
function GetStore(that, v) { |
|
|
|
let method = getStore; |
|
|
|
let params = [{ |
|
|
|
"InputValue": v, |
|
|
|
"PageIndex": 0, |
|
|
|
"PageSize": 100 |
|
|
|
}]; |
|
|
|
network.transfer_request(method, params, function (res) { |
|
|
|
that.setData({ |
|
|
|
currency: res.result, |
|
|
|
store: res.result |
|
|
|
}) |
|
|
|
}) |
|
|
|
that.setData({ |
|
|
|
which: "仓库" |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
function GetTakeGoodsType(that, v) { |
|
|
|
let method = getTakeGoodsType; |
|
|
|
let params = []; |
|
|
|
network.transfer_request(method, params, function (res) { |
|
|
|
console.log(res); |
|
|
|
that.setData({ |
|
|
|
currency: res.result, |
|
|
|
takeGoodsType: res.result |
|
|
|
}) |
|
|
|
}) |
|
|
|
that.setData({ |
|
|
|
which: "配送方式" |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
function GetGoodsWithUnitPrice(that, v, date) { |
|
|
|
let unitID = that.data.unit[that.data.isUnit].ID; |
|
|
|
let customerID = that.data.customer[that.data.customerIndex].ID; |
|
|
|
@ -157,7 +211,23 @@ Page({ |
|
|
|
ID: 0, |
|
|
|
Name: "请选择会计单位" |
|
|
|
}], |
|
|
|
addrs: "", |
|
|
|
empIndex: 0, |
|
|
|
employee: [{ |
|
|
|
ID: 0, |
|
|
|
Name: "请选择业务员" |
|
|
|
}], |
|
|
|
storeIndex: 0, |
|
|
|
store: [{ |
|
|
|
ID: 0, |
|
|
|
Name: "请选择仓库" |
|
|
|
}], |
|
|
|
takeGoodsTypeIndex: 0, |
|
|
|
takeGoodsType: [{ |
|
|
|
ID: 0, |
|
|
|
Name: "请选择配送方式" |
|
|
|
}], |
|
|
|
addrs: "", |
|
|
|
remark: "", |
|
|
|
dateTimeArray1: null, |
|
|
|
dateTime1: null, |
|
|
|
startYear: 2018, |
|
|
|
@ -194,9 +264,24 @@ Page({ |
|
|
|
let saletypeOld =[{ |
|
|
|
ID: res.result.SaleKind_ID, |
|
|
|
Name: res.result.SaleKind_Name |
|
|
|
}] |
|
|
|
|
|
|
|
let employeeOld = [{ |
|
|
|
ID: res.result.Employee_ID, |
|
|
|
Name: res.result.Employee_Name |
|
|
|
}] |
|
|
|
|
|
|
|
let storeOld = [{ |
|
|
|
ID: res.result.Store_ID, |
|
|
|
Name: res.result.Store_Name |
|
|
|
}] |
|
|
|
|
|
|
|
let takeGoodsTypeOld = [{ |
|
|
|
Name: res.result.TakeGoods_Type |
|
|
|
}] |
|
|
|
|
|
|
|
let addrrrr = res.result.DeliverAddress |
|
|
|
let remark=res.result.Remark |
|
|
|
let loadtimee = timechage.formatTimeTwo(res.result.LoadTime.substring(6, 19), 'Y-M-D h:m') |
|
|
|
|
|
|
|
let details=[]; |
|
|
|
@ -230,7 +315,11 @@ Page({ |
|
|
|
unit: unitOld, |
|
|
|
department: departmentOld, |
|
|
|
saletype: saletypeOld, |
|
|
|
employee:employeeOld, |
|
|
|
store:storeOld, |
|
|
|
takeGoodsType:takeGoodsTypeOld, |
|
|
|
addrs: addrrrr, |
|
|
|
remark: remark, |
|
|
|
loadTime: loadtimee, |
|
|
|
obj: details |
|
|
|
}) |
|
|
|
@ -309,6 +398,9 @@ Page({ |
|
|
|
|
|
|
|
getAddrs: function (e) { |
|
|
|
this.data.addrs = e.detail.value; |
|
|
|
}, |
|
|
|
getRemark: function (e) { |
|
|
|
this.data.remark = e.detail.value; |
|
|
|
}, |
|
|
|
add: function (e) { |
|
|
|
|
|
|
|
@ -403,6 +495,12 @@ Page({ |
|
|
|
GetDepartment(that, "") |
|
|
|
} else if (x == "销售类型") { |
|
|
|
GetSaleKind(that, "") |
|
|
|
} else if (x == "业务员") { |
|
|
|
GetEmployee(that, "") |
|
|
|
} else if (x == "仓库") { |
|
|
|
GetStore(that, "") |
|
|
|
} else if (x == "配送方式") { |
|
|
|
GetTakeGoodsType(that, "") |
|
|
|
} |
|
|
|
let currentStatu = e.currentTarget.dataset.statu; |
|
|
|
this.util(currentStatu) |
|
|
|
@ -447,6 +545,18 @@ Page({ |
|
|
|
that.setData({ |
|
|
|
saletypeIndex: idx |
|
|
|
}) |
|
|
|
} else if (which == "业务员") { |
|
|
|
that.setData({ |
|
|
|
empIndex: idx |
|
|
|
}) |
|
|
|
} else if (which == "仓库") { |
|
|
|
that.setData({ |
|
|
|
storeIndex: idx |
|
|
|
}) |
|
|
|
} else if (which == "配送方式") { |
|
|
|
that.setData({ |
|
|
|
takeGoodsTypeIndex: idx |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
@ -493,6 +603,12 @@ Page({ |
|
|
|
GetDepartment(that, value) |
|
|
|
} else if (which == "销售类型") { |
|
|
|
GetSaleKind(that, value) |
|
|
|
} else if (which == "业务员") { |
|
|
|
GetEmployee(that, value) |
|
|
|
} else if (which == "仓库") { |
|
|
|
GetStore(that, value) |
|
|
|
} else if (which == "配送方式") { |
|
|
|
GetTakeGoodsType(that, value) |
|
|
|
} |
|
|
|
}, |
|
|
|
select1: function (e) { |
|
|
|
@ -507,6 +623,9 @@ Page({ |
|
|
|
let customerID = this.data.customer[this.data.customerIndex].ID; |
|
|
|
let departmentID = this.data.department[this.data.departmentIndex].ID; |
|
|
|
let saletypeID = this.data.saletype[this.data.saletypeIndex].ID; |
|
|
|
let employeeID = this.data.employee[this.data.empIndex].ID; |
|
|
|
let storeID = this.data.store[this.data.storeIndex].ID; |
|
|
|
let takeGoodsTypeName = this.data.takeGoodsType[this.data.takeGoodsTypeIndex].Name; |
|
|
|
|
|
|
|
let year = this.data.dateTimeArray1[0][this.data.dateTime1[0]] |
|
|
|
let month = this.data.dateTimeArray1[1][this.data.dateTime1[1]] |
|
|
|
@ -516,7 +635,7 @@ Page({ |
|
|
|
|
|
|
|
let stringTime = year + "/" + month + "/" + date + " " + hour + ":" + minu + ":00" |
|
|
|
let timestamp2 = Date.parse(new Date(stringTime)); |
|
|
|
let update = "/Date(" + timestamp2 + "+0800)/"; |
|
|
|
let loadTime = "/Date(" + timestamp2 + "+0800)/"; |
|
|
|
|
|
|
|
if (customerID == 0) { |
|
|
|
wx.showToast({ |
|
|
|
@ -537,13 +656,35 @@ Page({ |
|
|
|
}) |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (employeeID == 0) { |
|
|
|
wx.showToast({ |
|
|
|
title: '请选择业务员', |
|
|
|
}) |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (storeID == 0) { |
|
|
|
wx.showToast({ |
|
|
|
title: '请选择仓库', |
|
|
|
}) |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (saletypeID == 0) { |
|
|
|
wx.showToast({ |
|
|
|
title: '请选择销售类型', |
|
|
|
}) |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (takeGoodsTypeName == "") { |
|
|
|
wx.showToast({ |
|
|
|
title: '请选择配送方式', |
|
|
|
}) |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (this.data.addrs == "") { |
|
|
|
wx.showToast({ |
|
|
|
title: '请填写送货地址', |
|
|
|
@ -593,11 +734,15 @@ Page({ |
|
|
|
let method = update; |
|
|
|
let params = [{ |
|
|
|
"Customer_ID": customerID, |
|
|
|
"LoadTime": update, |
|
|
|
"LoadTime": loadTime, |
|
|
|
"AccountingUnit_ID": unitID, |
|
|
|
"Department_ID": departmentID, |
|
|
|
"SaleKind_ID": saletypeID, |
|
|
|
"Employee_ID":employeeID, |
|
|
|
"Store_ID":storeID, |
|
|
|
"TakeGoods_Type":takeGoodsTypeName, |
|
|
|
"DeliverAddress": this.data.addrs, |
|
|
|
"Remark":this.data.remark, |
|
|
|
"Details": detailsArray, |
|
|
|
"ID": orderID |
|
|
|
}]; |
|
|
|
|