TopPipeWork.vue 23 KB

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