extend.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977
  1. <template>
  2. <div class="app-container">
  3. <div class="user-extend">
  4. <div class="info-box">
  5. <el-descriptions size="medium" border>
  6. <template #title>
  7. <h3 class="title">
  8. <i class="el-icon-collection-tag"></i>
  9. 基础信息
  10. </h3>
  11. </template>
  12. <el-descriptions-item v-for="v in dataInfo" :label="v.label" :key="v.key">{{ v.value }}</el-descriptions-item>
  13. <el-descriptions-item label="角色">{{ roleName }}</el-descriptions-item>
  14. <el-descriptions-item label="性别">{{ sex }}</el-descriptions-item>
  15. <el-descriptions-item label="状态">{{ status }}</el-descriptions-item>
  16. </el-descriptions>
  17. </div>
  18. <div class="info-box">
  19. <h3 class="title">
  20. <i class="el-icon-collection-tag"></i>
  21. 安保部门从业人员补充信息
  22. </h3>
  23. <el-form inline :model="formData" :rules="rules" ref="form" label-position="left" label-width="140px">
  24. <el-row>
  25. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  26. <el-form-item label="是否专职" prop="isFullTime">
  27. <el-radio-group v-model="formData.isFullTime">
  28. <el-radio
  29. v-for="dict in dict.type.sys_yes_no"
  30. :key="`${dict.value}`"
  31. :label="dict.value"
  32. >{{ dict.label }}</el-radio
  33. >
  34. </el-radio-group>
  35. </el-form-item>
  36. </el-col>
  37. <!-- </el-row>
  38. <el-row> -->
  39. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  40. <el-form-item label="所属部门" prop="deptId">
  41. <el-select style="width: 217px;" v-model="formData.deptId" placeholder="请选择所属部门">
  42. <el-option v-for="dict in dict.type.department_name" :key="dict.value" :label="dict.label"
  43. :value="dict.value" />
  44. </el-select>
  45. </el-form-item>
  46. </el-col>
  47. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  48. <el-form-item label="现任职务" prop="duties">
  49. <el-select style="width: 217px;" v-model="formData.duties" @change="changeDuties" placeholder="请选择现任职务">
  50. <el-option v-for="dict in dict.type.current_position" :key="dict.value" :label="dict.label"
  51. :value="dict.value" />
  52. </el-select>
  53. </el-form-item>
  54. </el-col>
  55. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  56. <el-form-item prop="entryTime" label="任现职日期">
  57. <el-date-picker style="width: 270px;" v-model="formData.entryTime" align="right"
  58. type="date" placeholder="选择任现职日期">
  59. </el-date-picker>
  60. </el-form-item>
  61. </el-col>
  62. <!-- </el-row>
  63. <el-row> -->
  64. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  65. <el-form-item label="用工形式" prop="workType">
  66. <el-select style="width: 217px;" v-model="formData.workType" placeholder="请选择用工形式">
  67. <el-option v-for="dict in dict.type.sys_work_type" :key="dict.value" :label="dict.label"
  68. :value="dict.value" />
  69. </el-select>
  70. </el-form-item>
  71. </el-col>
  72. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  73. <el-form-item label="学历取得方式" prop="educationType">
  74. <el-select style="width: 217px;" v-model="formData.educationType" placeholder="请选择学历取得方式">
  75. <el-option v-for="dict in dict.type.sys_education_type" :key="dict.value" :label="dict.label"
  76. :value="dict.value" />
  77. </el-select>
  78. </el-form-item>
  79. </el-col>
  80. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  81. <el-form-item label="最高学历" prop="highestEducation">
  82. <el-select style="width: 270px;" v-model="formData.highestEducation" placeholder="请选择最高学历">
  83. <el-option v-for="dict in dict.type.sys_highest_education" :key="dict.value" :label="dict.label"
  84. :value="dict.value" />
  85. </el-select>
  86. </el-form-item>
  87. </el-col>
  88. <!-- </el-row>
  89. <el-row> -->
  90. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  91. <el-form-item prop="bornTime" label="出生日期">
  92. <el-date-picker v-model="formData.bornTime" @change="startDateChanged"
  93. :picker-options="startDatepickerOptions" align="right" type="date" placeholder="选择出生日期">
  94. </el-date-picker>
  95. </el-form-item>
  96. </el-col>
  97. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  98. <el-form-item label="参加工作时间" prop="workTime">
  99. <el-date-picker style="width: 217px;" v-model="formData.workTime"
  100. align="right" type="date" placeholder="请选择参加工作时间">
  101. </el-date-picker>
  102. </el-form-item>
  103. </el-col>
  104. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  105. <el-form-item label="身份证号码" prop="idCard" >
  106. <el-input maxlength="18" style="width: 270px;" v-model="formData.idCard"
  107. placeholder="请输入身份证号码">
  108. </el-input>
  109. </el-form-item>
  110. </el-col>
  111. <!-- </el-row>
  112. <el-row> -->
  113. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  114. <el-form-item label="专业技术职业资格" label-width="240"
  115. prop="professionalQualifications">
  116. <el-input style="width: 240px;" maxlength="50" v-model="formData.professionalQualifications"
  117. placeholder="请输入初级以上证书名称">
  118. </el-input>
  119. </el-form-item>
  120. </el-col>
  121. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  122. <el-form-item label="金融安全防范工程专家" prop="financialExperts" label-width="240">
  123. <el-select style="width: 210px;" v-model="formData.financialExperts" placeholder="请选择金融安全防范工程专家">
  124. <el-option v-for="dict in dict.type.administrative_level" :key="dict.value" :label="dict.label"
  125. :value="dict.value" />
  126. </el-select>
  127. </el-form-item>
  128. </el-col>
  129. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  130. <el-form-item label="持证上岗通过情况" prop="certificateWork" label-width="180">
  131. <!-- <el-switch v-model="formData.certificateWork" @change="certificateWorkChanged" active-value="1" inactive-value="0"></el-switch> -->
  132. <el-radio-group v-model="formData.certificateWork" @change="certificateWorkChanged">
  133. <el-radio
  134. v-for="dict in dict.type.sys_yes_no_num"
  135. :key="`${dict.value}`"
  136. :label="dict.value"
  137. >{{ dict.label }}</el-radio
  138. >
  139. </el-radio-group>
  140. </el-form-item>
  141. </el-col>
  142. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  143. <el-form-item label="持证上岗未通过原因" v-if="formData.certificateWork == 0" label-width="240"
  144. prop="certificateFailReason">
  145. <el-select style="width: 225px;" v-model="formData.certificateFailReason" placeholder="请选择未通过原因">
  146. <el-option v-for="dict in dict.type.post_no_pass" :key="dict.value" :label="dict.label"
  147. :value="dict.value" />
  148. </el-select>
  149. </el-form-item>
  150. </el-col>
  151. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  152. <el-form-item v-if ="formData.duties==1" label="分管领导姓名" prop="responsibilitiesLeaderName">
  153. <el-input maxlength="50" style="width: 217px;" v-model="formData.responsibilitiesLeaderName"
  154. placeholder="请输入分管领导姓名">
  155. </el-input>
  156. </el-form-item>
  157. </el-col>
  158. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  159. <el-form-item v-if ="formData.duties==1" label="分管领导职务" prop="responsibilitiesLeaderDuties">
  160. <el-select style="width: 217px;" v-model="formData.responsibilitiesLeaderDuties" placeholder="请选择分管领导职务">
  161. <el-option v-for="dict in dict.type.sys_duties" :key="dict.value" :label="dict.label"
  162. :value="dict.value" />
  163. </el-select>
  164. </el-form-item>
  165. </el-col>
  166. </el-row>
  167. <!-- <el-row>
  168. <el-col :xs="24" :sm="24" :md="24" :lg="24">
  169. <el-form-item v-if="formData.certificateWork != 0" label="上传初级以上专业技术职业资格证书">
  170. <imgs-upload :limit="5" v-model="formData.qualificationCertificateUrl" :fileSize="2"></imgs-upload>
  171. </el-form-item>
  172. </el-col>
  173. </el-row> -->
  174. </el-form>
  175. </div>
  176. <div style="padding-top: 10px; margin-left: 42%">
  177. <el-button type="primary" @click="saveExtend" v-hasPermi="['system:information:edit']" size="small">提交</el-button>
  178. <el-button type="primary" @click="nosaveExtend" size="small">取消</el-button>
  179. </div>
  180. </div>
  181. </div>
  182. </template>
  183. <script>
  184. import uploadpng from "@/assets/images/upload.png";
  185. import uplpng from "@/assets/images/upl.png";
  186. import { getUser } from "@/api/system/user";
  187. import TreeSelect from '@riophae/vue-treeselect'
  188. import ImgsUpload from "@/components/ImgsUpload";
  189. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  190. import { deptTreeList } from "@/api/system/public";
  191. import { extendUserInformation } from "@/api/system/information";
  192. export default {
  193. dicts: ['administrative_level','sys_yes_no','sys_yes_no_num','sys_highest_education', "sys_work_type", "sys_duties", "sys_education_type", 'sys_department_type', 'post_no_pass', 'current_position','department_name'],
  194. fillter: {},
  195. components: { TreeSelect ,ImgsUpload},
  196. props: [],
  197. data() {
  198. return {
  199. startDatepickerOptions: {
  200. disabledDate(time) {
  201. const date = new Date();
  202. date.setTime(date.getTime() - 3600 * 1000 * 24);
  203. return time.getTime() >= date;
  204. },
  205. },
  206. endDatepickerOptions: {
  207. disabledDate: this.disabledDate,
  208. },
  209. //基础信息key
  210. infoKeys: [
  211. { label: '用户名称', key: 'username' },
  212. { label: '用户昵称', key: 'name' },
  213. { label: '工号', key: 'jobNumber' },
  214. // {label:'部门',key:'orgName'},
  215. { label: '手机', key: 'phone' },
  216. // {label:'性别',key:'gender'},
  217. // {label:'状态',key:'isLock'},
  218. { label: '机构', key: 'orgName' },
  219. ],
  220. dataInfo: [],
  221. formData: {
  222. deptId: null,
  223. duties: null,
  224. workType: null,
  225. isFullTime:"Y",
  226. highestEducation: null,
  227. educationType: null,
  228. certificateWork: "1",
  229. professionalQualifications: null,
  230. certificateFailReason: null,
  231. workTime: null,
  232. entryTime: null,
  233. bornTime: null,
  234. responsibilitiesLeaderName: null,
  235. responsibilitiesLeaderDuties: null,
  236. qualificationCertificateUrl: null,
  237. userId: null,
  238. financialExperts:null,
  239. },
  240. rules: {
  241. idCard:[
  242. { required: true, message: '请输入身份证号码', trigger: 'change'},
  243. { min: 18, message: "请输入18位身份证号码", trigger: "blur" },
  244. {
  245. validator: (rule, value, callback) => {
  246. if (
  247. this. checkIdCard(value)==false
  248. ) {
  249. callback(new Error("身份证号码格式不正确"));
  250. } else {
  251. callback();
  252. }
  253. },
  254. trigger: "blur",
  255. },
  256. ],
  257. deptId: [
  258. { required: true, message: '请选择所属部门', trigger: 'change' },
  259. ],
  260. duties: [
  261. { required: true, message: '请选择职务', trigger: 'change' },
  262. ],
  263. workType: [
  264. { required: true, message: '请选择用工形式', trigger: 'change' },
  265. ],
  266. isFullTime: [
  267. { required: true, message: '请选择是否专职', trigger: 'blur' },
  268. ],
  269. highestEducation: [
  270. { required: true, message: '请选择最高学历', trigger: 'change' },
  271. ],
  272. educationType: [
  273. { required: true, message: '请选择学历取得形式', trigger: 'change' },
  274. ],
  275. certificateWork: [
  276. { required: true, message: '请选择是否持证上岗', trigger: 'blur' },
  277. ],
  278. workTime: [
  279. { required: true, message: '请选择参加工作时间', trigger: 'blur' },
  280. ],
  281. entryTime: [
  282. { required: true, message: '请选择入职时间', trigger: 'change' }
  283. ],
  284. bornTime: [
  285. { required: true, message: '请选择出生时间', trigger: 'change' }
  286. ],
  287. responsibilitiesLeaderName: [
  288. { required: true, message: '请输入分管领导名字', trigger: 'change' }
  289. ],
  290. responsibilitiesLeaderDuties: [
  291. { required: true, message: '请选择分管领导职务', trigger: 'change' }
  292. ],
  293. qualificationCertificateUrl: [
  294. { required: true, message: '请选择上传资格证', trigger: 'change' }
  295. ],
  296. professionalQualifications: [
  297. { required: true, message: '请输入初级以上相关专业技术职业资格', trigger: 'change' }
  298. ],
  299. certificateFailReason: [
  300. { required: true, message: '请输入持证上岗未通过原因', trigger: 'change' }
  301. ],
  302. financialExperts: [
  303. { required: true, message: '请选择金融安全防范工程专家级别', trigger: 'change' }
  304. ],
  305. type: [
  306. { type: 'array', required: true, message: '请至少选择一个活动性质', trigger: 'change' }
  307. ],
  308. resource: [
  309. { required: true, message: '请选择活动资源', trigger: 'change' }
  310. ],
  311. desc: [
  312. { required: true, message: '请填写活动形式', trigger: 'blur' }
  313. ]
  314. },
  315. // 机构树选项
  316. deptList: undefined,
  317. // 遮罩层
  318. orgloading: true,
  319. // 选中数组
  320. orgids: [],
  321. // 选中数组
  322. Bankids: [],
  323. // 非单个停用
  324. single: true,
  325. // 非多个停用
  326. multiple: true,
  327. // 显示搜索条件
  328. showSearch: true,
  329. // 总条数
  330. total: 0,
  331. // 机构物防建设表格数据
  332. constructionList: [],
  333. // 银行物防建设表格数据
  334. BankPhysicalDefenseConstructionList: [],
  335. // 弹出层标题
  336. orgtitle: "",
  337. // 弹出层标题
  338. Banktitle: "",
  339. // 是否显示弹出层
  340. Bankopen: false,
  341. // 表单参数
  342. Bankform: {},
  343. // 是否显示弹出层
  344. orgopen: false,
  345. roleName: null,
  346. sex: null,
  347. status: null,
  348. // 表单参数
  349. orgform: {},
  350. //2个图片信息
  351. uploadp: uploadpng,
  352. uplp: uplpng,
  353. //下拉框生成信息
  354. orgTypes: {
  355. orgTyp1: { label: "营业网点", value: 0 },
  356. orgTyp2: { label: "监控中心", value: 1 },
  357. },
  358. businessLibraryTypes: {
  359. businessLibraryTyp1: { label: "1类业务库", value: 1 },
  360. businessLibraryTyp2: { label: "2类业务库", value: 2 },
  361. businessLibraryTyp3: { label: "3类业务库", value: 3 },
  362. },
  363. platformBrands: {
  364. platformBrand1: { label: "品牌1", value: 0 },
  365. platformBrand2: { label: "品牌2", value: 1 },
  366. },
  367. platformSupplierBrands: {
  368. platformSupplierBrand1: { label: "品牌1", value: 0 },
  369. platformSupplierBrand2: { label: "品牌2", value: 1 },
  370. },
  371. prop: "",
  372. propItem: "",
  373. row: "",
  374. imgs: []
  375. };
  376. },
  377. computed: {
  378. switchModel: {
  379. get() {
  380. return this.switchValue === 1; // 将0转换为false,1转换为true
  381. },
  382. set(value) {
  383. this.switchValue = value ? 1 : 0; // 将false转换为0,true转换为1
  384. },
  385. },
  386. },
  387. created() {
  388. this.getInfo();
  389. this.getDeptTreeList();
  390. },
  391. mounted() {
  392. },
  393. methods: {
  394. changeDuties(val){
  395. console.log(val);
  396. // this.formData.aloneDept = 'N'
  397. if(val!=1)
  398. {
  399. this.formData.responsibilitiesLeaderName="";
  400. this.formData.responsibilitiesLeaderDuties="";
  401. }
  402. },
  403. certificateWorkChanged(value)
  404. {
  405. if(value!=0)
  406. {
  407. this.formData.certificateFailReason="";
  408. }
  409. },
  410. //身份证
  411. checkIdCard(val){
  412. //是否为空
  413. if (val === '') {
  414. // Toast('请输入18位身份证号');
  415. return false;
  416. }
  417. if (val.length != 18) {
  418. // Toast('请输入18位身份证号');
  419. return false;
  420. }
  421. //检查号码是否符合规范,包括长度,类型
  422. if(this.isCardNo(val) === false){
  423. // Toast("证件号码不符合规范");
  424. return false;
  425. }
  426. //检查省份
  427. if(this.checkProvince(val) === false){
  428. // Toast("证件号码不对校验省份错误");
  429. return false;
  430. }
  431. //校验生日
  432. if(this.checkBirthday(val) === false){
  433. // Toast("证件号码校验生日错误");
  434. return false;
  435. }
  436. //检验位的检测
  437. if (this.checkParity(val) === false) {
  438. // Toast('您的身份证校验位不正确,请重新输入');
  439. return false;
  440. }
  441. },
  442. //检查号码是否符合规范,包括长度,类型
  443. isCardNo(data){
  444. //身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
  445. var reg = /(^\d{15}$)|(^\d{17}(\d|X)$)/;
  446. if (reg.test(data) === false) {
  447. return false;
  448. }
  449. return true;
  450. },
  451. //取身份证前两位,校验省份
  452. checkProvince(data) {
  453. var city={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江 ",
  454. 31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北",
  455. 43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏 ",
  456. 61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外 "};
  457. var province = data.substr(0,2);
  458. if (city[province] == undefined) {
  459. return false;
  460. }
  461. return true
  462. },
  463. //检查生日是否正确
  464. checkBirthday(data) {
  465. var len = data.length;
  466. //身份证15位时,次序为省(3位)市(3位)年(2位)月(2位)日(2位)校验位(3位),皆为数字
  467. if(len == '15')
  468. {
  469. var re_fifteen = /^(\d{6})(\d{2})(\d{2})(\d{2})(\d{3})$/;
  470. var arr_data = data.match(re_fifteen);
  471. var year = arr_data[2];
  472. var month = arr_data[3];
  473. var day = arr_data[4];
  474. var birthday = new Date('19'+year+'/'+month+'/'+day);
  475. return this.verifyBirthday('19'+year,month,day,birthday);
  476. }
  477. //身份证18位时,次序为省(3位)市(3位)年(4位)月(2位)日(2位)校验位(4位),校验位末尾可能为X
  478. if(len == '18')
  479. {
  480. var re_eighteen = /^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/;
  481. var arr_data = data.match(re_eighteen);
  482. var year = arr_data[2];
  483. var month = arr_data[3];
  484. var day = arr_data[4];
  485. var birthday = new Date(year+'/'+month+'/'+day);
  486. return this.verifyBirthday(year,month,day,birthday);
  487. }
  488. return false;
  489. },
  490. //校验日期
  491. verifyBirthday(year,month,day,birthday)
  492. {
  493. var now = new Date();
  494. var now_year = now.getFullYear();
  495. //年月日是否合理
  496. if(birthday.getFullYear() == year && (birthday.getMonth() + 1) == month && birthday.getDate() == day)
  497. {
  498. //判断年份的范围(0岁到130岁之间)
  499. var time = now_year - year;
  500. if(time >= 0 && time <= 150)
  501. {
  502. return true;
  503. }
  504. return false;
  505. }
  506. return false;
  507. },
  508. //校验位的检测
  509. checkParity(data)
  510. {
  511. //15位转18位
  512. data = this.changeFivteenToEighteen(data);
  513. var len = data.length;
  514. if(len == '18')
  515. {
  516. var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
  517. var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
  518. var cardTemp = 0, i, valnum;
  519. for(i = 0; i < 17; i ++)
  520. {
  521. cardTemp += data.substr(i, 1) * arrInt[i];
  522. }
  523. valnum = arrCh[cardTemp % 11];
  524. if (valnum == data.substr(17, 1))
  525. {
  526. return true;
  527. }
  528. return false;
  529. }
  530. return false;
  531. },
  532. //15位转18位身份证号
  533. changeFivteenToEighteen(data)
  534. {
  535. if(data.length == '15')
  536. {
  537. var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
  538. var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
  539. var cardTemp = 0, i;
  540. data = data.substr(0, 6) + '19' + data.substr(6, data.length - 6);
  541. for(i = 0; i < 17; i ++)
  542. {
  543. cardTemp += data.substr(i, 1) * arrInt[i];
  544. }
  545. data += arrCh[cardTemp % 11];
  546. return data;
  547. }
  548. return data;
  549. },
  550. getImgUrl(img) {
  551. this.imgs.push(img);
  552. console.log(this.imgs, 'imgs')
  553. },
  554. handleChange(value) {
  555. },
  556. //自定义数据
  557. tenantIdnormalizer(node, instanceId) {
  558. if (node.children && !node.children.length) {
  559. delete node.children
  560. }
  561. return {
  562. id: node.deptId,
  563. label: node.deptName,
  564. children: node.children
  565. }
  566. },
  567. getInfo() {
  568. getUser(this.$route.params.userId).then((data) => {
  569. if (!data.data) return;
  570. let res = data.data;
  571. this.dataInfo = this.infoKeys.map((v, i) => {
  572. v.value = res[v.key];
  573. return v
  574. })
  575. this.roleName = data.roleName;
  576. this.sex = data.sex;
  577. this.status = data.status;
  578. //console.log(data.information.qualificationCertificateUrl, '5555')
  579. //let img = data.information.qualificationCertificateUrl.split(',');
  580. this.formData = data.information;
  581. //this.formData.qualificationCertificateUrl = img.map((v, i) => { return this.imageUrl(v) });
  582. });
  583. },
  584. saveExtend() {
  585. this.formData.userId = this.$route.params.userId;
  586. // let imgs = JSON.parse(JSON.stringify(this.imgs));
  587. // let qualificationCertificateUrl = imgs.toString(',');
  588. this.$refs['form'].validate((valid) => {
  589. if (valid) {
  590. let data = {
  591. ...this.formData,
  592. // qualificationCertificateUrl
  593. }
  594. extendUserInformation(data).then(res => {
  595. this.$message.success('保存成功!')
  596. this.$router.go(-1)
  597. })
  598. }
  599. });
  600. },
  601. getExtendInfo() {
  602. getExtendByOrgId(this.$route.params.id).then((data) => {
  603. console.log(data.data);
  604. if (data.data != null) {
  605. this.orgType = data.data.orgType;
  606. this.weatherAreaCode = data.data.weatherAreaCode;
  607. this.premisesArea = data.data.premisesArea;
  608. this.ownership = data.data.ownership;
  609. this.outsideArea = data.data.outsideArea;
  610. this.askari = data.data.askari;
  611. this.remoteControl = data.data.remoteControl;
  612. this.selfServiceBank = data.data.selfServiceBank;
  613. this.lobbyEquipment = data.data.lobbyEquipment;
  614. this.wallPenetratingEquipment = data.data.wallPenetratingEquipment;
  615. this.extendId = data.data.id;
  616. }
  617. });
  618. },
  619. startDateChanged(time) {
  620. if (this.formData.bornTime > this.formData.entryTime) {
  621. if (null != this.formData.entryTime) {
  622. this.formData.entryTime = this.formData.bornTime;
  623. }
  624. }
  625. },
  626. disabledDate(time) {
  627. //小于开始日期禁止选择
  628. let bornTime = new Date();
  629. bornTime.setTime(bornTime.getTime() - 3600 * 1000 * 24);
  630. if (this.formData.bornTime) {
  631. bornTime = new Date(this.formatTime(this.formData.bornTime, 'YYYY-MM-DD'));
  632. bornTime.setTime(bornTime.getTime() - 3600 * 1000 * 24);
  633. }
  634. const date = new Date();
  635. date.setTime(date.getTime());
  636. return (!(new Date(bornTime).getTime() < time.getTime()) || !(time.getTime() < new Date(date).getTime()))
  637. },
  638. /** 查询机构下拉树结构 */
  639. getDeptTreeList() {
  640. deptTreeList().then(response => {
  641. this.deptList = response.data;
  642. this.defaultKeys = response.data[0];
  643. });
  644. },
  645. getOrgPhysicalDefenseConstructionInfo() {
  646. this.orgloading = true;
  647. let dat = { orgId: this.$route.params.id };
  648. listOrgPhysicalDefenseConstruction(dat).then((data) => {
  649. this.constructionList = data.rows;
  650. this.orgloading = false;
  651. });
  652. },
  653. getBankPhysicalDefenseConstructionInfo() {
  654. this.bankloading = true;
  655. let dat = { orgId: this.$route.params.id };
  656. listBankPhysicalDefenseConstruction(dat).then((data) => {
  657. this.BankPhysicalDefenseConstructionList = data.rows;
  658. this.bankloading = false;
  659. });
  660. },
  661. // 取消按钮
  662. Bankcancel() {
  663. this.Bankopen = false;
  664. this.Bankreset();
  665. },
  666. // 表单重置
  667. Bankreset() {
  668. this.Bankform = {
  669. id: null,
  670. standard: null,
  671. dateOfCompliance: null,
  672. certificateEvidence: null,
  673. certificate: null,
  674. evidence: null,
  675. createTime: null,
  676. updateTime: null,
  677. createBy: null,
  678. updateBy: null,
  679. orgId: null,
  680. };
  681. this.resetForm("Bankform");
  682. },
  683. // 多选框选中数据
  684. handleBankSelectionChange(selection) {
  685. this.Bankids = selection.map((item) => item.id);
  686. this.single = selection.length !== 1;
  687. this.multiple = !selection.length;
  688. },
  689. /** 新增按钮操作 */
  690. handleBankAdd() {
  691. this.Bankreset();
  692. this.Bankopen = true;
  693. this.Banktitle = "添加银行物防建设";
  694. },
  695. /** 修改按钮操作 */
  696. handleBankUpdate(row) {
  697. this.Bankreset();
  698. const id = row.id || this.Bankids;
  699. getBankPhysicalDefenseConstruction(id).then((response) => {
  700. this.Bankform = response.data;
  701. this.Bankopen = true;
  702. this.Banktitle = "修改银行物防建设";
  703. });
  704. },
  705. /** 提交按钮 */
  706. submitBankForm() {
  707. this.Bankform.orgId = this.$route.params.id;
  708. this.$refs["Bankform"].validate((valid) => {
  709. if (valid) {
  710. if (this.Bankform.id != null) {
  711. updateBankPhysicalDefenseConstruction(this.Bankform).then(
  712. (response) => {
  713. this.$modal.msgSuccess("修改成功");
  714. this.Bankopen = false;
  715. this.getBankPhysicalDefenseConstructionInfo();
  716. }
  717. );
  718. } else {
  719. addBankPhysicalDefenseConstruction(this.Bankform).then(
  720. (response) => {
  721. this.$modal.msgSuccess("新增成功");
  722. this.Bankopen = false;
  723. this.getBankPhysicalDefenseConstructionInfo();
  724. }
  725. );
  726. }
  727. }
  728. });
  729. },
  730. /** 删除按钮操作 */
  731. handleBankDelete(row) {
  732. const Bankids = row.id || this.Bankids;
  733. this.$modal
  734. .confirm('是否确认删除银行物防建设编号为"' + Bankids + '"的数据项?')
  735. .then(function () {
  736. return delBankPhysicalDefenseConstruction(Bankids);
  737. })
  738. .then(() => {
  739. this.getBankPhysicalDefenseConstructionInfo();
  740. this.$modal.msgSuccess("删除成功");
  741. })
  742. .catch(() => {
  743. });
  744. },
  745. // 表单重置
  746. orgreset() {
  747. this.orgform = {
  748. id: null,
  749. standard: null,
  750. dateOfCompliance: null,
  751. certificateEvidence: null,
  752. certificate: null,
  753. evidence: null,
  754. createTime: null,
  755. updateTime: null,
  756. createBy: null,
  757. updateBy: null,
  758. orgId: null,
  759. };
  760. this.resetForm("orgform");
  761. },
  762. // 取消按钮
  763. orgcancel() {
  764. this.orgopen = false;
  765. this.orgreset();
  766. },
  767. // 多选框选中数据
  768. handleOrgSelectionChange(selection) {
  769. this.orgids = selection.map((item) => item.id);
  770. this.single = selection.length !== 1;
  771. this.multiple = !selection.length;
  772. },
  773. /** 新增按钮操作 */
  774. handleOrgAdd() {
  775. this.orgreset();
  776. this.orgopen = true;
  777. this.orgtitle = "添加机构物防建设";
  778. },
  779. /** 修改按钮操作 */
  780. handleOrgUpdate(row) {
  781. this.orgreset();
  782. const id = row.id || this.orgids;
  783. getOrgPhysicalDefenseConstruction(id).then((response) => {
  784. this.orgform = response.data;
  785. this.orgopen = true;
  786. this.orgtitle = "修改机构物防建设";
  787. });
  788. },
  789. /** 提交按钮 */
  790. submitOrgForm() {
  791. this.orgform.orgId = this.$route.params.id;
  792. this.$refs["orgform"].validate((valid) => {
  793. if (valid) {
  794. if (this.orgform.id != null) {
  795. updateOrgPhysicalDefenseConstruction(this.orgform).then(
  796. (response) => {
  797. this.$modal.msgSuccess("修改成功");
  798. this.orgopen = false;
  799. this.getOrgPhysicalDefenseConstructionInfo();
  800. }
  801. );
  802. } else {
  803. addOrgPhysicalDefenseConstruction(this.orgform).then((response) => {
  804. this.$modal.msgSuccess("新增成功");
  805. this.orgopen = false;
  806. this.getOrgPhysicalDefenseConstructionInfo();
  807. });
  808. }
  809. }
  810. });
  811. },
  812. /** 删除按钮操作 */
  813. handleOrgDelete(row) {
  814. const orgids = row.id || this.orgids;
  815. this.$modal
  816. .confirm('是否确认删除机构物防建设编号为"' + orgids + '"的数据项?')
  817. .then(function () {
  818. return delOrgPhysicalDefenseConstruction(orgids);
  819. })
  820. .then(() => {
  821. this.getOrgPhysicalDefenseConstructionInfo();
  822. this.$modal.msgSuccess("删除成功");
  823. })
  824. .catch(() => {
  825. });
  826. },
  827. nosaveExtend() {
  828. this.$router.go(-1);
  829. },
  830. triggerFileInput() {
  831. this.$refs.fileInput.click();
  832. },
  833. async handleFileChange(event) {
  834. const file = event.target.files[0];
  835. if (!file) return;
  836. // 创建 FormData 对象并添加文件
  837. const formData = new FormData();
  838. formData.append('file', file);
  839. // // 发送文件到您的文件上传 API
  840. try {
  841. uploadFile(formData).then((res) => {
  842. console.log(res);
  843. // this.orgform.certificateEvidence = res.data;
  844. });
  845. // 处理上传成功的逻辑
  846. console.log('上传成功');
  847. } catch (error) {
  848. // 处理上传失败的逻辑
  849. console.log('上传失败');
  850. }
  851. // try {
  852. // const response = await request.post('http://localhost:9527/dev-api/file/file/upload', formData, {
  853. // headers: {
  854. // 'Content-Type': 'multipart/form-data',
  855. // },
  856. // });
  857. // // 处理上传成功的逻辑
  858. // console.log('上传成功', response);
  859. // } catch (error) {
  860. // // 处理上传失败的逻辑
  861. // console.log('上传失败', error);
  862. // }
  863. // 重置 input 元素,以便下次选择相同文件时仍能触发 change 事件
  864. event.target.value = '';
  865. },
  866. }
  867. };
  868. </script>
  869. <style scoped lang="scss">
  870. .user-extend{
  871. background-color: #fff;
  872. padding: 10px;
  873. }
  874. .title {
  875. font-size: 18px;
  876. text-align: left;
  877. color: #008CD6ff;
  878. height: 36px;
  879. line-height: 36px;
  880. padding-left: 8px;
  881. margin: 0;
  882. }
  883. .info-box {
  884. margin: 20px;
  885. }
  886. .demo-form-inline {}
  887. .dialog-footer {}
  888. .container {}
  889. .image-container {
  890. display: inline-block;
  891. width: 200px;
  892. margin-right: 20px;
  893. /* 设置与下一个div的水平间距 */
  894. }
  895. .zoom-image {
  896. transition: transform 0.3s ease;
  897. }
  898. .zoom-image:hover {
  899. transform: scale(1.02);
  900. }
  901. .border-color-change {
  902. border: 1px solid #ccc;
  903. transition: border-color 0.3s ease;
  904. }
  905. .border-color-change:hover {
  906. border-color: #1ea8e9;
  907. /* 您可以将此颜色更改为所需的颜色 */
  908. }
  909. </style>