|
|
@@ -1,35 +1,11 @@
|
|
|
const _Http = getApp().globalData.http;
|
|
|
import currency from "../../utils/currency";
|
|
|
-let content = null,
|
|
|
- downCount = null;
|
|
|
+let content = null;
|
|
|
Page({
|
|
|
data: {
|
|
|
isInsert: false,
|
|
|
CustomBar: getApp().globalData.CustomBar,
|
|
|
- filtratelist: [{
|
|
|
- label: "订单类型",
|
|
|
- index: null,
|
|
|
- showName: "value", //显示字段
|
|
|
- valueKey: "type", //返回Key
|
|
|
- selectKey: "value", //传参 代表选着字段 不传参返回整个选择对象
|
|
|
- value: "", //选中值
|
|
|
- list: [{
|
|
|
- value: "标准订单"
|
|
|
- }, {
|
|
|
- value: "促销订单"
|
|
|
- }, {
|
|
|
- value: "特殊订单"
|
|
|
- }]
|
|
|
- }, {
|
|
|
- label: "领域",
|
|
|
- index: null,
|
|
|
- showName: "tradefield", //显示字段
|
|
|
- valueKey: "tradefield", //返回Key
|
|
|
- selectKey: "tradefield", //传参 代表选着字段 不传参返回整个选择对象
|
|
|
- value: "", //选中值
|
|
|
- list: []
|
|
|
- }],
|
|
|
- privacyFieldC: []
|
|
|
+ privacyFieldC: [],
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
if (wx.getStorageSync('auth').worderform.options.some(v => v == 'insert')) this.setData({
|
|
|
@@ -40,18 +16,12 @@ Page({
|
|
|
"isExport": 0,
|
|
|
"pageNumber": 1,
|
|
|
"pageTotal": 1,
|
|
|
- pageSize: 20,
|
|
|
"where": {
|
|
|
"condition": "",
|
|
|
- "status": "",
|
|
|
- "brandname": "",
|
|
|
- "tradefield": ""
|
|
|
- }
|
|
|
+ },
|
|
|
+ tablefilter: {}
|
|
|
};
|
|
|
this.getList()
|
|
|
- this.getBrand()
|
|
|
- this.getDomain()
|
|
|
- this.getOrderList()
|
|
|
|
|
|
try {
|
|
|
let privacyFieldC = wx.getStorageSync('auth').worderform.forms.list.formcols.map(v => v.title);
|
|
|
@@ -138,7 +108,7 @@ Page({
|
|
|
status = e.detail.title
|
|
|
break;
|
|
|
}
|
|
|
- content.where.status = status;
|
|
|
+ content.tablefilter.status = status;
|
|
|
this.getList(true);
|
|
|
},
|
|
|
/* 搜索 */
|
|
|
@@ -148,56 +118,6 @@ Page({
|
|
|
content.where.condition = detail;
|
|
|
this.getList(true)
|
|
|
},
|
|
|
- /* 获取品牌 */
|
|
|
- getBrand() {
|
|
|
- _Http.basic({
|
|
|
- "id": 20220924163702,
|
|
|
- "content": {
|
|
|
- "pageSize": 9999,
|
|
|
- }
|
|
|
- }, false).then(res => {
|
|
|
- console.log("查询品牌", res)
|
|
|
- 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({
|
|
|
- "id": 20221223141802,
|
|
|
- "content": {
|
|
|
- "pageNumber": 1,
|
|
|
- "pageSize": 9999,
|
|
|
- "where": {
|
|
|
- "condition": ""
|
|
|
- }
|
|
|
- }
|
|
|
- }, false).then(res => {
|
|
|
- console.log("获取领域", res)
|
|
|
- if (res.msg == '成功') this.setData({
|
|
|
- 'filtratelist[1].list': res.data
|
|
|
- });
|
|
|
- })
|
|
|
- },
|
|
|
/* 设置页面高度 */
|
|
|
setListHeight() {
|
|
|
this.selectComponent("#ListBox").setHeight(".tips", this);
|
|
|
@@ -212,56 +132,70 @@ Page({
|
|
|
modalName: null
|
|
|
})
|
|
|
},
|
|
|
- handleFiltrate({
|
|
|
- detail
|
|
|
- }) {
|
|
|
- content.where.type = detail.type;
|
|
|
- content.where.tradefield = detail.tradefield;
|
|
|
- downCount = setTimeout(() => {
|
|
|
- this.getList(true);
|
|
|
- }, 300);
|
|
|
- },
|
|
|
createOrder() {
|
|
|
- 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: `是否确定创建${orderList[0]}`,
|
|
|
- complete: ({
|
|
|
- confirm
|
|
|
- }) => {
|
|
|
- if (confirm) _Http.basic({
|
|
|
- "id": 20221108111402,
|
|
|
- content: {
|
|
|
- sa_orderid: 0,
|
|
|
- rec_contactsid: 0,
|
|
|
- pay_enterpriseid: 0,
|
|
|
- sa_contractid: 0,
|
|
|
- sa_projectid: 0,
|
|
|
- "sa_brandid": this.data.brandList[0].sa_brandid, //品牌ID
|
|
|
- "type": orderList[0], //订单类型
|
|
|
- "tradefield": this.data.filtratelist[1].list[0].tradefield, //必选
|
|
|
- sys_enterpriseid: 0
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- console.log(`创建${orderList[0]}`, res);
|
|
|
- wx.showToast({
|
|
|
- title: res.msg != '成功' ? res.msg : '创建成功',
|
|
|
- icon: "none",
|
|
|
- mask: true
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20221008134803,
|
|
|
+ "version": 1,
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageTotal": 1,
|
|
|
+ "pageSize": 9999,
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ "isused": 1,
|
|
|
+ "isnotspecialfund": 0,
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.code != 1) wx.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ if (res.data.length == 1) {
|
|
|
+ this.handleAdd(res.data[0].sa_accountclassid)
|
|
|
+ } else {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/packageA/orderForm/add/add',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleAdd(sa_accountclassid) {
|
|
|
+ wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: `是否确定创建订单`,
|
|
|
+ complete: ({
|
|
|
+ confirm
|
|
|
+ }) => {
|
|
|
+ if (confirm) _Http.basic({
|
|
|
+ "id": 20221108111402,
|
|
|
+ content: {
|
|
|
+ sa_orderid: 0,
|
|
|
+ rec_contactsid: 0,
|
|
|
+ pay_enterpriseid: 0,
|
|
|
+ sa_contractid: 0,
|
|
|
+ sa_projectid: 0,
|
|
|
+ sa_accountclassid: sa_accountclassid,
|
|
|
+ "sa_brandid": 0, //品牌ID
|
|
|
+ "type": '标准订单', //订单类型
|
|
|
+ "tradefield": '默认', //必选
|
|
|
+ sys_enterpriseid: 0
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log(`创建标准订单`, res);
|
|
|
+ wx.showToast({
|
|
|
+ title: res.msg != '成功' ? res.msg : '创建成功',
|
|
|
+ icon: "none",
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ if (res.msg == '成功') setTimeout(() => {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/packageA/orderForm/detail?id=' + res.data.sa_orderid,
|
|
|
});
|
|
|
- if (res.msg == '成功') setTimeout(() => {
|
|
|
- wx.navigateTo({
|
|
|
- url: '/packageA/orderForm/detail?id=' + res.data.sa_orderid,
|
|
|
- });
|
|
|
- }, 500)
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- wx.navigateTo({
|
|
|
- url: '/packageA/orderForm/add/add?type=标准订单',
|
|
|
- })
|
|
|
- }
|
|
|
+ }, 500)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|