|
@@ -3,7 +3,7 @@ const _Http = getApp().globalData.http;
|
|
|
Page({
|
|
|
data: {
|
|
|
sa_orderid: null,
|
|
|
- tabsActive:0,
|
|
|
+ tabsActive: 0,
|
|
|
tabsList: [{
|
|
|
label: "产品明细",
|
|
|
icon: "icon-tabxiangxixinxi1"
|
|
@@ -19,12 +19,12 @@ Page({
|
|
|
}],
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- console.log(options)
|
|
|
this.setData({
|
|
|
sa_orderid: options.id
|
|
|
});
|
|
|
this.getDetail();
|
|
|
- },
|
|
|
+ },
|
|
|
+ /* 获取详情 */
|
|
|
getDetail() {
|
|
|
_Http.basic({
|
|
|
"id": 20221108151302,
|
|
@@ -41,5 +41,77 @@ Page({
|
|
|
detail: res.data
|
|
|
})
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
+ /* 更新数据 */
|
|
|
+ changeDetail() {
|
|
|
+ let data = this.data.detail,
|
|
|
+ content = {
|
|
|
+ "sa_orderid": data.sa_orderid,
|
|
|
+ "sys_enterpriseid": data.sys_enterpriseid, //订货企业id
|
|
|
+ "sa_accountclassid": data.accountclass.sa_accountclassid, //营销账户类型ID
|
|
|
+ "sa_brandid": data.sa_brandid, //品牌ID
|
|
|
+ "sys_enterprise_financeid": data.finance.sys_enterprise_financeid, //合作企业财务信息ID(开票信息)
|
|
|
+ "sa_logiscompid": data.logiscomp.sa_logiscompid, //物流公司档案ID
|
|
|
+ "rec_contactsid": data.contacts.contactsid, //合作企业联系人表ID(收货信息)
|
|
|
+ "type": data.type, //订单类型
|
|
|
+ "typemx": data.typemx, // 明细分类,可选
|
|
|
+ "remarks": data.remarks,
|
|
|
+ "saler_hrid": data.saler_hrid, //销售人员hrid,业务员hrid
|
|
|
+ "tradefield": "消防", //必选
|
|
|
+ "pay_enterpriseid": data.pay_enterpriseid, //结算单位
|
|
|
+ "rebate_userate": data.accountclass.rebate_userate, //返利金使用比例
|
|
|
+ "rebate_used": data.accountclass.rebate_used, //默认0,是否使用返利金
|
|
|
+ "billdate": data.billdate, //单据日期,默认创建日期
|
|
|
+ };
|
|
|
+ if (content.type != '标准订单') {
|
|
|
+ //"sa_contractid": 1, 合同ID,标准订单不传
|
|
|
+ //"sa_projectid": 1, 工程项目表ID,标准订单不传
|
|
|
+ }
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20221108111402,
|
|
|
+ content
|
|
|
+ }).then(res => {
|
|
|
+ console.log("修改订单数据", res);
|
|
|
+ if (res.msg != '成功') wx.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ resolve(res)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 修改订单备注 */
|
|
|
+ changeRemarks(e) {
|
|
|
+ let value = e.detail.value,
|
|
|
+ remarks = this.data.detail.remarks,
|
|
|
+ that = this;
|
|
|
+ if (value == this.data.detail.remarks) return;
|
|
|
+ wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '是否确定修改订单备注?',
|
|
|
+ complete: async (res) => {
|
|
|
+ if (res.cancel) that.setData({
|
|
|
+ "detail.remarks": remarks
|
|
|
+ })
|
|
|
+ if (res.confirm) {
|
|
|
+ let res = await that.changeDetail();
|
|
|
+ that.setData({
|
|
|
+ "detail.remarks": res.msg == '成功' ? value : remarks
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 设置是否使用返利金 */
|
|
|
+ async changeRebateUsed() {
|
|
|
+ this.setData({
|
|
|
+ "detail.accountclass.rebate_used": this.data.detail.accountclass.rebate_used == 0 ? 1 : 0
|
|
|
+ })
|
|
|
+ let res = await this.changeDetail();
|
|
|
+ if (res.msg != '成功') this.setData({
|
|
|
+ "detail.accountclass.rebate_used": this.data.detail.accountclass.rebate_used == 0 ? 1 : 0
|
|
|
+ });
|
|
|
+ },
|
|
|
})
|