瀏覽代碼

Merge branch '20221116_sun补贴管理导入新增' of sckj/mz-cloud into master

15143018065 2 年之前
父節點
當前提交
a77e3130bc

+ 28 - 4
ruoyi-modules/mz-business-btgl/src/main/java/com/ruoyi/business/domain/ZwywBtglGlbt.java

@@ -35,7 +35,7 @@ public class ZwywBtglGlbt extends BaseEntity
     private static final long serialVersionUID = 1L;
 
     /** 主键标识 */
-    @Excel(name = "主键标识")
+//    @Excel(name = "主键标识")
     @TableId(value = "id",type = IdType.ASSIGN_UUID)
     @ApiModelProperty(value = "主键标识")
     private String id;
@@ -147,12 +147,32 @@ public class ZwywBtglGlbt extends BaseEntity
     private String bfje;
 
     /** 头像 */
-    @Excel(name = "头像")
+//    @Excel(name = "头像")
     @ApiModelProperty(value = "头像", required = true)
-    @NotBlank(message = "{头像}",groups = AddGroup.class)
+//    @NotBlank(message = "{头像}",groups = AddGroup.class)
     @Size(min = 1, max = 100, message = "{头像}")
     private String tx;
 
+    /** 开户银行代码(C0044) */
+    @Excel(name = "开户银行代码", dictType = "C0044")
+    @ApiModelProperty(value = "开户银行代码(C0044)", required = true)
+    @DictV(type = "C0044",message = "{开户银行代码}")
+    private String khyh;
+
+    /** 银行账号 */
+    @Excel(name = "银行账号")
+    @ApiModelProperty(value = "银行账号")
+    @Size(max = 19, message = "{银行账号}")
+    @EncryptionV
+    private String yhzh;
+
+    /** 开户名称 */
+    @Excel(name = "开户名称")
+    @ApiModelProperty(value = "开户名称", required = true)
+    @Size(min = 1, max = 72, message = "{开户名称}")
+    @EncryptionV
+    private String khmc;
+
     /** 社区(村)审核结果(CZ002) */
     @Excel(name = "社区(村)审核结果", dictType = "CZ002")
     @ApiModelProperty(value = "社区(村)审核结果(CZ002)")
@@ -239,10 +259,14 @@ public class ZwywBtglGlbt extends BaseEntity
     private String tfyy;
 
     /** 申请状态(XZ111) */
-    @Excel(name = "申请状态", dictType = "XZ111")
+//    @Excel(name = "申请状态", dictType = "XZ111")
     @ApiModelProperty(value = "申请状态(XZ111)")
     private String status;
 
+    @ApiModelProperty(value = "附件")
+    @Size(max = 500, message = "{附件}")
+    private String fj;
+
     @TableField(exist = false)
     private String age;
 

+ 7 - 7
ruoyi-modules/mz-business-btgl/src/main/java/com/ruoyi/business/domain/ZwywBtglLrbtgl.java

@@ -35,7 +35,7 @@ public class ZwywBtglLrbtgl extends BaseEntity
     private static final long serialVersionUID = 1L;
 
     /** 主键标识 */
-    @Excel(name = "主键标识")
+//    @Excel(name = "主键标识")
     @TableId(value = "id",type = IdType.ASSIGN_UUID)
     @ApiModelProperty(value = "主键标识")
     private String id;
@@ -305,39 +305,39 @@ public class ZwywBtglLrbtgl extends BaseEntity
     private String dbrdh;
 
     /** 受理结果(CZ004) */
-    @Excel(name = "受理结果", dictType = "CZ004")
+//    @Excel(name = "受理结果", dictType = "CZ004")
     @ApiModelProperty(value = "受理结果(CZ004)")
     @DictV(type = "CZ004",message = "{受理结果}")
     private String sljg;
 
     /** 受理意见 */
-    @Excel(name = "受理意见")
+//    @Excel(name = "受理意见")
     @ApiModelProperty(value = "受理意见")
     @Size(max = 100, message = "{受理意见}")
 
     private String slyj;
 
     /** 审核结果(CZ002) */
-    @Excel(name = "审核结果", dictType = "CZ002")
+//    @Excel(name = "审核结果", dictType = "CZ002")
     @ApiModelProperty(value = "审核结果(CZ002)")
     @DictV(type = "CZ002",message = "{审核结果}")
     private String shjg;
 
     /** 审核意见 */
-    @Excel(name = "审核意见")
+//    @Excel(name = "审核意见")
     @ApiModelProperty(value = "审核意见")
     @Size(max = 200, message = "{审核意见}")
 
     private String shyj;
 
     /** 审批结果(XZ074) */
-    @Excel(name = "审批结果", dictType = "XZ074")
+//    @Excel(name = "审批结果", dictType = "XZ074")
     @ApiModelProperty(value = "审批结果(XZ074)")
     @DictV(type = "XZ074",message = "{审批结果}")
     private String spjg;
 
     /** 审批意见 */
-    @Excel(name = "审批意见")
+//    @Excel(name = "审批意见")
     @ApiModelProperty(value = "审批意见")
     @Size(max = 200, message = "{审批意见}")
     private String spyj;

+ 1 - 0
ruoyi-modules/mz-business-btgl/src/main/java/com/ruoyi/business/service/IZwywBtglGlbtService.java

@@ -54,4 +54,5 @@ public interface IZwywBtglGlbtService
      */
     public int deleteZwywBtglGlbtByIds(String[] ids);
 
+    public String importZwywBtglGlbt(List<ZwywBtglGlbt> glbtList);
 }

+ 41 - 0
ruoyi-modules/mz-business-btgl/src/main/java/com/ruoyi/business/service/impl/ZwywBtglGlbtServiceImpl.java

@@ -6,8 +6,10 @@ import com.ruoyi.business.mapper.ZwywBtglGlbtMapper;
 import com.ruoyi.business.service.IZwywBtglGlbtService;
 import com.ruoyi.common.core.constant.SecurityConstants;
 import com.ruoyi.common.core.context.SecurityContextHolder;
+import com.ruoyi.common.core.exception.ServiceException;
 import com.ruoyi.common.core.utils.DateUtils;
 import com.ruoyi.common.security.utils.EncryptionUtils;
+import com.ruoyi.common.security.utils.ImportUtils;
 import com.ruoyi.common.security.utils.SecurityUtils;
 import com.ruoyi.system.api.RemoteUserService;
 import com.ruoyi.system.api.enums.AdvancedStatus;
@@ -15,6 +17,7 @@ import com.ruoyi.system.api.enums.DeptLevelStatus;
 import com.ruoyi.system.api.enums.ExamineStatus;
 import com.ruoyi.system.api.model.LoginUser;
 import com.ruoyi.system.mapper.SysDeptJlMapper;
+import io.seata.common.util.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -182,4 +185,42 @@ public class ZwywBtglGlbtServiceImpl implements IZwywBtglGlbtService
         return zwywBtglGlbtMapper.deleteBatchIds(Arrays.asList(ids));
     }
 
+    @Override
+    public String importZwywBtglGlbt(List<ZwywBtglGlbt> glbtList) {
+        StringBuilder msg = new StringBuilder();
+        if (CollectionUtils.isEmpty(glbtList)) {
+            throw new ServiceException("导入数据不能为空!");
+        }
+        long count = glbtList.stream().distinct().count();
+        if (count < glbtList.size()) {
+            throw new ServiceException("导入的Excel有重复信息,请检查。");
+        }
+        for (ZwywBtglGlbt n: glbtList){
+            msg.append(ImportUtils.checkAndTrans(n));
+            ZwywBtglGlbt glbt = new ZwywBtglGlbt();
+            glbt.setXzqh(n.getXzqh());
+            glbt.setSqrZjhm(SecurityUtils.sm4encrypt_ECB(EncryptionUtils.key, n.getSqrZjhm()));
+            glbt.setStatus(AdvancedStatus.MONTH.getCode());
+            if (CollectionUtils.isNotEmpty(zwywBtglGlbtMapper.selectList(new LambdaQueryWrapper<>(glbt)))){
+                msg.append("<").append("证件号码:").append(n.getSqrZjhm()).append(" >已存在当前系统中,请修改。");
+            }
+            if (StringUtils.isEmpty(n.getBfje())) {
+                n.setBfje(null);
+            }
+            if (StringUtils.isEmpty(n.getBfys())) {
+                n.setBfys(null);
+            }
+            n.setStatus(AdvancedStatus.MONTH.getCode());
+        }
+        if (StringUtils.isNotEmpty(msg)) {
+            msg.insert(0, "很抱歉,导入失败!错误如下:<br />");
+            throw new ServiceException(msg.toString());
+        }
+        glbtList.forEach(zwywBtglGlbtMapper::insert);
+        msg.insert(0, "恭喜您,数据已全部导入成功!共 " + glbtList.size() + " 条,数据如下:<br />");
+        for (ZwywBtglGlbt n: glbtList){
+            msg.append("姓名: ").append(n.getSqrXm()).append(" 导入成功 <br />");
+        }
+        return msg.toString();
+    }
 }

+ 4 - 0
ruoyi-modules/mz-business-btgl/src/main/resources/mapper/business/ZwywBtglGlbtMapper.xml

@@ -35,6 +35,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="tfsj"    column="tfsj"    />
         <result property="tfyy"    column="tfyy"    />
         <result property="status"    column="status"    />
+        <result property="khyh"    column="khyh"    />
+        <result property="yhzh"    column="yhzh"    />
+        <result property="khmc"    column="khmc"    />
+        <result property="fj"    column="fj"    />
         <result property="createTimeStr"    column="create_time_str"    />
         <result property="createUserId"    column="create_user_id"    />
         <result property="createBy"    column="create_by"    />

+ 19 - 0
ruoyi-modules/mz-business/src/main/java/com/ruoyi/business/controller/ZwywBtglGlbtController.java

@@ -13,8 +13,10 @@ import com.ruoyi.system.validate.group.AddGroup;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 import java.util.List;
 
 /**
@@ -97,4 +99,21 @@ public class ZwywBtglGlbtController extends BaseController
     {
         return toAjax(zwywBtglGlbtService.deleteZwywBtglGlbtByIds(ids));
     }
+
+    @Log(title = "高龄补贴导入",businessType = BusinessType.IMPORT)
+    @RequiresPermissions("business:glbt:importData")
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws Exception{
+        ExcelUtil<ZwywBtglGlbt> util = new ExcelUtil<>(ZwywBtglGlbt.class);
+        List<ZwywBtglGlbt> zwywBtglGlbtlList = util.importExcel(file.getInputStream());
+        String message = zwywBtglGlbtService.importZwywBtglGlbt(zwywBtglGlbtlList);
+        return AjaxResult.success(message);
+    }
+
+    @PostMapping("/importTemplate")
+    public void importTemplate(HttpServletResponse response) throws IOException
+    {
+        ExcelUtil<ZwywBtglGlbt> util = new ExcelUtil<ZwywBtglGlbt>(ZwywBtglGlbt.class);
+        util.importTemplateExcel(response, "高龄补贴信息");
+    }
 }

+ 8 - 0
ruoyi-modules/mz-business/src/main/java/com/ruoyi/business/controller/ZwywBtglLrbtglController.java

@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 import java.util.List;
 
 /**
@@ -183,4 +184,11 @@ public class ZwywBtglLrbtglController extends BaseController
         String message = zwywBtglLrbtglService.importZwywBtglLrbtgl(ZwywBtglLrbtglList);
         return AjaxResult.success(message);
     }
+
+    @PostMapping("/importTemplate")
+    public void importTemplate(HttpServletResponse response) throws IOException
+    {
+        ExcelUtil<ZwywBtglLrbtgl> util = new ExcelUtil<ZwywBtglLrbtgl>(ZwywBtglLrbtgl.class);
+        util.importTemplateExcel(response, "老人补贴资金受理信息");
+    }
 }

+ 121 - 8
ruoyi-ui/src/views/business/btgl/glbt/index.vue

@@ -30,6 +30,10 @@
         <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
           v-hasPermi="['business:glbt:add']">新增</el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleImport"
+          v-hasPermi="['business:glbt:importData']">导入</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -127,6 +131,20 @@
               <td>补发金额</td>
               <td>{{ form.bfje }}</td>
             </tr>
+            <tr>
+              <td>开户银行</td>
+              <td>{{ translateDict('C0044', form.khyh) }}</td>
+              <td>银行账号</td>
+              <td>{{ form.yhzh }}</td>
+            </tr>
+            <tr>
+              <td>开户名称</td>
+              <td>{{ form.khmc }}</td>
+              <td>附件</td>
+              <td>
+                <file-upload v-model="form.fj" :isFile="false"></file-upload>
+              </td>
+            </tr>
           </table>
           <h3>审核信息</h3>
           <table class="table">
@@ -236,6 +254,20 @@
               <td>补发金额</td>
               <td>{{ form.bfje }}</td>
             </tr>
+            <tr>
+              <td>开户银行</td>
+              <td>{{ translateDict('C0044', form.khyh) }}</td>
+              <td>银行账号</td>
+              <td>{{ form.yhzh }}</td>
+            </tr>
+            <tr>
+              <td>开户名称</td>
+              <td>{{ form.khmc }}</td>
+              <td>附件</td>
+              <td>
+                <file-upload v-model="form.fj" :isFile="false"></file-upload>
+              </td>
+            </tr>
           </table>
 
           <div v-if="!shFlg && !tfFlg">
@@ -313,6 +345,23 @@
                 <number placeholder="补发金额" v-model.sync="form.bfje" :min="0" :max="10000000000" :precision="2" />
               </el-form-item>
             </div>
+            <div class="flexBox">
+              <el-form-item label="开户银行" prop="khyh" class="formWidth2">
+                <el-cascader :props="props" :options="dict.tree.C0044" v-model="form.khyh" placeholder="请选择开户银行">
+                </el-cascader>
+              </el-form-item>
+              <el-form-item label="银行账号" prop="yhzh" class="formWidth2">
+                <el-input v-model="form.yhzh" placeholder="请输入银行账号" />
+              </el-form-item>
+            </div>
+            <div class="flexBox">
+              <el-form-item label="开户名称" prop="khmc" class="formWidth2">
+                <el-input v-model="form.khmc" placeholder="请输入开户名称" />
+              </el-form-item>
+              <el-form-item label="附件">
+                <file-upload v-model="form.fj" />
+              </el-form-item>
+            </div>
             <div class="flexBox">
               <el-form-item label="头像" prop="tx" class="formWidth2">
                 <image-upload v-model="form.tx" />
@@ -448,6 +497,25 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 用户导入对话框 -->
+    <el-dialog v-dialog-drag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url"
+        :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess"
+        :auto-upload="false" drag>
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip text-center" slot="tip">
+          <span>仅允许导入xls、xlsx格式文件。</span>
+          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
+            @click="importTemplate">下载模板</el-link>
+        </div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -461,10 +529,11 @@ import {
 } from "@/api/business/btgl/glbt";
 import { chineseOne, idCard, Regular } from "@/utils/regular";
 import { decryptData_ECB, decryptRowData_ECB } from "@/api/tool/sm4";
+import { getToken } from '@/utils/auth';
 
 export default {
   name: "Glbt",
-  dicts: ["CZ035", "CZ002", "C0007", "C0032", "XZ111"],
+  dicts: ["CZ035", "CZ002", "C0044", "C0007", "C0032", "XZ111"],
   data() {
     return {
       // 遮罩层
@@ -473,6 +542,10 @@ export default {
       activeNameDetails: 'firstDetails',
       // 选中数组
       ids: [],
+      props: {
+        emitPath: false,
+        checkStrictly: true
+      },
       // 非单个禁用
       single: true,
       // 非多个禁用
@@ -494,6 +567,21 @@ export default {
       mzFlg: false,
       openXq: false,
       openTf: false,
+      // 用户导入参数
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/business/glbt/importData"
+      },
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -605,7 +693,7 @@ export default {
     getList() {
       this.loading = true;
       listGlbt(this.queryParams).then((response) => {
-        this.glbtList = decryptRowData_ECB(response.rows, ["sqrXm", "jzdz", "sqrLxdh", "sqrZjhm", "dbrXm", "dbrZjhm", "dbrLxdh", "tfdbrXm", "tfbdrLxdh"], [1, 4, 3, 2, 1, 2, 3, 1, 3]);
+        this.glbtList = decryptRowData_ECB(response.rows, ["sqrXm", "jzdz", "sqrLxdh", "sqrZjhm", "dbrXm", "dbrZjhm", "dbrLxdh", "tfdbrXm", "tfbdrLxdh", "khmc", "yhzh"], [1, 4, 3, 2, 1, 2, 3, 1, 3, 1, 5]);
         this.total = response.total;
         this.loading = false;
       });
@@ -681,10 +769,10 @@ export default {
       this.reset();
       this.shFlg = false;
       this.tfFlg = false,
-      this.jdFlg = false,
-      this.shFlg = false,
-      this.mzFlg = false,
-      this.open = true;
+        this.jdFlg = false,
+        this.shFlg = false,
+        this.mzFlg = false,
+        this.open = true;
       this.title = "高龄补贴信息";
     },
     /** 修改按钮操作 */
@@ -707,7 +795,7 @@ export default {
       }
       const id = row.id || this.ids;
       getGlbt(id).then((response) => {
-        this.form = decryptData_ECB(response.data, ["sqrXm", "jzdz", "sqrLxdh", "sqrZjhm", "dbrXm", "dbrZjhm", "dbrLxdh", "tfdbrXm", "tfbdrLxdh"], [1, 4, 3, 2, 1, 2, 3, 1, 3]);
+        this.form = decryptData_ECB(response.data, ["sqrXm", "jzdz", "sqrLxdh", "sqrZjhm", "dbrXm", "dbrZjhm", "dbrLxdh", "tfdbrXm", "tfbdrLxdh", "khmc", "yhzh"], [1, 4, 3, 2, 1, 2, 3, 1, 3, 1, 5]);
         this.form.xzqh = JSON.stringify(this.form.xzqh.split(','))
         let copyData = {
           ...this.form,
@@ -725,7 +813,7 @@ export default {
       this.shFlg = false;
       const id = row.id || this.ids;
       getGlbt(id).then((response) => {
-        this.form = decryptData_ECB(response.data, ["sqrXm", "jzdz", "sqrLxdh", "sqrZjhm", "dbrXm", "dbrZjhm", "dbrLxdh", "tfdbrXm", "tfbdrLxdh"], [1, 4, 3, 2, 1, 2, 3, 1, 3]);
+        this.form = decryptData_ECB(response.data, ["sqrXm", "jzdz", "sqrLxdh", "sqrZjhm", "dbrXm", "dbrZjhm", "dbrLxdh", "tfdbrXm", "tfbdrLxdh", "khmc", "yhzh"], [1, 4, 3, 2, 1, 2, 3, 1, 3, 1, 5]);
         this.form.xzqh = JSON.stringify(this.form.xzqh.split(','))
         this.openXq = true;
         this.title = "高龄补贴信息";
@@ -788,6 +876,31 @@ export default {
         }
       });
     },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.title = "高龄津贴信息导入";
+      this.upload.open = true;
+    },
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
+      this.getList();
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      this.download('business/glbt/importTemplate', {
+      }, `高龄津贴信息_模板_${new Date().getTime()}.xlsx`)
+    },
     /** 删除按钮操作 */
     handleDelete(row, index) {
       const ids = row.id || this.ids;

+ 23 - 27
ruoyi-ui/src/views/business/btgl/lrbtgl/index.vue

@@ -20,7 +20,7 @@
       </el-col>
       <el-col :span="1.5">
         <el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport"
-                   v-has-permi="['business:lrbtgl:importData']">导入</el-button>
+          v-has-permi="['business:lrbtgl:importData']">导入</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
@@ -353,23 +353,15 @@
 
     <!-- 用户导入对话框 -->
     <el-dialog v-dialog-drag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
-      <el-upload
-        ref="upload"
-        :limit="1"
-        accept=".xlsx, .xls"
-        :headers="upload.headers"
-        :action="upload.url"
-        :disabled="upload.isUploading"
-        :on-progress="handleFileUploadProgress"
-        :on-success="handleFileSuccess"
-        :auto-upload="false"
-        drag
-      >
+      <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url"
+        :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess"
+        :auto-upload="false" drag>
         <i class="el-icon-upload"></i>
         <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
         <div class="el-upload__tip text-center" slot="tip">
           <span>仅允许导入xls、xlsx格式文件。</span>
-          <!--          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>-->
+          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
+            @click="importTemplate">下载模板</el-link>
         </div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -631,11 +623,11 @@ export default {
         // jg: [{ required: true, message: '籍贯不能为空', trigger: 'blur' }],
         jg: [
           {
-          validator: function (rule, value, callback) {
-            if (value) { value.length != 3 ? callback(new Error('籍贯必须填到区级')) : callback(); }else{callback()}
-          },
-          trigger: 'change'
-        }],
+            validator: function (rule, value, callback) {
+              if (value) { value.length != 3 ? callback(new Error('籍贯必须填到区级')) : callback(); } else { callback() }
+            },
+            trigger: 'change'
+          }],
         // xjd: [{ required: true, message: '现居地不能为空', trigger: 'blur' }],
         cjzh: [{ max: 20, message: '残疾证号不能超过20个字符', trigger: 'blur' }],
         sfcjsb: [{ required: true, message: '是否参加社保不能为空', trigger: 'change' }],
@@ -673,7 +665,7 @@ export default {
     getList() {
       this.loading = true
       listLrbtgl(this.queryParams).then((response) => {
-        this.lrbtglList = decryptRowData_ECB(response.rows, ["xm","zjhm","sjhm","gddh","hjdzms","jzdzms","cjzh","jhrxm","jhrsjhm","yhzh","khmc","dbrxm","dbrdh"], [1, 2, 3, 3, 4, 4, 5, 1, 2, 5, 1, 1, 2])
+        this.lrbtglList = decryptRowData_ECB(response.rows, ["xm", "zjhm", "sjhm", "gddh", "hjdzms", "jzdzms", "cjzh", "jhrxm", "jhrsjhm", "yhzh", "khmc", "dbrxm", "dbrdh"], [1, 2, 3, 3, 4, 4, 5, 1, 2, 5, 1, 1, 2])
         this.total = response.total
         this.loading = false
       })
@@ -768,7 +760,7 @@ export default {
       this.reset()
       const id = row.id || this.ids
       getLrbtgl(id).then((response) => {
-        this.form = decryptData_ECB(response.data, ["xm","zjhm","sjhm","gddh","hjdzms","jzdzms","cjzh","jhrxm","jhrsjhm","yhzh","khmc","dbrxm","dbrdh"], [1, 2, 3, 3, 4, 4, 5, 1, 2, 5, 1, 1, 2])
+        this.form = decryptData_ECB(response.data, ["xm", "zjhm", "sjhm", "gddh", "hjdzms", "jzdzms", "cjzh", "jhrxm", "jhrsjhm", "yhzh", "khmc", "dbrxm", "dbrdh"], [1, 2, 3, 3, 4, 4, 5, 1, 2, 5, 1, 1, 2])
         this.form.hjszd = JSON.stringify(this.form.hjszd.split(','))
         this.form.jg = JSON.stringify(this.form.jg.split(','))
         this.form.xjd = JSON.stringify(this.form.xjd.split(','))
@@ -791,8 +783,8 @@ export default {
       this.reset()
       const id = row.id || this.ids
       getLrbtgl(id).then((response) => {
-        this.xqForm = decryptData_ECB(response.data, ["xm","zjhm","sjhm","gddh","hjdzms","jzdzms","cjzh","jhrxm","jhrsjhm","yhzh","khmc","dbrxm","dbrdh"], [1, 2, 3, 3, 4, 4, 5, 1, 2, 5, 1, 1, 2])
-        console.log(this.xqForm,'handleUpdateXQ');
+        this.xqForm = decryptData_ECB(response.data, ["xm", "zjhm", "sjhm", "gddh", "hjdzms", "jzdzms", "cjzh", "jhrxm", "jhrsjhm", "yhzh", "khmc", "dbrxm", "dbrdh"], [1, 2, 3, 3, 4, 4, 5, 1, 2, 5, 1, 1, 2])
+        console.log(this.xqForm, 'handleUpdateXQ');
         this.openXQ = true
       })
     },
@@ -876,11 +868,11 @@ export default {
     //   this.download('organization/ygJbxx/importTemplate', {
     //   }, `员工基本信息_模板_${new Date().getTime()}.xlsx`)
     // },
-// 文件上传中处理
+    // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
       this.upload.isUploading = true;
     },
-// 文件上传成功处理
+    // 文件上传成功处理
     handleFileSuccess(response, file, fileList) {
       this.upload.open = false;
       this.upload.isUploading = false;
@@ -888,11 +880,15 @@ export default {
       this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
       this.getList();
     },
-// 提交上传文件
+    // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
     },
-
+    /** 下载模板操作 */
+    importTemplate() {
+      this.download('business/lrbtgl/importTemplate', {
+      }, `老人补贴资金受理信息_模板_${new Date().getTime()}.xlsx`)
+    },
     /** 删除按钮操作 */
     handleDelete(row, index) {
       const ids = row.id || this.ids