TopPipeWork.vue 23 KB

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