This commit is contained in:
PQZ 2024-08-08 17:35:27 +08:00
parent 7738a882ba
commit 18c84d27ca
7 changed files with 238 additions and 203 deletions

View File

@ -1,9 +1,9 @@
<template>
<el-alert v-if="enable()" type="success" show-icon>
<template slot="title">
<div @click="goToUrl">{{ '' + title + '文档地址' + url }}</div>
</template>
</el-alert>
<!-- <el-alert v-if="enable()" type="success" show-icon>-->
<!-- <template slot="title">-->
<!-- <div @click="goToUrl">{{ '' + title + '文档地址' + url }}</div>-->
<!-- </template>-->
<!-- </el-alert>-->
</template>
<script>

View File

@ -108,6 +108,12 @@ export const DICT_TYPE = {
DICT_BASE_LABEL_TYPE : 'base_label_type',
//业务分类
DICT_BASE_LABEL_BUSI_TYPE : 'label_busi_type',
//合同模板类型
DICT_BASE_CONT_TEMP_TYPE : 'cont_temp_type',
//合同使用场景
DICT_BASE_CONT_TEMP_USE : 'cont_temp_use',
//合同是否有效
DICT_BASE_CONT_IS_VALID : 'cont_is_valid',
}
/**

View File

@ -1,130 +1,147 @@
<template>
<div class="app-container">
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body>
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="100px">
<el-form-item label="模板编号" prop="tempCode">
<el-input v-model="formData.tempCode" placeholder="请输入模板编号" />
</el-form-item>
<el-form-item label="模板类型" prop="tempType">
<el-select v-model="formData.tempType" placeholder="请选择模板类型">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="模板用途" prop="tempUse">
<el-input v-model="formData.tempUse" placeholder="请输入模板用途" />
</el-form-item>
<el-form-item label="模板名称" prop="tempName">
<el-input v-model="formData.tempName" placeholder="请输入模板名称" />
</el-form-item>
<el-form-item label="是否有效0否1是" prop="isValid">
<el-input v-model="formData.isValid" placeholder="请输入是否有效0否1是" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="formData.status">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="模板内容">
<Editor v-model="formData.tempContent" :min-height="192"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import * as ContTempApi from '@/api/base/cont';
import Editor from '@/components/Editor';
export default {
name: "ContTempForm",
components: {
Editor,
},
data() {
return {
//
dialogTitle: "",
//
dialogVisible: false,
// 12
formLoading: false,
//
formData: {
id: undefined,
tempCode: undefined,
tempType: undefined,
tempUse: undefined,
tempName: undefined,
isValid: undefined,
status: undefined,
tempContent: undefined,
},
//
formRules: {
},
};
},
methods: {
/** 打开弹窗 */
async open(id) {
this.dialogVisible = true;
this.reset();
//
if (id) {
this.formLoading = true;
try {
const res = await ContTempApi.getContTemp(id);
this.formData = res.data;
this.title = "修改合同模板";
} finally {
this.formLoading = false;
}
}
this.title = "新增合同模板";
},
/** 提交按钮 */
async submitForm() {
//
await this.$refs["formRef"].validate();
this.formLoading = true;
try {
const data = this.formData;
//
if (data.id) {
await ContTempApi.updateContTemp(data);
this.$modal.msgSuccess("修改成功");
this.dialogVisible = false;
this.$emit('success');
return;
}
//
await ContTempApi.createContTemp(data);
this.$modal.msgSuccess("新增成功");
this.dialogVisible = false;
this.$emit('success');
} finally {
this.formLoading = false;
}
},
/** 表单重置 */
reset() {
this.formData = {
id: undefined,
tempCode: undefined,
tempType: undefined,
tempUse: undefined,
tempName: undefined,
isValid: undefined,
status: undefined,
tempContent: undefined,
};
this.resetForm("formRef");
}
}
};
</script>
<template>
<div class="app-container">
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="100px">
<el-row :gutter="1">
<el-col :span="5">
<el-form-item label="模板名称" prop="tempName">
<el-input v-model="formData.tempName" placeholder="请输入模板名称"/>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="模板编码" prop="tempCode">
<el-input v-model="formData.tempCode" placeholder="请输入模板编码"/>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="模板类型" prop="tempType">
<el-select v-model="formData.tempType" placeholder="请选择模板类型" @keyup.enter.native="handleQuery">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.DICT_BASE_CONT_TEMP_TYPE)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="模板用途" prop="tempUse">
<el-select v-model="formData.tempUse" placeholder="请选择模板类型" @keyup.enter.native="handleQuery">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.DICT_BASE_CONT_TEMP_USE)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="模板内容">
<Editor :height="500" v-model="formData.tempContent" :min-height="192"/>
</el-form-item>
</el-form>
<div slot="footer" style="text-align: right;" class="dialog-footer">
<el-button type="primary" @click="submitForm" :disabled="formLoading"> </el-button>
<el-button @click="close()"> </el-button>
</div>
</div>
</template>
<script>
import * as ContTempApi from '@/api/base/cont';
import Editor from '@/components/Editor';
export default {
name: "ContTempForm",
components: {
Editor,
},
data() {
return {
// 12
formLoading: false,
//
formData: {
id: undefined,
tempCode: undefined,
tempType: undefined,
tempUse: undefined,
tempName: undefined,
isValid: undefined,
status: undefined,
tempContent: undefined,
},
//
formRules: {
tempName: [
{ required: true, message: '请输入模板名称', trigger: 'blur' },
],
tempCode: [
{ required: true, message: '请输入模板编码', trigger: 'blur' },
],
tempType: [
{ required: true, message: '请选择模板类型', trigger: 'blur' },
],
tempUse: [
{ required: true, message: '请选择模板用途', trigger: 'blur' },
],
},
};
},
created() {
const id = this.$route.params.id
this.open(id)
},
methods: {
close(){
this.$router.go(-1);
},
/** 打开弹窗 */
async open(id) {
this.reset();
//
if (id) {
this.formLoading = true;
try {
const res = await ContTempApi.getContTemp(id);
this.formData = res.data;
} finally {
this.formLoading = false;
}
}
},
/** 提交按钮 */
async submitForm() {
debugger
//
await this.$refs["formRef"].validate();
this.formLoading = true;
try {
const data = this.formData;
//
if (data.id) {
await ContTempApi.updateContTemp(data);
this.$modal.msgSuccess("修改成功");
this.$router.go(-1);
return;
}
//
await ContTempApi.createContTemp(data);
this.$modal.msgSuccess("新增成功");
this.$router.go(-1);
} finally {
this.formLoading = false;
}
},
/** 表单重置 */
reset() {
this.formData = {
id: undefined,
tempCode: undefined,
tempType: undefined,
tempUse: undefined,
tempName: undefined,
isValid: undefined,
status: undefined,
tempContent: undefined,
};
debugger
this.resetForm("formRef");
}
}
};
</script>

