|
@@ -51,6 +51,7 @@ Page({
|
|
|
this.getList()
|
|
|
this.getBrand()
|
|
|
this.getDomain()
|
|
|
+ this.getOrderList()
|
|
|
},
|
|
|
/* 获取产品 */
|
|
|
getList(init = false) {
|
|
@@ -149,6 +150,26 @@ Page({
|
|
|
if (res.msg == '成功') this.data.brandList = res.data
|
|
|
})
|
|
|
},
|
|
|
+ /* 获取orderList */
|
|
|
+ getOrderList() {
|
|
|
+ _Http.basic({
|
|
|
+ "classname": "sysmanage.develop.optiontype.optiontype",
|
|
|
+ "method": "optiontypeselect",
|
|
|
+ "content": {
|
|
|
+ "typename": "ordertype"
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log("订单类型", res)
|
|
|
+ let orderList = [];
|
|
|
+ try {
|
|
|
+ orderList = res.data.map(v => v.value);
|
|
|
+ } catch (error) {}
|
|
|
+ if (orderList.length == 0) orderList.push("标准订单")
|
|
|
+ this.setData({
|
|
|
+ orderList
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
/* 获取领域 */
|
|
|
getDomain() {
|
|
|
_Http.basic({
|
|
@@ -191,11 +212,11 @@ Page({
|
|
|
}, 300);
|
|
|
},
|
|
|
createOrder() {
|
|
|
- if (this.data.brandList.length == 1 && this.data.filtratelist[1].list.length == 1) {
|
|
|
-
|
|
|
+ let orderList = this.data.orderList;
|
|
|
+ if (this.data.brandList.length == 1 && this.data.filtratelist[1].list.length == 1 && orderList.length == 1) {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
- content: '是否确定创建标准订单',
|
|
|
+ content: `是否确定创建${orderList[0]}`,
|
|
|
complete: ({
|
|
|
confirm
|
|
|
}) => {
|
|
@@ -208,12 +229,12 @@ Page({
|
|
|
sa_contractid: 0,
|
|
|
sa_projectid: 0,
|
|
|
"sa_brandid": this.data.brandList[0].sa_brandid, //品牌ID
|
|
|
- "type": "标准订单", //订单类型
|
|
|
+ "type": orderList[0], //订单类型
|
|
|
"tradefield": this.data.filtratelist[1].list[0].tradefield, //必选
|
|
|
sys_enterpriseid: 0
|
|
|
}
|
|
|
}).then(res => {
|
|
|
- console.log("创建标准订单", res);
|
|
|
+ console.log(`创建${orderList[0]}`, res);
|
|
|
wx.showToast({
|
|
|
title: res.msg != '成功' ? res.msg : '创建成功',
|
|
|
icon: "none",
|
|
@@ -227,7 +248,6 @@ Page({
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
} else {
|
|
|
wx.navigateTo({
|
|
|
url: '/packageA/orderForm/add/add?type=标准订单',
|