diff --git a/app.json b/app.json
index 99582cb..1bc33e5 100644
--- a/app.json
+++ b/app.json
@@ -21,7 +21,8 @@
"pages/saleOutStore/outStoreDetail/outStoreDetail",
"pages/debitNoteList/debitNoteList",
"pages/debitNoteList/debitNoteDetail/debitNoteDetail",
- "pages/debitNoteList/debitNoteQuery/debitNoteQuery"
+ "pages/debitNoteList/debitNoteQuery/debitNoteQuery",
+ "pages/goodaNameChooseTemplate/goodaNameChooseTemplate"
],
"window": {
"backgroundTextStyle": "light",
diff --git a/pages/goodaNameChooseTemplate/goodaNameChooseTemplate.js b/pages/goodaNameChooseTemplate/goodaNameChooseTemplate.js
new file mode 100644
index 0000000..9c8abb1
--- /dev/null
+++ b/pages/goodaNameChooseTemplate/goodaNameChooseTemplate.js
@@ -0,0 +1,214 @@
+// pages/goodaNameChooseTemplate/goodaNameChooseTemplate.js
+var app = getApp()
+var network = require("../../utils/net.js")
+var dateTimePicker = require('../../utils/dateTimePicker.js');
+var utilll = require('../../utils/util.js');
+
+var unitID = null;
+var customerID = null;
+
+var getGoods = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetGoodsWithUnitPrice";
+
+Page({
+
+ data: {
+ winHeight: app.globalData.winHeight,
+ currentTab: 0,
+ collectionArray: [],
+ goodsArray: [],
+ checkBoxArray: [],
+ storageCheckBoxArray: [],
+ },
+
+ getGoodsNameBySearchString: function (event){
+ var searchString = event.detail.value;
+ this.GetGoodsWithUnitPrice(unitID, customerID, searchString);
+
+ },
+
+ GetGoodsWithUnitPrice: function(unitID, customerID, searchString) {
+ var that = this;
+ let timestamp = Date.parse(new Date());
+ let date = "/Date(" + timestamp + "+0800)/";
+ let method = getGoods;
+ let params = [{
+ "Input": searchString,
+ "PageIndex": 0,
+ "PageSize": 100,
+ "Customer_ID": parseInt(customerID),
+ "AccountingUnit_ID": parseInt(unitID),
+ "Date": date
+ }];
+ network.transfer_request(method, params, function(res) {
+ that.setData({
+ goodsArray: res.result,
+ })
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ // 根据客户id和会计单位获取存货及价格
+ var that = this;
+ unitID = options.unitID;
+ customerID = options.customerID;
+ this.GetGoodsWithUnitPrice(unitID, customerID, "");
+ // 获取收藏的存货信息
+ wx.getStorage({
+ key: 'storageGoodsKey',
+ success(res) {
+ console.log(res.data);
+ if (res.data.length > 0) {
+ that.setData({
+ collectionArray: res.data,
+ })
+ }
+ }
+ })
+ },
+
+ storegeBtnClick: function() {
+ var that = this;
+
+ // 获取收藏的存货信息
+ var oldCollectionArr = this.data.collectionArray;
+ var waitStorageArr = this.data.checkBoxArray;
+ var goodsNameArrayAll = this.data.goodsArray;
+
+ if (waitStorageArr.length <= 0) {
+ wx.showToast({
+ title: '请选择存货',
+ })
+ return;
+ } else {
+
+ // 对比所选存货是否已经存在于收藏中 有:不重复添加 返回未添加过的数组
+ for (var i = 0; i < waitStorageArr.length; i++) {
+ for (var j = 0; j < oldCollectionArr.length; j++) {
+ if (Number(waitStorageArr[i]) == Number(oldCollectionArr[j].SaleGoods_ID)) {
+ waitStorageArr.splice(i, 1);
+ }
+ }
+ }
+
+ // 对比原有数组和选中的数组 存在,将数组包含的其他值也取出加载
+ let choseCheck = [];
+ for (var i = 0; i < that.data.goodsArray.length; i++) {
+ for (var j = 0; j < waitStorageArr.length; j++) {
+ if (Number(goodsNameArrayAll[i].SaleGoods_ID) == waitStorageArr[j]) {
+ choseCheck.push(goodsNameArrayAll[i])
+ }
+ }
+ }
+ oldCollectionArr = oldCollectionArr.concat(choseCheck);
+ that.setData({
+ collectionArray: oldCollectionArr,
+ currentTab: 1,
+ });
+ wx.setStorage({
+ key: "storageGoodsKey",
+ data: oldCollectionArr,
+ success: function() {
+ wx.showToast({
+ title: '收藏成功',
+ });
+ },
+ })
+ }
+ },
+
+
+ // 多选框数值变化
+ checkboxValueChange: function(e) {
+ this.setData({
+ checkBoxArray: e.detail.value,
+ })
+ },
+
+ // 收藏夹页面多选框值变化
+ storageCheckboxValueChange:function (e){
+ this.setData({
+ storageCheckBoxArray: e.detail.value,
+ })
+ },
+
+ // 收藏夹点击添加存货明细按钮 存数据进入global
+ storageAddGoodsNameArrayBack: function () {
+ let choseCheck = []
+ // 对比原有数组和选中的数组 存在,将数组包含的其他值也取出加载
+ for (var i = 0; i < this.data.collectionArray.length; i++) {
+ for (var j = 0; j < this.data.storageCheckBoxArray.length; j++) {
+ if (Number(this.data.collectionArray[i].SaleGoods_ID) == this.data.storageCheckBoxArray[j]) {
+ choseCheck.push(this.data.collectionArray[i])
+ }
+ }
+ }
+ app.globalData.goodsNameArray = choseCheck;
+
+ var pages = getCurrentPages();
+ var currPage = pages[pages.length - 1]; //当前页面
+ var prevPage = pages[pages.length - 2]; //上一个页面
+ //直接调用上一个页面对象的setData()方法,把数据存到上一个页面中去
+ prevPage.setData({
+ backPage: "goodsNameChoosePage",
+ });
+
+ wx.navigateBack({
+ delta: 1,
+ })
+ },
+
+ // 全部页面点击添加存货明细按钮 存数据进入global
+ addGoodsName: function() {
+ let choseCheck = []
+ // 对比原有数组和选中的数组 存在,将数组包含的其他值也取出加载
+ for (var i = 0; i < this.data.goodsArray.length; i++) {
+ for (var j = 0; j < this.data.checkBoxArray.length; j++) {
+ if (Number(this.data.goodsArray[i].SaleGoods_ID) == this.data.checkBoxArray[j]) {
+ choseCheck.push(this.data.goodsArray[i])
+ }
+ }
+ }
+ app.globalData.goodsNameArray = choseCheck;
+
+ var pages = getCurrentPages();
+ var currPage = pages[pages.length - 1]; //当前页面
+ var prevPage = pages[pages.length - 2]; //上一个页面
+ //直接调用上一个页面对象的setData()方法,把数据存到上一个页面中去
+ prevPage.setData({
+ backPage: "goodsNameChoosePage",
+ });
+
+ wx.navigateBack({
+ delta: 1,
+ })
+ },
+
+ /**
+ * 滑动切换tab
+ */
+ bindChange: function(e) {
+ var that = this;
+ that.setData({
+ currentTab: e.detail.current
+ });
+
+ },
+
+ /**
+ * 点击tab切换
+ */
+ swichNav: function(e) {
+ var that = this;
+ if (this.data.currentTab === e.target.dataset.current) {
+ return false;
+ } else {
+ that.setData({
+ currentTab: e.target.dataset.current
+ })
+ }
+ },
+
+})
\ No newline at end of file
diff --git a/pages/goodaNameChooseTemplate/goodaNameChooseTemplate.json b/pages/goodaNameChooseTemplate/goodaNameChooseTemplate.json
new file mode 100644
index 0000000..5db69ff
--- /dev/null
+++ b/pages/goodaNameChooseTemplate/goodaNameChooseTemplate.json
@@ -0,0 +1,5 @@
+{
+ "navigationBarBackgroundColor": "white",
+ "navigationBarTextStyle": "black",
+ "navigationBarTitleText": "存货列表"
+}
\ No newline at end of file
diff --git a/pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxml b/pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxml
new file mode 100644
index 0000000..604498d
--- /dev/null
+++ b/pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxml
@@ -0,0 +1,48 @@
+
+
+
+ 全部
+ 收藏夹
+
+
+
+
+
+
+
+ 收藏
+
+
+
+
+
+
+
+
+
+
+ 添加存货明细
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 添加存货明细
+
+
+
+
+
+ {{item.Goods_Name}}
+
+
+
+
\ No newline at end of file
diff --git a/pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxss b/pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxss
new file mode 100644
index 0000000..56aa0e7
--- /dev/null
+++ b/pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxss
@@ -0,0 +1,121 @@
+/* pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxss */
+page{
+ background:#EFEFF6;
+ height: 100%;
+}
+
+.swiper-tab {
+ width: 100%;
+ height: 45px;
+ top: 0;
+ text-align: center;
+ line-height: 45px;
+ background: white;
+ display: flex;
+ flex-direction: row;
+ justify-content: space-around;
+ border-top: 2rpx solid #ece7e7;
+ border-bottom: 0.2rpx solid rgb(236, 231, 231);
+}
+
+.swiper-tab-list {
+ font-size: 30rpx;
+ width: 25%;
+ color: #777;
+}
+
+.on {
+ border-bottom: 1.5px solid #2E8CF5 ;
+ color: #2E8CF5;
+}
+
+.swiper-box {
+ margin-top: 3px;
+ display: block;
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+}
+
+.swiper-items1 {
+ height: 100%;
+}
+
+.swiper-items2 {
+ height: 100%;
+}
+
+.searchView{
+ margin: 10rpx 10rpx;
+ height: 30px;
+ display: flex;
+ flex-direction: row;
+}
+
+.imput_goodsName{
+ border: 1rpx solid rgb(236, 231, 231);
+ height: 100%;
+ width: 85%;
+ border-radius: 10rpx;
+ background-color: #fff;
+ text-align: center;
+ padding-top: 5rpx;
+}
+
+.storageView{
+ height: 100%;
+ padding-top: 10rpx;
+ width: 15%;
+ color: orange;
+ text-align: center;
+ justify-content: center;
+ font-size: 20px;
+}
+
+.scroll-views {
+ margin-top: 25rpx;
+ height: calc(100%-97px);
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+}
+
+.storage-scroll-views {
+ margin-top: 25rpx;
+ height: calc(100%-45px);
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+}
+
+.listBackGroundView{
+ background-color: #fff;
+}
+
+.listItem{
+ height: 80rpx;
+ display: flex;
+ padding: 10rpx 20rpx;
+ flex-direction: row;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.horizontallineView {
+ height: 1rpx;
+ background-color: #dbdbdb;
+ margin-left: 20rpx;
+ margin-right: 0rpx;
+}
+
+.addGoodsName{
+ height: 45px;
+ width: 100%;
+ background-color: #fff;
+ color: #2E8CF5;
+ font-size: 20px;
+ text-align: center;
+ line-height: 45px;
+ position: fixed;
+ bottom: 0rpx;
+}
\ No newline at end of file
diff --git a/pages/order/newBill/newBill.js b/pages/order/newBill/newBill.js
index 44fd4ae..2a294d2 100644
--- a/pages/order/newBill/newBill.js
+++ b/pages/order/newBill/newBill.js
@@ -73,7 +73,7 @@ function GetGoodsInfo(that, dmo, detail) {
}
function GetCustomerInfo(that, dmo) {
- var params = [app.globalData.userID, ["Department_ID", "Department_Name", "Employee_ID", "Employee_Name", "AccountingUnit_ID", "AccountingUnit_Name", "TakeGoods_Type", "Address"]]
+ 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);
dmo.Customer_ID = app.globalData.userID;