|
@@ -12,13 +12,12 @@ class Service{
|
|
|
this.mem_pointer_djcs = -1;
|
|
this.mem_pointer_djcs = -1;
|
|
|
this.qufei = [];
|
|
this.qufei = [];
|
|
|
this.qufeiEntry = null;
|
|
this.qufeiEntry = null;
|
|
|
- this.peibishu = {};
|
|
|
|
|
- this.dingeshu = {};
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ip() {
|
|
ip() {
|
|
|
//return "/api"//return "http://127.0.0.1:8000"
|
|
//return "/api"//return "http://127.0.0.1:8000"
|
|
|
- return "http://192.168.31.48:1313/api"
|
|
|
|
|
|
|
+ return "http://127.0.0.1:1313/api"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
clearCache() {//set qufei will clear cache
|
|
clearCache() {//set qufei will clear cache
|
|
@@ -528,19 +527,10 @@ class Service{
|
|
|
/////////////////////////////end of qingdan////////////////////////////////////
|
|
/////////////////////////////end of qingdan////////////////////////////////////
|
|
|
|
|
|
|
|
async generateQingdanTuijian(name, bh, bt, bm) {
|
|
async generateQingdanTuijian(name, bh, bt, bm) {
|
|
|
- const response = await fetch(this.ip().concat( "/qingdantuijian/"), {
|
|
|
|
|
- method : "POST",
|
|
|
|
|
- headers: {
|
|
|
|
|
- "Content-type": "application/json"
|
|
|
|
|
- },
|
|
|
|
|
- body: JSON.stringify(
|
|
|
|
|
- {
|
|
|
|
|
- "bh": bh,
|
|
|
|
|
- "bt": bt,
|
|
|
|
|
- "bm": bm,
|
|
|
|
|
- "name": name
|
|
|
|
|
- }
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ const response = await fetch(this.ip().concat( "/qingdantuijian/".concat(bm)), {
|
|
|
|
|
+ method : "GET",
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
if (!response.ok) {
|
|
if (!response.ok) {
|
|
|
//const error = await response.json();
|
|
//const error = await response.json();
|
|
@@ -638,16 +628,9 @@ async generateQingdanTuijian(name, bh, bt, bm) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async generatePeibiXilie(id) {
|
|
async generatePeibiXilie(id) {
|
|
|
- const response = await fetch(this.ip().concat( "/pbxl/"), {
|
|
|
|
|
- method : "POST",
|
|
|
|
|
- headers: {
|
|
|
|
|
- "Content-type": "application/json"
|
|
|
|
|
- },
|
|
|
|
|
- body: JSON.stringify(
|
|
|
|
|
- {
|
|
|
|
|
- "name": id
|
|
|
|
|
- }
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ const response = await fetch(this.ip().concat( "/pbxl/").concat(id), {
|
|
|
|
|
+ method : "GET",
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
if (!response.ok) {
|
|
if (!response.ok) {
|
|
|
//const error = await response.json();
|
|
//const error = await response.json();
|
|
@@ -658,65 +641,39 @@ async generateQingdanTuijian(name, bh, bt, bm) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
async generatePeibishu(zhuanye) {
|
|
async generatePeibishu(zhuanye) {
|
|
|
- if (this.peibishu.hasOwnProperty(zhuanye)) {
|
|
|
|
|
- return this.peibishu[zhuanye];
|
|
|
|
|
- }
|
|
|
|
|
- const response = await fetch(this.ip().concat( "/pbs/"), {
|
|
|
|
|
- method : "POST",
|
|
|
|
|
- headers: {
|
|
|
|
|
- "Content-type": "application/json"
|
|
|
|
|
- },
|
|
|
|
|
- body: JSON.stringify(
|
|
|
|
|
- {
|
|
|
|
|
- "value": zhuanye
|
|
|
|
|
- }
|
|
|
|
|
- )
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const response = await fetch(this.ip().concat( "/pbs/").concat(zhuanye.toString()), {
|
|
|
|
|
+ method : "GET",
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
if (!response.ok) {
|
|
if (!response.ok) {
|
|
|
//const error = await response.json();
|
|
//const error = await response.json();
|
|
|
console.error('error');
|
|
console.error('error');
|
|
|
} else {
|
|
} else {
|
|
|
const data = await response.json();
|
|
const data = await response.json();
|
|
|
- this.peibishu[zhuanye] = data;
|
|
|
|
|
|
|
+
|
|
|
return data;
|
|
return data;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
async generateDingeshu(value) {
|
|
async generateDingeshu(value) {
|
|
|
- if (this.dingeshu.hasOwnProperty(value)) {
|
|
|
|
|
- return this.dingeshu[value];
|
|
|
|
|
- }
|
|
|
|
|
- const response = await fetch(this.ip().concat( "/des/"), {
|
|
|
|
|
- method : "POST",
|
|
|
|
|
- headers: {
|
|
|
|
|
- "Content-type": "application/json"
|
|
|
|
|
- },
|
|
|
|
|
- body: JSON.stringify(
|
|
|
|
|
- {
|
|
|
|
|
- "value": value
|
|
|
|
|
- }
|
|
|
|
|
- )
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const response = await fetch(this.ip().concat( "/des/").concat(value.toString()), {
|
|
|
|
|
+ method : "GET",
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
if (!response.ok) {
|
|
if (!response.ok) {
|
|
|
//const error = await response.json();
|
|
//const error = await response.json();
|
|
|
console.error('error');
|
|
console.error('error');
|
|
|
} else {
|
|
} else {
|
|
|
const data = await response.json();
|
|
const data = await response.json();
|
|
|
- this.dingeshu[value] = data;
|
|
|
|
|
|
|
+
|
|
|
return data;
|
|
return data;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
async generateDingeXilie(value, id) {//定额书的一个栏目的所有具体定额
|
|
async generateDingeXilie(value, id) {//定额书的一个栏目的所有具体定额
|
|
|
- const response = await fetch(this.ip().concat("/dexilie/"), {
|
|
|
|
|
- method : "POST",
|
|
|
|
|
- headers: {
|
|
|
|
|
- "Content-type": "application/json"
|
|
|
|
|
- },
|
|
|
|
|
- body: JSON.stringify(
|
|
|
|
|
- {
|
|
|
|
|
- "value": value,
|
|
|
|
|
- "id": id
|
|
|
|
|
- }
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ const response = await fetch(this.ip().concat("/dexilie/").concat(value.toString()).concat("/").concat(id), {
|
|
|
|
|
+ method : "GET",
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
if (!response.ok) {
|
|
if (!response.ok) {
|
|
|
//const error = await response.json();
|
|
//const error = await response.json();
|
|
@@ -727,17 +684,9 @@ async generateQingdanTuijian(name, bh, bt, bm) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
async generateSingleDingeXilie(zhuanye, debh) {//清单页面展示用
|
|
async generateSingleDingeXilie(zhuanye, debh) {//清单页面展示用
|
|
|
- const response = await fetch(this.ip().concat( "/singledexilie/"), {
|
|
|
|
|
- method : "POST",
|
|
|
|
|
- headers: {
|
|
|
|
|
- "Content-type": "application/json"
|
|
|
|
|
- },
|
|
|
|
|
- body: JSON.stringify(
|
|
|
|
|
- {
|
|
|
|
|
- "debh": debh,
|
|
|
|
|
- "zhuanye": zhuanye
|
|
|
|
|
- }
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ const response = await fetch(this.ip().concat( "/singledexilie/").concat(zhuanye.toString()).concat("/").concat(debh), {
|
|
|
|
|
+ method : "GET",
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
if (!response.ok) {
|
|
if (!response.ok) {
|
|
|
//const error = await response.json();
|
|
//const error = await response.json();
|
|
@@ -901,15 +850,8 @@ async generateQingdanTuijian(name, bh, bt, bm) {
|
|
|
async cankao() { //参考费率
|
|
async cankao() { //参考费率
|
|
|
|
|
|
|
|
const response = await fetch(this.ip().concat( "/cankao/"), {
|
|
const response = await fetch(this.ip().concat( "/cankao/"), {
|
|
|
- method : "POST",
|
|
|
|
|
- headers: {
|
|
|
|
|
- "Content-type": "application/json"
|
|
|
|
|
- },
|
|
|
|
|
- body: JSON.stringify(
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ method : "GET",
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
if (!response.ok) {
|
|
if (!response.ok) {
|
|
|
//const error = await response.json();
|
|
//const error = await response.json();
|