政策申办统计导入
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<el-input v-model="form.title" placeholder="请输入标题" :maxlength="50" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发布地区" prop="areaId">
|
||||
<ai-area-get :instance="instance" v-model="form.areaId" :root="rootArea" valueLevel="5"/>
|
||||
<ai-area-get :instance="instance" v-model="form.areaId" :root="rootArea" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文章类型" prop="moduleId" style="width:50%;">
|
||||
<ai-select v-model="form.moduleId" :selectList="miniTypeList" @change="getNewTypeList"/>
|
||||
@@ -21,7 +21,7 @@
|
||||
<el-form-item label="正文" prop="content" style="width: 100%;">
|
||||
<ai-editor v-model="form.content" :instance="instance"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="封面图片(最多1张)" >
|
||||
<el-form-item label="封面图片" >
|
||||
<ai-uploader
|
||||
:isShowTip="true"
|
||||
:instance="instance"
|
||||
@@ -32,7 +32,7 @@
|
||||
<template slot="tips">最多上传1张图片,单张图片最大10MB<br/>支持.png,.jpg,.jpeg格式</template>
|
||||
</ai-uploader>
|
||||
</el-form-item>
|
||||
<el-form-item label="附件附件" prop="fileList">
|
||||
<el-form-item label="附件附件" prop="files">
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
action
|
||||
@@ -86,7 +86,10 @@ export default {
|
||||
rules() {
|
||||
return {
|
||||
title: [{required: true, message: "请输入标题"}],
|
||||
areaId: [{required: true, message: "请选择发布地区"}],
|
||||
areaId: [
|
||||
{message: "请选择发布地区", required: true, trigger: "blur"},
|
||||
{validator: (r, v, cb) => v && /0{3}$/g.test(v) ? cb('发布地区必须选到村级') : cb(), trigger: "blur"}
|
||||
],
|
||||
moduleId: [{required: true, message: "请选择文章类型"}],
|
||||
categoryId: [{required: true, message: "选择分类"}],
|
||||
}
|
||||
@@ -100,7 +103,7 @@ export default {
|
||||
form: {
|
||||
pictureUrlList: [],
|
||||
pictureUrl: '',
|
||||
file: []
|
||||
files: []
|
||||
},
|
||||
miniTypeList: [],
|
||||
newTypeList: []
|
||||
@@ -112,9 +115,9 @@ export default {
|
||||
const isLt10M = file.file.size / 1024 / 1024 < 10;
|
||||
if (!isLt10M) {
|
||||
this.$message.error("附件大小不超过10mb!");
|
||||
for (let i = 0; i < this.fileList.length; i++) {
|
||||
if (this.fileList[i].uid == file.file.uid) {
|
||||
this.fileList.splice(i, 1);
|
||||
for (let i = 0; i < this.form.files.length; i++) {
|
||||
if (this.form.files[i].uid == file.file.uid) {
|
||||
this.form.files.splice(i, 1);
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -124,33 +127,23 @@ export default {
|
||||
this.instance.post(`/admin/file/add`, formData, {withCredentials: false}).then(res => {
|
||||
if (res && res.code == 0) {
|
||||
let img = res.data[0].split(';');
|
||||
this.fileList.forEach((item, index) => {
|
||||
this.form.files.forEach((item, index) => {
|
||||
if (item.uid == file.file.uid) {
|
||||
this.fileList[index].id = img[1];
|
||||
this.form.files[index].id = img[1];
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
this.fileList = fileList;
|
||||
this.form.files = fileList;
|
||||
},
|
||||
handleChange(file, fileList) {
|
||||
this.fileList = fileList;
|
||||
this.form.files = fileList;
|
||||
},
|
||||
back() {
|
||||
this.$router.push({})
|
||||
},
|
||||
getDetail() {
|
||||
let {id} = this.$route.query
|
||||
id && this.instance.post("/app/apppreventionreturntopoverty/queryDetailById", null, {
|
||||
params: {id}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.form = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
this.$refs.ruleForm.validate(v => {
|
||||
if (v) {
|
||||
@@ -166,6 +159,23 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
getDetail() {
|
||||
let {id} = this.$route.query
|
||||
if(!id) {
|
||||
return
|
||||
}
|
||||
id && this.instance.post("/app/apppreventionreturntopoverty/queryDetailById", null, {
|
||||
params: {id}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
if(res.data.pictureUrl) {
|
||||
res.data.pictureUrlList = [{url: res.data.pictureUrl}]
|
||||
}
|
||||
this.form = res.data
|
||||
this.getNewTypeList()
|
||||
}
|
||||
})
|
||||
},
|
||||
getTypeList() {
|
||||
let {parentId} = this.$route.query
|
||||
this.instance.post(`/app/apppublicitycategory/list?categoryType=1&size=100&parentId=${parentId}`).then(res => {
|
||||
@@ -192,7 +202,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getTypeList()
|
||||
// this.getDetail()
|
||||
this.getDetail()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<div class="content">
|
||||
<ai-search-bar>
|
||||
<template #right>
|
||||
<el-input size="small" placeholder="请输入标题" v-model="search.con" clearable @change="page.current=1,getTableData()"/>
|
||||
<el-input size="small" placeholder="请输入标题" v-model="search.title" clearable @change="page.current=1,getTableData()"/>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-search-bar>
|
||||
@@ -44,7 +44,7 @@
|
||||
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size"
|
||||
@getList="getTableData" :col-configs="colConfigs" :dict="dict"
|
||||
@selection-change="v=>ids=v.map(e=>e.id)">
|
||||
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||
<el-table-column slot="options" label="操作" fixed="right" align="center" width='150px'>
|
||||
<template slot-scope="{row}">
|
||||
<el-button type="text" @click="showDetail(row.id)">编辑</el-button>
|
||||
<el-button type="text" @click="handleDelete(row.id)">删除</el-button>
|
||||
@@ -93,16 +93,16 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
search: {name: ""},
|
||||
search: {title: ""},
|
||||
page: {current: 1, size: 10, total: 0},
|
||||
newPage: {current: 1, size: 10, total: 0},
|
||||
tableData: [],
|
||||
colConfigs: [
|
||||
{label: "标题", prop: "name", align: "center"},
|
||||
{label: "地区", prop: "sex", dict: 'sex', align: "center"},
|
||||
{label: "浏览次数", prop: "age", align: "center"},
|
||||
{label: "发布人", prop: "nation", align: "center", dict: "fpNation"},
|
||||
{label: "发布时间", prop: "education", align: "center", dict: "fpEducation"},
|
||||
{label: "标题", prop: "title", align: "center"},
|
||||
{label: "地区", prop: "areaName", align: "center", width: '150px'},
|
||||
{label: "浏览次数", prop: "viewCount", align: "center", width: '100px'},
|
||||
{label: "发布人", prop: "createUserName", align: "center", width: '100px'},
|
||||
{label: "发布时间", prop: "createTime", align: "center", width: '100px'},
|
||||
{slot: "options"}
|
||||
],
|
||||
colConfigsNew: [
|
||||
@@ -113,9 +113,6 @@ export default {
|
||||
dialog: false,
|
||||
form: {},
|
||||
rules: {
|
||||
// type0: [{required: true, message: "请输入板块名称", trigger: "change"}],
|
||||
// type1: [{required: true, message: "请输入模块名称", trigger: "change"}],
|
||||
// type2: [{required: true, message: "请输入分类名称", trigger: "change"}],
|
||||
categoryName: '',
|
||||
showIndex: [{required: true, message: "请输入排序", trigger: "change"}],
|
||||
},
|
||||
@@ -132,7 +129,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getTableData() {
|
||||
this.instance.post("/app/apppreventionreturntopoverty/list", null, {
|
||||
this.instance.post("/app/apppublicityinfo/list", null, {
|
||||
params: {...this.page, ...this.search}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
@@ -145,8 +142,8 @@ export default {
|
||||
this.$router.push({query: {id: id, parentId: this.typeList[this.typeIndex].id}, hash: "#add"})
|
||||
},
|
||||
handleDelete(ids) {
|
||||
this.$confirm("是否要删除监测对象").then(() => {
|
||||
this.instance.post("/app/apppreventionreturntopoverty/delete", null, {
|
||||
this.$confirm("是否删除该条宣传资讯信息").then(() => {
|
||||
this.instance.post("/app/apppublicityinfo/delete", null, {
|
||||
params: {ids: ids?.toString()}
|
||||
}).then(res => {
|
||||
if (res?.code == 0) {
|
||||
|
||||
@@ -10,6 +10,25 @@
|
||||
</template>
|
||||
<template #right>
|
||||
<el-input size="small" placeholder="申请人/申请主体/事项名称" v-model="search.name" clearable @change="page.current=1,getTableData()"/>
|
||||
<ai-import
|
||||
ref="import"
|
||||
title="导入"
|
||||
name="政策申办数据统计"
|
||||
url="/appzwspstatistics/downloadTemplate"
|
||||
importUrl="/appzwspstatistics/import"
|
||||
suffixName="xlsx"
|
||||
:customCliker="true"
|
||||
:instance="instance"
|
||||
>
|
||||
<template slot="tips">
|
||||
<p>
|
||||
如果表格中已经存在数据,则会被本次导入的数据覆盖;不存在数据,系统将生成新的标准记录;
|
||||
</p>
|
||||
</template>
|
||||
<el-button size="small" icon="iconfont iconImport"
|
||||
>导入</el-button
|
||||
>
|
||||
</ai-import>
|
||||
<ai-download :instance="instance" url="/appzwspstatistics/export" :params="search" fileName="政策申办数据统计" :disabled="tableData.length == 0">
|
||||
<el-button icon="iconfont iconExported" :disabled="tableData.length == 0">导出</el-button>
|
||||
</ai-download>
|
||||
|
||||
Reference in New Issue
Block a user