TopPipeWork.vue 24 KB

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