清单更改

xuhongjie
严飞永 4 weeks ago
parent e912954367
commit 049812229f

@ -192,9 +192,7 @@ export function addCatalog(data) {
return request({
url: '/gysl/ml/add',
method: 'post',
data: {
ml: data // 同样包装在ml对象中
}
data : data
});
}
@ -203,7 +201,9 @@ export function deleteCatalog(idList) {
return request({
url: `/gysl/ml/delete`,
method: 'delete',
params: { idList }
params: {
idList: idList.join(',') // 将数组转换为逗号分隔的字符串
}
});
}
@ -212,18 +212,16 @@ export function editCatalog(data) {
return request({
url: '/gysl/ml/edit',
method: 'post',
data: {
ml: data // 按照接口要求将数据包装在ml对象中
}
data
});
}
// 查询所有目录
export function getAllCatalogs(params) {
export function getAllCatalogs(query) {
return request({
url: '/gysl/ml/page',
method: 'get',
params
params:query
});
}
@ -496,8 +494,8 @@ export function updatexmqt(data) {
data
})
}
//根据项目id查询信息// 根据项目id查询信息
export function getOtherInfoByxmid(query) {
//根据项目id查询信息
export function getOtherInfoByxmId(query) {
return request({
url: '/gysl/projectOtherInfo/searchId',
method: 'get',
@ -553,7 +551,6 @@ export function getxmmmbById(id) {
//单片材料管理
//新增数据
// 新增数据
export function addClgl(data) {
return request({
url: '/gysl/dpclgl/add',
@ -680,14 +677,15 @@ export function getpicturelist(id){
})
}
// 细分产业管理
// 细分产业管理
// 新增数据
export function addXfcygl(data) {
return request({
url: '/gysl/xfcygl/add',
method: 'post',
data
data:data
});
}
@ -696,7 +694,9 @@ export function deleteXfcygl(idList) {
return request({
url: '/gysl/xfcygl/delete',
method: 'delete',
params: { idList }
params: {
idList: idList.join(',') // 将数组转换为逗号分隔的字符串
}
});
}
@ -705,16 +705,16 @@ export function updateXfcygl(data) {
return request({
url: '/gysl/xfcygl/edit',
method: 'put',
data
data:data
});
}
// 分页查询所有数据
export function getXfcyglPage(params) {
export function getXfcyglPage(query) {
return request({
url: '/gysl/xfcygl/page',
method: 'get',
params
params:query
});
}
@ -727,4 +727,12 @@ export function getMessageCount() {
})
}
//月度进展信息
//智能提醒
// 已读智能提醒
export function markSmartReminderAsRead(id) {
return request({
url: `/gysl/jSmartReminders/isRead/${id}`,
method: 'get'
});
}

@ -223,10 +223,6 @@ export default {
this.$message.error(response.msg || '获取数据失败');
}
})
.catch(error => {
this.$message.error('请求失败');
console.error(error);
});
},
//

@ -15,7 +15,7 @@
<!-- 内容区 -->
<div class="content">
<div class="picturediv">
<div ref="chart" style="width: 30rem; height: 28rem; margin-left: 2rem;"></div>
<div ref="chart" style="width: 38rem; height: 28rem;"></div>
</div>
<div class="descriptionsdiv">
<div class="tablehead">

@ -44,7 +44,14 @@ export default {
return index === 0 ? require('@/assets/images/new@2x.png') : require('@/assets/images/other.png');
},
formatDate(dateString) {
if (!dateString) {
// dateString undefined
return '';
}
const date = new Date(dateString);
if (isNaN(date.getTime())) {
return '';
}
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');

@ -7,14 +7,14 @@
label-width="200">
<el-row>
<el-col :span="5">
<el-form-item label="项目名称" style="width: 100%;">
<el-form-item label="项目名称" prop="name" style="width: 100%;">
<el-input v-model="queryParams.name" placeholder="请输入项目名称" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="建设起止时间">
<el-date-picker v-model="queryParams.startTime" type="date" placeholder="开始日期"
<el-date-picker v-model="queryParams.begainTime" type="date" placeholder="开始日期"
style="width: 11rem;"></el-date-picker>
~
<el-date-picker v-model="queryParams.endTime" type="date" placeholder="结束日期"
@ -96,11 +96,7 @@
</div>
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange" stripe>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="序号" align="center" prop="id" />
<el-table-column label="项目名称" align="center" prop="name" width="200" />
<el-table-column label="现状分类" align="center" prop="xzfl">
<template slot-scope="scope">
@ -172,7 +168,7 @@ export default {
},
xzflMap: {
1: '已建',
2: '建',
2: '建',
3: '拟建'
},
//
@ -183,7 +179,6 @@ export default {
name: undefined,
xmfrdwxz: undefined,
dateRange: [],
startTime: undefined,
status: undefined
},
//
@ -203,51 +198,15 @@ export default {
checkPermi,
checkRole,
/** 查询项目列表 */
/** 查询项目列表 */
getList() {
this.loading = true;
//
const params = {
pageNum: this.queryParams.pageNum,
pageSize: this.queryParams.pageSize,
...(this.queryParams.name && { name: this.queryParams.name }),
...(this.queryParams.xzfl && { xzfl: this.queryParams.xzfl }),
...(this.queryParams.xmfrdwxz && { xmfrdwxz: this.queryParams.xmfrdwxz }),
...(this.queryParams.status && { status: this.queryParams.status })
};
//
if (this.queryParams.startTime) {
params.startTime = this.formatDate(this.queryParams.startTime);
}
if (this.queryParams.endTime) {
params.endTime = this.formatDate(this.queryParams.endTime);
}
console.log('最终查询参数:', params); //
getBasicInformationPage(params).then((response) => {
getBasicInformationPage(this.queryParams).then((response) => {
this.postList = response.data.records;
this.total = response.data.total;
this.loading = false;
}).catch(() => {
this.loading = false;
});
},
//
formatDate(date) {
if (!date) return null;
const d = new Date(date);
let month = '' + (d.getMonth() + 1);
let day = '' + d.getDate();
const year = d.getFullYear();
if (month.length < 2) month = '0' + month;
if (day.length < 2) day = '0' + day;
return [year, month, day].join('-');
},
/** 导入按钮操作 */
handleImport() {
this.upload.open = true;
@ -305,7 +264,7 @@ export default {
this.$modal
.confirm('是否确认删除项目id为"' + ids + '"的数据项?')
.then(() => {
return deleteBasicInformation(ids); // API
return deleteBasicInformation(ids);
})
.then(() => {
this.getList();
@ -320,19 +279,9 @@ export default {
this.$router.push({ path: `/manage-info/${id}` });
},
/** 重置按钮操作 */
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
xzfl: undefined,
name: undefined,
xmfrdwxz: undefined,
startTime: undefined,
endTime: undefined,
status: undefined
};
this.getList();
this.resetForm("queryForm");
this.handleQuery();
},
/** 搜索按钮操作 */

@ -7,11 +7,7 @@
<div class="title">苏州工业园区工业上楼管理系统</div>
<div class="logintabs">
<!-- @tab-click="handleClick" -->
<el-tabs
v-model="activeName"
:stretch="true"
color = "#216CDC"
>
<el-tabs v-model="activeName" :stretch="true" color="#216CDC">
<el-tab-pane label="企业用户登录" name="first"></el-tab-pane>
<el-tab-pane label="政务人员登录" name="second"></el-tab-pane>
</el-tabs>
@ -43,9 +39,17 @@
<span v-if="!loading"> </span>
<span v-else> ...</span>
</el-button>
<div style="float: right;" v-if="register">
<el-button v-if="showGovernmentLoginButton" size="medium" type="primary" class="tongyidenglu"
style="width:100%;background: #2B62F1;" @click.native.prevent="handleGovernmentLogin">
<span>政务统一身份认证登录</span>
</el-button>
<el-button v-if="showEnterpriseLoginButton" size="medium" type="primary" class="tongyidenglu"
style="width:100%;background: #2B62F1;" @click.native.prevent="handleEnterpriseLogin">
<span>企业统一身份认证登录</span>
</el-button>
<!-- <div style="float: right;" v-if="register">
<router-link class="link-type" :to="'/register'">立即注册</router-link>
</div>
</div> -->
</el-form-item>
</el-form>
<!-- 底部 -->
@ -94,11 +98,25 @@ export default {
this.redirect = route.query && route.query.redirect
}
},
computed: {
showGovernmentLoginButton() {
return this.activeName === 'second';
},
showEnterpriseLoginButton() {
return this.activeName === 'first';
}
},
created() {
this.getCode()
this.getCookie()
},
methods: {
handleGovernmentLogin() {
window.location.href = 'https://qyt.sipac.gov.cn/';
},
handleEnterpriseLogin() {
window.location.href = 'https://qytt.sipac.gov.cn/ecobrainportal/login.html';
},
getCode() {
getCodeImg().then((res) => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
@ -158,6 +176,7 @@ export default {
border-radius: 0.16rem;
}
::v-deep .el-tabs__header {
border-bottom: none !important;
}
@ -179,6 +198,10 @@ export default {
display: none !important;
}
.tongyidenglu {
margin-top: 1rem;
margin-left: 0rem;
}
.login {
display: flex;
@ -188,7 +211,9 @@ export default {
height: 100%;
background-image: url('../assets/images/loginbackground.png');
background-size: cover;
}.loginleft {
}
.loginleft {
width: 35rem;
height: 40rem;
background-image: url('../assets/images/loginleft.png');
@ -207,6 +232,7 @@ export default {
text-align: center;
margin-top: 1rem;
}
.loginitem {
width: 24rem;
}
@ -247,6 +273,7 @@ export default {
text-align: center;
color: #bfbfbf;
}
.logintabs {
margin-top: 2.88rem;
width: 18rem;
@ -279,12 +306,10 @@ export default {
.login-code-img {
height: 38px;
}
.el-tabs__item.is-active {
color: #216CDC;
position: relative;
padding-bottom: 0.5rem;
}
</style>

@ -128,15 +128,14 @@ export default {
dialogVisible: false,
indicatorDialogVisible: false,
form: {
id: null,
id: 0,
type: '',
name: '',
},
indicatorForm: {
id: null,
id: 0,
jtzb: '',
xxyq: '',
elementId: null
},
currentElement: null
};
@ -177,7 +176,7 @@ export default {
//
resetForm() {
this.form = {
id: null,
id: 0,
type: '',
name: ''
};
@ -186,10 +185,10 @@ export default {
//
resetIndicatorForm() {
this.indicatorForm = {
id: null,
id: 0,
jtzb: '',
xxyq: '',
elementId: null
elementId: 2
};
},
@ -201,7 +200,7 @@ export default {
createBy: user.userName,
createId: user.userId,
updateBy: user.userName,
updateId: user.userId
updateId: user.userId,
};
const api = this.form.id ? editElemention : addElement;
@ -230,10 +229,16 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteElemention([element.id]).then(() => {
// ID2
deleteElemention(2).then(() => {
this.$message.success('删除成功');
this.fetchElements();
})
this.fetchElements(); //
}).catch(error => {
this.$message.error('删除失败: ' + (error.message || '未知错误'));
});
}).catch(() => {
//
this.$message.info('已取消删除');
});
},
@ -290,9 +295,7 @@ export default {
deleteElemention([indicator.id]).then(() => {
this.$message.success('删除成功');
this.fetchElements();
}).catch(error => {
this.$message.error('删除失败: ' + (error.message || error));
});
})
});
}
},

@ -1,39 +1,39 @@
<template>
<div>
<!-- 搜索区域 -->
<!-- 表单查询项 -->
<div class="headerbox">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="7rem">
<el-form ref="queryForm" :model="queryParams" size="small" label-width="100px">
<el-row>
<el-col :span="9">
<el-form-item label="上楼目录类别" prop="slmllb" style="width: 100%;">
<el-select v-model="queryParams.slmllb" placeholder="请选择上楼目录类别" style="width: 26.5rem;">
<el-col :span="5">
<el-form-item label="上楼目录类别" prop="slmllb">
<el-select v-model="queryParams.slmllb" placeholder="请选择上楼目录类别">
<el-option v-for="dict in dict.type.shangloumulu" :key="dict.value" :label="dict.label"
:value="dict.value" />
:value="dict.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<el-col :span="5">
<el-form-item label="工业大类" prop="gydl" style="width: 100%;">
<el-input v-model="queryParams.gydl" placeholder="请输入工业大类" clearable style="width: 20.5rem;"
@keyup.enter.native="handleQuery" show-word-limit />
<el-input v-model="queryParams.gydl" placeholder="请输入工业大类" :fetch-suggestions="querySearchAsync"
@keyup.enter.native="handleQuery" />
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="产业" prop="cy" style="width: 100%;">
<el-input v-model="queryParams.cy" placeholder="请输入产业" clearable style="width: 20.5rem;"
@keyup.enter.native="handleQuery" show-word-limit />
@keyup.enter.native="handleQuery" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="9">
<el-col :span="3">
<el-form-item label="更新时间" prop="updateTime">
<el-date-picker v-model="queryParams.updateTime" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
:style="{ width: '26.5rem' }" placeholder="选择日期" clearable @change="handleQuery" />
:style="{ width: '13.5rem' }" placeholder="选择日期" clearable @change="handleQuery" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item style="margin-left: 2.5rem;">
<el-form-item style="margin-left: -100px;">
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
@ -42,18 +42,24 @@
</el-form>
</div>
<!-- 表格 -->
<!-- 表格内容-->
<div class="tablebox">
<!-- 导出行 -->
<div class="tablebtntwo">
<div>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd"></el-button>
</el-col>
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-download" size="mini" @click="handleImport"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-download" size="mini" @click="handleExport"></el-button>
</el-col>
</el-row>
</div>
<div class="tablebtn">
<el-button type="primary" size="mini" @click="handleExport"></el-button>
<el-button type="primary" size="mini" @click="handleImport"></el-button>
</div>
</div>
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" width="60" align="center">
@ -61,26 +67,29 @@
{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="上楼目录类别" align="center" prop="slmllb" :formatter="formatSlmllb" />
<el-table-column label="上楼目录类别" align="center">
<template slot-scope="scope">
{{ fileTypeMap[scope.row.slmllb] || scope.row.slmllb }}
</template>
</el-table-column>
<el-table-column label="工业大类" align="center" prop="gydl" />
<el-table-column label="产业" align="center" prop="cy" />
<el-table-column label="更新时间" align="center" prop="updateTime" width="180" />
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"></el-button>
<el-button size="mini" type="text" icon="el-icon-delete" style="color: #F25353;"
@click="handleDelete(scope.row)">删除</el-button>
<el-button size="mini" type="text" @click="handleUpdate(scope.row)"></el-button>
<el-button size="mini" type="text" @click="handleDelete(scope.row)" style="color: red;">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
</div>
<!-- 新增/修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<!-- 添加或修改项目对话框 -->
<el-dialog :title="title" :visible.sync="open" width="40rem" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="7rem">
<el-form-item label="上楼目录类别" prop="slmllb">
<el-select v-model="form.slmllb" placeholder="请选择上楼目录类别" style="width: 100%;">
<el-option v-for="dict in dict.type.shangloumulu" :key="dict.value" :label="dict.label"
@ -88,49 +97,53 @@
</el-select>
</el-form-item>
<el-form-item label="工业大类" prop="gydl">
<el-input v-model="form.gydl" placeholder="请输入工业大类" maxlength="50" show-word-limit />
<el-input v-model="form.gydl" placeholder="请输入工业大类" maxlength="50" />
</el-form-item>
<el-form-item label="产业" prop="cy">
<el-input v-model="form.cy" placeholder="请输入产业" maxlength="50" show-word-limit />
<el-input v-model="form.cy" placeholder="请输入产业" maxlength="50" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 导入对话框 -->
<el-dialog title="数据导入" :visible.sync="upload.open" width="400px" append-to-body :close-on-click-modal="false">
<el-upload ref="upload" :limit="1" accept=".xlsx,.xls" :headers="upload.headers" :action="upload.url"
:disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess"
:auto-upload="false" drag>
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
@click="importTemplate">下载模板</el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button @click="upload.open = false"> </el-button>
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { addCatalog, deleteCatalog, editCatalog, getAllCatalogs, exportCatalog } from '@/api/ManageApi/index';
import { getToken } from "@/utils/auth";
import { getAllCatalogs, addCatalog, editCatalog, deleteCatalog } from "@/api/ManageApi/index";
import fileload from "@/components/FileUpload/index.vue"
export default {
name: "Catalog",
dicts: ['shangloumulu'],
components: {
fileload
},
data() {
return {
//
//
loading: true,
//
ids: [],
@ -142,67 +155,96 @@ export default {
showSearch: true,
//
total: 0,
//
//
postList: [],
//
title: "",
//
//
open: false,
//
detailOpen: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
slmllb: undefined,
gydl: undefined,
cy: undefined,
slmllb: undefined,
updateTime: undefined
},
//
form: {
id: undefined,
slmllb: undefined,
gydl: undefined,
cy: undefined
slmllb: undefined,
cy: undefined,
createBy: undefined,
createId: undefined,
createTime: undefined,
updateBy: undefined,
updateId: undefined,
updateTime: undefined
},
//
rules: {
gydl: [
{ required: true, message: "文件名称不能为空", trigger: "blur" }
],
slmllb: [
{ required: true, message: "上楼目录类别不能为空", trigger: "change" }
],
gydl: [
{ required: true, message: "工业大类不能为空", trigger: "blur" },
{ max: 50, message: "长度不能超过50个字符", trigger: "blur" }
scyh: [
{ required: true, message: "上传用户不能为空", trigger: "blur" }
],
cy: [
{ required: true, message: "产业不能为空", trigger: "blur" },
{ max: 50, message: "长度不能超过50个字符", trigger: "blur" }
scsj: [
{ required: true, message: "上传时间不能为空", trigger: "change" }
]
},
//
//
fileTypeMap: {
1: "重点鼓励上楼",
2: "有条件上楼",
},
//
upload: {
//
open: false,
//
title: "目录导入",
//
isUploading: false,
//
updateSupport: 0,
//
headers: { Authorization: "Bearer " + getToken() },
url: process.env.VUE_APP_BASE_API + "/gysl/ml/importMl"
}
//
// url: process.env.VUE_APP_BASE_API + "/tc/assetCurrent/import"
url: location.origin + "/gysl/ml/importMl",
},
};
},
created() {
this.getList();
},
methods: {
//
formatSlmllb(row) {
return this.selectDictLabel(this.dict.type.shangloumulu, row.slmllb);
},
/** 查询列表 */
querySearchAsync(queryString, cb) {
let results = [];
// getAllCatalogs API
getAllCatalogs({ gydl: queryString }).then(res => {
res.data.records.forEach(item => {
results.push({
value: item.gydl,
id: item.id,
});
});
});
cb(results);
},
//
getList() {
this.loading = true;
console.log('【查询参数】', JSON.stringify(this.queryParams, null, 2));
getAllCatalogs(this.queryParams).then(response => {
console.log('【查询结果】', response.data);
this.postList = response.data.records.map(item => ({
...item,
updateTime: item.updateTime ? item.updateTime.split(' ')[0] : ''
@ -210,168 +252,139 @@ export default {
this.total = response.data.total;
this.loading = false;
}).catch(error => {
console.error('查询失败:', error);
console.error('API Request Error:', error);
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: undefined,
slmllb: undefined,
gydl: undefined,
cy: undefined
slmllb: undefined,
fj: undefined,
createBy: undefined,
createId: undefined,
createTime: undefined,
updateBy: undefined,
updateId: undefined,
updateTime: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增目录";
this.title = "新增项目知识库";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
console.log('【获取详情】ID:', id);
// API
const detailData = this.postList.find(item => item.id === id);
if (detailData) {
this.form = {
id: detailData.id,
slmllb: detailData.slmllb,
gydl: detailData.gydl,
cy: detailData.cy
};
const catalogId = row.id;
this.form = { ...row };
this.open = true;
this.title = "修改目录";
console.log('【详情数据】', JSON.stringify(this.form, null, 2));
}
this.title = "修改项目知识库";
},
/** 提交按钮 */
submitForm() {
submitForm: function () {
this.$refs["form"].validate(valid => {
if (valid) {
const user = this.$store.state.user;
const currentTime = new Date().toISOString().replace('T', ' ').substring(0, 19);
const formData = {
...this.form,
updateTime: currentTime,
updateBy: user.name,
updateId: user.userId,
...(this.form.id ? {} : {
createTime: currentTime,
createBy: user.name,
createId: user.userId
})
};
const requestData = { ml: formData };
console.log('【提交数据】', JSON.stringify(requestData, null, 2));
const request = this.form.id
? editCatalog(requestData)
: addCatalog(requestData);
request.then(response => {
this.$modal.msgSuccess(this.form.id ? "修改成功" : "新增成功");
if (this.form.id !== undefined) {
editCatalog(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).catch(error => {
console.error('API Request Error:', error);
});
} else {
addCatalog(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).catch(error => {
console.error('提交失败:', error);
this.$modal.msgError(error.response?.data?.msg || "操作失败");
console.error('API Request Error:', error);
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
console.log('【删除ID】', ids);
this.$modal.confirm('确认删除选中的数据?').then(() => {
return deleteCatalog(ids);
const catalogIds = row.id || this.ids;
this.$modal.confirm('是否确认删除项目知识库编号为"' + catalogIds + '"的数据项?').then(() => {
return deleteCatalog([catalogIds]);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(error => {
console.error('删除失败:', error);
});
}).catch(() => { });
},
/** 导出按钮操作 */
/**导出 */
handleExport() {
console.log('【导出参数】', JSON.stringify(this.queryParams, null, 2));
this.$modal.confirm('确认导出所有数据?').then(() => {
return exportCatalog(this.queryParams);
}).then(response => {
this.download(response.msg);
}).catch(error => {
console.error('导出失败:', error);
});
this.download(
"/gysl/ml/exportMl",
{
...this.form,
},
/** 导入按钮操作 */
`目录管理${new Date().getTime()}.xlsx`
);
},
//
handleImport() {
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download("/gysl/ml/importTemplate", {}, `目录导入模板_${new Date().getTime()}.xlsx`);
this.download(
"/tc/assetCurrent/importTemplate",
{},
`目录导入模板${new Date().getTime()}.xlsx`
);
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
}
},
}
};
</script>
@ -393,14 +406,21 @@ export default {
border: 1px solid #eee;
}
.tablebtntwo {
margin: 1rem 0;
.tablehead {
display: flex;
justify-content: space-between;
align-items: center;
}
.tablebtn {
.headbtn {
display: flex;
gap: .5rem;
}
.tablebtntwo {
margin-top: 1rem;
margin-bottom: 1rem;
width: 100%;
display: flex;
justify-content: space-between;
}
</style>

@ -1,20 +1,22 @@
<template>
<div>
<!-- 产业导向管理--细分产业管理 -->
<!-- 细分产业管理 -->
<!-- 表单查询项 -->
<div class="headerbox">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="7rem">
<el-form ref="queryForm" :model="queryParams" size="small" label-width="100px">
<el-row>
<el-col :span="9">
<el-form-item label="产业类别" prop="cylb" style="width: 100%;">
<el-input v-model="queryParams.cylb" placeholder="请输入产业类别" clearable style="width: 26.5rem;"
@keyup.enter.native="handleQuery" />
<el-col :span="5">
<el-form-item label="产业类别" prop="cylb">
<el-select v-model="queryParams.cylb" placeholder="请选择产业类别">
<el-option v-for="dict in dict.type.cylb" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<el-col :span="5">
<el-form-item label="产业细分" prop="cyxf" style="width: 100%;">
<el-input v-model="queryParams.cyxf" placeholder="请输入产业细分" clearable style="width: 20rem;"
@keyup.enter.native="handleQuery" />
<el-input v-model="queryParams.cyxf" placeholder="请输入产业细分"
:fetch-suggestions="querySearchAsync" @keyup.enter.native="handleQuery" />
</el-form-item>
</el-col>
<el-col :span="7">
@ -26,15 +28,17 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="9">
<el-col :span="3">
<el-form-item label="更新时间" prop="updateTime">
<el-date-picker type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :style="{ width: '26.5rem' }" placeholder="选择日期" clearable v-model="queryParams.updateTime"></el-date-picker>
<el-date-picker v-model="queryParams.updateTime" type="date" format="yyyy-MM-dd"
value-format="yyyy-MM-dd" :style="{ width: '13.5rem' }" placeholder="选择日期" clearable
@change="handleQuery" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item style="margin-left: 2.5rem;">
<el-form-item style="margin-left: -70px;">
<el-button type="primary" icon="el-icon-search" size="mini"
@click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -45,37 +49,50 @@
</div>
<!-- 表格内容区 -->
<div class="tablebox">
<!-- 标签行 -->
<div class="tablehead">
<!-- 导出行 -->
<div class="tablebtntwo">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd"></el-button>
</el-col>
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-download" size="mini"
@click="handleImport">导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-download" size="mini"
@click="handleExport">导出</el-button>
</el-col>
</el-row>
</div>
<div class="headbtn">
<el-button type="primary" size="mini" @click="handleExport"></el-button>
<el-button type="primary" size="mini" @click="handleImport"></el-button>
</div>
</div>
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="产业类别" align="center" prop="cylb" />
<el-table-column label="序号" width="60" align="center">
<template slot-scope="scope">
{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="产业类别" align="center" prop="cylb">
<template slot-scope="scope">
{{ cylbMap[scope.row.cylb] || scope.row.cylb }}
</template>
</el-table-column>
<el-table-column label="产业细分" align="center" prop="cyxf" />
<el-table-column label="原材料及生产环节" align="center" prop="ycljschj" />
<el-table-column label="上楼适应性" align="center">
<el-table-column label="上楼适应性" align="center" prop="slsyx">
<template slot-scope="scope">
{{ slsyxMap[scope.row.slsyx] || scope.row.slsyx }}
</template>
</el-table-column>
<el-table-column label="更新时间" align="center" prop="updateTime" />
<el-table-column label="更新时间" align="center" prop="updateTime" width="180" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="handleEdit(scope.row)"></el-button>
<el-button size="mini" type="text" style="color: #F25353;"
@click="handleDelete(scope.row)">删除</el-button>
<el-button size="mini" type="text" @click="handleUpdate(scope.row)"></el-button>
<el-button size="mini" type="text" @click="handleDelete(scope.row)"
style="color: red;">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -84,10 +101,13 @@
</div>
<!-- 添加或修改项目对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-dialog :title="title" :visible.sync="open" width="40rem" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="160px">
<el-form-item label="产业类别" prop="cylb">
<el-input v-model="form.cylb" placeholder="请输入产业类别" />
<el-select v-model="form.cylb" placeholder="请选择产业类别">
<el-option v-for="dict in dict.type.cylb" :key="dict.value" :label="dict.label"
:value="parseInt(dict.value)"></el-option>
</el-select>
</el-form-item>
<el-form-item label="产业细分" prop="cyxf">
<el-input v-model="form.cyxf" placeholder="请输入产业细分" />
@ -96,7 +116,7 @@
<el-input v-model="form.ycljschj" placeholder="请输入原材料及生产环节" />
</el-form-item>
<el-form-item label="上楼适应性" prop="slsyx">
<el-select v-model="form.slsyx" placeholder="请选择文件类型">
<el-select v-model="form.slsyx" placeholder="请选择上楼适应性">
<el-option v-for="dict in dict.type.slsyx" :key="dict.value" :label="dict.label"
:value="parseInt(dict.value)"></el-option>
</el-select>
@ -107,15 +127,18 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 批量导入对话框 -->
<!-- 导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls"
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
@click="importTemplate">下载模板</el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
@ -123,15 +146,19 @@
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getXfcyglPage, getXfcyglById, deleteXfcygl, addXfcygl, updateXfcygl } from "@/api/ManageApi/index";
import { getXfcyglPage, addXfcygl, updateXfcygl, deleteXfcygl } from "@/api/ManageApi/index";
import fileload from "@/components/FileUpload/index.vue"
export default {
name: "Subdivide",
dicts: ['slsyx'],
dicts: ['cylb', 'slsyx'],
components: {
fileload
},
data() {
return {
//
@ -146,94 +173,113 @@ export default {
showSearch: true,
//
total: 0,
//
//
postList: [],
//
title: "",
//
//
open: false,
//
detailOpen: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
cylb: undefined,
cyxf: undefined,
cylb: undefined,
slsyx: undefined,
dateRange: undefined
},
//
form: {},
form: {
id: undefined,
cyxf: undefined,
cylb: undefined,
ycljschj: undefined,
slsyx: undefined,
createBy: undefined,
createId: undefined,
createTime: undefined,
updateBy: undefined,
updateId: undefined,
updateTime: undefined
},
//
rules: {
// cylb: [
// { required: true, message: "", trigger: "blur" }
// ],
// cyxf: [
// { required: true, message: "", trigger: "blur" }
// ],
// ycljschj: [
// { required: true, message: "", trigger: "blur" }
// ],
// slsyx: [
// { required: true, message: "", trigger: "change" }
// ]
cyxf: [
{ required: true, message: "文件名称不能为空", trigger: "blur" }
],
cylb: [
{ required: true, message: "产业类别不能为空", trigger: "change" }
],
scyh: [
{ required: true, message: "上传用户不能为空", trigger: "blur" }
],
ycljschj: [
{ required: true, message: "上传时间不能为空", trigger: "change" }
]
},
//
cylbMap: {
1: "新一代信息技术",
2: "高端装备制造",
3: "生物医药及大健康",
4: "纳米技术应用及新材料",
5: "人工智能及数字产业",
6: "新能源及绿色产业"
},
//
slsyxMap: {
1: '能上楼',
2: '低楼层'
},
//
upload: {
//
open: false,
//
title: "导入",
title: "细分产业导入",
//
isUploading: false,
//
updateSupport: 0,
//
headers: { Authorization: "Bearer " + getToken() },
//
url: process.env.VUE_APP_BASE_API + "/gysl/xfcygl/imporXfcy"
// url: process.env.VUE_APP_BASE_API + "/tc/assetCurrent/import"
url: location.origin + "/gysl/xfcygl/exportXfcy",
},
//
slsyxMap: {
'1': '能上楼',
'2': '低楼层',
}
};
},
created() {
this.getList();
},
methods: {
//
handleImport() {
this.upload.open = true;
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
querySearchAsync(queryString, cb) {
let results = [];
// getXfcyglPage API
getXfcyglPage({ cyxf: queryString }).then(res => {
res.data.records.forEach(item => {
results.push({
value: item.cyxf,
id: item.id,
});
});
});
cb(results);
},
/** 查询项目列表 */
//
getList() {
this.loading = true;
const params = {
...this.queryParams,
startTime: this.queryParams.dateRange ? this.queryParams.dateRange[0] : undefined,
endTime: this.queryParams.dateRange ? this.queryParams.dateRange[1] : undefined
};
getXfcyglPage(params).then(response => {
this.postList = response.data.records;
getXfcyglPage(this.queryParams).then(response => {
this.postList = response.data.records.map(item => ({
...item,
}));
this.total = response.data.total;
this.loading = false;
}).catch(error => {
console.error('API Request Error:', error);
this.loading = false;
});
},
//
@ -245,10 +291,16 @@ export default {
reset() {
this.form = {
id: undefined,
cylb: undefined,
cyxf: undefined,
cylb: undefined,
ycljschj: undefined,
slsyx: undefined,
createBy: undefined,
createId: undefined,
createTime: undefined,
updateBy: undefined,
updateId: undefined,
updateTime: undefined
};
this.resetForm("form");
},
@ -272,92 +324,84 @@ export default {
handleAdd() {
this.reset();
this.open = true;
this.title = "添加细分产业";
this.title = "新增细分产业";
},
/** 修改按钮操作 */
handleEdit(row) {
handleUpdate(row) {
this.reset();
const id = row.id;
getXfcyglById(id).then(response => {
this.form = response.data;
const catalogId = row.id;
this.form = { ...row };
this.open = true;
this.title = "修改细分产业";
});
},
/** 提交按钮 */
// submitForm
submitForm: function () {
this.$refs["form"].validate(valid => {
if (valid) {
//
const submitData = {
...this.form,
createBy: '',
createId: 0,
id: 0,
createTime: '',
updateBy: '',
updateId: 0,
updateTime: ''
};
// 便
console.log('准备提交的数据:', JSON.stringify(submitData, null, 2));
if (this.form.id !== undefined) {
updateXfcygl(submitData).then(response => {
updateXfcygl(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).catch(error => {
console.error('修改失败:', error);
console.error('API Request Error:', error);
});
} else {
addXfcygl(submitData).then(response => {
addXfcygl(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).catch(error => {
console.error('新增失败:', error);
console.error('API Request Error:', error);
});
}
}
});
},
//
reset() {
this.form = {
id: undefined,
cylb: undefined,
cyxf: undefined,
ycljschj: undefined,
slsyx: undefined,
createBy: this.$store.state.user.name,
createId: this.$store.state.user.userId,
createTime: undefined, //
updateBy: this.$store.state.user.name,
updateId: this.$store.state.user.userId,
updateTime: undefined //
};
this.resetForm("form");
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除ID为"' + ids + '"的数据项?' + '删除这条信息之后有可能找不回来了,请思考一下哟!').then(function () {
return deleteXfcygl([ids]);
const catalogIds = row.id || this.ids;
this.$modal.confirm('是否确认删除项目知识库编号为"' + catalogIds + '"的数据项?').then(() => {
return deleteXfcygl([catalogIds]);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
},
/** 导出按钮操作 */
handleExport() {
this.download('/gysl/xfcygl/exportXfcy', {
...this.queryParams
}, `细分产业管理${new Date().getTime()}.xlsx`);
}
//
handleImport() {
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download(
"/tc/assetCurrent/importTemplate",
{},
`目录导入模板${new Date().getTime()}.xlsx`
);
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
},
}
};
</script>
@ -392,5 +436,8 @@ export default {
.tablebtntwo {
margin-top: 1rem;
margin-bottom: 1rem;
width: 100%;
display: flex;
justify-content: space-between;
}
</style>

@ -0,0 +1,47 @@
upload: {
open: false,
isUploading: false,
headers: { Authorization: "Bearer " + getToken() },
url: process.env.VUE_APP_BASE_API + "/gysl/ml/importMl"
}
/** 导出按钮操作 */
handleExport() {
console.log('【导出参数】', JSON.stringify(this.queryParams, null, 2));
this.$modal.confirm('确认导出所有数据?').then(() => {
return exportCatalog(this.queryParams);
}).then(response => {
this.download(response.msg);
}).catch(error => {
console.error('导出失败:', error);
});
},
/** 导入按钮操作 */
handleImport() {
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download("/gysl/ml/importTemplate", {}, `目录导入模板_${new Date().getTime()}.xlsx`);
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
}

@ -37,7 +37,8 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://192.168.0.112:7071/`,
// target: `http://192.168.0.112:7071/`,
target: `http://39.101.188.84:7071/`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save