Commit dbf6f831 by zhangzhen

付款单功能开发优化

parent 7a2d1276
import http from "@/common/vmeitime-http/index.js"
const setParamsData = (data = {},pageData) => {
let obj = {}
for (let i in data) {
obj[i] = data[i]
}
let paramsData = {
"__version__": "2.0",
"__sys__": {},
"__blocks__": {
"inqu_status": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
},
"result": {
"attr": {
count: 0,
limit: pageData && pageData.limit? pageData.limit : 10,
offset: pageData && pageData.offset? pageData.offset*pageData.limit : 0,
orderBy: "",
showCount: pageData && pageData.showCount? pageData.showCount : "true"
},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
},
"detail": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
}
}
}
let keyList = Object.keys(obj);
keyList.forEach((item, index) => {
paramsData.__blocks__.inqu_status.meta.columns.push({
pos: index,
name: item
})
})
paramsData.__blocks__.inqu_status.rows.push(Object.values(obj));
return paramsData
}
const setResultData = (data={}) => {
let obj = {}
for (let i in data) {
if (data[i] !== '') {
obj[i] = data[i]
}
}
let paramsData = {
"__version__": "2.0",
"__sys__": {},
"__blocks__": {
"result": {
"attr": {},
"meta": {
"columns": []
},
"rows": []
}
}
}
let keyList = Object.keys(obj);
keyList.forEach((item, index) => {
paramsData.__blocks__.result.meta.columns.push({
pos: index,
name: item
})
})
paramsData.__blocks__.result.rows.push(Object.values(obj));
return paramsData
}
const setResultDataAndDetail = (data={},detail=[]) => {
let obj = {}
for (let i in data) {
if (data[i] !== '') {
obj[i] = data[i]
}
}
let paramsData = {
"__version__": "2.0",
"__sys__": {},
"__blocks__": {
"detail1":{
"attr": {},
"meta": {
"columns": []
},
"rows": []
},
"result": {
"attr": {},
"meta": {
"columns": []
},
"rows": []
}
}
}
let keyList = Object.keys(obj);
keyList.forEach((item, index) => {
paramsData.__blocks__.result.meta.columns.push({
pos: index,
name: item
})
})
paramsData.__blocks__.result.rows.push(Object.values(obj));
if(detail&&detail.length){
let keyList2 = Object.keys(detail[0]);
keyList2.forEach((item, index) => {
paramsData.__blocks__.detail1.meta.columns.push({
pos: index,
name: item
})
})
detail.forEach(item=>{
paramsData.__blocks__.detail1.rows.push(Object.values(item));
})
}
return paramsData
}
export const getList = (params,pageData) => {
let url = `/service/S_CW_FK_01`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const getSelectList = (params,pageData) => {
let url = `/service/S_CW_FK_02`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const save = (data) => {
let url = `/service/S_CW_FK_03`
let d = setResultData(data);
return http.post(url, d)
}
export const updateSubmitStatus = (data) => {
let url = `/service/S_XS_KK_03`
let d = setResultData(data);
return http.post(url, d)
}
export const getProList = (params,pageData) => {
let url = `/service/S_CW_HT_01`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const getList3 = (params,pageData) => {
let url = `/service/S_CW_QZ_01`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const getList1 = (params,pageData) => {
let url = `/service/S_CW_QZ_02`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const getList2 = (params,pageData) => {
let url = `/service/S_CW_QZ_03`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const getList4 = (params,pageData) => {
let url = `/service/S_CW_QZ_04`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const getList5 = (params,pageData) => {
let url = `/service/S_CW_QZ_05`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment