110 1 year ago
parent
commit
345f070e3f

+ 177 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/kehudemo/controller/ItdmKehuController.java

@@ -0,0 +1,177 @@
+package org.jeecg.modules.kehudemo.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.kehudemo.entity.ItdmKehu;
+import org.jeecg.modules.kehudemo.service.IItdmKehuService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: 客户管理
+ * @Author: jeecg-boot
+ * @Date:   2023-05-17
+ * @Version: V1.0
+ */
+@Api(tags="客户管理")
+@RestController
+@RequestMapping("/kehudemo/itdmKehu")
+@Slf4j
+public class ItdmKehuController extends JeecgController<ItdmKehu, IItdmKehuService> {
+	@Autowired
+	private IItdmKehuService itdmKehuService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param itdmKehu
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "客户管理-分页列表查询")
+	@ApiOperation(value="客户管理-分页列表查询", notes="客户管理-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<ItdmKehu>> queryPageList(ItdmKehu itdmKehu,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<ItdmKehu> queryWrapper = QueryGenerator.initQueryWrapper(itdmKehu, req.getParameterMap());
+		Page<ItdmKehu> page = new Page<ItdmKehu>(pageNo, pageSize);
+		IPage<ItdmKehu> pageList = itdmKehuService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param itdmKehu
+	 * @return
+	 */
+	@AutoLog(value = "客户管理-添加")
+	@ApiOperation(value="客户管理-添加", notes="客户管理-添加")
+	//@RequiresPermissions("org.jeecg.modules:itdm_kehu:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody ItdmKehu itdmKehu) {
+		itdmKehuService.save(itdmKehu);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param itdmKehu
+	 * @return
+	 */
+	@AutoLog(value = "客户管理-编辑")
+	@ApiOperation(value="客户管理-编辑", notes="客户管理-编辑")
+	//@RequiresPermissions("org.jeecg.modules:itdm_kehu:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody ItdmKehu itdmKehu) {
+		itdmKehuService.updateById(itdmKehu);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "客户管理-通过id删除")
+	@ApiOperation(value="客户管理-通过id删除", notes="客户管理-通过id删除")
+	//@RequiresPermissions("org.jeecg.modules:itdm_kehu:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		itdmKehuService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "客户管理-批量删除")
+	@ApiOperation(value="客户管理-批量删除", notes="客户管理-批量删除")
+	//@RequiresPermissions("org.jeecg.modules:itdm_kehu:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.itdmKehuService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "客户管理-通过id查询")
+	@ApiOperation(value="客户管理-通过id查询", notes="客户管理-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<ItdmKehu> queryById(@RequestParam(name="id",required=true) String id) {
+		ItdmKehu itdmKehu = itdmKehuService.getById(id);
+		if(itdmKehu==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(itdmKehu);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param itdmKehu
+    */
+    //@RequiresPermissions("org.jeecg.modules:itdm_kehu:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, ItdmKehu itdmKehu) {
+        return super.exportXls(request, itdmKehu, ItdmKehu.class, "客户管理");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("itdm_kehu:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, ItdmKehu.class);
+    }
+
+}

+ 84 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/kehudemo/entity/ItdmKehu.java

@@ -0,0 +1,84 @@
+package org.jeecg.modules.kehudemo.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: 客户管理
+ * @Author: jeecg-boot
+ * @Date:   2023-05-17
+ * @Version: V1.0
+ */
+@Data
+@TableName("itdm_kehu")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="itdm_kehu对象", description="客户管理")
+public class ItdmKehu implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private java.lang.String id;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private java.lang.String createBy;
+	/**创建日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+    private java.util.Date createTime;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private java.lang.String updateBy;
+	/**更新日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新日期")
+    private java.util.Date updateTime;
+	/**所属部门*/
+    @ApiModelProperty(value = "所属部门")
+    private java.lang.String sysOrgCode;
+	/**客户姓名*/
+	@Excel(name = "客户姓名", width = 15)
+    @ApiModelProperty(value = "客户姓名")
+    private java.lang.String kehuName;
+	/**客户所在公司*/
+	@Excel(name = "客户所在公司", width = 15)
+    @ApiModelProperty(value = "客户所在公司")
+    private java.lang.String kehuHos;
+	/**客户职务*/
+	@Excel(name = "客户职务", width = 15)
+    @ApiModelProperty(value = "客户职务")
+    private java.lang.String kehuZhiwu;
+	/**客户地址*/
+	@Excel(name = "客户地址", width = 15)
+    @ApiModelProperty(value = "客户地址")
+    private java.lang.String kehuAddress;
+	/**客户电话*/
+	@Excel(name = "客户电话", width = 15)
+    @ApiModelProperty(value = "客户电话")
+    private java.lang.String kehuNum;
+	/**客户时间*/
+	@Excel(name = "客户时间", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "客户时间")
+    private java.util.Date kehuDate;
+}

+ 17 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/kehudemo/mapper/ItdmKehuMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.kehudemo.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.kehudemo.entity.ItdmKehu;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 客户管理
+ * @Author: jeecg-boot
+ * @Date:   2023-05-17
+ * @Version: V1.0
+ */
+public interface ItdmKehuMapper extends BaseMapper<ItdmKehu> {
+
+}

+ 5 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/kehudemo/mapper/xml/ItdmKehuMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.kehudemo.mapper.ItdmKehuMapper">
+
+</mapper>

+ 14 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/kehudemo/service/IItdmKehuService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.kehudemo.service;
+
+import org.jeecg.modules.kehudemo.entity.ItdmKehu;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 客户管理
+ * @Author: jeecg-boot
+ * @Date:   2023-05-17
+ * @Version: V1.0
+ */
+public interface IItdmKehuService extends IService<ItdmKehu> {
+
+}

+ 19 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/kehudemo/service/impl/ItdmKehuServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.kehudemo.service.impl;
+
+import org.jeecg.modules.kehudemo.entity.ItdmKehu;
+import org.jeecg.modules.kehudemo.mapper.ItdmKehuMapper;
+import org.jeecg.modules.kehudemo.service.IItdmKehuService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 客户管理
+ * @Author: jeecg-boot
+ * @Date:   2023-05-17
+ * @Version: V1.0
+ */
+@Service
+public class ItdmKehuServiceImpl extends ServiceImpl<ItdmKehuMapper, ItdmKehu> implements IItdmKehuService {
+
+}

+ 204 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/kehudemo/vue/ItdmKehuList.vue

@@ -0,0 +1,204 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('客户管理')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <itdm-kehu-modal ref="modalForm" @ok="modalFormOk"></itdm-kehu-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import ItdmKehuModal from './modules/ItdmKehuModal'
+
+  export default {
+    name: 'ItdmKehuList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      ItdmKehuModal
+    },
+    data () {
+      return {
+        description: '客户管理管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'客户姓名',
+            align:"center",
+            dataIndex: 'kehuName'
+          },
+          {
+            title:'客户所在公司',
+            align:"center",
+            dataIndex: 'kehuHos'
+          },
+          {
+            title:'客户职务',
+            align:"center",
+            dataIndex: 'kehuZhiwu'
+          },
+          {
+            title:'客户地址',
+            align:"center",
+            dataIndex: 'kehuAddress'
+          },
+          {
+            title:'客户电话',
+            align:"center",
+            dataIndex: 'kehuNum'
+          },
+          {
+            title:'客户时间',
+            align:"center",
+            dataIndex: 'kehuDate',
+            customRender:function (text) {
+              return !text?"":(text.length>10?text.substr(0,10):text)
+            }
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/kehudemo/itdmKehu/list",
+          delete: "/kehudemo/itdmKehu/delete",
+          deleteBatch: "/kehudemo/itdmKehu/deleteBatch",
+          exportXlsUrl: "/kehudemo/itdmKehu/exportXls",
+          importExcelUrl: "kehudemo/itdmKehu/importExcel",
+          
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'string',value:'kehuName',text:'客户姓名',dictCode:''})
+        fieldList.push({type:'string',value:'kehuHos',text:'客户所在公司',dictCode:''})
+        fieldList.push({type:'string',value:'kehuZhiwu',text:'客户职务',dictCode:''})
+        fieldList.push({type:'string',value:'kehuAddress',text:'客户地址',dictCode:''})
+        fieldList.push({type:'string',value:'kehuNum',text:'客户电话',dictCode:''})
+        fieldList.push({type:'date',value:'kehuDate',text:'客户时间'})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 26 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/kehudemo/vue/ItdmKehu_menu_insert.sql

@@ -0,0 +1,26 @@
+-- 注意:该页面对应的前台目录为views/kehudemo文件夹下
+-- 如果你想更改到其他目录,请修改sql中component字段对应的值
+
+
+INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
+VALUES ('202305170511210480', NULL, '客户管理', '/kehudemo/itdmKehuList', 'module-iTDM/kehudemo/ItdmKehuList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 1, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-05-17 17:11:48', NULL, NULL, 0);
+
+-- 权限控制sql
+-- 新增
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('202305170511210481', '202305170511210480', '新增', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:itdm_kehu:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-17 17:11:48', NULL, NULL, 0, 0, '1', 0);
+-- 编辑
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('202305170511210482', '202305170511210480', '编辑', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:itdm_kehu:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-17 17:11:48', NULL, NULL, 0, 0, '1', 0);
+-- 删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('202305170511210483', '202305170511210480', '删除', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:itdm_kehu:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-17 17:11:48', NULL, NULL, 0, 0, '1', 0);
+-- 批量删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('202305170511210484', '202305170511210480', '批量删除', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:itdm_kehu:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-17 17:11:48', NULL, NULL, 0, 0, '1', 0);
+-- 导出excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('202305170511210485', '202305170511210480', '导出excel', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:itdm_kehu:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-17 17:11:48', NULL, NULL, 0, 0, '1', 0);
+-- 导入excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('202305170511210486', '202305170511210480', '导入excel', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:itdm_kehu:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-17 17:11:48', NULL, NULL, 0, 0, '1', 0);

+ 129 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/kehudemo/vue/modules/ItdmKehuForm.vue

@@ -0,0 +1,129 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="客户姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="kehuName">
+              <a-input v-model="model.kehuName" placeholder="请输入客户姓名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="客户所在公司" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="kehuHos">
+              <a-input v-model="model.kehuHos" placeholder="请输入客户所在公司"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="客户职务" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="kehuZhiwu">
+              <a-input v-model="model.kehuZhiwu" placeholder="请输入客户职务"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="客户地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="kehuAddress">
+              <a-input v-model="model.kehuAddress" placeholder="请输入客户地址"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="客户电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="kehuNum">
+              <a-input v-model="model.kehuNum" placeholder="请输入客户电话"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="客户时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="kehuDate">
+              <j-date placeholder="请选择客户时间" v-model="model.kehuDate"  style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'ItdmKehuForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+        },
+        url: {
+          add: "/kehudemo/itdmKehu/add",
+          edit: "/kehudemo/itdmKehu/edit",
+          queryById: "/kehudemo/itdmKehu/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+         
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/kehudemo/vue/modules/ItdmKehuModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <itdm-kehu-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></itdm-kehu-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import ItdmKehuForm from './ItdmKehuForm'
+
+  export default {
+    name: 'ItdmKehuModal',
+    components: {
+      ItdmKehuForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/kehudemo/vue/modules/ItdmKehuModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <itdm-kehu-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></itdm-kehu-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import ItdmKehuForm from './ItdmKehuForm'
+  export default {
+    name: 'ItdmKehuModal',
+    components: {
+      ItdmKehuForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>