Commit 200fadb9 authored by “yiyousong”'s avatar “yiyousong”

pref:添加统计报表接口

parent 84b063f6
......@@ -32,23 +32,23 @@ export const getdeptList = (data) => {
};
// 查询事项列表
// export const getWriteMatterList = (data) => {
// let baseUrl = local.getLocal("serverUrl");
// let siteId = local.getLocal("siteId");
// let devicenum = local.getLocal("devicenum");
// return request({
// url: `${baseUrl}sampleform/matter/list`,
// method: "post",
// data: {
// siteId,
// devicenum,
// ...data,
// },
// });
// };
export const getSampleformMatterList = (data) => {
let baseUrl = local.getLocal("serverUrl");
let siteId = local.getLocal("siteId");
let devicenum = local.getLocal("devicenum");
return request({
url: `${baseUrl}sampleform/matter/list`,
method: "post",
data: {
siteId,
devicenum,
...data,
},
});
};
// 查询设备关联事项列表
export const getWriteMatterList = (data) => {
export const getDeviceMatterList = (data) => {
let baseUrl = local.getLocal("serverUrl");
let siteId = local.getLocal("siteId");
let deviceCode = local.getLocal("devicenum");
......@@ -90,3 +90,18 @@ export const mergeFormToDocx = (data) => {
},
});
};
// 查看样表
export const checkMaterials = (data) => {
let baseUrl = local.getLocal("serverUrl");
let siteId = local.getLocal("siteId");
let deviceCode = local.getLocal("devicenum");
return request({
url: `${baseUrl}sampleform/sample/bill/save`,
method: "post",
data: {
siteId,
deviceCode,
...data,
},
});
};
......@@ -8,7 +8,9 @@
}}个)</span
>
<span class="matter-name flex1 flexwrap"
>事项全称:<span v-html="matterInfo.matterFullName"></span>
>事项全称:<span
v-html="matterInfo.matterFullName || matterInfo.matterName"
></span>
</span>
</div>
<!-- 列表 -->
......@@ -89,7 +91,7 @@ export default {
path: "/showMaterials",
query: {
matterName: this.matterInfo.matterName,
matterId: this.matterInfo.id,
matterId: row.matterId,
id: row.id,
},
});
......
......@@ -190,11 +190,13 @@ export default {
},
// mq通讯
WebSocketMq(objc) {
var obj = objc.rabbmitInfo; //mq信息
var serviceInfo = objc.serviceInfo; //服务器信息
var deviceInfo = objc.deviceInfo; //设备信息
var serverUrl = serviceInfo.serverUrl; //系统地址
var siteId = deviceInfo.siteId; //站点id
let obj = objc.rabbmitInfo; //mq信息
let serviceInfo = objc.serviceInfo; //服务器信息
let deviceInfo = objc.deviceInfo; //设备信息
let serverUrl = serviceInfo.serverUrl; //系统地址
let siteId = deviceInfo.siteId; //站点id
let devicenum = objc.devicenum;
local.setLocal("devicenum", devicenum); // 设备编号
// 保存地址
local.setLocal("serverUrl", serverUrl);
local.setLocal("siteId", siteId);
......
......@@ -104,7 +104,7 @@ import Header from "@/components/Header.vue";
import PageTop from "@/components/PageTop.vue";
import SearchBox from "@/components/SearchBox.vue";
import MateralsList from "@/components/MateralsList.vue";
import { getWriteMatterList } from "@/api";
import { getSampleformMatterList } from "@/api";
export default {
components: {
Header,
......@@ -128,21 +128,21 @@ export default {
};
},
created() {
this.getWriteMatterList();
this.getSampleformMatterList();
// this.getAllmaterials();
},
watch: {
searchVal(newVal) {
if (newVal === "") {
this.current = 1;
this.getWriteMatterList();
this.getSampleformMatterList();
}
},
},
methods: {
// 获取事项列表
async getWriteMatterList() {
let res = await getWriteMatterList({
async getSampleformMatterList() {
let res = await getSampleformMatterList({
page: this.current,
size: this.size,
isTerminal: 1,
......@@ -156,12 +156,12 @@ export default {
// 搜索
handleSearch() {
this.current = 1;
this.getWriteMatterList();
this.getSampleformMatterList();
},
// 分页
changePage(cur) {
this.current = cur;
this.getWriteMatterList();
this.getSampleformMatterList();
},
// 查看
handleCheck(row) {
......@@ -247,7 +247,7 @@ export default {
.for-short {
// margin-bottom: 10px;
margin-bottom: 18px;
font-size: 24px;
font-size: 28px;
font-weight: 500;
color: #333333;
overflow: hidden;
......@@ -259,7 +259,7 @@ export default {
}
.name {
margin-bottom: 10px;
font-size: 18px;
font-size: 22px;
font-family: Source Han Sans CN;
color: #888888;
line-height: 24px;
......@@ -275,7 +275,7 @@ export default {
white-space: nowrap;
}
.materials {
font-size: 18px;
font-size: 22px;
font-family: Source Han Sans CN;
color: #333333;
line-height: 28px;
......
......@@ -44,7 +44,7 @@
></div>
<div class="name">
<span class="matter-fullName">事项全称</span
>{{ v.matterFullName }}
>{{ v.matterFullName || v.matterName }}
</div>
</div>
</div>
......@@ -82,7 +82,7 @@ import PageTop from "@/components/PageTop.vue";
import SearchBox from "@/components/SearchBox.vue";
import MateralsList from "../../components/MateralsList.vue";
import YEmpty from "@/components/YEmpty.vue";
import { getWriteMatterList } from "@/api";
import { getDeviceMatterList } from "@/api";
export default {
components: {
......@@ -107,20 +107,20 @@ export default {
};
},
created() {
this.getWriteMatterList();
this.getDeviceMatterList();
},
watch: {
searchVal(newVal) {
if (newVal === "") {
this.current = 1;
this.getWriteMatterList();
this.getDeviceMatterList();
}
},
},
methods: {
// 获取事项列表
async getWriteMatterList() {
let res = await getWriteMatterList({
async getDeviceMatterList() {
let res = await getDeviceMatterList({
page: this.current,
size: this.size,
deptCode: this.deptCode,
......@@ -135,17 +135,17 @@ export default {
changeDept(deptCode) {
this.deptCode = deptCode;
this.current = 1;
this.getWriteMatterList();
this.getDeviceMatterList();
},
// 搜索
handleSearch() {
this.current = 1;
this.getWriteMatterList();
this.getDeviceMatterList();
},
// 分页
changePage(cur) {
this.current = cur;
this.getWriteMatterList();
this.getDeviceMatterList();
},
handleCheck(row) {
this.matterInfo = row;
......
......@@ -74,7 +74,7 @@
:class="{ active: i === active }"
v-for="(v, i) in materailsList"
:key="v.id"
@click="active = i"
@click="changeIndex(v, i)"
>
{{ v.materialName ? v.materialName : v.materiaFullName }}
<div class="line"></div>
......@@ -105,7 +105,7 @@
<script>
import Header from "@/components/Header.vue";
import { getMaterialsList } from "@/api";
import { getMaterialsList, checkMaterials } from "@/api";
import local from "@/utils/local";
export default {
components: {
......@@ -116,6 +116,8 @@ export default {
api: local.getLocal("serverUrl") + "/",
matterInfo: {},
matterName: "", // 事项名称
matterId: this.$route.query.matterId, // 事项id
materailsId: this.$route.query.id, // 材料id
materailsList: [],
active: 0,
scale: 100,
......@@ -139,7 +141,7 @@ export default {
let res = await getMaterialsList({
page: 1,
size: -1,
matterId: this.$route.query.matterId,
matterId: this.matterId,
});
let { data } = res.data.data;
data.forEach((v) => {
......@@ -153,8 +155,18 @@ export default {
this.matterName = this.$route.query.matterName
? this.$route.query.matterName
: data[0].matterName;
let id = this.$route.query.id;
this.active = this.materailsList.findIndex((v) => v.id == id);
this.active = this.materailsList.findIndex(
(v) => v.id == this.materailsId
);
let curInfo = this.materailsList.find((v) => v.id == this.materailsId);
// 统计报表
this.checkMaterials(
curInfo.matterId,
curInfo.matterName,
curInfo.matterFullName,
curInfo.materialName,
curInfo.materialFullName
);
},
// 放大
......@@ -173,6 +185,34 @@ export default {
this.scale = 100;
}
},
// 统计报表
async checkMaterials(
matterId,
matterName,
matterFullName,
materialName,
materialFullName
) {
await checkMaterials({
matterId,
matterName,
matterFullName,
materialName,
materialFullName,
});
},
// 切换材料
changeIndex(row, index) {
this.active = index;
this.checkMaterials(
row.matterId,
row.matterName,
"",
row.materialName,
row.materialFullName
);
console.log(row);
},
},
};
</script>
......
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