Browse Source

frontInit

ye 8 months ago
parent
commit
8e37cc4a73

+ 1 - 1
config/dev.env.js

@@ -7,7 +7,7 @@ module.exports = merge(prodEnv, {
   // AIP_BASE: '"http://192.168.124.108:8082/DPshow_depart_war_exploded/"',
   //AIP_BASE: '"https://duptest.bgyfw.com:8002/DPshow_depart"',
   // AIP_BASE: '"http://10.187.0.72:8072/DPshow_depart"',
-    AIP_BASE: '"http://localhost:8072/DPshow_depart/"',
+    AIP_BASE: '"http://localhost:8080/DPshow_depart_war_exploded"',
   LUOSIMAO_API: '"6c29b1e55ab2befad0b746db886d10c7"',
   LUOSIMAO_DEV_RESPONSE_CODE: '"0697056754B0C13C745662D33E1AC555"',
   H5_INDEX: '"https://duptest.bgyfw.com:8002/DPshow_depart/api/wxLogin/userAuth?url=https://duptest.bgyfw.com/m/pages/singlePage/index.html"'

+ 2 - 1
config/prod.env.js

@@ -1,6 +1,7 @@
 module.exports = {
   NODE_ENV: '"production"',
-  AIP_BASE: '"http://localhost:8072/DPshow_depart/"',
+  // http://localhost:8072/DPshow_depart/
+  AIP_BASE: '"http://localhost:8080/DPshow_depart_war_exploded"',
   LUOSIMAO_API: '"6c29b1e55ab2befad0b746db886d10c7"',
   LUOSIMAO_DEV_RESPONSE_CODE: '"0697056754B0C13C745662D33E1AC555"',
   H5_INDEX: '"https://duptest.bgyfw.com:8002/DPshow_depart/api/wxLogin/userAuth?url=https://duptest.bgyfw.com/m/pages/singlePage/index.html"',

+ 1 - 1
config/test.env.js

@@ -6,7 +6,7 @@ module.exports = merge(devEnv, {
   // AIP_BASE: '"http://10.187.1.153:8880/"',
   // AIP_BASE: '"http://mcatest.bgyfw.com:81/dpshowtest/"',
   //test,tuisong
-     AIP_BASE: '"http://localhost:8072/DPshow_depart/"',
+     AIP_BASE: '"http://localhost:8080/DPshow_depart_war_exploded"',
   LUOSIMAO_API: '"6c29b1e55ab2befad0b746db886d10c7"',
   LUOSIMAO_DEV_RESPONSE_CODE: '"0697056754B0C13C745662D33E1AC555"',
   H5_INDEX: '"https://duptest.bgyfw.com:8002/DPshow_depart/api/wxLogin/userAuth?url=https://duptest.bgyfw.com/m/pages/singlePage/index.html"',

+ 45 - 0
src/api/dmn.js

@@ -0,0 +1,45 @@
+import { urlWrapper, axiosPostFileWrapper, axiosPostWrapper, axiosGetWrapper, axiosDeleteWrapper, axiosPostJsonWrapper } from './index';
+export const searchDomainsByPage = (data, success, error, exception) => {
+    axiosGetWrapper('/api/dmn/DnmDomainInformationController/selectDnmDomainInformationByPage', data, success, error, exception);
+};
+
+export const searchDomainsByByPageByLeader = (data, success, error, exception) => {
+    axiosGetWrapper('/api/dmn/DnmDomainInformationController/selectDnmDomainInformationByPageByLeader', data, success, error, exception);
+};
+
+
+export const findOrganization = (data, success, error, exception) => {
+    axiosGetWrapper('/api/dmn/OrganizationController/getOrganization', data, success, error, exception);
+};
+ 
+ export const insertDnmDomainInformationAndCost = (data, success, error, exception) => {
+    axiosPostJsonWrapper('/api/dmn/DnmDomainInformationController/insertDnmDomainInformationAndCost', data, success, error, exception);
+};
+
+
+ export const updateDnmDomainInformationAndCost = (data, success, error, exception) => {
+    axiosPostJsonWrapper('/api/dmn/DnmDomainInformationController/updateDnmDomainInformationAndCost', data, success, error, exception);
+};
+
+ export const deleteDnmDomainInformationById = (data, success, error, exception) => {
+    axiosGetWrapper('/api/dmn/DnmDomainInformationController/deleteDnmDomainInformationById', data, success, error, exception);
+};
+ export const deleteCostById = (data, success, error, exception) => {
+    axiosGetWrapper('/api/dmn/CostInformationController/delCostInformation', data, success, error, exception);
+};
+
+ export const updateDnmDomainInformationById = (data, success, error, exception) => {
+    axiosGetWrapper('/api/dmn/DnmDomainInformationController/updateDnmDomainInformationById', data, success, error, exception);
+}
+
+ export const selectDnmDomainInformationCostById = (data, success, error, exception) => {
+    axiosGetWrapper('/api/dmn/DnmDomainInformationController/getDnmDomainInformationAndCost', data, success, error, exception);
+};
+// 域名是否存在
+ export const checkDomainName = (data, success, error, exception) => {
+    axiosGetWrapper('/api/dmn/DnmDomainInformationController/checkDomainName', data, success, error, exception);
+};
+// 生成唯一流水号  
+ export const generateDomainCouponNumber = (data, success, error, exception) => {
+    axiosGetWrapper('/api/dmn/DnmDomainInformationController/generateDomainCouponNumber', data, success, error, exception);
+};

+ 1 - 0
src/main.js

@@ -142,5 +142,6 @@ new Vue({
   router,
   store,
   template: '<App/>',
+  
   components: { App },
 });

+ 14 - 7
src/router/index.js

@@ -347,6 +347,9 @@ import experienceOfficerTemplateMessage from '@/views/pages/experienceOfficer/te
 import detailExperienceOfficerTemplateMessage from '@/views/pages/experienceOfficer/templateMessage/detail.vue';
 
 import dialog from '@/components/dialog'
+// 域名管理
+import domainName from '@/views/pages/domainName'
+import domainManager from '@/views/pages/domainManager'
 Vue.use(Router);
 
 export default new Router({
@@ -2050,13 +2053,17 @@ export default new Router({
       component: detailExperienceOfficerTemplateMessage
     },
     {
-      path: '/viewExperienceOfficerTemplateMessage/:id',
-      props: {
-        disabled: true,
-      },
-      name: '查看模板消息',
-      component: detailExperienceOfficerTemplateMessage
-    }
+      hash: '',
+      path: '/domainName',
+      name: '域名管理',
+      component: domainName
+    },
+    {
+      hash: '',
+      path: '/domainManager',
+      name: '域名管理',
+      component: domainManager
+    },
     ],
   }
   ]

+ 449 - 0
src/views/pages/domainManager/index.vue

@@ -0,0 +1,449 @@
+<template>
+  <div>
+    <h1>法务部领导才能查看内容</h1>
+    <!-- 高级搜索按钮 -->
+    <el-button type="text" @click="showAdvancedSearch = !showAdvancedSearch">
+      高级搜索
+      <i :class="['el-icon-arrow-' + (showAdvancedSearch ? 'up' : 'down')]"></i>
+    </el-button>
+    <!-- 高级搜索表单 -->
+    <el-form :inline="true" class="search-form" v-show="showAdvancedSearch">
+      <el-form-item label="域名">
+        <el-input
+          v-model="searchForm.domainName"
+          placeholder="请输入域名"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="域名券号">
+        <el-input
+          v-model="searchForm.domainCouponNumber"
+          placeholder="请输入域名券号"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="所有人">
+        <el-input
+          v-model="searchForm.owner"
+          placeholder="请输入所有人"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="审核状态">
+        <el-select
+          v-model="searchForm.auditStatus"
+          placeholder="请选择审核状态"
+        >
+          <el-option label="待审核" value="待审核"></el-option>
+          <el-option label="已发布" value="已发布"></el-option>
+          <el-option label="未通过" value="未通过"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="域名申请日期">
+        <el-date-picker
+          v-model="searchForm.dateRange"
+          type="daterange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          style="width: 260px"
+             value-format="yyyy-MM-dd"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" @click="handleSearch">查找</el-button>
+        <el-button @click="handleReset">重置</el-button>
+      </el-form-item>
+    </el-form>
+     <!-- <el-button type="info" @click="openDialog">导出</el-button> -->
+    <!-- 查询结果表格 -->
+    <el-table :data="tableData" stripe style="width: 100%">
+      <el-table-column label="序号" width="60">
+        <template slot-scope="{ row, index }">{{ index + 1 }}</template>
+      </el-table-column>
+      <el-table-column prop="domainName" label="域名"></el-table-column>
+      <el-table-column
+        prop="domainCouponNumber"
+        label="域名券号"
+      ></el-table-column>
+      <el-table-column prop="owner" label="所有人"></el-table-column>
+      <el-table-column
+        prop="auditStatus"
+        label="审核状态"
+        :formatter="formatStatus"
+      >
+        <template slot-scope="{ row }">
+          <span v-html="formatStatus(row)"></span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="applicationTime"
+        label="域名申请日期"
+        sortable
+      ></el-table-column>
+      <el-table-column prop="accountId" label="账户ID"></el-table-column>
+      <el-table-column label="操作">
+        <template slot-scope="{ row }">
+          <el-button
+            type="text"
+            size="small"
+            @click="handleEdit(row)"
+            v-if="row.auditStatus == '待审核'"
+            >审核</el-button
+          >
+          <el-button
+            type="text"
+            size="small"
+            @click="handleReject(row)"
+            v-if="row.auditStatus == '待审核'"
+            >拒绝</el-button
+          >
+          <el-button type="text" size="small" @click="handleView(row)"
+            >查看</el-button
+          >
+          <el-button
+            type="text"
+            size="small"
+            @click="handleDelete(row)"
+            v-if="row.auditStatus !== '待审核'"
+            >删除</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      background
+      layout="prev, pager, next,total"
+      :current-page="page"
+      :page-size="pageSize"
+      :total="total"
+      align="center"
+      @current-change="handleCurrentChange"
+    >
+    </el-pagination>
+    <AddDomainName
+      :dialogVisible="dialogVisible"
+      :id="domainId"
+      :flag="domainFlag"
+      @closeDialog="closeDialog"
+    />
+  </div>
+</template>
+
+<script>
+import AddDomainName from "@/views/pages/domainName/addDomainName";
+import {
+  searchDomainsByByPageByLeader,
+  deleteDnmDomainInformationById,
+  updateDnmDomainInformationById,
+} from "@/api/dmn";
+import { MessageBox, Message } from "element-ui";
+export default {
+   components: {
+    AddDomainName,
+  },
+  data() {
+    return {
+      showAdvancedSearch: true,
+      searchForm: {
+        domainName: "",
+        domainCouponNumber: "",
+        owner: "",
+        auditStatus: "",
+        dateRange: [],
+      },
+      dialogVisible: false,
+      tableData: [
+        // 域名管理数据
+      ],
+      page: 1, // 当前页数
+      pageSize: 5, // 每页显示条数
+      total: 1000, // 总条数
+      domainId: "",
+      domainFlag: 0,
+    };
+  },
+  methods: {
+    closeDialog(data) {
+      console.log(data);
+      console.log("关闭");
+      this.dialogVisible = false;
+    },
+    // 定义组件方法
+    handleSearch() {
+      // 处理搜索逻辑,根据searchForm中的条件进行过滤查询
+      // 可以根据searchForm中的条件发送请求到后端进行数据查询
+      let params = {};
+      // 添加非空的搜索条件到 params 对象中
+      if (this.searchForm.domainName !== "") {
+        params.domainName = this.searchForm.domainName;
+      }
+      if (this.searchForm.domainCouponNumber !== "") {
+        params.domainCouponNumber = this.searchForm.domainCouponNumber;
+      }
+      if (this.searchForm.owner !== "") {
+        params.owner = this.searchForm.owner;
+      }
+      if (this.searchForm.auditStatus !== "") {
+        params.auditStatus = this.searchForm.auditStatus;
+      }
+      if (this.searchForm.dateRange.length === 2) {
+        params.startDate = this.searchForm.dateRange[0];
+        params.endDate = this.searchForm.dateRange[1];
+      }
+      params.page = this.page;
+      params.pageSize = this.pageSize;
+      this.getDataPage(params);
+    },
+    handleReset() {
+      // 处理重置搜索条件逻辑
+      this.searchForm = {
+        domainName: "",
+        domainCouponNumber: "",
+        owner: "",
+        auditStatus: "",
+        dateRange: [],
+      };
+    },
+    async handleDelete(row) {
+      try {
+        await this.$confirm("此操作将永久删除该条数据,是否继续?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+
+        // 用户点击了确定按钮,执行删除操作
+        let params = {
+          id: row.id,
+        };
+
+        await deleteDnmDomainInformationById(
+          params,
+          (response) => {
+            console.log(response);
+            // 显示删除成功的提示消息
+            Message({
+              type: "success",
+              message: "删除成功!",
+            });
+          },
+          (error) => {
+            console.warn(error);
+            Message({
+              type: "error",
+              message: "删除失败,请稍后重试!",
+            });
+          },
+          (exception) => {
+            console.warn(exception);
+            Message({
+              type: "error",
+              message: "删除异常,请联系管理员!",
+            });
+          }
+        );
+      } catch (error) {
+        // 用户点击了取消按钮或者点击了关闭按钮
+        console.log("取消删除");
+      }
+      // 重新获取数据渲染
+      this.getDataPage();
+    },
+    handleView(row) {
+      // 处理查看操作,跳转到详细信息页面或者弹出详情框
+      this.dialogVisible = true;
+      this.domainFlag = 2;
+      this.domainId = row.id;
+    },
+    formatStatus(row) {
+      switch (row.auditStatus) {
+        case "已发布":
+          return '<span style="color: green; font-weight: bold;">已发布</span>';
+        case "待审核":
+          return '<span style="color: grey; font-weight: bold;">待审核</span>';
+        case "未通过":
+          return '<span style="color: red; font-weight: bold;">未通过</span>';
+        default:
+          return row.auditStatus;
+      }
+    },
+    async getDataPage(
+      params = {
+        page: 1, // 当前页数
+        pageSize: 5, // 每页显示条数
+      }
+    ) {
+      await searchDomainsByByPageByLeader(
+        params,
+        (response) => {
+          console.log(response);
+          this.tableData = response.list;
+          this.total = response.total;
+          this.page = response.pageNum;
+          // this.pageSize = response.pageSize;
+        },
+        (error) => {
+          console.warn(error);
+        },
+        (exception) => {
+          console.warn(exception);
+        }
+      );
+    },
+    handleCurrentChange(newPage) {
+      console.log(newPage);
+      // 发起请求,例如调用获取数据的方法
+      let params = {};
+        // 处理搜索逻辑,根据searchForm中的条件进行过滤查询
+      // 添加非空的搜索条件到 params 对象中
+      if (this.searchForm.domainName !== "") {
+        params.domainName = this.searchForm.domainName;
+      }
+      if (this.searchForm.domainCouponNumber !== "") {
+        params.domainCouponNumber = this.searchForm.domainCouponNumber;
+      }
+      if (this.searchForm.owner !== "") {
+        params.owner = this.searchForm.owner;
+      }
+      if (this.searchForm.auditStatus !== "") {
+        params.auditStatus = this.searchForm.auditStatus;
+      }
+      if (this.searchForm.dateRange.length === 2) {
+        params.startDate = this.searchForm.dateRange[0];
+        params.endDate = this.searchForm.dateRange[1];
+      }
+      params.page = newPage;
+      params.pageSize = this.pageSize;
+      this.getDataPage(params);
+    },
+    async handleEdit(row) {
+      try {
+        const confirmResult = await this.$confirm(
+          `此操作将审核该${row.domainName}域名状态`,
+          "审核状态",
+          {
+            confirmButtonText: "通过",
+            cancelButtonText: "取消",
+            type: "warning",
+          }
+        );
+
+        if (confirmResult === "confirm") {
+          // 用户点击了"通过"按钮,执行审核通过的操作
+          let params = {
+            id: row.id,
+            flag: 0,
+          };
+
+          await updateDnmDomainInformationById(
+            params,
+            (response) => {
+              console.log(response);
+              // 显示审核通过的提示消息
+              this.$message({
+                type: "success",
+                message: "审核成功!",
+              });
+              this.getDataPage();
+            },
+            (error) => {
+              console.warn(error);
+              this.$message({
+                type: "error",
+                message: "审核失败,请稍后重试!",
+              });
+            },
+            (exception) => {
+              console.warn(exception);
+              this.$message({
+                type: "error",
+                message: "审核异常,请联系管理员!",
+              });
+            }
+          );
+        } else if (confirmResult === "cancel") {
+          // 用户点击了"拒绝"按钮
+          this.$message({
+            message: "您已取消操作",
+          });
+        } else {
+          // 用户点击了关闭按钮或其他情况
+          this.$message({
+            message: "您已取消操作",
+          });
+        }
+      } catch (error) {
+        // 捕获到异常,可能是对话框被关闭或其他错误
+        this.$message.error("您已取消操作");
+      }
+    },
+    async handleReject(row) {
+      try {
+        const confirmResult = await this.$confirm(
+          `此操作将审核该${row.domainName}域名状态`,
+          "审核状态",
+          {
+            confirmButtonText: "拒绝",
+            cancelButtonText: "取消",
+            type: "warning",
+          }
+        );
+
+        if (confirmResult === "confirm") {
+          // 用户点击了"通过"按钮,执行审核通过的操作
+          let params = {
+            id: row.id,
+            flag: 1,
+          };
+
+          await updateDnmDomainInformationById(
+            params,
+            (response) => {
+              console.log(response);
+              // 显示审核通过的提示消息
+              this.$message({
+                type: "success",
+                message: "成功!",
+              });
+              this.getDataPage();
+            },
+            (error) => {
+              console.warn(error);
+              this.$message({
+                type: "error",
+                message: "审核失败,请稍后重试!",
+              });
+            },
+            (exception) => {
+              console.warn(exception);
+              this.$message({
+                type: "error",
+                message: "审核异常,请联系管理员!",
+              });
+            }
+          );
+        } else if (confirmResult === "cancel") {
+          // 用户点击了"拒绝"按钮
+          this.$message({
+            message: "您已取消操作",
+          });
+        } else {
+          // 用户点击了关闭按钮或其他情况
+          this.$message({
+            message: "您已取消操作",
+          });
+        }
+      } catch (error) {
+        // 捕获到异常,可能是对话框被关闭或其他错误
+        this.$message.error("您已取消操作");
+      }
+    },
+  },
+  mounted() {
+    // 发起网络请求
+    this.getDataPage();
+  },
+};
+</script>
+
+<style>
+</style>

+ 606 - 0
src/views/pages/domainName/addDomainName/index.vue

@@ -0,0 +1,606 @@
+<template>
+  <div>
+    <el-dialog
+      title="域名管理"
+      :visible.sync="dialogVisible"
+      width="50%"
+      :before-close="closeDialog"
+    >
+      <div class="domain-registration-form">
+        <el-form
+          ref="domainForm"
+          :model="domainInformation"
+          :rules="rules"
+          label-width="120px"
+        >
+          <el-form-item label="域名" prop="domainName">
+            <el-input
+              v-model="domainInformation.domainName"
+              placeholder="请输入域名"
+              :disabled="flag === 2"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="域名券号" prop="domainCouponNumber">
+            <el-input
+              v-model="domainInformation.domainCouponNumber"
+              disabled
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="所有人" prop="owner">
+            <el-input
+              v-model="domainInformation.owner"
+              placeholder="请输入所有人"
+              :disabled="flag === 2"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="审核状态" prop="auditStatus">
+            <el-input
+              v-model="domainInformation.auditStatus"
+              disabled
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="域名申请日期" prop="applicationTime">
+            <el-date-picker
+              v-model="domainInformation.applicationTime"
+              type="date"
+              placeholder="选择日期"
+              :disabled="flag === 2"
+            ></el-date-picker>
+          </el-form-item>
+          <el-form-item label="代理机构" prop="agencyId">
+            <el-select
+              v-model="domainInformation.agencyId"
+              placeholder="请选择代理机构"
+              :disabled="flag === 2"
+            >
+              <el-option
+                v-for="item in agencyOptions"
+                :key="item.id"
+                :label="item.agencyName"
+                :value="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="续展日期" prop="renewalId">
+            <el-date-picker
+              v-model="domainInformation.renewalId"
+              type="date"
+              placeholder="选择日期"
+              :disabled="flag === 2"
+              value-format="yyyy-MM-dd"
+            ></el-date-picker>
+          </el-form-item>
+          <el-form-item label="续费时间" prop="renewalTime">
+            <el-date-picker
+              v-model="domainInformation.renewalTime"
+              type="date"
+              placeholder="选择日期"
+              :disabled="flag === 2"
+              value-format="yyyy-MM-dd"
+            ></el-date-picker>
+          </el-form-item>
+          <el-form-item label="续费金额" prop="renewalAmount">
+            <el-input
+              v-model.number="domainInformation.renewalAmount"
+              type="number"
+              placeholder="请输入续费金额"
+              :disabled="flag === 2"
+              @input="validateRenewalAmount"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="业务模式" prop="businessModel">
+            <el-input
+              v-model="domainInformation.businessModel"
+              placeholder="请输入业务模式,最多50字"
+              :disabled="flag === 2"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="使用部门" prop="departmentUsed">
+            <el-input
+              v-model="domainInformation.departmentUsed"
+              placeholder="请输入使用部门,最多50字"
+              :disabled="flag === 2"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="登记人">
+            <el-input v-model="domainInformation.registrar" disabled></el-input>
+          </el-form-item>
+          <el-form-item label="登记时间">
+            <el-input
+              v-model="domainInformation.registrationTime"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-form>
+        <!-- 费用信息表格 -->
+        <el-table :data="costList" style="width: 100%" align="center">
+          <el-table-column prop="costType" label="费用类型">
+            <template slot-scope="scope">
+              <el-input
+                v-model="scope.row.costType"
+                placeholder="请输入费用类型"
+                :disabled="flag === 2"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column prop="amount" label="金额">
+            <template slot-scope="scope">
+              <el-input
+                v-model.number="scope.row.amount"
+                type="number"
+                placeholder="请输入金额"
+                :disabled="flag === 2"
+                @input="validateAmount(scope.row)"
+              ></el-input>
+            </template>
+          </el-table-column>
+
+          <el-table-column prop="departmentAttributes" label="部门属性">
+            <template slot-scope="scope">
+              <el-input
+                v-model="scope.row.departmentAttributes"
+                placeholder="请输入部门属性"
+                :disabled="flag === 2"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column prop="budgetDepartment" label="预算部门">
+            <template slot-scope="scope">
+              <el-input
+                v-model="scope.row.budgetDepartment"
+                :disabled="flag === 2"
+                placeholder="请输入预算部门"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column prop="remarks" label="备注">
+            <template slot-scope="scope">
+              <el-input
+                v-model="scope.row.remarks"
+                :disabled="flag === 2"
+                placeholder="请输入备注"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column label="操作">
+            <template slot-scope="scope">
+              <el-button
+                v-if="flag !== 2"
+                size="mini"
+                type="text"
+                @click="handleRemove(scope.$index, scope.row)"
+                >删除</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <!-- 添加按钮 -->
+        <el-button
+          style="margin-top: 20px"
+          @click="addCostItem"
+          v-if="flag === 0 || flag === 1"
+          >添加费用信息</el-button
+        >
+
+        <!-- 操作按钮 -->
+        <div class="form-footer">
+          <el-button type="primary" @click="saveForm" v-if="flag === 0"
+            >存为草稿</el-button
+          >
+          <el-button
+            type="success"
+            @click="publishForm"
+            v-if="flag === 0 || flag === 1"
+            >提交审核</el-button
+          >
+          <el-button @click="closeDialog">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { sortByUp } from "../../../../components/performance/common/js/method";
+import {
+  findOrganization,
+  insertDnmDomainInformationAndCost,
+  selectDnmDomainInformationCostById,
+  checkDomainName,
+  generateDomainCouponNumber,
+  updateDnmDomainInformationAndCost,
+  deleteCostById,
+} from "@/api/dmn";
+import { MessageBox, Message } from "element-ui";
+export default {
+  name: "AddDomainName",
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      required: true,
+    },
+    id: {
+      type: Number,
+      required: true,
+    },
+    flag: {
+      type: Number,
+      required: true,
+    },
+  },
+  data() {
+    return {
+      domainInformation: {
+        domainName: "",
+        domainCouponNumber: "",
+        owner: "",
+        auditStatus: "",
+        applicationTime: "",
+        agencyId: null,
+        renewalId: "",
+        renewalTime: "",
+        renewalAmount: "",
+        businessModel: "",
+        departmentUsed: "",
+        registrar: "",
+        registrationTime: "",
+        accountId: "",
+        auditor: "",
+        defalg: "",
+        draftStatusTypeId: null,
+        costInformationId: null,
+      },
+      costList: [],
+      agencyOptions: [
+        { id: 1, agencyName: "代理机构1" },
+
+        { id: 2, agencyName: "代理机构2" },
+      ],
+      rules: {
+        domainName: [
+          { required: true, message: "请输入域名", trigger: "blur" },
+          { validator: this.checkDomainNameByNet, trigger: "blur" },
+        ],
+        owner: [{ required: true, message: "请输入所有人", trigger: "blur" }],
+        applicationTime: [
+          { required: true, message: "请选择域名申请日期", trigger: "change" },
+        ],
+        agencyId: [
+          { required: true, message: "请选择代理机构", trigger: "change" },
+        ],
+      },
+    };
+  },
+
+  methods: {
+    async checkDomainNameByNet(rule, value, callback) {
+      await checkDomainName(
+        { domainName: this.domainInformation.domainName },
+        (data) => {
+          if (data == "该域名已存在") {
+            console.log("该域名已存在");
+            Message({
+              type: "error",
+              message: "该域名已存在",
+            });
+            this.domainInformation.domainName = "";
+            callback(new Error("该域名已存在"));
+          } else {
+            callback();
+          }
+        },
+        (error) => {
+          console.warn(error);
+          Message({
+            type: "error",
+            message: "系统异常,请联系管理员!",
+          });
+        },
+        (exception) => {
+          console.warn(exception);
+          Message({
+            type: "error",
+            message: "系统异常管理员,请联系管理员!",
+          });
+        }
+      );
+    },
+    publishForm() {
+      if (this.flag == 0) {
+        console.log("提交");
+        // 保存主表单的逻辑
+        this.$refs["domainForm"].validate((valid) => {
+          if (valid) {
+            // 提交主表单和费用信息的数据
+            this.domainInformation.draftStatusTypeId = 0;
+            this.domainInformation.costInformationId = 1;
+            this.domainInformation.defalg = "0";
+            this.domainInformation.auditStatus = "待审核";
+            // 发布表单逻辑
+            this.insertDnmDomainInformationAndCostByNet();
+            this.$emit("closeDialog", false);
+            Message({
+              type: "success",
+              message: "提交成功",
+            });
+          } else {
+            this.$message.error("表单验证失败,请检查输入");
+          }
+        });
+      }
+      if (this.flag == 1) {
+        console.log("修改");
+        // 保存主表单的逻辑
+        this.$refs["domainForm"].validate((valid) => {
+          if (valid) {
+            // 提交主表单和费用信息的数据
+            this.domainInformation.draftStatusTypeId = 0;
+            this.domainInformation.costInformationId = 1;
+            this.domainInformation.defalg = "0";
+            this.domainInformation.auditStatus = "待审核";
+            // 发布表单逻辑
+            this.updateDnmDomainInformationAndCostByNet();
+            this.$emit("closeDialog", false);
+            Message({
+              type: "success",
+              message: "提交成功",
+            });
+          } else {
+            this.$message.error("表单验证失败,请检查输入");
+          }
+        });
+      } else {
+        this.$message.error("系统异常");
+      }
+    },
+    saveForm() {
+      // 保存主表单的逻辑
+      this.$refs["domainForm"].validate((valid) => {
+        if (valid) {
+          // 提交主表单和费用信息的数据
+          this.domainInformation.draftStatusTypeId = 0;
+          this.domainInformation.costInformationId = 1;
+          this.domainInformation.defalg = "0";
+          this.domainInformation.auditStatus = "草稿";
+          // 发布表单逻辑
+          this.insertDnmDomainInformationAndCostByNet();
+          Message({
+            type: "success",
+            message: "提交成功",
+          });
+          this.$emit("closeDialog", false);
+        } else {
+          this.$message.error("表单验证失败,请检查输入");
+        }
+      });
+    },
+    validateRenewalAmount() {
+      if (this.formData.renewalAmount < 0) {
+        // 如果输入的值小于0,则将其设为0或者其他合适的处理方式
+        this.domainInformation.renewalAmount = 0; // 或者可以显示提示信息
+      }
+    },
+    validateAmount(row) {
+      if (row.amount < 0) {
+        // 如果输入的金额为负数,则将其设为0或其他适当的处理方式
+        row.amount = 0; // 或者可以显示提示信息
+      }
+    },
+    // 添加费用字表
+    addCostItem() {
+      console.log("费用字表信息添加");
+      this.costList.push({
+        dnmDomainInformationId: null,
+        costType: "",
+        amount: "",
+        departmentAttributes: "",
+        budgetDepartment: "",
+        remarks: "",
+      });
+    },
+    handleRemove(index, row) {
+      console.log("删除");
+      if (this.flag == 1) {
+        console.log("编辑状态删除消费字表");
+        console.log(row);
+        let params = {
+          id: row.id,
+        };
+        deleteCostById(
+          params,
+          (response) => {
+            console.log(response);
+            // 显示删除成功的提示消息
+            Message({
+              type: "success",
+              message: "删除成功!",
+            });
+          },
+          (error) => {
+            console.warn(error);
+            Message({
+              type: "error",
+              message: "删除失败,请稍后重试!",
+            });
+          },
+          (exception) => {
+            console.warn(exception);
+            Message({
+              type: "error",
+              message: "删除异常,请联系管理员!",
+            });
+          }
+        );
+      }
+      this.costList.splice(index, 1);
+    },
+    closeDialog() {
+      this.$emit("closeDialog", false);
+    },
+    handleClose(done) {
+      // 关闭弹窗前的逻辑,比如重置表单数据
+      this.resetForm();
+      done();
+    },
+    resetForm() {
+      this.formData = {
+        domain: "",
+        couponNumber: "",
+        owner: "",
+        reviewStatus: "待审核",
+        applicationDate: "",
+        agency: "",
+      };
+      this.costs = [
+        { costType: "", amount: "", department: "", remark: "" },
+        { costType: "", amount: "", department: "", remark: "" },
+      ];
+    },
+    async findOrganizationByNet() {
+      await await findOrganization(
+        {},
+        (response) => {
+          this.agencyOptions = response;
+
+          // this.pageSize = response.pageSize;
+        },
+        (error) => {
+          console.warn(error);
+        },
+        (exception) => {
+          console.warn(exception);
+        }
+      );
+    },
+    async insertDnmDomainInformationAndCostByNet() {
+      await insertDnmDomainInformationAndCost(
+        {
+          domainInformation: this.domainInformation,
+          costList: this.costList,
+        },
+        (response) => {
+          console.log(response);
+
+          // this.pageSize = response.pageSize;
+        },
+        (error) => {
+          console.warn(error);
+        },
+        (exception) => {
+          console.warn(exception);
+        }
+      );
+    },
+    async updateDnmDomainInformationAndCostByNet() {
+      await updateDnmDomainInformationAndCost(
+        {
+          domainInformation: this.domainInformation,
+          costList: this.costList,
+        },
+        (response) => {
+          console.log(response);
+
+          // this.pageSize = response.pageSize;
+        },
+        (error) => {
+          console.warn(error);
+        },
+        (exception) => {
+          console.warn(exception);
+        }
+      );
+    },
+    async getDnmDomainInformationAndCostByNet(id) {
+      let params = {
+        id: id,
+      };
+      await selectDnmDomainInformationCostById(
+        params,
+        (response) => {
+          console.log(response);
+          this.costList = response.costList;
+          this.domainInformation = response.domainInformation;
+        },
+        (error) => {
+          console.warn(error);
+          Message({
+            type: "error",
+            message: "系统异常,请联系管理员!",
+          });
+        },
+        (exception) => {
+          console.warn(exception);
+          Message({
+            type: "error",
+            message: "系统异常管理员,请联系管理员!",
+          });
+        }
+      );
+    },
+    async generateDomainCouponNumberByNet() {
+      await generateDomainCouponNumber(
+        {},
+        (data) => {
+          this.domainInformation.domainCouponNumber = data || 2024079;
+        },
+        (error) => {
+          console.warn(error);
+          Message({
+            type: "error",
+            message: "系统异常,请联系管理员!",
+          });
+        },
+        (exception) => {
+          console.warn(exception);
+          Message({
+            type: "error",
+            message: "系统异常管理员,请联系管理员!",
+          });
+        }
+      );
+    },
+  },
+  watch: {
+    id: {
+      handler(newVal, oldVal) {
+        console.log("id 发生改变了:", newVal);
+        this.getDnmDomainInformationAndCostByNet(newVal);
+      },
+      deep: true,
+    },
+  },
+  mounted() {
+    // 获取当前日期
+    let currentDate = new Date();
+    // 格式化成 "YYYY-MM-DD" 的日期格式
+    let formattedDate = currentDate.toISOString().slice(0, 10);
+    // 更新 registrationTime 字段
+    this.domainInformation.registrationTime = formattedDate;
+    console.log(formattedDate);
+    this.domainInformation.registrar = JSON.parse(
+      sessionStorage.getItem("sysUserInfo")
+    ).UserName;
+    console.log(JSON.parse(sessionStorage.getItem("sysUserInfo")).UserName);
+    // 获取唯一卷号
+    this.generateDomainCouponNumberByNet();
+    this.domainInformation.accountId = JSON.parse(
+      sessionStorage.getItem("sysUserInfo")
+    ).LoginCode;
+    this.domainInformation.auditor = JSON.parse(
+      sessionStorage.getItem("sysUserInfo")
+    ).UserName;
+    this.domainInformation.auditStatus = "待审核";
+    this.findOrganizationByNet();
+    this.$on("openDialog", (value) => {
+      console.log("接收到的值:", value);
+    });
+  },
+};
+</script>
+
+<style scoped>
+.form-footer {
+  margin-top: 20px;
+}
+</style>

+ 351 - 0
src/views/pages/domainName/index.vue

@@ -0,0 +1,351 @@
+<template>
+  <div>
+    <!-- 高级搜索按钮 -->
+    <el-button type="text" @click="showAdvancedSearch = !showAdvancedSearch">
+      高级搜索
+      <i :class="['el-icon-arrow-' + (showAdvancedSearch ? 'up' : 'down')]"></i>
+    </el-button>
+
+    <!-- 高级搜索表单 -->
+    <!-- 高级搜索表单 -->
+    <el-form :inline="true" class="search-form" v-show="showAdvancedSearch">
+      <el-form-item label="域名">
+        <el-input
+          v-model="searchForm.domainName"
+          placeholder="请输入域名"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="域名券号">
+        <el-input
+          v-model="searchForm.domainCouponNumber"
+          placeholder="请输入域名券号"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="所有人">
+        <el-input
+          v-model="searchForm.owner"
+          placeholder="请输入所有人"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="审核状态">
+        <el-select
+          v-model="searchForm.auditStatus"
+          placeholder="请选择审核状态"
+        >
+          <el-option label="草稿" value="草稿"></el-option>
+          <el-option label="已发布" value="已发布"></el-option>
+          <el-option label="待审核" value="待审核"></el-option>
+          <el-option label="未通过" value="未通过"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="域名申请日期">
+        <el-date-picker
+          v-model="searchForm.dateRange"
+          type="daterange"
+          value-format="yyyy-MM-dd"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          style="width: 260px"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" @click="handleSearch">查找</el-button>
+        <el-button @click="handleReset">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <!-- 新建按钮 -->
+    <el-button type="primary" @click="openDialog">新建域名</el-button>
+        <!-- <el-button type="info" @click="openDialog">导出</el-button> -->
+    <!-- 查询结果表格 -->
+    <el-table :data="tableData" stripe style="width: 100%">
+      <el-table-column label="序号" width="60">
+        <template slot-scope="{ row, index }">
+          {{ typeof index === "number" ? index + 1 : "" }}
+        </template>
+      </el-table-column>
+      <el-table-column prop="domainName" label="域名"></el-table-column>
+      <el-table-column
+        prop="domainCouponNumber"
+        label="域名券号"
+      ></el-table-column>
+      <el-table-column prop="owner" label="所有人"></el-table-column>
+      <el-table-column
+        prop="auditStatus"
+        label="审核状态"
+        :formatter="formatStatus"
+      >
+        <template slot-scope="{ row }">
+          <span v-html="formatStatus(row)"></span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="applicationTime"
+        label="域名申请日期"
+        sortable
+      ></el-table-column>
+      <el-table-column prop="accountId" label="账户ID"></el-table-column>
+      <el-table-column label="操作">
+        <template slot-scope="{ row }">
+          <el-button type="text" size="small" @click="handleView(row)"
+            >查看</el-button
+          >
+          <el-button
+            v-if="row.auditStatus !== '待审核' && row.auditStatus !== '已发布'"
+            type="text"
+            size="small"
+            @click="handleEdit(row)"
+          >
+            编辑
+          </el-button>
+          <el-button
+            v-show="row.auditStatus !== '待审核'"
+            type="text"
+            size="small"
+            @click="handleDelete(row)"
+            >删除</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      background
+      layout="prev, pager, next,total"
+      :current-page="page"
+      :page-size="pageSize"
+      :total="total"
+      align="center"
+      @current-change="handleCurrentChange"
+    >
+    </el-pagination>
+    <!-- 域名管理新建弹窗组件 -->
+    <AddDomainName
+      :dialogVisible="dialogVisible"
+      :id="domainId"
+      :flag="domainFlag"
+      @closeDialog="closeDialog"
+    />
+  </div>
+</template>
+
+<script>
+import AddDomainName from "@/views/pages/domainName/addDomainName";
+import {
+  searchDomainsByPage,
+  deleteDnmDomainInformationById,
+} from "@/api/dmn";
+import { MessageBox, Message } from "element-ui";
+export default {
+  components: {
+    AddDomainName,
+  },
+  data() {
+    return {
+      showAdvancedSearch: true,
+      searchForm: {
+        domainName: "",
+        domainCouponNumber: "",
+        owner: "",
+        auditStatus: "",
+        dateRange: [],
+      },
+      dialogVisible: false,
+      tableData: [
+        // 域名管理数据
+      ],
+      page: 1, // 当前页数
+      pageSize: 5, // 每页显示条数
+      total: 1000, // 总条数
+      data: {},
+      domainId: "",
+      domainFlag: 0,
+    };
+  },
+  methods: {
+    handleSearch() {
+      // 处理搜索逻辑,根据searchForm中的条件进行过滤查询
+      // 可以根据searchForm中的条件发送请求到后端进行数据查询
+      let params = {};
+      // 添加非空的搜索条件到 params 对象中
+      if (this.searchForm.domainName !== "") {
+        params.domainName = this.searchForm.domainName;
+      }
+      if (this.searchForm.domainCouponNumber !== "") {
+        params.domainCouponNumber = this.searchForm.domainCouponNumber;
+      }
+      if (this.searchForm.owner !== "") {
+        params.owner = this.searchForm.owner;
+      }
+      if (this.searchForm.auditStatus !== "") {
+        params.auditStatus = this.searchForm.auditStatus;
+      }
+      if (this.searchForm.dateRange.length === 2) {
+        params.startDate = this.searchForm.dateRange[0];
+        params.endDate = this.searchForm.dateRange[1];
+      }
+      params.page = this.page;
+      params.pageSize = this.pageSize;
+      this.getDataPage(params);
+    },
+    handleCurrentChange(newPage) {
+      console.log(newPage);
+     // 处理搜索逻辑,根据searchForm中的条件进行过滤查询
+      // 可以根据searchForm中的条件发送请求到后端进行数据查询
+      let params = {};
+      // 添加非空的搜索条件到 params 对象中
+      if (this.searchForm.domainName !== "") {
+        params.domainName = this.searchForm.domainName;
+      }
+      if (this.searchForm.domainCouponNumber !== "") {
+        params.domainCouponNumber = this.searchForm.domainCouponNumber;
+      }
+      if (this.searchForm.owner !== "") {
+        params.owner = this.searchForm.owner;
+      }
+      if (this.searchForm.auditStatus !== "") {
+        params.auditStatus = this.searchForm.auditStatus;
+      }
+      if (this.searchForm.dateRange.length === 2) {
+        params.startDate = this.searchForm.dateRange[0];
+        params.endDate = this.searchForm.dateRange[1];
+      }
+      params.page = newPage;
+      params.pageSize = this.pageSize;
+      this.getDataPage(params);
+    },
+    handleReset() {
+      // 处理重置搜索条件逻辑
+      this.searchForm = {
+        domainName: "",
+        domainCouponNumber: "",
+        owner: "",
+        auditStatus: "",
+        dateRange: [],
+      };
+    },
+    async handleEdit(row) {
+      this.dialogVisible = true;
+      this.domainFlag = 1;
+      this.domainId = row.id;
+    },
+    async handleDelete(row) {
+      try {
+        await this.$confirm("此操作将永久删除该条数据,是否继续?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+
+        // 用户点击了确定按钮,执行删除操作
+        let params = {
+          id: row.id,
+        };
+
+        await deleteDnmDomainInformationById(
+          params,
+          (response) => {
+            console.log(response);
+            // 显示删除成功的提示消息
+            Message({
+              type: "success",
+              message: "删除成功!",
+            });
+          },
+          (error) => {
+            console.warn(error);
+            Message({
+              type: "error",
+              message: "删除失败,请稍后重试!",
+            });
+          },
+          (exception) => {
+            console.warn(exception);
+            Message({
+              type: "error",
+              message: "删除异常,请联系管理员!",
+            });
+          }
+        );
+      } catch (error) {
+        // 用户点击了取消按钮或者点击了关闭按钮
+        console.log("取消删除");
+      }
+      // 重新获取数据渲染
+      this.getDataPage();
+    },
+    formatStatus(row) {
+      switch (row.auditStatus) {
+        case "已发布":
+       return '<span style="color: green; font-weight: bold;">已发布</span>';
+        case "草稿":
+          return '<span style="color: blue; font-weight: bold;">草稿</span>';
+        case "未通过":
+          return '<span style="color: red; font-weight: bold;">未通过</span>';
+        default:
+          return row.auditStatus;
+      }
+    },
+    handleView(row) {
+      // 处理查看操作,跳转到详细信息页面或者弹出详情框
+      console.log("View:", row);
+       this.dialogVisible = true;
+      this.domainFlag = 2;
+      this.domainId = row.id;
+    },
+    handleCreate() {
+      // 处理新建操作,跳转到新建页面或者弹出新建框
+      console.log("Create new domain");
+    },
+    handleExport() {
+      // 处理导出操作,根据当前搜索条件导出数据
+      console.log("Export data");
+    },
+    openDialog() {
+      console.log("打开");
+       this.domainFlag = 0;
+      this.dialogVisible = true;
+    },
+    closeDialog(data) {
+      console.log(data);
+      console.log("关闭");
+      this.dialogVisible = false;
+      // 重新获取数据
+      this.getDataPage();
+    },
+    async getDataPage(
+      params = {
+        page: 1, // 当前页数
+        pageSize: 5, // 每页显示条数
+      }
+    ) {
+      await searchDomainsByPage(
+        params,
+        (response) => {
+          console.log(response);
+          this.tableData = response.list;
+          this.total = response.total;
+          this.page = response.pageNum;
+          // this.pageSize = response.pageSize;
+        },
+        (error) => {
+          console.warn(error);
+        },
+        (exception) => {
+          console.warn(exception);
+        }
+      );
+    },
+  },
+  mounted() {
+    // 发起网络请求
+    this.getDataPage();
+  },
+};
+</script>
+
+<style scoped>
+.search-form {
+  margin-bottom: 20px;
+}
+</style>