TopPipeWork.vue 23 KB

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