资讯分类

This commit is contained in:
闫晓茹 2023-02-20 16:38:04 +08:00
parent 0d44d736d6
commit 13c472f020

View File

@ -17,6 +17,36 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="资讯分类" prop="informationCategoryId">
<el-button
type=""
v-if="queryParams.informationCategoryName == '请选择资讯分类'"
@click="clickitem()"
style="
width: 250px;
text-align: left;
height: 36px;
color: #c0c4cc;
overflow: hidden;
"
>{{ queryParams.informationCategoryName }}</el-button
>
<el-button
@click="clickitem()"
type=""
v-else
style="
width: 250px;
text-align: left;
height: 36px;
padding-left: -10px;
overflow: hidden;
"
>{{ queryParams.informationCategoryName }}</el-button
>
</el-form-item>
<!-- </el-form-item> -->
<el-form-item label="资讯编码" prop="informationCode"> <el-form-item label="资讯编码" prop="informationCode">
<el-input <el-input
v-model="queryParams.informationCode" v-model="queryParams.informationCode"
@ -100,15 +130,19 @@
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="主键id" align="center" prop="id" /> --> <!-- <el-table-column label="主键id" align="center" prop="id" /> -->
<el-table-column <el-table-column
label="资讯标题" label="资讯标题"
align="center" align="center"
prop="informationTitle" prop="informationTitle"
/> />
<el-table-column label="资讯编码" align="center" prop="informationCode" /> <el-table-column label="资讯编码" align="center" prop="informationCode" />
<el-table-column label="资讯分类" align="center" prop="informationCategoryName" /> <el-table-column
label="资讯分类"
align="center"
prop="informationCategoryName"
/>
<el-table-column label="显示顺序" align="center" prop="informationSort" /> <el-table-column label="显示顺序" align="center" prop="informationSort" />
<el-table-column <el-table-column
label="操作" label="操作"
@ -216,7 +250,6 @@
placeholder="请输入资讯图文内容" placeholder="请输入资讯图文内容"
style="width: 80%; margin-left: 18%; margin-top: -5%" style="width: 80%; margin-left: 18%; margin-top: -5%"
v-model="form.informationContent" v-model="form.informationContent"
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -344,6 +377,104 @@
@pagination="informationInfoinfo" @pagination="informationInfoinfo"
/> />
</el-dialog> </el-dialog>
<!-- 搜索选择资讯 -->
<el-dialog
title="选择资讯"
:visible.sync="innerVisiblezx"
width="1000px"
append-to-body
:before-close="innerVisiblecancelzx"
>
<el-form
ref="queryForm"
:model="informationqueryParams"
:rules="rules"
label-width="80px"
:inline="true"
>
<el-form-item
label="资讯分类编码"
prop="informationCategoryCode"
label-width="120"
>
<el-input
v-model="informationqueryParams.informationCategoryCode"
placeholder="请输入资讯分类编码"
clearable
/>
</el-form-item>
<el-form-item
label="资讯分类名称"
prop="informationCategoryName"
label-width="120"
>
<el-input
v-model="informationqueryParams.informationCategoryName"
placeholder="请输入资讯分类名称"
clearable
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="informationInfoinfo"
>搜索</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="addresetQuerylist"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table
:data="infolist"
@cell-dblclick="nurseclickzx"
v-loading="loading"
>
<el-table-column label="请选择" width="100" align="center">
<template slot-scope="scope">
<el-button
type="primary"
style="width: 15px; height: 15px"
v-if="queryParams.informationCategoryId == scope.row.id"
circle
@click="nurseclickzx(scope.row)"
></el-button>
<el-button
v-else
style="width: 15px; height: 15px"
circle
@click="nurseclickzx(scope.row)"
></el-button>
</template>
</el-table-column>
<el-table-column
property="informationCategoryCode"
label="资讯分类编码"
align="center"
>
</el-table-column>
<el-table-column
property="informationCategoryName"
label="资讯名称"
align="center"
:show-overflow-tooltip="true"
>
</el-table-column>
</el-table>
<pagination
v-show="total2 > 0"
:total="total2"
:page.sync="informationqueryParams.pageNum"
:limit.sync="informationqueryParams.pageSize"
@pagination="informationInfoinfo"
/>
</el-dialog>
</div> </div>
</template> </template>
@ -372,11 +503,13 @@ export default {
// //
multiple: true, multiple: true,
innerVisible: false, innerVisible: false,
innerVisiblezx: false,
informationqueryParams: { informationqueryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
informationCategoryCode: "", informationCategoryCode: "",
informationCategoryName: "", informationCategoryName: "",
informationCategoryId: "",
}, },
// //
showSearch: true, showSearch: true,
@ -395,6 +528,7 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
informationCategoryName: "请选择资讯分类",
informationCategoryId: null, informationCategoryId: null,
informationTitle: null, informationTitle: null,
informationCode: null, informationCode: null,
@ -448,7 +582,6 @@ export default {
required: true, required: true,
message: "请输入资讯图文内容", message: "请输入资讯图文内容",
trigger: "blur", trigger: "blur",
}, },
], ],
}, },
@ -460,11 +593,13 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
innerVisiblecancel() { innerVisiblecancel() {
this.innerVisible = false; this.innerVisible = false;
}, },
innerVisiblecancelzx() {
this.innerVisiblezx = false;
},
// //
addresetQuery() { addresetQuery() {
this.queryParams = { this.queryParams = {
@ -472,6 +607,7 @@ export default {
pageSize: 10, pageSize: 10,
informationCategoryCode: "", informationCategoryCode: "",
informationTitle: "", informationTitle: "",
informationCategoryName: "",
}; };
this.getList(); this.getList();
}, },
@ -493,15 +629,15 @@ export default {
}); });
}, },
// //
clickinnerVisible() { clickinnerVisible() {
this.informationInfoinfo(); this.informationInfoinfo();
// this.form.informationCategoryId =
// this.nurseStationqueryParams.informationCategoryId;
// this.nnerVisibleindex = index;
// console.log(this.nnerVisibleindex);
this.innerVisible = true; this.innerVisible = true;
}, },
clickitem() {
this.informationInfoinfo();
this.innerVisiblezx = true;
},
imgUrl(imgUrl) { imgUrl(imgUrl) {
this.form.leadThumbnailUrl = imgUrl; this.form.leadThumbnailUrl = imgUrl;
}, },
@ -530,29 +666,24 @@ export default {
updatePicture(obj).then((res) => {}); updatePicture(obj).then((res) => {});
} }
if (this.imgsurl.pictureUrlList.length > 0) { if (this.imgsurl.pictureUrlList.length > 0) {
updatePicture(this.imgsurl).then((res) => {}); updatePicture(this.imgsurl).then((res) => {});
} }
this.imgsurl = { pictureUrlList: [] }; this.imgsurl = { pictureUrlList: [] };
// var obj = { pictureUrlList: [] };
// if (this.form.leadThumbnailUrl != this.leadThumbnailUrl) {
// obj.pictureUrlList.push(this.leadThumbnailUrl);
// }
// updatePicture(obj).then((res) => {
// this.open = false;
// });
this.open = false; this.open = false;
this.reset(); this.reset();
}, },
nurseclick(row) { nurseclick(row) {
console.log(row); console.log(row);
this.form.informationCategoryId = row.id; this.form.informationCategoryId = row.id;
this.form.informationCategoryName = row.informationCategoryName; this.form.informationCategoryName = row.informationCategoryName;
// }
this.innerVisible = false; this.innerVisible = false;
}, },
nurseclickzx(row) {
this.queryParams.informationCategoryId = row.id;
this.queryParams.informationCategoryName = row.informationCategoryName;
this.innerVisiblezx = false;
},
// //
reset() { reset() {
this.form = { this.form = {
@ -588,7 +719,8 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
informationCategoryCode: "", informationCategoryCode: "",
informationCategoryName: "", informationCategoryName: "请选择资讯分类",
// informationCategoryName:"",
}; };
this.informationInfoinfo(); this.informationInfoinfo();
this.handleQuery(); this.handleQuery();
@ -621,7 +753,6 @@ export default {
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
updateInformationInfo(this.form).then((response) => { updateInformationInfo(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
@ -637,7 +768,7 @@ export default {
this.getList(); this.getList();
}); });
} else { } else {
this.form.informationSort=parseInt( this.form.informationSort) this.form.informationSort = parseInt(this.form.informationSort);
addInformationInfo(this.form).then((response) => { addInformationInfo(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;