extend.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724
  1. <template>
  2. <div class="app-container">
  3. <h3 class="title">编辑管理人员信息</h3>
  4. <div class="info-box">
  5. <el-descriptions>
  6. <el-descriptions-item v-for="v in dataInfo" :label="v.label" :key="v.key">{{ v.value }}</el-descriptions-item>
  7. <el-descriptions-item label="角色">{{ roleName }}</el-descriptions-item>
  8. <el-descriptions-item label="性别">{{ sex }}</el-descriptions-item>
  9. <el-descriptions-item label="状态">{{ status }}</el-descriptions-item>
  10. </el-descriptions>
  11. </div>
  12. <div class="info-box">
  13. <el-form inline :model="formData" :rules="rules" ref="form" label-position="left" label-width="140px">
  14. <el-row>
  15. <el-col :xs="24" :sm="12" :md="8" :lg="6">
  16. <el-form-item label="是否专职" prop="isFullTime">
  17. <el-switch v-model="formData.isFullTime" active-value="1" inactive-value="0"></el-switch>
  18. </el-form-item>
  19. </el-col>
  20. <el-col :xs="24" :sm="12" :md="8" :lg="6">
  21. <el-form-item label="是否持证上岗" prop="certificateWork">
  22. <el-switch v-model="formData.certificateWork" active-value="1" inactive-value="0"></el-switch>
  23. </el-form-item>
  24. </el-col>
  25. </el-row>
  26. <el-row>
  27. <el-col :xs="24" :sm="12" :md="8" :lg="6">
  28. <el-form-item label="所属部门" prop="deptId">
  29. <el-select style="width: 217px;" v-model="formData.deptId" placeholder="请选择">
  30. <el-option v-for="dict in dict.type.sys_department_type" :key="dict.value" :label="dict.label"
  31. :value="dict.value"/>
  32. </el-select>
  33. </el-form-item>
  34. </el-col>
  35. <el-col :xs="24" :sm="12" :md="8" :lg="6">
  36. <el-form-item label="现任职务" prop="duties">
  37. <el-select style="width: 217px;" v-model="formData.duties" placeholder="请选择">
  38. <el-option v-for="dict in dict.type.current_position" :key="dict.value" :label="dict.label"
  39. :value="dict.value"/>
  40. </el-select>
  41. </el-form-item>
  42. </el-col>
  43. <el-col :xs="24" :sm="12" :md="8" :lg="6">
  44. <el-form-item label="最高学历" prop="highestEducation">
  45. <el-select style="width: 217px;" v-model="formData.highestEducation" placeholder="请选择">
  46. <el-option v-for="dict in dict.type.sys_highest_education" :key="dict.value" :label="dict.label"
  47. :value="dict.value"/>
  48. </el-select>
  49. </el-form-item>
  50. </el-col>
  51. </el-row>
  52. <el-row>
  53. <el-col :xs="24" :sm="12" :md="8" :lg="6">
  54. <el-form-item label="用工形式" prop="workType">
  55. <el-select style="width: 217px;" v-model="formData.workType" placeholder="请选择">
  56. <el-option v-for="dict in dict.type.sys_work_type" :key="dict.value" :label="dict.label"
  57. :value="dict.value"/>
  58. </el-select>
  59. </el-form-item>
  60. </el-col>
  61. <el-col :xs="24" :sm="12" :md="8" :lg="6">
  62. <el-form-item label="学历取得方式" prop="educationType">
  63. <el-select style="width: 217px;" v-model="formData.educationType" placeholder="请选择">
  64. <el-option v-for="dict in dict.type.sys_education_type" :key="dict.value" :label="dict.label"
  65. :value="dict.value"/>
  66. </el-select>
  67. </el-form-item>
  68. </el-col>
  69. <el-col :xs="24" :sm="12" :md="8" :lg="6">
  70. <el-form-item label="初级以上相关专业技术职业资格" prop="professionalQualifications">
  71. <el-input style="width: 217px;" maxlength="50" v-model="formData.professionalQualifications"
  72. placeholder="请输入">
  73. </el-input>
  74. </el-form-item>
  75. </el-col>
  76. </el-row>
  77. <el-row>
  78. <el-col :xs="24" :sm="12" :md="8" :lg="6">
  79. <el-form-item label="持证上岗未通过原因" prop="certificateFailReason">
  80. <el-select style="width: 217px;" v-model="formData.certificateFailReason" placeholder="请选择">
  81. <el-option v-for="dict in dict.type.post_no_pass" :key="dict.value" :label="dict.label"
  82. :value="dict.value"/>
  83. </el-select>
  84. </el-form-item>
  85. </el-col>
  86. <el-col :xs="24" :sm="12" :md="8" :lg="6">
  87. <el-form-item style="width: 517px;" label="参加工作时间" prop="workTime">
  88. <el-date-picker clearable v-model="formData.workTime" @change="startDateChanged"
  89. :picker-options="startDatepickerOptions" type="date" value-format="yyyy-MM-dd HH:mm:ss"
  90. placeholder="请选择时间">
  91. </el-date-picker>
  92. </el-form-item>
  93. </el-col>
  94. <el-col :xs="24" :sm="12" :md="8" :lg="6">
  95. <el-form-item prop="bornTime" label="出生日期">
  96. <el-date-picker v-model="formData.bornTime" @change="startDateChanged"
  97. :picker-options="startDatepickerOptions" align="right" type="date" placeholder="选择开始日期">
  98. </el-date-picker>
  99. </el-form-item>
  100. </el-col>
  101. <el-col :xs="24" :sm="12" :md="8" :lg="6">
  102. <el-form-item prop="entryTime" label="现任职时间">
  103. <el-date-picker v-model="formData.entryTime" :picker-options="endDatepickerOptions" align="right"
  104. type="date" placeholder="选择结束日期">
  105. </el-date-picker>
  106. </el-form-item>
  107. </el-col>
  108. <el-col :xs="24" :sm="12" :md="8" :lg="6">
  109. <el-form-item label="分管领导姓名" prop="responsibilitiesLeaderName">
  110. <el-input style="width: 217px;" v-model="formData.responsibilitiesLeaderName" placeholder="请输入">
  111. </el-input>
  112. </el-form-item>
  113. </el-col>
  114. <el-col :xs="24" :sm="12" :md="8" :lg="6">
  115. <el-form-item label="分管领导职务" prop="responsibilitiesLeaderDuties">
  116. <el-select style="width: 217px;" v-model="formData.responsibilitiesLeaderDuties" placeholder="请选择">
  117. <el-option v-for="dict in dict.type.sys_duties" :key="dict.value" :label="dict.label"
  118. :value="dict.value"/>
  119. </el-select>
  120. </el-form-item>
  121. </el-col>
  122. </el-row>
  123. <el-row>
  124. <el-col :xs="24" :sm="12" :md="8" :lg="6">
  125. <el-form-item label="上传相关证书">
  126. <image-upload :limit="5" :value="formData.qualificationCertificateUrl" :fileSize="2"
  127. @input="getImgUrl"></image-upload>
  128. </el-form-item>
  129. </el-col>
  130. <!--<el-col :xs="24" :sm="12" :md="8" :lg="6">
  131. <el-form-item label="示例图">
  132. <div style="width: 280px;">
  133. <el-image :src="uplp"></el-image>
  134. </div>
  135. </el-form-item>
  136. </el-col>-->
  137. </el-row>
  138. </el-form>
  139. </div>
  140. <div style="margin-top: 50px; margin-left: 42%">
  141. <el-button type="primary" @click="saveExtend" v-hasPermi="['system:information:edit']" size="small">提交</el-button>
  142. <el-button type="primary" @click="nosaveExtend" size="small">取消</el-button>
  143. </div>
  144. </div>
  145. </template>
  146. <script>
  147. import uploadpng from "@/assets/images/upload.png";
  148. import uplpng from "@/assets/images/upl.png";
  149. import {getUser} from "@/api/system/user";
  150. import TreeSelect from '@riophae/vue-treeselect'
  151. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  152. import {deptTreeList} from "@/api/system/public";
  153. import {extendUserInformation} from "@/api/system/information";
  154. export default {
  155. props: [],
  156. components: {TreeSelect},
  157. dicts: ['sys_highest_education', "sys_work_type", "sys_duties", "sys_education_type", 'sys_department_type', 'post_no_pass','current_position'],
  158. data() {
  159. return {
  160. startDatepickerOptions: {
  161. disabledDate(time) {
  162. const date = new Date();
  163. date.setTime(date.getTime() - 3600 * 1000 * 24);
  164. return time.getTime() > date;
  165. },
  166. },
  167. endDatepickerOptions: {
  168. disabledDate: this.disabledDate,
  169. },
  170. //基础信息key
  171. infoKeys: [
  172. {label: '用户名称', key: 'username'},
  173. {label: '用户昵称', key: 'name'},
  174. {label: '工号', key: 'jobNumber'},
  175. // {label:'部门',key:'orgName'},
  176. {label: '手机', key: 'phone'},
  177. // {label:'性别',key:'gender'},
  178. // {label:'状态',key:'isLock'},
  179. {label: '机构', key: 'orgName'},
  180. ],
  181. dataInfo: [],
  182. formData: {
  183. deptId: null,
  184. duties: null,
  185. workType: null,
  186. isFullTime: "1",
  187. highestEducation: null,
  188. educationType: null,
  189. certificateWork: "1",
  190. professionalQualifications: null,
  191. certificateFailReason: null,
  192. workTime: null,
  193. entryTime: null,
  194. bornTime: null,
  195. responsibilitiesLeaderName: null,
  196. responsibilitiesLeaderDuties: null,
  197. qualificationCertificateUrl: null,
  198. userId: null,
  199. },
  200. rules: {
  201. deptId: [
  202. {required: true, message: '请选择所属部门', trigger: 'blur'},
  203. ],
  204. duties: [
  205. {required: true, message: '请选择职务', trigger: 'blur'},
  206. ],
  207. workType: [
  208. {required: true, message: '请选择用工形式', trigger: 'blur'},
  209. ],
  210. isFullTime: [
  211. {required: true, message: '请选择是否专职', trigger: 'blur'},
  212. ],
  213. highestEducation: [
  214. {required: true, message: '请选择最高学历', trigger: 'blur'},
  215. ],
  216. educationType: [
  217. {required: true, message: '请选择学历取得形式', trigger: 'blur'},
  218. ],
  219. certificateWork: [
  220. {required: true, message: '请选择是否持证上岗', trigger: 'blur'},
  221. ],
  222. workTime: [
  223. {required: true, message: '请选择参加工作时间', trigger: 'blur'},
  224. ],
  225. entryTime: [
  226. {required: true, message: '请选择入职时间', trigger: 'change'}
  227. ],
  228. bornTime: [
  229. {required: true, message: '请选择出生时间', trigger: 'change'}
  230. ],
  231. responsibilitiesLeaderName: [
  232. {required: true, message: '请输入分管领导名字', trigger: 'change'}
  233. ],
  234. responsibilitiesLeaderDuties: [
  235. {required: true, message: '请选择分管领导职务', trigger: 'change'}
  236. ],
  237. qualificationCertificateUrl: [
  238. {required: true, message: '请选择上传资格证', trigger: 'change'}
  239. ],
  240. professionalQualifications: [
  241. {required: true, message: '请输入初级以上相关专业技术职业资格', trigger: 'change'}
  242. ],
  243. certificateFailReason: [
  244. {required: true, message: '请输入持证上岗未通过原因', trigger: 'change'}
  245. ],
  246. date2: [
  247. {type: 'date', required: true, message: '请选择时间', trigger: 'change'}
  248. ],
  249. type: [
  250. {type: 'array', required: true, message: '请至少选择一个活动性质', trigger: 'change'}
  251. ],
  252. resource: [
  253. {required: true, message: '请选择活动资源', trigger: 'change'}
  254. ],
  255. desc: [
  256. {required: true, message: '请填写活动形式', trigger: 'blur'}
  257. ]
  258. },
  259. // 机构树选项
  260. deptList: undefined,
  261. // 遮罩层
  262. orgloading: true,
  263. // 选中数组
  264. orgids: [],
  265. // 选中数组
  266. Bankids: [],
  267. // 非单个禁用
  268. single: true,
  269. // 非多个禁用
  270. multiple: true,
  271. // 显示搜索条件
  272. showSearch: true,
  273. // 总条数
  274. total: 0,
  275. // 机构物防建设表格数据
  276. constructionList: [],
  277. // 银行物防建设表格数据
  278. BankPhysicalDefenseConstructionList: [],
  279. // 弹出层标题
  280. orgtitle: "",
  281. // 弹出层标题
  282. Banktitle: "",
  283. // 是否显示弹出层
  284. Bankopen: false,
  285. // 表单参数
  286. Bankform: {},
  287. // 是否显示弹出层
  288. orgopen: false,
  289. roleName: null,
  290. sex: null,
  291. status: null,
  292. // 表单参数
  293. orgform: {},
  294. //2个图片信息
  295. uploadp: uploadpng,
  296. uplp: uplpng,
  297. //下拉框生成信息
  298. orgTypes: {
  299. orgTyp1: {label: "营业网点", value: 0},
  300. orgTyp2: {label: "监控中心", value: 1},
  301. },
  302. businessLibraryTypes: {
  303. businessLibraryTyp1: {label: "1类业务库", value: 1},
  304. businessLibraryTyp2: {label: "2类业务库", value: 2},
  305. businessLibraryTyp3: {label: "3类业务库", value: 3},
  306. },
  307. platformBrands: {
  308. platformBrand1: {label: "品牌1", value: 0},
  309. platformBrand2: {label: "品牌2", value: 1},
  310. },
  311. platformSupplierBrands: {
  312. platformSupplierBrand1: {label: "品牌1", value: 0},
  313. platformSupplierBrand2: {label: "品牌2", value: 1},
  314. },
  315. prop: "",
  316. propItem: "",
  317. row: "",
  318. imgs: []
  319. };
  320. },
  321. computed: {
  322. switchModel: {
  323. get() {
  324. return this.switchValue === 1; // 将0转换为false,1转换为true
  325. },
  326. set(value) {
  327. this.switchValue = value ? 1 : 0; // 将false转换为0,true转换为1
  328. },
  329. },
  330. },
  331. created() {
  332. this.getInfo();
  333. this.getDeptTreeList();
  334. },
  335. mounted() {
  336. },
  337. methods: {
  338. getImgUrl(img) {
  339. this.imgs.push(img);
  340. console.log(this.imgs, 'imgs')
  341. },
  342. handleChange(value) {
  343. },
  344. //自定义数据
  345. tenantIdnormalizer(node, instanceId) {
  346. if (node.children && !node.children.length) {
  347. delete node.children
  348. }
  349. return {
  350. id: node.deptId,
  351. label: node.deptName,
  352. children: node.children
  353. }
  354. },
  355. getInfo() {
  356. getUser(this.$route.params.userId).then((data) => {
  357. console.log(data, 'userdata');
  358. if (!data.data) return;
  359. let res = data.data;
  360. this.dataInfo = this.infoKeys.map((v, i) => {
  361. v.value = res[v.key];
  362. return v
  363. })
  364. this.roleName = data.roleName;
  365. this.sex = data.sex;
  366. this.status = data.status;
  367. this.formData = data.information;
  368. });
  369. },
  370. saveExtend() {
  371. this.formData.userId = this.$route.params.userId;
  372. this.formData.qualificationCertificateUrl = this.imgs.toString(',');
  373. this.$refs['form'].validate((valid) => {
  374. if (valid) {
  375. extendUserInformation(this.formData).then(res => {
  376. this.$message.success('保存成功!')
  377. this.$router.go(-1)
  378. })
  379. }
  380. });
  381. },
  382. getExtendInfo() {
  383. getExtendByOrgId(this.$route.params.id).then((data) => {
  384. console.log(data.data);
  385. if (data.data != null) {
  386. this.orgType = data.data.orgType;
  387. this.weatherAreaCode = data.data.weatherAreaCode;
  388. this.premisesArea = data.data.premisesArea;
  389. this.ownership = data.data.ownership;
  390. this.outsideArea = data.data.outsideArea;
  391. this.askari = data.data.askari;
  392. this.remoteControl = data.data.remoteControl;
  393. this.selfServiceBank = data.data.selfServiceBank;
  394. this.lobbyEquipment = data.data.lobbyEquipment;
  395. this.wallPenetratingEquipment = data.data.wallPenetratingEquipment;
  396. this.extendId = data.data.id;
  397. }
  398. });
  399. },
  400. startDateChanged(time) {
  401. if (this.formData.bornTime > this.formData.entryTime) {
  402. this.formData.entryTime = this.formData.bornTime;
  403. }
  404. },
  405. disabledDate(time) {
  406. //小于开始日期禁止选择
  407. let bornTime = new Date();
  408. bornTime.setTime(bornTime.getTime() - 3600 * 1000 * 24);
  409. if (this.formData.bornTime) {
  410. bornTime = new Date(this.formatTime(this.formData.bornTime, 'YYYY-MM-DD'));
  411. bornTime.setTime(bornTime.getTime() - 3600 * 1000 * 24);
  412. }
  413. return time.getTime() > new Date(bornTime).getTime()
  414. },
  415. /** 查询机构下拉树结构 */
  416. getDeptTreeList() {
  417. deptTreeList().then(response => {
  418. this.deptList = response.data;
  419. this.defaultKeys = response.data[0];
  420. });
  421. },
  422. getOrgPhysicalDefenseConstructionInfo() {
  423. this.orgloading = true;
  424. let dat = {orgId: this.$route.params.id};
  425. listOrgPhysicalDefenseConstruction(dat).then((data) => {
  426. this.constructionList = data.rows;
  427. this.orgloading = false;
  428. });
  429. },
  430. getBankPhysicalDefenseConstructionInfo() {
  431. this.bankloading = true;
  432. let dat = {orgId: this.$route.params.id};
  433. listBankPhysicalDefenseConstruction(dat).then((data) => {
  434. this.BankPhysicalDefenseConstructionList = data.rows;
  435. this.bankloading = false;
  436. });
  437. },
  438. // 取消按钮
  439. Bankcancel() {
  440. this.Bankopen = false;
  441. this.Bankreset();
  442. },
  443. // 表单重置
  444. Bankreset() {
  445. this.Bankform = {
  446. id: null,
  447. standard: null,
  448. dateOfCompliance: null,
  449. certificateEvidence: null,
  450. certificate: null,
  451. evidence: null,
  452. createTime: null,
  453. updateTime: null,
  454. createBy: null,
  455. updateBy: null,
  456. orgId: null,
  457. };
  458. this.resetForm("Bankform");
  459. },
  460. // 多选框选中数据
  461. handleBankSelectionChange(selection) {
  462. this.Bankids = selection.map((item) => item.id);
  463. this.single = selection.length !== 1;
  464. this.multiple = !selection.length;
  465. },
  466. /** 新增按钮操作 */
  467. handleBankAdd() {
  468. this.Bankreset();
  469. this.Bankopen = true;
  470. this.Banktitle = "添加银行物防建设";
  471. },
  472. /** 修改按钮操作 */
  473. handleBankUpdate(row) {
  474. this.Bankreset();
  475. const id = row.id || this.Bankids;
  476. getBankPhysicalDefenseConstruction(id).then((response) => {
  477. this.Bankform = response.data;
  478. this.Bankopen = true;
  479. this.Banktitle = "修改银行物防建设";
  480. });
  481. },
  482. /** 提交按钮 */
  483. submitBankForm() {
  484. this.Bankform.orgId = this.$route.params.id;
  485. this.$refs["Bankform"].validate((valid) => {
  486. if (valid) {
  487. if (this.Bankform.id != null) {
  488. updateBankPhysicalDefenseConstruction(this.Bankform).then(
  489. (response) => {
  490. this.$modal.msgSuccess("修改成功");
  491. this.Bankopen = false;
  492. this.getBankPhysicalDefenseConstructionInfo();
  493. }
  494. );
  495. } else {
  496. addBankPhysicalDefenseConstruction(this.Bankform).then(
  497. (response) => {
  498. this.$modal.msgSuccess("新增成功");
  499. this.Bankopen = false;
  500. this.getBankPhysicalDefenseConstructionInfo();
  501. }
  502. );
  503. }
  504. }
  505. });
  506. },
  507. /** 删除按钮操作 */
  508. handleBankDelete(row) {
  509. const Bankids = row.id || this.Bankids;
  510. this.$modal
  511. .confirm('是否确认删除银行物防建设编号为"' + Bankids + '"的数据项?')
  512. .then(function () {
  513. return delBankPhysicalDefenseConstruction(Bankids);
  514. })
  515. .then(() => {
  516. this.getBankPhysicalDefenseConstructionInfo();
  517. this.$modal.msgSuccess("删除成功");
  518. })
  519. .catch(() => {
  520. });
  521. },
  522. // 表单重置
  523. orgreset() {
  524. this.orgform = {
  525. id: null,
  526. standard: null,
  527. dateOfCompliance: null,
  528. certificateEvidence: null,
  529. certificate: null,
  530. evidence: null,
  531. createTime: null,
  532. updateTime: null,
  533. createBy: null,
  534. updateBy: null,
  535. orgId: null,
  536. };
  537. this.resetForm("orgform");
  538. },
  539. // 取消按钮
  540. orgcancel() {
  541. this.orgopen = false;
  542. this.orgreset();
  543. },
  544. // 多选框选中数据
  545. handleOrgSelectionChange(selection) {
  546. this.orgids = selection.map((item) => item.id);
  547. this.single = selection.length !== 1;
  548. this.multiple = !selection.length;
  549. },
  550. /** 新增按钮操作 */
  551. handleOrgAdd() {
  552. this.orgreset();
  553. this.orgopen = true;
  554. this.orgtitle = "添加机构物防建设";
  555. },
  556. /** 修改按钮操作 */
  557. handleOrgUpdate(row) {
  558. this.orgreset();
  559. const id = row.id || this.orgids;
  560. getOrgPhysicalDefenseConstruction(id).then((response) => {
  561. this.orgform = response.data;
  562. this.orgopen = true;
  563. this.orgtitle = "修改机构物防建设";
  564. });
  565. },
  566. /** 提交按钮 */
  567. submitOrgForm() {
  568. this.orgform.orgId = this.$route.params.id;
  569. this.$refs["orgform"].validate((valid) => {
  570. if (valid) {
  571. if (this.orgform.id != null) {
  572. updateOrgPhysicalDefenseConstruction(this.orgform).then(
  573. (response) => {
  574. this.$modal.msgSuccess("修改成功");
  575. this.orgopen = false;
  576. this.getOrgPhysicalDefenseConstructionInfo();
  577. }
  578. );
  579. } else {
  580. addOrgPhysicalDefenseConstruction(this.orgform).then((response) => {
  581. this.$modal.msgSuccess("新增成功");
  582. this.orgopen = false;
  583. this.getOrgPhysicalDefenseConstructionInfo();
  584. });
  585. }
  586. }
  587. });
  588. },
  589. /** 删除按钮操作 */
  590. handleOrgDelete(row) {
  591. const orgids = row.id || this.orgids;
  592. this.$modal
  593. .confirm('是否确认删除机构物防建设编号为"' + orgids + '"的数据项?')
  594. .then(function () {
  595. return delOrgPhysicalDefenseConstruction(orgids);
  596. })
  597. .then(() => {
  598. this.getOrgPhysicalDefenseConstructionInfo();
  599. this.$modal.msgSuccess("删除成功");
  600. })
  601. .catch(() => {
  602. });
  603. },
  604. nosaveExtend() {
  605. this.$router.go(-1);
  606. },
  607. triggerFileInput() {
  608. this.$refs.fileInput.click();
  609. },
  610. async handleFileChange(event) {
  611. const file = event.target.files[0];
  612. if (!file) return;
  613. // 创建 FormData 对象并添加文件
  614. const formData = new FormData();
  615. formData.append('file', file);
  616. // // 发送文件到您的文件上传 API
  617. try {
  618. uploadFile(formData).then((res) => {
  619. console.log(res);
  620. // this.orgform.certificateEvidence = res.data;
  621. });
  622. // 处理上传成功的逻辑
  623. console.log('上传成功');
  624. } catch (error) {
  625. // 处理上传失败的逻辑
  626. console.log('上传失败');
  627. }
  628. // try {
  629. // const response = await request.post('http://localhost:9527/dev-api/file/file/upload', formData, {
  630. // headers: {
  631. // 'Content-Type': 'multipart/form-data',
  632. // },
  633. // });
  634. // // 处理上传成功的逻辑
  635. // console.log('上传成功', response);
  636. // } catch (error) {
  637. // // 处理上传失败的逻辑
  638. // console.log('上传失败', error);
  639. // }
  640. // 重置 input 元素,以便下次选择相同文件时仍能触发 change 事件
  641. event.target.value = '';
  642. },
  643. },
  644. fillter: {},
  645. };
  646. </script>
  647. <style scoped lang="scss">
  648. .title {
  649. font-size: 18px;
  650. text-align: left;
  651. background: #008CD6bd;
  652. color: #fff;
  653. height: 36px;
  654. line-height: 36px;
  655. padding-left: 8px;
  656. margin: 0;
  657. }
  658. .info-box {
  659. margin: 30px;
  660. }
  661. .demo-form-inline {
  662. }
  663. .dialog-footer {
  664. }
  665. .container {
  666. }
  667. .image-container {
  668. display: inline-block;
  669. width: 200px;
  670. margin-right: 20px;
  671. /* 设置与下一个div的水平间距 */
  672. }
  673. .zoom-image {
  674. transition: transform 0.3s ease;
  675. }
  676. .zoom-image:hover {
  677. transform: scale(1.02);
  678. }
  679. .border-color-change {
  680. border: 1px solid #ccc;
  681. transition: border-color 0.3s ease;
  682. }
  683. .border-color-change:hover {
  684. border-color: #1ea8e9;
  685. /* 您可以将此颜色更改为所需的颜色 */
  686. }
  687. </style>