|
@@ -0,0 +1,164 @@
|
|
|
+<template>
|
|
|
+ <div class="m-container">
|
|
|
+ <h2>
|
|
|
+ <div class="squrt"></div>
|
|
|
+ 机构协议管理
|
|
|
+ </h2>
|
|
|
+ <save-form
|
|
|
+ :inline="true"
|
|
|
+ class="searchForm"
|
|
|
+ ref="searchForm"
|
|
|
+ @submit="search"
|
|
|
+ @reset="reset"
|
|
|
+ :saveKey="'platformProductManager'"
|
|
|
+ :model.sync="searchForm"
|
|
|
+ >
|
|
|
+ <el-form-item :rules="[]">
|
|
|
+ <el-input v-model="searchForm.search" placeholder="产品名称"></el-input>
|
|
|
+ </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 style="margin-bottom: 20px;" type="primary" v-permission="'platformProduct/add'" @click="openProduct('create')" icon="el-icon-plus">添加</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"
|
|
|
+ prop="name"
|
|
|
+ label="产品名称"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column align="center" label="产品描述" prop="remark">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <tooltip :content="scope.row.remark" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ @click="resetProduct(scope.row)"
|
|
|
+ v-permission="'platformProduct/update'"
|
|
|
+ type="text"
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ @click="delProduct(scope.row)"
|
|
|
+ v-permission="'platformProduct/delete'"
|
|
|
+ type="text"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <pagination
|
|
|
+ :saveKey="'platformProductManager'"
|
|
|
+ sync
|
|
|
+ :total.sync="pageInfo.total"
|
|
|
+ :page.sync="pageInfo.page"
|
|
|
+ :limit.sync="pageInfo.limit"
|
|
|
+ :page-sizes="pageInfo.page_size"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import pagination from "@/components/Pagination/index";
|
|
|
+import { platformProductQueryPage,platformProductDelete } from "./api";
|
|
|
+const initSearch = {
|
|
|
+ search: null
|
|
|
+};
|
|
|
+export default {
|
|
|
+ components: { pagination },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tableList: [],
|
|
|
+ pageType: 'create',
|
|
|
+ pageInfo: {
|
|
|
+ // 分页规则
|
|
|
+ limit: 10, // 限制显示条数
|
|
|
+ page: 1, // 当前页
|
|
|
+ total: 0, // 总条数
|
|
|
+ page_size: [10, 20, 40, 50], // 选择限制显示条数
|
|
|
+ },
|
|
|
+ searchForm: { ...initSearch },
|
|
|
+ isAdd: true,
|
|
|
+ courseVisible: false,
|
|
|
+ activeRow: null,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.$store.dispatch("setBranchs");
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async getList() {
|
|
|
+ try {
|
|
|
+ const res = await platformProductQueryPage({
|
|
|
+ ...this.searchForm,
|
|
|
+ page: this.pageInfo.page,
|
|
|
+ rows: this.pageInfo.limit,
|
|
|
+ });
|
|
|
+ this.pageInfo.total = res.data.total;
|
|
|
+ // res.data.rows
|
|
|
+ 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();
|
|
|
+ },
|
|
|
+ resetProduct(row) {
|
|
|
+ this.isAdd = false;
|
|
|
+ this.activeRow = row;
|
|
|
+ this.pageType = 'update'
|
|
|
+ this.courseVisible = true;
|
|
|
+ },
|
|
|
+ submitInfo() {
|
|
|
+ const str = this.isAdd ? "create" : "update";
|
|
|
+ this.$refs.operationModel.submitInfo(str);
|
|
|
+ },
|
|
|
+ close() {
|
|
|
+ this.courseVisible = false;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ openProduct() {
|
|
|
+ this.isAdd = true;
|
|
|
+ this.activeRow = null;
|
|
|
+ this.pageType = 'create'
|
|
|
+ this.courseVisible = true;
|
|
|
+ },
|
|
|
+ async delProduct(row) {
|
|
|
+ this.$confirm("是否删除?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then( async() => {
|
|
|
+ try{
|
|
|
+ const res = await platformProductDelete({ id:row.id})
|
|
|
+ this.$message.success('删除成功')
|
|
|
+ this.getList()
|
|
|
+ }catch{}
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.courseMask .el-dialog__body {
|
|
|
+ padding-bottom: 0;
|
|
|
+}
|
|
|
+</style>
|