35 changed files with 9600 additions and 1352 deletions
@ -0,0 +1,958 @@ |
|||
<template> |
|||
<div> |
|||
<el-form |
|||
:model="queryParams" |
|||
ref="queryForm" |
|||
:inline="true" |
|||
v-show="showSearch" |
|||
> |
|||
<el-form-item label="缴存方式" prop="depositMethods"> |
|||
<el-select |
|||
v-model="queryParams.conditionViews[0].value" |
|||
placeholder="请选择缴存方式" |
|||
clearable |
|||
size="small" |
|||
@change="handleQuery" |
|||
> |
|||
<el-option |
|||
v-for="dict in depositMethodsOptions" |
|||
:key="dict.dictValue" |
|||
:label="dict.dictLabel" |
|||
:value="dict.dictValue" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="缴存单位名称" prop="guaranteeBankName"> |
|||
<el-input |
|||
v-model="queryParams.conditionViews[1].value" |
|||
placeholder="请输入缴存单位名称" |
|||
clearable |
|||
size="small" |
|||
@keyup.enter.native="handleQuery" |
|||
> |
|||
<template slot="append"> |
|||
<el-button |
|||
type="primary" |
|||
slot="append" |
|||
icon="el-icon-search" |
|||
size="small" |
|||
@click="handleQuery" |
|||
></el-button> |
|||
</template> |
|||
</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" |
|||
v-hasPermi="[`system:${type}: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:${type}: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:${type}:remove`]" |
|||
>删除</el-button |
|||
> |
|||
</el-col> |
|||
<right-toolbar |
|||
:showSearch.sync="showSearch" |
|||
@queryTable="getList" |
|||
></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table |
|||
v-loading="loading" |
|||
:data="tbbzjList" |
|||
@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="depositMethods" |
|||
:formatter="depositMethodsFormat" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="缴存单位" |
|||
align="center" |
|||
prop="guaranteeBankName" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="缴存金额/保函金额/保险金额/担保金额(万元)" |
|||
align="center" |
|||
prop="depositMethods" |
|||
min-width="180" |
|||
> |
|||
<template slot-scope="scope"> |
|||
{{ |
|||
scope.row.depositAmount + |
|||
scope.row.bankGuaranteeLetterAmount + |
|||
scope.row.guaranteeCompanyAmount + |
|||
scope.row.insuranceAmount |
|||
}} |
|||
</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="[`system:${type}:edit`]" |
|||
>修改</el-button |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="[`system:${type}: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-row :gutter="15"> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="150px"> |
|||
<!-- ==============共有============= --> |
|||
<el-row :gutter="15"> |
|||
<el-col :span="12"> |
|||
<el-form-item label="缴存方式" prop="depositMethods"> |
|||
<el-select |
|||
v-model="form.depositMethods" |
|||
placeholder="请选择缴存方式" |
|||
style="width: 100%" |
|||
multiple |
|||
clearable |
|||
> |
|||
<el-option |
|||
v-for="dict in depositMethodsOptions" |
|||
:key="dict.dictValue" |
|||
:label="dict.dictLabel" |
|||
:value="dict.dictValue" |
|||
></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="缴存单位" prop="guaranteeBankName"> |
|||
<el-input |
|||
v-model="form.guaranteeBankName" |
|||
placeholder="请输入缴存单位" |
|||
/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
|
|||
<!-- ===========不共有============== --> |
|||
<!-- 1、现金存储 --> |
|||
<!-- <el-col :span="12" v-if="hasOne"> |
|||
<el-form-item label="现金金额" prop="cashAmount"> |
|||
<el-input v-model="form.cashAmount" placeholder="请输入现金金额"> |
|||
<template slot="append">万元</template> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-col> --> |
|||
<el-col :span="12" v-if="hasOne"> |
|||
<el-form-item label="缴存金额" prop="depositAmount"> |
|||
<el-input |
|||
v-model="form.depositAmount" |
|||
placeholder="请输入缴存金额" |
|||
> |
|||
<template slot="append">万元</template> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-if="hasOne"> |
|||
<el-form-item label="缴存日期" prop="depositAmountDate"> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
v-model="form.depositAmountDate" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="请选择缴存日期" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-if="hasOne"> |
|||
<el-form-item label="缴存银行名称" prop="depositBank"> |
|||
<el-input |
|||
v-model="form.depositBank" |
|||
placeholder="请输入缴存银行名称" |
|||
/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-if="hasOne"> |
|||
<el-form-item label="缴存保证金银行号" prop="depositBankNumber"> |
|||
<el-input |
|||
v-model="form.depositBankNumber" |
|||
placeholder="请输入缴存保证金银行号" |
|||
/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-if="hasOne"> |
|||
<el-form-item label="开户行地址" prop="accountBankAddress"> |
|||
<el-input |
|||
v-model="form.accountBankAddress" |
|||
placeholder="请输入开户行地址" |
|||
/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-if="hasOne"> |
|||
<el-form-item label="缴存凭证号" prop="voucherNumber"> |
|||
<el-input |
|||
v-model="form.voucherNumber" |
|||
placeholder="请输入缴存凭证号" |
|||
/> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
<!-- 2、银行保函 --> |
|||
<el-col :span="12" v-if="hasTwo"> |
|||
<el-form-item label="保函编号" prop="bankGuaranteeLetterNo"> |
|||
<el-input |
|||
v-model="form.bankGuaranteeLetterNo" |
|||
placeholder="请输入保函编号" |
|||
/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-if="hasTwo"> |
|||
<el-form-item label="银行保函金额" prop="bankGuaranteeLetterAmount"> |
|||
<el-input |
|||
v-model="form.bankGuaranteeLetterAmount" |
|||
placeholder="请输入银行保函金额" |
|||
> |
|||
<template slot="append">万元</template> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-if="hasTwo"> |
|||
<el-form-item label="保函开立日期" prop="bankGuaranteeStartYear"> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
v-model="form.bankGuaranteeStartYear" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择保函开立日期" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-if="hasTwo"> |
|||
<el-form-item label="保函到期日期" prop="bankGuaranteeEndYear"> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
v-model="form.bankGuaranteeEndYear" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择保函到期日期" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
<!-- 3、工程保证保险 --> |
|||
<el-col :span="12" v-if="hasThree"> |
|||
<el-form-item label="保险公司名称" prop="insuranceCompanyName"> |
|||
<el-input |
|||
v-model="form.insuranceCompanyName" |
|||
placeholder="请输入保险公司名称" |
|||
/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-if="hasThree"> |
|||
<el-form-item label="保险合同编号" prop="insuranceNo"> |
|||
<el-input |
|||
v-model="form.insuranceNo" |
|||
placeholder="请输入保险合同编号" |
|||
/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-if="hasThree"> |
|||
<el-form-item label="保险金额" prop="insuranceAmount"> |
|||
<el-input |
|||
v-model="form.insuranceAmount" |
|||
placeholder="请输入保险金额" |
|||
> |
|||
<template slot="append">万元</template> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-if="hasThree"> |
|||
<el-form-item label="保险生效日期" prop="insuranceStartTime"> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
v-model="form.insuranceStartTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择保险生效日期" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-if="hasThree"> |
|||
<el-form-item label="保险失效日期" prop="insuranceEndTime"> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
v-model="form.insuranceEndTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择保险失效日期" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-if="hasThree"> |
|||
<el-form-item label="支付保险费金额" prop="payAmountInsurance"> |
|||
<el-input |
|||
v-model="form.payAmountInsurance" |
|||
placeholder="请输入支付保险费金额" |
|||
> |
|||
<template slot="append">万元</template> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-if="hasThree"> |
|||
<el-form-item label="支付保险费日期" prop="payAmountInsuranceTime"> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
v-model="form.payAmountInsuranceTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择支付保险费日期" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
<!-- 4、工程担保公司保函 --> |
|||
<el-col :span="12" v-if="hasFour"> |
|||
<el-form-item label="担保银行名称" prop="guaranteeCompanyName"> |
|||
<el-input |
|||
v-model="form.guaranteeCompanyName" |
|||
placeholder="请输入担保银行名称" |
|||
/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-if="hasFour"> |
|||
<el-form-item |
|||
label="担保公司保函函编号" |
|||
prop="guaranteeCompanyLetterNo" |
|||
> |
|||
<el-input |
|||
v-model="form.guaranteeCompanyLetterNo" |
|||
placeholder="请输入担保公司保函函编号" |
|||
/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-if="hasFour"> |
|||
<el-form-item |
|||
label="担保公司担保金额" |
|||
prop="guaranteeCompanyAmount" |
|||
> |
|||
<el-input |
|||
v-model="form.guaranteeCompanyAmount" |
|||
placeholder="请输入担保公司担保金额" |
|||
> |
|||
<template slot="append">万元</template> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-if="hasFour"> |
|||
<el-form-item |
|||
label="担保保函开立日期" |
|||
prop="guaranteeCompanyStartYear" |
|||
> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
v-model="form.guaranteeCompanyStartYear" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择担保保函开立日期" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-if="hasFour"> |
|||
<el-form-item |
|||
label="担保保函到期日期" |
|||
prop="guaranteeCompanyEndYear" |
|||
> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
v-model="form.guaranteeCompanyEndYear" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择担保保函到期日期" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
<!-- ===========共有============== --> |
|||
<el-col :span="24"> |
|||
<el-form-item label="附件材料" prop="cashStorageFile"> |
|||
<myUpload :fileList="fileList" /> |
|||
</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> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: "Bzj", |
|||
props: ["proNo", "projectCode", "projectName", "formMethods", "type"], |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 投标保证金表格数据 |
|||
tbbzjList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
differentiatedDepositAmount: null, |
|||
amountPayable: null, |
|||
paidAmount: null, |
|||
depositMethods: null, |
|||
depositBankSalaryDeposit: null, |
|||
salaryDepositBankAccount: null, |
|||
cashAmount: null, |
|||
guaranteeBankName: null, |
|||
bankGuaranteeLetterNo: null, |
|||
bankGuaranteeLetterAmount: null, |
|||
bankGuaranteeStartYear: null, |
|||
bankGuaranteeEndYear: null, |
|||
guaranteeCompanyName: null, |
|||
guaranteeCompanyLetterNo: null, |
|||
guaranteeCompanyAmount: null, |
|||
guaranteeCompanyStartYear: null, |
|||
guaranteeCompanyEndYear: null, |
|||
insuranceCompanyName: null, |
|||
insuranceNo: null, |
|||
insuranceAmount: null, |
|||
insuranceStartTime: null, |
|||
insuranceEndTime: null, |
|||
otherAmount: null, |
|||
incomeTime: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
projectCode: null, |
|||
proNo: null, |
|||
owerDept: null, |
|||
}, |
|||
conditionViews: [ |
|||
{ |
|||
name: "depositMethods", |
|||
value: "", |
|||
type: "like", |
|||
isAnd: "1", |
|||
}, |
|||
{ |
|||
name: "guaranteeBankName", |
|||
value: "", |
|||
type: "like", |
|||
isAnd: "1", |
|||
}, |
|||
], |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
depositMethods: [ |
|||
{ |
|||
required: true, |
|||
message: "请选择缴存方式", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
guaranteeBankName: [ |
|||
{ |
|||
required: true, |
|||
message: "请输入缴存单位", |
|||
trigger: "blur", |
|||
}, |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
|
|||
depositAmount: [ |
|||
{ |
|||
pattern: |
|||
/(^[1-9]([0-9]{0,6})?(\.[0-9]{1,2})?$|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$))/, |
|||
message: "请输入数字,整数7位,可保留两位小数", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
depositAmountDate: [ |
|||
// { |
|||
// required: true, |
|||
// message: "请选择缴存日期", |
|||
// trigger: "blur", |
|||
// }, |
|||
], |
|||
depositBank: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
depositBankNumber: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
accountBankAddress: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
|
|||
voucherNumber: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
bankGuaranteeLetterNo: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
bankGuaranteeLetterAmount: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
{ |
|||
pattern: |
|||
/(^[1-9]([0-9]{0,6})?(\.[0-9]{1,2})?$|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$))/, |
|||
message: "请输入数字,整数7位,可保留两位小数", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
bankGuaranteeStartYear: [], |
|||
bankGuaranteeEndYear: [], |
|||
insuranceCompanyName: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
insuranceNo: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
insuranceAmount: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
{ |
|||
pattern: |
|||
/(^[1-9]([0-9]{0,6})?(\.[0-9]{1,2})?$|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$))/, |
|||
message: "请输入数字,整数7位,可保留两位小数", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
insuranceStartTime: [], |
|||
insuranceEndTime: [], |
|||
payAmountInsurance: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
{ |
|||
pattern: |
|||
/(^[1-9]([0-9]{0,6})?(\.[0-9]{1,2})?$|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$))/, |
|||
message: "请输入数字,整数7位,可保留两位小数", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
payAmountInsuranceTime: [], |
|||
guaranteeCompanyName: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
guaranteeCompanyLetterNo: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
guaranteeCompanyAmount: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
{ |
|||
pattern: |
|||
/(^[1-9]([0-9]{0,6})?(\.[0-9]{1,2})?$|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$))/, |
|||
message: "请输入数字,整数7位,可保留两位小数", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
guaranteeCompanyStartYear: [], |
|||
guaranteeCompanyEndYear: [], |
|||
cashStorageFile: [], |
|||
}, |
|||
// 缴存方式字典 |
|||
depositMethodsOptions: [], |
|||
fileList: [], |
|||
}; |
|||
}, |
|||
computed: { |
|||
hasOne() { |
|||
return this.form.depositMethods?.some((res) => res == 0); |
|||
}, |
|||
hasTwo() { |
|||
return this.form.depositMethods?.some((res) => res == 1); |
|||
}, |
|||
hasThree() { |
|||
return this.form.depositMethods?.some((res) => res == 2); |
|||
}, |
|||
hasFour() { |
|||
return this.form.depositMethods?.some((res) => res == 3); |
|||
}, |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
this.getDicts("income_methods").then((response) => { |
|||
this.depositMethodsOptions = response.data; |
|||
}); |
|||
}, |
|||
methods: { |
|||
/** 查询投标保证金列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
this.queryParams.data.proNo = this.proNo; |
|||
this.queryParams.data.projectCode = this.projectCode; |
|||
this.formMethods.list(this.queryParams).then((response) => { |
|||
this.tbbzjList = response.records; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
// 缴存方式字典翻译 |
|||
depositMethodsFormat(row, column) { |
|||
if (row.depositMethods?.length > 0) { |
|||
let res = ""; |
|||
row.depositMethods.forEach((item) => { |
|||
res = |
|||
res + "、" + this.selectDictLabel(this.depositMethodsOptions, item); |
|||
}); |
|||
return res.substr(1); |
|||
} |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.form = { |
|||
id: null, |
|||
differentiatedDepositAmount: null, |
|||
amountPayable: null, |
|||
paidAmount: null, |
|||
depositMethods: null, |
|||
depositBankSalaryDeposit: null, |
|||
salaryDepositBankAccount: null, |
|||
cashAmount: null, |
|||
guaranteeBankName: null, |
|||
bankGuaranteeLetterNo: null, |
|||
bankGuaranteeLetterAmount: null, |
|||
bankGuaranteeStartYear: null, |
|||
bankGuaranteeEndYear: null, |
|||
guaranteeCompanyName: null, |
|||
guaranteeCompanyLetterNo: null, |
|||
guaranteeCompanyAmount: null, |
|||
guaranteeCompanyStartYear: null, |
|||
guaranteeCompanyEndYear: null, |
|||
insuranceCompanyName: null, |
|||
insuranceNo: null, |
|||
insuranceAmount: null, |
|||
insuranceStartTime: null, |
|||
insuranceEndTime: null, |
|||
otherAmount: null, |
|||
incomeTime: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
projectCode: null, |
|||
proNo: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
id: null, |
|||
differentiatedDepositAmount: null, |
|||
amountPayable: null, |
|||
paidAmount: null, |
|||
depositMethods: null, |
|||
depositBankSalaryDeposit: null, |
|||
salaryDepositBankAccount: null, |
|||
cashAmount: null, |
|||
guaranteeBankName: null, |
|||
bankGuaranteeLetterNo: null, |
|||
bankGuaranteeLetterAmount: null, |
|||
bankGuaranteeStartYear: null, |
|||
bankGuaranteeEndYear: null, |
|||
guaranteeCompanyName: null, |
|||
guaranteeCompanyLetterNo: null, |
|||
guaranteeCompanyAmount: null, |
|||
guaranteeCompanyStartYear: null, |
|||
guaranteeCompanyEndYear: null, |
|||
insuranceCompanyName: null, |
|||
insuranceNo: null, |
|||
insuranceAmount: null, |
|||
insuranceStartTime: null, |
|||
insuranceEndTime: null, |
|||
otherAmount: null, |
|||
incomeTime: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
projectCode: null, |
|||
proNo: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
}, |
|||
conditionViews: [ |
|||
{ |
|||
name: "depositMethods", |
|||
value: "", |
|||
type: "like", |
|||
isAnd: "1", |
|||
}, |
|||
{ |
|||
name: "depositBankSalaryDeposit", |
|||
value: "", |
|||
type: "like", |
|||
isAnd: "1", |
|||
}, |
|||
], |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
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; |
|||
this.formMethods.get(id).then((response) => { |
|||
this.form = response.data; |
|||
if (this.form.cashStorageFile) { |
|||
this.fileList = JSON.parse(this.form.cashStorageFile); |
|||
} |
|||
this.open = true; |
|||
this.title = "修改投标保证金"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate((valid) => { |
|||
this.form.cashStorageFile = |
|||
this.fileList.length > 0 ? JSON.stringify(this.fileList) : null; |
|||
if (valid) { |
|||
if (this.form.id != null) { |
|||
this.formMethods.update(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
this.form.proNo = this.proNo; |
|||
this.form.projectCode = this.projectCode; |
|||
this.formMethods.add(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 this.formMethods.del(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 this.formMethods.export(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> |
@ -0,0 +1,544 @@ |
|||
<template> |
|||
<div> |
|||
<div style="text-align: right; margin-bottom: 10px"> |
|||
<el-button |
|||
type="primary" |
|||
icon="el-icon-plus" |
|||
size="mini" |
|||
@click="handleAdd" |
|||
v-hasPermi="['warn:rectification:add']" |
|||
>新增整改通知书</el-button |
|||
> |
|||
</div> |
|||
|
|||
<el-table v-loading="loading" border :data="rectificationList"> |
|||
<el-table-column |
|||
label="序号" |
|||
type="index" |
|||
width="50" |
|||
align="center" |
|||
fixed |
|||
/> |
|||
<!-- <el-table-column |
|||
label="监管id" |
|||
align="center" |
|||
prop="inspectionId" |
|||
min-width="120" |
|||
/> --> |
|||
<el-table-column |
|||
label="发文单位" |
|||
align="center" |
|||
prop="issuingUnit" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="文号" |
|||
align="center" |
|||
prop="documentNumber" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="通知生效时间" |
|||
align="center" |
|||
prop="noticeBegainTime" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<span>{{ |
|||
parseTime(scope.row.noticeBegainTime, "{y}-{m}-{d}") |
|||
}}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="整改通知书" |
|||
align="center" |
|||
prop="rectificationAttachment" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse( |
|||
scope.row.rectificationAttachment |
|||
)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.rectificationAttachment, index)" |
|||
style="cursor: pointer" |
|||
></i> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="责任单位" |
|||
align="center" |
|||
prop="unitArray" |
|||
:formatter="unitArrayFormat" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="整改完成情况" |
|||
align="center" |
|||
prop="isFinish" |
|||
:formatter="isFinishFormat" |
|||
min-width="120" |
|||
/> |
|||
<!-- <el-table-column |
|||
label="整改相关附件" |
|||
align="center" |
|||
prop="ccc" |
|||
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="['warn:rectification:edit']" |
|||
>修改</el-button |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['warn:rectification: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="110px"> |
|||
<!-- <el-form-item label="监管id" prop="inspectionId"> |
|||
<el-input v-model="form.inspectionId" placeholder="请输入监管id" /> |
|||
</el-form-item> --> |
|||
<el-form-item label="发文单位" prop="issuingUnit"> |
|||
<el-input v-model="form.issuingUnit" placeholder="请输入发文单位" /> |
|||
</el-form-item> |
|||
<el-form-item label="文号" prop="documentNumber"> |
|||
<el-input v-model="form.documentNumber" placeholder="请输入文号" /> |
|||
</el-form-item> |
|||
<el-form-item label="通知生效时间" prop="noticeBegainTime"> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
v-model="form.noticeBegainTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择通知生效时间" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="整改通知书" prop="rectificationAttachment"> |
|||
<!-- <el-input v-model="form.rectificationAttachment" placeholder="请输入整改通知书" /> --> |
|||
<el-upload |
|||
class="upload-demo" |
|||
action="thinking/common/upload" |
|||
:headers="headers" |
|||
:before-upload="(file) => $fileBeforeUpload(file, 'fileList1')" |
|||
:on-preview="handlePreview" |
|||
:on-remove="(file) => handleOpinionRemove(file, 'fileList1')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(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-form> |
|||
<responsibleUnit |
|||
v-if="open && form.id" |
|||
:isAdd="isAdd" |
|||
:inspectionId="inspectionId" |
|||
:rectificationId="form.id" |
|||
:proNo="proNo" |
|||
:proCode="proCode" |
|||
/> |
|||
<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 { |
|||
listRectification, |
|||
getRectification, |
|||
delRectification, |
|||
addRectification, |
|||
updateRectification, |
|||
exportRectification, |
|||
} from "@/api/warn/rectification"; |
|||
import { listInfo } from "@/api/build/enteInfo"; |
|||
import { getToken } from "@/utils/auth"; |
|||
import { getFileStream } from "@/api/system/upload"; |
|||
import responsibleUnit from "./responsibleUnit.vue"; |
|||
|
|||
export default { |
|||
name: "Rectification", |
|||
props: ["inspectionId", "proNo", "proCode"], |
|||
components: { |
|||
responsibleUnit, |
|||
}, |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 整改通知书表格数据 |
|||
rectificationList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
inspectionId: null, |
|||
issuingUnit: null, |
|||
documentNumber: null, |
|||
noticeBegainTime: null, |
|||
rectificationAttachment: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 查询参数 |
|||
unitParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sort: "desc", |
|||
}, |
|||
}, |
|||
unitOptions: [], |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
issuingUnit: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
documentNumber: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
}, |
|||
// 请求头 |
|||
headers: { |
|||
jianwei: "jwtech " + getToken(), |
|||
}, |
|||
fileList1: [], |
|||
isAdd: false, |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
this.getUnit(); |
|||
this.getDicts("rectification_completion").then((response) => { |
|||
this.isFinishOptions = response.data; |
|||
}); |
|||
}, |
|||
methods: { |
|||
/** 查询整改通知书列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
this.queryParams.data.inspectionId = this.inspectionId; |
|||
listRectification(this.queryParams).then((response) => { |
|||
this.rectificationList = response.records; |
|||
console.log("this.rectificationList", this.rectificationList); |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
getUnit() { |
|||
this.unitParams.data.proNo = this.proNo; |
|||
this.unitParams.data.proCode = this.proCode; |
|||
listInfo(this.unitParams).then((response) => { |
|||
this.unitOptions = response.data.enterpriseInfoList; |
|||
// console.log(88888888888, this.unitOptions); |
|||
}); |
|||
}, |
|||
unitArrayFormat(row) { |
|||
let res = ""; |
|||
row.unitArray?.forEach((item) => { |
|||
// this.unitOptions.forEach((sub) => { |
|||
// if (item === sub.enterpriseName) { |
|||
res = res + item + "、"; |
|||
// } |
|||
// }); |
|||
}); |
|||
return res; |
|||
}, |
|||
isFinishFormat(row) { |
|||
return this.selectDictLabel(this.isFinishOptions, row.isFinish); |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.fileList1 = []; |
|||
this.form = { |
|||
id: null, |
|||
inspectionId: null, |
|||
issuingUnit: null, |
|||
documentNumber: null, |
|||
noticeBegainTime: null, |
|||
rectificationAttachment: null, |
|||
createTime: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
id: null, |
|||
inspectionId: null, |
|||
issuingUnit: null, |
|||
documentNumber: null, |
|||
noticeBegainTime: null, |
|||
rectificationAttachment: null, |
|||
createTime: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
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.isAdd = true; |
|||
this.open = true; |
|||
this.title = "添加整改通知书"; |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset(); |
|||
this.isAdd = false; |
|||
const id = row.id || this.ids; |
|||
getRectification(id).then((response) => { |
|||
this.form = response.data; |
|||
if (this.form.rectificationAttachment) { |
|||
this.fileList1 = JSON.parse(this.form.rectificationAttachment); |
|||
} |
|||
this.open = true; |
|||
this.title = "修改整改通知书"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate((valid) => { |
|||
if (valid) { |
|||
this.form.rectificationAttachment = JSON.stringify(this.fileList1); |
|||
if (this.form.id != null) { |
|||
updateRectification(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
this.form.inspectionId = this.inspectionId; |
|||
addRectification(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 delRectification(ids); |
|||
}) |
|||
.then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}) |
|||
.catch(function () {}); |
|||
} else { |
|||
this.$message.warning("请选择要删除的数据!!"); |
|||
} |
|||
}, |
|||
// 上传意见附件 |
|||
submitOpinionUpload(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]); |
|||
}, |
|||
handleOpinionRemove(file, name) { |
|||
// console.log(file, fileList1); |
|||
let index = this[name].findIndex((item) => item.uid === file.uid); |
|||
// 删除文件 |
|||
this[name].splice(index, 1); |
|||
}, |
|||
// 表格中下载 |
|||
downloadFile(fileList, index) { |
|||
console.log(fileList); |
|||
let file = JSON.parse(fileList)[index]; |
|||
this.handlePreview(file); |
|||
}, |
|||
// 点击预览的文件进行下载 |
|||
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); //创建新的URL表示指定的blob对象 |
|||
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"; |
|||
//::v-deep { |
|||
// .el-dialog { |
|||
// margin-top: 10vh !important; |
|||
// } |
|||
//} |
|||
</style> |
@ -0,0 +1,857 @@ |
|||
<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="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 label="监督检查类型" prop="inspectionTypes"> |
|||
<el-select |
|||
v-model="queryParams.data.inspectionTypes" |
|||
placeholder="请选择监督检查类型" |
|||
clearable |
|||
size="small" |
|||
@change="handleQuery" |
|||
> |
|||
<el-option |
|||
v-for="dict in inspectionTypesOptions" |
|||
: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="['warn:inspections: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="['warn:inspections: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="['warn:inspections:remove']" |
|||
>删除</el-button |
|||
> |
|||
</el-col> |
|||
|
|||
<right-toolbar |
|||
:showSearch.sync="showSearch" |
|||
@queryTable="getList" |
|||
></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table |
|||
v-loading="loading" |
|||
:data="inspectionsList" |
|||
@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="projectName" |
|||
min-width="120" |
|||
/> |
|||
<!-- <el-table-column |
|||
label="监督检查类型" |
|||
align="center" |
|||
prop="inspectionTypes" |
|||
:formatter="inspectionTypesFormat" |
|||
min-width="120" |
|||
/> --> |
|||
<el-table-column |
|||
label="检查时间" |
|||
align="center" |
|||
prop="inspectionTime" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<span>{{ parseTime(scope.row.inspectionTime, "{y}-{m}-{d}") }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="检查人" |
|||
align="center" |
|||
prop="inspectionPerson" |
|||
min-width="120" |
|||
/> |
|||
|
|||
<el-table-column |
|||
label="通知文件" |
|||
align="center" |
|||
prop="noticeAttachment" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse(scope.row.noticeAttachment)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.noticeAttachment, index)" |
|||
style="cursor: pointer" |
|||
></i> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="检查表" |
|||
align="center" |
|||
prop="checklist" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse(scope.row.checklist)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.checklist, index)" |
|||
style="cursor: pointer" |
|||
></i> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="整改报告" |
|||
align="center" |
|||
prop="rectificationReport" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse(scope.row.rectificationReport)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.rectificationReport, 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="['warn:inspections:edit']" |
|||
>修改</el-button |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['warn:inspections: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="1400px" |
|||
append-to-body |
|||
:close-on-click-modal="false" |
|||
> |
|||
<div class="listTitle" style="margin-top: 0"> |
|||
<span>防洪度汛检查信息</span> |
|||
</div> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="110px"> |
|||
<el-form-item label="项目名称" prop="projectName"> |
|||
<el-select |
|||
v-model="form.projectName" |
|||
placeholder="请输入项目名称" |
|||
filterable |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in projectNameOptions" |
|||
:key="dict.projectName + dict.id" |
|||
:label="dict.projectName + '[' + dict.proCode + ']'" |
|||
:value="dict.projectName + '[' + dict.proCode + ']'" |
|||
@click.native="getId(dict)" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item label="监督检查类型" prop="inspectionTypes"> |
|||
<el-select |
|||
v-model="form.inspectionTypes" |
|||
placeholder="请选择监督检查类型" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in inspectionTypesOptions" |
|||
:key="dict.dictValue" |
|||
:label="dict.dictLabel" |
|||
:value="dict.dictValue" |
|||
></el-option> |
|||
</el-select> |
|||
</el-form-item> --> |
|||
<el-form-item label="检查时间" prop="inspectionTime"> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
v-model="form.inspectionTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择检查时间" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="检查人" prop="inspectionPerson"> |
|||
<el-input |
|||
v-model="form.inspectionPerson" |
|||
placeholder="请输入检查人" |
|||
/> |
|||
</el-form-item> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<el-form-item label="检查通知" prop="noticeAttachment"> |
|||
<!-- <el-input |
|||
v-model="form.noticeAttachment" |
|||
placeholder="请输入通知文件" |
|||
/> --> |
|||
<el-upload |
|||
class="upload-demo" |
|||
action="thinking/common/upload" |
|||
:headers="headers" |
|||
:before-upload="(file) => $fileBeforeUpload(file, 'fileList1')" |
|||
:on-preview="handlePreview" |
|||
:on-remove="(file) => handleOpinionRemove(file, 'fileList1')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(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="8"> |
|||
<el-form-item label="整改通知" prop="checklist"> |
|||
<!-- <el-input v-model="form.checklist" placeholder="请输入检查表" /> --> |
|||
<el-upload |
|||
class="upload-demo" |
|||
action="thinking/common/upload" |
|||
:headers="headers" |
|||
:before-upload="(file) => $fileBeforeUpload(file, 'fileList2')" |
|||
:on-preview="handlePreview" |
|||
:on-remove="(file) => handleOpinionRemove(file, 'fileList2')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(fileList, 'fileList2') |
|||
" |
|||
: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-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="整改报告" prop="rectificationReport"> |
|||
<!-- <el-input |
|||
v-model="form.rectificationReport" |
|||
placeholder="请输入整改报告" |
|||
/> --> |
|||
<el-upload |
|||
class="upload-demo" |
|||
action="thinking/common/upload" |
|||
:headers="headers" |
|||
:before-upload="(file) => $fileBeforeUpload(file, 'fileList3')" |
|||
:on-preview="handlePreview" |
|||
:on-remove="(file) => handleOpinionRemove(file, 'fileList3')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(fileList, 'fileList3') |
|||
" |
|||
: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-col> |
|||
</el-row> |
|||
</el-form> |
|||
<div v-if="form.id"> |
|||
<div class="listTitle" style="margin-top: 0"> |
|||
<span>责令限期整改通知书列表</span> |
|||
</div> |
|||
<editPart |
|||
:inspectionId="form.id" |
|||
:proNo="form.proNo" |
|||
:proCode="form.proCode" |
|||
/> |
|||
</div> |
|||
<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 { |
|||
listInspections, |
|||
getInspections, |
|||
delInspections, |
|||
addInspections, |
|||
updateInspections, |
|||
exportInspections, |
|||
} from "@/api/warn/inspections"; |
|||
import { listInfo, getInfo } from "@/api/build/projectInfo"; |
|||
import { getToken } from "@/utils/auth"; |
|||
import { getFileStream } from "@/api/system/upload"; |
|||
import editPart from "./editPart.vue"; |
|||
|
|||
export default { |
|||
name: "Inspections", |
|||
components: { |
|||
editPart, |
|||
}, |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 监管检查表格数据 |
|||
inspectionsList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 监督检查类型字典 |
|||
inspectionTypesOptions: [], |
|||
|
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
menuType: null, |
|||
inspectionTypes: null, |
|||
inspectionTime: null, |
|||
inspectionPerson: null, |
|||
noticeAttachment: null, |
|||
checklist: null, |
|||
rectificationReport: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 查询参数 |
|||
othersParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
isMajor: null, |
|||
projectName: null, |
|||
unitLeader: null, |
|||
projectLegalPerson: null, |
|||
projectLegalUnit: null, |
|||
projectLegalPhone: null, |
|||
engineeringGrade: null, |
|||
engineeringPurposes: null, |
|||
workCategory: null, |
|||
constructionAddress: null, |
|||
constructionMode: null, |
|||
constructionNature: null, |
|||
constructionContent: null, |
|||
adcd: null, |
|||
basin: null, |
|||
projectType: null, |
|||
centralArrangedFunds: null, |
|||
centralArrangedFundsRate: null, |
|||
provincialFunding: null, |
|||
provincialFundingRate: null, |
|||
cityLevelFunds: null, |
|||
cityLevelFundsRate: null, |
|||
countyLevelFunds: null, |
|||
countyLevelFundsRate: null, |
|||
townshipInvestments: null, |
|||
townshipInvestmentsRate: null, |
|||
isMajorProject: null, |
|||
investmentSubject: null, |
|||
constructionPhase: null, |
|||
fundingNumber: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
createUid: null, |
|||
createTime: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
inspectionPerson: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
projectName: [ |
|||
{ |
|||
required: true, |
|||
message: "请选择项目", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
}, |
|||
//项目名称 |
|||
projectNameOptions: [], |
|||
proCode: "", |
|||
proNo: "", |
|||
// 面包屑,路由信息 |
|||
routeList: [ |
|||
{ |
|||
path: "/evaluationEarlyWarning/supervisionInspection/regulatoryInspection", |
|||
routeName: "防洪度汛检查", |
|||
}, |
|||
], |
|||
// 请求头 |
|||
headers: { |
|||
jianwei: "jwtech " + getToken(), |
|||
}, |
|||
fileList1: [], |
|||
fileList2: [], |
|||
fileList3: [], |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
this.getDicts("supervisory_inspection_type").then((response) => { |
|||
this.inspectionTypesOptions = response.data; |
|||
}); |
|||
|
|||
listInfo(this.othersParams).then((response) => { |
|||
this.projectNameOptions = response.records; |
|||
}); |
|||
}, |
|||
methods: { |
|||
getId(res) { |
|||
// console.log(res) |
|||
getInfo(res.id).then((response) => { |
|||
console.log(response.data); |
|||
this.proNo = response.data.proNo; |
|||
this.proCode = response.data.proCode; |
|||
}); |
|||
}, |
|||
/** 查询监管检查列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
this.queryParams.data.menuType = "3"; |
|||
listInspections(this.queryParams).then((response) => { |
|||
this.inspectionsList = response.records; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
// 监督检查类型字典翻译 |
|||
inspectionTypesFormat(row, column) { |
|||
return this.selectDictLabel( |
|||
this.inspectionTypesOptions, |
|||
row.inspectionTypes |
|||
); |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.fileList1 = []; |
|||
this.fileList2 = []; |
|||
this.fileList3 = []; |
|||
this.form = { |
|||
id: null, |
|||
menuType: null, |
|||
inspectionTypes: null, |
|||
inspectionTime: null, |
|||
inspectionPerson: null, |
|||
noticeAttachment: null, |
|||
checklist: null, |
|||
rectificationReport: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
remark: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
id: null, |
|||
menuType: null, |
|||
inspectionTypes: null, |
|||
inspectionTime: null, |
|||
inspectionPerson: null, |
|||
noticeAttachment: null, |
|||
checklist: null, |
|||
rectificationReport: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
remark: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sort: "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; |
|||
getInspections(id).then((response) => { |
|||
this.form = response.data; |
|||
this.form.projectName = |
|||
this.form.projectName + "[" + this.form.proCode + "]"; |
|||
if (this.form.noticeAttachment) { |
|||
this.fileList1 = JSON.parse(this.form.noticeAttachment); |
|||
} |
|||
if (this.form.checklist) { |
|||
this.fileList2 = JSON.parse(this.form.checklist); |
|||
} |
|||
if (this.form.rectificationReport) { |
|||
this.fileList3 = JSON.parse(this.form.rectificationReport); |
|||
} |
|||
this.open = true; |
|||
this.title = "修改防洪度汛检查"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate((valid) => { |
|||
if (valid) { |
|||
if (this.proNo) { |
|||
this.form.proNo = this.proNo; |
|||
} |
|||
if (this.proCode) { |
|||
this.form.proCode = this.proCode; |
|||
} |
|||
this.form.noticeAttachment = JSON.stringify(this.fileList1); |
|||
this.form.checklist = JSON.stringify(this.fileList2); |
|||
this.form.rectificationReport = JSON.stringify(this.fileList3); |
|||
if (this.form.id != null) { |
|||
updateInspections(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
this.form.menuType = "3"; |
|||
addInspections(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 delInspections(ids); |
|||
}) |
|||
.then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}) |
|||
.catch(function () {}); |
|||
} else { |
|||
this.$message.warning("请选择要删除的数据!!"); |
|||
} |
|||
}, |
|||
// 上传意见附件 |
|||
submitOpinionUpload(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]); |
|||
}, |
|||
handleOpinionRemove(file, name) { |
|||
// console.log(file, fileList1); |
|||
let index = this[name].findIndex((item) => item.uid === file.uid); |
|||
// 删除文件 |
|||
this[name].splice(index, 1); |
|||
}, |
|||
// 表格中下载 |
|||
downloadFile(fileList, index) { |
|||
console.log(fileList); |
|||
let file = JSON.parse(fileList)[index]; |
|||
this.handlePreview(file); |
|||
}, |
|||
// 点击预览的文件进行下载 |
|||
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); //创建新的URL表示指定的blob对象 |
|||
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"; |
|||
::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> |
@ -0,0 +1,582 @@ |
|||
<template> |
|||
<div> |
|||
<!-- <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="['warn:zrdw: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="['warn:zrdw: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="['warn:zrdw:remove']" |
|||
>删除</el-button |
|||
> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="warning" |
|||
icon="el-icon-download" |
|||
size="mini" |
|||
@click="handleExport" |
|||
v-hasPermi="['warn:zrdw:export']" |
|||
>导出</el-button |
|||
> |
|||
</el-col> |
|||
<right-toolbar |
|||
:showSearch.sync="showSearch" |
|||
@queryTable="getList" |
|||
></right-toolbar> |
|||
</el-row> --> |
|||
|
|||
<el-table v-loading="loading" :data="zrdwList" border> |
|||
<!-- <el-table-column |
|||
label="监管id" |
|||
align="center" |
|||
prop="inspectionId" |
|||
min-width="120" |
|||
/> --> |
|||
<el-table-column |
|||
label="责任单位" |
|||
align="center" |
|||
prop="unitId" |
|||
:formatter="unitIdFormat" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="整改完成内容" |
|||
align="center" |
|||
prop="rectificationSituation" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="整改完成情况" |
|||
align="center" |
|||
prop="isFinish" |
|||
:formatter="isFinishFormat" |
|||
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)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.attachment, 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="['warn:zrdw:edit']" |
|||
>修改</el-button |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['warn:zrdw:remove']" |
|||
>删除</el-button |
|||
> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-button |
|||
type="text" |
|||
icon="el-icon-plus" |
|||
size="medium" |
|||
@click="handleAdd" |
|||
v-hasPermi="['warn:zrdw:add']" |
|||
>添加责任单位</el-button |
|||
> |
|||
<!-- <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="1000px" |
|||
append-to-body |
|||
:close-on-click-modal="false" |
|||
> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="110px"> |
|||
<!-- <el-form-item label="监管id" prop="inspectionId"> |
|||
<el-input v-model="form.inspectionId" placeholder="请输入监管id" /> |
|||
</el-form-item> --> |
|||
<el-form-item label="责任单位" prop="unitId"> |
|||
<!-- <el-input v-model="form.unitId" placeholder="请输入单位id" /> --> |
|||
<el-select |
|||
v-model="form.unitId" |
|||
placeholder="请选择责任单位" |
|||
filterable |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in unitOptions" |
|||
:key="dict.id + dict.enterpriseName" |
|||
:label="dict.enterpriseName" |
|||
:value="dict.id" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="整改完成内容" prop="rectificationSituation"> |
|||
<el-input |
|||
v-model="form.rectificationSituation" |
|||
placeholder="请输入整改完成内容" |
|||
type="textarea" |
|||
/> |
|||
<!-- <el-select |
|||
v-model="form.rectificationSituation" |
|||
placeholder="请输入项目名称" |
|||
filterable |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in rectificationSituationOptions" |
|||
:key="dict.dictValue" |
|||
:label="dict.dictLabel" |
|||
:value="dict.dictValue" |
|||
/> |
|||
</el-select> --> |
|||
</el-form-item> |
|||
<el-form-item label="整改完成情况" prop="isFinish" v-if="isEdit"> |
|||
<!-- <el-input |
|||
v-model="form.isFinish" |
|||
placeholder="请输入整改完成情况" |
|||
/> --> |
|||
<el-select |
|||
v-model="form.isFinish" |
|||
placeholder="请选择整改完成情况" |
|||
filterable |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in isFinishOptions" |
|||
:key="dict.dictValue" |
|||
:label="dict.dictLabel" |
|||
:value="dict.dictValue" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="附件" prop="attachment" v-if="isEdit"> |
|||
<!-- <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) => handleOpinionRemove(file, 'fileList1')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(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-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 { |
|||
listZrdw, |
|||
getZrdw, |
|||
delZrdw, |
|||
addZrdw, |
|||
updateZrdw, |
|||
exportZrdw, |
|||
} from "@/api/warn/zrdw"; |
|||
import { listInfo } from "@/api/build/enteInfo"; |
|||
import { getToken } from "@/utils/auth"; |
|||
import { getFileStream } from "@/api/system/upload"; |
|||
|
|||
export default { |
|||
name: "Zrdw", |
|||
props: ["inspectionId", "rectificationId", "proNo", "proCode", "isAdd"], |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: false, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 责任单位表格数据 |
|||
zrdwList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 整改完成情况字典 |
|||
isFinishOptions: [], |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
inspectionId: null, |
|||
rectificationId: null, |
|||
unitId: null, |
|||
rectificationSituation: null, |
|||
isFinish: null, |
|||
attachment: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 查询参数 |
|||
unitParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sort: "desc", |
|||
}, |
|||
}, |
|||
unitOptions: [], |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
rectificationSituation: [ |
|||
{ max: 65500, message: "字符长度最大为65500", trigger: "blur" }, |
|||
], |
|||
}, |
|||
// 请求头 |
|||
headers: { |
|||
jianwei: "jwtech " + getToken(), |
|||
}, |
|||
fileList1: [], |
|||
isEdit: false, |
|||
}; |
|||
}, |
|||
created() { |
|||
if (!this.isAdd) this.getList(); |
|||
this.getUnit(); |
|||
this.getDicts("rectification_completion").then((response) => { |
|||
this.isFinishOptions = response.data; |
|||
}); |
|||
}, |
|||
methods: { |
|||
getUnit() { |
|||
this.unitParams.data.proNo = this.proNo; |
|||
this.unitParams.data.proCode = this.proCode; |
|||
listInfo(this.unitParams).then((response) => { |
|||
this.unitOptions = response.data.enterpriseInfoList; |
|||
// console.log(88888888888, this.unitOptions); |
|||
}); |
|||
}, |
|||
/** 查询责任单位列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
this.queryParams.data.inspectionId = this.inspectionId; |
|||
this.queryParams.data.rectificationId = this.rectificationId; |
|||
listZrdw(this.queryParams).then((response) => { |
|||
this.zrdwList = response.records; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
isFinishFormat(row) { |
|||
return this.selectDictLabel(this.isFinishOptions, row.isFinish); |
|||
}, |
|||
unitIdFormat(row) { |
|||
return this.unitOptions.find((item) => item.id == row.unitId) |
|||
?.enterpriseName; |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.fileList1 = []; |
|||
this.form = { |
|||
id: null, |
|||
inspectionId: null, |
|||
rectificationId: null, |
|||
unitId: null, |
|||
rectificationSituation: null, |
|||
attachment: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
id: null, |
|||
inspectionId: null, |
|||
rectificationId: null, |
|||
unitId: null, |
|||
rectificationSituation: null, |
|||
attachment: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
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.isEdit = false; |
|||
this.open = true; |
|||
this.title = "添加责任单位"; |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset(); |
|||
this.isEdit = true; |
|||
const id = row.id || this.ids; |
|||
getZrdw(id).then((response) => { |
|||
this.form = response.data; |
|||
if (this.form.attachment) { |
|||
this.fileList1 = JSON.parse(this.form.attachment); |
|||
} |
|||
this.open = true; |
|||
this.title = "修改责任单位"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate((valid) => { |
|||
if (valid) { |
|||
this.form.attachment = JSON.stringify(this.fileList1); |
|||
if (this.form.id != null) { |
|||
updateZrdw(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
this.form.inspectionId = this.inspectionId; |
|||
this.form.rectificationId = this.rectificationId; |
|||
this.form.isFinish = "0"; |
|||
addZrdw(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 delZrdw(ids); |
|||
}) |
|||
.then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}) |
|||
.catch(function () {}); |
|||
} else { |
|||
this.$message.warning("请选择要删除的数据!!"); |
|||
} |
|||
}, |
|||
// 上传意见附件 |
|||
submitOpinionUpload(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]); |
|||
}, |
|||
handleOpinionRemove(file, name) { |
|||
// console.log(file, fileList1); |
|||
let index = this[name].findIndex((item) => item.uid === file.uid); |
|||
// 删除文件 |
|||
this[name].splice(index, 1); |
|||
}, |
|||
// 表格中下载 |
|||
downloadFile(fileList, index) { |
|||
console.log(fileList); |
|||
let file = JSON.parse(fileList)[index]; |
|||
this.handlePreview(file); |
|||
}, |
|||
// 点击预览的文件进行下载 |
|||
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); //创建新的URL表示指定的blob对象 |
|||
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"; |
|||
//::v-deep { |
|||
// .el-dialog { |
|||
// margin-top: 10vh !important; |
|||
// } |
|||
//} |
|||
</style> |
@ -0,0 +1,544 @@ |
|||
<template> |
|||
<div> |
|||
<div style="text-align: right; margin-bottom: 10px"> |
|||
<el-button |
|||
type="primary" |
|||
icon="el-icon-plus" |
|||
size="mini" |
|||
@click="handleAdd" |
|||
v-hasPermi="['warn:rectification:add']" |
|||
>新增整改通知书</el-button |
|||
> |
|||
</div> |
|||
|
|||
<el-table v-loading="loading" border :data="rectificationList"> |
|||
<el-table-column |
|||
label="序号" |
|||
type="index" |
|||
width="50" |
|||
align="center" |
|||
fixed |
|||
/> |
|||
<!-- <el-table-column |
|||
label="监管id" |
|||
align="center" |
|||
prop="inspectionId" |
|||
min-width="120" |
|||
/> --> |
|||
<el-table-column |
|||
label="发文单位" |
|||
align="center" |
|||
prop="issuingUnit" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="文号" |
|||
align="center" |
|||
prop="documentNumber" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="通知生效时间" |
|||
align="center" |
|||
prop="noticeBegainTime" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<span>{{ |
|||
parseTime(scope.row.noticeBegainTime, "{y}-{m}-{d}") |
|||
}}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="整改通知书" |
|||
align="center" |
|||
prop="rectificationAttachment" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse( |
|||
scope.row.rectificationAttachment |
|||
)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.rectificationAttachment, index)" |
|||
style="cursor: pointer" |
|||
></i> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="责任单位" |
|||
align="center" |
|||
prop="unitArray" |
|||
:formatter="unitArrayFormat" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="整改完成情况" |
|||
align="center" |
|||
prop="isFinish" |
|||
:formatter="isFinishFormat" |
|||
min-width="120" |
|||
/> |
|||
<!-- <el-table-column |
|||
label="整改相关附件" |
|||
align="center" |
|||
prop="ccc" |
|||
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="['warn:rectification:edit']" |
|||
>修改</el-button |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['warn:rectification: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="110px"> |
|||
<!-- <el-form-item label="监管id" prop="inspectionId"> |
|||
<el-input v-model="form.inspectionId" placeholder="请输入监管id" /> |
|||
</el-form-item> --> |
|||
<el-form-item label="发文单位" prop="issuingUnit"> |
|||
<el-input v-model="form.issuingUnit" placeholder="请输入发文单位" /> |
|||
</el-form-item> |
|||
<el-form-item label="文号" prop="documentNumber"> |
|||
<el-input v-model="form.documentNumber" placeholder="请输入文号" /> |
|||
</el-form-item> |
|||
<el-form-item label="通知生效时间" prop="noticeBegainTime"> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
v-model="form.noticeBegainTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择通知生效时间" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="整改通知书" prop="rectificationAttachment"> |
|||
<!-- <el-input v-model="form.rectificationAttachment" placeholder="请输入整改通知书" /> --> |
|||
<el-upload |
|||
class="upload-demo" |
|||
action="thinking/common/upload" |
|||
:headers="headers" |
|||
:before-upload="(file) => $fileBeforeUpload(file, 'fileList1')" |
|||
:on-preview="handlePreview" |
|||
:on-remove="(file) => handleOpinionRemove(file, 'fileList1')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(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-form> |
|||
<responsibleUnit |
|||
v-if="open && form.id" |
|||
:isAdd="isAdd" |
|||
:inspectionId="inspectionId" |
|||
:rectificationId="form.id" |
|||
:proNo="proNo" |
|||
:proCode="proCode" |
|||
/> |
|||
<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 { |
|||
listRectification, |
|||
getRectification, |
|||
delRectification, |
|||
addRectification, |
|||
updateRectification, |
|||
exportRectification, |
|||
} from "@/api/warn/rectification"; |
|||
import { listInfo } from "@/api/build/enteInfo"; |
|||
import { getToken } from "@/utils/auth"; |
|||
import { getFileStream } from "@/api/system/upload"; |
|||
import responsibleUnit from "./responsibleUnit.vue"; |
|||
|
|||
export default { |
|||
name: "Rectification", |
|||
props: ["inspectionId", "proNo", "proCode"], |
|||
components: { |
|||
responsibleUnit, |
|||
}, |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 整改通知书表格数据 |
|||
rectificationList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
inspectionId: null, |
|||
issuingUnit: null, |
|||
documentNumber: null, |
|||
noticeBegainTime: null, |
|||
rectificationAttachment: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 查询参数 |
|||
unitParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sort: "desc", |
|||
}, |
|||
}, |
|||
unitOptions: [], |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
issuingUnit: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
documentNumber: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
}, |
|||
// 请求头 |
|||
headers: { |
|||
jianwei: "jwtech " + getToken(), |
|||
}, |
|||
fileList1: [], |
|||
isAdd: false, |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
this.getUnit(); |
|||
this.getDicts("rectification_completion").then((response) => { |
|||
this.isFinishOptions = response.data; |
|||
}); |
|||
}, |
|||
methods: { |
|||
/** 查询整改通知书列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
this.queryParams.data.inspectionId = this.inspectionId; |
|||
listRectification(this.queryParams).then((response) => { |
|||
this.rectificationList = response.records; |
|||
console.log("this.rectificationList", this.rectificationList); |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
getUnit() { |
|||
this.unitParams.data.proNo = this.proNo; |
|||
this.unitParams.data.proCode = this.proCode; |
|||
listInfo(this.unitParams).then((response) => { |
|||
this.unitOptions = response.data.enterpriseInfoList; |
|||
// console.log(88888888888, this.unitOptions); |
|||
}); |
|||
}, |
|||
unitArrayFormat(row) { |
|||
let res = ""; |
|||
row.unitArray?.forEach((item) => { |
|||
// this.unitOptions.forEach((sub) => { |
|||
// if (item === sub.enterpriseName) { |
|||
res = res + item + "、"; |
|||
// } |
|||
// }); |
|||
}); |
|||
return res; |
|||
}, |
|||
isFinishFormat(row) { |
|||
return this.selectDictLabel(this.isFinishOptions, row.isFinish); |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.fileList1 = []; |
|||
this.form = { |
|||
id: null, |
|||
inspectionId: null, |
|||
issuingUnit: null, |
|||
documentNumber: null, |
|||
noticeBegainTime: null, |
|||
rectificationAttachment: null, |
|||
createTime: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
id: null, |
|||
inspectionId: null, |
|||
issuingUnit: null, |
|||
documentNumber: null, |
|||
noticeBegainTime: null, |
|||
rectificationAttachment: null, |
|||
createTime: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
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.isAdd = true; |
|||
this.open = true; |
|||
this.title = "添加整改通知书"; |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset(); |
|||
this.isAdd = false; |
|||
const id = row.id || this.ids; |
|||
getRectification(id).then((response) => { |
|||
this.form = response.data; |
|||
if (this.form.rectificationAttachment) { |
|||
this.fileList1 = JSON.parse(this.form.rectificationAttachment); |
|||
} |
|||
this.open = true; |
|||
this.title = "修改整改通知书"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate((valid) => { |
|||
if (valid) { |
|||
this.form.rectificationAttachment = JSON.stringify(this.fileList1); |
|||
if (this.form.id != null) { |
|||
updateRectification(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
this.form.inspectionId = this.inspectionId; |
|||
addRectification(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 delRectification(ids); |
|||
}) |
|||
.then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}) |
|||
.catch(function () {}); |
|||
} else { |
|||
this.$message.warning("请选择要删除的数据!!"); |
|||
} |
|||
}, |
|||
// 上传意见附件 |
|||
submitOpinionUpload(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]); |
|||
}, |
|||
handleOpinionRemove(file, name) { |
|||
// console.log(file, fileList1); |
|||
let index = this[name].findIndex((item) => item.uid === file.uid); |
|||
// 删除文件 |
|||
this[name].splice(index, 1); |
|||
}, |
|||
// 表格中下载 |
|||
downloadFile(fileList, index) { |
|||
console.log(fileList); |
|||
let file = JSON.parse(fileList)[index]; |
|||
this.handlePreview(file); |
|||
}, |
|||
// 点击预览的文件进行下载 |
|||
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); //创建新的URL表示指定的blob对象 |
|||
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"; |
|||
//::v-deep { |
|||
// .el-dialog { |
|||
// margin-top: 10vh !important; |
|||
// } |
|||
//} |
|||
</style> |
@ -0,0 +1,857 @@ |
|||
<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="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 label="监督检查类型" prop="inspectionTypes"> |
|||
<el-select |
|||
v-model="queryParams.data.inspectionTypes" |
|||
placeholder="请选择监督检查类型" |
|||
clearable |
|||
size="small" |
|||
@change="handleQuery" |
|||
> |
|||
<el-option |
|||
v-for="dict in inspectionTypesOptions" |
|||
: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="['warn:inspections: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="['warn:inspections: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="['warn:inspections:remove']" |
|||
>删除</el-button |
|||
> |
|||
</el-col> |
|||
|
|||
<right-toolbar |
|||
:showSearch.sync="showSearch" |
|||
@queryTable="getList" |
|||
></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table |
|||
v-loading="loading" |
|||
:data="inspectionsList" |
|||
@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="projectName" |
|||
min-width="120" |
|||
/> |
|||
<!-- <el-table-column |
|||
label="监督检查类型" |
|||
align="center" |
|||
prop="inspectionTypes" |
|||
:formatter="inspectionTypesFormat" |
|||
min-width="120" |
|||
/> --> |
|||
<el-table-column |
|||
label="检查时间" |
|||
align="center" |
|||
prop="inspectionTime" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<span>{{ parseTime(scope.row.inspectionTime, "{y}-{m}-{d}") }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="检查人" |
|||
align="center" |
|||
prop="inspectionPerson" |
|||
min-width="120" |
|||
/> |
|||
|
|||
<el-table-column |
|||
label="通知文件" |
|||
align="center" |
|||
prop="noticeAttachment" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse(scope.row.noticeAttachment)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.noticeAttachment, index)" |
|||
style="cursor: pointer" |
|||
></i> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="检查表" |
|||
align="center" |
|||
prop="checklist" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse(scope.row.checklist)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.checklist, index)" |
|||
style="cursor: pointer" |
|||
></i> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="整改报告" |
|||
align="center" |
|||
prop="rectificationReport" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse(scope.row.rectificationReport)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.rectificationReport, 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="['warn:inspections:edit']" |
|||
>修改</el-button |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['warn:inspections: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="1400px" |
|||
append-to-body |
|||
:close-on-click-modal="false" |
|||
> |
|||
<div class="listTitle" style="margin-top: 0"> |
|||
<span>项目法人履职检查信息</span> |
|||
</div> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="110px"> |
|||
<el-form-item label="项目名称" prop="projectName"> |
|||
<el-select |
|||
v-model="form.projectName" |
|||
placeholder="请输入项目名称" |
|||
filterable |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in projectNameOptions" |
|||
:key="dict.projectName + dict.id" |
|||
:label="dict.projectName + '[' + dict.proCode + ']'" |
|||
:value="dict.projectName + '[' + dict.proCode + ']'" |
|||
@click.native="getId(dict)" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item label="监督检查类型" prop="inspectionTypes"> |
|||
<el-select |
|||
v-model="form.inspectionTypes" |
|||
placeholder="请选择监督检查类型" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in inspectionTypesOptions" |
|||
:key="dict.dictValue" |
|||
:label="dict.dictLabel" |
|||
:value="dict.dictValue" |
|||
></el-option> |
|||
</el-select> |
|||
</el-form-item> --> |
|||
<el-form-item label="检查时间" prop="inspectionTime"> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
v-model="form.inspectionTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择检查时间" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="检查人" prop="inspectionPerson"> |
|||
<el-input |
|||
v-model="form.inspectionPerson" |
|||
placeholder="请输入检查人" |
|||
/> |
|||
</el-form-item> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<el-form-item label="检查通知" prop="noticeAttachment"> |
|||
<!-- <el-input |
|||
v-model="form.noticeAttachment" |
|||
placeholder="请输入通知文件" |
|||
/> --> |
|||
<el-upload |
|||
class="upload-demo" |
|||
action="thinking/common/upload" |
|||
:headers="headers" |
|||
:before-upload="(file) => $fileBeforeUpload(file, 'fileList1')" |
|||
:on-preview="handlePreview" |
|||
:on-remove="(file) => handleOpinionRemove(file, 'fileList1')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(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="8"> |
|||
<el-form-item label="整改通知" prop="checklist"> |
|||
<!-- <el-input v-model="form.checklist" placeholder="请输入检查表" /> --> |
|||
<el-upload |
|||
class="upload-demo" |
|||
action="thinking/common/upload" |
|||
:headers="headers" |
|||
:before-upload="(file) => $fileBeforeUpload(file, 'fileList2')" |
|||
:on-preview="handlePreview" |
|||
:on-remove="(file) => handleOpinionRemove(file, 'fileList2')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(fileList, 'fileList2') |
|||
" |
|||
: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-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="整改报告" prop="rectificationReport"> |
|||
<!-- <el-input |
|||
v-model="form.rectificationReport" |
|||
placeholder="请输入整改报告" |
|||
/> --> |
|||
<el-upload |
|||
class="upload-demo" |
|||
action="thinking/common/upload" |
|||
:headers="headers" |
|||
:before-upload="(file) => $fileBeforeUpload(file, 'fileList3')" |
|||
:on-preview="handlePreview" |
|||
:on-remove="(file) => handleOpinionRemove(file, 'fileList3')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(fileList, 'fileList3') |
|||
" |
|||
: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-col> |
|||
</el-row> |
|||
</el-form> |
|||
<div v-if="form.id"> |
|||
<div class="listTitle" style="margin-top: 0"> |
|||
<span>责令限期整改通知书列表</span> |
|||
</div> |
|||
<editPart |
|||
:inspectionId="form.id" |
|||
:proNo="form.proNo" |
|||
:proCode="form.proCode" |
|||
/> |
|||
</div> |
|||
<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 { |
|||
listInspections, |
|||
getInspections, |
|||
delInspections, |
|||
addInspections, |
|||
updateInspections, |
|||
exportInspections, |
|||
} from "@/api/warn/inspections"; |
|||
import { listInfo, getInfo } from "@/api/build/projectInfo"; |
|||
import { getToken } from "@/utils/auth"; |
|||
import { getFileStream } from "@/api/system/upload"; |
|||
import editPart from "./editPart.vue"; |
|||
|
|||
export default { |
|||
name: "Inspections", |
|||
components: { |
|||
editPart, |
|||
}, |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 监管检查表格数据 |
|||
inspectionsList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 监督检查类型字典 |
|||
inspectionTypesOptions: [], |
|||
|
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
menuType: null, |
|||
inspectionTypes: null, |
|||
inspectionTime: null, |
|||
inspectionPerson: null, |
|||
noticeAttachment: null, |
|||
checklist: null, |
|||
rectificationReport: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 查询参数 |
|||
othersParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
isMajor: null, |
|||
projectName: null, |
|||
unitLeader: null, |
|||
projectLegalPerson: null, |
|||
projectLegalUnit: null, |
|||
projectLegalPhone: null, |
|||
engineeringGrade: null, |
|||
engineeringPurposes: null, |
|||
workCategory: null, |
|||
constructionAddress: null, |
|||
constructionMode: null, |
|||
constructionNature: null, |
|||
constructionContent: null, |
|||
adcd: null, |
|||
basin: null, |
|||
projectType: null, |
|||
centralArrangedFunds: null, |
|||
centralArrangedFundsRate: null, |
|||
provincialFunding: null, |
|||
provincialFundingRate: null, |
|||
cityLevelFunds: null, |
|||
cityLevelFundsRate: null, |
|||
countyLevelFunds: null, |
|||
countyLevelFundsRate: null, |
|||
townshipInvestments: null, |
|||
townshipInvestmentsRate: null, |
|||
isMajorProject: null, |
|||
investmentSubject: null, |
|||
constructionPhase: null, |
|||
fundingNumber: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
createUid: null, |
|||
createTime: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
inspectionPerson: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
projectName: [ |
|||
{ |
|||
required: true, |
|||
message: "请选择项目", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
}, |
|||
//项目名称 |
|||
projectNameOptions: [], |
|||
proCode: "", |
|||
proNo: "", |
|||
// 面包屑,路由信息 |
|||
routeList: [ |
|||
{ |
|||
path: "/evaluationEarlyWarning/supervisionInspection/regulatoryInspection", |
|||
routeName: "项目法人履职检查", |
|||
}, |
|||
], |
|||
// 请求头 |
|||
headers: { |
|||
jianwei: "jwtech " + getToken(), |
|||
}, |
|||
fileList1: [], |
|||
fileList2: [], |
|||
fileList3: [], |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
this.getDicts("supervisory_inspection_type").then((response) => { |
|||
this.inspectionTypesOptions = response.data; |
|||
}); |
|||
|
|||
listInfo(this.othersParams).then((response) => { |
|||
this.projectNameOptions = response.records; |
|||
}); |
|||
}, |
|||
methods: { |
|||
getId(res) { |
|||
// console.log(res) |
|||
getInfo(res.id).then((response) => { |
|||
console.log(response.data); |
|||
this.proNo = response.data.proNo; |
|||
this.proCode = response.data.proCode; |
|||
}); |
|||
}, |
|||
/** 查询监管检查列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
this.queryParams.data.menuType = "0"; |
|||
listInspections(this.queryParams).then((response) => { |
|||
this.inspectionsList = response.records; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
// 监督检查类型字典翻译 |
|||
inspectionTypesFormat(row, column) { |
|||
return this.selectDictLabel( |
|||
this.inspectionTypesOptions, |
|||
row.inspectionTypes |
|||
); |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.fileList1 = []; |
|||
this.fileList2 = []; |
|||
this.fileList3 = []; |
|||
this.form = { |
|||
id: null, |
|||
menuType: null, |
|||
inspectionTypes: null, |
|||
inspectionTime: null, |
|||
inspectionPerson: null, |
|||
noticeAttachment: null, |
|||
checklist: null, |
|||
rectificationReport: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
remark: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
id: null, |
|||
menuType: null, |
|||
inspectionTypes: null, |
|||
inspectionTime: null, |
|||
inspectionPerson: null, |
|||
noticeAttachment: null, |
|||
checklist: null, |
|||
rectificationReport: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
remark: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sort: "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; |
|||
getInspections(id).then((response) => { |
|||
this.form = response.data; |
|||
this.form.projectName = |
|||
this.form.projectName + "[" + this.form.proCode + "]"; |
|||
if (this.form.noticeAttachment) { |
|||
this.fileList1 = JSON.parse(this.form.noticeAttachment); |
|||
} |
|||
if (this.form.checklist) { |
|||
this.fileList2 = JSON.parse(this.form.checklist); |
|||
} |
|||
if (this.form.rectificationReport) { |
|||
this.fileList3 = JSON.parse(this.form.rectificationReport); |
|||
} |
|||
this.open = true; |
|||
this.title = "修改项目法人履职检查"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate((valid) => { |
|||
if (valid) { |
|||
if (this.proNo) { |
|||
this.form.proNo = this.proNo; |
|||
} |
|||
if (this.proCode) { |
|||
this.form.proCode = this.proCode; |
|||
} |
|||
this.form.noticeAttachment = JSON.stringify(this.fileList1); |
|||
this.form.checklist = JSON.stringify(this.fileList2); |
|||
this.form.rectificationReport = JSON.stringify(this.fileList3); |
|||
if (this.form.id != null) { |
|||
updateInspections(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
this.form.menuType = "0"; |
|||
addInspections(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 delInspections(ids); |
|||
}) |
|||
.then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}) |
|||
.catch(function () {}); |
|||
} else { |
|||
this.$message.warning("请选择要删除的数据!!"); |
|||
} |
|||
}, |
|||
// 上传意见附件 |
|||
submitOpinionUpload(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]); |
|||
}, |
|||
handleOpinionRemove(file, name) { |
|||
// console.log(file, fileList1); |
|||
let index = this[name].findIndex((item) => item.uid === file.uid); |
|||
// 删除文件 |
|||
this[name].splice(index, 1); |
|||
}, |
|||
// 表格中下载 |
|||
downloadFile(fileList, index) { |
|||
console.log(fileList); |
|||
let file = JSON.parse(fileList)[index]; |
|||
this.handlePreview(file); |
|||
}, |
|||
// 点击预览的文件进行下载 |
|||
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); //创建新的URL表示指定的blob对象 |
|||
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"; |
|||
::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> |
@ -0,0 +1,582 @@ |
|||
<template> |
|||
<div> |
|||
<!-- <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="['warn:zrdw: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="['warn:zrdw: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="['warn:zrdw:remove']" |
|||
>删除</el-button |
|||
> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="warning" |
|||
icon="el-icon-download" |
|||
size="mini" |
|||
@click="handleExport" |
|||
v-hasPermi="['warn:zrdw:export']" |
|||
>导出</el-button |
|||
> |
|||
</el-col> |
|||
<right-toolbar |
|||
:showSearch.sync="showSearch" |
|||
@queryTable="getList" |
|||
></right-toolbar> |
|||
</el-row> --> |
|||
|
|||
<el-table v-loading="loading" :data="zrdwList" border> |
|||
<!-- <el-table-column |
|||
label="监管id" |
|||
align="center" |
|||
prop="inspectionId" |
|||
min-width="120" |
|||
/> --> |
|||
<el-table-column |
|||
label="责任单位" |
|||
align="center" |
|||
prop="unitId" |
|||
:formatter="unitIdFormat" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="整改完成内容" |
|||
align="center" |
|||
prop="rectificationSituation" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="整改完成情况" |
|||
align="center" |
|||
prop="isFinish" |
|||
:formatter="isFinishFormat" |
|||
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)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.attachment, 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="['warn:zrdw:edit']" |
|||
>修改</el-button |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['warn:zrdw:remove']" |
|||
>删除</el-button |
|||
> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-button |
|||
type="text" |
|||
icon="el-icon-plus" |
|||
size="medium" |
|||
@click="handleAdd" |
|||
v-hasPermi="['warn:zrdw:add']" |
|||
>添加责任单位</el-button |
|||
> |
|||
<!-- <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="1000px" |
|||
append-to-body |
|||
:close-on-click-modal="false" |
|||
> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="110px"> |
|||
<!-- <el-form-item label="监管id" prop="inspectionId"> |
|||
<el-input v-model="form.inspectionId" placeholder="请输入监管id" /> |
|||
</el-form-item> --> |
|||
<el-form-item label="责任单位" prop="unitId"> |
|||
<!-- <el-input v-model="form.unitId" placeholder="请输入单位id" /> --> |
|||
<el-select |
|||
v-model="form.unitId" |
|||
placeholder="请选择责任单位" |
|||
filterable |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in unitOptions" |
|||
:key="dict.id + dict.enterpriseName" |
|||
:label="dict.enterpriseName" |
|||
:value="dict.id" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="整改完成内容" prop="rectificationSituation"> |
|||
<el-input |
|||
v-model="form.rectificationSituation" |
|||
placeholder="请输入整改完成内容" |
|||
type="textarea" |
|||
/> |
|||
<!-- <el-select |
|||
v-model="form.rectificationSituation" |
|||
placeholder="请输入项目名称" |
|||
filterable |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in rectificationSituationOptions" |
|||
:key="dict.dictValue" |
|||
:label="dict.dictLabel" |
|||
:value="dict.dictValue" |
|||
/> |
|||
</el-select> --> |
|||
</el-form-item> |
|||
<el-form-item label="整改完成情况" prop="isFinish" v-if="isEdit"> |
|||
<!-- <el-input |
|||
v-model="form.isFinish" |
|||
placeholder="请输入整改完成情况" |
|||
/> --> |
|||
<el-select |
|||
v-model="form.isFinish" |
|||
placeholder="请选择整改完成情况" |
|||
filterable |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in isFinishOptions" |
|||
:key="dict.dictValue" |
|||
:label="dict.dictLabel" |
|||
:value="dict.dictValue" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="附件" prop="attachment" v-if="isEdit"> |
|||
<!-- <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) => handleOpinionRemove(file, 'fileList1')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(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-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 { |
|||
listZrdw, |
|||
getZrdw, |
|||
delZrdw, |
|||
addZrdw, |
|||
updateZrdw, |
|||
exportZrdw, |
|||
} from "@/api/warn/zrdw"; |
|||
import { listInfo } from "@/api/build/enteInfo"; |
|||
import { getToken } from "@/utils/auth"; |
|||
import { getFileStream } from "@/api/system/upload"; |
|||
|
|||
export default { |
|||
name: "Zrdw", |
|||
props: ["inspectionId", "rectificationId", "proNo", "proCode", "isAdd"], |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: false, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 责任单位表格数据 |
|||
zrdwList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 整改完成情况字典 |
|||
isFinishOptions: [], |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
inspectionId: null, |
|||
rectificationId: null, |
|||
unitId: null, |
|||
rectificationSituation: null, |
|||
isFinish: null, |
|||
attachment: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 查询参数 |
|||
unitParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sort: "desc", |
|||
}, |
|||
}, |
|||
unitOptions: [], |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
rectificationSituation: [ |
|||
{ max: 65500, message: "字符长度最大为65500", trigger: "blur" }, |
|||
], |
|||
}, |
|||
// 请求头 |
|||
headers: { |
|||
jianwei: "jwtech " + getToken(), |
|||
}, |
|||
fileList1: [], |
|||
isEdit: false, |
|||
}; |
|||
}, |
|||
created() { |
|||
if (!this.isAdd) this.getList(); |
|||
this.getUnit(); |
|||
this.getDicts("rectification_completion").then((response) => { |
|||
this.isFinishOptions = response.data; |
|||
}); |
|||
}, |
|||
methods: { |
|||
getUnit() { |
|||
this.unitParams.data.proNo = this.proNo; |
|||
this.unitParams.data.proCode = this.proCode; |
|||
listInfo(this.unitParams).then((response) => { |
|||
this.unitOptions = response.data.enterpriseInfoList; |
|||
// console.log(88888888888, this.unitOptions); |
|||
}); |
|||
}, |
|||
/** 查询责任单位列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
this.queryParams.data.inspectionId = this.inspectionId; |
|||
this.queryParams.data.rectificationId = this.rectificationId; |
|||
listZrdw(this.queryParams).then((response) => { |
|||
this.zrdwList = response.records; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
isFinishFormat(row) { |
|||
return this.selectDictLabel(this.isFinishOptions, row.isFinish); |
|||
}, |
|||
unitIdFormat(row) { |
|||
return this.unitOptions.find((item) => item.id == row.unitId) |
|||
?.enterpriseName; |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.fileList1 = []; |
|||
this.form = { |
|||
id: null, |
|||
inspectionId: null, |
|||
rectificationId: null, |
|||
unitId: null, |
|||
rectificationSituation: null, |
|||
attachment: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
id: null, |
|||
inspectionId: null, |
|||
rectificationId: null, |
|||
unitId: null, |
|||
rectificationSituation: null, |
|||
attachment: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
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.isEdit = false; |
|||
this.open = true; |
|||
this.title = "添加责任单位"; |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset(); |
|||
this.isEdit = true; |
|||
const id = row.id || this.ids; |
|||
getZrdw(id).then((response) => { |
|||
this.form = response.data; |
|||
if (this.form.attachment) { |
|||
this.fileList1 = JSON.parse(this.form.attachment); |
|||
} |
|||
this.open = true; |
|||
this.title = "修改责任单位"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate((valid) => { |
|||
if (valid) { |
|||
this.form.attachment = JSON.stringify(this.fileList1); |
|||
if (this.form.id != null) { |
|||
updateZrdw(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
this.form.inspectionId = this.inspectionId; |
|||
this.form.rectificationId = this.rectificationId; |
|||
this.form.isFinish = "0"; |
|||
addZrdw(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 delZrdw(ids); |
|||
}) |
|||
.then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}) |
|||
.catch(function () {}); |
|||
} else { |
|||
this.$message.warning("请选择要删除的数据!!"); |
|||
} |
|||
}, |
|||
// 上传意见附件 |
|||
submitOpinionUpload(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]); |
|||
}, |
|||
handleOpinionRemove(file, name) { |
|||
// console.log(file, fileList1); |
|||
let index = this[name].findIndex((item) => item.uid === file.uid); |
|||
// 删除文件 |
|||
this[name].splice(index, 1); |
|||
}, |
|||
// 表格中下载 |
|||
downloadFile(fileList, index) { |
|||
console.log(fileList); |
|||
let file = JSON.parse(fileList)[index]; |
|||
this.handlePreview(file); |
|||
}, |
|||
// 点击预览的文件进行下载 |
|||
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); //创建新的URL表示指定的blob对象 |
|||
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"; |
|||
//::v-deep { |
|||
// .el-dialog { |
|||
// margin-top: 10vh !important; |
|||
// } |
|||
//} |
|||
</style> |
@ -0,0 +1,544 @@ |
|||
<template> |
|||
<div> |
|||
<div style="text-align: right; margin-bottom: 10px"> |
|||
<el-button |
|||
type="primary" |
|||
icon="el-icon-plus" |
|||
size="mini" |
|||
@click="handleAdd" |
|||
v-hasPermi="['warn:rectification:add']" |
|||
>新增整改通知书</el-button |
|||
> |
|||
</div> |
|||
|
|||
<el-table v-loading="loading" border :data="rectificationList"> |
|||
<el-table-column |
|||
label="序号" |
|||
type="index" |
|||
width="50" |
|||
align="center" |
|||
fixed |
|||
/> |
|||
<!-- <el-table-column |
|||
label="监管id" |
|||
align="center" |
|||
prop="inspectionId" |
|||
min-width="120" |
|||
/> --> |
|||
<el-table-column |
|||
label="发文单位" |
|||
align="center" |
|||
prop="issuingUnit" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="文号" |
|||
align="center" |
|||
prop="documentNumber" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="通知生效时间" |
|||
align="center" |
|||
prop="noticeBegainTime" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<span>{{ |
|||
parseTime(scope.row.noticeBegainTime, "{y}-{m}-{d}") |
|||
}}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="整改通知书" |
|||
align="center" |
|||
prop="rectificationAttachment" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse( |
|||
scope.row.rectificationAttachment |
|||
)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.rectificationAttachment, index)" |
|||
style="cursor: pointer" |
|||
></i> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="责任单位" |
|||
align="center" |
|||
prop="unitArray" |
|||
:formatter="unitArrayFormat" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="整改完成情况" |
|||
align="center" |
|||
prop="isFinish" |
|||
:formatter="isFinishFormat" |
|||
min-width="120" |
|||
/> |
|||
<!-- <el-table-column |
|||
label="整改相关附件" |
|||
align="center" |
|||
prop="ccc" |
|||
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="['warn:rectification:edit']" |
|||
>修改</el-button |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['warn:rectification: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="110px"> |
|||
<!-- <el-form-item label="监管id" prop="inspectionId"> |
|||
<el-input v-model="form.inspectionId" placeholder="请输入监管id" /> |
|||
</el-form-item> --> |
|||
<el-form-item label="发文单位" prop="issuingUnit"> |
|||
<el-input v-model="form.issuingUnit" placeholder="请输入发文单位" /> |
|||
</el-form-item> |
|||
<el-form-item label="文号" prop="documentNumber"> |
|||
<el-input v-model="form.documentNumber" placeholder="请输入文号" /> |
|||
</el-form-item> |
|||
<el-form-item label="通知生效时间" prop="noticeBegainTime"> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
v-model="form.noticeBegainTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择通知生效时间" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="整改通知书" prop="rectificationAttachment"> |
|||
<!-- <el-input v-model="form.rectificationAttachment" placeholder="请输入整改通知书" /> --> |
|||
<el-upload |
|||
class="upload-demo" |
|||
action="thinking/common/upload" |
|||
:headers="headers" |
|||
:before-upload="(file) => $fileBeforeUpload(file, 'fileList1')" |
|||
:on-preview="handlePreview" |
|||
:on-remove="(file) => handleOpinionRemove(file, 'fileList1')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(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-form> |
|||
<responsibleUnit |
|||
v-if="open && form.id" |
|||
:isAdd="isAdd" |
|||
:inspectionId="inspectionId" |
|||
:rectificationId="form.id" |
|||
:proNo="proNo" |
|||
:proCode="proCode" |
|||
/> |
|||
<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 { |
|||
listRectification, |
|||
getRectification, |
|||
delRectification, |
|||
addRectification, |
|||
updateRectification, |
|||
exportRectification, |
|||
} from "@/api/warn/rectification"; |
|||
import { listInfo } from "@/api/build/enteInfo"; |
|||
import { getToken } from "@/utils/auth"; |
|||
import { getFileStream } from "@/api/system/upload"; |
|||
import responsibleUnit from "./responsibleUnit.vue"; |
|||
|
|||
export default { |
|||
name: "Rectification", |
|||
props: ["inspectionId", "proNo", "proCode"], |
|||
components: { |
|||
responsibleUnit, |
|||
}, |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 整改通知书表格数据 |
|||
rectificationList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
inspectionId: null, |
|||
issuingUnit: null, |
|||
documentNumber: null, |
|||
noticeBegainTime: null, |
|||
rectificationAttachment: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 查询参数 |
|||
unitParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sort: "desc", |
|||
}, |
|||
}, |
|||
unitOptions: [], |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
issuingUnit: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
documentNumber: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
}, |
|||
// 请求头 |
|||
headers: { |
|||
jianwei: "jwtech " + getToken(), |
|||
}, |
|||
fileList1: [], |
|||
isAdd: false, |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
this.getUnit(); |
|||
this.getDicts("rectification_completion").then((response) => { |
|||
this.isFinishOptions = response.data; |
|||
}); |
|||
}, |
|||
methods: { |
|||
/** 查询整改通知书列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
this.queryParams.data.inspectionId = this.inspectionId; |
|||
listRectification(this.queryParams).then((response) => { |
|||
this.rectificationList = response.records; |
|||
console.log("this.rectificationList", this.rectificationList); |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
getUnit() { |
|||
this.unitParams.data.proNo = this.proNo; |
|||
this.unitParams.data.proCode = this.proCode; |
|||
listInfo(this.unitParams).then((response) => { |
|||
this.unitOptions = response.data.enterpriseInfoList; |
|||
// console.log(88888888888, this.unitOptions); |
|||
}); |
|||
}, |
|||
unitArrayFormat(row) { |
|||
let res = ""; |
|||
row.unitArray?.forEach((item) => { |
|||
// this.unitOptions.forEach((sub) => { |
|||
// if (item === sub.enterpriseName) { |
|||
res = res + item + "、"; |
|||
// } |
|||
// }); |
|||
}); |
|||
return res; |
|||
}, |
|||
isFinishFormat(row) { |
|||
return this.selectDictLabel(this.isFinishOptions, row.isFinish); |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.fileList1 = []; |
|||
this.form = { |
|||
id: null, |
|||
inspectionId: null, |
|||
issuingUnit: null, |
|||
documentNumber: null, |
|||
noticeBegainTime: null, |
|||
rectificationAttachment: null, |
|||
createTime: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
id: null, |
|||
inspectionId: null, |
|||
issuingUnit: null, |
|||
documentNumber: null, |
|||
noticeBegainTime: null, |
|||
rectificationAttachment: null, |
|||
createTime: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
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.isAdd = true; |
|||
this.open = true; |
|||
this.title = "添加整改通知书"; |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset(); |
|||
this.isAdd = false; |
|||
const id = row.id || this.ids; |
|||
getRectification(id).then((response) => { |
|||
this.form = response.data; |
|||
if (this.form.rectificationAttachment) { |
|||
this.fileList1 = JSON.parse(this.form.rectificationAttachment); |
|||
} |
|||
this.open = true; |
|||
this.title = "修改整改通知书"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate((valid) => { |
|||
if (valid) { |
|||
this.form.rectificationAttachment = JSON.stringify(this.fileList1); |
|||
if (this.form.id != null) { |
|||
updateRectification(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
this.form.inspectionId = this.inspectionId; |
|||
addRectification(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 delRectification(ids); |
|||
}) |
|||
.then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}) |
|||
.catch(function () {}); |
|||
} else { |
|||
this.$message.warning("请选择要删除的数据!!"); |
|||
} |
|||
}, |
|||
// 上传意见附件 |
|||
submitOpinionUpload(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]); |
|||
}, |
|||
handleOpinionRemove(file, name) { |
|||
// console.log(file, fileList1); |
|||
let index = this[name].findIndex((item) => item.uid === file.uid); |
|||
// 删除文件 |
|||
this[name].splice(index, 1); |
|||
}, |
|||
// 表格中下载 |
|||
downloadFile(fileList, index) { |
|||
console.log(fileList); |
|||
let file = JSON.parse(fileList)[index]; |
|||
this.handlePreview(file); |
|||
}, |
|||
// 点击预览的文件进行下载 |
|||
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); //创建新的URL表示指定的blob对象 |
|||
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"; |
|||
//::v-deep { |
|||
// .el-dialog { |
|||
// margin-top: 10vh !important; |
|||
// } |
|||
//} |
|||
</style> |
@ -0,0 +1,857 @@ |
|||
<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="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 label="监督检查类型" prop="inspectionTypes"> |
|||
<el-select |
|||
v-model="queryParams.data.inspectionTypes" |
|||
placeholder="请选择监督检查类型" |
|||
clearable |
|||
size="small" |
|||
@change="handleQuery" |
|||
> |
|||
<el-option |
|||
v-for="dict in inspectionTypesOptions" |
|||
: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="['warn:inspections: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="['warn:inspections: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="['warn:inspections:remove']" |
|||
>删除</el-button |
|||
> |
|||
</el-col> |
|||
|
|||
<right-toolbar |
|||
:showSearch.sync="showSearch" |
|||
@queryTable="getList" |
|||
></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table |
|||
v-loading="loading" |
|||
:data="inspectionsList" |
|||
@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="projectName" |
|||
min-width="120" |
|||
/> |
|||
<!-- <el-table-column |
|||
label="监督检查类型" |
|||
align="center" |
|||
prop="inspectionTypes" |
|||
:formatter="inspectionTypesFormat" |
|||
min-width="120" |
|||
/> --> |
|||
<el-table-column |
|||
label="检查时间" |
|||
align="center" |
|||
prop="inspectionTime" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<span>{{ parseTime(scope.row.inspectionTime, "{y}-{m}-{d}") }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="检查人" |
|||
align="center" |
|||
prop="inspectionPerson" |
|||
min-width="120" |
|||
/> |
|||
|
|||
<el-table-column |
|||
label="通知文件" |
|||
align="center" |
|||
prop="noticeAttachment" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse(scope.row.noticeAttachment)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.noticeAttachment, index)" |
|||
style="cursor: pointer" |
|||
></i> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="检查表" |
|||
align="center" |
|||
prop="checklist" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse(scope.row.checklist)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.checklist, index)" |
|||
style="cursor: pointer" |
|||
></i> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="整改报告" |
|||
align="center" |
|||
prop="rectificationReport" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse(scope.row.rectificationReport)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.rectificationReport, 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="['warn:inspections:edit']" |
|||
>修改</el-button |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['warn:inspections: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="1400px" |
|||
append-to-body |
|||
:close-on-click-modal="false" |
|||
> |
|||
<div class="listTitle" style="margin-top: 0"> |
|||
<span>质量检查信息</span> |
|||
</div> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="110px"> |
|||
<el-form-item label="项目名称" prop="projectName"> |
|||
<el-select |
|||
v-model="form.projectName" |
|||
placeholder="请输入项目名称" |
|||
filterable |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in projectNameOptions" |
|||
:key="dict.projectName + dict.id" |
|||
:label="dict.projectName + '[' + dict.proCode + ']'" |
|||
:value="dict.projectName + '[' + dict.proCode + ']'" |
|||
@click.native="getId(dict)" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item label="监督检查类型" prop="inspectionTypes"> |
|||
<el-select |
|||
v-model="form.inspectionTypes" |
|||
placeholder="请选择监督检查类型" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in inspectionTypesOptions" |
|||
:key="dict.dictValue" |
|||
:label="dict.dictLabel" |
|||
:value="dict.dictValue" |
|||
></el-option> |
|||
</el-select> |
|||
</el-form-item> --> |
|||
<el-form-item label="检查时间" prop="inspectionTime"> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
v-model="form.inspectionTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择检查时间" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="检查人" prop="inspectionPerson"> |
|||
<el-input |
|||
v-model="form.inspectionPerson" |
|||
placeholder="请输入检查人" |
|||
/> |
|||
</el-form-item> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<el-form-item label="检查通知" prop="noticeAttachment"> |
|||
<!-- <el-input |
|||
v-model="form.noticeAttachment" |
|||
placeholder="请输入通知文件" |
|||
/> --> |
|||
<el-upload |
|||
class="upload-demo" |
|||
action="thinking/common/upload" |
|||
:headers="headers" |
|||
:before-upload="(file) => $fileBeforeUpload(file, 'fileList1')" |
|||
:on-preview="handlePreview" |
|||
:on-remove="(file) => handleOpinionRemove(file, 'fileList1')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(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="8"> |
|||
<el-form-item label="整改通知" prop="checklist"> |
|||
<!-- <el-input v-model="form.checklist" placeholder="请输入检查表" /> --> |
|||
<el-upload |
|||
class="upload-demo" |
|||
action="thinking/common/upload" |
|||
:headers="headers" |
|||
:before-upload="(file) => $fileBeforeUpload(file, 'fileList2')" |
|||
:on-preview="handlePreview" |
|||
:on-remove="(file) => handleOpinionRemove(file, 'fileList2')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(fileList, 'fileList2') |
|||
" |
|||
: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-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="整改报告" prop="rectificationReport"> |
|||
<!-- <el-input |
|||
v-model="form.rectificationReport" |
|||
placeholder="请输入整改报告" |
|||
/> --> |
|||
<el-upload |
|||
class="upload-demo" |
|||
action="thinking/common/upload" |
|||
:headers="headers" |
|||
:before-upload="(file) => $fileBeforeUpload(file, 'fileList3')" |
|||
:on-preview="handlePreview" |
|||
:on-remove="(file) => handleOpinionRemove(file, 'fileList3')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(fileList, 'fileList3') |
|||
" |
|||
: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-col> |
|||
</el-row> |
|||
</el-form> |
|||
<div v-if="form.id"> |
|||
<div class="listTitle" style="margin-top: 0"> |
|||
<span>责令限期整改通知书列表</span> |
|||
</div> |
|||
<editPart |
|||
:inspectionId="form.id" |
|||
:proNo="form.proNo" |
|||
:proCode="form.proCode" |
|||
/> |
|||
</div> |
|||
<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 { |
|||
listInspections, |
|||
getInspections, |
|||
delInspections, |
|||
addInspections, |
|||
updateInspections, |
|||
exportInspections, |
|||
} from "@/api/warn/inspections"; |
|||
import { listInfo, getInfo } from "@/api/build/projectInfo"; |
|||
import { getToken } from "@/utils/auth"; |
|||
import { getFileStream } from "@/api/system/upload"; |
|||
import editPart from "./editPart.vue"; |
|||
|
|||
export default { |
|||
name: "Inspections", |
|||
components: { |
|||
editPart, |
|||
}, |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 监管检查表格数据 |
|||
inspectionsList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 监督检查类型字典 |
|||
inspectionTypesOptions: [], |
|||
|
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
menuType: null, |
|||
inspectionTypes: null, |
|||
inspectionTime: null, |
|||
inspectionPerson: null, |
|||
noticeAttachment: null, |
|||
checklist: null, |
|||
rectificationReport: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 查询参数 |
|||
othersParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
isMajor: null, |
|||
projectName: null, |
|||
unitLeader: null, |
|||
projectLegalPerson: null, |
|||
projectLegalUnit: null, |
|||
projectLegalPhone: null, |
|||
engineeringGrade: null, |
|||
engineeringPurposes: null, |
|||
workCategory: null, |
|||
constructionAddress: null, |
|||
constructionMode: null, |
|||
constructionNature: null, |
|||
constructionContent: null, |
|||
adcd: null, |
|||
basin: null, |
|||
projectType: null, |
|||
centralArrangedFunds: null, |
|||
centralArrangedFundsRate: null, |
|||
provincialFunding: null, |
|||
provincialFundingRate: null, |
|||
cityLevelFunds: null, |
|||
cityLevelFundsRate: null, |
|||
countyLevelFunds: null, |
|||
countyLevelFundsRate: null, |
|||
townshipInvestments: null, |
|||
townshipInvestmentsRate: null, |
|||
isMajorProject: null, |
|||
investmentSubject: null, |
|||
constructionPhase: null, |
|||
fundingNumber: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
createUid: null, |
|||
createTime: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
inspectionPerson: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
projectName: [ |
|||
{ |
|||
required: true, |
|||
message: "请选择项目", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
}, |
|||
//项目名称 |
|||
projectNameOptions: [], |
|||
proCode: "", |
|||
proNo: "", |
|||
// 面包屑,路由信息 |
|||
routeList: [ |
|||
{ |
|||
path: "/evaluationEarlyWarning/supervisionInspection/regulatoryInspection", |
|||
routeName: "质量检查", |
|||
}, |
|||
], |
|||
// 请求头 |
|||
headers: { |
|||
jianwei: "jwtech " + getToken(), |
|||
}, |
|||
fileList1: [], |
|||
fileList2: [], |
|||
fileList3: [], |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
this.getDicts("supervisory_inspection_type").then((response) => { |
|||
this.inspectionTypesOptions = response.data; |
|||
}); |
|||
|
|||
listInfo(this.othersParams).then((response) => { |
|||
this.projectNameOptions = response.records; |
|||
}); |
|||
}, |
|||
methods: { |
|||
getId(res) { |
|||
// console.log(res) |
|||
getInfo(res.id).then((response) => { |
|||
console.log(response.data); |
|||
this.proNo = response.data.proNo; |
|||
this.proCode = response.data.proCode; |
|||
}); |
|||
}, |
|||
/** 查询监管检查列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
this.queryParams.data.menuType = "1"; |
|||
listInspections(this.queryParams).then((response) => { |
|||
this.inspectionsList = response.records; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
// 监督检查类型字典翻译 |
|||
inspectionTypesFormat(row, column) { |
|||
return this.selectDictLabel( |
|||
this.inspectionTypesOptions, |
|||
row.inspectionTypes |
|||
); |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.fileList1 = []; |
|||
this.fileList2 = []; |
|||
this.fileList3 = []; |
|||
this.form = { |
|||
id: null, |
|||
menuType: null, |
|||
inspectionTypes: null, |
|||
inspectionTime: null, |
|||
inspectionPerson: null, |
|||
noticeAttachment: null, |
|||
checklist: null, |
|||
rectificationReport: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
remark: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
id: null, |
|||
menuType: null, |
|||
inspectionTypes: null, |
|||
inspectionTime: null, |
|||
inspectionPerson: null, |
|||
noticeAttachment: null, |
|||
checklist: null, |
|||
rectificationReport: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
remark: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sort: "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; |
|||
getInspections(id).then((response) => { |
|||
this.form = response.data; |
|||
this.form.projectName = |
|||
this.form.projectName + "[" + this.form.proCode + "]"; |
|||
if (this.form.noticeAttachment) { |
|||
this.fileList1 = JSON.parse(this.form.noticeAttachment); |
|||
} |
|||
if (this.form.checklist) { |
|||
this.fileList2 = JSON.parse(this.form.checklist); |
|||
} |
|||
if (this.form.rectificationReport) { |
|||
this.fileList3 = JSON.parse(this.form.rectificationReport); |
|||
} |
|||
this.open = true; |
|||
this.title = "修改质量检查"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate((valid) => { |
|||
if (valid) { |
|||
if (this.proNo) { |
|||
this.form.proNo = this.proNo; |
|||
} |
|||
if (this.proCode) { |
|||
this.form.proCode = this.proCode; |
|||
} |
|||
this.form.noticeAttachment = JSON.stringify(this.fileList1); |
|||
this.form.checklist = JSON.stringify(this.fileList2); |
|||
this.form.rectificationReport = JSON.stringify(this.fileList3); |
|||
if (this.form.id != null) { |
|||
updateInspections(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
this.form.menuType = "1"; |
|||
addInspections(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 delInspections(ids); |
|||
}) |
|||
.then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}) |
|||
.catch(function () {}); |
|||
} else { |
|||
this.$message.warning("请选择要删除的数据!!"); |
|||
} |
|||
}, |
|||
// 上传意见附件 |
|||
submitOpinionUpload(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]); |
|||
}, |
|||
handleOpinionRemove(file, name) { |
|||
// console.log(file, fileList1); |
|||
let index = this[name].findIndex((item) => item.uid === file.uid); |
|||
// 删除文件 |
|||
this[name].splice(index, 1); |
|||
}, |
|||
// 表格中下载 |
|||
downloadFile(fileList, index) { |
|||
console.log(fileList); |
|||
let file = JSON.parse(fileList)[index]; |
|||
this.handlePreview(file); |
|||
}, |
|||
// 点击预览的文件进行下载 |
|||
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); //创建新的URL表示指定的blob对象 |
|||
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"; |
|||
::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> |
@ -0,0 +1,582 @@ |
|||
<template> |
|||
<div> |
|||
<!-- <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="['warn:zrdw: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="['warn:zrdw: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="['warn:zrdw:remove']" |
|||
>删除</el-button |
|||
> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="warning" |
|||
icon="el-icon-download" |
|||
size="mini" |
|||
@click="handleExport" |
|||
v-hasPermi="['warn:zrdw:export']" |
|||
>导出</el-button |
|||
> |
|||
</el-col> |
|||
<right-toolbar |
|||
:showSearch.sync="showSearch" |
|||
@queryTable="getList" |
|||
></right-toolbar> |
|||
</el-row> --> |
|||
|
|||
<el-table v-loading="loading" :data="zrdwList" border> |
|||
<!-- <el-table-column |
|||
label="监管id" |
|||
align="center" |
|||
prop="inspectionId" |
|||
min-width="120" |
|||
/> --> |
|||
<el-table-column |
|||
label="责任单位" |
|||
align="center" |
|||
prop="unitId" |
|||
:formatter="unitIdFormat" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="整改完成内容" |
|||
align="center" |
|||
prop="rectificationSituation" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="整改完成情况" |
|||
align="center" |
|||
prop="isFinish" |
|||
:formatter="isFinishFormat" |
|||
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)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.attachment, 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="['warn:zrdw:edit']" |
|||
>修改</el-button |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['warn:zrdw:remove']" |
|||
>删除</el-button |
|||
> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-button |
|||
type="text" |
|||
icon="el-icon-plus" |
|||
size="medium" |
|||
@click="handleAdd" |
|||
v-hasPermi="['warn:zrdw:add']" |
|||
>添加责任单位</el-button |
|||
> |
|||
<!-- <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="1000px" |
|||
append-to-body |
|||
:close-on-click-modal="false" |
|||
> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="110px"> |
|||
<!-- <el-form-item label="监管id" prop="inspectionId"> |
|||
<el-input v-model="form.inspectionId" placeholder="请输入监管id" /> |
|||
</el-form-item> --> |
|||
<el-form-item label="责任单位" prop="unitId"> |
|||
<!-- <el-input v-model="form.unitId" placeholder="请输入单位id" /> --> |
|||
<el-select |
|||
v-model="form.unitId" |
|||
placeholder="请选择责任单位" |
|||
filterable |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in unitOptions" |
|||
:key="dict.id + dict.enterpriseName" |
|||
:label="dict.enterpriseName" |
|||
:value="dict.id" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="整改完成内容" prop="rectificationSituation"> |
|||
<el-input |
|||
v-model="form.rectificationSituation" |
|||
placeholder="请输入整改完成内容" |
|||
type="textarea" |
|||
/> |
|||
<!-- <el-select |
|||
v-model="form.rectificationSituation" |
|||
placeholder="请输入项目名称" |
|||
filterable |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in rectificationSituationOptions" |
|||
:key="dict.dictValue" |
|||
:label="dict.dictLabel" |
|||
:value="dict.dictValue" |
|||
/> |
|||
</el-select> --> |
|||
</el-form-item> |
|||
<el-form-item label="整改完成情况" prop="isFinish" v-if="isEdit"> |
|||
<!-- <el-input |
|||
v-model="form.isFinish" |
|||
placeholder="请输入整改完成情况" |
|||
/> --> |
|||
<el-select |
|||
v-model="form.isFinish" |
|||
placeholder="请选择整改完成情况" |
|||
filterable |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in isFinishOptions" |
|||
:key="dict.dictValue" |
|||
:label="dict.dictLabel" |
|||
:value="dict.dictValue" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="附件" prop="attachment" v-if="isEdit"> |
|||
<!-- <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) => handleOpinionRemove(file, 'fileList1')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(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-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 { |
|||
listZrdw, |
|||
getZrdw, |
|||
delZrdw, |
|||
addZrdw, |
|||
updateZrdw, |
|||
exportZrdw, |
|||
} from "@/api/warn/zrdw"; |
|||
import { listInfo } from "@/api/build/enteInfo"; |
|||
import { getToken } from "@/utils/auth"; |
|||
import { getFileStream } from "@/api/system/upload"; |
|||
|
|||
export default { |
|||
name: "Zrdw", |
|||
props: ["inspectionId", "rectificationId", "proNo", "proCode", "isAdd"], |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: false, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 责任单位表格数据 |
|||
zrdwList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 整改完成情况字典 |
|||
isFinishOptions: [], |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
inspectionId: null, |
|||
rectificationId: null, |
|||
unitId: null, |
|||
rectificationSituation: null, |
|||
isFinish: null, |
|||
attachment: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 查询参数 |
|||
unitParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sort: "desc", |
|||
}, |
|||
}, |
|||
unitOptions: [], |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
rectificationSituation: [ |
|||
{ max: 65500, message: "字符长度最大为65500", trigger: "blur" }, |
|||
], |
|||
}, |
|||
// 请求头 |
|||
headers: { |
|||
jianwei: "jwtech " + getToken(), |
|||
}, |
|||
fileList1: [], |
|||
isEdit: false, |
|||
}; |
|||
}, |
|||
created() { |
|||
if (!this.isAdd) this.getList(); |
|||
this.getUnit(); |
|||
this.getDicts("rectification_completion").then((response) => { |
|||
this.isFinishOptions = response.data; |
|||
}); |
|||
}, |
|||
methods: { |
|||
getUnit() { |
|||
this.unitParams.data.proNo = this.proNo; |
|||
this.unitParams.data.proCode = this.proCode; |
|||
listInfo(this.unitParams).then((response) => { |
|||
this.unitOptions = response.data.enterpriseInfoList; |
|||
// console.log(88888888888, this.unitOptions); |
|||
}); |
|||
}, |
|||
/** 查询责任单位列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
this.queryParams.data.inspectionId = this.inspectionId; |
|||
this.queryParams.data.rectificationId = this.rectificationId; |
|||
listZrdw(this.queryParams).then((response) => { |
|||
this.zrdwList = response.records; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
isFinishFormat(row) { |
|||
return this.selectDictLabel(this.isFinishOptions, row.isFinish); |
|||
}, |
|||
unitIdFormat(row) { |
|||
return this.unitOptions.find((item) => item.id == row.unitId) |
|||
?.enterpriseName; |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.fileList1 = []; |
|||
this.form = { |
|||
id: null, |
|||
inspectionId: null, |
|||
rectificationId: null, |
|||
unitId: null, |
|||
rectificationSituation: null, |
|||
attachment: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
id: null, |
|||
inspectionId: null, |
|||
rectificationId: null, |
|||
unitId: null, |
|||
rectificationSituation: null, |
|||
attachment: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
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.isEdit = false; |
|||
this.open = true; |
|||
this.title = "添加责任单位"; |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset(); |
|||
this.isEdit = true; |
|||
const id = row.id || this.ids; |
|||
getZrdw(id).then((response) => { |
|||
this.form = response.data; |
|||
if (this.form.attachment) { |
|||
this.fileList1 = JSON.parse(this.form.attachment); |
|||
} |
|||
this.open = true; |
|||
this.title = "修改责任单位"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate((valid) => { |
|||
if (valid) { |
|||
this.form.attachment = JSON.stringify(this.fileList1); |
|||
if (this.form.id != null) { |
|||
updateZrdw(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
this.form.inspectionId = this.inspectionId; |
|||
this.form.rectificationId = this.rectificationId; |
|||
this.form.isFinish = "0"; |
|||
addZrdw(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 delZrdw(ids); |
|||
}) |
|||
.then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}) |
|||
.catch(function () {}); |
|||
} else { |
|||
this.$message.warning("请选择要删除的数据!!"); |
|||
} |
|||
}, |
|||
// 上传意见附件 |
|||
submitOpinionUpload(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]); |
|||
}, |
|||
handleOpinionRemove(file, name) { |
|||
// console.log(file, fileList1); |
|||
let index = this[name].findIndex((item) => item.uid === file.uid); |
|||
// 删除文件 |
|||
this[name].splice(index, 1); |
|||
}, |
|||
// 表格中下载 |
|||
downloadFile(fileList, index) { |
|||
console.log(fileList); |
|||
let file = JSON.parse(fileList)[index]; |
|||
this.handlePreview(file); |
|||
}, |
|||
// 点击预览的文件进行下载 |
|||
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); //创建新的URL表示指定的blob对象 |
|||
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"; |
|||
//::v-deep { |
|||
// .el-dialog { |
|||
// margin-top: 10vh !important; |
|||
// } |
|||
//} |
|||
</style> |
@ -0,0 +1,544 @@ |
|||
<template> |
|||
<div> |
|||
<div style="text-align: right; margin-bottom: 10px"> |
|||
<el-button |
|||
type="primary" |
|||
icon="el-icon-plus" |
|||
size="mini" |
|||
@click="handleAdd" |
|||
v-hasPermi="['warn:rectification:add']" |
|||
>新增整改通知书</el-button |
|||
> |
|||
</div> |
|||
|
|||
<el-table v-loading="loading" border :data="rectificationList"> |
|||
<el-table-column |
|||
label="序号" |
|||
type="index" |
|||
width="50" |
|||
align="center" |
|||
fixed |
|||
/> |
|||
<!-- <el-table-column |
|||
label="监管id" |
|||
align="center" |
|||
prop="inspectionId" |
|||
min-width="120" |
|||
/> --> |
|||
<el-table-column |
|||
label="发文单位" |
|||
align="center" |
|||
prop="issuingUnit" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="文号" |
|||
align="center" |
|||
prop="documentNumber" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="通知生效时间" |
|||
align="center" |
|||
prop="noticeBegainTime" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<span>{{ |
|||
parseTime(scope.row.noticeBegainTime, "{y}-{m}-{d}") |
|||
}}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="整改通知书" |
|||
align="center" |
|||
prop="rectificationAttachment" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse( |
|||
scope.row.rectificationAttachment |
|||
)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.rectificationAttachment, index)" |
|||
style="cursor: pointer" |
|||
></i> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="责任单位" |
|||
align="center" |
|||
prop="unitArray" |
|||
:formatter="unitArrayFormat" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="整改完成情况" |
|||
align="center" |
|||
prop="isFinish" |
|||
:formatter="isFinishFormat" |
|||
min-width="120" |
|||
/> |
|||
<!-- <el-table-column |
|||
label="整改相关附件" |
|||
align="center" |
|||
prop="ccc" |
|||
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="['warn:rectification:edit']" |
|||
>修改</el-button |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['warn:rectification: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="110px"> |
|||
<!-- <el-form-item label="监管id" prop="inspectionId"> |
|||
<el-input v-model="form.inspectionId" placeholder="请输入监管id" /> |
|||
</el-form-item> --> |
|||
<el-form-item label="发文单位" prop="issuingUnit"> |
|||
<el-input v-model="form.issuingUnit" placeholder="请输入发文单位" /> |
|||
</el-form-item> |
|||
<el-form-item label="文号" prop="documentNumber"> |
|||
<el-input v-model="form.documentNumber" placeholder="请输入文号" /> |
|||
</el-form-item> |
|||
<el-form-item label="通知生效时间" prop="noticeBegainTime"> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
v-model="form.noticeBegainTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择通知生效时间" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="整改通知书" prop="rectificationAttachment"> |
|||
<!-- <el-input v-model="form.rectificationAttachment" placeholder="请输入整改通知书" /> --> |
|||
<el-upload |
|||
class="upload-demo" |
|||
action="thinking/common/upload" |
|||
:headers="headers" |
|||
:before-upload="(file) => $fileBeforeUpload(file, 'fileList1')" |
|||
:on-preview="handlePreview" |
|||
:on-remove="(file) => handleOpinionRemove(file, 'fileList1')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(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-form> |
|||
<responsibleUnit |
|||
v-if="open && form.id" |
|||
:isAdd="isAdd" |
|||
:inspectionId="inspectionId" |
|||
:rectificationId="form.id" |
|||
:proNo="proNo" |
|||
:proCode="proCode" |
|||
/> |
|||
<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 { |
|||
listRectification, |
|||
getRectification, |
|||
delRectification, |
|||
addRectification, |
|||
updateRectification, |
|||
exportRectification, |
|||
} from "@/api/warn/rectification"; |
|||
import { listInfo } from "@/api/build/enteInfo"; |
|||
import { getToken } from "@/utils/auth"; |
|||
import { getFileStream } from "@/api/system/upload"; |
|||
import responsibleUnit from "./responsibleUnit.vue"; |
|||
|
|||
export default { |
|||
name: "Rectification", |
|||
props: ["inspectionId", "proNo", "proCode"], |
|||
components: { |
|||
responsibleUnit, |
|||
}, |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 整改通知书表格数据 |
|||
rectificationList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
inspectionId: null, |
|||
issuingUnit: null, |
|||
documentNumber: null, |
|||
noticeBegainTime: null, |
|||
rectificationAttachment: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 查询参数 |
|||
unitParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sort: "desc", |
|||
}, |
|||
}, |
|||
unitOptions: [], |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
issuingUnit: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
documentNumber: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
}, |
|||
// 请求头 |
|||
headers: { |
|||
jianwei: "jwtech " + getToken(), |
|||
}, |
|||
fileList1: [], |
|||
isAdd: false, |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
this.getUnit(); |
|||
this.getDicts("rectification_completion").then((response) => { |
|||
this.isFinishOptions = response.data; |
|||
}); |
|||
}, |
|||
methods: { |
|||
/** 查询整改通知书列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
this.queryParams.data.inspectionId = this.inspectionId; |
|||
listRectification(this.queryParams).then((response) => { |
|||
this.rectificationList = response.records; |
|||
console.log("this.rectificationList", this.rectificationList); |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
getUnit() { |
|||
this.unitParams.data.proNo = this.proNo; |
|||
this.unitParams.data.proCode = this.proCode; |
|||
listInfo(this.unitParams).then((response) => { |
|||
this.unitOptions = response.data.enterpriseInfoList; |
|||
// console.log(88888888888, this.unitOptions); |
|||
}); |
|||
}, |
|||
unitArrayFormat(row) { |
|||
let res = ""; |
|||
row.unitArray?.forEach((item) => { |
|||
// this.unitOptions.forEach((sub) => { |
|||
// if (item === sub.enterpriseName) { |
|||
res = res + item + "、"; |
|||
// } |
|||
// }); |
|||
}); |
|||
return res; |
|||
}, |
|||
isFinishFormat(row) { |
|||
return this.selectDictLabel(this.isFinishOptions, row.isFinish); |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.fileList1 = []; |
|||
this.form = { |
|||
id: null, |
|||
inspectionId: null, |
|||
issuingUnit: null, |
|||
documentNumber: null, |
|||
noticeBegainTime: null, |
|||
rectificationAttachment: null, |
|||
createTime: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
id: null, |
|||
inspectionId: null, |
|||
issuingUnit: null, |
|||
documentNumber: null, |
|||
noticeBegainTime: null, |
|||
rectificationAttachment: null, |
|||
createTime: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
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.isAdd = true; |
|||
this.open = true; |
|||
this.title = "添加整改通知书"; |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset(); |
|||
this.isAdd = false; |
|||
const id = row.id || this.ids; |
|||
getRectification(id).then((response) => { |
|||
this.form = response.data; |
|||
if (this.form.rectificationAttachment) { |
|||
this.fileList1 = JSON.parse(this.form.rectificationAttachment); |
|||
} |
|||
this.open = true; |
|||
this.title = "修改整改通知书"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate((valid) => { |
|||
if (valid) { |
|||
this.form.rectificationAttachment = JSON.stringify(this.fileList1); |
|||
if (this.form.id != null) { |
|||
updateRectification(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
this.form.inspectionId = this.inspectionId; |
|||
addRectification(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 delRectification(ids); |
|||
}) |
|||
.then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}) |
|||
.catch(function () {}); |
|||
} else { |
|||
this.$message.warning("请选择要删除的数据!!"); |
|||
} |
|||
}, |
|||
// 上传意见附件 |
|||
submitOpinionUpload(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]); |
|||
}, |
|||
handleOpinionRemove(file, name) { |
|||
// console.log(file, fileList1); |
|||
let index = this[name].findIndex((item) => item.uid === file.uid); |
|||
// 删除文件 |
|||
this[name].splice(index, 1); |
|||
}, |
|||
// 表格中下载 |
|||
downloadFile(fileList, index) { |
|||
console.log(fileList); |
|||
let file = JSON.parse(fileList)[index]; |
|||
this.handlePreview(file); |
|||
}, |
|||
// 点击预览的文件进行下载 |
|||
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); //创建新的URL表示指定的blob对象 |
|||
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"; |
|||
//::v-deep { |
|||
// .el-dialog { |
|||
// margin-top: 10vh !important; |
|||
// } |
|||
//} |
|||
</style> |
@ -0,0 +1,857 @@ |
|||
<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="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 label="监督检查类型" prop="inspectionTypes"> |
|||
<el-select |
|||
v-model="queryParams.data.inspectionTypes" |
|||
placeholder="请选择监督检查类型" |
|||
clearable |
|||
size="small" |
|||
@change="handleQuery" |
|||
> |
|||
<el-option |
|||
v-for="dict in inspectionTypesOptions" |
|||
: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="['warn:inspections: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="['warn:inspections: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="['warn:inspections:remove']" |
|||
>删除</el-button |
|||
> |
|||
</el-col> |
|||
|
|||
<right-toolbar |
|||
:showSearch.sync="showSearch" |
|||
@queryTable="getList" |
|||
></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table |
|||
v-loading="loading" |
|||
:data="inspectionsList" |
|||
@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="projectName" |
|||
min-width="120" |
|||
/> |
|||
<!-- <el-table-column |
|||
label="监督检查类型" |
|||
align="center" |
|||
prop="inspectionTypes" |
|||
:formatter="inspectionTypesFormat" |
|||
min-width="120" |
|||
/> --> |
|||
<el-table-column |
|||
label="检查时间" |
|||
align="center" |
|||
prop="inspectionTime" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<span>{{ parseTime(scope.row.inspectionTime, "{y}-{m}-{d}") }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="检查人" |
|||
align="center" |
|||
prop="inspectionPerson" |
|||
min-width="120" |
|||
/> |
|||
|
|||
<el-table-column |
|||
label="通知文件" |
|||
align="center" |
|||
prop="noticeAttachment" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse(scope.row.noticeAttachment)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.noticeAttachment, index)" |
|||
style="cursor: pointer" |
|||
></i> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="检查表" |
|||
align="center" |
|||
prop="checklist" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse(scope.row.checklist)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.checklist, index)" |
|||
style="cursor: pointer" |
|||
></i> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="整改报告" |
|||
align="center" |
|||
prop="rectificationReport" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse(scope.row.rectificationReport)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.rectificationReport, 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="['warn:inspections:edit']" |
|||
>修改</el-button |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['warn:inspections: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="1400px" |
|||
append-to-body |
|||
:close-on-click-modal="false" |
|||
> |
|||
<div class="listTitle" style="margin-top: 0"> |
|||
<span>市场监管专项检查信息</span> |
|||
</div> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="110px"> |
|||
<el-form-item label="项目名称" prop="projectName"> |
|||
<el-select |
|||
v-model="form.projectName" |
|||
placeholder="请输入项目名称" |
|||
filterable |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in projectNameOptions" |
|||
:key="dict.projectName + dict.id" |
|||
:label="dict.projectName + '[' + dict.proCode + ']'" |
|||
:value="dict.projectName + '[' + dict.proCode + ']'" |
|||
@click.native="getId(dict)" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item label="监督检查类型" prop="inspectionTypes"> |
|||
<el-select |
|||
v-model="form.inspectionTypes" |
|||
placeholder="请选择监督检查类型" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in inspectionTypesOptions" |
|||
:key="dict.dictValue" |
|||
:label="dict.dictLabel" |
|||
:value="dict.dictValue" |
|||
></el-option> |
|||
</el-select> |
|||
</el-form-item> --> |
|||
<el-form-item label="检查时间" prop="inspectionTime"> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
v-model="form.inspectionTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择检查时间" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="检查人" prop="inspectionPerson"> |
|||
<el-input |
|||
v-model="form.inspectionPerson" |
|||
placeholder="请输入检查人" |
|||
/> |
|||
</el-form-item> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<el-form-item label="检查通知" prop="noticeAttachment"> |
|||
<!-- <el-input |
|||
v-model="form.noticeAttachment" |
|||
placeholder="请输入通知文件" |
|||
/> --> |
|||
<el-upload |
|||
class="upload-demo" |
|||
action="thinking/common/upload" |
|||
:headers="headers" |
|||
:before-upload="(file) => $fileBeforeUpload(file, 'fileList1')" |
|||
:on-preview="handlePreview" |
|||
:on-remove="(file) => handleOpinionRemove(file, 'fileList1')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(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="8"> |
|||
<el-form-item label="整改通知" prop="checklist"> |
|||
<!-- <el-input v-model="form.checklist" placeholder="请输入检查表" /> --> |
|||
<el-upload |
|||
class="upload-demo" |
|||
action="thinking/common/upload" |
|||
:headers="headers" |
|||
:before-upload="(file) => $fileBeforeUpload(file, 'fileList2')" |
|||
:on-preview="handlePreview" |
|||
:on-remove="(file) => handleOpinionRemove(file, 'fileList2')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(fileList, 'fileList2') |
|||
" |
|||
: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-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="整改报告" prop="rectificationReport"> |
|||
<!-- <el-input |
|||
v-model="form.rectificationReport" |
|||
placeholder="请输入整改报告" |
|||
/> --> |
|||
<el-upload |
|||
class="upload-demo" |
|||
action="thinking/common/upload" |
|||
:headers="headers" |
|||
:before-upload="(file) => $fileBeforeUpload(file, 'fileList3')" |
|||
:on-preview="handlePreview" |
|||
:on-remove="(file) => handleOpinionRemove(file, 'fileList3')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(fileList, 'fileList3') |
|||
" |
|||
: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-col> |
|||
</el-row> |
|||
</el-form> |
|||
<div v-if="form.id"> |
|||
<div class="listTitle" style="margin-top: 0"> |
|||
<span>责令限期整改通知书列表</span> |
|||
</div> |
|||
<editPart |
|||
:inspectionId="form.id" |
|||
:proNo="form.proNo" |
|||
:proCode="form.proCode" |
|||
/> |
|||
</div> |
|||
<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 { |
|||
listInspections, |
|||
getInspections, |
|||
delInspections, |
|||
addInspections, |
|||
updateInspections, |
|||
exportInspections, |
|||
} from "@/api/warn/inspections"; |
|||
import { listInfo, getInfo } from "@/api/build/projectInfo"; |
|||
import { getToken } from "@/utils/auth"; |
|||
import { getFileStream } from "@/api/system/upload"; |
|||
import editPart from "./editPart.vue"; |
|||
|
|||
export default { |
|||
name: "Inspections", |
|||
components: { |
|||
editPart, |
|||
}, |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 监管检查表格数据 |
|||
inspectionsList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 监督检查类型字典 |
|||
inspectionTypesOptions: [], |
|||
|
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
menuType: null, |
|||
inspectionTypes: null, |
|||
inspectionTime: null, |
|||
inspectionPerson: null, |
|||
noticeAttachment: null, |
|||
checklist: null, |
|||
rectificationReport: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 查询参数 |
|||
othersParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
isMajor: null, |
|||
projectName: null, |
|||
unitLeader: null, |
|||
projectLegalPerson: null, |
|||
projectLegalUnit: null, |
|||
projectLegalPhone: null, |
|||
engineeringGrade: null, |
|||
engineeringPurposes: null, |
|||
workCategory: null, |
|||
constructionAddress: null, |
|||
constructionMode: null, |
|||
constructionNature: null, |
|||
constructionContent: null, |
|||
adcd: null, |
|||
basin: null, |
|||
projectType: null, |
|||
centralArrangedFunds: null, |
|||
centralArrangedFundsRate: null, |
|||
provincialFunding: null, |
|||
provincialFundingRate: null, |
|||
cityLevelFunds: null, |
|||
cityLevelFundsRate: null, |
|||
countyLevelFunds: null, |
|||
countyLevelFundsRate: null, |
|||
townshipInvestments: null, |
|||
townshipInvestmentsRate: null, |
|||
isMajorProject: null, |
|||
investmentSubject: null, |
|||
constructionPhase: null, |
|||
fundingNumber: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
createUid: null, |
|||
createTime: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
inspectionPerson: [ |
|||
{ max: 250, message: "字符长度最大为250", trigger: "blur" }, |
|||
], |
|||
projectName: [ |
|||
{ |
|||
required: true, |
|||
message: "请选择项目", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
}, |
|||
//项目名称 |
|||
projectNameOptions: [], |
|||
proCode: "", |
|||
proNo: "", |
|||
// 面包屑,路由信息 |
|||
routeList: [ |
|||
{ |
|||
path: "/evaluationEarlyWarning/supervisionInspection/regulatoryInspection", |
|||
routeName: "市场监管专项检查", |
|||
}, |
|||
], |
|||
// 请求头 |
|||
headers: { |
|||
jianwei: "jwtech " + getToken(), |
|||
}, |
|||
fileList1: [], |
|||
fileList2: [], |
|||
fileList3: [], |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
this.getDicts("supervisory_inspection_type").then((response) => { |
|||
this.inspectionTypesOptions = response.data; |
|||
}); |
|||
|
|||
listInfo(this.othersParams).then((response) => { |
|||
this.projectNameOptions = response.records; |
|||
}); |
|||
}, |
|||
methods: { |
|||
getId(res) { |
|||
// console.log(res) |
|||
getInfo(res.id).then((response) => { |
|||
console.log(response.data); |
|||
this.proNo = response.data.proNo; |
|||
this.proCode = response.data.proCode; |
|||
}); |
|||
}, |
|||
/** 查询监管检查列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
this.queryParams.data.menuType = "2"; |
|||
listInspections(this.queryParams).then((response) => { |
|||
this.inspectionsList = response.records; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
// 监督检查类型字典翻译 |
|||
inspectionTypesFormat(row, column) { |
|||
return this.selectDictLabel( |
|||
this.inspectionTypesOptions, |
|||
row.inspectionTypes |
|||
); |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.fileList1 = []; |
|||
this.fileList2 = []; |
|||
this.fileList3 = []; |
|||
this.form = { |
|||
id: null, |
|||
menuType: null, |
|||
inspectionTypes: null, |
|||
inspectionTime: null, |
|||
inspectionPerson: null, |
|||
noticeAttachment: null, |
|||
checklist: null, |
|||
rectificationReport: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
remark: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
id: null, |
|||
menuType: null, |
|||
inspectionTypes: null, |
|||
inspectionTime: null, |
|||
inspectionPerson: null, |
|||
noticeAttachment: null, |
|||
checklist: null, |
|||
rectificationReport: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
remark: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sort: "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; |
|||
getInspections(id).then((response) => { |
|||
this.form = response.data; |
|||
this.form.projectName = |
|||
this.form.projectName + "[" + this.form.proCode + "]"; |
|||
if (this.form.noticeAttachment) { |
|||
this.fileList1 = JSON.parse(this.form.noticeAttachment); |
|||
} |
|||
if (this.form.checklist) { |
|||
this.fileList2 = JSON.parse(this.form.checklist); |
|||
} |
|||
if (this.form.rectificationReport) { |
|||
this.fileList3 = JSON.parse(this.form.rectificationReport); |
|||
} |
|||
this.open = true; |
|||
this.title = "修改市场监管专项检查"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate((valid) => { |
|||
if (valid) { |
|||
if (this.proNo) { |
|||
this.form.proNo = this.proNo; |
|||
} |
|||
if (this.proCode) { |
|||
this.form.proCode = this.proCode; |
|||
} |
|||
this.form.noticeAttachment = JSON.stringify(this.fileList1); |
|||
this.form.checklist = JSON.stringify(this.fileList2); |
|||
this.form.rectificationReport = JSON.stringify(this.fileList3); |
|||
if (this.form.id != null) { |
|||
updateInspections(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
this.form.menuType = "2"; |
|||
addInspections(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 delInspections(ids); |
|||
}) |
|||
.then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}) |
|||
.catch(function () {}); |
|||
} else { |
|||
this.$message.warning("请选择要删除的数据!!"); |
|||
} |
|||
}, |
|||
// 上传意见附件 |
|||
submitOpinionUpload(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]); |
|||
}, |
|||
handleOpinionRemove(file, name) { |
|||
// console.log(file, fileList1); |
|||
let index = this[name].findIndex((item) => item.uid === file.uid); |
|||
// 删除文件 |
|||
this[name].splice(index, 1); |
|||
}, |
|||
// 表格中下载 |
|||
downloadFile(fileList, index) { |
|||
console.log(fileList); |
|||
let file = JSON.parse(fileList)[index]; |
|||
this.handlePreview(file); |
|||
}, |
|||
// 点击预览的文件进行下载 |
|||
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); //创建新的URL表示指定的blob对象 |
|||
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"; |
|||
::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> |
@ -0,0 +1,582 @@ |
|||
<template> |
|||
<div> |
|||
<!-- <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="['warn:zrdw: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="['warn:zrdw: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="['warn:zrdw:remove']" |
|||
>删除</el-button |
|||
> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="warning" |
|||
icon="el-icon-download" |
|||
size="mini" |
|||
@click="handleExport" |
|||
v-hasPermi="['warn:zrdw:export']" |
|||
>导出</el-button |
|||
> |
|||
</el-col> |
|||
<right-toolbar |
|||
:showSearch.sync="showSearch" |
|||
@queryTable="getList" |
|||
></right-toolbar> |
|||
</el-row> --> |
|||
|
|||
<el-table v-loading="loading" :data="zrdwList" border> |
|||
<!-- <el-table-column |
|||
label="监管id" |
|||
align="center" |
|||
prop="inspectionId" |
|||
min-width="120" |
|||
/> --> |
|||
<el-table-column |
|||
label="责任单位" |
|||
align="center" |
|||
prop="unitId" |
|||
:formatter="unitIdFormat" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="整改完成内容" |
|||
align="center" |
|||
prop="rectificationSituation" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="整改完成情况" |
|||
align="center" |
|||
prop="isFinish" |
|||
:formatter="isFinishFormat" |
|||
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)" |
|||
:key="item + index" |
|||
> |
|||
<i class="el-icon-document"></i> |
|||
{{ item.name }} |
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile(scope.row.attachment, 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="['warn:zrdw:edit']" |
|||
>修改</el-button |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['warn:zrdw:remove']" |
|||
>删除</el-button |
|||
> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-button |
|||
type="text" |
|||
icon="el-icon-plus" |
|||
size="medium" |
|||
@click="handleAdd" |
|||
v-hasPermi="['warn:zrdw:add']" |
|||
>添加责任单位</el-button |
|||
> |
|||
<!-- <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="1000px" |
|||
append-to-body |
|||
:close-on-click-modal="false" |
|||
> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="110px"> |
|||
<!-- <el-form-item label="监管id" prop="inspectionId"> |
|||
<el-input v-model="form.inspectionId" placeholder="请输入监管id" /> |
|||
</el-form-item> --> |
|||
<el-form-item label="责任单位" prop="unitId"> |
|||
<!-- <el-input v-model="form.unitId" placeholder="请输入单位id" /> --> |
|||
<el-select |
|||
v-model="form.unitId" |
|||
placeholder="请选择责任单位" |
|||
filterable |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in unitOptions" |
|||
:key="dict.id + dict.enterpriseName" |
|||
:label="dict.enterpriseName" |
|||
:value="dict.id" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="整改完成内容" prop="rectificationSituation"> |
|||
<el-input |
|||
v-model="form.rectificationSituation" |
|||
placeholder="请输入整改完成内容" |
|||
type="textarea" |
|||
/> |
|||
<!-- <el-select |
|||
v-model="form.rectificationSituation" |
|||
placeholder="请输入项目名称" |
|||
filterable |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in rectificationSituationOptions" |
|||
:key="dict.dictValue" |
|||
:label="dict.dictLabel" |
|||
:value="dict.dictValue" |
|||
/> |
|||
</el-select> --> |
|||
</el-form-item> |
|||
<el-form-item label="整改完成情况" prop="isFinish" v-if="isEdit"> |
|||
<!-- <el-input |
|||
v-model="form.isFinish" |
|||
placeholder="请输入整改完成情况" |
|||
/> --> |
|||
<el-select |
|||
v-model="form.isFinish" |
|||
placeholder="请选择整改完成情况" |
|||
filterable |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in isFinishOptions" |
|||
:key="dict.dictValue" |
|||
:label="dict.dictLabel" |
|||
:value="dict.dictValue" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="附件" prop="attachment" v-if="isEdit"> |
|||
<!-- <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) => handleOpinionRemove(file, 'fileList1')" |
|||
:before-remove="beforeRemove" |
|||
multiple |
|||
:on-exceed="handleExceed" |
|||
:on-success=" |
|||
(_, fileList) => submitOpinionUpload(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-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 { |
|||
listZrdw, |
|||
getZrdw, |
|||
delZrdw, |
|||
addZrdw, |
|||
updateZrdw, |
|||
exportZrdw, |
|||
} from "@/api/warn/zrdw"; |
|||
import { listInfo } from "@/api/build/enteInfo"; |
|||
import { getToken } from "@/utils/auth"; |
|||
import { getFileStream } from "@/api/system/upload"; |
|||
|
|||
export default { |
|||
name: "Zrdw", |
|||
props: ["inspectionId", "rectificationId", "proNo", "proCode", "isAdd"], |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: false, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 责任单位表格数据 |
|||
zrdwList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 整改完成情况字典 |
|||
isFinishOptions: [], |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
inspectionId: null, |
|||
rectificationId: null, |
|||
unitId: null, |
|||
rectificationSituation: null, |
|||
isFinish: null, |
|||
attachment: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 查询参数 |
|||
unitParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sort: "desc", |
|||
}, |
|||
}, |
|||
unitOptions: [], |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
rectificationSituation: [ |
|||
{ max: 65500, message: "字符长度最大为65500", trigger: "blur" }, |
|||
], |
|||
}, |
|||
// 请求头 |
|||
headers: { |
|||
jianwei: "jwtech " + getToken(), |
|||
}, |
|||
fileList1: [], |
|||
isEdit: false, |
|||
}; |
|||
}, |
|||
created() { |
|||
if (!this.isAdd) this.getList(); |
|||
this.getUnit(); |
|||
this.getDicts("rectification_completion").then((response) => { |
|||
this.isFinishOptions = response.data; |
|||
}); |
|||
}, |
|||
methods: { |
|||
getUnit() { |
|||
this.unitParams.data.proNo = this.proNo; |
|||
this.unitParams.data.proCode = this.proCode; |
|||
listInfo(this.unitParams).then((response) => { |
|||
this.unitOptions = response.data.enterpriseInfoList; |
|||
// console.log(88888888888, this.unitOptions); |
|||
}); |
|||
}, |
|||
/** 查询责任单位列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
this.queryParams.data.inspectionId = this.inspectionId; |
|||
this.queryParams.data.rectificationId = this.rectificationId; |
|||
listZrdw(this.queryParams).then((response) => { |
|||
this.zrdwList = response.records; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
isFinishFormat(row) { |
|||
return this.selectDictLabel(this.isFinishOptions, row.isFinish); |
|||
}, |
|||
unitIdFormat(row) { |
|||
return this.unitOptions.find((item) => item.id == row.unitId) |
|||
?.enterpriseName; |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.fileList1 = []; |
|||
this.form = { |
|||
id: null, |
|||
inspectionId: null, |
|||
rectificationId: null, |
|||
unitId: null, |
|||
rectificationSituation: null, |
|||
attachment: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
id: null, |
|||
inspectionId: null, |
|||
rectificationId: null, |
|||
unitId: null, |
|||
rectificationSituation: null, |
|||
attachment: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
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.isEdit = false; |
|||
this.open = true; |
|||
this.title = "添加责任单位"; |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset(); |
|||
this.isEdit = true; |
|||
const id = row.id || this.ids; |
|||
getZrdw(id).then((response) => { |
|||
this.form = response.data; |
|||
if (this.form.attachment) { |
|||
this.fileList1 = JSON.parse(this.form.attachment); |
|||
} |
|||
this.open = true; |
|||
this.title = "修改责任单位"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate((valid) => { |
|||
if (valid) { |
|||
this.form.attachment = JSON.stringify(this.fileList1); |
|||
if (this.form.id != null) { |
|||
updateZrdw(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
this.form.inspectionId = this.inspectionId; |
|||
this.form.rectificationId = this.rectificationId; |
|||
this.form.isFinish = "0"; |
|||
addZrdw(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 delZrdw(ids); |
|||
}) |
|||
.then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}) |
|||
.catch(function () {}); |
|||
} else { |
|||
this.$message.warning("请选择要删除的数据!!"); |
|||
} |
|||
}, |
|||
// 上传意见附件 |
|||
submitOpinionUpload(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]); |
|||
}, |
|||
handleOpinionRemove(file, name) { |
|||
// console.log(file, fileList1); |
|||
let index = this[name].findIndex((item) => item.uid === file.uid); |
|||
// 删除文件 |
|||
this[name].splice(index, 1); |
|||
}, |
|||
// 表格中下载 |
|||
downloadFile(fileList, index) { |
|||
console.log(fileList); |
|||
let file = JSON.parse(fileList)[index]; |
|||
this.handlePreview(file); |
|||
}, |
|||
// 点击预览的文件进行下载 |
|||
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); //创建新的URL表示指定的blob对象 |
|||
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"; |
|||
//::v-deep { |
|||
// .el-dialog { |
|||
// margin-top: 10vh !important; |
|||
// } |
|||
//} |
|||
</style> |
File diff suppressed because it is too large
Loading…
Reference in new issue