KeXuCong 7 months ago
parent
commit
abca102d7d
  1. 53
      jwtech-admin-page/src/api/enterprise/asset.js
  2. 750
      jwtech-admin-page/src/views/marketSupervision/enterpriseInformation/options/assetCondition.vue
  3. 15
      jwtech-admin-page/src/views/marketSupervision/enterpriseInformation/options/index.vue
  4. 2
      jwtech-admin-page/vue.config.js

53
jwtech-admin-page/src/api/enterprise/asset.js

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询资产状况信息列表
export function listAsset(query) {
return request({
url: '/enterprise/asset/list',
method: 'post',
data: query
})
}
// 查询资产状况信息详细
export function getAsset(id) {
return request({
url: '/enterprise/asset/' + id,
method: 'get'
})
}
// 新增资产状况信息
export function addAsset(data) {
return request({
url: '/enterprise/asset',
method: 'post',
data: data
})
}
// 修改资产状况信息
export function updateAsset(data) {
return request({
url: '/enterprise/asset',
method: 'put',
data: data
})
}
// 删除资产状况信息
export function delAsset(id) {
return request({
url: '/enterprise/asset/' + id,
method: 'delete'
})
}
// 导出资产状况信息
export function exportAsset(query) {
return request({
url: '/enterprise/asset/export',
method: 'get',
params: query
})
}

750
jwtech-admin-page/src/views/marketSupervision/enterpriseInformation/options/assetCondition.vue

