TopPipeWork.vue 24 KB

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