资产导入导出、资产bugfix

lijinlong
吕天方 5 months ago
parent a4ef00a1d5
commit dac1f216d2

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 MiB

@ -2887,6 +2887,11 @@ export default {
this.ruleForm.xjgywxt = {} this.ruleForm.xjgywxt = {}
this.$set(this.ruleForm.xjgywxt, 'remark', "") this.$set(this.ruleForm.xjgywxt, 'remark', "")
} }
if(this.ruleForm.fwwz) {
let arr = this.ruleForm.fwwz.split("-")
this.select = arr[0]
this.ruleForm.fwwz = arr[1]
}
this.ruleForm.xttz ? this.xttz = this.ruleForm.xttz.split(',') : []; this.ruleForm.xttz ? this.xttz = this.ruleForm.xttz.split(',') : [];
let chepingUnit = this.ruleForm.gylxxList.filter((item) => item.type == 1) let chepingUnit = this.ruleForm.gylxxList.filter((item) => item.type == 1)
let yjgysUnit = this.ruleForm.gylxxList.filter((item) => item.type == 2) let yjgysUnit = this.ruleForm.gylxxList.filter((item) => item.type == 2)
@ -3054,17 +3059,20 @@ export default {
this.ruleForm.shi = this.dlwz[1] this.ruleForm.shi = this.dlwz[1]
this.ruleForm.qu = this.dlwz[2] this.ruleForm.qu = this.dlwz[2]
} }
if(this.ruleForm.fwwz) {
this.ruleForm.fwwz = this.select + "-" + this.ruleForm.fwwz
}
this.loading = true; this.loading = true;
if(this.$route.query.pageType == 'change') { if(this.$route.query.pageType == 'change') {
assetUnitData('put',this.ruleForm).then(res=>{ assetUnitData('put',this.ruleForm).then(res=>{
console.log(res,"res"); // console.log(res,"res");
this.loading = false; this.loading = false;
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.$router.go(-1); this.$router.go(-1);
}) })
} else { } else {
assetUnitData('post',this.ruleForm).then(res=>{ assetUnitData('post',this.ruleForm).then(res=>{
console.log(res,"res"); // console.log(res,"res");
this.loading = false; this.loading = false;
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.$router.go(-1); this.$router.go(-1);

@ -160,11 +160,41 @@
:current-page.sync="formInline.current" :current-page.sync="formInline.current"
></my-pagination> ></my-pagination>
</main> </main>
<!-- 资产导入对话框 -->
<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">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
</div>
<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">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import myPagination from "@/views/components/Pagination/index.vue" import myPagination from "@/views/components/Pagination/index.vue"
// import myDialog from "@/views/components/myDialog/index.vue" // import myDialog from "@/views/components/myDialog/index.vue"
import { getToken } from "@/utils/auth";
import { assetUnit, deleteAssetInfo } from "@/api/auditPagesApi/index"; import { assetUnit, deleteAssetInfo } from "@/api/auditPagesApi/index";
export default { export default {
dicts: ['zc_xtzt','zc_xtlx'], dicts: ['zc_xtzt','zc_xtlx'],
@ -186,6 +216,21 @@ export default {
tableData:[], tableData:[],
loading:false, loading:false,
tabHeader: undefined, tabHeader: undefined,
//
upload: {
//
open: false,
//
title: "资产导入",
//
isUploading: false,
//
updateSupport: 0,
//
headers: { Authorization: "Bearer " + getToken() },
//
url: process.env.VUE_APP_BASE_API + "/tc/assetCurrent/import"
},
} }
}, },
mounted(){ mounted(){
@ -210,7 +255,6 @@ export default {
resetQuery(){ resetQuery(){
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
this.getList();
}, },
// //
handleQuery(){ handleQuery(){
@ -229,9 +273,36 @@ export default {
this.getList(); this.getList();
}, },
// //
handleImport(){}, handleImport(){
this.upload.open = true;
},
// //
handleExport(){}, handleExport(){
this.download('/tc/assetCurrent/export', {
...this.formInline
}, `asset_${new Date().getTime()}.xlsx`)
},
/** 下载模板操作 */
importTemplate() {
this.download('/tc/assetCurrent/importTemplate', {
}, `asset${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();
},
// //
handleAdd(){ handleAdd(){
this.$router.push({name: 'AssetsAuth',query: { this.$router.push({name: 'AssetsAuth',query: {

@ -1,7 +1,7 @@
<template> <template>
<div class="login"> <div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form"> <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">若依后台管理系统</h3> <h3 class="title">太仓资产核查管理系统</h3>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input <el-input
v-model="loginForm.username" v-model="loginForm.username"
@ -161,13 +161,16 @@ export default {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 100%; height: 100%;
background-image: url("../assets/images/login-background.jpg"); background-image: url("../assets/images/bg@2x.png");
background-size: cover; background-size: cover;
} }
.title { .title {
margin: 0px auto 30px auto; margin: 0px auto 30px auto;
text-align: center; text-align: center;
color: #707070; font-family: Alimama ShuHeiTi;
font-weight: bold;
font-size: 24px;
color: #192734;
} }
.login-form { .login-form {

@ -510,7 +510,7 @@ export default {
}, },
/** 导入按钮操作 */ /** 导入按钮操作 */
handleImport() { handleImport() {
this.upload.title = "用户导入"; this.upload.title = "单位导入";
this.upload.open = true; this.upload.open = true;
}, },
/** 下载模板操作 */ /** 下载模板操作 */

File diff suppressed because it is too large Load Diff

@ -3,38 +3,36 @@
<div class="L-main" id="L-size-main"> <div class="L-main" id="L-size-main">
<div class="content-search" id="L-header"> <div class="content-search" id="L-header">
<div class="search-title">查询条件</div> <div class="search-title">查询条件</div>
<el-form :inline="true" :model="formInline" size="small" class="demo-form-inline"> <el-form :inline="true" ref="queryForm" :model="formInline" size="small" class="demo-form-inline">
<el-row> <el-row>
<el-col :span="7"> <el-col :span="7">
<el-form-item label="系统名称:"> <el-form-item label="系统名称:" prop="xtmc">
<el-input v-model="formInline.name" placeholder="请输入"></el-input> <el-input v-model="formInline.xtmc" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
<el-form-item label="系统类型:"> <el-form-item label="系统类型:" prop="xtlx">
<el-select v-model="formInline.type" placeholder="请选择"> <el-select v-model="formInline.xtlx" placeholder="请选择系统类型">
<el-option label="item.label" value="item.value"> <el-option
</el-option> v-for="dict in dict.type.zc_xtlx"
<!-- <el-option
v-for="dict in dict.type.bms_approval_status"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value"> :value="dict.value">
</el-option> --> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
<el-form-item label="系统状态:"> <el-form-item label="系统状态:" prop="xtzt">
<el-select v-model="formInline.status" placeholder="请选择"> <el-select v-model="formInline.xtzt" placeholder="请选择">
<el-option label="item.label" value="item.value"> <el-select v-model="formInline.xtzt" placeholder="请选择系统状态">
</el-option> <el-option
<!-- <el-option v-for="dict in dict.type.zc_xtzt"
v-for="dict in dict.type.bms_approval_status"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value"> :value="dict.value">
</el-option> --> </el-option>
</el-select>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -48,35 +46,50 @@
</el-form> </el-form>
</div> </div>
<main> <main>
<div class="search-title search-title-two"> <div class="search-title">
<span class="search-title-span">资产列表</span> <span class="search-title-span">资产列表</span>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
</el-col>
</el-row>
</div> </div>
<section> <section>
<el-table v-loading="loading" :data="tableData" :height="tabHeader" :max-height="tabHeader" :row-class-name="tableRowClassName"> <el-table v-loading="loading" :data="tableData" :height="tabHeader" :max-height="tabHeader" :row-class-name="tableRowClassName">
<el-table-column type="index" width="50" label="序号" align="center"/> <el-table-column type="index" width="50" label="序号" align="center"/>
<el-table-column label="系统名称" key="number" width="200px" prop="number" align="center" /> <el-table-column label="系统名称" key="xtmc" width="200px" prop="xtmc" align="center" />
<el-table-column label="系统类型" key="name" prop="name" align="center" /> <el-table-column label="系统类型" key="xtlx" prop="xtlx" align="center">
<el-table-column label="单位名称" key="type" prop="type" align="center"> <template slot-scope="scope">
<dict-tag :options="dict.type.zc_xtlx" :value="scope.row.xtlx"/>
</template>
</el-table-column>
<el-table-column label="单位名称" key="dwmc" prop="dwmc" align="center">
<!-- <template slot-scope="scope"> <!-- <template slot-scope="scope">
<dict-tag :options="dict.type.project_middle_type" :value="scope.row.projectMiddleType"/> <dict-tag :options="dict.type.project_middle_type" :value="scope.row.projectMiddleType"/>
</template> --> </template> -->
</el-table-column> </el-table-column>
<el-table-column label="新增时间" key="time" prop="time" align="center" /> <el-table-column label="新增时间" key="createTime" prop="createTime" align="center" />
<el-table-column label="系统状态" key="status" width="200px" prop="status" class-name="table-status" align="center"> <el-table-column label="系统状态" key="status" prop="status" class-name="table-status" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.status === 0" style="color: #16B771;"> <span v-if="scope.row.xtzt == 1" style="color: #16B771;">
已安装 已安装
</span> </span>
<span v-if="scope.row.status === 1" style="color: #F58A0C;"> <span v-if="scope.row.xtzt == 2" style="color: #F58A0C;">
测试中 测试中
</span> </span>
<span v-if="scope.row.status === 2" style="color: #1485EF;"> <span v-if="scope.row.xtzt == 3" style="color: #1485EF;">
使用中 使用中
</span> </span>
<span v-if="scope.row.status === 3" style="color: #29A07A;"> <span v-if="scope.row.xtzt == 4" style="color: #29A07A;">
维护中 维护中
</span> </span>
<span v-if="scope.row.status === 4" style="color: #F50C0C;"> <span v-if="scope.row.xtzt == 5" style="color: #F50C0C;">
报废 报废
</span> </span>
</template> </template>
@ -84,17 +97,9 @@
<el-table-column label="操作" prop="userId" class-name="table-operation" align="center"> <el-table-column label="操作" prop="userId" class-name="table-operation" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div style="display: flex;align-items: center;justify-content: center;"> <div style="display: flex;align-items: center;justify-content: center;">
<div style="display: flex;align-items: center;cursor: pointer;"> <div style="display: flex;align-items: center;cursor: pointer;" @click="goInfo(scope.row)">
<img src="@/assets/images/icon-ck@2x.png" alt="" style="width: 20px;margin-right: 5px;"> <img src="@/assets/images/icon-ck@2x.png" alt="" style="width: 20px;margin-right: 5px;">
<span class="look-info" @click="goInfo(scope.row)" style="color: #1485EF;margin-right: 15px;">查看</span> <span class="look-info" style="color: #1485EF;margin-right: 15px;">查看</span>
</div>
<div style="display: flex;align-items: center;cursor: pointer;">
<img src="@/assets/images/edit.png" alt="" style="width: 15px;margin-right: 5px;">
<span class="look-info" @click="goInfo(scope.row)" style="color: #1485EF;margin-right: 15px;">编辑</span>
</div>
<div style="display: flex;align-items: center;cursor: pointer;">
<img src="@/assets/images/del.png" alt="" style="width: 20px;margin-right: 5px;">
<span class="look-info" @click="goInfo(scope.row)" style="color: #F50C0C;margin-right: 15px;">删除</span>
</div> </div>
</div> </div>
</template> </template>
@ -104,10 +109,10 @@
<my-pagination <my-pagination
id="L-pagination" id="L-pagination"
:total="total" :total="total"
:page="pagination.current" :page="formInline.current"
:limit="pagination.size" :limit="formInline.size"
@pagination="getPagination" @pagination="getPagination"
:current-page.sync="pagination.current" :current-page.sync="formInline.current"
></my-pagination> ></my-pagination>
</main> </main>
</div> </div>
@ -115,21 +120,20 @@
<script> <script>
import myPagination from "@/views/components/Pagination/index.vue" import myPagination from "@/views/components/Pagination/index.vue"
// import myDialog from "@/views/components/myDialog/index.vue" // import myDialog from "@/views/components/myDialog/index.vue"
import { assetUnit, deleteAssetInfo } from "@/api/auditPagesApi/index";
export default { export default {
// dicts: ['jjh_project_type', 'bms_approval_status', "project_middle_type", "project_small_type", "project_categories"], dicts: ['zc_xtzt','zc_xtlx'],
components:{myPagination}, components:{myPagination},
data() { data() {
return { return {
formInline:{ formInline:{
name:"", xtmc:"",
type:"", xtlx:"",
status:"", xtzt:"",
},
total:0,
pagination:{
current:1, current:1,
size:10, size:10,
}, },
total:0,
tableData:[ tableData:[
{ {
number:20230001, number:20230001,
@ -173,7 +177,7 @@ export default {
} }
}, },
mounted(){ mounted(){
this.getInfo(); this.getList();
this.cancalDebounce(); this.cancalDebounce();
window.addEventListener('resize', this.cancalDebounce); window.addEventListener('resize', this.cancalDebounce);
}, },
@ -182,69 +186,45 @@ export default {
}, },
methods:{ methods:{
// //
getInfo(){ getList(){
// this.loading = true; this.loading = true;
// jProject(this.pagination).then(res=>{ assetUnit('get',this.formInline).then(res=>{
// this.loading = false; this.loading = false;
// this.total = res.data.total; this.total = res.data.total;
// this.tableData = res.data.records; this.tableData = res.data.records;
// }) })
}, },
// //
resetQuery(){ resetQuery(){
this.formInline = { this.resetForm("queryForm");
name:"", this.handleQuery();
type:"",
time:[],
number:"",
status:"",
}
this.pagination = {
current: 1,
size: 10,
}
this.getList();
}, },
// //
handleQuery(){ handleQuery(){
this.pagination = { this.formInline.current = 1;
current: 1,
size: 10
}
if(this.formInline.time.length > 0) {
this.formInline.startTime = this.formInline.time[0]
this.formInline.endTime = this.formInline.time[1]
}
this.pagination = { ...this.pagination,...this.formInline };
this.getList(); this.getList();
}, },
// //
getPagination(pages){ getPagination(pages){
this.pagination.current = pages.page; this.formInline.current = pages.page;
this.pagination.size = pages.limit; this.formInline.size = pages.limit;
this.getList(); this.getList();
}, },
// //
handleImport(){}, handleImport(){},
// //
handleExport(){}, handleExport(){
// this.download('/tc/assetCurrent/export', {
handleAdd(){ ...this.formInline
this.$router.push({name: 'AssetsAuth',query: { }, `asset_${new Date().getTime()}.xlsx`)
pageType: "add",
}})
}, },
// //
goInfo(){ goInfo(row){
this.$router.push({name: 'myAssetsAuth',query: { this.$router.push({name: 'myAssetsAuth',query: {
pageType: "add", pageType: "look",
id: row.id
}}) }})
}, },
//
edit(){
},
//
delInfo(){},
// table // table
tableRowClassName({row, rowIndex}){ tableRowClassName({row, rowIndex}){
if (rowIndex % 2 !== 0) { if (rowIndex % 2 !== 0) {
@ -260,7 +240,7 @@ export default {
const elementHeight = element.offsetHeight; const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight; const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight; const paginationtHeight = pagination.offsetHeight;
this.tabHeader = elementHeight - headerHeight - paginationtHeight - 110; this.tabHeader = elementHeight - headerHeight - paginationtHeight - 80;
} }
}, },
} }

Loading…
Cancel
Save