municipal.vue 36 KB

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