courtyard.vue 26 KB

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