cityConstrution.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849
  1. <template>
  2. <view>
  3. <view class="align-items" style="margin-top: 80rpx;">
  4. <back></back>
  5. <view class="title-text" style="margin-left: 20rpx;">
  6. 阀管施工
  7. </view>
  8. </view>
  9. <view style="margin-top: 60rpx;">
  10. <view>
  11. <view class="font-fifty-six SourceHanSansCN choose" @click="openHouse('district')">
  12. {{districtName ? districtName :'选择行政区'}}
  13. <!-- <u-select v-model="houseShow" :list="chooseHouseList" @confirm="chooseHouse"></u-select> -->
  14. </view>
  15. </view>
  16. <view>
  17. <view class="font-fifty-six SourceHanSansCN choose" @click="openHouse('xiaoqu')">
  18. {{house ? house : '选择小区'}}
  19. <!-- <u-select v-model="bulidShow" :list="chooseBuildList" @confirm="chooseBuild"></u-select> -->
  20. </view>
  21. </view>
  22. <view>
  23. <view class="font-fifty-six SourceHanSansCN choose" @click="openHouse('louyu')">
  24. {{bulid ? bulid : '选择楼宇'}}
  25. <!-- <u-select v-model="bulidShow" :list="chooseBuildList" @confirm="chooseBuild"></u-select> -->
  26. </view>
  27. </view>
  28. <view>
  29. <view class="font-fifty-six SourceHanSansCN choose" @click="openHouse('danyuan')">
  30. {{unit ? unit : '选择单元'}}
  31. <!-- openUnit(), <u-select v-model="unitShow" :list="chooseUnitList" @confirm="chooseUnit"></u-select> -->
  32. </view>
  33. </view>
  34. <view>
  35. <view class="font-fifty-six SourceHanSansCN choose" @click="openHouse('menpai')">
  36. {{houseNumber ? houseNumber : '选择门牌'}}
  37. <!-- open(), <u-select v-model="houseNumberShow" :list="chooseNumberList" @confirm="chooseNumber"></u-select> -->
  38. </view>
  39. </view>
  40. <view>
  41. <view class="font-fifty-six SourceHanSansCN select-type" @click="openType('shows')">
  42. 上门类型 <text class="font-fifty-six SourceHanSansCN" style="color: #232146;">
  43. {{type ? '----' + type : ''}}</text>
  44. <u-select v-model="shows" :list="mounicipalList" @confirm="confirm"></u-select>
  45. </view>
  46. <view v-if="typeValue">
  47. <view v-if=" typeValue === '002' ">
  48. <view class="font-fifty-six SourceHanSansCN select-type" @click="projectType()">
  49. 自闭阀类型 <text class="font-fifty-six SourceHanSansCN" style="color: #232146;">
  50. {{valueType ? '----' + valueType : ''}}</text>
  51. <u-select v-model="listTypeShow" :list="typeList" @confirm="listType"></u-select>
  52. </view>
  53. <view class="font-fifty-six SourceHanSansCN tube" @click="openType('tubeType')">
  54. 管子类别
  55. <text class="font-fifty-six SourceHanSansCN" style="color: #232146;">
  56. {{tubeType ?'----' + tubeType:''}}</text>
  57. <u-select v-model="tubeTypeShow" :list="tubeTypeList" @confirm="tubeTypeConfirm"></u-select>
  58. </view>
  59. <view class="font-fifty-six SourceHanSansCN tube" @click="openType('tubeLong')">
  60. 管子长度
  61. <text class="font-fifty-six SourceHanSansCN" style="color: #232146;">
  62. {{tubeLong ?'----' + tubeLong :''}}</text>
  63. <u-select v-model="tubeLongShow" :list="tubeTypeLongList" @confirm="tubeLongConfirm">
  64. </u-select>
  65. </view>
  66. </view>
  67. <view class="upload align-items">
  68. <view class="" style="display: flex; flex-wrap: wrap;">
  69. <image src="/static/icon/chooseimg.png" mode=""
  70. style="width: 190rpx; height: 190rpx; margin: 0 12rpx;; " @click="choose()"></image>
  71. <view v-for="(item,index) in imgArr" :key="index" style="position: relative;">
  72. <view
  73. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' ">
  74. <image :src="item" mode="" style="width: 190rpx; height: 190rpx; margin: 0 12rpx;"
  75. @click="showPhoto(index)">
  76. </image>
  77. </view>
  78. <view v-else>
  79. <video :src="item" style="width: 190rpx; height: 190rpx; margin: 0 12rpx;"></video>
  80. </view>
  81. <view @click="remove(index)"
  82. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%; background-color: #FF0000;">
  83. <u-icon name="close" color="#FFFFFF" size="35"></u-icon>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="gray font-forty-eight SourceHanSansCN" v-if="photo">
  88. 此处添加照片或视频
  89. </view>
  90. </view>
  91. <view class="upload">
  92. <text class="font-forty SourceHanSansCN">备注:</text>
  93. <textarea value="" placeholder="请输入备注" v-model="remark" />
  94. </view>
  95. </view>
  96. <view class="font-fifty-six SourceHanSansCN total background-color1" @click="submit()">
  97. 提交数据
  98. </view>
  99. <!-- <u-select v-model="shows" :list="mounicipalList" @confirm="confirm"></u-select> -->
  100. <!-- <u-select v-model="tubeTypeShow" :list="tubeTypeList" @confirm="tubeTypeConfirm"></u-select> -->
  101. <!-- <u-select v-model="tubeLongShow" :list="tubeTypeLongList" @confirm="tubeLongConfirm"></u-select> -->
  102. </view>
  103. </view>
  104. <u-popup v-model="pop" mode="bottom" height="1000rpx">
  105. <view style="margin: 20rpx;">
  106. <u-search v-show="inputShow" placeholder="请输入搜索内容" v-model="keyword"
  107. :action-style="{'font-size':'40rpx'}" @custom="searchinfo(selectType)"></u-search>
  108. </view>
  109. <view>
  110. <scroll-view scroll-y="true" style="height: 600rpx; text-align: center;">
  111. <view v-for="(item,index) in chooseHouseList" :key="item.value">
  112. <view :class="current === index ? 'active' : '' " style="color: #000000;font-size: 56rpx;"
  113. @click="active(item,index)">
  114. {{item.label}}
  115. </view>
  116. </view>
  117. </scroll-view>
  118. <view class="">
  119. <button type="default" class="font-fifty-six" @click="search(selectType)">确定</button>
  120. </view>
  121. <view class="">
  122. <button type="default" @click="pop = false;" class="font-fifty-six">取消</button>
  123. </view>
  124. </view>
  125. </u-popup>
  126. </view>
  127. </template>
  128. <script>
  129. import service from '@/api/index.js'
  130. export default {
  131. components: {
  132. },
  133. data() {
  134. return {
  135. keyword: '',
  136. selectType: '',
  137. pop: false,
  138. inputShow: false,
  139. housename: '',
  140. houseid: 0,
  141. buildid: 0,
  142. unitid: 0,
  143. numberid: 0,
  144. houseShow: false,
  145. current: -1,
  146. chooseHouseList: [],
  147. districtId: 0,
  148. districtName: '选择行政区',
  149. house: '选择小区',
  150. bulid: '选择楼宇',
  151. unit: '选择单元',
  152. houseNumber: '选择门牌',
  153. action: this.$HTTP.webUrl + `/obs`,
  154. shows: false,
  155. tubeTypeShow: false,
  156. tubeLongShow: false,
  157. mounicipalList: [],
  158. tubeTypeList: [],
  159. tubeTypeLongList: [],
  160. type: '',
  161. tubeType: '',
  162. tubeLong: '',
  163. // url: [],
  164. photo: true,
  165. typeValue: '',
  166. headers: {
  167. MAuthorization: "wxBearer " + uni.getStorageSync('token')
  168. },
  169. housedata: '',
  170. typeList: [],
  171. listTypeShow: false,
  172. valueType: '',
  173. uploading: false,
  174. imgArr: [],
  175. remark: '',
  176. show: false,
  177. progress: 0, //上传图片进度百分比
  178. loading: false
  179. }
  180. },
  181. onLoad() {
  182. // this.getArea();
  183. this.select();
  184. this.getTubeType();
  185. this.getTubeLong();
  186. this.getProjectType();
  187. },
  188. methods: {
  189. openHouse(selectType) {
  190. if (selectType === 'district') {
  191. this.inputShow = false
  192. //选择行政区
  193. this.housename = null;
  194. this.selectType = 'district'
  195. service.getDistrict().then(res => {
  196. // console.log(res);
  197. this.chooseHouseList = [];
  198. res.forEach((item, index) => {
  199. this.chooseHouseList.push({
  200. value: item.dictValue,
  201. label: item.dictLabel,
  202. selectType: 'district'
  203. })
  204. })
  205. })
  206. } else if (selectType === 'xiaoqu') {
  207. this.inputShow = true
  208. //选择小区
  209. this.selectType = 'xiaoqu'
  210. this.housename = null;
  211. // this.district = '';
  212. service.getArea({
  213. district: this.districtId
  214. }).then(res => {
  215. this.chooseHouseList = [];
  216. res.forEach((item, index) => {
  217. this.chooseHouseList.push({
  218. value: item.id,
  219. label: item.name,
  220. selectType: 'xiaoqu'
  221. })
  222. })
  223. })
  224. } else if (selectType === 'louyu') {
  225. this.inputShow = true
  226. //选择楼宇
  227. this.selectType = 'louyu'
  228. this.housename = null;
  229. service.getBuilding({
  230. areaId: this.houseid
  231. }).then(res => {
  232. this.chooseHouseList = [];
  233. res.forEach(item => {
  234. this.chooseHouseList.push({
  235. value: item.id,
  236. label: item.name,
  237. selectType: 'louyu'
  238. })
  239. })
  240. })
  241. } else if (selectType === 'danyuan') {
  242. this.inputShow = true
  243. //选择单元
  244. this.selectType = 'danyuan';
  245. this.housename = null;
  246. service.getUnit({
  247. buildingId: this.buildid
  248. }).then(res => {
  249. this.chooseHouseList = [];
  250. res.forEach(item => {
  251. this.chooseHouseList.push({
  252. value: item.id,
  253. label: item.name,
  254. selectType: 'danyuan'
  255. })
  256. })
  257. })
  258. } else if (selectType === 'menpai') {
  259. this.inputShow = true
  260. //选择门牌
  261. this.selectType = 'menpai';
  262. this.housename = null;
  263. service.getHouse({
  264. unitId: this.unitid
  265. }).then(res => {
  266. this.chooseHouseList = [];
  267. res.forEach(item => {
  268. this.chooseHouseList.push({
  269. value: item.id,
  270. label: item.name,
  271. selectType: 'menpai'
  272. })
  273. })
  274. })
  275. }
  276. this.pop = !this.pop;
  277. },
  278. searchinfo(selectType) {
  279. if (selectType == 'xiaoqu') {
  280. console.log('ssss', this.selectType)
  281. service.getArea({
  282. name: this.keyword
  283. }).then(res => {
  284. this.chooseHouseList = [];
  285. res.forEach((item, index) => {
  286. this.chooseHouseList.push({
  287. value: item.id,
  288. label: item.name,
  289. selectType: 'xiaoqu'
  290. })
  291. })
  292. })
  293. this.keyword = '';
  294. } else if (selectType == 'louyu') {
  295. console.log('ssss', this.selectType)
  296. service.getBuilding({
  297. areaId: this.houseid,
  298. name: this.keyword
  299. }).then(res => {
  300. this.chooseHouseList = [];
  301. res.forEach((item, index) => {
  302. this.chooseHouseList.push({
  303. value: item.id,
  304. label: item.name,
  305. selectType: 'louyu'
  306. })
  307. })
  308. })
  309. this.keyword = '';
  310. } else if (selectType == 'danyuan') {
  311. console.log('ssss', this.selectType)
  312. service.getUnit({
  313. buildingId: this.buildid,
  314. name: this.keyword
  315. }).then(res => {
  316. this.chooseHouseList = [];
  317. res.forEach((item, index) => {
  318. this.chooseHouseList.push({
  319. value: item.id,
  320. label: item.name,
  321. selectType: 'danyuan'
  322. })
  323. })
  324. })
  325. this.keyword = '';
  326. } else if (selectType == 'menpai') {
  327. console.log('ssss', this.selectType)
  328. service.getHouse({
  329. unitId: this.unitid,
  330. name: this.keyword
  331. }).then(res => {
  332. this.chooseHouseList = [];
  333. res.forEach((item, index) => {
  334. this.chooseHouseList.push({
  335. value: item.id,
  336. label: item.name,
  337. selectType: 'menpai'
  338. })
  339. })
  340. })
  341. this.keyword = '';
  342. }
  343. },
  344. showPhoto(index) {
  345. uni.previewImage({
  346. current: index,
  347. urls: this.imgArr,
  348. })
  349. console.log('sss')
  350. },
  351. openBuild() {
  352. this.bulidShow = !this.bulidShow
  353. },
  354. projectType() {
  355. this.listTypeShow = !this.listTypeShow
  356. },
  357. // //获取小区
  358. // getArea() {
  359. // },
  360. getProjectType() {
  361. service.getProject().then(res => {
  362. console.log('getProjectType', res)
  363. this.typeList = [];
  364. res.forEach(item => {
  365. this.typeList.push({
  366. value: item.id,
  367. label: item.valveType
  368. })
  369. })
  370. })
  371. },
  372. search(selectType) {
  373. if (selectType == 'district') {
  374. this.districtName = this.housename;
  375. service.getArea({
  376. district: this.districtId
  377. }).then(res => {
  378. this.chooseHouseList = [];
  379. res.forEach(item => {
  380. this.chooseHouseList.push({
  381. value: item.dictValue,
  382. label: item.dictLabel,
  383. selectType: 'xiaoqu'
  384. })
  385. })
  386. })
  387. this.current = -1;
  388. this.house = null;
  389. this.bulid = null;
  390. this.unit = null;
  391. this.houseNumber = null;
  392. this.houseid = 0;
  393. this.buildid = 0;
  394. this.unitid = 0;
  395. this.housedata = 0;
  396. } else if (selectType == 'xiaoqu') {
  397. this.house = this.housename;
  398. service.getBuilding({
  399. areaId: this.houseid
  400. }).then(res => {
  401. this.chooseHouseList = [];
  402. res.forEach(item => {
  403. this.chooseHouseList.push({
  404. value: item.id,
  405. label: item.name,
  406. selectType: 'louyu'
  407. })
  408. })
  409. })
  410. this.current = -1;
  411. this.bulid = null;
  412. this.unit = null;
  413. this.houseNumber = null;
  414. this.buildid = 0;
  415. this.unitid = 0;
  416. this.housedata = 0;
  417. } else if (selectType == 'louyu') {
  418. this.bulid = this.housename;
  419. service.getUnit({
  420. buildingId: this.buildid
  421. }).then(res => {
  422. this.chooseHouseList = [];
  423. res.forEach(item => {
  424. this.chooseHouseList.push({
  425. value: item.id,
  426. label: item.name,
  427. selectType: 'danyuan'
  428. })
  429. })
  430. })
  431. this.unit = null;
  432. this.houseNumber = null;
  433. this.current = -1;
  434. this.unitid = 0;
  435. this.housedata = 0;
  436. } else if (selectType == 'danyuan') {
  437. this.unit = this.housename;
  438. service.getHouse({
  439. unitId: this.unitid
  440. }).then(res => {
  441. this.chooseHouseList = [];
  442. res.forEach(item => {
  443. this.chooseHouseList.push({
  444. value: item.id,
  445. label: item.name,
  446. selectType: 'menpai'
  447. })
  448. })
  449. })
  450. this.houseNumber = null;
  451. this.current = -1;
  452. this.housedata = 0;
  453. } else if (selectType == 'menpai') {
  454. this.houseNumber = this.housename;
  455. this.housedata = this.numberid;
  456. this.current = -1;
  457. }
  458. this.pop = false;
  459. },
  460. active(item, index) {
  461. this.current = index;
  462. if (item.selectType == 'district') { //行政区
  463. this.housename = item.label;
  464. this.districtId = item.value;
  465. } else if (item.selectType == 'xiaoqu') { //小区
  466. this.housename = item.label;
  467. this.houseid = item.value;
  468. } else if (item.selectType == 'louyu') { //楼宇
  469. this.housename = item.label;
  470. this.buildid = item.value;
  471. } else if (item.selectType == 'danyuan') { //单元
  472. this.housename = item.label;
  473. this.unitid = item.value;
  474. } else if (item.selectType == 'menpai') { //门牌
  475. this.housename = item.label;
  476. this.numberid = item.value
  477. }
  478. this.selectType = item.selectType;
  479. // console.log("xxxxx_type:" + this.selectType + "_" + this.housename)
  480. },
  481. openUnit() {
  482. this.unitShow = !this.unitShow
  483. },
  484. //选择门牌
  485. open() {
  486. this.houseNumberShow = !this.houseNumberShow
  487. },
  488. //选择上门类型
  489. confirm(e) {
  490. this.type = e[0].label
  491. this.typeValue = e[0].value
  492. this.imgArr = [];
  493. this.tubeType = null;
  494. this.tubeLong = null;
  495. this.valueType = null;
  496. this.photo = true;
  497. },
  498. //选择类型
  499. select() {
  500. service.getDic({
  501. dicType: 'service_type'
  502. }).then(res => {
  503. res.forEach(item => {
  504. this.mounicipalList.push({
  505. value: item.value,
  506. label: item.name
  507. })
  508. })
  509. })
  510. },
  511. openType(type) {
  512. if (type === 'shows') {
  513. this.shows = !this.shows
  514. } else if (type === 'tubeType') {
  515. this.tubeTypeShow = !this.tubeTypeShow
  516. } else {
  517. this.tubeLongShow = !this.tubeLongShow
  518. }
  519. },
  520. tubeTypeConfirm(e) {
  521. this.tubeType = e[0].label
  522. },
  523. listType(e) {
  524. this.valueType = e[0].label
  525. },
  526. tubeLongConfirm(e) {
  527. this.tubeLong = e[0].label
  528. },
  529. getTubeType() {
  530. service.getPipeType().then(res => {
  531. res.forEach(item => {
  532. this.tubeTypeList.push({
  533. value: item.id,
  534. label: item.pipeType
  535. })
  536. })
  537. })
  538. },
  539. getTubeLong() {
  540. service.getPipeLength().then(res => {
  541. res.forEach(item => {
  542. this.tubeTypeLongList.push({
  543. value: item.id,
  544. label: item.pipeLength
  545. })
  546. })
  547. })
  548. },
  549. remove(index) {
  550. uni.showModal({
  551. title: '提示',
  552. content: '是否删除该图片或视频?',
  553. success: (res) => {
  554. if (res.confirm) {
  555. this.imgArr.splice(index, 1)
  556. console.log('this.imgarr', this.imgArr)
  557. if (this.imgArr.length <= 0) {
  558. this.photo = true;
  559. }
  560. }
  561. }
  562. })
  563. },
  564. choose() {
  565. let _this = this;
  566. uni.showActionSheet({
  567. title: '上传',
  568. itemList: ['图片', '视频'],
  569. success: (res) => {
  570. console.log(res)
  571. if (res.tapIndex == 0) {
  572. this.chooseimage()
  573. } else {
  574. this.choosevideo()
  575. }
  576. }
  577. })
  578. },
  579. chooseimage() {
  580. console.log('图片')
  581. let _this = this;
  582. uni.chooseImage({
  583. sizeType: ['album', 'camera'],
  584. success(resp) {
  585. console.log('res--uni.chooseMedia', resp);
  586. resp.tempFiles.forEach((item, index) => {
  587. const task = uni.uploadFile({
  588. url: _this.$HTTP.webUrl + `/obs`,
  589. filePath: item.path,
  590. name: 'file',
  591. formData: {},
  592. header: _this.headers,
  593. success: res => {
  594. // 判断是否json字符串,将其转为json格式
  595. let data = _this.$u.test.jsonString(res
  596. .data) ? JSON.parse(res.data) : res.data;
  597. if (![200, 201, 204].includes(res.statusCode)) {
  598. // this.uploadError(index, data);
  599. _this.$UTILS.showPrompt('上传失败!')
  600. } else {
  601. if (_this.progress === 100) {
  602. console.log('_this.progress', _this.progress)
  603. console.log('data----', data)
  604. console.log('res--', res)
  605. _this.imgArr.push(data.data.url)
  606. console.log('imgArr', _this.imgArr)
  607. _this.$UTILS.showPrompt('上传成功!')
  608. _this.photo = false;
  609. }
  610. }
  611. },
  612. fail: e => {
  613. _this.$UTILS.showPrompt('上传失败!')
  614. this.uploadError(index, e);
  615. },
  616. complete: res => {
  617. uni.hideLoading();
  618. _this.uploading = false;
  619. }
  620. });
  621. task.onProgressUpdate(res => {
  622. _this.progress = res.progress;
  623. console.log('onProgressUpdate', res)
  624. console.log('task.onProgressUpdate', _this.progress)
  625. uni.showLoading({
  626. title: '上传中'
  627. })
  628. if (_this.progress != 100) {
  629. _this.loading = false
  630. console.log('_this.loading false', _this.loading)
  631. } else {
  632. _this.loading = true
  633. console.log('_this.loading true', _this.loading)
  634. }
  635. });
  636. })
  637. },
  638. })
  639. },
  640. choosevideo() {
  641. let _this = this;
  642. console.log('视频')
  643. uni.chooseVideo({
  644. sourceType: ['album', 'camera'],
  645. maxDuration: 30,
  646. success(resp) {
  647. const task = uni.uploadFile({
  648. url: _this.$HTTP.webUrl + `/obs`,
  649. filePath: resp.tempFilePath,
  650. name: 'file',
  651. formData: {},
  652. header: _this.headers,
  653. success: res => {
  654. // 判断是否json字符串,将其转为json格式
  655. let data = _this.$u.test.jsonString(res
  656. .data) ? JSON.parse(res.data) : res.data;
  657. if (![200, 201, 204].includes(res.statusCode)) {
  658. this.uploadError(index, data);
  659. } else {
  660. //上传成功
  661. if (_this.progress === 100) {
  662. console.log('_this.progress', _this.progress)
  663. _this.imgArr.push(data.data.url)
  664. console.log('imgArr', _this.imgArr)
  665. _this.$UTILS.showPrompt('上传成功!')
  666. _this.photo = false;
  667. }
  668. }
  669. },
  670. fail: e => {
  671. _this.$UTILS.showPrompt('上传失败!')
  672. this.uploadError(index, e);
  673. },
  674. complete: res => {
  675. uni.hideLoading();
  676. _this.uploading = false;
  677. }
  678. });
  679. task.onProgressUpdate(res => {
  680. _this.progress = res.progress;
  681. console.log('onProgressUpdate', res)
  682. uni.showLoading({
  683. title: '上传中'
  684. })
  685. if (_this.progress != 100) {
  686. _this.loading = false
  687. console.log('_this.loading false', _this.loading)
  688. } else {
  689. _this.loading = true
  690. console.log('_this.loading true', _this.loading)
  691. }
  692. });
  693. },
  694. })
  695. },
  696. submit() {
  697. if (!this.housedata) {
  698. this.$UTILS.showPrompt('请选择门牌号!')
  699. return
  700. }
  701. if (!this.type) {
  702. this.$UTILS.showPrompt('请选择上门类型!')
  703. return
  704. }
  705. if (this.typeValue == '002') {
  706. if (!this.valueType) {
  707. this.$UTILS.showPrompt('请选择自闭阀类别!')
  708. return
  709. }
  710. if (!this.tubeType) {
  711. this.$UTILS.showPrompt('请选择管子类型!')
  712. return
  713. }
  714. if (!this.tubeLong) {
  715. this.$UTILS.showPrompt('请选择管子长度!')
  716. return
  717. }
  718. }
  719. if (this.imgArr.length <= 0) {
  720. this.$UTILS.showPrompt('请上传照片或视频!')
  721. return
  722. }
  723. if (this.loading == false) {
  724. this.$UTILS.showPrompt('照片或视频未上传完毕,无法提交!')
  725. return
  726. }
  727. let param = {
  728. serviceType: this.typeValue,
  729. pipeType: this.tubeType,
  730. pipeLength: this.tubeLong,
  731. //小区
  732. areaId: this.houseid,
  733. areaName: this.house,
  734. //楼宇
  735. buildingId: this.buildid,
  736. buildingName: this.bulid,
  737. //单元
  738. unitId: this.unitid,
  739. unitName: this.unit,
  740. //房间
  741. houseId: this.housedata,
  742. houseName: this.houseNumber,
  743. valveType: this.valueType,
  744. picUrl: this.imgArr,
  745. remark: this.remark,
  746. }
  747. console.log('param-----', param)
  748. service.submitOrder(param).then(res => {
  749. this.$UTILS.showPrompt('提交成功!')
  750. this.houseNumber = null;
  751. this.type = null;
  752. this.typeValue = null;
  753. this.valueType = null;
  754. this.tubeType = null;
  755. this.tubeLong = null;
  756. this.housedata = null;
  757. this.typeValue = null;
  758. this.remark = null;
  759. this.imgArr = [];
  760. }).catch(e => {
  761. this.$UTILS.showPrompt('提交失败!')
  762. console.error(e)
  763. })
  764. },
  765. }
  766. }
  767. </script>
  768. <style lang="scss" scoped>
  769. .choose {
  770. text-align: center;
  771. padding: 20rpx;
  772. margin: 30rpx;
  773. color: #FFFFFF;
  774. background: #43CEB1;
  775. border-radius: 64rpx;
  776. }
  777. .active {
  778. background-color: #1890FF;
  779. }
  780. .select-type {
  781. border: 2rpx solid #3857F3;
  782. text-align: center;
  783. padding: 20rpx;
  784. margin: 30rpx;
  785. color: #3857F3;
  786. border-radius: 64rpx;
  787. }
  788. .upload {
  789. margin: 30rpx;
  790. padding: 30rpx 20rpx;
  791. border: 2rpx solid #3857F3;
  792. border-radius: 48rpx;
  793. }
  794. .tube {
  795. text-align: center;
  796. padding: 20rpx;
  797. margin: 30rpx;
  798. color: #43CEB1;
  799. border: 2rpx solid #43CEB1;
  800. border-radius: 64rpx;
  801. }
  802. .total {
  803. width: 100%;
  804. padding: 40rpx 30rpx;
  805. text-align: center;
  806. color: #FFFFFF;
  807. }
  808. </style>