View File

@ -2,31 +2,20 @@
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="模板编号" prop="tempCode">
<el-input v-model="queryParams.tempCode" placeholder="请输入模板编号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="模板类型" prop="tempType">
<el-select v-model="queryParams.tempType" placeholder="请选择模板类型" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="模板用途" prop="tempUse">
<el-input v-model="queryParams.tempUse" placeholder="请输入模板用途" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="模板名称" prop="tempName">
<el-input v-model="queryParams.tempName" placeholder="请输入模板名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="是否有效0否1是" prop="isValid">
<el-input v-model="queryParams.isValid" placeholder="请输入是否有效0否1是" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
<el-option label="请选择字典生成" value="" />
<el-form-item label="模板类型" prop="tempType">
<el-select v-model="queryParams.tempType" placeholder="请选择模板类型" @keyup.enter.native="handleQuery">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.DICT_BASE_CONT_TEMP_TYPE)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
<el-form-item label="模板用途" prop="tempUse">
<el-select v-model="queryParams.tempUse" placeholder="请选择模板类型" @keyup.enter.native="handleQuery">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.DICT_BASE_CONT_TEMP_USE)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
@ -38,24 +27,36 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)"
v-hasPermi="['base:cont-temp:create']">新增</el-button>
v-hasPermi="['base:cont-temp:create']">新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:cont-temp:export']">导出</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
:loading="exportLoading"
v-hasPermi="['base:cont-temp:export']">导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="主键标识" align="center" prop="id" />
<el-table-column label="模板编号" align="center" prop="tempCode" />
<el-table-column label="模板类型" align="center" prop="tempType" />
<el-table-column label="模板用途" align="center" prop="tempUse" />
<el-table-column label="模板名称" align="center" prop="tempName" />
<el-table-column label="是否有效0否1是" align="center" prop="isValid" />
<el-table-column label="状态" align="center" prop="status" />
<el-table-column label="模板内容" align="center" prop="tempContent" />
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="模板名称" align="center" prop="tempName"/>
<el-table-column label="模板编码" align="center" prop="tempCode"/>
<el-table-column label="模板类型" align="center" prop="tempType">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.DICT_BASE_CONT_TEMP_TYPE" :value="scope.row.tempType" />
</template>
</el-table-column>
<el-table-column label="模板用途" align="center" prop="tempUse">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.DICT_BASE_CONT_TEMP_USE" :value="scope.row.tempUse" />
</template>
</el-table-column>
<el-table-column label="是否有效" align="center" prop="isValid">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.DICT_BASE_CONT_IS_VALID" :value="scope.row.isValid" />
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
@ -63,10 +64,18 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button v-if="scope.row.isValid == '0'" size="mini" type="text" icon="el-icon-open" @click="valid(scope.row.id,'1')"
v-hasPermi="['base:cont-temp:update']">启用
</el-button>
<el-button v-if="scope.row.isValid == '1'" size="mini" type="text" icon="el-icon-open" @click="valid(scope.row.id,'0')"
v-hasPermi="['base:cont-temp:update']">停用
</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
v-hasPermi="['base:cont-temp:update']">修改</el-button>
v-hasPermi="['base:cont-temp:update']">修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:cont-temp:delete']">删除</el-button>
v-hasPermi="['base:cont-temp:delete']">删除
</el-button>
</template>
</el-table-column>
</el-table>
@ -74,17 +83,16 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<ContTempForm ref="formRef" @success="getList" />
</div>
<!-- <ContTempForm ref="formRef" @success="getList"/>-->
</div>
</template>
<script>
import * as ContTempApi from '@/api/base/cont';
import ContTempForm from '@/views/base/cont/form/ContTempForm.vue';
export default {
name: "ContTemp",
components: {
ContTempForm,
},
data() {
return {
@ -94,8 +102,8 @@ export default {
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
total: 0,
//
list: [],
//
@ -106,8 +114,8 @@ export default {
currentRow: {},
//
queryParams: {
pageNo: 1,
pageSize: 10,
pageNo: 1,
pageSize: 10,
tempCode: null,
tempType: null,
tempUse: null,
@ -117,7 +125,7 @@ export default {
tempContent: null,
createTime: [],
},
};
};
},
created() {
this.getList();
@ -126,8 +134,8 @@ export default {
/** 查询列表 */
async getList() {
try {
this.loading = true;
const res = await ContTempApi.getContTempPage(this.queryParams);
this.loading = true;
const res = await ContTempApi.getContTempPage(this.queryParams);
this.list = res.data.records;
this.total = res.data.total;
} finally {
@ -146,17 +154,36 @@ export default {
},
/** 添加/修改操作 */
openForm(id) {
this.$refs["formRef"].open(id);
this.$router.push({
name: "ContTempForm",
params:{
id: id
}
});
// this.$refs["formRef"].open(id);
},
/**
* 启用/停用
*/
async valid(id,isValid){
let formData = {
id:id,
isValid:isValid
}
await ContTempApi.updateContTemp(formData);
this.$modal.msgSuccess("操作成功");
this.getList()
},
/** 删除按钮操作 */
async handleDelete(row) {
const id = row.id;
await this.$modal.confirm('是否确认删除合同模板编号为"' + id + '"的数据项?')
await this.$modal.confirm('是否确认删除合同模板名称为"' + row.tempName + '"的数据项?')
try {
await ContTempApi.deleteContTemp(id);
await this.getList();
this.$modal.msgSuccess("删除成功");
} catch {}
await ContTempApi.deleteContTemp(id);
await this.getList();
this.$modal.msgSuccess("删除成功");
} catch {
}
},
/** 导出按钮操作 */
async handleExport() {
@ -170,6 +197,6 @@ export default {
this.exportLoading = false;
}
},
}
}
};
</script>

View File

@ -12,11 +12,6 @@
<el-form-item label="身份证号" prop="idCard">
<el-input v-model="queryParams.idCard" placeholder="请输入身份证号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="客户状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择客户状态" clearable size="small">
<el-option label="请选择字典生成" value=""/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>

View File

@ -12,11 +12,6 @@
<el-form-item label="身份证号" prop="idCard">
<el-input v-model="queryParams.idCard" placeholder="请输入身份证号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="客户状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择客户状态" clearable size="small">
<el-option label="请选择字典生成" value=""/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>

View File

@ -12,11 +12,6 @@
<el-form-item label="身份证号" prop="idCard">
<el-input v-model="queryParams.idCard" placeholder="请输入身份证号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="客户状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择客户状态" clearable size="small">
<el-option label="请选择字典生成" value=""/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>