新增页面

des
吕天方 7 months ago
parent bc69b41660
commit e5e3296569

@ -5,8 +5,8 @@ VUE_APP_TITLE = 金鸡湖现代服务业品牌管理系统
ENV = 'development'
# 金鸡湖现代服务业品牌管理系统/开发环境
VUE_APP_BASE_API = 'http://192.168.0.108:9040'
# VUE_APP_BASE_API = 'http://39.101.188.84:9040'
# VUE_APP_BASE_API = 'http://192.168.0.108:9040'
VUE_APP_BASE_API = 'http://39.101.188.84:9040'
# VUE_APP_BASE_API = 'https://idp.sipac.gov.cn/api'
# 路由懒加载

@ -1,6 +1,6 @@
{
"name": "ruoyi",
"version": "1.0.202406241047",
"version": "1.0.202406250959",
"description": "金鸡湖现代服务业品牌管理系统",
"author": "若依",
"license": "MIT",

@ -1,8 +1,6 @@
<template>
<div>
<!-- <el-button type="primary" icon="icon-jc-xihuan">搜索</el-button>
<el-button type="primary" icon="el-icon-search">搜索</el-button>
<el-button type="yellow" icon="el-icon-search">搜索</el-button> -->
</div>
</template>

@ -0,0 +1,292 @@
<template>
<div class="L-public-main" id="L-size-main" v-if="false">
<div class="L-main">
<header id="L-header">
<el-form :inline="true" :model="formInline" size="small" class="demo-form-inline" ref="queryFrom">
<el-col :span="22">
<el-form-item label="规则名称:" prop="enterpriseName">
<el-input v-model.trim="formInline.enterpriseName" placeholder="请输入内容"></el-input>
</el-form-item>
<el-form-item>
<el-button size="mini" @click="resetQuery('queryFrom')"></el-button>
<el-button size="mini" type="primary" @click="handleQuery('queryFrom')"></el-button>
</el-form-item>
</el-col>
<el-col :span="2">
<!-- <el-button type="primary" class="import-btn" icon="icon iconfont icon-jc-shangchuan" size="mini" @click="importBtn"></el-button> -->
<el-button type="primary" class="import-btn" icon="el-icon-plus" size="mini" @click="importBtn"></el-button>
</el-col>
</el-form>
</header>
<section>
<el-table v-loading="loading" :data="tableData" :row-class-name="tableRowClassName" :height="tabHeader" :max-height="tabHeader">
<el-table-column label="规则名称" prop="enterpriseName" />
<el-table-column label="提醒对象" prop="enterpriseCode" />
<el-table-column label="提醒方式" prop="contactName" />
<el-table-column label="提醒时间" prop="contactOffice" />
<el-table-column label="修改时间" prop="contactPhone" />
<!-- <el-table-column label="常用联系人邮箱" prop="contactEmail" /> -->
<el-table-column label="操作" prop="userId" class-name="table-operation" width="180px">
<template slot-scope="scope">
<span class="look-info" @click="goInfo(scope.row)"></span>
<span class="edit-info" @click="editInfo(scope.row)" v-hasRole="['ent']"></span>
<span class="del-info" @click="delInfo(scope.row)" v-hasRole="['ent']"></span>
</template>
</el-table-column>
</el-table>
<my-pagination
id="L-pagination"
:total="total"
:page="pagination.current"
:limit="pagination.size"
@pagination="getPagination"
:current-page.sync="pagination.current"
></my-pagination>
</section>
</div>
<my-dialog :title="title" @close="importClose" @confirm="confirm" ref="importProject" closeText="关闭" :myclass="true">
<el-form :model="addFrom" size="small" ref="importFrom" label-width="180px" :rules="rules" class="newArticle" :disabled="title == '查看常用联系人' ? true : false">
<el-row>
<el-col :span="24">
<el-form-item label="提醒规则标题" class="importFormItem">
<el-input v-model.trim="addFrom.enterpriseCode" placeholder="请输入内容"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="企业名称:" class="importFormItem">
<el-input v-model.trim="addFrom.enterpriseName" placeholder="请输入内容"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="常用联系人名称:" class="importFormItem" prop="contactName">
<el-input v-model.trim="addFrom.contactName" placeholder="请输入常用联系人名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="常用联系人公司职务:" class="importFormItem" prop="contactOffice">
<el-input v-model.trim="addFrom.contactOffice" placeholder="请输入常用联系人公司职务"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="常用联系人手机号码:" class="importFormItem" prop="contactPhone">
<el-input v-model.trim="addFrom.contactPhone" placeholder="请输入常用联系人手机号码"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="常用联系人邮箱:" class="importFormItem" prop="contactEmail">
<el-input v-model.trim="addFrom.contactEmail" placeholder="请输入常用联系人邮箱"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</my-dialog>
</div>
</template>
<script>
import myPagination from "@/views/components/Pagination/index.vue"
import myDialog from "@/views/components/myDialog/index.vue"
import { getJEnterpriseContact, jEnterpriseContactNew, jEnterpriseContactChange, jEnterpriseContactId, jEnterpriseContactDel } from "@/api/jin_ji_hu/infoMaintain"
export default {
components:{myPagination, myDialog},
data() {
return {
total:0,
pagination: {
current:1,
size:10,
},
loading:false,
formInline: {
enterpriseName: '',
enterpriseCode:"",
},
tableData:[],
tabHeader: undefined,
addFrom: {
contactName:"",
contactOffice:"",
contactPhone:"",
contactEmail:"",
enterpriseCode:"",
enterpriseName:"",
},
rules:{
contactName:[
{ required: true, message: '请填写常用联系人姓名', trigger: 'blur' }
],
contactOffice:[
{ required: true, message: '请填写常用联系人公司职务', trigger: 'blur' }
],
contactPhone:[
{ required: true, message: '请填写常用联系人手机号码', trigger: 'blur' },
],
contactEmail:[
{ required: true, message: '请填写常用联系人邮箱', trigger: 'blur' },
],
},
title:"新增智能提醒规则",
infoVisible:false,
}
},
mounted() {
this.cancalDebounce();
window.addEventListener('resize', this.cancalDebounce);
},
destroyed() {
window.removeEventListener('resize', this.cancalDebounce);
},
methods:{
//
getList(){
this.loading = true;
getJEnterpriseContact(this.pagination).then(res=>{
this.loading = false;
this.total = res.data.total;
this.tableData = res.data.records;
})
},
//
getPagination(pages) {
this.pagination.current = pages.page;
this.pagination.size = pages.limit;
this.getList();
},
//
handleQuery() {
this.pagination.current = 1;
this.pagination.size = 10;
this.pagination = { ...this.pagination,...this.formInline };
// console.log(this.pagination);
// console.log(this.formInline);
this.getList();
},
//
resetQuery(formName){
this.$nextTick(() => {
this.$refs[formName].resetFields();
this.pagination = {
current: 1,
size: 10
}
this.getList();
});
},
// table
tableRowClassName({row, rowIndex}){
if (rowIndex % 2 !== 0) {
return 'evenNumber-row';
}
return '';
},
//
importBtn(){
this.title = "新增智能提醒规则";
this.addFrom.enterpriseCode = this.name;
this.addFrom.enterpriseName = this.nickName;
this.$refs.importProject.open();
},
//
importClose(){
this.$nextTick(()=>{
this.$refs.importFrom.resetFields();
this.$refs.importProject.close();
this.addFrom = {
contactName:"",
contactOffice:"",
contactPhone:"",
contactEmail:"",
}
})
},
//
goInfo(row){
this.title = "查看智能提醒规则"
jEnterpriseContactId(row.id).then((res=>{
if(res.code == 200) {
this.addFrom = res.data;
this.$refs.importProject.open();
}
}))
},
//
editInfo(row){
this.title = "修改智能提醒规则"
// this.addFrom.enterpriseCode = this.name;
// this.addFrom.enterpriseName = this.nickName;
jEnterpriseContactId(row.id).then((res)=>{
if(res.code == 200) {
this.addFrom = res.data;
this.$refs.importProject.open();
}
})
},
//
confirm(){
this.$refs.importFrom.validate((valid) => {
if (valid) {
// console.log(this.addFrom);
let id = this.addFrom.id ? this.addFrom.id : null;
if(id) {
jEnterpriseContactChange(this.addFrom).then((res)=>{
if(res.code == 200) {
this.getList();
this.importClose();
this.$message({
type: "success",
message: "修改成功!",
});
}
})
} else {
jEnterpriseContactNew(this.addFrom).then((res)=>{
if(res.code == 200) {
this.getList();
this.importClose();
this.$message({
type: "success",
message: "新增成功!",
});
}
})
}
} else {
return false;
}
});
},
//
delInfo(row){
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
jEnterpriseContactDel({ id: row.id }).then((res) => {
this.getList();
this.$message({
type: "success",
message: "删除成功!",
});
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
},
//
cancalDebounce(){
const element = document.getElementById('L-size-main'); // ID
const header = document.getElementById('L-header'); // ID
const pagination = document.getElementById('L-pagination'); // ID
const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight;
this.tabHeader = elementHeight - headerHeight - paginationtHeight - 140;
}
},
}
</script>
Loading…
Cancel
Save