TopPipeWork.vue 24 KB

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