courtyard.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912
  1. <template>
  2. <view>
  3. <view class="background">
  4. <view class="uni-list">
  5. <view class="container">
  6. <view>
  7. 工程周期
  8. </view>
  9. <view v-if="this.isEmpty(this.projectValue.dictValue)" style="margin-top: 10;"
  10. @click="pickerShow('gczq')">
  11. <span style="color: darkgray;">请选择工程周期</span>
  12. <image src="../../../static/images/icon_right.png"
  13. style=" position: absolute; width: 15px;height: 15px;"></image>
  14. </view>
  15. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('gczq')">
  16. <span style="color: black;">{{projectValue.dictLabel}}</span>
  17. <image src="../../../static/images/icon_right.png"
  18. style=" position: absolute; width: 15px;height: 15px;"></image>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="uni-list">
  23. <view class="container">
  24. <view>
  25. 行政区
  26. </view>
  27. <view v-if="this.isEmpty(this.XZQValue.dictValue)" style="margin-top: 10;"
  28. @click="pickerShow('xzq')">
  29. <span style="color: darkgray;">请选择行政区</span>
  30. <image src="../../../static/images/icon_right.png"
  31. style=" position: absolute; width: 15px;height: 15px;"></image>
  32. </view>
  33. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('xzq')">
  34. <span style="color: black;">{{XZQValue.dictLabel}}</span>
  35. <image src="../../../static/images/icon_right.png"
  36. style=" position: absolute; width: 15px;height: 15px;"></image>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="uni-list">
  41. <view class="container">
  42. <view>
  43. 小区
  44. </view>
  45. <view v-if="this.isEmpty(this.XQValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
  46. @click="pickerShow('xq')">
  47. <span style="color: darkgray;">请选择小区</span>
  48. <image src="../../../static/images/icon_right.png"
  49. style=" position: absolute; width: 15px;height: 15px;"></image>
  50. </view>
  51. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('xq')">
  52. <span style="color: black;">{{XQValue.name}}</span>
  53. <image src="../../../static/images/icon_right.png"
  54. style=" position: absolute; width: 15px;height: 15px;"></image>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="uni-list">
  59. <view class="container" style="margin-bottom: 10px;">
  60. <view class="uni-list-cell-left">
  61. 楼栋
  62. </view>
  63. <view v-if="this.isEmpty(this.LDValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
  64. @click="pickerShow('ld')">
  65. <span style="color: darkgray;">请选择楼栋</span>
  66. <image src="../../../static/images/icon_right.png"
  67. style=" position: absolute; width: 15px;height: 15px;"></image>
  68. </view>
  69. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('ld')">
  70. <span style="color: black;">{{LDValue.name}}</span>
  71. <image src="../../../static/images/icon_right.png"
  72. style=" position: absolute; width: 15px;height: 15px;"></image>
  73. </view>
  74. </view>
  75. </view>
  76. <SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
  77. subtitleKey="id" v-model="name"></SelectPicker>
  78. <SelectPicker :list="dictOptions" @change="changeSelectDict" v-if="openDict" @close="closeDict"
  79. titleKey="dictLabel" subtitleKey="dictValue" v-model="dictLabel"></SelectPicker>
  80. </view>
  81. <view class="background">
  82. <view>
  83. <view class="uni-list">
  84. <view style="font-size: 16px;margin-left: 10px;margin-top: 10px;">
  85. {{objValue.enginClassValue}}
  86. <span
  87. style="color: blue;font-size: 14px; display: flex;justify-content:flex-end; margin-right: 15px;"
  88. @click="history">历史</span>
  89. </view>
  90. <view class="container">
  91. <view>
  92. 施工时间
  93. </view>
  94. <view @click="openDatetimePicker('sg')">
  95. <span style="color: black;">{{time}}</span>
  96. <image src="../../../static/images/icon_right.png"
  97. style=" position: absolute; width: 15px;height: 15px;"></image>
  98. </view>
  99. </view>
  100. <view class="container" v-if="objValue.enginClassValue=='回填'">
  101. <view>
  102. 回填时间
  103. </view>
  104. <view style="margin-top: 10;" @click="openDatetimePicker('ht')">
  105. <span style="color: black;">{{BackfillingTime ? BackfillingTime:'请选择回填时间'}}</span>
  106. <image src="../../../static/images/icon_right.png"
  107. style=" position: absolute; width: 15px;height: 15px;"></image>
  108. </view>
  109. </view>
  110. <view class="container" v-else-if="objValue.enginClassValue=='打压'">
  111. <view>
  112. 分段打压是否合格
  113. </view>
  114. <view v-if="this.isEmpty(this.isOkValue)" style="margin-top: 10;" @click="showActionsheet()">
  115. <span style="color: darkgray;">请选择分段打压是否合格</span>
  116. <image src="../../../static/images/icon_right.png"
  117. style=" position: absolute; width: 15px;height: 15px;"></image>
  118. </view>
  119. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="showActionsheet()">
  120. <span style="color: black;">{{isOkLabel}}</span>
  121. <image src="../../../static/images/icon_right.png"
  122. style=" position: absolute; width: 15px;height: 15px;"></image>
  123. </view>
  124. </view>
  125. <view class="container">
  126. <view class="uni-common-mt" style="width: 100%;">
  127. <text class="uni-title uni-common-pl">施工内容</text>
  128. <view style="width: 100%;padding-right: 20rpx;box-sizing: border-box;">
  129. <textarea class="textarea" placeholder="请输入施工内容" maxlength="255"
  130. placeholder-style="padding: 10rpx;"
  131. style="width: 100%;height: 100%;border: 1rpx solid #cccccc; border-radius: 15rpx;padding: 10rpx;line-height:normal;"
  132. auto-height v-model="projectContent"></textarea>
  133. </view>
  134. </view>
  135. </view>
  136. <view class="container">
  137. <view>
  138. 材 质
  139. </view>
  140. <view v-if="this.isEmpty(this.materialValue.id)" style="margin-top: 10;"
  141. @click="pickerShow('cz')">
  142. <span style="color: darkgray;">请选择材质</span>
  143. <image src="../../../static/images/icon_right.png"
  144. style=" position: absolute; width: 15px;height: 15px;"></image>
  145. </view>
  146. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('cz')">
  147. <span style="color: black;">{{materialValue.name}}</span>
  148. <image src="../../../static/images/icon_right.png"
  149. style=" position: absolute; width: 15px;height: 15px;"></image>
  150. </view>
  151. </view>
  152. <view class="container">
  153. <view>
  154. 规 格
  155. </view>
  156. <view v-if="this.isEmpty(this.specificationValue.id)" style="margin-top: 10;"
  157. @click="pickerShow('gg')">
  158. <span style="color: darkgray;">请选择规格</span>
  159. <image src="../../../static/images/icon_right.png"
  160. style=" position: absolute; width: 15px;height: 15px;"></image>
  161. </view>
  162. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('gg')">
  163. <span style="color: black;">{{specificationValue.name}}</span>
  164. <image src="../../../static/images/icon_right.png"
  165. style=" position: absolute; width: 15px;height: 15px;"></image>
  166. </view>
  167. </view>
  168. <view class="container">
  169. <text>数 量</text>
  170. <input class="uni-input" type="number" v-model="inputNumberValue" placeholder="请填写数量"
  171. maxlength="11" style="margin-left: 10px;text-align: right;"></input>
  172. </view>
  173. </view>
  174. <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
  175. <view class="container" style="color: gainsboro;">*请上传照片</view>
  176. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  177. <image src="/static/images/chooseimg.png" mode=""
  178. style="width: 100rpx; height: 100rpx; margin: 0 12rpx;; " @click="choose()"></image>
  179. <view v-for="(item,index) in imgArr" :key="index" style="position: relative;">
  180. <view
  181. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' ">
  182. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  183. @click="showPhoto(index)">
  184. </image>
  185. </view>
  186. <view v-else>
  187. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  188. </view>
  189. <view @click="remove(index)"
  190. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  191. <image src="../../../static/images/icon_close.png" style=" width: 15px; height: 15px;">
  192. </image>
  193. </view>
  194. </view>
  195. </view>
  196. </view>
  197. </view>
  198. </view>
  199. <view class="action-btn">
  200. <button @click="submit" class="btn cu-btn block bg-blue lg round">确认上传</button>
  201. </view>
  202. <bottom-sheet ref="refShare" :data="historyList"></bottom-sheet>
  203. <yt-dateTimePicker ref="myPicker" @submit="handleSubmit" :start-year="2024" :end-year="2099"
  204. :time-hide="[true, true, true, true, true, true]" :time-label="['年', '月', '日', '时', '分', '秒']" />
  205. </view>
  206. </template>
  207. <script>
  208. import SelectPicker from '../../../components/selectPicker/select_picker.vue'
  209. import bottomSheet from '../../../components/bottomSheet/bottomSheet.vue'
  210. import {
  211. getDicts
  212. } from "@/api/system/dict/data";
  213. import {
  214. getAreaList,
  215. getBuildingList,
  216. addTearOldPipe,
  217. getEnginMaterialQualityList,
  218. getEnginSpecificationsList,
  219. getRoomProjectList,
  220. getRoomProjectId,
  221. } from '@/api/common'
  222. import {
  223. getToken
  224. } from '../../../utils/auth';
  225. export default {
  226. components: {
  227. SelectPicker,
  228. bottomSheet,
  229. },
  230. data() {
  231. return {
  232. headers: {
  233. Authorization: "Bearer " + getToken()
  234. },
  235. type: '',
  236. open: false,
  237. objValue: '', //上一页面传过来的值 新增接口用
  238. openDict: false,
  239. selectList: [],
  240. dictOptions: [],
  241. imgArr: [],
  242. XQValue: {},
  243. XZQValue: {},
  244. projectValue: {},
  245. LevelValue: {},
  246. isOkValue: '', //分段打压是否合格
  247. isOkLabel: '', //分段打压是否合格label
  248. LDValue: {},
  249. time: '', //施工时间
  250. timeType: '', //时间类型
  251. BackfillingTime: '', //回填时间
  252. showTime: false,
  253. specificationValue: {}, //规格
  254. projectContent: '', //施工内容
  255. materialValue: {}, //材质
  256. brandValue: {}, //品牌
  257. doorValue: {}, //上门类型
  258. SelfClosValve: {}, //自闭阀类型
  259. materialList: '', //材质list
  260. XQList: '',
  261. LDList: '',
  262. progress: 0, //上传图片进度百分比
  263. loading: false,
  264. inputNumberValue: '',
  265. title: '',
  266. historyList: {} //历史数据
  267. }
  268. },
  269. created() {
  270. this.time = this.traversalTime(new Date().getTime()) //在data里定义变量-nowTime
  271. },
  272. onLoad(options) {
  273. if ('params' in options) {
  274. this.objValue = JSON.parse(decodeURIComponent(options.params));
  275. if (this.objValue.enginType == `old_renovation`) {
  276. this.title = '旧改工程-庭院'
  277. } else if (this.objValue.enginType == `new_built`) {
  278. this.title = '新建工程-庭院'
  279. }
  280. uni.setNavigationBarTitle({
  281. title: this.title
  282. })
  283. }
  284. },
  285. methods: {
  286. // 打开picker
  287. openDatetimePicker(type) {
  288. this.timeType = type;
  289. this.$refs.myPicker.show();
  290. },
  291. // 关闭picker
  292. closeDatetimePicker() {
  293. this.$refs.myPicker.hide();
  294. },
  295. handleSubmit(e) {
  296. if (this.timeType == 'ht') {
  297. this.BackfillingTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
  298. } else {
  299. this.time = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
  300. }
  301. },
  302. //获取当前时间
  303. traversalTime(timestamp) {
  304. //timestamp(时间戳)是整数,否则要parseInt转换
  305. let time = new Date(timestamp);
  306. let y = time.getFullYear();
  307. let m = time.getMonth() + 1;
  308. let d = time.getDate();
  309. let h = time.getHours();
  310. let mm = time.getMinutes();
  311. let s = time.getSeconds();
  312. return y + '-' + this.addTimes(m) + '-' + this.addTimes(d) + ' ' + this.addTimes(h) + ':' + this.addTimes(
  313. mm) + ':' + this.addTimes(s);
  314. },
  315. addTimes(m) {
  316. return m < 10 ? '0' + m : m
  317. },
  318. //判断是否选择
  319. isEmpty(str) {
  320. return (!str || 0 === str.length);
  321. },
  322. // 显示历史弹窗
  323. handleShowSheet() {
  324. this.shareState = true;
  325. },
  326. // 隐藏历史弹窗
  327. handleHiddenShare() {
  328. this.shareState = false;
  329. },
  330. showPhoto(index) {
  331. uni.previewImage({
  332. current: index,
  333. urls: this.imgArr,
  334. })
  335. },
  336. remove(index) {
  337. uni.showModal({
  338. title: '提示',
  339. content: '是否删除该图片或视频?',
  340. success: (res) => {
  341. if (res.confirm) {
  342. this.imgArr.splice(index, 1)
  343. console.log('this.imgarr', this.imgArr)
  344. if (this.imgArr.length <= 0) {
  345. this.photo = true;
  346. }
  347. }
  348. }
  349. })
  350. },
  351. choose() {
  352. let _this = this;
  353. uni.showActionSheet({
  354. title: '上传',
  355. itemList: ['图片', '视频'],
  356. success: (res) => {
  357. console.log(res)
  358. if (res.tapIndex == 0) {
  359. this.chooseimage()
  360. } else {
  361. this.choosevideo()
  362. }
  363. }
  364. })
  365. },
  366. chooseimage() {
  367. let _this = this;
  368. console.log('图片', _this.headers)
  369. uni.chooseImage({
  370. sizeType: ['album', 'camera'],
  371. success(resp) {
  372. resp.tempFiles.forEach((item, index) => {
  373. const task = uni.uploadFile({
  374. url: _this.$HTTP + `/obs`,
  375. filePath: item.path,
  376. name: 'file',
  377. formData: {},
  378. header: _this.headers,
  379. success: res => {
  380. // 判断是否json字符串,将其转为json格式
  381. console.log("结果", res)
  382. // let data = _this.$u.test.jsonString(res
  383. // .data) ? JSON.parse(res.data) : res.data;
  384. let data = JSON.parse(res.data);
  385. if (![200].includes(data.code)) {
  386. // this.uploadError(index, data);
  387. _this.$modal.msg(data.msg)
  388. } else {
  389. if (_this.progress === 100) {
  390. console.log('_this.progress', _this.progress)
  391. //console.log('data----', data)data
  392. console.log('res--', res)
  393. _this.imgArr.push(data.data.url)
  394. console.log('imgArr', _this.imgArr)
  395. _this.$modal.msg('上传成功!')
  396. _this.photo = false;
  397. }
  398. }
  399. },
  400. fail: e => {
  401. console.log(e)
  402. _this.$modal.msg('上传失败!')
  403. //_this.uploadError(index, e);
  404. },
  405. complete: res => {
  406. uni.hideLoading();
  407. _this.uploading = false;
  408. }
  409. });
  410. task.onProgressUpdate(res => {
  411. _this.progress = res.progress;
  412. console.log('onProgressUpdate', res)
  413. console.log('task.onProgressUpdate', _this.progress)
  414. uni.showLoading({
  415. title: '上传中'
  416. })
  417. if (_this.progress != 100) {
  418. _this.loading = false
  419. console.log('_this.loading false', _this.loading)
  420. } else {
  421. _this.loading = true
  422. console.log('_this.loading true', _this.loading)
  423. }
  424. });
  425. })
  426. },
  427. })
  428. },
  429. choosevideo() {
  430. let _this = this;
  431. console.log('视频')
  432. uni.chooseVideo({
  433. sourceType: ['album', 'camera'],
  434. maxDuration: 30,
  435. success(resp) {
  436. const task = uni.uploadFile({
  437. url: _this.$HTTP + `/obs`,
  438. filePath: resp.tempFilePath,
  439. name: 'file',
  440. formData: {},
  441. header: _this.headers,
  442. success: res => {
  443. // 判断是否json字符串,将其转为json格式
  444. let data = JSON.parse(res.data);
  445. if (![200].includes(res.statusCode)) {
  446. this.uploadError(index, data);
  447. } else {
  448. //上传成功
  449. if (_this.progress === 100) {
  450. console.log('_this.progress', _this.progress)
  451. _this.imgArr.push(data.data.url)
  452. console.log('imgArr', _this.imgArr)
  453. _this.$modal.msg('上传成功!')
  454. _this.photo = false;
  455. }
  456. }
  457. },
  458. fail: e => {
  459. _this.$modal.msg('上传失败!')
  460. this.uploadError(index, e);
  461. },
  462. complete: res => {
  463. uni.hideLoading();
  464. _this.uploading = false;
  465. }
  466. });
  467. task.onProgressUpdate(res => {
  468. _this.progress = res.progress;
  469. console.log('onProgressUpdate', res)
  470. uni.showLoading({
  471. title: '上传中'
  472. })
  473. if (_this.progress != 100) {
  474. _this.loading = false
  475. console.log('_this.loading false', _this.loading)
  476. } else {
  477. _this.loading = true
  478. console.log('_this.loading true', _this.loading)
  479. }
  480. });
  481. },
  482. })
  483. },
  484. showActionsheet() {
  485. //分段打压是否合格
  486. getDicts("sys_yes_no").then(response => {
  487. this.dictOptions = response.data;
  488. let array = [];
  489. this.dictOptions.forEach((item, index) => {
  490. array.push(item.dictLabel)
  491. });
  492. uni.showActionSheet({
  493. itemList: array,
  494. success: (res) => {
  495. // console.log('选择了第' + (res.tapIndex + 1) + '个选项');
  496. // console.log(this.dictOptions[res.tapIndex].dictValue)
  497. this.isOkValue = this.dictOptions[res.tapIndex].dictValue;
  498. this.isOkLabel = this.dictOptions[res.tapIndex].dictLabel;
  499. },
  500. fail: (err) => {
  501. console.log('弹窗取消');
  502. }
  503. });
  504. });
  505. },
  506. pickerShow(e) {
  507. this.type = e; //赋值类型
  508. if (e == 'cz') { //材质
  509. this.open = true;
  510. getEnginMaterialQualityList("民用工程").then(response => {
  511. this.selectList = response.data;
  512. });
  513. } else if (e == 'gg') { //规格
  514. if (this.isEmpty(this.materialValue.id)) {
  515. this.$modal.msg('请选择材质')
  516. } else {
  517. this.open = true;
  518. this.selectList = this.materialList;
  519. }
  520. } else if (e == 'gczq') { //工程周期
  521. this.openDict = true;
  522. getDicts("engin_cycle").then(response => {
  523. this.dictOptions = response.data;
  524. });
  525. } else if (e == 'xzq') { //行政区
  526. if (this.isEmpty(this.projectValue.dictValue)) {
  527. this.$modal.msg('请选择工程周期')
  528. } else {
  529. this.openDict = true;
  530. getDicts("district").then(response => {
  531. this.dictOptions = response.data;
  532. });
  533. }
  534. //this.selectList = this.dictOptions;
  535. } else if (e == 'xq') { //小区
  536. if (this.isEmpty(this.XZQValue.dictValue)) {
  537. this.$modal.msg('请选择行政区')
  538. } else {
  539. this.open = true;
  540. this.selectList = this.XQList;
  541. }
  542. } else if (e == 'ld') { //楼栋
  543. if (this.isEmpty(this.XQValue.id)) {
  544. this.$modal.msg('请选择小区')
  545. } else {
  546. this.open = true;
  547. this.selectList = this.LDList;
  548. }
  549. }
  550. },
  551. changeSelectDict(item, index) {
  552. this.openDict = false;
  553. if (this.type == 'isok') {
  554. this.isOkValue = item
  555. } else if (this.type == 'gczq') {
  556. this.projectValue = item
  557. } else if (this.type == 'xzq') {
  558. this.XZQValue = item;
  559. //根据行政区id获取小区数据
  560. this.XQValue = ''; //重置小区数据
  561. this.LDValue = ''; //重置楼栋数据
  562. getAreaList(item.dictValue).then(res => {
  563. this.XQList = res.data;
  564. })
  565. }
  566. },
  567. changeSelect(item, index) {
  568. // this.index = index;
  569. // this.address = item.communityName;
  570. this.open = false;
  571. if (this.type == 'cz') {
  572. this.materialValue = item;
  573. this.specificationValue = ''; //重置规格
  574. //根据材质ID 获取规格数据
  575. getEnginSpecificationsList(item.id).then(res => {
  576. this.materialList = res.data
  577. })
  578. } else if (this.type == 'gg') {
  579. this.specificationValue = item;
  580. } else if (this.type == 'xq') {
  581. this.XQValue = item;
  582. //根据小区id 获取楼栋数据
  583. this.LDValue = ''; //重置楼栋数据
  584. this.DYValue = ''; //重置单元数据
  585. this.FJValue = ''; //重置房间数据
  586. getBuildingList(item.id).then(res => {
  587. this.LDList = res.data
  588. // console.log("楼栋=", res)
  589. })
  590. } else if (this.type == 'ld') {
  591. this.LDValue = item;
  592. }
  593. },
  594. //关闭弹窗
  595. close(e) {
  596. this.open = false
  597. },
  598. //关闭弹窗
  599. closeDict(e) {
  600. this.openDict = false
  601. },
  602. //提交数据
  603. submit() {
  604. if (this.isEmpty(this.projectValue.dictValue)) {
  605. this.$modal.msg("请选择工程周期")
  606. return
  607. }
  608. if (this.isEmpty(this.XZQValue.dictValue)) {
  609. this.$modal.msg("请选择行政区")
  610. return
  611. }
  612. if (this.isEmpty(this.XQValue.id)) {
  613. this.$modal.msg("请选择小区")
  614. return
  615. }
  616. // else if (this.isEmpty(this.LDValue.id)) {
  617. // this.$modal.msg("请选择楼栋")
  618. // }
  619. if (this.objValue.enginClassValue == '回填' && this.isEmpty(this.BackfillingTime)) {
  620. this.$modal.msg("请选择回填时间")
  621. return
  622. }
  623. if (this.objValue.enginClassValue == '打压' && this.isEmpty(this.isOkValue)) {
  624. this.$modal.msg("请选择分段打压是否合格")
  625. return
  626. }
  627. if (this.isEmpty(this.materialValue.id)) {
  628. this.$modal.msg("请选择材质")
  629. return
  630. }
  631. if (this.isEmpty(this.specificationValue.id)) {
  632. this.$modal.msg("请选择规格")
  633. return
  634. }
  635. if (this.isEmpty(this.inputNumberValue)) {
  636. this.$modal.msg("请输入数量")
  637. return
  638. }
  639. if (this.imgArr.length <= 0) {
  640. this.$modal.msg('请上传照片或视频')
  641. return
  642. }
  643. if (this.loading == false) {
  644. this.$modal.msg('照片或视频未上传完毕,无法提交!')
  645. return
  646. }
  647. //提交
  648. this.onsubmit();
  649. },
  650. onsubmit() {
  651. let unitId = '';
  652. let houseId = '';
  653. let buildingId = '';
  654. if (this.isEmpty(this.LDValue.id)) {
  655. buildingId = '';
  656. } else {
  657. buildingId = this.LDValue.id
  658. }
  659. //提交
  660. let param = {
  661. district: this.XZQValue.dictValue,
  662. areaId: this.XQValue.id,
  663. buildingId: buildingId, //不必传 如果没有传 ' '
  664. unitId: unitId,
  665. houseId: houseId, //传空
  666. enginType: this.objValue.enginType, //写死 上一页面传过来的
  667. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  668. enginCycle: this.projectValue.dictValue, //工程周期
  669. zEngineeringNodeBo: {
  670. type: this.objValue.enginClassValue, //写死 上一页面传过来的 (拆旧管等 字典值)
  671. zEngineeringInfoBo: {
  672. //constructAccordingDrawings: this.isCheck, //是否按图纸施工
  673. segmentedCompressionQualified: this.isOkValue, // 分段打压是否台格
  674. zEngiineeringPhotoBoList: this.imgArr, //照片集合
  675. constructTime: this.time, //施工时间
  676. backfillTime: this.BackfillingTime, // 回填时间
  677. remark: this.projectContent, //施工内容
  678. // headName: this.user.nickName, // 负责人名称
  679. // headPhone: this.user.phonenumber, // 负责人电话
  680. zEngineeringMaterialBo: [{
  681. materialQuality: this.materialValue.id, //材质
  682. specifications: this.specificationValue.id, //规格
  683. number: this.inputNumberValue //数量
  684. }]
  685. }
  686. }
  687. }
  688. addTearOldPipe(param).then(res => {
  689. if (res.code == '200') {
  690. uni.showToast({
  691. title: res.msg,
  692. icon: 'none',
  693. //显示持续时间为 3秒
  694. duration: 2000
  695. });
  696. setTimeout(function() {
  697. uni.navigateBack();
  698. }, 1000)
  699. }
  700. })
  701. },
  702. history() {
  703. if (this.isEmpty(this.projectValue.dictValue)) {
  704. this.$modal.msg("请选择工程周期")
  705. return
  706. }
  707. if (this.isEmpty(this.XZQValue.dictValue)) {
  708. this.$modal.msg("请选择行政区")
  709. return
  710. }
  711. if (this.isEmpty(this.XQValue.id)) {
  712. this.$modal.msg("请选择小区")
  713. return
  714. }
  715. let unitId = '';
  716. let houseId = '';
  717. let buildingId = '';
  718. if (this.isEmpty(this.LDValue.id)) {
  719. buildingId = '';
  720. } else {
  721. buildingId = this.LDValue.id
  722. }
  723. let param = {
  724. areaId: this.XQValue.id, // 小区id
  725. buildingId: buildingId, // 楼宇id
  726. enginCycle: this.projectValue.dictValue, // 工程周期
  727. unitId: unitId,
  728. houseId: houseId, //传空
  729. enginType: this.objValue.enginType, //写死 上一页面传过来的
  730. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  731. }
  732. getRoomProjectId(param).then(res => {
  733. if (res.code == '200') {
  734. if (res.data != null) {
  735. getRoomProjectList(res.data.id, this.objValue.enginClassValue).then(
  736. res => {
  737. this.historyList = res.data
  738. if (res.data.zEngineeringNodeBo != null) {
  739. this.showHistoryList();
  740. } else {
  741. this.$modal.msg("暂无历史信息")
  742. }
  743. })
  744. } else {
  745. this.$modal.msg("暂无工程信息")
  746. }
  747. } else {
  748. this.$modal.msg(res.msg)
  749. }
  750. })
  751. },
  752. showHistoryList() {
  753. this.$refs.refShare.handleShowShare();
  754. }
  755. }
  756. }
  757. </script>
  758. <style>
  759. .container {
  760. display: flex;
  761. margin-left: 10px;
  762. margin-top: 10px;
  763. margin-right: 10px;
  764. align-items: flex-start;
  765. justify-content: space-between;
  766. }
  767. .text {
  768. font-size: 16px;
  769. color: #333;
  770. }
  771. .background {
  772. border: 15px solid hsla(0, 0%, 100%, .5);
  773. background: white;
  774. background-clip: padding-box;
  775. padding-left: 5px;
  776. padding-right: 10px;
  777. /*从padding开始往外面裁剪背景*/
  778. }
  779. .btn {
  780. margin-top: 40px;
  781. margin-right: 20px;
  782. margin-bottom: 120px;
  783. margin-left: 20px;
  784. height: 45px;
  785. }
  786. .number {
  787. display: flex;
  788. /* 水平居中显示子元素 */
  789. align-items: flex-start;
  790. /* 垂直居中显示子元素 */
  791. justify-content: space-between;
  792. /* 左右间距等于间距大小 */
  793. padding: 10px;
  794. /* 设置padding以提高视觉效果 */
  795. }
  796. .textarea {
  797. margin-top: 10upx;
  798. width: 100%;
  799. border: 1rpx solid red;
  800. min-height: 100upx;
  801. line-height: 20px;
  802. }
  803. </style>