Browse Source

修改

dev_kxc
xzt 1 year ago
parent
commit
8cadc49d0e
  1. 53
      jwtech-admin-page/src/api/build/djjgd.js
  2. 441
      jwtech-admin-page/src/views/building/partyConstructionDevelopment/index.vue
  3. 11
      jwtech-admin-page/src/views/building/projectInfo/projectProcess/index.vue
  4. 22
      jwtech-admin-page/src/views/building/projectInfo/projectProcess/peasantWorkerSystem/options/specificMarginAccount.vue
  5. 4
      jwtech-admin-page/src/views/building/projectInfo/projectProcess/qualityControl/index.vue
  6. 737
      jwtech-admin-page/src/views/building/projectInfo/projectProcess/safetyRecord.vue

53
jwtech-admin-page/src/api/build/djjgd.js

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询党建工地开展情况列表
export function listDjjgd(query) {
return request({
url: '/system/djjgd/list',
method: 'post',
data: query
})
}
// 查询党建工地开展情况详细
export function getDjjgd(id) {
return request({
url: '/system/djjgd/' + id,
method: 'get'
})
}
// 新增党建工地开展情况
export function addDjjgd(data) {
return request({
url: '/system/djjgd',
method: 'post',
data: data
})
}
// 修改党建工地开展情况
export function updateDjjgd(data) {
return request({
url: '/system/djjgd',
method: 'put',
data: data
})
}
// 删除党建工地开展情况
export function delDjjgd(id) {
return request({
url: '/system/djjgd/' + id,
method: 'delete'
})
}
// 导出党建工地开展情况
export function exportDjjgd(query) {
return request({
url: '/system/djjgd/export',
method: 'get',
params: query
})
}

441
jwtech-admin-page/src/views/building/partyConstructionDevelopment/index.vue

@ -0,0 +1,441 @@
<template>
<div class="app-container">
<!-- 面包屑 -->
<el-breadcrumb separator="/" style="margin-bottom: 20px">
<el-breadcrumb-item
v-for="(item, index) in routeList"
:key="item + index"
:to="{ path: item.path }"
>{{ item.routeName }}</el-breadcrumb-item
>
</el-breadcrumb>
<el-form
:model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
>
<el-form-item label="是否开展" prop="isCarry">
<el-select
v-model="queryParams.data.isCarry"
placeholder="请选择是否开展"
clearable
size="small"
@change="handleQuery"
>
<el-option
v-for="dict in isCarryOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</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"
v-hasPermi="['system:djjgd:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:djjgd:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:djjgd:remove']"
>删除</el-button
>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="warning"
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:djjgd:export']"
>导出</el-button
>
</el-col> -->
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="djjgdList"
@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="isCarry"
:formatter="isCarryFormat"
min-width="120"
/>
<el-table-column
label="附件"
align="center"
prop="attachment"
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-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:djjgd:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:djjgd:remove']"
>删除</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-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="是否开展" prop="isCarry">
<el-select
v-model="form.isCarry"
placeholder="请选择是否开展"
style="width: 100%"
>
<el-option
v-for="dict in isCarryOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="附件" prop="attachment">
<el-input v-model="form.attachment" placeholder="请输入附件" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listDjjgd,
getDjjgd,
delDjjgd,
addDjjgd,
updateDjjgd,
exportDjjgd,
} from "@/api/build/djjgd";
export default {
name: "Djjgd",
data() {
return {
//
routeList: [
{
path: "/building/partyConstructionDevelopment",
routeName: "党建工地开展情况",
},
],
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
djjgdList: [],
//
title: "",
//
open: false,
//
isCarryOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
ids: null,
data: {
proCode: null,
proNo: null,
createUid: null,
createTime: null,
updateUid: null,
updateTime: null,
isCarry: null,
attachment: null,
},
//
params: {
//
orderBy: "create_time",
// descasc
sortBy: "desc",
},
},
//
form: {},
//
rules: {},
};
},
created() {
this.getList();
this.getDicts("whether").then((response) => {
this.isCarryOptions = response.data;
});
},
methods: {
/** 查询党建工地开展情况列表 */
getList() {
this.loading = true;
listDjjgd(this.queryParams).then((response) => {
this.djjgdList = response.records;
this.total = response.total;
this.loading = false;
});
},
//
isCarryFormat(row, column) {
return this.selectDictLabel(this.isCarryOptions, row.isCarry);
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
proCode: null,
proNo: null,
createUid: null,
createTime: null,
updateUid: null,
updateTime: null,
isCarry: null,
attachment: null,
};
this.resetForm("form");
},
//
resetQueryForm() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
data: {
id: null,
proCode: null,
proNo: null,
createUid: null,
createTime: null,
updateUid: null,
updateTime: null,
isCarry: null,
attachment: null,
},
//
params: {
//
orderBy: "create_time",
// descasc
sortBy: "desc",
},
};
this.resetForm("form");
},
/** 搜索按钮操作 */
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;
getDjjgd(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改党建工地开展情况";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateDjjgd(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addDjjgd(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 delDjjgd(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
} else {
this.$message.warning("请选择要删除的数据!!");
}
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
let message = "是否确认导出所有的数据项?";
if (this.ids) {
message = "是否确认导出选中的数据项?";
queryParams.ids = this.ids;
}
this.$confirm(message, "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return exportDjjgd(queryParams);
})
.then((response) => {
this.downloadFile(response, true, response.msg);
// this.download(response.msg);
})
.catch(function () {});
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/css/dialog.scss";
//::v-deep {
// .el-dialog {
// margin-top: 10vh !important;
// }
//}
</style>

