Commit 76d3caa3 authored by 赵啸非's avatar 赵啸非

修改首页列表与数量

parent eff03961
...@@ -4,19 +4,19 @@ ...@@ -4,19 +4,19 @@
<div slot="title" class="title flex aic"> <div slot="title" class="title flex aic">
<span <span
>材料列表(共{{ >材料列表(共{{
matterInfo.materals ? matterInfo.materals.length : 0 matterInfo.matterDatumList ? matterInfo.matterDatumList.length : 0
}}个)</span }}个)</span
> >
<span class="matter-name">事项名称:{{ matterInfo.matterName }}</span> <span class="matter-name">事项名称:{{ matterInfo.matterName }}</span>
</div> </div>
<!-- 列表 --> <!-- 列表 -->
<div <div
class="materals-list flex flexwrap jcb" class="matterDatumList-list flex flexwrap jcb"
v-if="matterInfo.materals && matterInfo.materals.length" v-if="matterInfo.matterDatumList && matterInfo.matterDatumList.length"
> >
<div <div
class="materals-item flex flexc aic" class="matterDatumList-item flex flexc aic"
v-for="v in matterInfo.materals" v-for="v in matterInfo.matterDatumList"
:key="v.id" :key="v.id"
@click="handleWrite" @click="handleWrite"
> >
...@@ -24,15 +24,15 @@ ...@@ -24,15 +24,15 @@
<img :src="api + v.preViewPath" /> <img :src="api + v.preViewPath" />
</div> </div>
<div class="for-short">{{ v.materialName }}</div> <div class="for-short">{{ v.materialName }}</div>
<div class="materals-name"> <div class="matterDatumList-name">
{{ v.materiaFullName }} {{ v.materiaFullName }}
</div> </div>
<!-- <div class="check-btn" @click.stop>点击查看二维码</div> --> <!-- <div class="check-btn" @click.stop>点击查看二维码</div> -->
</div> </div>
<div <div
class="list" class="list"
v-for="item in row - (matterInfo.materals.length % row)" v-for="item in row - (matterInfo.matterDatumList.length % row)"
v-show="matterInfo.materals.length % row > 0" v-show="matterInfo.matterDatumList.length % row > 0"
:key="'list' + item" :key="'list' + item"
></div> ></div>
</div> </div>
...@@ -62,7 +62,7 @@ export default { ...@@ -62,7 +62,7 @@ export default {
return { return {
api: local.getLocal("baseUrl") api: local.getLocal("baseUrl")
? local.getLocal("baseUrl") + "/" ? local.getLocal("baseUrl") + "/"
: "http://192.168.0.98:11074/", : "http://192.168.0.98:11078",
row: 5, row: 5,
}; };
}, },
...@@ -116,7 +116,7 @@ export default { ...@@ -116,7 +116,7 @@ export default {
white-space: nowrap; white-space: nowrap;
} }
} }
.materals-list { .matterDatumList-list {
width: 100%; width: 100%;
height: 100%; height: 100%;
align-content: flex-start; align-content: flex-start;
...@@ -129,7 +129,7 @@ export default { ...@@ -129,7 +129,7 @@ export default {
overflow: hidden; overflow: hidden;
} }
} }
.materals-item { .matterDatumList-item {
width: 19%; width: 19%;
margin-top: 40px; margin-top: 40px;
// height: 430px; // height: 430px;
...@@ -154,7 +154,7 @@ export default { ...@@ -154,7 +154,7 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.materals-name { .matterDatumList-name {
font-size: 18px; font-size: 18px;
font-family: Source Han Sans CN; font-family: Source Han Sans CN;
color: #777777; color: #777777;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<PageTop> <PageTop>
<div slot="count" class="count"> <div slot="count" class="count">
共计<span class="data-count">{{ matterTotal }}</span 共计<span class="data-count">{{ matterTotal }}</span
>件事项,<span class="data-count">{{ materals.total }}</span >件事项,<span class="data-count">{{ matterDatumTotal }}</span
>份表单 >份表单
</div> </div>
<SearchBox <SearchBox
...@@ -22,22 +22,22 @@ ...@@ -22,22 +22,22 @@
<div class="matter-list" v-if="matterList.length"> <div class="matter-list" v-if="matterList.length">
<div <div
class="matter-item" class="matter-item"
v-for="v in matterList" v-for="matter in matterList"
:key="v.id" :key="matter.id"
@click="handleCheck(v)" @click="handleCheck(matter)"
> >
<div class="for-short">{{ v.matterName }}</div> <div class="for-short" v-html="matter.matterName"></div>
<div class="name"> <div class="name">
{{ v.matterFullName }} {{ matter.matterFullName }}
</div> </div>
<div <div
class="materials" class="materials"
v-for="(item, index) in v.materals" v-for="(item,index) in matter.matterDatumList"
:key="item.id" :key="item.id"
> >
·{{ item.materiaFullName }} ·{{ item.materiaFullName }}
<span v-if="index > 2">{{ <span v-if="index>2">{{
`等${v.materals && v.materals.length}份材料` `等${matter.matterDatumList && matter.matterDatumList.length}份材料`
}}</span> }}</span>
</div> </div>
</div> </div>
...@@ -78,7 +78,7 @@ import Header from "@/components/Header.vue"; ...@@ -78,7 +78,7 @@ import Header from "@/components/Header.vue";
import PageTop from "@/components/PageTop.vue"; import PageTop from "@/components/PageTop.vue";
import SearchBox from "@/components/SearchBox.vue"; import SearchBox from "@/components/SearchBox.vue";
import MateralsList from "@/components/MateralsList.vue"; import MateralsList from "@/components/MateralsList.vue";
import { getWriteMatterList, getMaterialsList } from "@/api"; import { getWriteMatterList } from "@/api";
export default { export default {
components: { components: {
Header, Header,
...@@ -96,19 +96,20 @@ export default { ...@@ -96,19 +96,20 @@ export default {
matterInfo: {}, matterInfo: {},
visible: false, visible: false,
matterTotal: 0, matterTotal: 0,
matterDatumTotal: 0,
matterList: [], // 事项列表 matterList: [], // 事项列表
materals: [], // 所有材料列表 matterDatumList: [], // 所有材料列表
}; };
}, },
created() { created() {
this.getWriteMatterList(); this.getWriteMatterList();
this.getAllmaterials(); // this.getAllmaterials();
}, },
watch: { watch: {
searchVal(newVal) { searchVal(newVal) {
if (newVal === "") { if (newVal === "") {
this.getWriteMatterList(); this.getWriteMatterList();
this.getAllmaterials(); // this.getAllmaterials();
} }
}, },
}, },
...@@ -121,19 +122,20 @@ export default { ...@@ -121,19 +122,20 @@ export default {
matterName: this.searchVal, matterName: this.searchVal,
}); });
let { total, data } = res.data.data; let { total, data } = res.data.data;
data.forEach(async (v) => { // data.forEach(async (v) => {
v.materals = []; // v.matterDatumList = [];
let obj = await this.getMaterialsList(1, -1, v.id); // let obj = await this.getMaterialsList(1, -1, v.id);
obj.data.forEach((item) => { // obj.data.forEach((item) => {
v.materals.push(item); // v.matterDatumList.push(item);
}); // });
}); // });
this.matterList = data; this.matterList = data;
// this.matterDatumList=data.matterDatumList
this.matterTotal = total; this.matterTotal = total;
}, },
// 获取所有材料 // 获取所有材料
async getAllmaterials() { /* async getAllmaterials() {
this.materals = await this.getMaterialsList(1, 3, null, this.searchVal); this.matterDatumList = await this.getMaterialsList(1, 3, null, this.searchVal);
}, },
// 获取材料列表 // 获取材料列表
async getMaterialsList(page = 1, size = 3, matterId, materialName) { async getMaterialsList(page = 1, size = 3, matterId, materialName) {
...@@ -148,11 +150,11 @@ export default { ...@@ -148,11 +150,11 @@ export default {
total, total,
data, data,
}; };
}, },*/
// 搜索 // 搜索
handleSearch() { handleSearch() {
this.getWriteMatterList(); this.getWriteMatterList();
this.getAllmaterials(); // this.getAllmaterials();
}, },
// 分页 // 分页
changePage(cur) { changePage(cur) {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
:key="v.id" :key="v.id"
@click="handleCheck(v)" @click="handleCheck(v)"
> >
<div class="for-short">{{ v.matterName }}</div> <div class="for-short" v-html="v.matterName"></div>
<div class="name">事项名称:{{ v.matterFullName }}</div> <div class="name">事项名称:{{ v.matterFullName }}</div>
</div> </div>
</div> </div>
...@@ -69,7 +69,7 @@ import LeftMenus from "./components/LeftMenus.vue"; ...@@ -69,7 +69,7 @@ import LeftMenus from "./components/LeftMenus.vue";
import PageTop from "@/components/PageTop.vue"; import PageTop from "@/components/PageTop.vue";
import SearchBox from "@/components/SearchBox.vue"; import SearchBox from "@/components/SearchBox.vue";
import MateralsList from "../../components/MateralsList.vue"; import MateralsList from "../../components/MateralsList.vue";
import {getWriteMatterList, getMaterialsList} from "@/api"; import {getWriteMatterList} from "@/api";
export default { export default {
components: { components: {
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
}, },
created() { created() {
this.getWriteMatterList(); this.getWriteMatterList();
this.getAllmaterials(); // this.getAllmaterials();
}, },
watch: { watch: {
searchVal(newVal) { searchVal(newVal) {
...@@ -125,7 +125,7 @@ export default { ...@@ -125,7 +125,7 @@ export default {
this.matterList = data; this.matterList = data;
this.matterTotal = total; this.matterTotal = total;
}, },
// 获取材料 /* // 获取材料
async getAllmaterials() { async getAllmaterials() {
this.materals = await this.getMaterialsList(1, 3, null); this.materals = await this.getMaterialsList(1, 3, null);
}, },
...@@ -142,13 +142,13 @@ export default { ...@@ -142,13 +142,13 @@ export default {
total, total,
data, data,
}; };
}, },*/
// 切换部门 // 切换部门
changeDept(deptCode) { changeDept(deptCode) {
this.deptCode = deptCode; this.deptCode = deptCode;
this.current = 1; this.current = 1;
this.getWriteMatterList(); this.getWriteMatterList();
this.getAllmaterials(); //this.getAllmaterials();
}, },
// 分页 // 分页
changePage(cur) { changePage(cur) {
...@@ -156,7 +156,9 @@ export default { ...@@ -156,7 +156,9 @@ export default {
this.getWriteMatterList(); this.getWriteMatterList();
}, },
handleCheck(row) { handleCheck(row) {
console.log("onclick row",row)
this.matterInfo = row; this.matterInfo = row;
console.log("lens",this.matterInfo.matterDatumList.length)
this.visible = true; this.visible = true;
}, },
}, },
......
...@@ -109,7 +109,7 @@ export default { ...@@ -109,7 +109,7 @@ export default {
return { return {
api: local.getLocal("baseUrl") api: local.getLocal("baseUrl")
? local.getLocal("baseUrl") + "/" ? local.getLocal("baseUrl") + "/"
: "http://192.168.0.98:11074", : "http://192.168.0.98:11078",
matterInfo: this.$route.query, matterInfo: this.$route.query,
materailsList: [], materailsList: [],
active: 0, active: 0,
...@@ -121,6 +121,11 @@ export default { ...@@ -121,6 +121,11 @@ export default {
}, },
created() { created() {
this.getMaterialsList(); this.getMaterialsList();
console.log("matterDatumList",this.matterInfo.matterDatumList)
// this.materailsList=this.matterInfo.matterDatumList;
}, },
methods: { methods: {
......
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