basicinfo.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826
  1. <template>
  2. <basic-container>
  3. <avue-crud :option="option"
  4. :table-loading="loading"
  5. :data="data"
  6. :page.sync="page"
  7. :permission="permissionList"
  8. :before-open="beforeOpen"
  9. v-model="form"
  10. ref="crud"
  11. @row-update="rowUpdate"
  12. @row-save="rowSave"
  13. @row-del="rowDel"
  14. @search-change="searchChange"
  15. @search-reset="searchReset"
  16. @selection-change="selectionChange"
  17. @current-change="currentChange"
  18. @size-change="sizeChange"
  19. @refresh-change="refreshChange"
  20. @on-load="onLoad">
  21. <template slot="menuLeft">
  22. <el-button type="danger"
  23. size="small"
  24. icon="el-icon-delete"
  25. plain
  26. v-if="permission.basicinfo_delete"
  27. @click="handleDelete">删 除
  28. </el-button>
  29. </template>
  30. <!-- <template slot="buildingId" slot-scope="scope">-->
  31. <!-- <span v-if="scope.row.buildingId!==-1">-->
  32. <!-- {{scope.row.buildingName}}-->
  33. <!-- </span>-->
  34. <!-- </template>-->
  35. <!-- <template slot="floorId" slot-scope="scope">-->
  36. <!-- <span v-if="scope.row.floorId!==-1">-->
  37. <!-- {{scope.row.floorName}}-->
  38. <!-- </span>-->
  39. <!-- </template>-->
  40. <!-- <template slot="unitId" slot-scope="scope">-->
  41. <!-- <span v-if="scope.row.unitId!==-1">-->
  42. <!-- {{scope.row.unitName}}-->
  43. <!-- </span>-->
  44. <!-- </template>-->
  45. <!-- <template slot="roomId" slot-scope="scope">-->
  46. <!-- <span v-if="scope.row.roomId!==-1">-->
  47. <!-- {{scope.row.roomName}}-->
  48. <!-- </span>-->
  49. <!-- </template>-->
  50. <!-- <template slot="menu" slot-scope="scope">-->
  51. <!-- <el-button icon="el-icon-setting" size="mini" type="text">-->
  52. <!-- <el-dropdown>-->
  53. <!-- <span class="el-dropdown-link" style="font-size: xx-small; color: #4babfe">设置标签<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i></span>-->
  54. <!-- <el-dropdown-menu slot="dropdown">-->
  55. <!-- <el-dropdown-item type="text" @click.native="tagsFormOpen('elder', scope.row)">高龄老人</el-dropdown-item>-->
  56. <!-- <el-dropdown-item type="text" @click.native="tagsFormOpen('keyPerson', scope.row)">重点人员</el-dropdown-item>-->
  57. <!-- <el-dropdown-item type="text" @click.native="tagsFormOpen('disabler', scope.row)">残障人士</el-dropdown-item>-->
  58. <!-- &lt;!&ndash; <el-dropdown-item type="text" @click.native="tagsFormOpen('household', scope.row)">常住人员</el-dropdown-item>&ndash;&gt;-->
  59. <!-- &lt;!&ndash; <el-dropdown-item type="text" @click.native="tagsFormOpen('enterpriseStaff', scope.row)">企业员工</el-dropdown-item>&ndash;&gt;-->
  60. <!-- </el-dropdown-menu>-->
  61. <!-- </el-dropdown>-->
  62. <!-- </el-button>-->
  63. <!-- </template>-->
  64. <!-- 标签点击事件-->
  65. <!-- <template slot="tags" slot-scope="scope" style="display: flex">-->
  66. <!-- <div v-if="scope.row.tags!== null">-->
  67. <!-- <el-button style="margin: auto" class="el-icon-collection-tag" v-for="item in scope.row.tags.split(',')" @click.native="tagsDetail(item,scope.row)" size="mini" type="text">-->
  68. <!-- {{item}}-->
  69. <!-- </el-button>-->
  70. <!-- </div>-->
  71. <!-- </template>-->
  72. </avue-crud>
  73. <!-- 显示标签详情组件-->
  74. <!-- <el-dialog title="残障人士【标签详情】" :visible.sync="disablerTagsdetail" :modal-append-to-body="false">-->
  75. <!-- <DisablerTagsDetail v-if="disablerTagsdetail" :basic-data="basicData"></DisablerTagsDetail>-->
  76. <!-- </el-dialog>-->
  77. <!-- <el-dialog title="高龄老人【标签详情】" :visible.sync="elderTagsdetail" :modal-append-to-body="false">-->
  78. <!-- <ElderTagsDetail v-if="elderTagsdetail" :basic-data="basicData"></ElderTagsDetail>-->
  79. <!-- </el-dialog>-->
  80. <!-- <el-dialog title="重点人员【标签详情】" :visible.sync="keyPersonTagsdetail" :modal-append-to-body="false">-->
  81. <!-- <KeypeopleTagsDetail v-if="keyPersonTagsdetail" :basic-data="basicData"></KeypeopleTagsDetail>-->
  82. <!-- </el-dialog>-->
  83. <!-- <el-dialog title="常住人员【标签详情】" :visible.sync="householdTagsdetail" :modal-append-to-body="false">-->
  84. <!-- <HouseholdTagsDetail v-if="householdTagsdetail" :basic-data="basicData"></HouseholdTagsDetail>-->
  85. <!-- </el-dialog>-->
  86. <!-- <el-dialog title="企业员工【标签详情】" :visible.sync="enterpriseStaffTagsdetail" :modal-append-to-body="false">-->
  87. <!-- <EnterpriseStaffTagsDetail v-if="enterpriseStaffTagsdetail" :basic-data="basicData"></EnterpriseStaffTagsDetail>-->
  88. <!-- </el-dialog>-->
  89. <!-- 标签添加信息组件-->
  90. <!-- <el-dialog title="高龄老人【添加标签信息】" :visible.sync="elderTags" :modal-append-to-body="false">-->
  91. <!-- <ElderTagsForm v-if="elderTags" :basic-data="basicData" :close-fn="() => {elderTags = false}"></ElderTagsForm>-->
  92. <!-- </el-dialog>-->
  93. <!-- <el-dialog title="残障人士【添加标签信息】" :visible.sync="disablerTags" :modal-append-to-body="false">-->
  94. <!-- <DisablerTagsForm v-if="disablerTags" :basic-data="basicData" :close-fn="() => {disablerTags = false}"></DisablerTagsForm>-->
  95. <!-- </el-dialog>-->
  96. <!-- <el-dialog title="重点人员【添加标签信息】" :visible.sync="keyPersonTags" :modal-append-to-body="false">-->
  97. <!-- <KeyPersonTagsForm v-if="keyPersonTags" :basic-data="basicData" :close-fn="() => {keyPersonTags = false}"></KeyPersonTagsForm>-->
  98. <!-- </el-dialog>-->
  99. <!-- <el-dialog title="常住人员【添加标签信息】" :visible.sync="householdTags" :modal-append-to-body="false">-->
  100. <!-- <HouseholdTagsForm v-if="householdTags" :basic-data="basicData" :close-fn="() => {householdTags = false}"></HouseholdTagsForm>-->
  101. <!-- </el-dialog>-->
  102. <!-- <el-dialog title="企业人员【添加标签信息】" :visible.sync="enterpriseStaffTags" :modal-append-to-body="false">-->
  103. <!-- <EnterpriseStaffTagsForm v-if="enterpriseStaffTags" :basic-data="basicData" :close-fn="() => {enterpriseStaffTags = false}"></EnterpriseStaffTagsForm>-->
  104. <!-- </el-dialog>-->
  105. </basic-container>
  106. </template>
  107. <script>
  108. import {getList, getDetail, add, update, remove} from "@/api/person/basicinfo";
  109. import {mapGetters} from "vuex";
  110. // import ElderTagsForm from "@/components/person-tags/elderTags-form";
  111. // import DisablerTagsForm from "@/components/person-tags/disablerTags-form";
  112. // import KeyPersonTagsForm from "@/components/person-tags/keyPersonTags-form";
  113. // import EnterpriseStaffTagsForm from "@/components/person-tags/enterpriseStaffTags-form";
  114. // import HouseholdTagsForm from "@/components/person-tags/householdTags-form";
  115. // import ElderTagsDetail from "@/components/person-tags/elderTags-detail";
  116. // import DisablerTagsDetail from "@/components/person-tags/disablerTags-detail";
  117. // import KeypeopleTagsDetail from "@/components/person-tags/keyPersonTags-detail";
  118. // import HouseholdTagsDetail from "@/components/person-tags/householdTags-detail";
  119. // import EnterpriseStaffTagsDetail from "@/components/person-tags/enterpriseStaffTags-detail";
  120. import {DIC} from "@/api/util/nation"
  121. export default {
  122. // components: {ElderTagsForm, DisablerTagsForm,KeyPersonTagsForm,DisablerTagsDetail,ElderTagsDetail,KeypeopleTagsDetail},
  123. data() {
  124. return {
  125. elderTags: false,
  126. disablerTags: false,
  127. keyPersonTags: false,
  128. householdTags:false,
  129. enterpriseStaffTags:false,
  130. elderTagsdetail:false,
  131. disablerTagsdetail:false,
  132. keyPersonTagsdetail:false,
  133. // householdTagsdetail:false,
  134. // enterpriseStaffTagsdetail:false,
  135. basicData: {},
  136. form: {},
  137. query: {},
  138. loading: true,
  139. page: {
  140. pageSize: 10,
  141. currentPage: 1,
  142. total: 0
  143. },
  144. selectionList: [],
  145. option: {
  146. height:'auto',
  147. calcHeight: 30,
  148. labelWidth: 120,
  149. tip: false,
  150. searchShow: true,
  151. searchMenuSpan: 6,
  152. border: true,
  153. index: true,
  154. viewBtn: true,
  155. selection: true,
  156. dialogClickModal: false,
  157. // menuWidth:500,
  158. column: [
  159. {
  160. label: "身份证号",
  161. labelWidth: 150,
  162. prop: "idCard",
  163. search:true,
  164. hide: true,
  165. rules: [{
  166. required: false,
  167. message: "请输入身份证号码",
  168. trigger: "blur"
  169. }]
  170. },
  171. {
  172. label: "姓名",
  173. prop: "name",
  174. search:true,
  175. rules: [{
  176. required: true,
  177. message: "请输入姓名",
  178. trigger: "blur"
  179. }]
  180. },
  181. {
  182. label: "性别",
  183. prop: "sex",
  184. type: 'select',
  185. dataType:"number",
  186. search:true,
  187. dicUrl: "/api/blade-system/dict-biz/dictionary?code=sex",
  188. props: {
  189. label: "dictValue",
  190. value: "dictKey"
  191. },
  192. rules: [{
  193. required: true,
  194. message: "请选择性别",
  195. trigger: "blur"
  196. }]
  197. },
  198. {
  199. label: "照片",
  200. prop: "imageUri",
  201. type: 'upload',
  202. hide:true,
  203. listType: 'picture-img',
  204. propsHttp: {
  205. res: "data",
  206. url: "link"
  207. },
  208. action: "/api/blade-resource/oss/endpoint/put-file",
  209. tip: '只能生产jpg/png图片,且不超过500kb',
  210. rules: [{
  211. required: false,
  212. message: "请上传入境证明url",
  213. trigger: "blur"
  214. }]
  215. },
  216. { //列表是展示
  217. label: "所属社区",
  218. prop: "agencyName",
  219. addDisplay: false,
  220. editDisplay: false,
  221. },
  222. {
  223. label: "所属社区",
  224. prop: "agencyId",
  225. search: true,
  226. cascaderItem: ['residentialId'],
  227. type: "select",
  228. // remote: true,
  229. // dicData: [],
  230. dicUrl: "/api/cyzh-community/agency/list?size=500",
  231. dicFormatter:(res)=>{
  232. return res.data.records;//返回字典的层级结构
  233. },
  234. props: {
  235. label: "name",
  236. value: "id"
  237. },
  238. rules: [{
  239. required: true,
  240. message: "请选择所属社区",
  241. trigger: "blur"
  242. }],
  243. hide: true,
  244. viewDisplay: false
  245. },
  246. {
  247. label: "所属小区",
  248. prop: "residentialName",
  249. addDisplay: false,
  250. editDisplay: false,
  251. },
  252. {
  253. label: "所属小区",
  254. prop: "residentialId",
  255. dataType:'number',
  256. type: "select",
  257. search: true,
  258. cascaderItem: ['buildingId'],
  259. dicUrl: "/api/cyzh-community/residential/list?agencyId={{key}}&size=500",
  260. dicFormatter:(res)=>{
  261. return res.data.records;//返回字典的层级结构
  262. },
  263. // filterable: true,
  264. props: {
  265. label: "name",
  266. value: "id"
  267. },
  268. rules: [{
  269. required: true,
  270. message: "请选择所属小区",
  271. trigger: "blur"
  272. }],
  273. hide: true,
  274. viewDisplay: false
  275. },
  276. {
  277. label: "所属楼栋",
  278. prop: "buildingName",
  279. addDisplay: false,
  280. editDisplay: false,
  281. },
  282. {
  283. label: "所属楼栋",
  284. prop: "buildingId",
  285. type: "select",
  286. // slot:true,
  287. search: true,
  288. cascaderItem: ['unitId'],
  289. dicUrl: "/api/cyzh-community/building/list?residentialId={{key}}&size=500",
  290. dicFormatter:(res)=>{
  291. return res.data.records;//返回字典的层级结构
  292. },
  293. // dicFlag: true,
  294. // filterable: true,
  295. props: {
  296. label: "name",
  297. value: "id"
  298. },
  299. rules: [{
  300. required: true,
  301. message: "请选择楼栋",
  302. trigger: "blur"
  303. }],
  304. hide: true,
  305. viewDisplay: false
  306. },
  307. {
  308. label: "所属单元",
  309. prop: "unitName",
  310. addDisplay: false,
  311. editDisplay: false,
  312. },
  313. {
  314. label: "所属单元",
  315. prop: "unitId",
  316. type: "select",
  317. // slot:true,
  318. search: true,
  319. cascaderItem: ['floorId'],
  320. dicUrl: "/api/cyzh-community/unit/list?buildingId={{key}}&size=500",
  321. dicFormatter:(res)=>{
  322. return res.data.records;//返回字典的层级结构
  323. },
  324. // dicFlag: false,
  325. // filterable: true,
  326. props: {
  327. label: "name",
  328. value: "id"
  329. },
  330. rules: [{
  331. required: true,
  332. message: "请选择单元",
  333. trigger: "blur"
  334. }],
  335. hide: true,
  336. viewDisplay: false
  337. },
  338. {
  339. label: "所属楼层",
  340. prop: "floorName",
  341. addDisplay: false,
  342. editDisplay: false,
  343. },
  344. {
  345. label: "所属楼层",
  346. prop: "floorId",
  347. type: "select",
  348. // slot:true,
  349. search: true,
  350. cascaderItem: ['roomId'],
  351. dicUrl: "/api/cyzh-community/floor/list?unitId={{key}}&size=100",
  352. dicFormatter:(res)=>{
  353. return res.data.records;//返回字典的层级结构
  354. },
  355. // dicFlag: false,
  356. filterable: true,
  357. props: {
  358. label: "name",
  359. value: "id"
  360. },
  361. rules: [{
  362. required: true,
  363. message: "请选择楼层d",
  364. trigger: "blur"
  365. }],
  366. hide: true,
  367. viewDisplay: false
  368. },
  369. {
  370. label: "所属房间",
  371. prop: "roomName",
  372. addDisplay: false,
  373. editDisplay: false,
  374. },
  375. {
  376. label: "所属房间",
  377. prop: "roomId",
  378. type: "select",
  379. // slot:true,
  380. search: true,
  381. dicUrl: "/api/cyzh-community/room/list?floorId={{key}}&size=500&current=1",
  382. dicFormatter:(res)=>{
  383. return res.data.records;//返回字典的层级结构
  384. },
  385. // dicFlag: false,
  386. filterable: true,
  387. props: {
  388. label: "name",
  389. value: "id"
  390. },
  391. rules: [{
  392. required: true,
  393. message: "请选择房间",
  394. trigger: "blur"
  395. }],
  396. hide: true,
  397. viewDisplay: false
  398. },
  399. {
  400. label:'手机号码',
  401. prop:'phone',
  402. width:120,
  403. rules: [{
  404. required: true,
  405. message: "请输入手机号码",
  406. trigger: "blur"
  407. }]
  408. },
  409. {
  410. label: "生日",
  411. prop: "birthday",
  412. type:'date',
  413. valueFormat:"yyyy-MM-dd",
  414. hide: true,
  415. rules: [{
  416. required: false,
  417. message: "请输入生日",
  418. trigger: "blur"
  419. }]
  420. },
  421. // {
  422. // label: "民族",
  423. // prop: "nation",
  424. // hide:true,
  425. // rules: [{
  426. // required: true,
  427. // message: "请输入民族",
  428. // trigger: "blur"
  429. // }]
  430. // },
  431. {
  432. label: "民族",
  433. prop: "nation",
  434. type:'select',
  435. dicData:DIC.VALUE,
  436. filterable:true,
  437. // searchFilterable:true,
  438. hide:true,
  439. rules: [{
  440. required: true,
  441. message: "请输入民族",
  442. trigger: "blur"
  443. }]
  444. },
  445. {
  446. label: "籍贯",
  447. prop: "nativePlace",
  448. hide:true,
  449. rules: [{
  450. required: false,
  451. message: "请输入籍贯",
  452. trigger: "blur"
  453. }]
  454. },
  455. {
  456. label: "国籍",
  457. prop: "nationality",
  458. hide:true,
  459. type:'select',
  460. dataType:'number',
  461. dicUrl: "/api/blade-system/dict-biz/dictionary?code=nationality",
  462. props: {
  463. label: "dictValue",
  464. value: "dictKey"
  465. },
  466. rules: [{
  467. required: false,
  468. message: "请输入国籍",
  469. trigger: "blur"
  470. }]
  471. },
  472. {
  473. label: "政治面貌",
  474. prop: "political",
  475. hide:true,
  476. type: 'select',
  477. dataType:"number",
  478. dicUrl: "/api/blade-system/dict-biz/dictionary?code=political",
  479. props: {
  480. label: "dictValue",
  481. value: "dictKey"
  482. },
  483. rules: [{
  484. required: false,
  485. message: "请选择政治面貌",
  486. trigger: "blur"
  487. }]
  488. },
  489. {
  490. label: "婚姻状况",
  491. prop: "maritalStatus",
  492. type: 'select',
  493. dataType:"number",
  494. hide:true,
  495. dicUrl: "/api/blade-system/dict-biz/dictionary?code=marital-status",
  496. props: {
  497. label: "dictValue",
  498. value: "dictKey"
  499. },
  500. rules: [{
  501. required: false,
  502. message: "请选择婚姻状况",
  503. trigger: "blur"
  504. }]
  505. },
  506. {
  507. label: "教育水平",
  508. prop: "educationalLevel",
  509. hide:true,
  510. type: 'select',
  511. dataType:"number",
  512. dicUrl: "/api/blade-system/dict-biz/dictionary?code=educational-level",
  513. props: {
  514. label: "dictValue",
  515. value: "dictKey"
  516. },
  517. rules: [{
  518. required: false,
  519. message: "请选择教育水平",
  520. trigger: "blur"
  521. }]
  522. },
  523. {
  524. label: "工作单位",
  525. prop: "workplace",
  526. hide:true,
  527. rules: [{
  528. required: false,
  529. message: "请输入工作单位",
  530. trigger: "blur"
  531. }]
  532. },
  533. {
  534. label: "小程序openId",
  535. prop: "openId",
  536. hide: true,
  537. display: false,
  538. rules: [{
  539. required: false,
  540. message: "请输入小程序openId",
  541. trigger: "blur"
  542. }]
  543. },
  544. {
  545. label: "邮箱",
  546. prop: "email",
  547. hide:true,
  548. rules: [{
  549. required: false,
  550. message: "请输入邮箱",
  551. trigger: "blur"
  552. }]
  553. },
  554. {
  555. label:"是否会员",
  556. prop:'isMember',
  557. type:"select",
  558. hide:true,
  559. dataType:'number',
  560. dicData:[
  561. {
  562. label:'是',
  563. value:1
  564. },{
  565. label:'否',
  566. value:0
  567. },{
  568. label:'暂无',
  569. value:-1
  570. }
  571. ],
  572. },
  573. {
  574. label: "人员标签",
  575. prop: "tags",
  576. type:'checkbox',
  577. search:true,
  578. multiple:true,
  579. span: 24,
  580. dataType:'string',
  581. dicUrl: "/api/blade-system/dict-biz/dictionary?code=person-tag",
  582. props: {
  583. label: "dictValue",
  584. value: "dictKey"
  585. },
  586. rules: [{
  587. required: true,
  588. message: "请输入标签",
  589. trigger: "blur"
  590. }]
  591. },
  592. {
  593. label: "备注",
  594. prop: "remark",
  595. hide:true,
  596. rules: [{
  597. required: false,
  598. message: "请输入备注",
  599. trigger: "blur"
  600. }]
  601. },
  602. // {
  603. // label:'创建时间',
  604. // prop:'createTime',
  605. // type:"datetime",
  606. // span:12,
  607. // search:true,
  608. // valueFormat: 'yyyy-MM-dd HH:mm:ss',
  609. // format: 'yyyy-MM-dd HH:mm:ss',
  610. // defaultTime:['2020-1-1 00:00:00','2021-6-30 23:59:59'],
  611. // // dateDefault: true,
  612. // // searchValue:['2020-1-1 00:00:00','2021-6-30 23:59:59'],
  613. // searchRange:true,
  614. // searchClearable: false,
  615. // rules: [{
  616. // required: false,
  617. // message: "请输入创建时间",
  618. // trigger: "blur"
  619. // }]
  620. // }
  621. ]
  622. },
  623. data: []
  624. };
  625. },
  626. watch:{
  627. },
  628. computed: {
  629. ...mapGetters(["permission"]),
  630. permissionList() {
  631. return {
  632. addBtn: this.vaildData(this.permission.basicinfo_add, false),
  633. viewBtn: this.vaildData(this.permission.basicinfo_view, false),
  634. delBtn: this.vaildData(this.permission.basicinfo_delete, false),
  635. editBtn: this.vaildData(this.permission.basicinfo_edit, false)
  636. };
  637. },
  638. ids() {
  639. let ids = [];
  640. this.selectionList.forEach(ele => {
  641. ids.push(ele.id);
  642. });
  643. return ids.join(",");
  644. }
  645. },
  646. methods: {
  647. tagsFormOpen(type,row) {
  648. this.basicData = row;
  649. switch (type) {
  650. case 'elder':
  651. this.elderTags = true;
  652. break;
  653. case 'disabler':
  654. this.disablerTags = true;
  655. break;
  656. case 'keyPerson':
  657. this.keyPersonTags = true;
  658. break;
  659. // case 'household':
  660. // this.householdTags = true;
  661. // break;
  662. // case 'enterpriseStaff':
  663. // this.enterpriseStaffTags = true;
  664. // break;
  665. }
  666. },
  667. tagsDetail(type,row){
  668. this.basicData = row;
  669. switch (type) {
  670. case '高龄老人':
  671. this.elderTagsdetail = true;
  672. break;
  673. case '残障人士':
  674. this.disablerTagsdetail = true;
  675. break;
  676. case '重点人员':
  677. this.keyPersonTagsdetail = true;
  678. break;
  679. // case '常住人员':
  680. // this.householdTagsdetail = true;
  681. // break;
  682. // case '企业员工':
  683. // this.enterpriseStaffTagsdetail = true;
  684. // break;
  685. }
  686. },
  687. rowSave(row, done, loading) {
  688. row.agencyName = row.$agencyId;
  689. row.residentialName = row.$residentialId;
  690. row.buildingName = row.$buildingId;
  691. row.unitName = row.$unitId;
  692. row.floorName = row.$floorId;
  693. row.roomName = row.$roomId;
  694. if (row.tags.length == 0) {
  695. row.tags = '';
  696. }
  697. add(row).then(() => {
  698. this.onLoad(this.page);
  699. this.$message({
  700. type: "success",
  701. message: "操作成功!"
  702. });
  703. done();
  704. }, error => {
  705. loading();
  706. window.console.log(error);
  707. });
  708. },
  709. rowUpdate(row, index, done, loading) {
  710. console.log(row)
  711. row.agencyName = row.$agencyId;
  712. row.residentialName = row.$residentialId;
  713. row.buildingName = row.$buildingId;
  714. row.unitName = row.$unitId;
  715. row.floorName = row.$floorId;
  716. row.roomName = row.$roomId;
  717. if (row.tags.length == 0) {
  718. row.tags = '';
  719. }
  720. update(row).then(() => {
  721. this.onLoad(this.page);
  722. this.$message({
  723. type: "success",
  724. message: "操作成功!"
  725. });
  726. done();
  727. }, error => {
  728. loading();
  729. console.log(error);
  730. });
  731. },
  732. rowDel(row) {
  733. this.$confirm("确定将选择数据删除?", {
  734. confirmButtonText: "确定",
  735. cancelButtonText: "取消",
  736. type: "warning"
  737. })
  738. .then(() => {
  739. return remove(row.id);
  740. })
  741. .then(() => {
  742. this.onLoad(this.page);
  743. this.$message({
  744. type: "success",
  745. message: "操作成功!"
  746. });
  747. });
  748. },
  749. handleDelete() {
  750. if (this.selectionList.length === 0) {
  751. this.$message.warning("请选择至少一条数据");
  752. return;
  753. }
  754. this.$confirm("确定将选择数据删除?", {
  755. confirmButtonText: "确定",
  756. cancelButtonText: "取消",
  757. type: "warning"
  758. })
  759. .then(() => {
  760. return remove(this.ids);
  761. })
  762. .then(() => {
  763. this.onLoad(this.page);
  764. this.$message({
  765. type: "success",
  766. message: "操作成功!"
  767. });
  768. this.$refs.crud.toggleSelection();
  769. });
  770. },
  771. beforeOpen(done, type) {
  772. if (["edit", "view"].includes(type)) {
  773. getDetail(this.form.id).then(res => {
  774. this.form = res.data.data;
  775. });
  776. }
  777. done();
  778. },
  779. searchReset() {
  780. this.query = {};
  781. this.onLoad(this.page);
  782. },
  783. searchChange(params, done) {
  784. this.query = params;
  785. this.page.currentPage = 1;
  786. console.log(params,"搜索条件参数");
  787. this.onLoad(this.page, params);
  788. done();
  789. },
  790. selectionChange(list) {
  791. this.selectionList = list;
  792. },
  793. selectionClear() {
  794. this.selectionList = [];
  795. this.$refs.crud.toggleSelection();
  796. },
  797. currentChange(currentPage){
  798. this.page.currentPage = currentPage;
  799. },
  800. sizeChange(pageSize){
  801. this.page.pageSize = pageSize;
  802. },
  803. refreshChange() {
  804. this.onLoad(this.page, this.query);
  805. },
  806. onLoad(page, params = {}) {
  807. this.loading = true;
  808. getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
  809. const data = res.data.data;
  810. this.page.total = data.total;
  811. this.data = data.records;
  812. this.loading = false;
  813. this.selectionClear();
  814. });
  815. }
  816. }
  817. };
  818. </script>
  819. <style>
  820. </style>