hcDetails.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <template>
  2. <view class="details">
  3. <view class="search">
  4. <uni-icons type="bars" size="30" @click="returnList"></uni-icons>
  5. </view>
  6. <scroll-view class="top-menu-view" scroll-x="true">
  7. <view class="menu-topic-view" v-for="(item, key) in tabOptions" :key="key" @click="active=key">
  8. <view :class="active==key ? 'menu-topic-act' : 'menu-topic'">
  9. <text class="menu-topic-text">{{item}}</text>
  10. <view class="menu-topic-bottom">
  11. <view class="menu-topic-bottom-color"></view>
  12. </view>
  13. </view>
  14. </view>
  15. </scroll-view>
  16. <!-- <van-sticky :offset-top="-10">
  17. <van-tabs sticky v-model="active" class="tabs">
  18. <van-tab v-for="(item, key) in tabOptions" :key="key" :title="item">
  19. </van-tab>
  20. </van-tabs>
  21. </van-sticky> -->
  22. <view>
  23. <view class="hclist" v-if="active==0">
  24. <view class="menu-list">
  25. <view class="list-cell list-cell-arrow" v-for="(item, i) in jbxxs" :key="i">
  26. <view class="menu-item-box">
  27. <view>{{item.name}}</view>
  28. <view class="text-right">{{infoObj[item.prop]}}</view>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- <van-cell v-for="(item, i) in jbxxs" :key="i" :title="item.name" :value="infoObj[item.prop]" /> -->
  33. </view>
  34. <view class="hclist" v-if="active==1">
  35. <scroll-view v-if="sheets.length" class="top-menu-view" scroll-x="true">
  36. <view class="menu-topic-view" v-for="ypitem in sheets" :key="ypitem.sheet"
  37. @click="ywyptab=ypitem.sheet">
  38. <view :class="ywyptab==ypitem.sheet ? 'menu-topic-act' : 'menu-topic'">
  39. <text class="menu-topic-text">{{ypitem.type}}</text>
  40. <view class="menu-topic-bottom">
  41. <view class="menu-topic-bottom-color"></view>
  42. </view>
  43. </view>
  44. </view>
  45. </scroll-view>
  46. <!-- <van-tabs sticky v-if="sheets.length" v-model="ywyptab">
  47. <van-tab v-for="ypitem in sheets" :key="ypitem.sheet" :title="ypitem.type" :name="ypitem.sheet">
  48. </van-tab>
  49. </van-tabs> -->
  50. <view class="swiper-item" v-for="ypitem in sheets" :key="ypitem.sheet">
  51. <view v-if="ywyptab==ypitem.sheet">
  52. <img :src="ypitem.photo" width="100%" />
  53. 压占{{ ypitem.type }}面积共{{ ypitem.mjj }}平方米
  54. <view class="list-cell">
  55. <uni-row>
  56. <uni-col :span="8" v-for="(item, i) in tdxzTable" :key="i">{{item.label}}</uni-col>
  57. </uni-row>
  58. </view>
  59. <view class="list-cell">
  60. <uni-row v-for="(row, index) in ypitem.data_list" :key="index">
  61. <uni-col :span="8" v-for="(item, i) in tdxzTable" :key="i">
  62. <div v-if="item.slot == 'ratio'">
  63. {{ ((row.yzmj / ypitem.yzmj) * 100).toFixed(2) }}%
  64. </div>
  65. <span v-else>{{ row[item.prop] }}</span>
  66. </uni-col>
  67. </uni-row>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="hclist" v-if="active==2">
  73. <view class="example-body">
  74. <uni-file-picker ref="upsgfjsRef" limit="9" title="最多选择9张图片" @select="e=>selectfile(e,'sgfjs')"
  75. @delete="e=>fileDelete(e,'sgfjs')"></uni-file-picker>
  76. </view>
  77. </view>
  78. <view class="hclist" v-if="active==3">
  79. <uni-forms ref="checkRef" :model="checkform" labelWidth="80px">
  80. <uni-forms-item label="实际地类" name="dlbm">
  81. <uni-data-select v-model="checkform.dlbm" :localdata="decList"></uni-data-select>
  82. </uni-forms-item>
  83. <uni-forms-item label="核查初判" name="decide">
  84. <uni-data-select v-model="checkform.decide" :localdata="hgxList"></uni-data-select>
  85. </uni-forms-item>
  86. <uni-forms-item label="其它材料" name="fjs">
  87. <uni-file-picker ref="upfjsRef" title="添加照片或文件" @select="e=>selectfile(e,'fjs')"
  88. @delete="e=>fileDelete(e,'fjs')"></uni-file-picker>
  89. </uni-forms-item>
  90. <uni-forms-item label="其它说明" name="notes" required>
  91. <uni-easyinput v-model="checkform.notes" type="textarea" placeholder="请输入其它说明" />
  92. </uni-forms-item>
  93. </uni-forms>
  94. </view>
  95. </view>
  96. <div class="btns">
  97. <button type="primary" size="mini" @click=" toggle">举证说明</button>
  98. <button type="primary" size="mini" :disabled=" !qrdis" @click="affirm(0)">确认</button>
  99. <button type="primary" size="mini" :disabled=" !qrdis" @click="affirm(1)">退回</button>
  100. <button type="primary" size="mini" @click="save">保存</button>
  101. <button type="primary" size="mini" :disabled=" !tjdis" @click="tj">提交</button>
  102. </div>
  103. <uni-popup ref="popup" background-color="#fff">
  104. <uni-popup-dialog type="info" title="举证说明" :content="nowobj.notes"></uni-popup-dialog>
  105. </uni-popup>
  106. </view>
  107. </template>
  108. <script>
  109. import {
  110. uploadFile
  111. } from '@/utils/choose.js'
  112. import {
  113. getDkjbxx,
  114. getDkjbywy,
  115. getStep,
  116. hcWork,
  117. getHcInfo,
  118. getdecTree,
  119. } from "@/api/dkjbxx.js";
  120. import {
  121. getdict
  122. } from "@/api/apis.js";
  123. import {
  124. jbxxs,
  125. tdxzTable,
  126. } from "../config";
  127. export default {
  128. name: "list",
  129. data() {
  130. return {
  131. nowobj: {},
  132. active: 0,
  133. tabOptions: ['基本信息', '业务研判', '实地拍照', '核查信息'],
  134. loading: false,
  135. steps: [],
  136. qrdis: false,
  137. tjdis: false,
  138. jbxxs: jbxxs,
  139. tdxzTable: tdxzTable,
  140. activeName: "jbxx",
  141. infoObj: {},
  142. activities: [],
  143. //业务研判
  144. ywyptab: "1",
  145. sheets: [],
  146. //上传拍照
  147. fileList: {},
  148. checkform: {},
  149. decList: [],
  150. hgxList: []
  151. };
  152. },
  153. mounted() {
  154. // this.getsteps()
  155. },
  156. methods: {
  157. handleClick(val) {
  158. this.nowobj = val
  159. this.getsteps();
  160. this.reset();
  161. this.getInfos(val);
  162. this.getdict()
  163. },
  164. getInfos(val) {
  165. let id = val.dkjdxxId
  166. getDkjbxx(id).then((res) => {
  167. this.infoObj = res.data;
  168. });
  169. getDkjbywy(id).then((res) => {
  170. if (res.data) {
  171. this.sheets = JSON.parse(res.data.sheetJson);
  172. this.ywyptab = this.sheets[0].sheet;
  173. }
  174. });
  175. getHcInfo({
  176. dkid: this.nowobj.dkjdxxId,
  177. auditflowStep: 'WYDC',
  178. auditflowId: this.nowobj.auditflowId,
  179. fieldworkId: this.nowobj.id,
  180. }).then((res) => {
  181. if (res.data)
  182. this.checkform = res.data
  183. });
  184. },
  185. getdict() {
  186. this.decList = [];
  187. this.hgxList = [];
  188. getdecTree({
  189. dictType: '3DDLBM'
  190. }).then((res) => {
  191. res.data.map(di => {
  192. this.decList.push({
  193. value: di.dictCode,
  194. text: di.dictLabel
  195. })
  196. })
  197. });
  198. getdict({
  199. dictType: 'hgx_decide'
  200. }).then((res) => {
  201. res.rows.map(di => {
  202. this.hgxList.push({
  203. value: di.dictCode,
  204. text: di.dictLabel
  205. })
  206. })
  207. });
  208. },
  209. returnList() {
  210. this.$emit('returnList')
  211. },
  212. getsteps() {
  213. this.steps = [];
  214. getStep({
  215. dkjdxxId: this.nowobj.dkjdxxId
  216. }).then((res) => {
  217. this.steps = res.data;
  218. this.qrdis = this.steps.find((x) => x.auditflowStep.includes('WYQR'))
  219. this.tjdis = this.steps.find((x) => x.auditflowStep.includes('TJ'))
  220. });
  221. },
  222. reset() {
  223. this.checkform = {
  224. fieldworkId: this.nowobj.id,
  225. dlbm: "",
  226. dlmc: "",
  227. decide: "",
  228. notes: "",
  229. auditflowStep: "WYDC",
  230. fjs: [],
  231. sdfjs: []
  232. }
  233. this.fileList= {
  234. fjs: [],
  235. sdfjs: []
  236. }
  237. },
  238. afterRead(files, detail) {
  239. // files.forEach(element => {
  240. // setTimeout(() => {
  241. // element.status = null;
  242. // }, 2000);
  243. // });
  244. },
  245. toggle() {
  246. this.$refs.popup.open('center')
  247. },
  248. affirm(confirmState) {
  249. uni.$globalData = this.nowobj
  250. this.$tab.navigateTo('/pages/index/common/affirm?confirmState=' + confirmState)
  251. },
  252. save() {
  253. let a = this.decList.find(d => d.value == this.checkform.dlbm)
  254. if (a) this.checkform.dlmc = a.text;
  255. this.$refs.checkRef.validate().then(res => {
  256. hcWork(this.checkform).then(response => {
  257. this.$modal.msgSuccess("保存成功")
  258. this.getsteps()
  259. })
  260. })
  261. },
  262. tj() {
  263. uni.$globalData = this.nowobj
  264. this.$tab.navigateTo('/pages/index/common/tjDialog')
  265. },
  266. selectfile(e, fname) {
  267. e.tempFilePaths.map(item => {
  268. this.fileList[fname].push(item)
  269. uploadFile(item, (data) => {
  270. this.checkform[fname].push(data);
  271. })
  272. })
  273. },
  274. fileDelete(e, fname) {
  275. let index = this.fileList[fname].indexOf(e.tempFilePath)
  276. this.fileList[fname].splice(index, 1)
  277. this.checkform[fname].splice(index, 1);
  278. }
  279. },
  280. };
  281. </script>
  282. <style lang="scss">
  283. .details {
  284. width: 100%;
  285. .uni-icons {
  286. position: absolute;
  287. right: 20rpx;
  288. top: 70rpx;
  289. }
  290. // position: relative;
  291. .tabs {
  292. margin-bottom: 20rpx;
  293. }
  294. .hclist {
  295. height: 40vh;
  296. overflow-x: hidden;
  297. overflow-y: auto;
  298. background: #fff;
  299. padding: 10rpx;
  300. }
  301. .btns {
  302. width: 100%;
  303. position: absolute;
  304. bottom: 20rpx;
  305. display: flex;
  306. }
  307. }
  308. </style>
  309. <style scoped lang="scss">
  310. @import "./tabs.scss";
  311. .menu-list {
  312. margin: 0;
  313. }
  314. .custom-image-box {
  315. /* #ifndef APP-NVUE */
  316. display: flex;
  317. /* #endif */
  318. flex-direction: row;
  319. justify-content: space-between;
  320. align-items: center;
  321. }
  322. </style>