fix:协议管理页面编辑按钮失效修改
This commit is contained in:
parent
ab8bd22d41
commit
c58b78a130
|
|
@ -30,11 +30,7 @@
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="往来单位" prop="unitId">
|
<el-form-item label="往来单位" prop="unitId">
|
||||||
<el-select
|
<el-select v-model="queryParams.unitId" placeholder="请选择往来单位" clearable>
|
||||||
v-model="queryParams.unitId"
|
|
||||||
placeholder="请选择往来单位"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(item, i) in unitList"
|
v-for="(item, i) in unitList"
|
||||||
:key="i"
|
:key="i"
|
||||||
|
|
@ -44,11 +40,7 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="工程名称" prop="projectId">
|
<el-form-item label="工程名称" prop="projectId">
|
||||||
<el-select
|
<el-select v-model="queryParams.projectId" placeholder="请选择工程名称" clearable>
|
||||||
v-model="queryParams.projectId"
|
|
||||||
placeholder="请选择工程名称"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(item, i) in projectList"
|
v-for="(item, i) in projectList"
|
||||||
:key="i"
|
:key="i"
|
||||||
|
|
@ -58,33 +50,15 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
|
||||||
type="primary"
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新建</el-button>
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
>新建</el-button
|
|
||||||
>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<!-- <el-col :span="1.5">-->
|
<!-- <el-col :span="1.5">-->
|
||||||
|
|
@ -110,33 +84,14 @@
|
||||||
<!-- >删除</el-button>-->
|
<!-- >删除</el-button>-->
|
||||||
<!-- </el-col>-->
|
<!-- </el-col>-->
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
>导出</el-button
|
|
||||||
>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
:showSearch.sync="showSearch"
|
|
||||||
@queryTable="getList"
|
|
||||||
></right-toolbar>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table
|
<el-table v-loading="loading" :data="agreementList" @selection-change="handleSelectionChange">
|
||||||
v-loading="loading"
|
|
||||||
:data="agreementList"
|
|
||||||
@selection-change="handleSelectionChange"
|
|
||||||
>
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column
|
<el-table-column label="序号" align="center" type="index" width="60" />
|
||||||
label="序号"
|
|
||||||
align="center"
|
|
||||||
type="index"
|
|
||||||
width="60"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="协议编号"
|
label="协议编号"
|
||||||
align="center"
|
align="center"
|
||||||
|
|
@ -149,24 +104,9 @@
|
||||||
prop="contractCode"
|
prop="contractCode"
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column label="附件图片" align="center" prop="fileName" :show-overflow-tooltip="true" />
|
||||||
label="附件图片"
|
<el-table-column label="签订日期" align="center" prop="signTime" :show-overflow-tooltip="true" />
|
||||||
align="center"
|
<el-table-column label="往来单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
|
||||||
prop="fileName"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="签订日期"
|
|
||||||
align="center"
|
|
||||||
prop="signTime"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="往来单位"
|
|
||||||
align="center"
|
|
||||||
prop="unitName"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="工程名称"
|
label="工程名称"
|
||||||
align="center"
|
align="center"
|
||||||
|
|
@ -185,45 +125,23 @@
|
||||||
prop="leaseDay"
|
prop="leaseDay"
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column label="授权人" align="center" prop="authPerson" :show-overflow-tooltip="true" />
|
||||||
label="授权人"
|
<el-table-column label="联系电话 " align="center" prop="phone" :show-overflow-tooltip="true" />
|
||||||
align="center"
|
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||||
prop="authPerson"
|
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="联系电话 "
|
|
||||||
align="center"
|
|
||||||
prop="phone"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="备注"
|
|
||||||
align="center"
|
|
||||||
prop="remark"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="操作"
|
|
||||||
align="center"
|
|
||||||
width="200"
|
|
||||||
class-name="small-padding fixed-width"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
>编辑</el-button
|
>编辑</el-button>
|
||||||
>
|
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="danger"
|
type="danger"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
>删除</el-button
|
>删除</el-button>
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -244,30 +162,16 @@
|
||||||
append-to-body
|
append-to-body
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
>
|
>
|
||||||
<el-form
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||||
ref="form"
|
|
||||||
:model="form"
|
|
||||||
:rules="rules"
|
|
||||||
label-width="120px"
|
|
||||||
>
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="合同编号" prop="contractCode">
|
<el-form-item label="合同编号" prop="contractCode">
|
||||||
<el-input
|
<el-input maxlength="50" v-model="form.contractCode" placeholder="合同编号" />
|
||||||
maxlength="50"
|
|
||||||
v-model="form.contractCode"
|
|
||||||
placeholder="合同编号"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="往来单位" prop="unitId">
|
<el-form-item label="往来单位" prop="unitId">
|
||||||
<el-select
|
<el-select v-model="form.unitId" filterable placeholder="请选择往来单位" style="width: 100%">
|
||||||
v-model="form.unitId"
|
|
||||||
filterable
|
|
||||||
placeholder="请选择往来单位"
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in unitList"
|
v-for="item in unitList"
|
||||||
:key="item.unitId"
|
:key="item.unitId"
|
||||||
|
|
@ -355,11 +259,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="授权人" prop="authPerson">
|
<el-form-item label="授权人" prop="authPerson">
|
||||||
<el-input
|
<el-input maxlength="50" v-model="form.authPerson" placeholder="请输入授权人" />
|
||||||
maxlength="50"
|
|
||||||
v-model="form.authPerson"
|
|
||||||
placeholder="请输入授权人"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
@ -367,20 +267,12 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="联系方式" prop="phone">
|
<el-form-item label="联系方式" prop="phone">
|
||||||
<el-input
|
<el-input maxlength="50" v-model="form.phone" placeholder="请输入联系方式" />
|
||||||
v-model="form.phone"
|
|
||||||
placeholder="请输入联系方式"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" maxlength="200" />
|
||||||
v-model="form.remark"
|
|
||||||
type="textarea"
|
|
||||||
placeholder="请输入备注"
|
|
||||||
maxlength="200"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
@ -389,8 +281,7 @@
|
||||||
<el-col :span="20">
|
<el-col :span="20">
|
||||||
<el-form-item label="合同照片" prop="fileName">
|
<el-form-item label="合同照片" prop="fileName">
|
||||||
<el-upload
|
<el-upload
|
||||||
:http-request="
|
:http-request="(obj) => imgUpLoad(obj, 'fileUrl')
|
||||||
(obj) => imgUpLoad(obj, 'fileUrl')
|
|
||||||
"
|
"
|
||||||
action="#"
|
action="#"
|
||||||
:limit="5"
|
:limit="5"
|
||||||
|
|
@ -401,10 +292,9 @@
|
||||||
:on-success="handleAvatarSuccess"
|
:on-success="handleAvatarSuccess"
|
||||||
:on-preview="handlePictureCardPreview"
|
:on-preview="handlePictureCardPreview"
|
||||||
:on-remove="handleRemove"
|
:on-remove="handleRemove"
|
||||||
|
:on-exceed="handleExceed"
|
||||||
>
|
>
|
||||||
<i
|
<i class="el-icon-plus avatar-uploader-icon"></i>
|
||||||
class="el-icon-plus avatar-uploader-icon"
|
|
||||||
></i>
|
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -417,7 +307,7 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog :visible.sync="dialogVisible">
|
<el-dialog :visible.sync="dialogVisible">
|
||||||
<img width="100%" height="650px" :src="dialogImageUrl" alt="" />
|
<img width="100%" height="650px" :src="dialogImageUrl" alt />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -430,13 +320,13 @@
|
||||||
updateAgreement,
|
updateAgreement,
|
||||||
removeAgreement,
|
removeAgreement,
|
||||||
getUnitList,
|
getUnitList,
|
||||||
getProjectList,
|
getProjectList
|
||||||
} from '@/api/claimAndRefund/receive'
|
} from "@/api/claimAndRefund/receive";
|
||||||
import { imgUpLoad, fileUpLoad } from '@/api/system/upload'
|
import { imgUpLoad, fileUpLoad } from "@/api/system/upload";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Agreement',
|
name: "Agreement",
|
||||||
dicts: ['sys_normal_disable'],
|
dicts: ["sys_normal_disable"],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
|
|
@ -459,11 +349,11 @@
|
||||||
agreementList: [],
|
agreementList: [],
|
||||||
|
|
||||||
protocolList: [
|
protocolList: [
|
||||||
{ protocolId: 1, protocolName: '内部单位' },
|
{ protocolId: 1, protocolName: "内部单位" },
|
||||||
{ protocolId: 2, protocolName: '外部单位' },
|
{ protocolId: 2, protocolName: "外部单位" }
|
||||||
],
|
],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: '',
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
// 日期范围
|
// 日期范围
|
||||||
|
|
@ -473,104 +363,104 @@
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
keyWord: undefined,
|
keyWord: undefined,
|
||||||
agreementCode: '',
|
agreementCode: "",
|
||||||
projectId: '',
|
projectId: "",
|
||||||
unitId: '',
|
unitId: ""
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
//图片上传
|
//图片上传
|
||||||
uploadHeader: process.env.VUE_APP_BASE_API,
|
uploadHeader: process.env.VUE_APP_BASE_API,
|
||||||
imageUrl: '',
|
imageUrl: "",
|
||||||
imageName: '',
|
imageName: "",
|
||||||
fileList: [],
|
fileList: [],
|
||||||
checkUrlList: [],
|
checkUrlList: [],
|
||||||
checkUrlNameList: [],
|
checkUrlNameList: [],
|
||||||
dialogImageUrl: '',
|
dialogImageUrl: "",
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
//上传地址
|
//上传地址
|
||||||
// uploadUrl:'http://192.168.0.14:21624/system',//线上服务器地址+system
|
// uploadUrl:'http://192.168.0.14:21624/system',//线上服务器地址+system
|
||||||
// uploadUrl:'http://112.29.103.165:21624/system',//线上服务器地址+system
|
// uploadUrl:'http://112.29.103.165:21624/system',//线上服务器地址+system
|
||||||
uploadUrl: process.env.VUE_APP_BASE_API + '/system', // 上传的图片服务器地址
|
uploadUrl: process.env.VUE_APP_BASE_API + "/system", // 上传的图片服务器地址
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
contractCode: [
|
contractCode: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '合同编号不能为空',
|
message: "合同编号不能为空",
|
||||||
trigger: 'blur',
|
trigger: "blur"
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
signTime: [
|
signTime: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '签订日期不能为空',
|
message: "签订日期不能为空",
|
||||||
trigger: 'blur',
|
trigger: "blur"
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
unitId: [
|
unitId: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '往来单位不能为空',
|
message: "往来单位不能为空",
|
||||||
trigger: 'blur',
|
trigger: "blur"
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
projectId: [
|
projectId: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '工程名称不能为空',
|
message: "工程名称不能为空",
|
||||||
trigger: 'blur',
|
trigger: "blur"
|
||||||
},
|
}
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
peopleOpen: false,
|
peopleOpen: false,
|
||||||
noticeOpen: false,
|
noticeOpen: false,
|
||||||
nform: {
|
nform: {
|
||||||
notice: '',
|
notice: ""
|
||||||
},
|
},
|
||||||
nrules: {
|
nrules: {
|
||||||
notice: [
|
notice: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '通知内容不能为空',
|
message: "通知内容不能为空",
|
||||||
trigger: 'blur',
|
trigger: "blur"
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
deptName: undefined,
|
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
deptName: undefined
|
||||||
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList()
|
this.getList();
|
||||||
this.getUnitList()
|
this.getUnitList();
|
||||||
this.getProjectList()
|
this.getProjectList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//获取单位类型 ,getUnitList, getProjectList
|
//获取单位类型 ,getUnitList, getProjectList
|
||||||
getUnitList() {
|
getUnitList() {
|
||||||
getUnitList().then((response) => {
|
getUnitList().then(response => {
|
||||||
this.unitList = response.data
|
this.unitList = response.data;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
getProjectList() {
|
getProjectList() {
|
||||||
getProjectList().then((response) => {
|
getProjectList().then(response => {
|
||||||
this.projectList = response.data
|
this.projectList = response.data;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 查询字典类型列表 */
|
/** 查询字典类型列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true
|
this.loading = true;
|
||||||
getAgreementList(this.queryParams).then((response) => {
|
getAgreementList(this.queryParams).then(response => {
|
||||||
this.agreementList = response.rows
|
this.agreementList = response.rows;
|
||||||
this.total = response.total
|
this.total = response.total;
|
||||||
this.loading = false
|
this.loading = false;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false
|
this.open = false;
|
||||||
this.reset()
|
this.reset();
|
||||||
},
|
},
|
||||||
// 表单重置
|
// 表单重置
|
||||||
reset() {
|
reset() {
|
||||||
|
|
@ -580,167 +470,182 @@
|
||||||
dictType: undefined,
|
dictType: undefined,
|
||||||
fileUrl: undefined,
|
fileUrl: undefined,
|
||||||
fileName: undefined,
|
fileName: undefined,
|
||||||
status: '0',
|
status: "0",
|
||||||
remark: undefined,
|
remark: undefined
|
||||||
}
|
};
|
||||||
this.fileList = []
|
this.fileList = [];
|
||||||
this.resetForm('form')
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.getList()
|
this.getList();
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
// this.dateRange = []
|
// this.dateRange = []
|
||||||
this.resetForm('queryForm')
|
this.resetForm("queryForm");
|
||||||
this.queryParams.pageNum = 1
|
this.queryParams.pageNum = 1;
|
||||||
this.queryParams.pageSize = 10
|
this.queryParams.pageSize = 10;
|
||||||
this.getList()
|
this.getList();
|
||||||
// this.handleQuery()
|
// this.handleQuery()
|
||||||
},
|
},
|
||||||
handleNotice() {
|
handleNotice() {
|
||||||
this.noticeOpen = true
|
this.noticeOpen = true;
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset()
|
this.reset();
|
||||||
this.fileList = []
|
this.fileList = [];
|
||||||
this.checkUrlList = []
|
this.checkUrlList = [];
|
||||||
this.checkUrlNameList = []
|
this.checkUrlNameList = [];
|
||||||
this.open = true
|
this.open = true;
|
||||||
this.title = '新建'
|
this.title = "新建";
|
||||||
},
|
},
|
||||||
// 图片上传
|
// 图片上传
|
||||||
imgUpLoad(param, name, index) {
|
imgUpLoad(param, name, index) {
|
||||||
// console.log(param,'image')
|
// console.log(param,'image')
|
||||||
param.type = 'ma'
|
param.type = "ma";
|
||||||
imgUpLoad(param)
|
imgUpLoad(param)
|
||||||
.then((res) => {
|
.then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.checkUrlList.push(res.data.fileUrl)
|
this.checkUrlList.push(res.data.fileUrl);
|
||||||
this.checkUrlNameList.push(res.data.fileName)
|
this.checkUrlNameList.push(res.data.fileName);
|
||||||
} else {
|
} else {
|
||||||
// this.$msgError(res.msg)
|
// this.$msgError(res.msg)
|
||||||
this.$modal.msgError(res.msg)
|
this.$modal.msgError(res.msg);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch(error => {
|
||||||
// this.$msgError(error)
|
// this.$msgError(error)
|
||||||
this.$modal.msgError(error)
|
this.$modal.msgError(error);
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
handleAvatarSuccess(res, file) {
|
handleAvatarSuccess(res, file) {
|
||||||
console.log('success')
|
console.log("success");
|
||||||
|
},
|
||||||
|
handleExceed(files, fileList) {
|
||||||
|
this.$message.warning("最多只可以上传五张图片");
|
||||||
},
|
},
|
||||||
handleRemove(file, fileList) {
|
handleRemove(file, fileList) {
|
||||||
let sum = 0
|
let sum = 0;
|
||||||
this.checkUrlNameList.forEach((item, index) => {
|
this.checkUrlNameList.forEach((item, index) => {
|
||||||
if (item == file.name) {
|
if (item == file.name) {
|
||||||
sum = index
|
sum = index;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
this.checkUrlNameList.splice(sum, 1)
|
this.checkUrlNameList.splice(sum, 1);
|
||||||
this.checkUrlList.splice(sum, 1)
|
this.checkUrlList.splice(sum, 1);
|
||||||
},
|
},
|
||||||
//图片点击查看
|
//图片点击查看
|
||||||
handlePictureCardPreview(file) {
|
handlePictureCardPreview(file) {
|
||||||
console.log(file)
|
console.log(file);
|
||||||
this.dialogImageUrl = file.url
|
this.dialogImageUrl = file.url;
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true;
|
||||||
},
|
},
|
||||||
//图片查看
|
//图片查看
|
||||||
openImg(url) {
|
openImg(url) {
|
||||||
this.dialogImageUrl = this.uploadUrl + url
|
this.dialogImageUrl = this.uploadUrl + url;
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true;
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map((item) => item.agreementId)
|
this.ids = selection.map(item => item.agreementId);
|
||||||
this.single = selection.length != 1
|
this.single = selection.length != 1;
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length;
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset()
|
this.reset();
|
||||||
// const agreementId = row.agreementId
|
// const agreementId = row.agreementId
|
||||||
let param = {
|
let param = {
|
||||||
agreementId: row.agreementId,
|
agreementId: row.agreementId
|
||||||
|
};
|
||||||
|
getAgreementInfoId(param).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.fileList = [];
|
||||||
|
this.checkUrlList = [];
|
||||||
|
this.checkUrlNameList = [];
|
||||||
|
if (
|
||||||
|
response.data &&
|
||||||
|
typeof response.data.fileUrl === "string" &&
|
||||||
|
typeof response.data.fileName === "string"
|
||||||
|
) {
|
||||||
|
try {
|
||||||
|
let [urlArr, nameArr] = [
|
||||||
|
response.data.fileUrl,
|
||||||
|
response.data.fileName
|
||||||
|
].map(str => str.split(","));
|
||||||
|
|
||||||
|
if (urlArr.length !== nameArr.length) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
getAgreementInfoId(param).then((response) => {
|
let fileList = urlArr.map((url, i) => ({
|
||||||
this.form = response.data
|
|
||||||
this.fileList = []
|
|
||||||
this.checkUrlList = []
|
|
||||||
this.checkUrlNameList = []
|
|
||||||
if (response.data.fileUrl != '') {
|
|
||||||
let urlArr = response.data.fileUrl.split(',')
|
|
||||||
let nameArr = response.data.fileName.split(',')
|
|
||||||
for (let i = 0; i < urlArr.length; i++) {
|
|
||||||
let obj = {
|
|
||||||
name: nameArr[i],
|
name: nameArr[i],
|
||||||
url: this.uploadUrl + urlArr[i],
|
url: `${this.uploadUrl}${url}`
|
||||||
}
|
}));
|
||||||
this.fileList.push(obj)
|
this.fileList = fileList;
|
||||||
this.checkUrlList.push(urlArr[i])
|
this.checkUrlList = urlArr;
|
||||||
this.checkUrlNameList.push(nameArr[i])
|
this.checkUrlNameList = nameArr;
|
||||||
|
} catch (error) {
|
||||||
|
console.error("处理合同照片时发生错误:", error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.open = true
|
this.open = true;
|
||||||
this.title = '编辑'
|
this.title = "编辑";
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm: function() {
|
submitForm: function() {
|
||||||
this.form.fileUrl = this.checkUrlList.join(',')
|
this.form.fileUrl = this.checkUrlList.join(",");
|
||||||
this.form.fileName = this.checkUrlNameList.join(',')
|
this.form.fileName = this.checkUrlNameList.join(",");
|
||||||
this.$refs['form'].validate((valid) => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.agreementId != undefined) {
|
if (this.form.agreementId != undefined) {
|
||||||
updateAgreement(this.form).then((response) => {
|
updateAgreement(this.form).then(response => {
|
||||||
this.$modal.msgSuccess('修改成功')
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false
|
this.open = false;
|
||||||
this.getList()
|
this.getList();
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
addAgreement(this.form).then((response) => {
|
addAgreement(this.form).then(response => {
|
||||||
this.$modal.msgSuccess('新增成功')
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false
|
this.open = false;
|
||||||
this.getList()
|
this.getList();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
// const agreementId = row.agreementId;
|
// const agreementId = row.agreementId;
|
||||||
let param = {
|
let param = {
|
||||||
agreementId: row.agreementId + '',
|
agreementId: row.agreementId + ""
|
||||||
}
|
};
|
||||||
this.$modal
|
this.$modal
|
||||||
.confirm('是否确认删除该数据项?')
|
.confirm("是否确认删除该数据项?")
|
||||||
.then(function() {
|
.then(function() {
|
||||||
return removeAgreement(param)
|
return removeAgreement(param);
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.getList()
|
this.getList();
|
||||||
this.$modal.msgSuccess('删除成功')
|
this.$modal.msgSuccess("删除成功");
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
this.download(
|
this.download(
|
||||||
'material/agreementInfo/export',
|
"material/agreementInfo/export",
|
||||||
{
|
{
|
||||||
...this.queryParams,
|
...this.queryParams
|
||||||
},
|
|
||||||
`协议_${new Date().getTime()}.xlsx`,
|
|
||||||
)
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
`协议_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
::v-deep.el-table .fixed-width .el-button--mini {
|
::v-deep.el-table .fixed-width .el-button--mini {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue