extend.vue 26 KB

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