|
@@ -0,0 +1,203 @@
|
|
|
+<template>
|
|
|
+ <div class="m-container">
|
|
|
+ <h2>
|
|
|
+ <div class="squrt"></div>
|
|
|
+ 机构协议管理
|
|
|
+ </h2>
|
|
|
+ <div class="m-core">
|
|
|
+ <save-form
|
|
|
+ :inline="true"
|
|
|
+ class="searchForm"
|
|
|
+ ref="searchForm"
|
|
|
+ @submit="search"
|
|
|
+ @reset="reset"
|
|
|
+ :saveKey="'tenantTradeManager'"
|
|
|
+ :model.sync="searchForm"
|
|
|
+ >
|
|
|
+ <el-form-item prop="status">
|
|
|
+ <el-select
|
|
|
+ v-model.trim="searchForm.status"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ @clear="onClear('status')"
|
|
|
+ placeholder="状态"
|
|
|
+ >
|
|
|
+ <el-option label="启用" :value="1"></el-option>
|
|
|
+ <el-option label="停用" :value="0"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button native-type="submit" type="danger">搜索</el-button>
|
|
|
+ <el-button native-type="reset" type="primary">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </save-form>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ style="margin-bottom: 20px"
|
|
|
+ @click="protocolVisible = true"
|
|
|
+ >新增协议</el-button
|
|
|
+ >
|
|
|
+ <!-- 列表 -->
|
|
|
+ <div class="tableWrap">
|
|
|
+ <el-table
|
|
|
+ :data="tableList"
|
|
|
+ :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
|
|
|
+ >
|
|
|
+ <el-table-column align="center" label="协议编号" prop="id">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="协议号" prop="contractNo">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="协议名称" prop="name">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="上传时间" prop="updateTime">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="操作人" prop="latestOperator">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="状态">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.status ? '启用' : '停用' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ @click="openService(scope.row, 'look')"
|
|
|
+ type="text"
|
|
|
+ >查看</el-button>
|
|
|
+ <el-button
|
|
|
+ @click="openService(scope.row, 'open')"
|
|
|
+ v-if="!scope.row.status"
|
|
|
+ v-permission="'tenantContractTemplate/updateStatus'"
|
|
|
+ type="text"
|
|
|
+ >启用</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <pagination
|
|
|
+ :saveKey="'tenantTradeManager'"
|
|
|
+ sync
|
|
|
+ :total.sync="pageInfo.total"
|
|
|
+ :page.sync="pageInfo.page"
|
|
|
+ :limit.sync="pageInfo.limit"
|
|
|
+ :page-sizes="pageInfo.page_size"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-dialog title="新增协议" :visible.sync="protocolVisible" width="560px">
|
|
|
+ <addProtocol v-if="protocolVisible" @close="protocolVisible = false" @getList="getList" />
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ title="查看协议"
|
|
|
+ :visible.sync="lookVisible"
|
|
|
+ width="415px"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <previewProtocol
|
|
|
+ @close="lookVisible = false"
|
|
|
+ :look="true"
|
|
|
+ :fileContent="fileContent"
|
|
|
+ v-if="lookVisible"
|
|
|
+ />
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import pagination from "@/components/Pagination/index";
|
|
|
+import previewProtocol from "@/views/tenantSetting/model/previewProtocol";
|
|
|
+import { tenantContractTemplateList, updateStatus } from "./api";
|
|
|
+import { tenantStatus } from '@/constant'
|
|
|
+import { dealStatus } from "@/utils/searchArray";
|
|
|
+import addProtocol from './model/addProtocol'
|
|
|
+const initSearch = {
|
|
|
+ status: null
|
|
|
+};
|
|
|
+export default {
|
|
|
+ components: { pagination, addProtocol, previewProtocol },
|
|
|
+ data() {
|
|
|
+ const baseTenantId = sessionStorage.getItem('baseTenantId')
|
|
|
+ return {
|
|
|
+ baseTenantId,
|
|
|
+ tenantStatus,
|
|
|
+ dealStatus,
|
|
|
+ tableList: [],
|
|
|
+ protocolVisible: false,
|
|
|
+ pageInfo: {
|
|
|
+ // 分页规则
|
|
|
+ limit: 10, // 限制显示条数
|
|
|
+ page: 1, // 当前页
|
|
|
+ total: 0, // 总条数
|
|
|
+ page_size: [10, 20, 40, 50], // 选择限制显示条数
|
|
|
+ },
|
|
|
+ lookVisible: false,
|
|
|
+ fileContent: null,
|
|
|
+ searchForm: { ...initSearch },
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async mounted() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async getList() {
|
|
|
+ try {
|
|
|
+ let { createTimer, ...reset } = this.searchForm;
|
|
|
+ const res = await tenantContractTemplateList({
|
|
|
+ ...reset,
|
|
|
+ page: this.pageInfo.page,
|
|
|
+ rows: this.pageInfo.limit,
|
|
|
+ });
|
|
|
+ console.log(res)
|
|
|
+ this.pageInfo.total = res.data.total;
|
|
|
+ this.tableList = res.data.rows;
|
|
|
+ } catch (e) {}
|
|
|
+ },
|
|
|
+ search() {
|
|
|
+ this.pageInfo.page = 1;
|
|
|
+ this.$refs.searchForm.save(this.searchForm);
|
|
|
+ this.$refs.searchForm.save(this.pageInfo, "page");
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ reset() {
|
|
|
+ this.searchForm = { ...initSearch };
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ async openService(row, type) {
|
|
|
+ if(type == 'look') {
|
|
|
+ this.fileContent = row.contractTemplateContent
|
|
|
+ this.lookVisible = true
|
|
|
+ } else if(type == 'open') {
|
|
|
+ try {
|
|
|
+ this.$confirm(`同一时间协议只能启用一个,启用后,已启用的协议将自动停用?`, "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then( async() => {
|
|
|
+ await updateStatus({ id: row.id })
|
|
|
+ this.$message.success('启用成功')
|
|
|
+ this.getList()
|
|
|
+ });
|
|
|
+ } catch(e) {
|
|
|
+ //
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // this.protocolVisible = true
|
|
|
+ },
|
|
|
+ },
|
|
|
+ filters: {
|
|
|
+ tenantOrderStatus(val) {
|
|
|
+ const template = {
|
|
|
+ 0: "待支付",
|
|
|
+ 1: "已支付",
|
|
|
+ 2: "支付失败"
|
|
|
+ }
|
|
|
+ return template[val]
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.courseMask .el-dialog__body {
|
|
|
+ padding-bottom: 0;
|
|
|
+}
|
|
|
+</style>
|