| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>企业管理</title>
- <#include "../../include/head-file.ftl">
- </head>
- <body>
- <div id="index" class="ms-index" v-cloak>
- <el-header class="ms-header" height="50px">
- <el-col :span=12>
- <@shiro.hasPermission name="tf:enterprise:save">
- <el-button type="primary" class="el-icon-plus" size="default" @click="save()">新增</el-button>
- </@shiro.hasPermission>
- <@shiro.hasPermission name="tf:enterprise:del">
- <el-button type="danger" class="el-icon-delete" size="default" @click="del(selectionList)" :disabled="!selectionList.length">删除</el-button>
- </@shiro.hasPermission>
- </el-col>
- </el-header>
- <div class="ms-search">
- <el-row>
- <el-form :model="form" ref="searchForm" label-width="120px" size="default">
- <el-row>
- <el-col :span=8>
- <!--企业名称-->
- <el-form-item label="企业名称" prop="enterpriseName">
- <el-input
- v-model="form.enterpriseName"
- :disabled="false"
- :readonly="false"
- :style="{width: '100%'}"
- :clearable="true"
- placeholder="请输入企业名称">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span=8>
- <!--企业类型-->
- <el-form-item label="企业类型" prop="enterpriseType">
- <ms-dict v-model="form.enterpriseType"
- :style="{width: '100%'}"
- dict-type="企业管理-企业类型"
- :filterable="false"
- :disabled="false"
- :multiple="false" :clearable="true"
- placeholder="请选择企业类型">
- </ms-dict>
- </el-form-item>
- </el-col>
- <el-col :span=8>
- <!--品牌名-->
- <el-form-item label="品牌名" prop="enterpriseBrand">
- <el-input
- v-model="form.enterpriseBrand"
- :disabled="false"
- :readonly="false"
- :style="{width: '100%'}"
- :clearable="true"
- placeholder="请输入品牌名">
- </el-input>
- <div class="ms-form-tip">
- 多个品牌名,使用中英逗号分隔 </div>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span=8>
- <!--展位号-->
- <el-form-item label="展位号" prop="enterpriseBooth">
- <el-input
- v-model="form.enterpriseBooth"
- :disabled="false"
- :readonly="false"
- :style="{width: '100%'}"
- :clearable="true"
- placeholder="请输入展位号">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span=8>
- <!--联系人-->
- <el-form-item label="联系人" prop="enterpriseContact">
- <el-input
- v-model="form.enterpriseContact"
- :disabled="false"
- :readonly="false"
- :style="{width: '100%'}"
- :clearable="true"
- placeholder="请输入联系人">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span=8>
- <!--经营状态-->
- <el-form-item label="经营状态" prop="enterpriseOperatingStatus">
- <ms-dict v-model="form.enterpriseOperatingStatus"
- :style="{width: '100%'}"
- dict-type="企业管理-经营状态"
- :filterable="false"
- :disabled="false"
- :multiple="false" :clearable="true"
- placeholder="请选择经营状态">
- </ms-dict>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span=24 style="display: flex;justify-content: end;padding-right: 10px;">
- <el-button type="primary" class="el-icon-search" size="default" @click="currentPage=1;list(true)">搜索</el-button>
- <el-button @click="rest" class="el-icon-refresh" size="default">重置</el-button>
- <ms-search ref="search" @search="search" :search-json="searchJson" :search-key="historyKey"></ms-search>
- </el-col>
- </el-row>
- </el-form>
- </el-row>
- </div>
- <el-main class="ms-container">
- <el-table class="ms-table-pagination" v-loading="loading" ref="multipleTable" border :data="dataList" tooltip-effect="dark" @selection-change="handleSelectionChange">
- <template #empty>
- {{emptyText}}
- </template>
- <el-table-column type="selection" width="40" :selectable="isChecked"></el-table-column>
- <el-table-column label="企业名称" min-width="250" align="left" prop="enterpriseName">
- </el-table-column>
- <el-table-column label="企业类型" align="left" prop="enterpriseType" :formatter="enterpriseTypeFormat">
- </el-table-column>
- <el-table-column label="品牌名" min-width="100" align="left" prop="enterpriseBrand">
- </el-table-column>
- <el-table-column label="展位号" align="left" prop="enterpriseBooth">
- </el-table-column>
- <el-table-column label="访问量" align="right" prop="enterpriseVisits">
- </el-table-column>
- <el-table-column label="联系人" align="left" prop="enterpriseContact">
- </el-table-column>
- <el-table-column label="联系电话" align="left" prop="enterpriseTel">
- </el-table-column>
- <el-table-column label="企业地址" min-width="250" align="left" prop="enterpriseAddress">
- </el-table-column>
- <el-table-column label="入驻时间" min-width="200" align="center" prop="enterpriseEntryTime" >
- </el-table-column>
- <el-table-column label="经营状态" align="left" prop="enterpriseOperatingStatus" :formatter="enterpriseOperatingStatusFormat">
- </el-table-column>
- <el-table-column min-width="80" label="LOGO" align="left">
- <template #default="scope">
- <template v-if="scope.row.enterpriseLogo&&scope.row.enterpriseLogo !=''&&JSON.parse(scope.row.enterpriseLogo).length">
- <div class="block" v-for="src in JSON.parse(scope.row.enterpriseLogo)">
- <el-image
- :src="(!src.url.startsWith('http://') && !src.url.startsWith('https://')) ? ms.contextpath + src.url : src.url"
- :preview-teleported=true
- style="width: 50px;height: 50px;line-height: 50px;font-size: 30px">
- <template #error>
- <template class="image-slot">
- <i class="el-icon-picture-outline"></i>
- </template>
- </template>
- </el-image>
- </div>
- </template>
- </template>
- </el-table-column>
- <el-table-column min-width="180" align="center" label="创建时间" prop="createDate"></el-table-column>
- <el-table-column label="操作" width="180" align="center" fixed="right">
- <template #default="scope">
- <@shiro.hasPermission name="tf:enterpriseProducts:view">
- <el-link type="primary" :underline="false" @click="openlist(scope.row.id,scope.row.enterpriseName)">产品管理</el-link>
- </@shiro.hasPermission>
- <@shiro.hasPermission name="tf:enterprise:update">
- <el-link type="primary" :underline="false" @click="save(scope.row.id)">编辑</el-link>
- </@shiro.hasPermission>
- <@shiro.hasPermission name="tf:enterprise:del">
- <el-link type="primary" :underline="false" @click="del([scope.row])" v-if="scope.row.del!=3">删除</el-link>
- </@shiro.hasPermission>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- background
- :page-sizes="[10,20,30,40,50,100]"
- layout="total, sizes, prev, pager, next, jumper"
- :current-page="currentPage"
- :page-size="pageSize"
- :total="total"
- class="ms-pagination"
- @current-change='currentChange'
- @size-change="sizeChange">
- </el-pagination>
- </el-main>
- </div>
- </body>
- </html>
- <script>
- var indexVue = new _Vue({
- el: '#index',
- provide() {
- return {
- searchParent: this //筛选使用
- };
- },
- data:function() {
- return {
- searchJson:[
- {
- "isSearch": "true",
- "action": "and",
- "field": "ENTERPRISE_NAME",
- "el": "eq",
- "model": "enterpriseName",
- "name": "企业名称",
- "type": "input"
- },
- {
- "isSearch": "true",
- "action": "and",
- "field": "ENTERPRISE_TYPE",
- "el": "eq",
- "model": "enterpriseType",
- "name": "企业类型",
- "key": "dictValue",
- "title": "dictLabel",
- "type": "select",
- "multiple": "false"
-
- }, {
- "isSearch": "true",
- "action": "and",
- "field": "ENTERPRISE_BRAND",
- "el": "eq",
- "model": "enterpriseBrand",
- "name": "品牌名",
- "type": "input"
- },
- {
- "isSearch": "true",
- "action": "and",
- "field": "ENTERPRISE_BOOTH",
- "el": "eq",
- "model": "enterpriseBooth",
- "name": "展位号",
- "type": "input"
- },
- {
- "isSearch": "",
- "action": "and",
- "field": "ENTERPRISE_VISITS",
- "el": "eq",
- "model": "enterpriseVisits",
- "name": "访问量",
- "type": "number"
- },
- {
- "isSearch": "true",
- "action": "and",
- "field": "ENTERPRISE_CONTACT",
- "el": "eq",
- "model": "enterpriseContact",
- "name": "联系人",
- "type": "input"
- },
- {
- "isSearch": "",
- "action": "and",
- "field": "ENTERPRISE_TEL",
- "el": "eq",
- "model": "enterpriseTel",
- "name": "联系电话",
- "type": "input"
- },
- {
- "isSearch": "",
- "action": "and",
- "field": "ENTERPRISE_ADDRESS",
- "el": "eq",
- "model": "enterpriseAddress",
- "name": "企业地址",
- "type": "input"
- },
- {
- "action": "and",
- "field": "ENTERPRISE_ENTRY_TIME",
- "model": "enterpriseEntryTime",
- "el": "gt",
- "fmt": "YYYY-MM-DD",
- "name": "入驻时间",
- "type": "date"
- },
- {
- "isSearch": "true",
- "action": "and",
- "field": "ENTERPRISE_OPERATING_STATUS",
- "el": "eq",
- "model": "enterpriseOperatingStatus",
- "name": "经营状态",
- "key": "dictValue",
- "title": "dictLabel",
- "type": "select",
- "multiple": "false"
-
- }, {
- "action":"and",
- "field": "ENTERPRISE_LOGO",
- "el": "empty",
- "model": "enterpriseLogo",
- "name": "LOGO",
- "type": "imgupload"
- },
- ],
- dataList: [], //企业管理列表
- selectionList:[],//企业管理列表选中
- total: 0, //总记录数量
- pageSize: 10, //页面数量
- currentPage:1, //初始页
- manager: ms.manager,
- loading: true,//加载状态
- emptyText:'',//提示文字
- // 企业类型
- enterpriseTypeOptions:[],
- // 经营状态
- enterpriseOperatingStatusOptions:[],
- //搜索表单
- form:{
- sqlWhere:null
- },
- //历史记录参数
- historyKey: "tf_enterprise_history"
- }
- },
- watch:{
- disabled: {
- handler(newVal) {
- if (newVal === true) {
- ms.editorConfig.readonly = true;
- } else {
- ms.editorConfig.readonly = false;
- }
- },
- immediate: true
- }
- },
- methods:{
- isChecked: function(row) {
- if(row.del == 3) {
- return false;
- }
- return true;
- },
- //查询列表
- list: function(isSearch) {
- var that = this;
- var data = {}; //搜索参数
- that.loading = true;
- var page={
- pageNo: that.currentPage,
- pageSize : that.pageSize
- }
- var form = JSON.parse(JSON.stringify(that.form))
- if(isSearch) {
- //删除空字符串
- for (var key in form){
- if(form[key] === undefined || form[key] === null){
- delete form[key]
- }
- }
- form.sqlWhere ? data = Object.assign({}, {sqlWhere: form.sqlWhere}, page) : data = Object.assign({}, form, page)
- } else {
- data = page;
- }
- sessionStorage.setItem(that.historyKey,JSON.stringify({form: form, page: page}));
- ms.http.post(ms.manager+"/tf/enterprise/list.do",data).then(
- function(res) {
- if (!res.result||res.data.total <= 0) {
- that.emptyText ="暂无数据"
- that.dataList = [];
- that.total = 0;
- } else {
- that.emptyText = '';
- that.total = res.data.total;
- that.dataList = res.data.rows;
- }
- that.loading = false;
- }).catch(function(err) {
- that.loading = false;
- console.log(err);
- });
- },
- //企业管理列表选中
- handleSelectionChange:function(val){
- this.selectionList = val;
- },
- //删除
- del: function(row){
- var that = this;
- that.$confirm("此操作将永久删除所选内容, 是否继续", "提示", {
- confirmButtonText: "确认",
- cancelButtonText: "取消",
- type: 'warning'
- }).then(function() {
- ms.http.post(ms.manager+"/tf/enterprise/delete.do", row.length?row:[row],{
- headers: {
- 'Content-Type': 'application/json'
- }
- }).then(
- function(res){
- if (res.result) {
- that.$notify({
- title:'成功',
- type: 'success',
- message:"删除成功"
- });
- //删除成功,刷新列表
- that.list();
- }else {
- that.$notify({
- title: "错误",
- message: res.msg,
- type: 'warning'
- });
- }
- });
- }).catch(function(err) {
- //删除如果用户取消会抛出异常,所以需要catch一下
- console.log(err)
- });
- },
- //新增
- save:function(id){
- if(id){
- ms.util.openSystemUrl("/tf/enterprise/form.do?id="+id);
- }else {
- ms.util.openSystemUrl("/tf/enterprise/form.do");
- }
- },
- //产品管理
- openlist:function(id,name){
- window.parent.indexVue.open({
- id: "E-"+id,
- modelTitle: "产品管理-"+name,
- modelUrl: "/tf/enterpriseProducts/index.do?id=" + id,
- })
- },
- //pageSize改变时会触发
- sizeChange:function(pagesize) {
- this.loading = true;
- this.pageSize = pagesize;
- this.list(true);
- },
- //currentPage改变时会触发
- currentChange:function(currentPage) {
- this.loading = true;
- this.currentPage = currentPage;
- this.list(true);
- },
- search:function(data){
- this.form.sqlWhere = JSON.stringify(data);
- this.list(true);
- },
- //重置表单
- rest:function(){
- this.currentPage = 1;
- this.form = {
- sqlWhere:null
- };
- this.$refs.searchForm.resetFields();
- this.list(true);
- },
- //企业类型 列表格式化
- enterpriseTypeFormat:function(row, column, cellValue, index){
- var value="";
- if(cellValue){
- var data = this.enterpriseTypeOptions.find(function(value){
- return value.dictValue==cellValue;
- })
- if(data&&data.dictLabel){
- value = data.dictLabel;
- }
- }
- return value;
- },
- //获取enterpriseType数据源
- enterpriseTypeOptionsGet:function() {
- var that = this;
- ms.http.get(ms.base+'/mdiy/dict/list.do', {dictType:'企业管理-企业类型',pageSize:99999}).then(function (res) {
- that.enterpriseTypeOptions = res.data.rows;
- }).catch(function (err) {
- console.log(err);
- });
- },
- //入驻时间日期格式化
- enterpriseEntryTimeFormat:function(row, column, cellValue, index){
- return ms.util.date.fmt(new Date(row.ENTERPRISE_ENTRY_TIME),'YYYY-MM-DD');
- },
- //经营状态 列表格式化
- enterpriseOperatingStatusFormat:function(row, column, cellValue, index){
- var value="";
- if(cellValue){
- var data = this.enterpriseOperatingStatusOptions.find(function(value){
- return value.dictValue==cellValue;
- })
- if(data&&data.dictLabel){
- value = data.dictLabel;
- }
- }
- return value;
- },
- //获取enterpriseOperatingStatus数据源
- enterpriseOperatingStatusOptionsGet:function() {
- var that = this;
- ms.http.get(ms.base+'/mdiy/dict/list.do', {dictType:'企业管理-经营状态',pageSize:99999}).then(function (res) {
- that.enterpriseOperatingStatusOptions = res.data.rows;
- }).catch(function (err) {
- console.log(err);
- });
- },
- // enterpriseLogo删除
- enterpriseLogoHandleRemove: function (file, files) {
- var index = -1;
- index = this.form.enterpriseLogo.findIndex(function (text) {
- return text.uid == file.uid;
- });
- if (index != -1) {
- this.form.enterpriseLogo.splice(index, 1);
- }
- },
- //enterpriseLogo上传超过限制
- enterpriseLogoHandleExceed: function (files, fileList) {
- this.$notify({
- title: '失败',
- message: '当前最多上传1个文件',
- type: 'warning'
- });
- },
- //enterpriseLogo预览
- enterpriseLogoHandlePreview: function (file){
- window.open(file.url);
- },
- //enterpriseLogo上传前
- enterpriseLogoBeforeUpload: function (file) {
- var type = file.type;
- if (type) {
- var isImage = type.startsWith('image/');
- if (!isImage) {
- this.$notify({
- title: '提示',
- message: '请上传图片类型文件',
- type: 'warning'
- });
- }
- return isImage;
- }
- return false;
- },
- //enterpriseLogo上传成功
- enterpriseLogoSuccess: function (response, file, fileList) {
- if (response.result) {
- if(!response.data.startsWith("http://") && !response.data.startsWith("https://")) {
- file.url = ms.contextpath + response.data;
- }else{
- file.url = response.data;
- }
- this.form.enterpriseLogo.push({
- url: response.data,
- name: file.name,
- uid: file.uid
- });
- } else {
- // 移除上传图片
- var index = fileList.indexOf(file);
- if (index > -1) {
- fileList.splice(index, 1);
- }
- this.$notify({
- title: '失败',
- message: response.msg,
- type: 'warning'
- });
- }
- },
- //enterpriseLogo上传失败
- enterpriseLogoError: function (response, file, fileList) {
- response = JSON.parse(response.message);
- this.$notify({
- title: '失败',
- message: response.msg,
- type: 'warning'
- });
- },
- },
- mounted:function(){
- var that = this;
- //如果存在历史参数,恢复页面结果
- if(sessionStorage.getItem(this.historyKey) && ms.util.getParameter("isBack") == 'true') {
- var _history = JSON.parse(sessionStorage.getItem(this.historyKey))
- this.form = _history.form;
- this.total = parseInt(_history.total);
- this.currentPage = parseInt(_history.page.pageNo);
- this.pageSize = parseInt(_history.page.pageSize);
- }
- this.list(true);
- },
- created:function(){
- var that = this;
-
- //加载企业类型 数据
- this.enterpriseTypeOptionsGet();
-
- //加载经营状态 数据
- this.enterpriseOperatingStatusOptionsGet();
- }
- })
- </script>
- <style scoped>
- #index .ms-container {
- height: calc(100vh - 141px);
- }
- </style>
|