courtyard.vue 25 KB

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