municipal.vue 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192
  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.projectType.dictValue)" style="margin-top: 10;"
  10. @click="pickerShow('gclx',0)">
  11. <span style="color: darkgray;">请选择工程类型</span>
  12. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  13. </view>
  14. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('gclx',0)">
  15. <span style="color: black;">{{projectType.dictLabel}}</span>
  16. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="uni-list">
  21. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  22. <view>
  23. 工程名称
  24. </view>
  25. <view v-if="this.isEmpty(this.projectName.id)" style="margin-top: 10;"
  26. @click="pickerShow('gcmc',0)">
  27. <span style="color: darkgray;">请选择工程名称</span>
  28. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  29. </view>
  30. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('gcmc',0)">
  31. <span style="color: black;">{{projectName.name}}</span>
  32. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  33. </view>
  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="jsdwValue" maxlength="100" 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="xmfzrValue" maxlength="16" 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="xcfzrValue" maxlength="16" 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="text" v-model="sjdwValue" maxlength="100" disabled="true"
  61. style="margin-left: 10px;text-align: right;"></input>
  62. </view>
  63. </view>
  64. <view class="uni-list">
  65. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  66. <text>设计负责人</text>
  67. <input class="uni-input" type="text" v-model="sjfzrValue" maxlength="16" disabled="true"
  68. style="margin-left: 10px;text-align: right;"></input>
  69. </view>
  70. </view>
  71. <view class="uni-list">
  72. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  73. <text>设计联系电话</text>
  74. <input class="uni-input" type="number" v-model="sjPhoneValue" disabled="true" maxlength="11"
  75. style="margin-left: 10px;text-align: right;"></input>
  76. </view>
  77. </view>
  78. <view class="uni-list">
  79. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  80. <text>监理单位</text>
  81. <input class="uni-input" type="text" v-model="jldwValue" maxlength="100" disabled="true"
  82. style="margin-left: 10px;text-align: right;"></input>
  83. </view>
  84. </view>
  85. <view class="uni-list">
  86. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  87. <text>监理负责人</text>
  88. <input class="uni-input" type="text" v-model="jlfzrValue" maxlength="16" disabled="true"
  89. style="margin-left: 10px;text-align: right;"></input>
  90. </view>
  91. </view>
  92. <view class="uni-list">
  93. <view class="container">
  94. <text>监理联系电话</text>
  95. <input class="uni-input" type="number" v-model="jlPhoneValue" disabled="true" maxlength="11"
  96. style="margin-left: 10px;text-align: right;"></input>
  97. </view>
  98. </view>
  99. <view class="uni-list">
  100. <view class="align-items">
  101. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  102. <view v-for="(item,index) in fileArr" :key="index" style="position: relative;">
  103. <view
  104. 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' ">
  105. <image :src="item.picUrl" mode=""
  106. style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  107. @click="showPhotoFile(fileImageArr.indexOf(item.picUrl))">
  108. </image>
  109. </view>
  110. <view v-else-if="item.picUrl.substring(item.picUrl.length - 3) == 'mp4'">
  111. <video :src="item.picUrl"
  112. style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  113. </view>
  114. <view v-else @click="chooseModel(item.picUrl,item.fileName)">
  115. {{item.fileName}}
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. </view>
  121. <SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
  122. subtitleKey="id" v-model="name"></SelectPicker>
  123. <SelectPicker :list="dictOptions" @change="changeSelectDict" v-if="openDict" @close="closeDict"
  124. titleKey="dictLabel" subtitleKey="dictValue" v-model="dictLabel"></SelectPicker>
  125. </view>
  126. <view class="background">
  127. <view>
  128. <view class="uni-list">
  129. <view
  130. style="font-size: 16px;margin-left: 10px;margin-top: 10px;display: flex; justify-content: space-between;margin-bottom: 10px;">
  131. {{objValue.value}}
  132. <span
  133. style="color: blue;font-size: 14px; display: flex;justify-content:flex-end; margin-right: 10px;"
  134. @click="history">历史</span>
  135. </view>
  136. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  137. <view>
  138. 施工时间
  139. </view>
  140. <view @click="openDatetimePicker()">
  141. <span style="color: black;">{{time}}</span>
  142. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  143. </view>
  144. </view>
  145. <view v-for="(a,index) in czggslList" :key="index" class="num-style">
  146. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  147. <view>
  148. 材质
  149. </view>
  150. <view class="uni-list-cell-db" @click="pickerShow('cz',index)">
  151. <span style="color: black;">{{a.cz.id==''?'请选择材质':a.cz.name}}</span>
  152. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  153. </view>
  154. </view>
  155. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  156. <view>
  157. 规格
  158. </view>
  159. <view class="uni-list-cell-db" @click="pickerShow('gg',index)">
  160. <span style="color: black;">{{a.gg.id==''?'请选择规格':a.gg.name}}</span>
  161. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  162. </view>
  163. </view>
  164. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  165. <text>米 数</text>
  166. <view style="display: flex; justify-content: right; width: 70%;">
  167. <input class="uni-input" type="number" v-model="a.sl.inputIntegerNumberValue"
  168. maxlength="6"
  169. style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
  170. <text style="font-weight:bold;margin-left: 10px;margin-right: 10px;">.</text>
  171. <input class="uni-input" type="number" v-model="a.sl.inputDecimalNumberValue"
  172. maxlength="1"
  173. style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
  174. </view>
  175. </view>
  176. <button v-if="index!=0" @click="this.czggslList.splice(index,1)" class="sc-btn">删除</button>
  177. </view>
  178. <button @click="this.czggslList.push({cz:{id: '',name: ''},gg:{id: '',name: ''},sl: {
  179. inputIntegerNumberValue: '',
  180. inputDecimalNumberValue: ''
  181. }})" class="tj-btn">添加</button>
  182. </view>
  183. <view v-if="objValue.value=='沟上施工'">
  184. <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
  185. <view class="container" style="color: #b2b2b2;">*请上传焊接照片</view>
  186. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  187. <image :src="loadImgSrc('updateimg.png')" mode=""
  188. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('hj')"
  189. v-show="reviewStatus!='1'"></image>
  190. <view v-for="(item,index) in imgHjArr" :key="index" style="position: relative;">
  191. <view
  192. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
  193. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  194. @click="showPhoto(index,'hj')">
  195. </image>
  196. </view>
  197. <view v-else>
  198. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  199. </view>
  200. <view @click="remove(index,'hj')"
  201. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  202. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  203. </image>
  204. </view>
  205. </view>
  206. </view>
  207. </view>
  208. <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
  209. <view class="container" style="color: #b2b2b2;">*请上传防腐照片</view>
  210. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  211. <image :src="loadImgSrc('updateimg.png')" mode=""
  212. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('ff')"
  213. v-show="reviewStatus!='1'"></image>
  214. <view v-for="(item,index) in imgFfArr" :key="index" style="position: relative;">
  215. <view
  216. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
  217. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  218. @click="showPhoto(index,'ff')">
  219. </image>
  220. </view>
  221. <view v-else>
  222. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  223. </view>
  224. <view @click="remove(index,'ff')"
  225. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  226. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  227. </image>
  228. </view>
  229. </view>
  230. </view>
  231. </view>
  232. </view>
  233. <view v-else>
  234. <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
  235. <view class="container" style="color: #b2b2b2;">*请上传管道下沟照片</view>
  236. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  237. <image :src="loadImgSrc('updateimg.png')" mode=""
  238. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('gdxg')"
  239. v-show="reviewStatus!='1'"></image>
  240. <view v-for="(item,index) in imgGdxgArr" :key="index" style="position: relative;">
  241. <view
  242. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
  243. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  244. @click="showPhoto(index,'gdxg')">
  245. </image>
  246. </view>
  247. <view v-else>
  248. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  249. </view>
  250. <view @click="remove(index,'gdxg')"
  251. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  252. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  253. </image>
  254. </view>
  255. </view>
  256. </view>
  257. <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
  258. <view class="container" style="color: #b2b2b2;">*请上传警示带铺设照片</view>
  259. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  260. <image :src="loadImgSrc('updateimg.png')" mode=""
  261. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('jsdps')"
  262. v-show="reviewStatus!='1'"></image>
  263. <view v-for="(item,index) in imgJspsArr" :key="index" style="position: relative;">
  264. <view
  265. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
  266. <image :src="item" mode=""
  267. style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  268. @click="showPhoto(index,'jsdps')">
  269. </image>
  270. </view>
  271. <view v-else>
  272. <video :src="item"
  273. style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  274. </view>
  275. <view @click="remove(index,'jsdps')"
  276. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  277. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  278. </image>
  279. </view>
  280. </view>
  281. </view>
  282. </view>
  283. <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
  284. <view class="container" style="color: #b2b2b2;">*请上传回填照片</view>
  285. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  286. <image :src="loadImgSrc('updateimg.png')" mode=""
  287. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('ht')"
  288. v-show="reviewStatus!='1'"></image>
  289. <view v-for="(item,index) in imgHtArr" :key="index" style="position: relative;">
  290. <view
  291. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
  292. <image :src="item" mode=""
  293. style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  294. @click="showPhoto(index,'ht')">
  295. </image>
  296. </view>
  297. <view v-else>
  298. <video :src="item"
  299. style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  300. </view>
  301. <view @click="remove(index,'ht')"
  302. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  303. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  304. </image>
  305. </view>
  306. </view>
  307. </view>
  308. </view>
  309. </view>
  310. </view>
  311. </view>
  312. </view>
  313. </view>
  314. <view class="action-btn">
  315. <button @click="submit" class="btn cu-btn block bg-blue lg round">确认上传</button>
  316. </view>
  317. <bottom-sheet ref="refShare" :data="historyList" :TitleType="objValue.value"></bottom-sheet>
  318. <yt-dateTimePicker ref="myPicker" @submit="handleSubmit" :start-year="2024" :end-year="2099"
  319. :time-hide="[true, true, true, true, true, true]" :time-label="['年', '月', '日', '时', '分', '秒']" />
  320. <!-- 下载提示页面 -->
  321. <mypopup :show="show_loding" :popupText="popupText" :titleText="titleText" :cancelText="cancelText"
  322. :confirmText="confirmText" @close="cancel_loding" @confirm="confirm_loding">
  323. </mypopup>
  324. </scroll-view>
  325. </template>
  326. <script>
  327. import SelectPicker from '../../components/selectPicker/select_picker.vue'
  328. import bottomSheet from '../../components/bottomSheet/bottomSheetMore.vue'
  329. import mypopup from '../../components/mypopup/mypopup.vue'
  330. import {
  331. getDicts
  332. } from "@/api/system/dict/data";
  333. import {
  334. getEnginMaterialQualityList,
  335. getEnginSpecificationsList,
  336. getRoomProjectList,
  337. getRoomProjectId,
  338. Submitengineering,
  339. getengineeringNameList,
  340. getEngineeringDetails,
  341. getEngineeringHistoryList,
  342. } from '@/api/common'
  343. import {
  344. getToken
  345. } from '../../utils/auth';
  346. export default {
  347. components: {
  348. SelectPicker,
  349. bottomSheet,
  350. mypopup
  351. },
  352. data() {
  353. return {
  354. historyList: {}, //历史数据
  355. show_loding: false,
  356. popupText: '', //对话框内容
  357. titleText: '',
  358. cancelText: '',
  359. confirmText: '',
  360. fileImageArr: [],
  361. zEngineeringMaterialBo: [], //给后台传的值 用料列表
  362. czggslList: [{
  363. cz: {
  364. id: '',
  365. name: ''
  366. },
  367. gg: {
  368. id: '',
  369. name: ''
  370. },
  371. sl: {
  372. inputIntegerNumberValue: '',
  373. inputDecimalNumberValue: ''
  374. }
  375. }, ],
  376. conLists: [],
  377. headers: {
  378. Authorization: "Bearer " + getToken()
  379. },
  380. time: '', //施工时间
  381. loading: false,
  382. loadingFile: false,
  383. projectType: {}, //工程类型
  384. open: false,
  385. objValue: '', //上一页面传过来的值 新增接口用
  386. openDict: false,
  387. specificationValue: {}, //规格
  388. projectContent: '', //施工内容
  389. materialValue: {}, //材质
  390. selectList: [],
  391. dictOptions: [],
  392. imgArr: [],
  393. imgHjArr: [],
  394. imgFfArr: [],
  395. imgGdxgArr: [],
  396. imgJspsArr: [],
  397. imgHtArr: [],
  398. fileArr: [],
  399. fileNameArr: [],
  400. type: '',
  401. jlPhoneValue: '', //监理电话
  402. jlfzrValue: '', //监理负责人
  403. jldwValue: '', //监理单位
  404. sjPhoneValue: '', //设计电话
  405. sjfzrValue: '', //设计负责人
  406. sjdwValue: '', //设计单位
  407. xcfzrValue: '', //现场负责人
  408. xmfzrValue: '', //项目负责人
  409. jsdwValue: '', //建设单位
  410. projectName: '', //工程名称
  411. SelectIndex: '', //选择的索引值
  412. fileUrl: '', //点击的文件地址
  413. fileName: '', //点击的文件名称
  414. enginList: {}, //工程信息
  415. enginId: '', //工程id
  416. createTime: '',
  417. infonId: '', //info id
  418. }
  419. },
  420. created() {
  421. this.time = this.traversalTime(new Date().getTime()) //在data里定义变量-nowTime
  422. },
  423. onLoad(options) {
  424. if ('params' in options) {
  425. this.objValue = JSON.parse(decodeURIComponent(options.params));
  426. }
  427. },
  428. methods: {
  429. //判断是否选择
  430. isEmpty(str) {
  431. return (!str || 0 === str.length);
  432. },
  433. handleSubmit(e) {
  434. this.time = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
  435. },
  436. //获取当前时间
  437. traversalTime(timestamp) {
  438. //timestamp(时间戳)是整数,否则要parseInt转换
  439. let time = new Date(timestamp);
  440. let y = time.getFullYear();
  441. let m = time.getMonth() + 1;
  442. let d = time.getDate();
  443. let h = time.getHours();
  444. let mm = time.getMinutes();
  445. let s = time.getSeconds();
  446. return y + '-' + this.addTimes(m) + '-' + this.addTimes(d) + ' ' + this.addTimes(h) + ':' + this.addTimes(
  447. mm) + ':' + this.addTimes(s);
  448. },
  449. addTimes(m) {
  450. return m < 10 ? '0' + m : m
  451. },
  452. // 打开picker
  453. openDatetimePicker() {
  454. this.$refs.myPicker.show();
  455. },
  456. // 关闭picker
  457. closeDatetimePicker() {
  458. this.$refs.myPicker.hide();
  459. },
  460. pickerShow(e, index) {
  461. this.SelectIndex = index;
  462. this.type = e; //赋值类型
  463. if (e == 'cz') { //材质
  464. this.open = true;
  465. getEnginMaterialQualityList("市政工程").then(response => {
  466. this.selectList = response.data;
  467. });
  468. } else if (e == 'gg') { //规格
  469. if (this.isEmpty(this.czggslList[index].cz.id)) {
  470. this.$modal.msg('请选择材质')
  471. // this.czggslList[index].cz = this.materialValue.id
  472. } else {
  473. this.open = true;
  474. this.selectList = this.materialList;
  475. }
  476. } else if (e == 'gclx') { //工程类型
  477. this.openDict = true;
  478. getDicts("municipal_engineering").then(response => {
  479. this.dictOptions = response.data;
  480. });
  481. } else if (e == 'gcmc') { //工程名称
  482. if (this.isEmpty(this.projectType.dictValue)) {
  483. this.$modal.msg('请选择工程类型')
  484. return
  485. }
  486. this.open = true;
  487. //请求
  488. getengineeringNameList(this.projectType.dictValue, "2", null).then(response => {
  489. this.selectList = response.data;
  490. });
  491. }
  492. },
  493. showPhotoFile(index) {
  494. uni.previewImage({
  495. current: index,
  496. urls: this.fileImageArr,
  497. })
  498. },
  499. showPhoto(index, e) {
  500. let typeArr = [];
  501. let newArr = [];
  502. if (e == 'hj') {
  503. typeArr = this.imgHjArr;
  504. } else if (e == 'ff') {
  505. typeArr = this.imgFfArr;
  506. } else if (e == 'gdxg') {
  507. typeArr = this.imgGdxgArr;
  508. } else if (e == 'jsdps') {
  509. typeArr = this.imgJspsArr;
  510. } else if (e == 'ht') {
  511. typeArr = this.imgHtArr;
  512. }
  513. console.log("===", typeArr);
  514. typeArr.forEach((item, index) => {
  515. if (item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' ||
  516. item.substring(item.length - 4) == 'jpeg') {
  517. newArr.push(item)
  518. }
  519. });
  520. uni.previewImage({
  521. current: index,
  522. urls: newArr,
  523. })
  524. },
  525. remove(index, e) {
  526. let _this = this;
  527. uni.showModal({
  528. title: '提示',
  529. content: '是否删除该图片或视频?',
  530. success: (res) => {
  531. if (res.confirm) {
  532. //this.imgArr.splice(index, 1)
  533. if (e == 'hj') {
  534. _this.imgHjArr.splice(index, 1)
  535. } else if (e == 'ff') {
  536. _this.imgFfArr.splice(index, 1)
  537. } else if (e == 'gdxg') {
  538. _this.imgGdxgArr.splice(index, 1)
  539. } else if (e == 'jsdps') {
  540. _this.imgJspsArr.splice(index, 1)
  541. } else if (e == 'ht') {
  542. _this.imgHtArr.splice(index, 1)
  543. }
  544. }
  545. }
  546. })
  547. },
  548. choose(e) {
  549. let _this = this;
  550. uni.showActionSheet({
  551. title: '上传',
  552. itemList: ['图片', '视频'],
  553. success: (res) => {
  554. if (res.tapIndex == 0) {
  555. this.chooseimage(e)
  556. } else {
  557. this.choosevideo(e)
  558. }
  559. }
  560. })
  561. },
  562. chooseimage(e) {
  563. let _this = this;
  564. uni.chooseImage({
  565. sizeType: ['album', 'camera'],
  566. success(resp) {
  567. resp.tempFiles.forEach((item, index) => {
  568. const task = uni.uploadFile({
  569. url: _this.$HTTP + `/obs`,
  570. filePath: item.path,
  571. name: 'file',
  572. formData: {},
  573. header: _this.headers,
  574. success: res => {
  575. let data = JSON.parse(res.data);
  576. if (![200].includes(data.code)) {
  577. _this.$modal.msg(data.msg)
  578. } else {
  579. if (_this.progress === 100) {
  580. if (e == 'hj') {
  581. _this.imgHjArr.push(data.data.url)
  582. } else if (e == 'ff') {
  583. _this.imgFfArr.push(data.data.url)
  584. } else if (e == 'gdxg') {
  585. _this.imgGdxgArr.push(data.data.url)
  586. } else if (e == 'jsdps') {
  587. _this.imgJspsArr.push(data.data.url)
  588. } else if (e == 'ht') {
  589. _this.imgHtArr.push(data.data.url)
  590. }
  591. _this.$modal.msg('上传成功!')
  592. }
  593. }
  594. },
  595. fail: e => {
  596. _this.$modal.msg('上传失败!')
  597. },
  598. complete: res => {
  599. uni.hideLoading();
  600. _this.uploading = false;
  601. }
  602. });
  603. task.onProgressUpdate(res => {
  604. _this.progress = res.progress;
  605. uni.showLoading({
  606. title: '上传中'
  607. })
  608. if (_this.progress != 100) {
  609. _this.loading = false
  610. } else {
  611. _this.loading = true
  612. }
  613. });
  614. })
  615. },
  616. })
  617. },
  618. choosevideo(e) {
  619. let _this = this;
  620. uni.chooseVideo({
  621. sourceType: ['album', 'camera'],
  622. maxDuration: 30,
  623. success(resp) {
  624. const task = uni.uploadFile({
  625. url: _this.$HTTP + `/obs`,
  626. filePath: resp.tempFilePath,
  627. name: 'file',
  628. formData: {},
  629. header: _this.headers,
  630. success: res => {
  631. // 判断是否json字符串,将其转为json格式
  632. let data = JSON.parse(res.data);
  633. if (![200].includes(res.statusCode)) {
  634. this.uploadError(index, data);
  635. } else {
  636. //上传成功
  637. if (_this.progress === 100) {
  638. if (e == 'hj') {
  639. _this.imgHjArr.push(data.data.url)
  640. } else if (e == 'ff') {
  641. _this.imgFfArr.push(data.data.url)
  642. } else if (e == 'gdxg') {
  643. _this.imgGdxgArr.push(data.data.url)
  644. } else if (e == 'jsdps') {
  645. _this.imgJspsArr.push(data.data.url)
  646. } else if (e == 'ht') {
  647. _this.imgHtArr.push(data.data.url)
  648. }
  649. _this.$modal.msg('上传成功!')
  650. }
  651. }
  652. },
  653. fail: e => {
  654. _this.$modal.msg('上传失败!')
  655. this.uploadError(index, e);
  656. },
  657. complete: res => {
  658. uni.hideLoading();
  659. _this.uploading = false;
  660. }
  661. });
  662. task.onProgressUpdate(res => {
  663. _this.progress = res.progress;
  664. uni.showLoading({
  665. title: '上传中'
  666. })
  667. if (_this.progress != 100) {
  668. _this.loadingFile = false
  669. } else {
  670. _this.loadingFile = true
  671. }
  672. });
  673. },
  674. })
  675. },
  676. changeSelectDict(item, index) {
  677. this.openDict = false;
  678. this.projectType = item
  679. this.projectName = ''; //重置工程名称
  680. this.jlPhoneValue = ''; //重置监理电话
  681. this.jlfzrValue = ''; //重置监理负责人
  682. this.jldwValue = ''; //重置监理单位
  683. this.sjPhoneValue = ''; //重置设计电话
  684. this.sjfzrValue = ''; //重置设计负责人
  685. this.sjdwValue = ''; //重置设计单位
  686. this.xcfzrValue = ''; //重置现场负责人
  687. this.xmfzrValue = ''; //重置项目负责人
  688. this.jsdwValue = ''; //重置建设单位
  689. this.enginId = ''; //重置工程id
  690. this.fileArr = ''
  691. this.createTime = '';
  692. this.infonId = '';
  693. this.fileImageArr = [];
  694. },
  695. changeSelect(item, index) {
  696. this.open = false;
  697. if (this.type == 'cz') {
  698. this.materialValue = item;
  699. this.specificationValue = ''; //重置规格
  700. //根据材质ID 获取规格数据
  701. getEnginSpecificationsList(item.id).then(res => {
  702. this.materialList = res.data
  703. this.czggslList[this.SelectIndex].cz.id = this.materialValue.id
  704. this.czggslList[this.SelectIndex].cz.name = this.materialValue.name
  705. })
  706. } else if (this.type == 'gg') {
  707. this.specificationValue = item;
  708. this.czggslList[this.SelectIndex].gg.id = this.specificationValue.id
  709. this.czggslList[this.SelectIndex].gg.name = this.specificationValue.name
  710. } else if (this.type == 'gcmc') {
  711. this.projectName = item
  712. //根据工程id 获取工程信息
  713. uni.showLoading({
  714. title: '加载中'
  715. })
  716. getEngineeringDetails(item.id).then(response => {
  717. uni.hideLoading();
  718. // this.enginList = response.data
  719. this.jlPhoneValue = response.data.supervisionPhone; //监理电话
  720. this.jlfzrValue = response.data.supervisionHead; //监理负责人
  721. this.jldwValue = response.data.supervisionUnit; //监理单位
  722. this.sjPhoneValue = response.data.designPhone; //设计电话
  723. this.sjfzrValue = response.data.designHead; //设计负责人
  724. this.sjdwValue = response.data.designUnit; //设计单位
  725. this.xcfzrValue = response.data.sceneHead; //现场负责人
  726. this.xmfzrValue = response.data.projectHead; //项目负责人
  727. this.jsdwValue = response.data.constructUnit; //建设单位
  728. this.enginId = response.data.id; //工程id
  729. this.fileArr = response.data.pics
  730. this.createTime = response.data.createTime;
  731. //this.infonId = response.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList[0].id
  732. this.fileArr.forEach((list, index) => {
  733. if (list.picUrl.substring(list.picUrl.length - 3) == 'png' || list.picUrl
  734. .substring(list.picUrl.length - 3) == 'jpg' || list.picUrl.substring(list
  735. .picUrl.length - 4) == 'jpeg') {
  736. this.fileImageArr.push(list.picUrl)
  737. }
  738. });
  739. });
  740. }
  741. },
  742. //关闭弹窗
  743. close(e) {
  744. this.open = false
  745. },
  746. //关闭弹窗
  747. closeDict(e) {
  748. this.openDict = false
  749. },
  750. chooseModel(url, name) {
  751. this.cancelText = '复制';
  752. this.confirmText = "下载";
  753. this.titleText = "温馨提示"
  754. this.popupText = "下载或者复制链接";
  755. this.show_loding = true;
  756. this.fileName = name;
  757. this.fileUrl = url; //文件名称和下载地址赋值
  758. },
  759. //取消按钮
  760. cancel_loding() {
  761. let _this = this;
  762. _this.show_loding = false;
  763. if (!_this.isEmpty(_this.fileUrl)) {
  764. uni.setClipboardData({
  765. data: _this.fileUrl,
  766. success() {
  767. uni.showToast({
  768. title: '已复制' + _this.fileName + '地址成功 请在浏览器打开',
  769. icon: 'none'
  770. });
  771. },
  772. fail(e) {
  773. uni.showToast({
  774. title: '复制失败',
  775. icon: 'none'
  776. });
  777. }
  778. });
  779. }
  780. },
  781. //确定按钮
  782. confirm_loding() {
  783. this.show_loding = false;
  784. this.download(this.fileUrl, this.fileName);
  785. },
  786. getDownLoadFilePath() {
  787. let cachePath = `${uni.env.USER_DATA_PATH}/downloads`
  788. let fm = uni.getFileSystemManager()
  789. try {
  790. // 访问成功则存在
  791. fm.accessSync(cachePath)
  792. } catch (error) {
  793. // 不存在则新建
  794. fm.mkdirSync(cachePath, true)
  795. }
  796. return cachePath
  797. },
  798. download(url, name) {
  799. let savePath = this.getDownLoadFilePath();
  800. uni.downloadFile({
  801. url: url,
  802. success: response => {
  803. if (response.statusCode === 200) {
  804. uni.getFileSystemManager().saveFile({
  805. tempFilePath: response.tempFilePath,
  806. filePath: `${savePath}/${name}`,
  807. success: (resData) => {
  808. uni.showToast({
  809. title: '下载成功'
  810. })
  811. },
  812. fail: error => {}
  813. })
  814. }
  815. }
  816. })
  817. },
  818. //历史
  819. history() {
  820. if (this.isEmpty(this.projectType.dictValue)) {
  821. this.$modal.msg('请选择工程类型')
  822. return
  823. }
  824. if (this.isEmpty(this.projectName.id)) {
  825. this.$modal.msg('请选择工程名称')
  826. return
  827. }
  828. getEngineeringHistoryList(this.enginId, '').then(response => {
  829. this.historyList = response.data
  830. if (response.data.zEngineeringNodeBoList != null) {
  831. this.$refs.refShare.handleShowShare();
  832. } else {
  833. this.$modal.msg("暂无历史信息")
  834. }
  835. });
  836. },
  837. submit() {
  838. if (this.isEmpty(this.projectType.dictValue)) {
  839. this.$modal.msg('请选择工程类型')
  840. return
  841. }
  842. if (this.isEmpty(this.projectName.id)) {
  843. this.$modal.msg('请选择工程名称')
  844. return
  845. }
  846. try {
  847. this.czggslList.forEach((list) => {
  848. if (this.isEmpty(list.cz.id)) {
  849. this.$modal.msg('材质不能为空')
  850. throw new Error('End Loop')
  851. }
  852. if (this.isEmpty(list.gg.id)) {
  853. this.$modal.msg('规格不能为空')
  854. throw new Error('End Loop')
  855. }
  856. if (this.isEmpty(list.sl.inputIntegerNumberValue)) {
  857. this.$modal.msg("请输入米数")
  858. throw new Error('End Loop')
  859. }
  860. })
  861. } catch (e) {
  862. if (e.message === 'End Loop') throw e
  863. }
  864. // if (this.imgArr.length <= 0) {
  865. // this.$modal.msg('请上传照片或视频')
  866. // return
  867. // }
  868. if (this.objValue.value == '沟上施工') {
  869. if (this.imgHjArr.length <= 0) {
  870. this.$modal.msg('请上传焊接照片')
  871. return
  872. }
  873. if (this.imgFfArr.length <= 0) {
  874. this.$modal.msg('请上传防腐照片')
  875. return
  876. }
  877. } else {
  878. if (this.imgGdxgArr.length <= 0) {
  879. this.$modal.msg('请上传管道下沟照片')
  880. return
  881. }
  882. if (this.imgJspsArr.length <= 0) {
  883. this.$modal.msg('请上传警示带铺设照片')
  884. return
  885. }
  886. if (this.imgHtArr.length <= 0) {
  887. this.$modal.msg('请上传回填照片')
  888. return
  889. }
  890. }
  891. if (this.loading == false) {
  892. this.$modal.msg('照片或视频未上传完毕,无法提交!')
  893. return
  894. }
  895. this.zEngineeringMaterialBo = [];
  896. this.czggslList.forEach((list) => {
  897. this.zEngineeringMaterialBo.push({
  898. materialQuality: list.cz.id,
  899. specifications: list.gg.id,
  900. number: list.sl.inputIntegerNumberValue + (list.sl.inputDecimalNumberValue ==
  901. '' ?
  902. '' : "." + list.sl.inputDecimalNumberValue)
  903. })
  904. })
  905. let param = {
  906. //files: this.fileArr, //文件
  907. id: this.enginId, //工程id
  908. type: '2', // 用来区分工业工程=1、市政工程=2
  909. enginName: this.projectName.name, //工程名称
  910. enginType: this.projectType.dictValue, // 工程类型
  911. constructUnit: this.jsdwValue, // 建筑单位
  912. projectHead: this.xmfzrValue, // 项目负责人
  913. sceneHead: this.xcfzrValue, // 现场负责人
  914. designUnit: this.sjdwValue, // 设计单位
  915. designHead: this.sjfzrValue, // 设计负责人
  916. designPhone: this.sjPhoneValue, // 设计联系电话
  917. supervisionUnit: this.jldwValue, // 监理单位
  918. supervisionHead: this.jlfzrValue, // 监理负责人
  919. supervisionPhone: this.jlPhoneValue, // 监理联系电话
  920. //enginClassification: this.objValue.value, // 工程分类 上一页面传过来的
  921. zEngineeringNodeBo: {
  922. createTime: this.createTime,
  923. type: '市政工程', // 写死
  924. zEngineeringInfoBo: {
  925. //engInfoId: this.infonId,
  926. constructTime: this.time, //施工时间
  927. zEngiineeringPhotoBoList: this.imgArr, //照片集合
  928. zEngineeringMaterialBo: this.zEngineeringMaterialBo // 用料对象
  929. }
  930. }
  931. }
  932. uni.showLoading()
  933. Submitengineering(param).then(res => {
  934. if (res.code == '200') {
  935. uni.hideLoading()
  936. uni.showToast({
  937. title: res.msg,
  938. icon: 'none',
  939. //显示持续时间为 3秒
  940. duration: 2000
  941. });
  942. setTimeout(function() {
  943. uni.navigateBack();
  944. }, 1000)
  945. }
  946. })
  947. }
  948. }
  949. }
  950. </script>
  951. <style lang="scss">
  952. .container {
  953. display: flex;
  954. align-items: center;
  955. justify-content: space-between;
  956. padding: 10px;
  957. position: relative;
  958. }
  959. .uni-list {
  960. border: 1xp solid #eee;
  961. }
  962. .to-right-icon {
  963. width: 15px;
  964. height: 15px;
  965. position: absolute;
  966. top: 50%;
  967. transform: translateY(-50%);
  968. }
  969. .text {
  970. font-size: 16px;
  971. color: #333;
  972. }
  973. .background {
  974. // border: 15px solid hsla(0, 0%, 100%, .5);
  975. background: white;
  976. background-clip: padding-box;
  977. padding: 20rpx;
  978. border-radius: 20rpx;
  979. margin: 20rpx;
  980. /*从padding开始往外面裁剪背景*/
  981. }
  982. .btn {
  983. width: 715rpx;
  984. height: 69rpx;
  985. background: #79A4F0;
  986. border-radius: 6rpx;
  987. font-size: 25rpx;
  988. font-family: Microsoft YaHei;
  989. font-weight: 400;
  990. color: #FFFFFF;
  991. line-height: 69rpx;
  992. margin-top: 40rpx;
  993. margin-bottom: 100rpx;
  994. }
  995. .number {
  996. display: flex;
  997. /* 水平居中显示子元素 */
  998. align-items: flex-start;
  999. /* 垂直居中显示子元素 */
  1000. justify-content: space-between;
  1001. /* 左右间距等于间距大小 */
  1002. padding: 10px;
  1003. /* 设置padding以提高视觉效果 */
  1004. }
  1005. .textarea {
  1006. margin-top: 10upx;
  1007. width: 100%;
  1008. border: 1rpx solid red;
  1009. min-height: 100upx;
  1010. line-height: 20px;
  1011. }
  1012. .tj-btn {
  1013. height: 69rpx;
  1014. background: #3184f0;
  1015. border-radius: 6rpx;
  1016. font-size: 25rpx;
  1017. font-weight: 400;
  1018. color: #FFFFFF;
  1019. line-height: 69rpx;
  1020. margin: 40rpx 70rpx;
  1021. }
  1022. .sc-btn {
  1023. height: 69rpx;
  1024. background: #f0686b;
  1025. border-radius: 6rpx;
  1026. font-size: 25rpx;
  1027. font-weight: 400;
  1028. color: #FFFFFF;
  1029. line-height: 69rpx;
  1030. margin: 40rpx;
  1031. }
  1032. .num-style {
  1033. background: #e8f4f9;
  1034. margin: 20rpx;
  1035. padding: 10rpx;
  1036. border-radius: 20rpx;
  1037. border: 1px solid #d4e3f0;
  1038. }
  1039. </style>