11
jwtech-admin-page/src/views/building/projectInfo/projectProcess/index.vue

@ -84,6 +84,15 @@
:proCode="formData.proCode"
/>
</el-tab-pane>
<el-tab-pane
v-if="checkPermi(['building:fxcs:index'])"
label="防汛措施"
name="safetyRecord"
:disabled="!routeList[1].isEdit"
:lazy="true"
>
<safetyRecord :proNo="formData.proNo" :proCode="formData.proCode" />
</el-tab-pane>
<el-tab-pane
v-if="checkPermi(['building:bgxx:index'])"
label="变更信息"
@ -181,6 +190,7 @@ import contract from "./contract/index.vue";
import preparationForConstruction from "./preparationForConstruction.vue";
// import qualityControl from "./qualityControl.vue";
import qualityControl from "./qualityControl/index.vue";
import safetyRecord from "./safetyRecord.vue";
import designChangeInformation from "./designChangeInformation.vue";
import scheduleManagement from "./scheduleManagement.vue";
import supervisionAndManagement from "./supervisionAndManagement/index.vue";
@ -205,6 +215,7 @@ export default {
contract,
preparationForConstruction,
qualityControl,
safetyRecord,
designChangeInformation,
scheduleManagement,
supervisionAndManagement,

22
jwtech-admin-page/src/views/building/projectInfo/projectProcess/peasantWorkerSystem/options/specificMarginAccount.vue

@ -112,6 +112,16 @@
align="center"
fixed
/>
<el-table-column
label="年月份"
align="center"
prop="yearMonthDate"
min-width="120"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.yearMonthDate, "{y}-{m}") }}</span>
</template>
</el-table-column>
<el-table-column
label="专用账号"
align="center"
@ -214,6 +224,18 @@
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" :rules="rules" label-width="180px">
<el-form-item label="年月份" prop="yearMonthDate">
<el-date-picker
clearable
size="small"
style="width: 100%"
v-model="form.yearMonthDate"
type="month"
value-format="yyyy-MM-dd"
placeholder="选择年月份"
>
</el-date-picker>
</el-form-item>
<el-form-item label="专用账号" prop="dedicatedAccounts">
<el-input
v-model="form.dedicatedAccounts"

