enginproject.vue 35 KB

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