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

pref:修改事项材料页面

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