Commit 8d29c2d1 authored by “yiyousong”'s avatar “yiyousong”

pref:修改事项材料页面

parent 2e5dfaf8
...@@ -2,19 +2,33 @@ ...@@ -2,19 +2,33 @@
<template> <template>
<div class="applymaterial"> <div class="applymaterial">
<a-button class="addclass" @click="showModal">新增材料</a-button> <a-button class="addclass" @click="showModal">新增材料</a-button>
<div class="table-content"> <div class="table-content mt20">
<Standardtable <!-- 表格 -->
<a-table
bordered
:loading="loading"
:pagination="{
showTotal: (total) => `共 ${total} 条`,
current: current,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onChange: handlechange,
onShowSizeChange: showSizeChange,
}"
:scroll="{ y: 550 }"
:columns="columns" :columns="columns"
:dataSource="dataSource" :data-source="dataSource"
:bordered="true" :rowKey="(record) => record.id"
:selectedRows="selectedRows"
:isShow="false"
:pagination="false"
@selectedRowChange="callback"
> >
<span slot="num" slot-scope="{ index }">{{ index + 1 }}</span> <template slot="num" slot-scope="text, record, index">
<span>
<template slot="look" slot-scope="{ text }"> {{ (current - 1) * size + index + 1 }}
</span>
</template>
<template slot="look" slot-scope="text">
<span class="kong mr" @click="downloadEmpty(text.matterDatumFileList)" <span class="kong mr" @click="downloadEmpty(text.matterDatumFileList)"
>空白表格</span >空白表格</span
> >
...@@ -24,31 +38,19 @@ ...@@ -24,31 +38,19 @@
>示例样表</span >示例样表</span
> >
</template> </template>
<template slot="operate" slot-scope="{ text }"> <template slot="operate" slot-scope="text">
<span class="look_more mr" @click="readMore(text)">查看更多</span> <span class="look_more mr" @click="readMore(text)">查看更多</span>
<span class="edit mr" @click="editMaterial(text)">编辑</span> <span class="edit mr" @click="editMaterial(text)">编辑</span>
<a-popconfirm <span class="del">删除</span>
title="删除不可恢复,确定要删除吗?"
@confirm="delMaterial(text.id)"
>
<a-icon slot="icon" type="question-circle-o" style="color: red" />
<span class="del">删除</span>
</a-popconfirm>
</template> </template>
</Standardtable> </a-table>
</div> </div>
<!-- 翻页 -->
<a-pagination
v-model="current"
:total="total"
@change="handlechange"
:pageSize="size"
show-less-items
/>
<!-- 新增材料对话框 --> <!-- 新增材料对话框 -->
<addmaterials <addmaterials
ref="addmaterials" ref="addmaterials"
:formVisible.sync="formVisible" :formVisible.sync="formVisible"
:dict="dict"
></addmaterials> ></addmaterials>
<!-- 查看更多 --> <!-- 查看更多 -->
<material-details <material-details
...@@ -66,7 +68,6 @@ ...@@ -66,7 +68,6 @@
<script> <script>
import local from "@/utils/local"; import local from "@/utils/local";
import Standardtable from "@/components/table/StandardTable.vue";
import addmaterials from "../group/addmaterials.vue"; import addmaterials from "../group/addmaterials.vue";
import materialDetails from "../group/materialDetails.vue"; import materialDetails from "../group/materialDetails.vue";
import downloadTable from "../group/downloadTable.vue"; import downloadTable from "../group/downloadTable.vue";
...@@ -108,7 +109,6 @@ let columns = [ ...@@ -108,7 +109,6 @@ let columns = [
]; ];
export default { export default {
components: { components: {
Standardtable,
addmaterials, addmaterials,
materialDetails, materialDetails,
downloadTable, downloadTable,
...@@ -118,6 +118,9 @@ export default { ...@@ -118,6 +118,9 @@ export default {
return { return {
title: "下载空白表格", title: "下载空白表格",
columns, columns,
dict: {}, // 材料字典
loading: false,
pageSizeOptions: ["10", "30", "50", "100"],
dataSource: [], dataSource: [],
selectedRows: [], // 选中数据 selectedRows: [], // 选中数据
formVisible: false, formVisible: false,
...@@ -137,19 +140,23 @@ export default { ...@@ -137,19 +140,23 @@ export default {
// 获取申请材料列表 // 获取申请材料列表
async getMatterDatumData() { async getMatterDatumData() {
if (local.getLocal("matter")) { if (local.getLocal("matter")) {
this.loading = true;
let res = await getMatterDatumList({ let res = await getMatterDatumList({
page: this.current, page: this.current,
size: this.size, size: this.size,
matterId: local.getLocal("matter").id, matterId: local.getLocal("matter").id,
matterName: local.getLocal("matter").matterName, matterName: local.getLocal("matter").matterName,
}); });
let { data } = res.data; this.loading = false;
let { data, dict } = res.data;
if (!data.data.length && this.current > 1) { if (!data.data.length && this.current > 1) {
this.current -= 1; this.current -= 1;
this.getMatterDatumData(); this.getMatterDatumData();
} }
this.total = data.total; this.total = data.total;
this.dataSource = data.data; this.dataSource = data.data;
this.dict = dict;
console.log(dict);
} }
}, },
// 选中数据 // 选中数据
...@@ -170,6 +177,11 @@ export default { ...@@ -170,6 +177,11 @@ export default {
this.current = num; this.current = num;
this.getMatterDatumData(); this.getMatterDatumData();
}, },
// 改变每页显示数量
showSizeChange(size) {
this.size = size;
this.getMatterDatumData();
},
// 删除 // 删除
async delMaterial(val) { async delMaterial(val) {
let res = await delMatterDatum({ id: val }); let res = await delMatterDatum({ id: val });
......
...@@ -28,7 +28,22 @@ ...@@ -28,7 +28,22 @@
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="所属部门" prop="deptId"> <a-form-model-item label="所属部门" prop="deptId">
<a-select <a-select
style="width: 260px" showSearch
v-model="form.deptId"
optionFilterProp="label"
placeholder="请选择部门"
@change="handleChange"
>
<a-select-option
v-for="v in deptList"
:key="v.id"
:value="v.deptNumber"
:label="v.name"
>
{{ v.name }}</a-select-option
>
</a-select>
<!-- <a-select
placeholder="请选择部门" placeholder="请选择部门"
v-model="form.deptId" v-model="form.deptId"
@change="handleChange" @change="handleChange"
...@@ -41,7 +56,7 @@ ...@@ -41,7 +56,7 @@
> >
{{ v.name }} {{ v.name }}
</a-select-option> </a-select-option>
</a-select> </a-select> -->
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -199,15 +214,15 @@ export default { ...@@ -199,15 +214,15 @@ export default {
{ required: true, message: "部门不能为空", trigger: "change" }, { required: true, message: "部门不能为空", trigger: "change" },
], ],
name: [{ required: true, message: "窗口名不能为空", trigger: "blur" }], name: [{ required: true, message: "窗口名不能为空", trigger: "blur" }],
englishName: [ // englishName: [
{ required: true, message: "窗口英语名不能为空", trigger: "blur" }, // { required: true, message: "窗口英语名不能为空", trigger: "blur" },
], // ],
region: [ // region: [
{ required: true, message: "窗口区域不能为空", trigger: "blur" }, // { required: true, message: "窗口区域不能为空", trigger: "blur" },
], // ],
englishRegion: [ // englishRegion: [
{ required: true, message: "窗口英语区域不能为空", trigger: "blur" }, // { required: true, message: "窗口英语区域不能为空", trigger: "blur" },
], // ],
fromnum: [ fromnum: [
{ required: true, validator: changeWindowNumber, trigger: "blur" }, { required: true, validator: changeWindowNumber, trigger: "blur" },
], ],
......
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