piping_record.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. <template>
  2. <scroll-view>
  3. <view class="background">
  4. <view class="uni-list">
  5. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  6. <view>
  7. 行政区
  8. </view>
  9. <view v-if="this.isEmpty(this.XZQValue.dictValue)" style="margin-top: 10;"
  10. @click="pickerShow('xzq')">
  11. <span style="color: darkgray;">请选择行政区</span>
  12. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  13. </view>
  14. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('xzq')">
  15. <span style="color: black;">{{XZQValue.dictLabel}}</span>
  16. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="uni-list">
  21. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  22. <view>
  23. 小区
  24. </view>
  25. <view v-if="this.isEmpty(this.XQValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
  26. @click="pickerShow('xq')">
  27. <span style="color: darkgray;">请选择小区</span>
  28. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  29. </view>
  30. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('xq')">
  31. <span style="color: black;">{{XQValue.name}}</span>
  32. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="uni-list">
  37. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  38. <view class="uni-list-cell-left">
  39. 楼栋
  40. </view>
  41. <view v-if="this.isEmpty(this.LDValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
  42. @click="pickerShow('ld')">
  43. <span style="color: darkgray;">请选择楼栋</span>
  44. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  45. </view>
  46. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('ld')">
  47. <span style="color: black;">{{LDValue.name}}</span>
  48. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="uni-list" style="margin-top: 10;">
  53. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  54. <view class="uni-list-cell-left">
  55. 单元
  56. </view>
  57. <view v-if="this.isEmpty(this.DYValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
  58. @click="pickerShow('dy')">
  59. <span style="color: darkgray;">请选择单元</span>
  60. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  61. </view>
  62. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('dy')">
  63. <span style="color: black;">{{DYValue.name}}</span>
  64. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="uni-list">
  69. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  70. <view class="uni-list-cell-left">
  71. 房间
  72. </view>
  73. <view v-if="this.isEmpty(this.FJValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
  74. @click="pickerShow('fj')">
  75. <span style="color: darkgray;">请选择房间</span>
  76. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  77. </view>
  78. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('fj')">
  79. <span style="color: black;">{{FJValue.name}}</span>
  80. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <view class="background">
  86. <view>
  87. <view
  88. style="font-size: 16px;margin-left: 10px;margin-top: 10px;display: flex; justify-content: space-between;margin-bottom: 10px;">
  89. 户主信息
  90. <image v-if="change==false" :src="loadImgSrc('icon_user_open.png')" @click='change1'
  91. style="display: flex;justify-content:flex-end; margin-right: 10px;width: 15px;height: 15px;">
  92. </image>
  93. <image v-if="change==true" :src="loadImgSrc('icon_user_close.png')" @click='change1'
  94. style="display: flex;justify-content:flex-end; margin-right: 10px;width: 15px;height: 15px;">
  95. </image>
  96. </view>
  97. </view>
  98. <view v-show="change">
  99. <view class="uni-list">
  100. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  101. <view class="uni-list-cell-left">
  102. 户主姓名
  103. </view>
  104. <view class="uni-list-cell-db" style="margin-top: 10;">
  105. <span style="color: darkgray;" v-model="houseHeadName">{{houseHeadName}}</span>
  106. </view>
  107. </view>
  108. </view>
  109. <view class="uni-list">
  110. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  111. <view class="uni-list-cell-left">
  112. 户主电话
  113. </view>
  114. <view class="uni-list-cell-db" style="margin-top: 10;">
  115. <span style="color: darkgray;" v-model="houseHeadPhone">{{houseHeadPhone}}</span>
  116. </view>
  117. </view>
  118. </view>
  119. <view class="uni-list">
  120. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  121. <view class="uni-list-cell-left">
  122. 户主身份证号码
  123. </view>
  124. <view class="uni-list-cell-db" style="margin-top: 10;">
  125. <span style="color: darkgray;"
  126. v-model="houseHeadIDcardNumber">{{houseHeadIDcardNumber}}</span>
  127. </view>
  128. </view>
  129. </view>
  130. <view class="uni-list">
  131. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  132. <view class="uni-list-cell-left">
  133. 管理所
  134. </view>
  135. <view class="uni-list-cell-db" style="margin-top: 10;">
  136. <span style="color: darkgray;" v-model="administrative">{{administrative}}</span>
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. <view class="background">
  143. <view class="uni-list">
  144. <view
  145. style="font-size: 16px;margin-left: 10px;margin-top: 10px;display: flex; justify-content: space-between;margin-bottom: 10px;">
  146. 未安装
  147. </view>
  148. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  149. <view>
  150. 原因
  151. </view>
  152. <view v-if="this.isEmpty(this.reasonValue.id)" style="margin-top: 10;"
  153. @click="pickerShow('reason')">
  154. <span style="color: darkgray;">请选择原因</span>
  155. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  156. </view>
  157. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('reason')">
  158. <span style="color: black;">{{reasonValue.name}}</span>
  159. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  160. </view>
  161. </view>
  162. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  163. <view class="uni-common-mt" style="width: 100%;">
  164. <text class="uni-title uni-common-pl">具体原因</text>
  165. <view style="width: 100%;box-sizing: border-box;">
  166. <textarea class="textarea" placeholder="请输入具体原因" maxlength="255"
  167. placeholder-style="padding: 10rpx;"
  168. style="width: 100%;height: 100%;border: 1rpx solid #cccccc; border-radius: 15rpx;padding: 10rpx;line-height:normal;"
  169. auto-height v-model="specificReasonsValue"></textarea>
  170. </view>
  171. </view>
  172. </view>
  173. </view>
  174. </view>
  175. </view>
  176. <view class="action-btn" v-show="reviewStatus!='1'">
  177. <button @click="submit" class="btn cu-btn block bg-blue lg round">确认上传</button>
  178. </view>
  179. <SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
  180. subtitleKey="id" v-model="name"></SelectPicker>
  181. <SelectPicker :list="dictOptions" @change="changeSelectDict" v-if="openDict" @close="closeDict"
  182. titleKey="dictLabel" subtitleKey="dictValue" v-model="dictLabel"></SelectPicker>
  183. </scroll-view>
  184. </template>
  185. <script>
  186. import SelectPicker from '../../components/selectPicker/select_picker.vue'
  187. import {
  188. getDicts
  189. } from "@/api/system/dict/data";
  190. import {
  191. getAreaList,
  192. getBuildingList,
  193. getUnitList,
  194. addTearOldPipe,
  195. getRoomProjectList,
  196. getRoomProjectId,
  197. getHousesList,
  198. } from '@/api/common';
  199. import {
  200. getToken
  201. } from '../../utils/auth';
  202. export default {
  203. components: {
  204. SelectPicker,
  205. },
  206. data() {
  207. return {
  208. title: '',
  209. name: '未安装',
  210. administrative: '',
  211. headers: {
  212. Authorization: "Bearer " + getToken()
  213. },
  214. reasonValue: {},
  215. specificReasonsValue: '',
  216. FJValue: {},
  217. houseHeadName: '',
  218. houseHeadPhone: '',
  219. houseHeadIDcardNumber: '',
  220. type: '',
  221. open: false,
  222. reviewStatus: '', //是否可以点击
  223. objValue: '', //上一页面传过来的值 新增接口用
  224. openDict: false,
  225. selectList: [],
  226. dictOptions: [],
  227. imgArr: [],
  228. XQValue: {},
  229. XZQValue: {},
  230. projectValue: {
  231. 'dictValue': '0'
  232. },
  233. time: '', //施工时间
  234. LDValue: {},
  235. DYValue: {},
  236. XQList: '',
  237. LDList: '',
  238. DYList: '',
  239. change: false,
  240. FJList: '',
  241. }
  242. },
  243. onLoad(options) {
  244. if ('params' in options) {
  245. this.objValue = JSON.parse(decodeURIComponent(options.params));
  246. uni.setNavigationBarTitle({
  247. title: '未安装'
  248. })
  249. }
  250. },
  251. methods: {
  252. //判断是否选择
  253. isEmpty(str) {
  254. return (!str || 0 === str.length);
  255. },
  256. change1() {
  257. this.change = !this.change
  258. },
  259. submit() {
  260. if (this.isEmpty(this.projectValue.dictValue)) {
  261. this.$modal.msg("请选择工程周期")
  262. return;
  263. }
  264. if (this.isEmpty(this.XZQValue.dictValue)) {
  265. this.$modal.msg("请选择行政区")
  266. return;
  267. }
  268. if (this.isEmpty(this.XQValue.id)) {
  269. this.$modal.msg("请选择小区")
  270. return;
  271. }
  272. if (this.isEmpty(this.LDValue.id)) {
  273. this.$modal.msg("请选择楼栋")
  274. return;
  275. }
  276. if (this.isEmpty(this.DYValue.id)) {
  277. this.$modal.msg("请选择单元")
  278. return;
  279. }
  280. if (this.isEmpty(this.FJValue.id)) {
  281. this.$modal.msg("请选择房间")
  282. return;
  283. }
  284. if (this.isEmpty(this.reasonValue.id)) {
  285. this.$modal.msg("请选择原因")
  286. return;
  287. }
  288. if (this.isEmpty(this.specificReasonsValue)) {
  289. this.$modal.msg("请输入具体原因")
  290. return;
  291. }
  292. uni.showLoading()
  293. let param = {
  294. district: this.XZQValue.dictValue,
  295. areaId: this.XQValue.id,
  296. buildingId: this.LDValue.id,
  297. unitId: this.isEmpty(this.DYValue.id) ? '' : this.DYValue.id,
  298. enginType: this.objValue.enginType, //写死 上一页面传过来的
  299. enginClassification: this.objValue
  300. .enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  301. enginCycle: this.projectValue.dictValue, //工程周期
  302. zEngineeringNodeBo: {
  303. type: this.objValue.enginClassValue, //写死 上一页面传过来的 (拆旧管等 字典值)
  304. zEngineeringInfoBo: {
  305. constructTime: this.time,
  306. zEngiineeringPhotoBoList: this.imgArr, //照片集合
  307. }
  308. }
  309. }
  310. addTearOldPipe(param).then(res => {
  311. uni.hideLoading()
  312. if (res.code == '200') {
  313. uni.showToast({
  314. title: res.msg,
  315. icon: 'none',
  316. //显示持续时间为 3秒
  317. duration: 2000
  318. });
  319. setTimeout(function() {
  320. uni.navigateBack();
  321. }, 1000)
  322. }
  323. })
  324. //提交接口执行逻辑
  325. },
  326. pickerShow(e) {
  327. this.type = e; //赋值类型
  328. if (e == 'xzq') { //行政区
  329. if (this.isEmpty(this.projectValue.dictValue)) {
  330. this.$modal.msg('请选择工程周期')
  331. } else {
  332. this.openDict = true;
  333. getDicts("district").then(response => {
  334. this.dictOptions = response.data;
  335. });
  336. }
  337. } else if (e == 'xq') { //小区
  338. if (this.isEmpty(this.XZQValue.dictValue)) {
  339. this.$modal.msg('请选择行政区')
  340. } else {
  341. this.open = true;
  342. this.selectList = this.XQList;
  343. }
  344. } else if (e == 'ld') { //楼栋
  345. if (this.isEmpty(this.XQValue.id)) {
  346. this.$modal.msg('请选择小区')
  347. } else {
  348. this.open = true;
  349. this.selectList = this.LDList;
  350. }
  351. } else if (e == 'dy') { //单元
  352. if (this.isEmpty(this.LDValue.id)) {
  353. this.$modal.msg('请选择楼栋')
  354. } else {
  355. this.open = true;
  356. this.selectList = this.DYList;
  357. }
  358. } else if (e == 'fj') { //房间
  359. if (this.isEmpty(this.DYValue.id)) {
  360. this.$modal.msg('请选择单元')
  361. } else {
  362. this.open = true;
  363. this.selectList = this.FJList;
  364. }
  365. }
  366. },
  367. changeSelectDict(item, index) {
  368. this.openDict = false;
  369. if (this.type == 'xzq') {
  370. this.XZQValue = item;
  371. //根据行政区id获取小区数据
  372. this.XQValue = ''; //重置小区数据
  373. this.LDValue = ''; //重置楼栋数据
  374. this.DYValue = ''; //重置单元数据
  375. getAreaList(item.dictValue).then(res => {
  376. this.XQList = res.data;
  377. })
  378. }
  379. },
  380. changeSelect(item, index) {
  381. this.open = false;
  382. if (this.type == 'xq') {
  383. this.XQValue = item;
  384. //根据小区id 获取楼栋数据
  385. this.LDValue = ''; //重置楼栋数据
  386. this.DYValue = ''; //重置单元数据
  387. this.administrative = item.administrative;
  388. getBuildingList(item.id).then(res => {
  389. this.LDList = res.data
  390. })
  391. } else if (this.type == 'ld') {
  392. this.LDValue = item;
  393. //根据楼栋ID 获取单元数据
  394. this.DYValue = ''; //重置单元数据
  395. getUnitList(item.id).then(res => {
  396. this.DYList = res.data
  397. })
  398. } else if (this.type == 'dy') {
  399. this.DYValue = item;
  400. this.FJValue = ''; //重置房间数据
  401. this.currentResidentsPhoe = [];
  402. this.houseHeadName = "";
  403. this.houseHeadPhone = "";
  404. this.houseHeadIDcardNumber = "";
  405. getHousesList(item.id).then(res => {
  406. this.FJList = res.data
  407. })
  408. } else if (this.type == 'fj') {
  409. this.FJValue = item;
  410. this.houseHeadName = item.houseUserName;
  411. this.houseHeadPhone = item.phone;
  412. this.houseHeadIDcardNumber = item.idCard;
  413. }
  414. },
  415. //关闭弹窗
  416. close(e) {
  417. this.open = false
  418. },
  419. //关闭弹窗
  420. closeDict(e) {
  421. this.openDict = false
  422. },
  423. }
  424. }
  425. </script>
  426. <style lang="scss">
  427. .container {
  428. display: flex;
  429. align-items: center;
  430. justify-content: space-between;
  431. padding: 10px;
  432. position: relative;
  433. }
  434. .uni-list {
  435. border: 1xp solid #eee;
  436. }
  437. .to-right-icon {
  438. width: 15px;
  439. height: 15px;
  440. position: absolute;
  441. top: 50%;
  442. transform: translateY(-50%);
  443. }
  444. .text {
  445. font-size: 16px;
  446. color: #333;
  447. }
  448. .background {
  449. // border: 15px solid hsla(0, 0%, 100%, .5);
  450. background: white;
  451. background-clip: padding-box;
  452. padding: 20rpx;
  453. border-radius: 20rpx;
  454. margin: 20rpx;
  455. /*从padding开始往外面裁剪背景*/
  456. }
  457. .btn {
  458. width: 715rpx;
  459. height: 69rpx;
  460. background: #79A4F0;
  461. border-radius: 6rpx;
  462. font-size: 25rpx;
  463. font-family: Microsoft YaHei;
  464. font-weight: 400;
  465. color: #FFFFFF;
  466. line-height: 69rpx;
  467. margin-top: 40rpx;
  468. margin-bottom: 100rpx;
  469. }
  470. .number {
  471. display: flex;
  472. /* 水平居中显示子元素 */
  473. align-items: flex-start;
  474. /* 垂直居中显示子元素 */
  475. justify-content: space-between;
  476. /* 左右间距等于间距大小 */
  477. padding: 10px;
  478. /* 设置padding以提高视觉效果 */
  479. }
  480. .textarea {
  481. margin-top: 10upx;
  482. width: 100%;
  483. border: 1rpx solid red;
  484. min-height: 100upx;
  485. line-height: 20px;
  486. }
  487. </style>