TopPipeWork.vue 24 KB

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