TopPipeWork.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898
  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. console.log("ddd", error)
  536. }
  537. })
  538. },
  539. pickerShow(e) {
  540. this.type = e; //赋值类型
  541. if (e == 'gcmc') {
  542. this.open = true;
  543. getTopPipeNameList().then(response => {
  544. this.selectList = response.data;
  545. });
  546. } else if (e == 'cz') { //材质
  547. this.open = true;
  548. getEnginMaterialQualityList("顶管工程").then(response => {
  549. this.selectList = response.data;
  550. });
  551. } else if (e == 'gg') { //规格
  552. if (this.isEmpty(this.materialValue.id)) {
  553. this.$modal.msg('请选择材质')
  554. } else {
  555. this.open = true;
  556. this.selectList = this.materialList;
  557. }
  558. }
  559. },
  560. changeSelect(item, index) {
  561. // this.index = index;
  562. // this.address = item.communityName;
  563. this.open = false;
  564. if (this.type == 'gcmc') {
  565. this.projectName = item;
  566. uni.showLoading({
  567. title: '加载中'
  568. })
  569. getTopPipeWorkDetails(item.id).then(res => {
  570. uni.hideLoading();
  571. this.gcddValue = res.data.enginAddre; //工程地点
  572. this.gcbmValue = res.data.enginCode; //工程编码
  573. this.sgdwValue = res.data.constructUnit; //施工单位
  574. this.gcgmValue = res.data.enginScale; //工程规模
  575. this.sgzlValue = res.data.constructQuality; //施工质量
  576. this.sgjdValue = res.data.constructSchedule; //施工进度
  577. this.fileArr = res.data.pics;
  578. this.enginId = res.data.enginId;
  579. this.id = res.data.id;
  580. })
  581. } else if (this.type == 'cz') {
  582. this.materialValue = item;
  583. this.specificationValue = ''; //重置规格
  584. //根据材质ID 获取规格数据
  585. getEnginSpecificationsList(item.id).then(res => {
  586. this.materialList = res.data
  587. })
  588. } else if (this.type == 'gg') {
  589. this.specificationValue = item;
  590. }
  591. },
  592. //关闭弹窗
  593. close(e) {
  594. this.open = false
  595. },
  596. //历史
  597. history() {
  598. if (this.isEmpty(this.projectName.id)) {
  599. this.$modal.msg('请选择工程名称')
  600. return
  601. }
  602. getTopPipeHistoryList(this.id, this.objValue.value).then(response => {
  603. this.historyList = response.data
  604. if (response.data.zEngineeringNodeBo.zEngineeringInfoBoList != null) {
  605. this.$refs.refShare.handleShowShare();
  606. } else {
  607. this.$modal.msg("暂无历史信息")
  608. }
  609. });
  610. },
  611. //提交
  612. submit() {
  613. if (this.isEmpty(this.projectName.id)) {
  614. this.$modal.msg('请选择工程名称')
  615. return
  616. }
  617. if (this.isEmpty(this.materialValue.id)) {
  618. this.$modal.msg("请选择材质")
  619. return
  620. }
  621. if (this.isEmpty(this.specificationValue.id)) {
  622. this.$modal.msg("请选择规格")
  623. return
  624. }
  625. if (this.isEmpty(this.inputNumberValue)) {
  626. this.$modal.msg("请输入数量")
  627. return
  628. }
  629. if (this.imgArr.length <= 0) {
  630. this.$modal.msg('请上传照片或视频')
  631. return
  632. }
  633. if (this.loading == false) {
  634. this.$modal.msg('照片或视频未上传完毕,无法提交!')
  635. }
  636. let param = {
  637. id: this.id,
  638. enginId: this.enginId,
  639. enginName: this.projectName.name,
  640. enginAddre: this.gcddValue,
  641. enginCode: this.gcbmValue,
  642. constructUnit: this.sgdwValue,
  643. enginScale: this.gcgmValue,
  644. constructQuality: this.sgzlValue,
  645. constructSchedule: this.sgjdValue,
  646. files: this.fileArr,
  647. zEngineeringNodeBo: {
  648. type: this.objValue.value,
  649. zEngineeringInfoBo: {
  650. constructTime: this.time,
  651. remark: this.projectContent,
  652. zEngiineeringPhotoBoList: this.imgArr,
  653. zEngineeringMaterialBo: [{
  654. materialQuality: this.materialValue.id, //材质
  655. specifications: this.specificationValue.id, //规格
  656. number: this.inputNumberValue //数量
  657. }]
  658. }
  659. }
  660. }
  661. SubmitTopPipeWork(param).then(res => {
  662. if (res.code == '200') {
  663. uni.showToast({
  664. title: res.msg,
  665. icon: 'none',
  666. //显示持续时间为 3秒
  667. duration: 1000
  668. });
  669. setTimeout(function() {
  670. uni.navigateBack();
  671. }, 1000)
  672. }
  673. })
  674. },
  675. }
  676. }
  677. </script>
  678. <style>
  679. .container {
  680. display: flex;
  681. margin-left: 10px;
  682. margin-top: 10px;
  683. margin-right: 10px;
  684. align-items: flex-start;
  685. justify-content: space-between;
  686. }
  687. .text {
  688. font-size: 16px;
  689. color: #333;
  690. }
  691. .background {
  692. border: 15px solid hsla(0, 0%, 100%, .5);
  693. background: white;
  694. background-clip: padding-box;
  695. padding-left: 5px;
  696. padding-right: 10px;
  697. /*从padding开始往外面裁剪背景*/
  698. }
  699. .btn {
  700. margin-top: 40px;
  701. margin-right: 20px;
  702. margin-bottom: 120px;
  703. margin-left: 20px;
  704. height: 45px;
  705. }
  706. .number {
  707. display: flex;
  708. /* 水平居中显示子元素 */
  709. align-items: flex-start;
  710. /* 垂直居中显示子元素 */
  711. justify-content: space-between;
  712. /* 左右间距等于间距大小 */
  713. padding: 10px;
  714. /* 设置padding以提高视觉效果 */
  715. }
  716. .textarea {
  717. margin-top: 10upx;
  718. width: 100%;
  719. border: 1rpx solid red;
  720. min-height: 100upx;
  721. line-height: 20px;
  722. }
  723. page {
  724. background: #f2f2f2;
  725. }
  726. .flex-x {
  727. display: flex;
  728. align-items: center;
  729. }
  730. .template_title,
  731. .template_title1,
  732. .template_title_list {
  733. height: 90rpx;
  734. background: #fff;
  735. justify-content: space-between;
  736. padding: 0 30rpx;
  737. box-sizing: border-box;
  738. }
  739. .template_title1 {
  740. background: none;
  741. }
  742. .template_title_list {
  743. margin-bottom: 4rpx;
  744. }
  745. .template_title>view,
  746. .template_title1>view {
  747. font-size: 32rpx;
  748. color: #8f8f8f;
  749. flex-shrink: 0;
  750. margin-right: 20rpx;
  751. }
  752. .template_title>input {
  753. font-size: 28rpx;
  754. color: #808080;
  755. text-align: right;
  756. flex-grow: 1;
  757. }
  758. /* 添加内容 */
  759. .add_con>text {
  760. font-size: 40rpx;
  761. color: #f16765;
  762. display: block;
  763. margin-right: 20rpx;
  764. margin-left: 10rpx;
  765. line-height: 44rpx;
  766. }
  767. .add_con>view {
  768. font-size: 32rpx;
  769. color: #7885cb;
  770. }
  771. /* 删除内容 */
  772. .del {
  773. font-size: 32rpx;
  774. color: #f16765;
  775. margin-right: 14rpx;
  776. padding: 20rpx;
  777. }
  778. input {
  779. flex-grow: 1;
  780. font-size: 28rpx;
  781. color: #808080;
  782. }
  783. .btn {
  784. margin-top: 100rpx;
  785. }
  786. </style>