4
jwtech-admin-page/src/views/building/projectInfo/projectProcess/qualityControl/index.vue

@ -48,9 +48,9 @@
:proCode="proCode"
/>
</el-tab-pane>
<el-tab-pane label="安全备案" name="safetyRecord" :lazy="true">
<!-- <el-tab-pane label="安全备案" name="safetyRecord" :lazy="true">
<safetyRecord :proNo="proNo" :proCode="proCode" />
</el-tab-pane>
</el-tab-pane> -->
</el-tabs>
</div>
</template>

737
jwtech-admin-page/src/views/building/projectInfo/projectProcess/safetyRecord.vue

@ -0,0 +1,737 @@
<template>
<div class="app-container">
<div class="listTitle">
<span>整体措施方案</span>
<span class="addBtn" @click="handleAdd(1)">
<i class="el-icon-plus"></i>
添加
</span>
</div>
<el-table v-loading="loading" :data="filingsList1">
<el-table-column label="序号" type="index" width="50" align="center" />
<el-table-column
label="年度"
align="center"
prop="year"
min-width="120"
/>
<el-table-column
label="内容描述"
align="center"
prop="content"
min-width="120"
/>
<el-table-column
label="备注"
align="center"
prop="remark"
min-width="120"
/>
<el-table-column
label="附件"
align="center"
prop="attachment"
min-width="120"
>
<template slot-scope="scope">
<div
v-for="(item, index) in JSON.parse(
scope.row.attachment ? scope.row.attachment : JSON.stringify({})
)"
: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"
class-name="small-padding fixed-width"
width="180"
fixed="right"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['build:filings:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['build:filings:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<div class="listTitle">
<span>度汛方案</span>
<span class="addBtn" @click="handleAdd(2)">
<i class="el-icon-plus"></i>
添加
</span>
</div>
<el-table v-loading="loading" :data="filingsList2">
<el-table-column label="序号" type="index" width="50" align="center" />
<el-table-column
label="年度"
align="center"
prop="year"
min-width="120"
/>
<el-table-column
label="批复单位"
align="center"
prop="approvalUnit"
min-width="120"
/>
<el-table-column
label="备案单位"
align="center"
prop="filingsUnit"
min-width="120"
/>
<el-table-column
label="批复意见文号"
align="center"
prop="approvalOpinionNumber"
min-width="120"
/>
<el-table-column
label="备案内容"
align="center"
prop="filingsContent"
min-width="120"
>
<template slot-scope="scope">
<div
v-for="(item, index) in JSON.parse(
scope.row.filingsContent
? scope.row.filingsContent
: JSON.stringify({})
)"
: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="approvalOpinion"
min-width="120"
>
<template slot-scope="scope">
<div
v-for="(item, index) in JSON.parse(
scope.row.approvalOpinion
? scope.row.approvalOpinion
: JSON.stringify({})
)"
: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"
class-name="small-padding fixed-width"
width="180"
fixed="right"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['build:filings:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['build:filings:remove']"
>删除</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="closeDialog"
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-form-item label="年度" prop="year">
<!-- <el-input v-model="form.year" placeholder="请输入年度" /> -->
<el-date-picker
v-model="form.year"
type="year"
placeholder="请选择年度"
style="width: 100%"
value-format="yyyy"
>
</el-date-picker>
</el-form-item>
<el-form-item label="内容描述" prop="content" v-if="form.type == 1">
<el-input
v-model="form.content"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item>
<el-form-item label="备注" prop="remark" v-if="form.type == 1">
<el-input
v-model="form.remark"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item>
<el-form-item label="附件" prop="attachment" v-if="form.type == 1">
<!-- <el-input
v-model="form.attachment"
type="textarea"
placeholder="请输入内容"
/> -->
<el-upload
class="upload-demo"
action="thinking/common/upload"
:headers="headers"
:before-upload="(file) => $fileBeforeUpload(file, 'fileList1')"
:on-preview="handlePreview"
:on-remove="handleRemove1"
:before-remove="beforeRemove"
multiple
:on-success="submitUpload1"
: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-form-item
label="批复单位"
prop="approvalUnit"
v-if="form.type == 2"
>
<el-input v-model="form.approvalUnit" placeholder="请输入批复单位" />
</el-form-item>
<el-form-item
label="批复意见文号"
prop="approvalOpinionNumber"
v-if="form.type == 2"
>
<el-input
v-model="form.approvalOpinionNumber"
placeholder="请输入批复意见文号"
/>
</el-form-item>
<el-form-item label="备案单位" prop="filingsUnit" v-if="form.type == 2">
<el-input v-model="form.filingsUnit" placeholder="请输入备案单位" />
</el-form-item>
<el-form-item
label="备案内容"
prop="filingsContent"
v-if="form.type == 2"
>
<!-- <el-input
v-model="form.filingsContent"
placeholder="请输入备案内容"
/> -->
<el-upload
class="upload-demo"
action="thinking/common/upload"
:headers="headers"
:before-upload="(file) => $fileBeforeUpload(file, 'fileList2')"
:on-preview="handlePreview"
:on-remove="handleRemove2"
:before-remove="beforeRemove"
multiple
:on-success="submitUpload2"
:file-list="fileList2"
>
<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-form-item
label="批复意见"
prop="approvalOpinion"
v-if="form.type == 2"
>
<!-- <el-input
v-model="form.approvalOpinion"
placeholder="请输入批复意见"
/> -->
<el-upload
class="upload-demo"
action="thinking/common/upload"
:headers="headers"
:before-upload="(file) => $fileBeforeUpload(file, 'fileList3')"
:on-preview="handlePreview"
:on-remove="handleRemove3"
:before-remove="beforeRemove"
multiple
:on-success="submitUpload3"
:file-list="fileList3"
>
<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-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listFilings,
getFilings,
delFilings,
addFilings,
updateFilings,
exportFilings,
} from "@/api/build/filings";
import { getToken } from "@/utils/auth";
import { getFileStream } from "@/api/system/upload";
export default {
name: "Filings",
props: ["proNo", "proCode"],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
filingsList1: [],
filingsList2: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
ids: null,
data: {
year: null,
content: null,
remark: null,
approvalUnit: null,
approvalOpinionNumber: null,
filingsUnit: null,
type: null,
createUid: null,
updateUid: null,
proCode: null,
proNo: null,
owerDept: null,
},
},
//
form: {},
//
rules: {
content: [
{ max: 2950, message: "字符长度最大为2950", trigger: "blur" },
],
remark: [{ max: 2950, message: "字符长度最大为2950", trigger: "blur" }],
approvalUnit: [
{ max: 250, message: "字符长度最大为250", trigger: "blur" },
],
approvalOpinionNumber: [
{ max: 250, message: "字符长度最大为250", trigger: "blur" },
],
filingsUnit: [
{ max: 250, message: "字符长度最大为250", trigger: "blur" },
],
},
fileList1: [],
fileList2: [],
fileList3: [],
//
headers: {
jianwei: "jwtech " + getToken(),
},
};
},
created() {
this.getList();
},
methods: {
closeDialog() {
this.fileList1 = [];
this.fileList2 = [];
this.fileList3 = [];
},
/** 查询安全备案列表 */
getList() {
this.loading = true;
this.queryParams.data.proNo = this.proNo;
this.queryParams.data.proCode = this.proCode;
listFilings(this.queryParams).then((response) => {
this.filingsList1 = response.records.filter((item) => item.type == 1);
this.filingsList2 = response.records.filter((item) => item.type == 2);
// this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
year: null,
content: null,
remark: null,
approvalUnit: null,
approvalOpinionNumber: null,
filingsUnit: null,
type: null,
createUid: null,
updateUid: null,
createTime: null,
updateTime: null,
proCode: null,
proNo: null,
owerDept: null,
};
this.resetForm("form");
},
//
resetQueryForm() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
data: {
id: null,
year: null,
content: null,
remark: null,
approvalUnit: null,
approvalOpinionNumber: null,
filingsUnit: null,
type: null,
createUid: null,
updateUid: null,
createTime: null,
updateTime: null,
proCode: null,
proNo: null,
owerDept: null,
},
};
this.resetForm("form");
},
/** 搜索按钮操作 */
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(type) {
this.reset();
this.open = true;
this.form.type = type;
if (this.form.type == 1) {
this.title = "添加整体措施方案";
} else {
this.title = "添加度汛方案";
}
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getFilings(id).then((response) => {
this.form = response.data;
this.open = true;
// console.log("this.form", this.form);
if (this.form.type == 1) {
this.title = "修改整体措施方案";
if (response.data.attachment)
this.fileList1 = JSON.parse(response.data.attachment);
} else {
this.title = "修改度汛方案";
if (response.data.filingsContent)
this.fileList2 = JSON.parse(response.data.filingsContent);
if (response.data.approvalOpinion)
this.fileList3 = JSON.parse(response.data.approvalOpinion);
}
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
this.form.proNo = this.proNo;
this.form.proCode = this.proCode;
if (this.fileList1.length > 0) {
this.form.attachment = JSON.stringify(this.fileList1);
}
if (this.fileList2.length > 0) {
this.form.filingsContent = JSON.stringify(this.fileList2);
}
if (this.fileList3.length > 0) {
this.form.approvalOpinion = JSON.stringify(this.fileList3);
}
if (this.form.id != null) {
updateFilings(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addFilings(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 delFilings(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
} else {
this.$message.warning("请选择要删除的数据!!");
}
},
//
submitUpload1(_, fileList) {
console.log("fileList1", fileList);
this.fileList1.push({
name: fileList.name,
fileName: fileList.response.fileName,
url: fileList.response.url,
uid: fileList.uid,
});
},
handleRemove1(file, fileList) {
// console.log(file, fileList);
let index = this.fileList1.findIndex((item) => item.uid === file.uid);
//
this.fileList1.splice(index, 1);
},
//
downloadFile_1(scope, index) {
console.log(scope);
let file = JSON.parse(scope.row.attachment)[index];
this.handlePreview(file);
},
//
submitUpload2(_, fileList) {
console.log("fileList2", fileList);
this.fileList2.push({
name: fileList.name,
fileName: fileList.response.fileName,
url: fileList.response.url,
uid: fileList.uid,
});
},
handleRemove2(file, fileList) {
// console.log(file, fileList);
let index = this.fileList2.findIndex((item) => item.uid === file.uid);
//
this.fileList2.splice(index, 1);
},
//
downloadFile_2(scope, index) {
console.log(scope);
let file = JSON.parse(scope.row.filingsContent)[index];
this.handlePreview(file);
},
//
submitUpload3(_, fileList) {
console.log("fileList3", fileList);
this.fileList3.push({
name: fileList.name,
fileName: fileList.response.fileName,
url: fileList.response.url,
uid: fileList.uid,
});
},
handleRemove3(file, fileList) {
// console.log(file, fileList);
let index = this.fileList3.findIndex((item) => item.uid === file.uid);
//
this.fileList3.splice(index, 1);
},
//
downloadFile_3(scope, index) {
console.log(scope);
let file = JSON.parse(scope.row.approvalOpinion)[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
});
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/css/dialog.scss";
// ::v-deep {
// .el-dialog {
// margin-top: 10vh !important;
// }
// }
.listTitle {
font-size: 14px;
padding-left: 10px;
padding-right: 30px;
margin: 20px 0;
border-left: 2px solid #36b29e;
display: flex;
justify-content: space-between;
span:nth-child(1) {
font-weight: bold;
}
.addBtn {
color: #36b29e;
cursor: pointer;
}
.addBtn:hover {
color: #31a08e;
}
}
</style>
Loading…
Cancel
Save