更新
This commit is contained in:
parent
021640ed3a
commit
e384bbcb30
@ -1,7 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
size="small"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
<el-form-item label="学员姓名" prop="userName">
|
<el-form-item label="学员姓名" prop="userName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.userName"
|
v-model="queryParams.userName"
|
||||||
@ -11,8 +17,16 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
type="primary"
|
||||||
|
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>
|
||||||
|
|
||||||
@ -25,39 +39,55 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="contractList" @selection-change="handleSelectionChange">
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="contractList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="合同内容" align="center" prop="content">
|
<el-table-column label="合同内容" align="center" prop="content">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button @click="viewContentFun(scope.row.content)" type="text" >查看</el-button>
|
<el-button @click="viewContentFun(scope.row)" type="text"
|
||||||
|
>查看</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="学员姓名" align="center" prop="userName" />
|
<el-table-column label="学员姓名" align="center" prop="userName" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
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="text"
|
type="text"
|
||||||
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>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total > 0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@ -68,7 +98,7 @@
|
|||||||
<el-dialog :title="title" :visible.sync="open" width="750px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="750px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||||
<el-form-item label="合同内容">
|
<el-form-item label="合同内容">
|
||||||
<editor v-model="form.content" :min-height="192"/>
|
<editor v-model="form.content" :min-height="192" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="学员姓名" prop="userName">
|
<el-form-item label="学员姓名" prop="userName">
|
||||||
<el-input v-model="form.userName" placeholder="请输入学员姓名" />
|
<el-input v-model="form.userName" placeholder="请输入学员姓名" />
|
||||||
@ -79,23 +109,41 @@
|
|||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog title="查看" :visible.sync="viewFlag" width="65%" append-to-body>
|
<el-dialog title="查看" :visible.sync="viewFlag" width="65%" append-to-body>
|
||||||
<div style="box-sizing: border-box;padding: 15px;overflow: hidden" v-html="content"></div>
|
<div
|
||||||
|
style="box-sizing: border-box; padding: 15px; overflow: hidden"
|
||||||
|
v-html="content"
|
||||||
|
></div>
|
||||||
|
<div style="text-align: right;" v-if="userUrl">
|
||||||
|
<el-image
|
||||||
|
:src="baseImageUrl + userUrl"
|
||||||
|
fit="cover"
|
||||||
|
:preview-src-list="[baseImageUrl + userUrl]"
|
||||||
|
lazy
|
||||||
|
alt="身份证照片"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listContract, getContract, delContract, addContract, updateContract } from "./api/contract";
|
import {
|
||||||
import editor from '@/components/Editor/index.vue'
|
listContract,
|
||||||
|
getContract,
|
||||||
|
delContract,
|
||||||
|
addContract,
|
||||||
|
updateContract,
|
||||||
|
} from "./api/contract";
|
||||||
|
import editor from "@/components/Editor/index.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Contract",
|
name: "Contract",
|
||||||
components: {editor},
|
components: { editor },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
viewFlag:false,
|
viewFlag: false,
|
||||||
content:"",
|
content: "",
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
@ -121,27 +169,30 @@ export default {
|
|||||||
deptId: null,
|
deptId: null,
|
||||||
userId: null,
|
userId: null,
|
||||||
content: null,
|
content: null,
|
||||||
userName: null
|
userName: null,
|
||||||
},
|
},
|
||||||
|
baseImageUrl: "http://122.51.230.86:9000/",
|
||||||
|
userUrl: "",
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {},
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
viewContentFun(data){
|
viewContentFun(data) {
|
||||||
this.content = data;
|
console.log(data, "111");
|
||||||
this.viewFlag = true
|
this.content = data.content;
|
||||||
|
this.userUrl = data.userUrl;
|
||||||
|
this.viewFlag = true;
|
||||||
},
|
},
|
||||||
/** 查询驾校合同列表 */
|
/** 查询驾校合同列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listContract(this.queryParams).then(response => {
|
listContract(this.queryParams).then((response) => {
|
||||||
this.contractList = response.data.records;
|
this.contractList = response.data.records;
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@ -163,7 +214,7 @@ export default {
|
|||||||
createBy: null,
|
createBy: null,
|
||||||
updateTime: null,
|
updateTime: null,
|
||||||
updateBy: null,
|
updateBy: null,
|
||||||
userName: null
|
userName: null,
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
@ -179,9 +230,9 @@ export default {
|
|||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.id)
|
this.ids = selection.map((item) => item.id);
|
||||||
this.single = selection.length!==1
|
this.single = selection.length !== 1;
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length;
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
@ -192,8 +243,8 @@ export default {
|
|||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
const id = row.id || this.ids
|
const id = row.id || this.ids;
|
||||||
getContract(id).then(response => {
|
getContract(id).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改驾校合同";
|
this.title = "修改驾校合同";
|
||||||
@ -201,16 +252,16 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateContract(this.form).then(response => {
|
updateContract(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addContract(this.form).then(response => {
|
addContract(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
@ -222,19 +273,27 @@ export default {
|
|||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids;
|
const ids = row.id || this.ids;
|
||||||
this.$modal.confirm('是否确认删除驾校合同编号为"' + ids + '"的数据项?').then(function() {
|
this.$modal
|
||||||
return delContract(ids);
|
.confirm('是否确认删除驾校合同编号为"' + ids + '"的数据项?')
|
||||||
}).then(() => {
|
.then(function () {
|
||||||
this.getList();
|
return delContract(ids);
|
||||||
this.$modal.msgSuccess("删除成功");
|
})
|
||||||
}).catch(() => {});
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
this.download('system/driveSchool/contract/export', {
|
this.download(
|
||||||
...this.queryParams
|
"system/driveSchool/contract/export",
|
||||||
}, `contract_${new Date().getTime()}.xlsx`)
|
{
|
||||||
}
|
...this.queryParams,
|
||||||
}
|
},
|
||||||
|
`contract_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user