TopPipeWork.vue 26 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001
  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.projectName.id)" style="margin-top: 10;"
  10. @click="pickerShow('gcmc',0)">
  11. <span style="color: darkgray;">请选择工程名称</span>
  12. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  13. </view>
  14. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('gcmc',0)">
  15. <span style="color: black;">{{projectName.name}}</span>
  16. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="uni-list">
  21. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  22. <text>工程地点</text>
  23. <input class="uni-input" type="text" v-model="gcddValue" disabled="true"
  24. style="margin-left: 10px;text-align: right;"></input>
  25. </view>
  26. </view>
  27. <view class="uni-list">
  28. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  29. <text>工程编码</text>
  30. <input class="uni-input" type="text" v-model="gcbmValue" disabled="true"
  31. style="margin-left: 10px;text-align: right;"></input>
  32. </view>
  33. </view>
  34. <view class="uni-list">
  35. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  36. <text>施工单位</text>
  37. <input class="uni-input" type="text" v-model="sgdwValue" disabled="true"
  38. style="margin-left: 10px;text-align: right;"></input>
  39. </view>
  40. </view>
  41. <view class="uni-list">
  42. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  43. <text>工程规模</text>
  44. <input class="uni-input" type="text" v-model="gcgmValue" disabled="true"
  45. style="margin-left: 10px;text-align: right;"></input>
  46. </view>
  47. </view>
  48. <view class="uni-list">
  49. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  50. <text>施工质量</text>
  51. <input class="uni-input" type="text" v-model="sgzlValue" disabled="true"
  52. style="margin-left: 10px;text-align: right;"></input>
  53. </view>
  54. </view>
  55. <view class="uni-list">
  56. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  57. <text>施工进度</text>
  58. <input class="uni-input" type="number" v-model="sgjdValue" disabled="true"
  59. style="margin-left: 10px;text-align: right;"></input>
  60. </view>
  61. </view>
  62. <view class="uni-list">
  63. <view class="align-items" style="margin-bottom: 20px;">
  64. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  65. <view v-for="(item,index) in fileArr" :key="index" style="position: relative;">
  66. <view
  67. v-if="item.picUrl.substring(item.picUrl.length - 3) == 'png' || item.picUrl.substring(item.picUrl.length - 3) == 'jpg'||item.picUrl.substring(item.picUrl.length-4)=='jpeg' ">
  68. <image :src="item.picUrl" mode=""
  69. style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  70. @click="showPhotoFile(fileImageArr.indexOf(item.picUrl))">
  71. </image>
  72. </view>
  73. <view v-else-if="item.picUrl.substring(item.picUrl.length - 3) == 'mp4'">
  74. <video :src="item.picUrl"
  75. style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  76. </view>
  77. <view v-else @click="chooseModel(item.picUrl,item.fileName)">
  78. {{item.fileName}}
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. <SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
  85. subtitleKey="id" v-model="name"></SelectPicker>
  86. <SelectPicker :list="dictOptions" @change="changeSelectDict" v-if="openDict" @close="closeDict"
  87. titleKey="dictLabel" subtitleKey="dictValue" v-model="dictLabel"></SelectPicker>
  88. </view>
  89. <view class="background">
  90. <view>
  91. <view class="uni-list">
  92. <view
  93. style="font-size: 16px;margin-left: 10px;margin-top: 10px;display: flex; justify-content: space-between;margin-bottom: 10px;">
  94. {{objValue.value}}
  95. <span
  96. style="color: blue;font-size: 14px; display: flex;justify-content:flex-end; margin-right: 10px;"
  97. @click="history">历史</span>
  98. </view>
  99. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  100. <view>
  101. 施工时间
  102. </view>
  103. <view @click="openDatetimePicker()">
  104. <span style="color: black;">{{time}}</span>
  105. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  106. </view>
  107. </view>
  108. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  109. <view class="uni-common-mt" style="width: 100%;">
  110. <text class="uni-title uni-common-pl">施工内容</text>
  111. <view style="width: 100%;box-sizing: border-box;">
  112. <textarea class="textarea" placeholder="请输入施工内容" maxlength="100"
  113. placeholder-style="padding: 10rpx;"
  114. style="width: 100%;height: 100%;border: 1rpx solid #cccccc; border-radius: 15rpx;padding: 10rpx;line-height:normal;"
  115. auto-height v-model="projectContent"></textarea>
  116. </view>
  117. </view>
  118. </view>
  119. <view v-for="(a,index) in czggslList" :key="index" class="num-style">
  120. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  121. <view>
  122. 材质
  123. </view>
  124. <view class="uni-list-cell-db" @click="pickerShow('cz',index)">
  125. <span style="color: black;">{{a.cz.id==''?'请选择材质':a.cz.name}}</span>
  126. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  127. </view>
  128. </view>
  129. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  130. <view>
  131. 规格
  132. </view>
  133. <view class="uni-list-cell-db" @click="pickerShow('gg',index)">
  134. <span style="color: black;">{{a.gg.id==''?'请选择规格':a.gg.name}}</span>
  135. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  136. </view>
  137. </view>
  138. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  139. <text>米 数</text>
  140. <!-- style="margin-left: 10px;text-align: right;" -->
  141. <view style="display: flex; justify-content: right; width: 70%;">
  142. <input class="uni-input" type="number" v-model="a.sl.inputIntegerNumberValue"
  143. maxlength="6"
  144. style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
  145. <text style="font-weight:bold;margin-left: 10px;margin-right: 10px;">.</text>
  146. <input class="uni-input" type="number" v-model="a.sl.inputDecimalNumberValue"
  147. maxlength="1"
  148. style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
  149. </view>
  150. </view>
  151. <button v-if="index!=0" @click="this.czggslList.splice(index,1)" class="sc-btn">删除</button>
  152. </view>
  153. <button @click="this.czggslList.push({cz:{id: '',name: ''},gg:{id: '',name: ''},sl: {
  154. inputIntegerNumberValue: '',
  155. inputDecimalNumberValue: ''
  156. }})" class="tj-btn">添加</button>
  157. </view>
  158. </view>
  159. <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
  160. <view class="container" style="color: #b2b2b2;">*请上传照片</view>
  161. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  162. <image :src="loadImgSrc('updateimg.png')" mode=""
  163. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose()">
  164. </image>
  165. <view v-for="(item,index) in imgArr" :key="index" style="position: relative;">
  166. <view
  167. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
  168. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  169. @click="showPhoto(index)">
  170. </image>
  171. </view>
  172. <view v-else>
  173. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  174. </view>
  175. <view @click="remove(index)"
  176. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  177. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  178. </image>
  179. </view>
  180. </view>
  181. </view>
  182. </view>
  183. </view>
  184. <view class="action-btn">
  185. <button @click="submit" class="btn cu-btn block bg-blue lg round">确认上传</button>
  186. </view>
  187. <bottom-sheet ref="refShare" :data="historyList" :TitleType="objValue.value"></bottom-sheet>
  188. <yt-dateTimePicker ref="myPicker" @submit="handleSubmit" :start-year="2024" :end-year="2099"
  189. :time-hide="[true, true, true, true, true, true]" :time-label="['年', '月', '日', '时', '分', '秒']" />
  190. <!-- 下载提示页面 -->
  191. <mypopup :show="show_loding" :popupText="popupText" :titleText="titleText" :cancelText="cancelText"
  192. :confirmText="confirmText" @close="cancel_loding" @confirm="confirm_loding">
  193. </mypopup>
  194. </scroll-view>
  195. </template>
  196. <script>
  197. import SelectPicker from '../../components/selectPicker/select_picker.vue'
  198. import bottomSheet from '../../components/bottomSheet/bottomSheetMore.vue'
  199. import mypopup from '../../components/mypopup/mypopup.vue'
  200. import {
  201. getDicts
  202. } from "@/api/system/dict/data";
  203. import {
  204. getToken
  205. } from '../../utils/auth';
  206. import {
  207. getEnginMaterialQualityList,
  208. getEnginSpecificationsList,
  209. getTopPipeWorkDetails,
  210. getTopPipeNameList,
  211. SubmitTopPipeWork,
  212. getTopPipeHistoryList
  213. } from '@/api/common'
  214. export default {
  215. components: {
  216. SelectPicker,
  217. bottomSheet,
  218. mypopup
  219. },
  220. data() {
  221. return {
  222. historyList: {}, //历史数据
  223. show_loding: false,
  224. popupText: '', //对话框内容
  225. titleText: '',
  226. cancelText: '',
  227. confirmText: '',
  228. objValue: '', //上一页面传过来的值 新增接口用
  229. headers: {
  230. Authorization: "Bearer " + getToken()
  231. },
  232. loading: false,
  233. time: '', //施工时间
  234. open: false,
  235. objValue: '', //上一页面传过来的值 新增接口用
  236. openDict: false,
  237. selectList: [],
  238. fileImageArr: [],
  239. dictOptions: [],
  240. imgArr: [],
  241. fileArr: [],
  242. projectName: '', //工程名称
  243. specificationValue: {}, //规格
  244. materialValue: {}, //材质
  245. inputNumberValue: '',
  246. inputIntegerNumberValue: '',
  247. inputDecimalNumberValue: '',
  248. gcddValue: '', //工程地点
  249. gcbmValue: '', //工程编码
  250. sgdwValue: '', //施工单位
  251. gcgmValue: '', //工程规模
  252. sgzlValue: '', //施工质量
  253. sgjdValue: '', //施工进度
  254. materialList: '', //材质list
  255. enginId: '', //其他工程id
  256. id: '', //工程id
  257. fileUrl: '', //点击的文件地址
  258. fileName: '', //点击的文件名称
  259. projectContent: '', //描述
  260. zEngineeringMaterialBo: [], //给后台传的值 用料列表
  261. SelectIndex: '', //选择的索引值
  262. czggslList: [{
  263. cz: {
  264. id: '',
  265. name: ''
  266. },
  267. gg: {
  268. id: '',
  269. name: ''
  270. },
  271. sl: {
  272. inputIntegerNumberValue: '',
  273. inputDecimalNumberValue: ''
  274. }
  275. }, ],
  276. }
  277. },
  278. created() {
  279. this.time = this.traversalTime(new Date().getTime()) //在data里定义变量-nowTime
  280. },
  281. onLoad(options) {
  282. if ('params' in options) {
  283. this.objValue = JSON.parse(decodeURIComponent(options.params));
  284. }
  285. },
  286. methods: {
  287. //判断是否选择
  288. isEmpty(str) {
  289. return (!str || 0 === str.length);
  290. },
  291. handleSubmit(e) {
  292. this.time = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
  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
  305. .addTimes(
  306. mm) + ':' + this.addTimes(s);
  307. },
  308. addTimes(m) {
  309. return m < 10 ? '0' + m : m
  310. },
  311. // 打开picker
  312. openDatetimePicker() {
  313. this.$refs.myPicker.show();
  314. },
  315. // 关闭picker
  316. closeDatetimePicker() {
  317. this.$refs.myPicker.hide();
  318. },
  319. showPhotoFile(index) {
  320. uni.previewImage({
  321. current: index,
  322. urls: this.fileImageArr,
  323. })
  324. },
  325. showPhoto(index) {
  326. let newArr = [];
  327. this.imgArr.forEach((item, index) => {
  328. if (item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' ||
  329. item.substring(item.length - 4) == 'jpeg') {
  330. newArr.push(item)
  331. }
  332. });
  333. uni.previewImage({
  334. current: index,
  335. urls: newArr,
  336. })
  337. },
  338. remove(index) {
  339. uni.showModal({
  340. title: '提示',
  341. content: '是否删除该图片或视频?',
  342. success: (res) => {
  343. if (res.confirm) {
  344. this.imgArr.splice(index, 1)
  345. if (this.imgArr.length <= 0) {
  346. this.photo = true;
  347. }
  348. }
  349. }
  350. })
  351. },
  352. choose() {
  353. let _this = this;
  354. uni.showActionSheet({
  355. title: '上传',
  356. itemList: ['图片', '视频'],
  357. success: (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. uni.chooseImage({
  369. sizeType: ['album', 'camera'],
  370. success(resp) {
  371. resp.tempFiles.forEach((item, index) => {
  372. const task = uni.uploadFile({
  373. url: _this.$HTTP + `/obs`,
  374. filePath: item.path,
  375. name: 'file',
  376. formData: {},
  377. header: _this.headers,
  378. success: res => {
  379. // 判断是否json字符串,将其转为json格式
  380. let data = JSON.parse(res.data);
  381. if (![200].includes(data.code)) {
  382. _this.$modal.msg(data.msg)
  383. } else {
  384. if (_this.progress === 100) {
  385. _this.imgArr.push(data.data.url)
  386. _this.$modal.msg('上传成功!')
  387. _this.photo = false;
  388. }
  389. }
  390. },
  391. fail: e => {
  392. _this.$modal.msg('上传失败!')
  393. },
  394. complete: res => {
  395. uni.hideLoading();
  396. _this.uploading = false;
  397. }
  398. });
  399. task.onProgressUpdate(res => {
  400. _this.progress = res.progress;
  401. uni.showLoading({
  402. title: '上传中'
  403. })
  404. if (_this.progress != 100) {
  405. _this.loading = false
  406. } else {
  407. _this.loading = true
  408. }
  409. });
  410. })
  411. },
  412. })
  413. },
  414. choosevideo() {
  415. let _this = this;
  416. uni.chooseVideo({
  417. sourceType: ['album', 'camera'],
  418. maxDuration: 30,
  419. success(resp) {
  420. const task = uni.uploadFile({
  421. url: _this.$HTTP + `/obs`,
  422. filePath: resp.tempFilePath,
  423. name: 'file',
  424. formData: {},
  425. header: _this.headers,
  426. success: res => {
  427. // 判断是否json字符串,将其转为json格式
  428. let data = JSON.parse(res.data);
  429. if (![200].includes(res.statusCode)) {
  430. this.uploadError(index, data);
  431. } else {
  432. //上传成功
  433. if (_this.progress === 100) {
  434. _this.imgArr.push(data.data.url)
  435. _this.$modal.msg('上传成功!')
  436. _this.photo = false;
  437. }
  438. }
  439. },
  440. fail: e => {
  441. _this.$modal.msg('上传失败!')
  442. this.uploadError(index, e);
  443. },
  444. complete: res => {
  445. uni.hideLoading();
  446. _this.uploading = false;
  447. }
  448. });
  449. task.onProgressUpdate(res => {
  450. _this.progress = res.progress;
  451. uni.showLoading({
  452. title: '上传中'
  453. })
  454. if (_this.progress != 100) {
  455. _this.loading = false
  456. } else {
  457. _this.loading = true
  458. }
  459. });
  460. },
  461. })
  462. },
  463. chooseModel(url, name) {
  464. this.cancelText = '复制';
  465. this.confirmText = "下载";
  466. this.titleText = "温馨提示"
  467. this.popupText = "下载或者复制链接";
  468. this.show_loding = true;
  469. this.fileName = name;
  470. this.fileUrl = url; //文件名称和下载地址赋值
  471. },
  472. //取消按钮
  473. cancel_loding() {
  474. let _this = this;
  475. _this.show_loding = false;
  476. if (!_this.isEmpty(_this.fileUrl)) {
  477. uni.setClipboardData({
  478. data: _this.fileUrl,
  479. success() {
  480. uni.showToast({
  481. title: '已复制' + _this.fileName + '地址成功 请在浏览器打开',
  482. icon: 'none'
  483. });
  484. },
  485. fail(e) {
  486. uni.showToast({
  487. title: '复制失败',
  488. icon: 'none'
  489. });
  490. }
  491. });
  492. }
  493. },
  494. //确定按钮
  495. confirm_loding() {
  496. this.show_loding = false;
  497. this.download(this.fileUrl, this.fileName);
  498. },
  499. getDownLoadFilePath() {
  500. let cachePath = `${uni.env.USER_DATA_PATH}/downloads`
  501. let fm = uni.getFileSystemManager()
  502. try {
  503. // 访问成功则存在
  504. fm.accessSync(cachePath)
  505. } catch (error) {
  506. // 不存在则新建
  507. fm.mkdirSync(cachePath, true)
  508. }
  509. return cachePath
  510. },
  511. download(url, name) {
  512. let savePath = this.getDownLoadFilePath();
  513. //var savePath = uni.env.USER_DATA_PATH + '/savePath'
  514. uni.downloadFile({
  515. url: url,
  516. success: response => {
  517. if (response.statusCode === 200) {
  518. uni.getFileSystemManager().saveFile({
  519. tempFilePath: response.tempFilePath,
  520. filePath: `${savePath}/${name}`,
  521. success: (resData) => {
  522. uni.showToast({
  523. title: '下载成功'
  524. })
  525. },
  526. fail: error => {}
  527. })
  528. }
  529. },
  530. fail: error => {}
  531. })
  532. },
  533. pickerShow(e, index) {
  534. this.SelectIndex = index;
  535. this.type = e; //赋值类型
  536. if (e == 'gcmc') {
  537. this.open = true;
  538. getTopPipeNameList().then(response => {
  539. this.selectList = response.data;
  540. });
  541. } else if (e == 'cz') { //材质
  542. this.open = true;
  543. getEnginMaterialQualityList("顶管工程").then(response => {
  544. this.selectList = response.data;
  545. });
  546. } else if (e == 'gg') { //规格
  547. if (this.isEmpty(this.czggslList[index].cz.id)) {
  548. this.$modal.msg('请选择材质')
  549. // this.czggslList[index].cz = this.materialValue.id
  550. } else {
  551. this.open = true;
  552. this.selectList = this.materialList;
  553. }
  554. }
  555. },
  556. changeSelect(item, index) {
  557. // this.index = index;
  558. // this.address = item.communityName;
  559. this.open = false;
  560. if (this.type == 'gcmc') {
  561. this.projectName = item;
  562. this.fileImageArr = [];
  563. uni.showLoading({
  564. title: '加载中'
  565. })
  566. getTopPipeWorkDetails(item.id).then(res => {
  567. uni.hideLoading();
  568. this.gcddValue = res.data.enginAddre; //工程地点
  569. this.gcbmValue = res.data.enginCode; //工程编码
  570. this.sgdwValue = res.data.constructUnit; //施工单位
  571. this.gcgmValue = res.data.enginScale; //工程规模
  572. this.sgzlValue = res.data.constructQuality; //施工质量
  573. this.sgjdValue = res.data.constructSchedule; //施工进度
  574. this.fileArr = res.data.pics;
  575. this.enginId = res.data.enginId;
  576. this.id = res.data.id;
  577. this.fileArr.forEach((list, index) => {
  578. if (list.picUrl.substring(list.picUrl.length - 3) == 'png' || list.picUrl
  579. .substring(list.picUrl.length - 3) == 'jpg' || list.picUrl.substring(list
  580. .picUrl.length - 4) == 'jpeg') {
  581. this.fileImageArr.push(list.picUrl)
  582. }
  583. });
  584. })
  585. }
  586. // else if (this.type == 'cz') {
  587. // this.materialValue = item;
  588. // this.specificationValue = ''; //重置规格
  589. // //根据材质ID 获取规格数据
  590. // getEnginSpecificationsList(item.id).then(res => {
  591. // this.materialList = res.data
  592. // })
  593. // } else if (this.type == 'gg') {
  594. // this.specificationValue = item;
  595. // }
  596. else if (this.type == 'cz') {
  597. this.materialValue = item;
  598. this.specificationValue = ''; //重置规格
  599. //根据材质ID 获取规格数据
  600. getEnginSpecificationsList(item.id).then(res => {
  601. this.materialList = res.data
  602. this.czggslList[this.SelectIndex].cz.id = this.materialValue.id
  603. this.czggslList[this.SelectIndex].cz.name = this.materialValue.name
  604. })
  605. } else if (this.type == 'gg') {
  606. this.specificationValue = item;
  607. this.czggslList[this.SelectIndex].gg.id = this.specificationValue.id
  608. this.czggslList[this.SelectIndex].gg.name = this.specificationValue.name
  609. }
  610. },
  611. //关闭弹窗
  612. close(e) {
  613. this.open = false
  614. },
  615. //历史
  616. history() {
  617. if (this.isEmpty(this.projectName.id)) {
  618. this.$modal.msg('请选择工程名称')
  619. return
  620. }
  621. getTopPipeHistoryList(this.id, this.objValue.value).then(response => {
  622. this.historyList = response.data
  623. if (response.data.zEngineeringNodeBo.zEngineeringInfoBoList != null) {
  624. this.$refs.refShare.handleShowShare();
  625. } else {
  626. this.$modal.msg("暂无历史信息")
  627. }
  628. });
  629. },
  630. //提交
  631. submit() {
  632. if (this.isEmpty(this.projectName.id)) {
  633. this.$modal.msg('请选择工程名称')
  634. return
  635. }
  636. try {
  637. this.czggslList.forEach((list) => {
  638. if (this.isEmpty(list.cz.id)) {
  639. this.$modal.msg('材质不能为空')
  640. throw new Error('End Loop')
  641. }
  642. if (this.isEmpty(list.gg.id)) {
  643. this.$modal.msg('规格不能为空')
  644. throw new Error('End Loop')
  645. }
  646. if (this.isEmpty(list.sl.inputIntegerNumberValue)) {
  647. this.$modal.msg("请输入米数")
  648. throw new Error('End Loop')
  649. }
  650. })
  651. } catch (e) {
  652. if (e.message === 'End Loop') throw e
  653. }
  654. this.zEngineeringMaterialBo = [];
  655. this.czggslList.forEach((list) => {
  656. this.zEngineeringMaterialBo.push({
  657. materialQuality: list.cz.id,
  658. specifications: list.gg.id,
  659. number: list.sl.inputIntegerNumberValue + (list.sl
  660. .inputDecimalNumberValue ==
  661. '' ?
  662. '' : "." + list.sl.inputDecimalNumberValue)
  663. })
  664. })
  665. if (this.imgArr.length <= 0) {
  666. this.$modal.msg('请上传照片或视频')
  667. return
  668. }
  669. if (this.loading == false) {
  670. this.$modal.msg('照片或视频未上传完毕,无法提交!')
  671. }
  672. if (this.isEmpty(this.inputDecimalNumberValue)) {
  673. this.inputNumberValue = this.inputIntegerNumberValue;
  674. } else {
  675. this.inputNumberValue = this.inputIntegerNumberValue + "." + this.inputDecimalNumberValue;
  676. }
  677. let param = {
  678. id: this.id,
  679. enginId: this.enginId,
  680. enginName: this.projectName.name,
  681. enginAddre: this.gcddValue,
  682. enginCode: this.gcbmValue,
  683. constructUnit: this.sgdwValue,
  684. enginScale: this.gcgmValue,
  685. constructQuality: this.sgzlValue,
  686. constructSchedule: this.sgjdValue,
  687. files: this.fileArr,
  688. zEngineeringNodeBo: {
  689. type: this.objValue.value,
  690. zEngineeringInfoBo: {
  691. constructTime: this.time,
  692. remark: this.projectContent,
  693. zEngiineeringPhotoBoList: this.imgArr,
  694. zEngineeringMaterialBo: this.zEngineeringMaterialBo // 用料对象
  695. }
  696. }
  697. }
  698. uni.showLoading()
  699. SubmitTopPipeWork(param).then(res => {
  700. if (res.code == '200') {
  701. uni.hideLoading()
  702. uni.showToast({
  703. title: res.msg,
  704. icon: 'none',
  705. //显示持续时间为 3秒
  706. duration: 1000
  707. });
  708. setTimeout(function() {
  709. uni.navigateBack();
  710. }, 1000)
  711. }
  712. })
  713. },
  714. }
  715. }
  716. </script>
  717. <style>
  718. .container {
  719. display: flex;
  720. align-items: center;
  721. justify-content: space-between;
  722. padding: 10px;
  723. position: relative;
  724. }
  725. .uni-list {
  726. border: 1xp solid #eee;
  727. }
  728. .to-right-icon {
  729. width: 15px;
  730. height: 15px;
  731. position: absolute;
  732. top: 50%;
  733. transform: translateY(-50%);
  734. }
  735. .text {
  736. font-size: 16px;
  737. color: #333;
  738. }
  739. .background {
  740. // border: 15px solid hsla(0, 0%, 100%, .5);
  741. background: white;
  742. background-clip: padding-box;
  743. padding: 20rpx;
  744. border-radius: 20rpx;
  745. margin: 20rpx 10rpx;
  746. /*从padding开始往外面裁剪背景*/
  747. }
  748. .btn {
  749. width: 715rpx;
  750. height: 69rpx;
  751. background: #79A4F0;
  752. border-radius: 6rpx;
  753. font-size: 25rpx;
  754. font-family: Microsoft YaHei;
  755. font-weight: 400;
  756. color: #FFFFFF;
  757. line-height: 69rpx;
  758. margin-top: 40rpx;
  759. margin-bottom: 100rpx;
  760. }
  761. .number {
  762. display: flex;
  763. /* 水平居中显示子元素 */
  764. align-items: flex-start;
  765. /* 垂直居中显示子元素 */
  766. justify-content: space-between;
  767. /* 左右间距等于间距大小 */
  768. padding: 10px;
  769. /* 设置padding以提高视觉效果 */
  770. }
  771. .tj-btn {
  772. height: 69rpx;
  773. background: #3184f0;
  774. border-radius: 6rpx;
  775. font-size: 25rpx;
  776. font-weight: 400;
  777. color: #FFFFFF;
  778. line-height: 69rpx;
  779. margin: 40rpx 70rpx;
  780. }
  781. .sc-btn {
  782. height: 69rpx;
  783. background: #f0686b;
  784. border-radius: 6rpx;
  785. font-size: 25rpx;
  786. font-weight: 400;
  787. color: #FFFFFF;
  788. line-height: 69rpx;
  789. margin: 40rpx;
  790. }
  791. .num-style {
  792. background: #e8f4f9;
  793. margin: 20rpx;
  794. padding: 10rpx;
  795. border-radius: 20rpx;
  796. border: 1px solid #d4e3f0;
  797. }
  798. .textarea {
  799. margin-top: 10upx;
  800. width: 100%;
  801. border: 1rpx solid red;
  802. min-height: 100upx;
  803. line-height: 20px;
  804. }
  805. page {
  806. background: #f2f2f2;
  807. }
  808. .flex-x {
  809. display: flex;
  810. align-items: center;
  811. }
  812. .template_title,
  813. .template_title1,
  814. .template_title_list {
  815. height: 90rpx;
  816. background: #fff;
  817. justify-content: space-between;
  818. padding: 0 30rpx;
  819. box-sizing: border-box;
  820. }
  821. .template_title1 {
  822. background: none;
  823. }
  824. .template_title_list {
  825. margin-bottom: 4rpx;
  826. }
  827. .template_title>view,
  828. .template_title1>view {
  829. font-size: 32rpx;
  830. color: #8f8f8f;
  831. flex-shrink: 0;
  832. margin-right: 20rpx;
  833. }
  834. .template_title>input {
  835. font-size: 28rpx;
  836. color: #808080;
  837. text-align: right;
  838. flex-grow: 1;
  839. }
  840. /* 添加内容 */
  841. .add_con>text {
  842. font-size: 40rpx;
  843. color: #f16765;
  844. display: block;
  845. margin-right: 20rpx;
  846. margin-left: 10rpx;
  847. line-height: 44rpx;
  848. }
  849. .add_con>view {
  850. font-size: 32rpx;
  851. color: #7885cb;
  852. }
  853. /* 删除内容 */
  854. .del {
  855. font-size: 32rpx;
  856. color: #f16765;
  857. margin-right: 14rpx;
  858. padding: 20rpx;
  859. }
  860. input {
  861. flex-grow: 1;
  862. font-size: 28rpx;
  863. color: #808080;
  864. }
  865. </style>