municipal.vue 37 KB

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