@ -0,0 +1,750 @@
<template>
<div class="app-container">
<!-- <el-form
:model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
>
<el-form-item label="项目名称" prop="projectName">
<el-input
v-model="queryParams.data.projectName"
placeholder="请输入项目名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
>
<el-button
type="primary"
slot="append"
icon="el-icon-search"
size="small"
@click="handleQuery"
></el-button>
</el-input>
</el-form-item>
<el-form-item>
<el-button
type="cyan"
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>
</el-form> -->
<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-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="performanceRecordList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" fixed />
<el-table-column
label="序号"
type="index"
width="50"
align="center"
fixed
/>
<el-table-column
label="财务信息"
align="center"
prop="financialInformation"
min-width="180"
>
<template slot-scope="scope">
<div
v-for="(item, index) in JSON.parse(scope.row.financialInformation)"
:key="item + index"
>
<i class="el-icon-document"></i>
{{ item.name }}
<i
class="el-icon-download"
@click="downloadFile(scope, index)"
style="cursor: pointer"
></i>
</div>
</template>
</el-table-column>
<el-table-column
label="设备资产信息"
align="center"
prop="equipmentAssetInformation"
min-width="180"
>
<template slot-scope="scope">
<div
v-for="(item, index) in JSON.parse(
scope.row.equipmentAssetInformation
)"
:key="item + index"
>
<i class="el-icon-document"></i>
{{ item.name }}
<i
class="el-icon-download"
@click="downloadFile(scope, index)"
style="cursor: pointer"
></i>
</div>
</template>
</el-table-column>
<el-table-column
label="年份"
align="center"
prop="year"
min-width="120"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="180"
fixed="right"
>
<template slot-scope="scope">
<!-- <el-button
size="mini"
type="text"
icon="el-icon-view"
@click="viewInfo(scope.row)"
>查看</el-button
> -->
<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"
@click="handleDelete(scope.row)"
>删除</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"
/>
<!-- 添加或修改工程业绩记录对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
width="1200px"
append-to-body
:close-on-click-modal="false"
>
<el-row :gutter="15">
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-col :span="12">
<el-form-item label="财务信息" prop="financialInformation">
<!-- <el-input v-model="form.attachment" placeholder="请输入附件" /> -->
<el-upload
class="upload-demo"
action="thinking/common/upload"
:headers="headers"
:before-upload="(file) => $fileBeforeUpload(file, 'fileList')"
:on-preview="handlePreview"
:on-remove="(file) => handleRemove(file, 'fileList')"
:before-remove="beforeRemove"
multiple
:on-exceed="handleExceed"
:on-success="
(_, fileList) => submitUpload(fileList, 'fileList')
"
:file-list="fileList"
>
<el-button size="small" type="primary" plain>
<i class="el-icon-upload el-icon--right"></i>
点击上传
</el-button>
<div slot="tip" class="el-upload__tip">
支持jpg/png/pdf/word/excel文件等不超过200M
</div>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备资产信息" prop="equipmentAssetInformation">
<!-- <el-input v-model="form.attachment" placeholder="请输入附件" /> -->
<el-upload
class="upload-demo"
action="thinking/common/upload"
:headers="headers"
:before-upload="(file) => $fileBeforeUpload(file, 'fileList1')"
:on-preview="handlePreview"
:on-remove="(file) => handleRemove(file, 'fileList1')"
:before-remove="beforeRemove"
multiple
:on-exceed="handleExceed"
:on-success="
(_, fileList) => submitUpload(fileList, 'fileList1')
"
:file-list="fileList1"
>
<el-button size="small" type="primary" plain>
<i class="el-icon-upload el-icon--right"></i>
点击上传
</el-button>
<div slot="tip" class="el-upload__tip">
支持jpg/png/pdf/word/excel文件等不超过200M
</div>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="年份" prop="year">
<el-date-picker
clearable
size="small"
style="width: 100%"
v-model="form.year"
type="year"
value-format="yyyy"
placeholder="选择年份"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!--查看 -->
<el-dialog
:title="viewTitle"
:visible.sync="viewOpen"
width="1200px"
append-to-body
@close="closeView"
:close-on-click-modal="false"
>
<!-- 工程业绩记录 -->
<div class="infoTitle">工程业绩记录</div>
<div class="draLine"></div>
<div class="content">
<el-descriptions
class="margin-top"
:column="2"
border
:labelStyle="{
'text-align': 'left',
width: '180px',
height: '50px',
}"
:contentStyle="{ minWidth: '350px' }"
>
<el-descriptions-item>
<template slot="label"> 项目名称 </template>
{{ this.performanceRecordMsg.projectName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 建设单位 </template>
{{ this.performanceRecordMsg.constructingUnits }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 项目负责人 </template>
{{ this.performanceRecordMsg.projectLeader }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 项目所在地 </template>
{{ formatProjectLocation(this.performanceRecordMsg) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 项目状态 </template>
{{ projectStatusFormat(this.performanceRecordMsg) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 开工日期 </template>
{{ this.performanceRecordMsg.commencementDate }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 竣工日期 </template>
{{ this.performanceRecordMsg.completionDate }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 合同价万元 </template>
{{ this.performanceRecordMsg.contractPrice }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 项目获奖情况 </template>
{{ this.performanceRecordMsg.projectAwardSituation }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 质量评定结果 </template>
{{ this.performanceRecordMsg.qualityAssessmentResults }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 备注 </template>
{{ this.performanceRecordMsg.remark }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 附件 </template>
<template v-if="this.performanceRecordMsg.attachment">
<div
v-for="(item, index) in JSON.parse(
this.performanceRecordMsg.attachment
)"
:key="item + index"
>
{{ item.name }}
<i
class="el-icon-download"
@click="downloadFile2(item, index)"
style="cursor: pointer"
></i>
</div>
</template>
</el-descriptions-item>
</el-descriptions>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listAsset,
getAsset,
addAsset,
updateAsset,
delAsset,
exportAsset,
} from "@/api/enterprise/asset";
import {
listPerformanceRecord,
getPerformanceRecord,
delPerformanceRecord,
addPerformanceRecord,
updatePerformanceRecord,
exportPerformanceRecord,
} from "@/api/enterprise/performanceRecord";
import { getParentQualifications } from "@/api/enterprise/qualifications";
import { getAreasData } from "@/api/areas/index";
import { regionData, codeToText, TextToCode } from "element-china-area-data";
import { getToken } from "@/utils/auth";
import { getFileStream } from "@/api/system/upload";
export default {
name: "assetCondition",
props: ["enterpriseId"],
data() {
return {
areasOptionProps: {
emitPath: false, //value
checkStrictly: true, //
},
areasOptions: [],
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
performanceRecordList: [],
//
title: "",
viewTitle: "",
//
open: false,
viewOpen: false,
//
projectStatusOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
ids: null,
data: {
enterpriseId: null,
projectName: null,
constructingUnits: null,
proCode: null,
projectLeader: null,
projectLocation: null,
projectStatus: null,
commencementDate: null,
completionDate: null,
contractPrice: null,
projectAwardSituation: null,
qualityAssessmentResults: null,
attachment: null,
createUid: null,
updateUid: null,
owerDept: null,
},
//
params: {
//
orderBy: "create_time",
// descasc
sort: "desc",
},
},
//
form: {
id: null,
enterpriseId: null,
financialInformation: null,
equipmentAssetInformation: null,
year: null,
},
//
rules: {
projectName: [
{
required: true,
message: "请输入项目名称",
trigger: "blur",
},
{ max: 250, message: "字符长度最大为250", trigger: "blur" },
],
constructingUnits: [
{ max: 250, message: "字符长度最大为250", trigger: "blur" },
],
projectLeader: [
{ max: 250, message: "字符长度最大为250", trigger: "blur" },
],
contractPrice: [
{
pattern:
/(^[1-9]([0-9]{0,6})?(\.[0-9]{1,2})?$|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$))/,
message: "请输入数字,整数7位,可保留两位小数",
trigger: "blur",
},
],
projectAwardSituation: [
{ max: 250, message: "字符长度最大为250", trigger: "blur" },
],
qualityAssessmentResults: [
{ max: 250, message: "字符长度最大为250", trigger: "blur" },
],
remark: [{ max: 250, message: "字符长度最大为250", trigger: "blur" }],
},
//
headers: {
jianwei: "jwtech " + getToken(),
},
fileList: [],
fileList1: [],
performanceRecordMsg: {},
};
},
created() {
this.getList();
},
methods: {
formatProjectLocation(row) {
if (row.projectLocation) {
let provinceCode = row.projectLocation.slice(0, 2);
let cityCode = row.projectLocation.slice(2, 4);
let areaCode = row.projectLocation.slice(4, 6);
if (areaCode != "00") {
return (
codeToText[provinceCode] +
"-" +
codeToText[provinceCode + cityCode] +
"-" +
codeToText[provinceCode + cityCode + areaCode]
);
} else if (cityCode != "00") {
return (
codeToText[provinceCode] + "-" + codeToText[provinceCode + cityCode]
);
} else {
return codeToText[provinceCode];
}
}
},
/** 查询工程业绩记录列表 */
getList() {
this.loading = true;
this.queryParams.data.enterpriseId = this.enterpriseId;
listAsset(this.queryParams).then((response) => {
this.performanceRecordList = response.records;
this.total = response.total;
this.loading = false;
});
},
//
projectStatusFormat(row, column) {
return this.selectDictLabel(this.projectStatusOptions, row.projectStatus);
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.fileList = [];
this.form = {
id: null,
enterpriseId: null,
financialInformation: null,
equipmentAssetInformation: null,
year: null,
};
this.resetForm("form");
},
//
resetQueryForm() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
data: {
id: null,
enterpriseId: null,
projectName: null,
constructingUnits: null,
proCode: null,
projectLeader: null,
projectLocation: null,
projectStatus: null,
commencementDate: null,
completionDate: null,
contractPrice: null,
projectAwardSituation: null,
qualityAssessmentResults: null,
remark: null,
attachment: null,
createUid: null,
updateUid: null,
createTime: null,
updateTime: null,
owerDept: null,
},
//
params: {
//
orderBy: "create_time",
// descasc
sort: "desc",
},
};
this.resetForm("form");
},
//
viewInfo(row) {
// this.viewTitle = row.projectName.slice(0, row.projectName.indexOf("["));
this.viewTitle = row.projectName;
this.performanceRecordMsg = row;
console.log("performanceRecordMsg", row);
this.viewOpen = true;
},
//
closeView() {
this.performanceRecordMsg = {};
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetQueryForm();
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 = "添加工程业绩记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getAsset(id).then((response) => {
this.form = response.data;
if (this.form.financialInformation) {
this.fileList = JSON.parse(this.form.financialInformation);
}
if (this.form.equipmentAssetInformation) {
this.fileList1 = JSON.parse(this.form.equipmentAssetInformation);
}
this.open = true;
this.title = "修改工程业绩记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
this.form.enterpriseId = this.enterpriseId;
this.form.financialInformation = JSON.stringify(this.fileList);
this.form.equipmentAssetInformation = JSON.stringify(this.fileList1);
if (this.form.id != null) {
updateAsset(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addAsset(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
if (ids) {
this.$confirm("是否删除选中的数据?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return delAsset(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
} else {
this.$message.warning("请选择要删除的数据!!");
}
},
submitUpload(fileList, name) {
console.log(name, fileList);
this[name].push({
name: fileList.name,
fileName: fileList.response.fileName,
url: fileList.response.url,
uid: fileList.uid,
});
console.log(name, this[name]);
},
handleRemove(file, name) {
// console.log(file, fileList1);
let index = this[name].findIndex((item) => item.uid === file.uid);
//
this[name].splice(index, 1);
},
downloadFile(scope, index) {
// console.log(scope);
let file = JSON.parse(scope.row.attachment)[index];
this.handlePreview(file);
},
downloadFile2(info, index) {
console.log(info);
this.handlePreview(info);
},
//
handlePreview(file) {
// console.log(file);
getFileStream({ fileName: file.fileName }).then((res) => {
const blob = new Blob([res], {
// type
// application/xlsx application/zip
type: "application/xlsx",
}); //excel,pdf
const href = URL.createObjectURL(blob); //URLblob
const a = document.createElement("a"); //a
a.style.display = "none";
a.href = href; //
a.download = file.name; //
a.click(); //
URL.revokeObjectURL(a.href); //URL
});
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
files.length + fileList.length
} 个文件`
);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/css/dialog.scss";
</style>

15
jwtech-admin-page/src/views/marketSupervision/enterpriseInformation/options/index.vue

@ -89,6 +89,17 @@
:enterpriseId="$route.query.baseDataId"
/>
</el-tab-pane>
<el-tab-pane
label="资产状况信息"
name="assetCondition"
:disabled="!routeList[1].isEdit"
:lazy="true"
>
<assetCondition
v-if="activeName === 'assetCondition'"
:enterpriseId="$route.query.baseDataId"
/>
</el-tab-pane>
</el-tabs>
</div>
</template>
@ -101,6 +112,7 @@ import performanceRecord from "./performanceRecord.vue";
import behaviorAndCredit from "./behaviorAndCredit.vue";
import dynamicCredit from "./dynamicCredit.vue";
import personnelBehavior from './personnelBehavior.vue'
import assetCondition from './assetCondition.vue'
// import {
// listProjectinfo,
@ -119,7 +131,8 @@ export default {
performanceRecord,
behaviorAndCredit,
dynamicCredit,
personnelBehavior
personnelBehavior,
assetCondition
},
data() {
return {

2
jwtech-admin-page/vue.config.js

@ -43,7 +43,7 @@ module.exports = {
// target: "http://127.0.0.1:18082",
// target: "http://192.168.2.108:18080",
// target: "http://192.168.2.103:18082",
target: "http://192.168.2.111:18082",
target: "http://192.168.255.62:18082",
// target: "http://192.168.2.108:18080",
// target: "http://192.168.1.20:8084",
changeOrigin: true,

Loading…
Cancel
Save