uu
This commit is contained in:
parent
716fe78f92
commit
0ae9bc75a2
@ -4,6 +4,11 @@ import { host } from "./api"
|
||||
import { getSessionXToken } from "@/session"
|
||||
|
||||
const coreRequestBase = (url, reqParams, options = {}, methodType = "POST", coreParams = {}) => {
|
||||
// get请求 需要转成query参
|
||||
if(methodType.toLocaleLowerCase() == 'get') {
|
||||
url = url + (url.indexOf('?') == -1 ? '?': '') + tansGetParamsToQuery(reqParams)
|
||||
reqParams = {}
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url,
|
||||
@ -23,6 +28,32 @@ const coreRequestBase = (url, reqParams, options = {}, methodType = "POST", core
|
||||
|
||||
const baseParam = {}
|
||||
|
||||
/**
|
||||
* 参数处理
|
||||
* @param {*} params 参数
|
||||
*/
|
||||
export function tansGetParamsToQuery(params) {
|
||||
let result = ''
|
||||
for (const propName of Object.keys(params)) {
|
||||
const value = params[propName];
|
||||
var part = encodeURIComponent(propName) + "=";
|
||||
if (value !== null && typeof (value) !== "undefined") {
|
||||
if (typeof value === 'object') {
|
||||
for (const key of Object.keys(value)) {
|
||||
if (value[key] !== null && typeof (value[key]) !== 'undefined') {
|
||||
let params = propName + '[' + key + ']';
|
||||
var subPart = encodeURIComponent(params) + "=";
|
||||
result += subPart + encodeURIComponent(value[key]) + "&";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result += part + encodeURIComponent(value) + "&";
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// 请求处理
|
||||
let coreRequest = function(url, params = {}, options = {}, methodType, coreParams = {}) {
|
||||
let comReqData = getCommonReqData()
|
||||
|
||||
@ -169,6 +169,7 @@
|
||||
printFlag: '0',
|
||||
billCode: '',
|
||||
_date: [],
|
||||
params: {}
|
||||
},
|
||||
resData: { list: [] }
|
||||
}
|
||||
@ -186,8 +187,8 @@
|
||||
methods: {
|
||||
async getListFun(param){
|
||||
let cpParam = JSON.parse(JSON.stringify(param))
|
||||
cpParam['params.beginSendDate'] = cpParam._date[0]
|
||||
cpParam['params.endSendDate'] = cpParam._date[1]
|
||||
cpParam.params.beginSendDate = cpParam._date[0]
|
||||
cpParam.params.endSendDate = cpParam._date[1]
|
||||
let res = await apiService.queryPrintListSimple(cpParam)
|
||||
// list增加新字段
|
||||
res.rows.map(t=> {
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
<u-row justify="between" align="top">
|
||||
<u-col span="12">
|
||||
<!-- 订单状态 -->
|
||||
<tpx-tabs :list="dicData.emis_waybill_stat_type" v-model:value="searchParam.waybillStatType"
|
||||
<tpx-tabs :list="dicData.emis_waybill_stat_type" v-model:value="searchParam.params.waybillStatType"
|
||||
@tabchange="(val)=> { handleSearchParamChange() }" v-slot="curOrdTab"
|
||||
>
|
||||
<text slot>
|
||||
@ -123,7 +123,9 @@
|
||||
searchParam: {
|
||||
billCode: '',
|
||||
_date: [],
|
||||
params: {
|
||||
waybillStatType: dicData?.emis_waybill_stat_type?.[0]?.val,
|
||||
}
|
||||
},
|
||||
queryOption: {
|
||||
|
||||
@ -156,9 +158,8 @@
|
||||
methods: {
|
||||
transSearchPm(param){
|
||||
let cpParam = JSON.parse(JSON.stringify(param))
|
||||
cpParam['params.beginDate'] = cpParam._date[0]
|
||||
cpParam['params.endDate'] = cpParam._date[1]
|
||||
cpParam['params.waybillStatType'] = param.waybillStatType
|
||||
cpParam.params.beginDate = cpParam._date[0]
|
||||
cpParam.params.endDate = cpParam._date[1]
|
||||
return cpParam
|
||||
},
|
||||
async getListFun(param){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user