diff --git a/app.json b/app.json index f7e9ba8..99582cb 100644 --- a/app.json +++ b/app.json @@ -2,6 +2,10 @@ "pages": [ "pages/login/login", "pages/homePage/homePage", + "pages/order/order", + "pages/order/detail/detail", + "pages/order/newBill/newBill", + "pages/order/query/query", "pages/saleForecastList/saleForecastList", "pages/saleForecastList/Detail/Detail", "pages/saleForecastList/query/query", diff --git a/pages/homePage/homePage.js b/pages/homePage/homePage.js index 25ea194..bce7e42 100644 --- a/pages/homePage/homePage.js +++ b/pages/homePage/homePage.js @@ -37,13 +37,13 @@ Page({ var btnID = event.currentTarget.dataset.itemid; var transferURL = ''; switch (btnID) { - // 找司机 + // 预报 case "1": transferURL = '/pages/saleForecastList/saleForecastList'; break; - // 对账单 + // 订单 case "2": - transferURL = '/pages/statementOfAccount/statementOfAccount'; + transferURL = '/pages/order/order'; break; // 客户找车 case "3": @@ -57,9 +57,11 @@ Page({ case "5": transferURL = '/pages/guarantee/guarantee'; break; + // 客户对账 case "6": transferURL = '/pages/statementOfAccount/statementOfAccount'; break; + // 欠款单 case "7": transferURL = '/pages/debitNoteList/debitNoteList'; break; diff --git a/pages/homePage/homePage.wxml b/pages/homePage/homePage.wxml index 16cd4b0..d7774e2 100644 --- a/pages/homePage/homePage.wxml +++ b/pages/homePage/homePage.wxml @@ -17,11 +17,11 @@ 销售订单 - --> + 客户找车 diff --git a/pages/login/login.js b/pages/login/login.js index 5aec694..e78fc7b 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -56,8 +56,8 @@ function IsBindWeixinMP(phone) { let params = [phone]; network.requestLoading(method, params, function (res) { // res.result = false; - setCurrentCustomerID(); - + // 取消获取当前用户的ID值 + // setCurrentCustomerID(); if (res.result == true) { wx.switchTab({ url: '/pages/homePage/homePage', @@ -77,9 +77,7 @@ function setCurrentCustomerID (){ let method = getCurrentID; let params = []; network.transfer_request(method, params, function (res) { - // res.result = false; app.globalData.userID = res.result; - console.log(res.result); }) } diff --git a/pages/order/detail/detail.js b/pages/order/detail/detail.js index 087564e..19773c5 100644 --- a/pages/order/detail/detail.js +++ b/pages/order/detail/detail.js @@ -1,26 +1,27 @@ -// pages/orderinfo/orderinfo.js +// pages/order/detail/detail.js var app = getApp() var network = require("../../../utils/net.js") var dateTimePicker = require('../../../utils/dateTimePicker.js'); var utilll = require('../../../utils/util.js'); var timechage = require("../../../utils/dateTimeUtil.js") -var orderID=0; var getAccountingUnit = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetAccountingUnit"; var getCustomer = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetCustomer"; var getDept = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetDepartment"; -var getGoods = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetGoodsWithUnitPrice"; +var getGoods = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetGoods"; 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 getGoodsDetail = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetGoodsDetailWithPrice" +var getCustomerInfo = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/GetCustomerRefDto" var load = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/Load"; let update = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/Update'; -function setTime(that){ +function setTime(that) { // 获取完整的年月日 时分秒,以及默认显示的数组 - var obj1 = dateTimePicker.dateTimePicker(that.data.startYear, that.data.endYear, that.data.loadTime); + var obj1 = dateTimePicker.dateTimePicker(2018, 2030, that.data.dmo.LoadTime); // 精确到分的处理,将数组的秒去掉 var lastArray = obj1.dateTimeArray.pop(); var lastTime = obj1.dateTime.pop(); @@ -29,843 +30,567 @@ function setTime(that){ dateTimeArray1: obj1.dateTimeArray, dateTime1: obj1.dateTime }); + that.timeConversion(); } -function GetAccountingUnit(that, inputValue) { - let method = getAccountingUnit; - let params = [{ - "InputValue": inputValue, - "PageIndex": 0, - "PageSize": 100 - }]; - network.transfer_request(method, params, function (res) { +function GetBaseInfoList(that, method, params) { + network.transfer_request(method, params, function(res) { that.setData({ - currency: res.result, - unit: res.result - }) - }) - that.setData({ - which: "会计部门" - }) -} - -function GetCustomer(that, inputValue) { - let method = getCustomer; - let params = [{ - "InputValue": inputValue, - "PageIndex": 0, - "PageSize": 100 - }]; - network.transfer_request(method, params, function (res) { - that.setData({ - currency: res.result, - customer: res.result - }) - }) - that.setData({ - which: "购货客户" - }) -} - -function GetDepartment(that, inputValue) { - let method = getDept; - let params = [{ - "InputValue": inputValue, - "PageIndex": 0, - "PageSize": 100 - }]; - network.transfer_request(method, params, function (res) { - that.setData({ - currency: res.result, - department: res.result - }) - }) - that.setData({ - which: "部门" - }) -} - -function GetSaleKind(that, v) { - let method = getSaleKind; - let params = [{ - "InputValue": v, - "PageIndex": 0, - "PageSize": 100 - }]; - network.transfer_request(method, params, function (res) { - that.setData({ - currency: res.result, - saletype: res.result - }) - }) - that.setData({ - which: "销售类型" - }) + currency: res.result + }); + }); } -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 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) { + detail.Goods_SecondUnit = res.result.Goods_SecondUnit; + detail.Goods_UnitConvertDirection = res.result.Goods_UnitConvertDirection; + detail.Goods_MainUnitRatio = res.result.Goods_MainUnitRatio; + detail.Goods_SecondUnitRatio = res.result.Goods_SecondUnitRatio; + detail.Unit = res.result.Unit; + detail.LeftRatio = res.result.LeftRatio; + detail.RightRatio = res.result.RightRatio; + + if (res.result.RightRatio == null) { + detail.RightRatio = Number(1) + } + if (res.result.LeftRatio == null) { + detail.LeftRatio = Number(1) + } + + detail.Price = res.result.Price; + detail.PolicyPrice = res.result.PolicyPrice; -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: "仓库" - }) -} + dmo: dmo + }); -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; - let method = getGoods; - let params = [{ - "Input": v, - "PageIndex": 0, - "PageSize": 100, - "Customer_ID": customerID, - "AccountingUnit_ID": unitID, - "Date": date - }]; - network.transfer_request(method, params, function (res) { +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) { + 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; + dmo.DeliverAddress = obj.Address; that.setData({ - goods: res.result, - }) - }) + dmo: dmo + }); + }); } Page({ - /** - * 页面的初始数据 - */ data: { - /** - * 页面配置 - */ - which: "", - winWidth: 0, - winHeight: app.globalData.winHeight, - // tab切换 currentTab: 0, - obj: [], - goods: [], - idx: 0, - currency: [], - saletypeIndex: 0, - saletype: [{ - ID: 0, - Name: "请选择销售类型" - }], - departmentIndex: 0, - department: [{ - ID: 0, - Name: "请选择销售部门" - }], - customerIndex: 0, - customer: [{ - ID: 0, - Name: "请选择客户" - }], - isUnit: 0, - unit: [{ - ID: 0, - Name: "请选择会计单位" - }], - empIndex: 0, - employee: [{ - ID: 0, - Name: "请选择业务员" - }], - storeIndex: 0, - store: [{ - ID: 0, - Name: "请选择仓库" - }], - takeGoodsTypeIndex: 0, - takeGoodsType: [{ - ID: 0, - Name: "请选择配送方式" - }], - addrs: "", - remark: "", + winHeight: app.globalData.winHeight, + which: '', + rowIdx: -1, + dmo: {}, dateTimeArray1: null, dateTime1: null, - startYear: 2018, - endYear: 2030, - loadTime:"" + backPage:'', }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { + onLoad: function(options) { var that = this; - let ID = Number(options.ID); - orderID = ID; - - let method = load; - let params = [ID]; - network.transfer_request(method, params, function (res) { - let customerOld=[{ - ID: res.result.Customer_ID, - Name: res.result.Customer_Name - }] - - let unitOld=[{ - ID: res.result.AccountingUnit_ID, - Name: res.result.AccountingUnit_Name - }] - - let departmentOld=[{ - ID: res.result.Department_ID, - Name: res.result.Department_Name - }] - - 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=[]; - - for(var i =0;i 0) { + // 在此添加货品价格的请求 + for (var i = 0; i < goodsArr.length; i++) { + let newobj = {}; + this.data.dmo.Details.push(newobj); + var itemIndex = this.data.dmo.Details.length - 1; + var detail = this.data.dmo.Details[itemIndex]; + detail.SaleGoods_ID = goodsArr[i].SaleGoods_ID; + detail.Goods_Name = goodsArr[i].Goods_Name; + GetGoodsInfo(this, this.data.dmo, detail); + } + } + } }, - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, /** * 滑动切换tab */ - bindChange: function (e) { - - var that = this; - that.setData({ + bindChange: function(e) { + this.setData({ currentTab: e.detail.current }); - }, /** * 点击tab切换 */ - swichNav: function (e) { - - var that = this; - + swichNav: function(e) { if (this.data.currentTab === e.target.dataset.current) { return false; } else { - that.setData({ + this.setData({ currentTab: e.target.dataset.current }) } }, - getAddrs: function (e) { - this.data.addrs = e.detail.value; - }, - getRemark: function (e) { - this.data.remark = e.detail.value; + changeDateTime1: function(e) { + this.setData({ + dateTime1: e.detail.value, + }); + this.timeConversion(); }, - add: function (e) { - let newobj = { - Goods_Name: "请选择存货" - }; + // 添加一个时间转换 + 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]] + let hour = this.data.dateTimeArray1[3][this.data.dateTime1[3]] + let minu = this.data.dateTimeArray1[4][this.data.dateTime1[4]] + let stringTime = year + "/" + month + "/" + date + " " + hour + ":" + minu + ":00" + let timestamp = Date.parse(new Date(stringTime)); + let loadTime = "/Date(" + timestamp + "+0800)/"; + this.data.dmo.LoadTime = loadTime; + this.setData({ + dmo: this.data.dmo, + }) + }, - this.data.obj.push(newobj) + getAddrs: function(e) { + this.data.dmo.DeliverAddress = e.detail.value; + this.setData({ + dmo: this.data.dmo + }); + }, - let aaa = this.data.obj; + getRemark: function(e) { + this.data.dmo.Remark = e.detail.value; + this.setData({ + dmo: this.data.dmo + }); + }, + powerDrawer: function(e) { + let x = e.currentTarget.dataset.x; + if (x == "存货") { + var dmo = this.data.dmo; + if (dmo.AccountingUnit_ID == null || dmo.Customer_ID == null || dmo.LoadTime == null) { + wx.showModal({ + title: '提示', + content: '请先选择客户及会计单位', + }); + return; + } + } + let idx = e.currentTarget.dataset.idx; + if (idx == undefined) + idx = -1; + this.showDialog(x, ''); this.setData({ - obj: aaa, - }) + which: x, + rowIdx: idx + }); + this.util(); }, - deleteItem: function (e) { - let idx = e.target.dataset.idx; - let deleteobj = this.data.obj; - deleteobj.splice(idx, 1) + + + select: function(e) { + var value = e.detail.value; + var x = this.data.which; + this.showDialog(x, value); + }, + + showDialog: function(x, value) { + var method = null; + let params = [{ + "InputValue": value, + "PageIndex": 0, + "PageSize": 100 + }]; + switch (x) { + case "购货客户": + method = getCustomer; + break; + case "会计部门": + method = getAccountingUnit; + break; + case "部门": + method = getDept; + break; + case "销售类型": + method = getSaleKind; + break; + case "业务员": + method = getEmployee; + break; + case "仓库": + method = getStore; + break; + case "配送方式": + method = getTakeGoodsType; + params = []; + break; + case "存货": + method = getGoods; + break; + } + GetBaseInfoList(this, method, params); + }, + + dialogClose: function(e) { + this.util(); + }, + + util: function() { + /* 动画部分 */ + // 第1步:创建动画实例 + var animation = wx.createAnimation({ + duration: 200, //动画时长 + timingFunction: "linear", //线性 + delay: 0 //0则不延迟 + }); + // 第2步:这个动画实例赋给当前的动画实例 + this.animation = animation; + // 第3步:执行第一组动画 + animation.opacity(0).rotateX(-100).step(); + // 第4步:导出动画对象赋给数据对象储存 this.setData({ - obj: deleteobj + animationData: animation.export() }) - }, + // 第5步:设置定时器到指定时候后,执行第二组动画 + setTimeout(function() { + // 执行第二组动画 + animation.opacity(1).rotateX(0).step(); + // 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象 + this.setData({ + animationData: animation + }) - getGoodsNum: function (e) { - //值: - //e.detail.value - //设置的id - //e.target.dataset.index - let value = e.detail.value; - let idx = e.target.dataset.idx; + //关闭 + this.setData({ + showModalStatus: !this.data.showModalStatus, + }); + }.bind(this), 200) - let end = value.charAt(value.length - 1) - if (end != ".") { + }, - this.data.obj[idx].goodsNum = Number(value); + itemclick: function(e) { + var flag = true; + var x = this.data.which; + var item = e.currentTarget.dataset.item; + var dmo = this.data.dmo; + switch (x) { + case "购货客户": + dmo.Customer_ID = item.ID; + dmo.Customer_Name = item.Name; + flag =false; + GetCustomerInfo(this,dmo); + break; + case "会计部门": + dmo.AccountingUnit_ID = item.ID; + dmo.AccountingUnit_Name = item.Name; + break; + case "部门": + dmo.Department_ID = item.ID; + dmo.Department_Name = item.Name; + break; + case "销售类型": + dmo.SaleKind_ID = item.ID; + dmo.SaleKind_Name = item.Name; + break; + case "业务员": + dmo.Employee_ID = item.ID; + dmo.Employee_Name = item.Name; + break; + case "仓库": + dmo.Store_ID = item.ID; + dmo.Store_Name = item.Name; + break; + case "配送方式": + dmo.TakeGoods_Type = item.Name; + break; + case "存货": + var idx = this.data.rowIdx; + var detail = dmo.Details[idx]; + detail.SaleGoods_ID = item.ID; + detail.Goods_Name = item.Name; + flag = false; + GetGoodsInfo(this,dmo, detail); + break; + } + if (flag){ + this.setData({ + dmo: dmo + }); + } + + this.util(); + }, - let Goods_MainUnitRatio = this.data.obj[idx].Goods_MainUnitRatio - let Goods_SecondUnitRatio = this.data.obj[idx].Goods_SecondUnitRatio - let Goods_UnitConvertDirection = this.data.obj[idx].Goods_UnitConvertDirection - let RightRatio = this.data.obj[idx].RightRatio - let LeftRatio = this.data.obj[idx].LeftRatio + getGoodsNum: function (e) { + var v = e.detail.value; + let end = v.charAt(v.length - 1) + if (end == ".") + return; + let idx = e.target.dataset.idx; + var detail = this.data.dmo.Details[idx]; + let value = Number(v); + if (isNaN(value)) { + wx.showModal({ + title: '提示', + content: '输入格式不正确', + }); + } else { + detail.UnitNum = value; - var numberNumber = Number(value) / RightRatio * LeftRatio; - if (Goods_UnitConvertDirection == 0 || Goods_UnitConvertDirection == 1) { - let secondNumber = numberNumber / (Goods_MainUnitRatio) * (Goods_SecondUnitRatio); - this.data.obj[idx].goodsSecondNum = Number(secondNumber) - this.setData({ - obj: this.data.obj - }) + var numberNumber = detail.UnitNum / detail.RightRatio * detail.LeftRatio; + if (detail.Goods_UnitConvertDirection == 0 || detail.Goods_UnitConvertDirection == 1) { + detail.SecondNumber = numberNumber / (detail.Goods_MainUnitRatio) * (detail.Goods_SecondUnitRatio); } } - + this.setData({ + dmo: this.data.dmo + }) }, + getSecondNum: function (e) { - let value = e.detail.value; + var v = e.detail.value; + let end = v.charAt(v.length - 1) + if (end == ".") + return; let idx = e.target.dataset.idx; + var detail = this.data.dmo.Details[idx]; + let value = Number(v); + if (isNaN(value)) { + wx.showModal({ + title: '提示', + content: '输入格式不正确', + }); + } else { + detail.SecondNumber = value; - let end = value.charAt(value.length - 1) - if (end != ".") { - this.data.obj[idx].goodsSecondNum = Number(value); - - let Goods_MainUnitRatio = this.data.obj[idx].Goods_MainUnitRatio - let Goods_SecondUnitRatio = this.data.obj[idx].Goods_SecondUnitRatio - let Goods_UnitConvertDirection = this.data.obj[idx].Goods_UnitConvertDirection - let RightRatio = this.data.obj[idx].RightRatio - let LeftRatio = this.data.obj[idx].LeftRatio - - var numberNumber = Number(value) / LeftRatio * RightRatio; - if (Goods_UnitConvertDirection == 0 || Goods_UnitConvertDirection == 2) { - let unitnumber = numberNumber / (Goods_SecondUnitRatio) * (Goods_MainUnitRatio); - this.data.obj[idx].goodsNum = Number(unitnumber) - this.setData({ - obj: this.data.obj - }) + var numberNumber = detail.SecondNumber / detail.LeftRatio * detail.RightRatio; + if (detail.Goods_UnitConvertDirection == 0 || detail.Goods_UnitConvertDirection == 2) { + detail.UnitNum = numberNumber / (Goods_SecondUnitRatio) * (Goods_MainUnitRatio); } } + this.setData({ + dmo: this.data.dmo + }) }, + getPrice: function (e) { - let value = e.detail.value; + var v = e.detail.value; + let end = v.charAt(v.length - 1) + if (end == ".") + return; let idx = e.target.dataset.idx; - this.data.obj[idx].Price = Number(value); - }, - powerDrawer: function (e) { - let that = this; - let x = e.currentTarget.dataset.x; - if (x == "会计部门") { - GetAccountingUnit(that, "") - } else if (x == "购货客户") { - GetCustomer(that, "") - } else if (x == "部门") { - 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) - }, - powerDrawer1: function (e) { - let that = this; - let currentStatu = e.currentTarget.dataset.statu; - - let timestamp = Date.parse(new Date()); - let date = "/Date(" + timestamp + "+0800)/"; - GetGoodsWithUnitPrice(that, "", date) - - if (e.currentTarget.dataset.idx != null) { - let idxx = e.currentTarget.dataset.idx; - this.setData({ - idx: idxx + let value = Number(v); + if (isNaN(value)) { + wx.showToast({ + title: '提示', + content: '输入格式不正确', }) - } - this.util1(currentStatu) + } else + this.data.dmo.Details[idx].Price = value; + this.setData({ + dmo: this.data.dmo + }) + }, + deleteItem: function(e) { + let idx = e.target.dataset.idx; + this.data.dmo.Details.splice(idx, 1) + this.setData({ + dmo: this.data.dmo + }) }, - itemclick: function (e) { - var that = this; - var name = e.currentTarget.dataset.name; - var id = e.currentTarget.dataset.id; - var which = e.currentTarget.dataset.item; - var idx = e.currentTarget.dataset.idx; - if (which == "会计部门") { - that.setData({ - isUnit: idx - }) - } else if (which == "购货客户") { - that.setData({ - customerIndex: idx - }) - } else if (which == "部门") { - that.setData({ - departmentIndex: idx - }) - } else if (which == "销售类型") { - that.setData({ - saletypeIndex: idx - }) - } else if (which == "业务员") { - that.setData({ - empIndex: idx - }) - } else if (which == "仓库") { - that.setData({ - storeIndex: idx + add: function(e) { + // let newobj = {}; + // this.data.dmo.Details.push(newobj); + // this.setData({ + // dmo: this.data.dmo + // }) + var dmo = this.data.dmo; + if (dmo.Customer_ID == null) { + wx.showToast({ + title: '请选择购货客户' }) - } else if (which == "配送方式") { - that.setData({ - takeGoodsTypeIndex: idx + return; + } + if (dmo.AccountingUnit_ID == null) { + wx.showToast({ + title: '请选择会计单位' }) + return; } - - this.setData({ - showModalStatus: false, + wx.navigateTo({ + url: '../../goodaNameChooseTemplate/goodaNameChooseTemplate?unitID=' + dmo.AccountingUnit_ID + '&customerID' + dmo.Customer_ID, }) }, - itemclick1: function (e) { + + // 存货明细页面更多按钮 + moreBtnClick: function (e) { var that = this; - var name = e.currentTarget.dataset.name; - var id = e.currentTarget.dataset.data.SaleGoods_ID; - var pp = e.currentTarget.dataset.policyprice; - var price = e.currentTarget.dataset.data.Price; - var Goods_MainUnitRatio = e.currentTarget.dataset.data.Goods_MainUnitRatio - var Goods_SecondUnitRatio = e.currentTarget.dataset.data.Goods_SecondUnitRatio - var Goods_UnitConvertDirection = e.currentTarget.dataset.data.Goods_UnitConvertDirection - - if (e.currentTarget.dataset.data.RightRatio == null) { - this.data.obj[this.data.idx].RightRatio = Number(1) - } - if (e.currentTarget.dataset.data.LeftRatio == null) { - this.data.obj[this.data.idx].LeftRatio = Number(1) - } - this.data.obj[this.data.idx].Goods_MainUnitRatio = Number(Goods_MainUnitRatio) - this.data.obj[this.data.idx].Goods_SecondUnitRatio = Number(Goods_SecondUnitRatio) - this.data.obj[this.data.idx].SaleGoods_ID = Number(id); - this.data.obj[this.data.idx].Goods_Name = name; - this.data.obj[this.data.idx].Price = Number(price) - this.data.obj[this.data.idx].PolicyPrice = Number(pp); - this.data.obj[this.data.idx].Goods_UnitConvertDirection = Number(Goods_UnitConvertDirection) - this.setData({ - showModalStatus1: false, - obj: that.data.obj + var itemList = [ + "审核", + "撤销" + ]; + wx.showActionSheet({ + itemList: itemList, + itemColor: "#2689f8", + success: function (res) { + // res.cancel 用户是不是点击了取消按钮 + // res.tapIndex 数组元素的序号,从0开始 + that.moreBtnClickedDetailInfo(itemList[res.tapIndex]); + } }) }, - select: function (e) { - var that = this; - var which = e.currentTarget.dataset.item; - var value = e.detail.value; - if (which == "会计部门") { - GetAccountingUnit(that, value) - } else if (which == "购货客户") { - GetCustomer(that, value) - } else if (which == "部门") { - 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) + + // 更多 -> 撤销 -> 审核 + moreBtnClickedDetailInfo: function (item) { + if (item == "审核") { + wx.showModal({ + title: "提示", + content: "++++" + item + "++++", + }) + } else { + wx.showModal({ + title: "提示", + content: "++++" + item + "++++", + }) } }, - select1: function (e) { - var that = this; - var value = e.detail.value; - let timestamp = Date.parse(new Date()); - let date = "/Date(" + timestamp + "+0800)/"; - GetGoodsWithUnitPrice(that, value, date) - }, - submitForm: function () { - let unitID = this.data.unit[this.data.isUnit].ID; - 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]] - let date = this.data.dateTimeArray1[2][this.data.dateTime1[2]] - let hour = this.data.dateTimeArray1[3][this.data.dateTime1[3]] - let minu = this.data.dateTimeArray1[4][this.data.dateTime1[4]] - let stringTime = year + "/" + month + "/" + date + " " + hour + ":" + minu + ":00" - let timestamp2 = Date.parse(new Date(stringTime)); - let loadTime = "/Date(" + timestamp2 + "+0800)/"; + // 保存 + submitForm: function() { + var dmo = this.data.dmo; - if (customerID == 0) { + if (dmo.Customer_ID == null) { wx.showToast({ title: '请选择购货客户' }) return; } - if (unitID == 0) { + if (dmo.AccountingUnit_ID == null) { wx.showToast({ title: '请选择会计单位' }) return; } - if (departmentID == 0) { + if (dmo.Department_ID == null) { wx.showToast({ title: '请选择销售部门', }) return; } - - if (employeeID == 0) { + + if (dmo.Employee_ID == null) { wx.showToast({ title: '请选择业务员', }) return; } - if (storeID == 0) { + if (dmo.Store_ID == null) { wx.showToast({ title: '请选择仓库', }) return; } - if (saletypeID == 0) { + if (dmo.SaleKind_ID == null) { wx.showToast({ title: '请选择销售类型', }) return; - } - - if (takeGoodsTypeName == "") { - wx.showToast({ - title: '请选择配送方式', - }) - return; } - if (this.data.addrs == "") { + if (dmo.TakeGoods_Type == "") { wx.showToast({ - title: '请填写送货地址', + title: '请选择配送方式', }) return; } - let detailsArray = []; - - for (var i = 0; i < this.data.obj.length; i++) { - if (this.data.obj[i].Goods_Name == "请选择存货") { + for (var i = 0; i < dmo.Details.length; i++) { + if (dmo.Details[i].SaleGoods_ID == null) { wx.showToast({ title: '存货不能为空', }) return; } - if (this.data.obj[i].goodsNum == null) { + if (dmo.Details[i].UnitNum == null && dmo.Details[i].SecondNumber == null) { wx.showToast({ - title: '报货数量不能为空', + title: '请输入报货数量/重量', }) return; } - if (this.data.obj[i].goodsSecondNum == null) { - wx.showToast({ - title: '辅数量不能为空', - }) - return; - } - var olddID=0; - if(this.data.obj[i].ID==null){ - olddID = 0 - }else{ - olddID = Number(this.data.obj[i].ID) - } - var dmo = { - SaleGoods_ID: this.data.obj[i].SaleGoods_ID, - UnitNum: this.data.obj[i].goodsNum, - SecondNumber: this.data.obj[i].goodsSecondNum, - Price: this.data.obj[i].Price, - PolicyPrice: this.data.obj[i].PolicyPrice, - ID:olddID - } - detailsArray.push(dmo) + // if (dmo.Details[i].SecondNumber == null) { + // wx.showToast({ + // title: '辅数量不能为空', + // }) + // return; + // } } - let method = update; let params = [{ - "Customer_ID": customerID, - "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 + "Customer_ID": dmo.Customer_ID, + "LoadTime": dmo.LoadTime, + "AccountingUnit_ID": dmo.AccountingUnit_ID, + "Department_ID": dmo.Department_ID, + "SaleKind_ID": dmo.SaleKind_ID, + "Employee_ID": dmo.Employee_ID, + "Store_ID": dmo.Store_ID, + "TakeGoods_Type": dmo.TakeGoods_Type, + "DeliverAddress": dmo.DeliverAddress, + "Remark": dmo.Remark, + "Details": dmo.Details, + "ID": dmo.ID }]; - - network.transfer_request(method, params, function (res) { + + network.transfer_request(method, params, function(res) { if (res.result == null) { wx.showModal({ title: '提示', content: '修改成功,是否返回上级列表', - success: function (res) { - if (res.cancel) { - } else { + success: function(res) { + if (res.cancel) {} else { wx.navigateBack({ delta: 1 }) } }, - fail: function (res) { } + fail: function(res) {} }) } }) }, - changeDateTime1(e) { - this.setData({ - dateTime1: e.detail.value - }); - - }, - util: function (currentStatu) { - /* 动画部分 */ - // 第1步:创建动画实例 - var animation = wx.createAnimation({ - duration: 200, //动画时长 - timingFunction: "linear", //线性 - delay: 0 //0则不延迟 - }); - - // 第2步:这个动画实例赋给当前的动画实例 - this.animation = animation; - - // 第3步:执行第一组动画 - animation.opacity(0).rotateX(-100).step(); - - // 第4步:导出动画对象赋给数据对象储存 - this.setData({ - animationData: animation.export() - }) - - // 第5步:设置定时器到指定时候后,执行第二组动画 - setTimeout(function () { - // 执行第二组动画 - animation.opacity(1).rotateX(0).step(); - // 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象 - this.setData({ - animationData: animation - }) - - //关闭 - if (currentStatu == "close") { - this.setData({ - showModalStatus: false, - }); - } - }.bind(this), 200) - - // 显示 - if (currentStatu == "open") { - // 调用函数时,传入new Date()参数,返回值是日期和时间 - // var timet = utilll.formatTime(new Date()); - // 再通过setData更改Page()里面的data,动态更新页面的数据 - this.setData({ - // time: timet, - showModalStatus: true, - }); - } - }, - util1: function (currentStatu) { - /* 动画部分 */ - // 第1步:创建动画实例 - var animation = wx.createAnimation({ - duration: 200, //动画时长 - timingFunction: "linear", //线性 - delay: 0 //0则不延迟 - }); - - // 第2步:这个动画实例赋给当前的动画实例 - this.animation = animation; - - // 第3步:执行第一组动画 - animation.opacity(0).rotateX(-100).step(); - - // 第4步:导出动画对象赋给数据对象储存 - this.setData({ - animationData: animation.export() - }) - - // 第5步:设置定时器到指定时候后,执行第二组动画 - setTimeout(function () { - // 执行第二组动画 - animation.opacity(1).rotateX(0).step(); - // 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象 - this.setData({ - animationData: animation - }) - - //关闭 - if (currentStatu == "close") { - this.setData({ - showModalStatus1: false - }); - } - }.bind(this), 200) - - // 显示 - if (currentStatu == "open") { - // 调用函数时,传入new Date()参数,返回值是日期和时间 - // var timet = utilll.formatTime(new Date()); - // 再通过setData更改Page()里面的data,动态更新页面的数据 - this.setData({ - // time: timet, - showModalStatus1: true - }); - } - } }) \ No newline at end of file diff --git a/pages/order/detail/detail.wxml b/pages/order/detail/detail.wxml index 63c5fef..f9f74cd 100644 --- a/pages/order/detail/detail.wxml +++ b/pages/order/detail/detail.wxml @@ -12,11 +12,8 @@ 购货客户 - - - {{customer[customerIndex].Name}} + + {{dmo.Customer_Name?dmo.Customer_Name:"请选择客户"}} @@ -24,7 +21,7 @@ 发货时间 - + {{dateTimeArray1[0][dateTime1[0]]}}-{{dateTimeArray1[1][dateTime1[1]]}}-{{dateTimeArray1[2][dateTime1[2]]}} {{dateTimeArray1[3][dateTime1[3]]}}:{{dateTimeArray1[4][dateTime1[4]]}} @@ -34,66 +31,48 @@ 会计单位 - - - {{unit[isUnit].Name}} + + {{dmo.AccountingUnit_Name?dmo.AccountingUnit_Name:"请选择会计单位"}} 销售部门 - - - {{department[departmentIndex].Name}} + + {{dmo.Department_Name?dmo.Department_Name:"请选择销售部门"}} - + 业务员 - - - {{employee[empIndex].Name}} + + {{dmo.Employee_Name?dmo.Employee_Name:"请选择业务员"}} - + 仓库 - - - {{store[storeIndex].Name}} + + {{dmo.Store_Name?dmo.Store_Name:"请选择仓库"}} 销售类型 - - - {{saletype[saletypeIndex].Name}} + + {{dmo.SaleKind_Name?dmo.SaleKind_Name:"请选择销售类型"}} - + 配送方式 - - - {{takeGoodsType[takeGoodsTypeIndex].Name}} + + {{dmo.TakeGoods_Type?dmo.TakeGoods_Type:"请选择配送方式"}} @@ -101,115 +80,110 @@ 送货地址 - + - + 摘要 - + - - - - - - - - - - - - - - - - - {{item.Name}} - - - - 取消 - + - - - - - - 存货名称 - - {{obj[idx].Goods_Name}} - - - - - - 报货数量 - + + + + 存货名称 + + {{item.Goods_Name}} - + + + + + 报货数量 + + + - - 辅 数 量 - - - - - 单 价 - - - + + 辅 数 量 + + + - - 政策单价 - {{obj[idx].PolicyPrice}} - - + + 单 价 + + + + + 政策单价 + {{item.PolicyPrice}} - 删除 + - - - - + 删除 - - - + + - - - - - - - - - - - - - {{item.Goods_Name}} + + + + 添加存货 - + - 取消 - + + + + + + 更多 + + + + + + + 保存 + + + + + + + - \ No newline at end of file + + + + + + + + + + + + {{item.Name}} + + + + 取消 + \ No newline at end of file diff --git a/pages/order/detail/detail.wxss b/pages/order/detail/detail.wxss index 987952e..c37015d 100644 --- a/pages/order/detail/detail.wxss +++ b/pages/order/detail/detail.wxss @@ -1,7 +1,7 @@ /* pages/orderinfo/orderinfo.wxss */ page { - background:#EAF1F8; + background: #eaf1f8; height: calc(100%-10px); } @@ -26,7 +26,7 @@ page { } .on { - background-color:#2E8CF5 ; + background-color: #2e8cf5; color: white; } @@ -51,15 +51,14 @@ page { } .baseitem { - height: 60rpx; - background: #fff; + height: 60rpx; + background: #fff; /* border-bottom: 0.1px solid #dbdbdb; */ display: flex; flex-direction: row; align-items: center; padding: 20rpx 20rpx; font-size: 30rpx; - } .horizontallineView { @@ -80,6 +79,7 @@ page { /* margin-left: 20rpx; margin-right: 20rpx; */ width: 70%; + height: 100%; text-align: right; } @@ -111,7 +111,6 @@ page { text-align: right; } - .add { display: flex; flex-direction: row; @@ -150,9 +149,8 @@ page { background-color: #fff; } -.main-body{ - background-color: #fff; - +.main-body { + background-color: #fff; } .submit { @@ -230,3 +228,59 @@ page { font-size: 18px; color: rgb(48, 48, 48); } + +.imageView { + height: 80px; + width: 100%; + margin-top: 20rpx; + position: relative; + align-items: center; + justify-content: center; + box-sizing: content-box; +} + +.imageViewNoMargin{ + height: 80px; + width: 100%; + margin-top: -10rpx; + position: relative; + align-items: center; + justify-content: center; + box-sizing: content-box; +} + +.currentImage { + width: 100%; + height: 100%; +} + +.bottomGroupView{ + margin-top: -10rpx; + width: 100%; + height: 80px; + display: flex; + flex-direction: row; +} + +.btnTextView { + position: absolute; + width: 100%; + top:0; + line-height: 65px; + text-align: center; +} + +.btnText { + color: white; + font-size: 20px; +} + +.goodsNameImageToTopFar{ + height: calc(100% - 180px); + background:#EAF1F8; +} + +.blueAddText{ + color: #2689f8; + font-size: 20px; +} diff --git a/pages/order/newBill/newBill.js b/pages/order/newBill/newBill.js index 0de4e8a..2abfac0 100644 --- a/pages/order/newBill/newBill.js +++ b/pages/order/newBill/newBill.js @@ -1,658 +1,519 @@ - +// pages/order/detail/detail.js var app = getApp() var network = require("../../../utils/net.js") var dateTimePicker = require('../../../utils/dateTimePicker.js'); var utilll = require('../../../utils/util.js'); +var timechage = require("../../../utils/dateTimeUtil.js") + +var getAccountingUnit = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetAccountingUnit"; +var getCustomer = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetCustomer"; +var getDept = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetDepartment"; +var getGoods = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetGoods"; +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 getGoodsDetail = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetGoodsDetailWithPrice" +var getCustomerInfo = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/GetCustomerRefDto" + +let insert = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/Insert' + +var getUserPrifile = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/AccountRpc/GetUserPrifile" + +// 获取完整的年月日 时分秒,以及默认显示的数组' +function setTime(that) { + // 精确到分的处理,将数组的秒去掉 + var obj1 = dateTimePicker.dateTimePicker(2018, 2030); + var lastArray = obj1.dateTimeArray.pop(); + var lastTime = obj1.dateTime.pop(); -function GetAccountingUnit(that, inputValue) { - let method = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetAccountingUnit"; - let params = [{ - "InputValue": inputValue, - "PageIndex": 0, - "PageSize": 100 - }]; - network.transfer_request(method, params, function(res) { - that.setData({ - currency: res.result, - unit: res.result - }) - }) - that.setData({ - which: "会计部门" - }) -} - -function GetCustomer(that, inputValue) { - let method = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetCustomer"; - let params = [{ - "InputValue": inputValue, - "PageIndex": 0, - "PageSize": 100 - }]; - network.transfer_request(method, params, function(res) { - that.setData({ - currency: res.result, - customer: res.result - }) - }) - that.setData({ - which: "购货客户" - }) -} - -function GetDepartment(that, inputValue) { - let method = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetDepartment"; - let params = [{ - "InputValue": inputValue, - "PageIndex": 0, - "PageSize": 100 - }]; - network.transfer_request(method, params, function(res) { - that.setData({ - currency: res.result, - department: res.result - }) - }) - that.setData({ - which: "部门" - }) -} - -function GetSaleKind(that, v) { - let method = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetSaleKind"; - let params = [{ - "InputValue": v, - "PageIndex": 0, - "PageSize": 100 - }]; - network.transfer_request(method, params, function(res) { - that.setData({ - currency: res.result, - saletype: res.result - }) - }) that.setData({ - which: "销售类型" - }) -} + dateTimeArray1: obj1.dateTimeArray, + dateTime1: obj1.dateTime + }); -function GetEmployee(that, inputValue) { - let method = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetEmployee"; - let params = [{ - "InputValue": inputValue, - "PageIndex": 0, - "PageSize": 100 - }]; - network.transfer_request(method, params, function (res) { - that.setData({ - currency: res.result, - employee: res.result - }) - }) - that.setData({ - which: "业务员" - }) + that.timeConversion(); } -function GetStore(that, inputValue) { - let method = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetStore"; - let params = [{ - "InputValue": inputValue, - "PageIndex": 0, - "PageSize": 100 - }]; +function GetBaseInfoList(that, method, params) { network.transfer_request(method, params, function (res) { that.setData({ - currency: res.result, - store: res.result - }) - }) - that.setData({ - which: "仓库" - }) + currency: res.result + }); + }); } -function GetTakeGoodsType(that, inputValue) { - let method = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetTakeGoods_Type"; - let params = []; - network.transfer_request(method, params, function (res) { +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) { + detail.Goods_SecondUnit = res.result.Goods_SecondUnit; + detail.Goods_UnitConvertDirection = res.result.Goods_UnitConvertDirection; + detail.Goods_MainUnitRatio = res.result.Goods_MainUnitRatio; + detail.Goods_SecondUnitRatio = res.result.Goods_SecondUnitRatio; + detail.Unit = res.result.Unit; + detail.LeftRatio = res.result.LeftRatio; + detail.RightRatio = res.result.RightRatio; + if (res.result.RightRatio == null) { + detail.RightRatio = Number(1) + } + if (res.result.LeftRatio == null) { + detail.LeftRatio = Number(1) + } + detail.Price = res.result.Price; + detail.PolicyPrice = res.result.PolicyPrice; that.setData({ - currency: res.result, - takeGoodsType: res.result - }) - }) - that.setData({ - which: "配送方式" - }) + dmo: dmo + }); + }); } -function GetGoodsWithUnitPrice(that, v, date) { - let unitID = that.data.unit[that.data.isUnit].ID; - let customerID = that.data.customer[that.data.customerIndex].ID; - let method = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetGoodsWithUnitPrice"; - let params = [{ - "Input": v, - "PageIndex": 0, - "PageSize": 100, - "Customer_ID": customerID, - "AccountingUnit_ID": unitID, - "Date": date - }]; - network.transfer_request(method, params, function(res) { +function GetCustomerInfo(that, dmo) { + var params = [dmo.Customer_ID, ["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.Department_ID = obj.Department_ID; + dmo.Department_Name = obj.Department_Name; + dmo.Employee_ID = obj.Employee_ID; + dmo.Employee_Name = obj.Employee_Name; + dmo.AccountingUnit_ID = obj.AccountingUnit_ID; + dmo.AccountingUnit_Name = obj.AccountingUnit_Name; + if (obj.TakeGoods_Type != null) + dmo.TakeGoods_Type = obj.TakeGoods_Type.Name; + else + dmo.TakeGoods_Type = ""; + dmo.DeliverAddress = obj.Address; that.setData({ - goods: res.result, - }) - }) + dmo: dmo + }); + }); } Page({ - /** - * 页面的初始数据 - */ data: { - /** - * 页面配置 - */ - which: "", - winWidth: 0, - winHeight: app.globalData.winHeight, - // tab切换 currentTab: 0, - obj: [], - goods: [], - idx: 0, - currency: [], - saletypeIndex: 0, - saletype: [{ - ID: 0, - Name: "请选择销售类型" - }], - departmentIndex: 0, - department: [{ - ID: 0, - Name: "请选择销售部门" - }], - customerIndex: 0, - customer: [{ - ID: 0, - Name: "请选择客户" - }], - isUnit: 0, - unit: [{ - ID: 0, - Name: "请选择会计单位" - }], - empIndex: 0, - employee: [{ - ID: 0, - Name: "请选择业务员" - }], - storeIndex: 0, - store: [{ - ID: 0, - Name: "请选择仓库" - }], - takeGoodsTypeIndex: 0, - takeGoodsType: [{ - ID: 0, - Name: "请选择配送方式" - }], - addrs: "", - remark:"", - dateTimeArray: null, - dateTime: null, + winHeight: app.globalData.winHeight, + which: '', + rowIdx: -1, + dmo: { + Details: [], + }, dateTimeArray1: null, dateTime1: null, - startYear: 2018, - endYear: 2030 + backPage: "", }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function(options) { - - // 获取完整的年月日 时分秒,以及默认显示的数组 - var obj1 = dateTimePicker.dateTimePicker(this.data.startYear, this.data.endYear); - // 精确到分的处理,将数组的秒去掉 - var lastArray = obj1.dateTimeArray.pop(); - var lastTime = obj1.dateTime.pop(); - - this.setData({ - dateTimeArray: obj1.dateTimeArray, - dateTime: obj1.dateTime, - dateTimeArray1: obj1.dateTimeArray, - dateTime1: obj1.dateTime - }); - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function() { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function() { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function() { - + onLoad: function (options) { + var that = this; + setTime(that); + this.getUserPrifile(); }, - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function() { - + getUserPrifile: function () { + var that = this; + network.transfer_request(getUserPrifile, [], function (res) { + that.data.dmo.SaleKind_ID = res.result.Order_SaleKind_ID; + that.data.dmo.SaleKind_Name = res.result.Order_SaleKind_Name; + that.data.dmo.Store_ID = res.result.Order_Store_ID; + that.data.dmo.Store_Name = res.result.Order_Store_Name; + that.setData({ + dmo: that.data.dmo + }); + }); }, - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function() { - + onShow: function () { + var that = this; + if (this.data.backPage == "goodsNameChoosePage") { + var goodsArr = app.globalData.goodsNameArray; + app.globalData.goodsNameArray = []; + if (goodsArr.length > 0) { + // 在此添加货品价格的请求 + for (var i = 0; i < goodsArr.length; i++) { + let newobj = {}; + this.data.dmo.Details.push(newobj); + var itemIndex = this.data.dmo.Details.length - 1; + var detail = this.data.dmo.Details[itemIndex]; + detail.SaleGoods_ID = goodsArr[i].SaleGoods_ID; + detail.Goods_Name = goodsArr[i].Goods_Name; + GetGoodsInfo(this, this.data.dmo, detail); + } + } + } }, - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function() { - - }, /** * 滑动切换tab */ - bindChange: function(e) { - - var that = this; - that.setData({ + bindChange: function (e) { + this.setData({ currentTab: e.detail.current }); - }, /** * 点击tab切换 */ - swichNav: function(e) { - - var that = this; - + swichNav: function (e) { if (this.data.currentTab === e.target.dataset.current) { return false; } else { - that.setData({ + this.setData({ currentTab: e.target.dataset.current }) } }, - getAddrs: function(e) { - this.data.addrs = e.detail.value; - }, - getRemark: function (e) { - this.data.remark = e.detail.value; + changeDateTime1(e) { + this.setData({ + dateTime1: e.detail.value, + }); + this.timeConversion(); }, - add: function(e) { - - let newobj = { - Goods_Name: "请选择存货" - }; - - this.data.obj.push(newobj) - - let aaa = this.data.obj; + // 添加一个时间转换 + 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]] + let hour = this.data.dateTimeArray1[3][this.data.dateTime1[3]] + let minu = this.data.dateTimeArray1[4][this.data.dateTime1[4]] + let stringTime = year + "/" + month + "/" + date + " " + hour + ":" + minu + ":00" + let timestamp = Date.parse(new Date(stringTime)); + let loadTime = "/Date(" + timestamp + "+0800)/"; + this.data.dmo.LoadTime = loadTime; this.setData({ - obj: aaa, + dmo: this.data.dmo, }) }, - deleteItem: function(e) { - let idx = e.target.dataset.idx; - let deleteobj = this.data.obj; - deleteobj.splice(idx, 1) + getAddrs: function (e) { + this.data.dmo.DeliverAddress = e.detail.value; this.setData({ - obj: deleteobj - }) + dmo: this.data.dmo + }); }, - getGoodsNum: function(e) { - //值: - //e.detail.value - //设置的id - //e.target.dataset.index - let value = e.detail.value; - let idx = e.target.dataset.idx; - - let end = value.charAt(value.length - 1) - if (end != ".") { - - this.data.obj[idx].goodsNum = Number(value); - - let Goods_MainUnitRatio = this.data.obj[idx].Goods_MainUnitRatio - let Goods_SecondUnitRatio = this.data.obj[idx].Goods_SecondUnitRatio - let Goods_UnitConvertDirection = this.data.obj[idx].Goods_UnitConvertDirection - let RightRatio = this.data.obj[idx].RightRatio - let LeftRatio = this.data.obj[idx].LeftRatio + getRemark: function (e) { + this.data.dmo.Remark = e.detail.value; + this.setData({ + dmo: this.data.dmo + }); + }, - var numberNumber = Number(value) / RightRatio * LeftRatio; - if (Goods_UnitConvertDirection == 0 || Goods_UnitConvertDirection == 1) { - let secondNumber = numberNumber / (Goods_MainUnitRatio) * (Goods_SecondUnitRatio); - this.data.obj[idx].goodsSecondNum = Number(secondNumber) - this.setData({ - obj: this.data.obj - }) + powerDrawer: function (e) { + let x = e.currentTarget.dataset.x; + if (x == "存货") { + var dmo = this.data.dmo; + if (dmo.AccountingUnit_ID == null || dmo.Customer_ID == null || dmo.LoadTime == null) { + wx.showModal({ + title: '提示', + content: '请先选择客户及会计单位', + }); + return; } } + let idx = e.currentTarget.dataset.idx; + if (idx == undefined) + idx = -1; + this.showDialog(x, ''); + this.setData({ + which: x, + rowIdx: idx + }); + this.util(); + }, + // 遮罩存货输入框 + select: function (e) { + var value = e.detail.value; + var x = this.data.which; + this.showDialog(x, value); }, - getSecondNum: function(e) { - let value = e.detail.value; - let idx = e.target.dataset.idx; - let end = value.charAt(value.length - 1) - if (end != ".") { - this.data.obj[idx].goodsSecondNum = Number(value); - - let Goods_MainUnitRatio = this.data.obj[idx].Goods_MainUnitRatio - let Goods_SecondUnitRatio = this.data.obj[idx].Goods_SecondUnitRatio - let Goods_UnitConvertDirection = this.data.obj[idx].Goods_UnitConvertDirection - let RightRatio = this.data.obj[idx].RightRatio - let LeftRatio = this.data.obj[idx].LeftRatio - - var numberNumber = Number(value) / LeftRatio * RightRatio; - if (Goods_UnitConvertDirection == 0 || Goods_UnitConvertDirection == 2) { - let unitnumber = numberNumber / (Goods_SecondUnitRatio) * (Goods_MainUnitRatio); - this.data.obj[idx].goodsNum = Number(unitnumber) - this.setData({ - obj: this.data.obj - }) - } + showDialog: function (x, value) { + var method = null; + let params = [{ + "InputValue": value, + "PageIndex": 0, + "PageSize": 100 + }]; + switch (x) { + case "购货客户": + method = getCustomer; + break; + case "会计部门": + method = getAccountingUnit; + break; + case "部门": + method = getDept; + break; + case "销售类型": + method = getSaleKind; + break; + case "业务员": + method = getEmployee; + break; + case "仓库": + method = getStore; + break; + case "配送方式": + method = getTakeGoodsType; + params = []; + break; + case "存货": + method = getGoods; + break; } + GetBaseInfoList(this, method, params); }, - getPrice: function(e) { - let value = e.detail.value; - let idx = e.target.dataset.idx; - this.data.obj[idx].Price = Number(value); + + dialogClose: function (e) { + this.util(); }, - powerDrawer: function(e) { - let that = this; - let x = e.currentTarget.dataset.x; - if (x == "会计部门") { - GetAccountingUnit(that, "") - } else if (x == "购货客户") { - GetCustomer(that, "") - } else if (x == "部门") { - GetDepartment(that, "") - } else if (x == "销售类型") { - GetSaleKind(that, "") - } else if (x == "业务员") { - GetEmployee(that, "") - } else if (x == "仓库") { - GetStore(that, "") - } else if (x == "配送方式") { - GetTakeGoodsType(that, "") + + itemclick: function (e) { + var flag = true; + var x = this.data.which; + var item = e.currentTarget.dataset.item; + var dmo = this.data.dmo; + switch (x) { + case "购货客户": + dmo.Customer_ID = item.ID; + dmo.Customer_Name = item.Name; + flag = false; + GetCustomerInfo(this, dmo); + break; + case "会计部门": + dmo.AccountingUnit_ID = item.ID; + dmo.AccountingUnit_Name = item.Name; + break; + case "部门": + dmo.Department_ID = item.ID; + dmo.Department_Name = item.Name; + break; + case "销售类型": + dmo.SaleKind_ID = item.ID; + dmo.SaleKind_Name = item.Name; + break; + case "业务员": + dmo.Employee_ID = item.ID; + dmo.Employee_Name = item.Name; + break; + case "仓库": + dmo.Store_ID = item.ID; + dmo.Store_Name = item.Name; + break; + case "配送方式": + dmo.TakeGoods_Type = item.Name; + break; + case "存货": + var idx = this.data.rowIdx; + var detail = dmo.Details[idx]; + detail.SaleGoods_ID = item.ID; + detail.Goods_Name = item.Name; + flag = false; + GetGoodsInfo(this, dmo, detail); + break; } - let currentStatu = e.currentTarget.dataset.statu; - // if (e.currentTarget.dataset.idx != null) { - // let idxx = e.currentTarget.dataset.idx; - // this.setData({ - // idx: idxx - // }) - // } - this.util(currentStatu) + if (flag) { + this.setData({ + dmo: dmo + }); + } + this.util(); }, - powerDrawer1: function(e) { - let that = this; - let currentStatu = e.currentTarget.dataset.statu; - let timestamp = Date.parse(new Date()); - let date = "/Date(" + timestamp + "+0800)/"; - GetGoodsWithUnitPrice(that, "", date) + getGoodsNum: function (e) { + let idx = e.target.dataset.idx; + var detail = this.data.dmo.Details[idx]; + let value = Number(e.detail.value); + if (isNaN(value)) { + wx.showModal({ + title: '提示', + content: '输入格式不正确', + }); + } else { + detail.UnitNum = value; - if (e.currentTarget.dataset.idx != null) { - let idxx = e.currentTarget.dataset.idx; - this.setData({ - idx: idxx - }) + var numberNumber = detail.UnitNum / detail.RightRatio * detail.LeftRatio; + if (detail.Goods_UnitConvertDirection == 0 || detail.Goods_UnitConvertDirection == 1) { + detail.SecondNumber = numberNumber / (detail.Goods_MainUnitRatio) * (detail.Goods_SecondUnitRatio); + } } - this.util1(currentStatu) + this.setData({ + dmo: this.data.dmo + }) + }, + + getSecondNum: function (e) { + let idx = e.target.dataset.idx; + var detail = this.data.dmo.Details[idx]; + let value = Number(e.detail.value); + if (isNaN(value)) { + wx.showModal({ + title: '提示', + content: '输入格式不正确', + }); + } else { + detail.SecondNumber = value; + var numberNumber = detail.SecondNumber / detail.LeftRatio * detail.RightRatio; + if (detail.Goods_UnitConvertDirection == 0 || detail.Goods_UnitConvertDirection == 2) { + detail.UnitNum = numberNumber / (Goods_SecondUnitRatio) * (Goods_MainUnitRatio); + } + } + this.setData({ + dmo: this.data.dmo + }) }, - itemclick: function(e) { - var that = this; - var name = e.currentTarget.dataset.name; - var id = e.currentTarget.dataset.id; - var which = e.currentTarget.dataset.item; - var idx = e.currentTarget.dataset.idx; - if (which == "会计部门") { - that.setData({ - isUnit: idx - }) - } else if (which == "购货客户") { - that.setData({ - customerIndex: idx - }) - } else if (which == "部门") { - that.setData({ - departmentIndex: idx - }) - } else if (which == "销售类型") { - 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 + // + getPrice: function (e) { + let idx = e.target.dataset.idx; + let value = Number(e.detail.value); + if (isNaN(value)) { + wx.showToast({ + title: '提示', + content: '输入格式不正确', }) - } - + } else + this.data.dmo.Details[idx].Price = value; this.setData({ - showModalStatus: false, + dmo: this.data.dmo }) }, - itemclick1: function(e) { - var that = this; - var name = e.currentTarget.dataset.name; - var id = e.currentTarget.dataset.data.SaleGoods_ID; - var pp = e.currentTarget.dataset.policyprice; - if(!pp) - pp=''; - - var price = e.currentTarget.dataset.data.Price; - var Goods_MainUnitRatio = e.currentTarget.dataset.data.Goods_MainUnitRatio - var Goods_SecondUnitRatio = e.currentTarget.dataset.data.Goods_SecondUnitRatio - var Goods_UnitConvertDirection = e.currentTarget.dataset.data.Goods_UnitConvertDirection - - if (e.currentTarget.dataset.data.RightRatio == null) { - this.data.obj[this.data.idx].RightRatio = Number(1) - } - if (e.currentTarget.dataset.data.LeftRatio == null) { - this.data.obj[this.data.idx].LeftRatio = Number(1) - } - this.data.obj[this.data.idx].Goods_MainUnitRatio = Number(Goods_MainUnitRatio) - this.data.obj[this.data.idx].Goods_SecondUnitRatio = Number(Goods_SecondUnitRatio) - this.data.obj[this.data.idx].SaleGoods_ID = Number(id); - this.data.obj[this.data.idx].Goods_Name = name; - this.data.obj[this.data.idx].Price = Number(price) - this.data.obj[this.data.idx].PolicyPrice = pp; - this.data.obj[this.data.idx].Goods_UnitConvertDirection = Number(Goods_UnitConvertDirection) + + // 删除 + deleteItem: function (e) { + let idx = e.target.dataset.idx; + this.data.dmo.Details.splice(idx, 1) this.setData({ - showModalStatus1: false, - obj: that.data.obj + dmo: this.data.dmo }) }, - select: function(e) { - var that = this; - var which = e.currentTarget.dataset.item; - var value = e.detail.value; - if (which == "会计部门") { - GetAccountingUnit(that, value) - } else if (which == "购货客户") { - GetCustomer(that, value) - } else if (which == "部门") { - 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) + + // 点击添加存货 + add: function (e) { + // 新增获取存货 + var dmo = this.data.dmo; + if (dmo.Customer_ID == null) { + wx.showToast({ + title: '请选择购货客户' + }) + return; } + if (dmo.AccountingUnit_ID == null) { + wx.showToast({ + title: '请选择会计单位' + }) + return; + } + wx.navigateTo({ + url: '../../goodaNameChooseTemplate/goodaNameChooseTemplate?unitID=' + dmo.AccountingUnit_ID + '&customerID' + dmo.Customer_ID, + }) }, - select1: function(e) { - var that = this; - var value = e.detail.value; - let timestamp = Date.parse(new Date()); - let date = "/Date(" + timestamp + "+0800)/"; - GetGoodsWithUnitPrice(that, value, date) - }, - submitForm: function() { - let unitID = this.data.unit[this.data.isUnit].ID; - 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]] - let date = this.data.dateTimeArray1[2][this.data.dateTime1[2]] - let hour = this.data.dateTimeArray1[3][this.data.dateTime1[3]] - let minu = this.data.dateTimeArray1[4][this.data.dateTime1[4]] - - let stringTime = year + "/" + month + "/" + date + " " + hour + ":" + minu + ":00" - let timestamp2 = Date.parse(new Date(stringTime)); - let update = "/Date(" + timestamp2 + "+0800)/"; - if (customerID == 0) { + // 提交 + submitForm: function () { + var dmo = this.data.dmo; + if (dmo.Customer_ID == null) { wx.showToast({ title: '请选择购货客户' }) return; } - if (unitID == 0) { + if (dmo.AccountingUnit_ID == null) { wx.showToast({ title: '请选择会计单位' }) return; } - if (departmentID == 0) { + if (dmo.Department_ID == null) { wx.showToast({ title: '请选择销售部门', }) return; } - if (employeeID == 0) { + + if (dmo.Employee_ID == null) { wx.showToast({ title: '请选择业务员', }) return; } - if (storeID == 0) { + + if (dmo.Store_ID == null) { wx.showToast({ title: '请选择仓库', }) return; } - if (saletypeID == 0) { + + if (dmo.SaleKind_ID == null) { wx.showToast({ title: '请选择销售类型', }) return; - } - if (takeGoodsTypeName == "") { - wx.showToast({ - title: '请选择配送方式', - }) - return; } - if (this.data.addrs == "") { + + if (dmo.TakeGoods_Type == "") { wx.showToast({ - title: '请填写送货地址', + title: '请选择配送方式', }) return; } - let detailsArray = []; + // if (dmo.DeliverAddress == "") { + // wx.showToast({ + // title: '请填写送货地址', + // }) + // return; + // } - for (var i = 0; i < this.data.obj.length; i++) { - if (this.data.obj[i].Goods_Name == "请选择存货") { + for (var i = 0; i < dmo.Details.length; i++) { + if (dmo.Details[i].SaleGoods_ID == null) { wx.showToast({ title: '存货不能为空', }) return; } - if (this.data.obj[i].goodsNum == null) { + if (dmo.Details[i].UnitNum == null && dmo.Details[i].SecondNumber == null) { wx.showToast({ - title: '报货数量不能为空', + title: '请输入报货数量/重量', }) return; } - if (this.data.obj[i].goodsSecondNum == null) { - wx.showToast({ - title: '辅数量不能为空', - }) - return; - } - if (this.data.obj[i].PolicyPrice=='') - this.data.obj[i].PolicyPrice=NaN; - var dmo = { - SaleGoods_ID: this.data.obj[i].SaleGoods_ID, - UnitNum: this.data.obj[i].goodsNum, - SecondNumber: this.data.obj[i].goodsSecondNum, - Price: this.data.obj[i].Price, - PolicyPrice: this.data.obj[i].PolicyPrice - } - detailsArray.push(dmo) - } + } - let method = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/Insert'; + let method = insert; let params = [{ - "Customer_ID": customerID, - "LoadTime": update, - "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 - + "Customer_ID": dmo.Customer_ID, + "LoadTime": dmo.LoadTime, + "AccountingUnit_ID": dmo.AccountingUnit_ID, + "Department_ID": dmo.Department_ID, + "SaleKind_ID": dmo.SaleKind_ID, + "Employee_ID": dmo.Employee_ID, + "Store_ID": dmo.Store_ID, + "TakeGoods_Type": dmo.TakeGoods_Type, + "DeliverAddress": dmo.DeliverAddress, + "Remark": dmo.Remark, + "Details": dmo.Details, + "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.cancel) { - } else { + if (res.confirm) { wx.navigateBack({ delta: 1 }) @@ -662,15 +523,9 @@ Page({ }) } }) - }, - changeDateTime1(e) { - this.setData({ - dateTime1: e.detail.value - }); - }, - util: function(currentStatu) { + util: function () { /* 动画部分 */ // 第1步:创建动画实例 var animation = wx.createAnimation({ @@ -678,20 +533,16 @@ Page({ timingFunction: "linear", //线性 delay: 0 //0则不延迟 }); - // 第2步:这个动画实例赋给当前的动画实例 this.animation = animation; - // 第3步:执行第一组动画 animation.opacity(0).rotateX(-100).step(); - // 第4步:导出动画对象赋给数据对象储存 this.setData({ animationData: animation.export() }) - // 第5步:设置定时器到指定时候后,执行第二组动画 - setTimeout(function() { + setTimeout(function () { // 执行第二组动画 animation.opacity(1).rotateX(0).step(); // 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象 @@ -700,70 +551,10 @@ Page({ }) //关闭 - if (currentStatu == "close") { - this.setData({ - showModalStatus: false, - }); - } - }.bind(this), 200) - - // 显示 - if (currentStatu == "open") { - // 调用函数时,传入new Date()参数,返回值是日期和时间 - // var timet = utilll.formatTime(new Date()); - // 再通过setData更改Page()里面的data,动态更新页面的数据 this.setData({ - // time: timet, - showModalStatus: true, + showModalStatus: !this.data.showModalStatus, }); - } - }, - util1: function(currentStatu) { - /* 动画部分 */ - // 第1步:创建动画实例 - var animation = wx.createAnimation({ - duration: 200, //动画时长 - timingFunction: "linear", //线性 - delay: 0 //0则不延迟 - }); - - // 第2步:这个动画实例赋给当前的动画实例 - this.animation = animation; - - // 第3步:执行第一组动画 - animation.opacity(0).rotateX(-100).step(); - - // 第4步:导出动画对象赋给数据对象储存 - this.setData({ - animationData: animation.export() - }) - - // 第5步:设置定时器到指定时候后,执行第二组动画 - setTimeout(function() { - // 执行第二组动画 - animation.opacity(1).rotateX(0).step(); - // 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象 - this.setData({ - animationData: animation - }) - - //关闭 - if (currentStatu == "close") { - this.setData({ - showModalStatus1: false - }); - } }.bind(this), 200) - // 显示 - if (currentStatu == "open") { - // 调用函数时,传入new Date()参数,返回值是日期和时间 - // var timet = utilll.formatTime(new Date()); - // 再通过setData更改Page()里面的data,动态更新页面的数据 - this.setData({ - // time: timet, - showModalStatus1: true - }); - } - } + }, }) \ No newline at end of file diff --git a/pages/order/newBill/newBill.wxml b/pages/order/newBill/newBill.wxml index ed5cd51..b0c070e 100644 --- a/pages/order/newBill/newBill.wxml +++ b/pages/order/newBill/newBill.wxml @@ -1,4 +1,5 @@ - + + 基本信息 订单明细 @@ -8,194 +9,185 @@ - - 购货客户 - - - {{customer[customerIndex].Name}} - - - - - 发货时间 - - - {{dateTimeArray1[0][dateTime1[0]]}}-{{dateTimeArray1[1][dateTime1[1]]}}-{{dateTimeArray1[2][dateTime1[2]]}} {{dateTimeArray1[3][dateTime1[3]]}}:{{dateTimeArray1[4][dateTime1[4]]}} + + + 购货客户 + + {{dmo.Customer_Name?dmo.Customer_Name:"请选择客户"}} - - - - - 会计单位 - - - {{unit[isUnit].Name}} - - + + + 发货时间 + + + {{dateTimeArray1[0][dateTime1[0]]}}-{{dateTimeArray1[1][dateTime1[1]]}}-{{dateTimeArray1[2][dateTime1[2]]}} {{dateTimeArray1[3][dateTime1[3]]}}:{{dateTimeArray1[4][dateTime1[4]]}} + + + + - - 销售部门 - - - {{department[departmentIndex].Name}} + + 会计单位 + + {{dmo.AccountingUnit_Name?dmo.AccountingUnit_Name:"请选择会计单位"}} + - + - - 业务员 - - - {{employee[empIndex].Name}} + + 销售部门 + + {{dmo.Department_Name?dmo.Department_Name:"请选择销售部门"}} + - + - - 仓库 - - - {{store[storeIndex].Name}} + + 业务员 + + {{dmo.Employee_Name?dmo.Employee_Name:"请选择业务员"}} + - + - - 销售类型 - - - {{saletype[saletypeIndex].Name}} + + 仓库 + + {{dmo.Store_Name?dmo.Store_Name:"请选择仓库"}} + - + - - 配送方式 - - - {{takeGoodsType[takeGoodsTypeIndex].Name}} + + 销售类型 + + {{dmo.SaleKind_Name?dmo.SaleKind_Name:"请选择销售类型"}} + - + - - 送货地址 - - - - 摘要 - - + + 配送方式 + + {{dmo.TakeGoods_Type?dmo.TakeGoods_Type:"请选择配送方式"}} + + + - - - - + + 送货地址 + + + - - - - - - - - - - - - - {{item.Name}} - - + + 摘要 + + + - 取消 - + + - - - + + + - 存货名称 - - {{obj[idx].Goods_Name}} + 存货名称 + + {{item.Goods_Name}} - - - - 报货数量 - + + - - 辅 数 量 - - + + 报货数量 + + + + + + 辅 数 量 + + - - - 单 价 - - + + 单 价 + + + - - 政策单价 - {{obj[idx].PolicyPrice}} - + + 政策单价 + {{item.PolicyPrice}} - 删除 + - - - - - + 删除 - - - + - - - - - - - - - - - - {{item.Goods_Name}} + + + + + + + 添加存货 - + + + + + + + + 更多 + + + + + + + 保存 + + + - 取消 - + + - \ No newline at end of file + + + + + + + + + + + + {{item.Name}} + + + + 取消 + \ No newline at end of file diff --git a/pages/order/newBill/newBill.wxss b/pages/order/newBill/newBill.wxss index 81cc92a..66b7f3e 100644 --- a/pages/order/newBill/newBill.wxss +++ b/pages/order/newBill/newBill.wxss @@ -1,7 +1,7 @@ -/* pages/saleforecast/saleforecast.wxss */ +/* pages/orderinfo/orderinfo.wxss */ page { - background:#EAF1F8; + background: #eaf1f8; height: calc(100%-10px); } @@ -26,7 +26,7 @@ page { } .on { - background-color:#2E8CF5 ; + background-color: #2e8cf5; color: white; } @@ -51,68 +51,67 @@ page { } .baseitem { + height: 60rpx; background: #fff; - width: 100%; - border-bottom: 0.1px solid #dbdbdb; + /* border-bottom: 0.1px solid #dbdbdb; */ display: flex; flex-direction: row; align-items: center; - padding-top: 20rpx; - padding-bottom: 20rpx; + padding: 20rpx 20rpx; font-size: 30rpx; } +.horizontallineView { + height: 1rpx; + background-color: #dbdbdb; + margin-left: 20rpx; + margin-right: 0rpx; +} + .baseitem_key { color: #666; - width: 40%; - margin-left: 20rpx; + width: 30%; + /* margin-left: 20rpx; */ } .baseitem_value { color: rgb(48, 48, 48); - margin-left: 20rpx; - margin-right: 20rpx; - width: 160%; + /* margin-left: 20rpx; + margin-right: 20rpx; */ + width: 70%; + height: 100%; text-align: right; } .baseitem_key2 { color: #666; - width: 40%; - margin-left: 20rpx; + width: 30%; + /* margin-left: 20rpx; */ } .baseitem_value2 { color: rgb(48, 48, 48); - margin-left: 20rpx; - margin-right: 20rpx; - width: 160%; + /* margin-left: 20rpx; + margin-right: 20rpx; */ + width: 70%; text-align: right; } .baseitem_key1 { color: #666; - width: 100%; + width: 30%; margin-left: 20rpx; } .baseitem_value1 { color: rgb(48, 48, 48); - margin-left: 20rpx; - margin-right: 20rpx; - width: 100%; + /* margin-left: 20rpx; + margin-right: 20rpx; */ + width: 70%; text-align: right; } -::-webkit-scrollbar { - width: 0; - height: 0; - color: transparent; -} - .add { - display: flex; - flex-direction: row; align-items: center; justify-content: center; border-left: none; @@ -145,6 +144,7 @@ page { .itemView { margin-top: 20rpx; + background-color: #fff; } .submit { @@ -222,3 +222,59 @@ page { font-size: 18px; color: rgb(48, 48, 48); } + +.imageView { + height: 80px; + width: 100%; + margin-top: 20rpx; + position: relative; + align-items: center; + justify-content: center; + box-sizing: content-box; +} + +.imageViewNoMargin{ + height: 80px; + width: 100%; + margin-top: -10rpx; + position: relative; + align-items: center; + justify-content: center; + box-sizing: content-box; +} + +.currentImage { + width: 100%; + height: 100%; +} + +.bottomGroupView{ + margin-top: -10rpx; + width: 100%; + height: 80px; + display: flex; + flex-direction: row; +} + +.btnTextView { + position: absolute; + width: 100%; + top:0; + line-height: 65px; + text-align: center; +} + +.btnText { + color: white; + font-size: 20px; +} + +.goodsNameImageToTopFar{ + height: calc(100% - 180px); + background:#EAF1F8; +} + +.blueAddText{ + color: #2689f8; + font-size: 20px; +} \ No newline at end of file diff --git a/pages/sendCargo/sendCargo.wxml b/pages/sendCargo/sendCargo.wxml index ac12f51..7faa497 100644 --- a/pages/sendCargo/sendCargo.wxml +++ b/pages/sendCargo/sendCargo.wxml @@ -10,7 +10,7 @@