资讯分类

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"
/>
</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-input
v-model="queryParams.informationCode"
@ -100,15 +130,19 @@
>
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="主键id" align="center" prop="id" /> -->
<el-table-column
label="资讯标题"
align="center"
prop="informationTitle"
/>
<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="操作"
@ -216,7 +250,6 @@
placeholder="请输入资讯图文内容"
style="width: 80%; margin-left: 18%; margin-top: -5%"
v-model="form.informationContent"
/>
</el-form-item>
</el-form>
@ -344,6 +377,104 @@
@pagination="informationInfoinfo"
/>
</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>
</template>
@ -372,11 +503,13 @@ export default {
//
multiple: true,
innerVisible: false,
innerVisiblezx: false,
informationqueryParams: {
pageNum: 1,
pageSize: 10,
informationCategoryCode: "",
informationCategoryName: "",
informationCategoryId: "",
},
//
showSearch: true,
@ -395,6 +528,7 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
informationCategoryName: "请选择资讯分类",
informationCategoryId: null,
informationTitle: null,
informationCode: null,
@ -448,7 +582,6 @@ export default {
required: true,
message: "请输入资讯图文内容",
trigger: "blur",
},
],
},
@ -460,11 +593,13 @@ export default {
this.getList();
},
methods: {
innerVisiblecancel() {
this.innerVisible = false;
},
innerVisiblecancelzx() {
this.innerVisiblezx = false;
},
//
addresetQuery() {
this.queryParams = {
@ -472,6 +607,7 @@ export default {
pageSize: 10,
informationCategoryCode: "",
informationTitle: "",
informationCategoryName: "",
};
this.getList();
},
@ -493,15 +629,15 @@ export default {
});
},
//
//
clickinnerVisible() {
this.informationInfoinfo();
// this.form.informationCategoryId =
// this.nurseStationqueryParams.informationCategoryId;
// this.nnerVisibleindex = index;
// console.log(this.nnerVisibleindex);
this.innerVisible = true;
},
clickitem() {
this.informationInfoinfo();
this.innerVisiblezx = true;
},
imgUrl(imgUrl) {
this.form.leadThumbnailUrl = imgUrl;
},
@ -530,29 +666,24 @@ export default {
updatePicture(obj).then((res) => {});
}
if (this.imgsurl.pictureUrlList.length > 0) {
updatePicture(this.imgsurl).then((res) => {});
}
this.imgsurl = { pictureUrlList: [] };
// var obj = { pictureUrlList: [] };
// if (this.form.leadThumbnailUrl != this.leadThumbnailUrl) {
// obj.pictureUrlList.push(this.leadThumbnailUrl);
// }
// updatePicture(obj).then((res) => {
// this.open = false;
// });
updatePicture(this.imgsurl).then((res) => {});
}
this.imgsurl = { pictureUrlList: [] };
this.open = false;
this.reset();
},
nurseclick(row) {
console.log(row);
this.form.informationCategoryId = row.id;
this.form.informationCategoryName = row.informationCategoryName;
// }
this.innerVisible = false;
},
nurseclickzx(row) {
this.queryParams.informationCategoryId = row.id;
this.queryParams.informationCategoryName = row.informationCategoryName;
this.innerVisiblezx = false;
},
//
reset() {
this.form = {
@ -588,7 +719,8 @@ export default {
pageNum: 1,
pageSize: 10,
informationCategoryCode: "",
informationCategoryName: "",
informationCategoryName: "请选择资讯分类",
// informationCategoryName:"",
};
this.informationInfoinfo();
this.handleQuery();
@ -621,7 +753,6 @@ export default {
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateInformationInfo(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
@ -637,7 +768,7 @@ export default {
this.getList();
});
} else {
this.form.informationSort=parseInt( this.form.informationSort)
this.form.informationSort = parseInt(this.form.informationSort);
addInformationInfo(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;