enginproject.vue 39 KB

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