hcDetails.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  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-show="active==2">
  73. <view class="example-body">
  74. <uni-file-picker ref="upsgfjsRef" limit="9" title="最多选择9张图片" v-model="fileList.sdfjs"
  75. @select="e=>selectfile(e,'sdfjs')" @delete="e=>fileDelete(e,'sdfjs')"></uni-file-picker>
  76. </view>
  77. </view>
  78. <view class="hclist" v-show="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="添加照片或文件" v-model="fileList.fjs"
  88. @select="e=>selectfile(e,'fjs')" @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-item label="数字签名" name="notes" required>
  94. <img v-if="checkform.dataUrl" :url="checkform.dataUrl"></img>
  95. <view style="width: 100% ;height: 250rpx;" v-else>
  96. <l-signature disableScroll ref="signatureRef" penColor="red" :penSize="5"
  97. :openSmooth="true"></l-signature>
  98. <button size="mini" @click="$refs.signatureRef.clear()">撤消</button>
  99. <button size="mini" @click="savesign">保存</button>
  100. </view>
  101. </uni-forms-item>
  102. </uni-forms>
  103. </view>
  104. </view>
  105. <div class="btns">
  106. <button type="primary" size="mini" @click=" toggle">举证说明</button>
  107. <button type="primary" size="mini" :disabled=" !qrdis" @click="affirm(0)">确认</button>
  108. <button type="primary" size="mini" :disabled=" !qrdis" @click="affirm(1)">退回</button>
  109. <button type="primary" size="mini" @click="save">保存</button>
  110. <button type="primary" size="mini" :disabled=" !tjdis" @click="tj">提交</button>
  111. </div>
  112. <uni-popup ref="popup" background-color="#fff">
  113. <uni-popup-dialog type="info" title="举证说明" :content="nowobj.notes"></uni-popup-dialog>
  114. </uni-popup>
  115. </view>
  116. </template>
  117. <script>
  118. import {
  119. uploadFile
  120. } from '@/utils/choose.js'
  121. import {
  122. getDkjbxx,
  123. getDkjbywy,
  124. getStep,
  125. hcWork,
  126. getHcInfo,
  127. getdecTree,
  128. } from "@/api/dkjbxx.js";
  129. import {
  130. getdict
  131. } from "@/api/apis.js";
  132. import {
  133. jbxxs,
  134. tdxzTable,
  135. } from "../config";
  136. export default {
  137. name: "list",
  138. data() {
  139. return {
  140. nowobj: {},
  141. active: 0,
  142. tabOptions: ['基本信息', '业务研判', '实地拍照', '核查信息'],
  143. loading: false,
  144. steps: [],
  145. qrdis: false,
  146. tjdis: false,
  147. jbxxs: jbxxs,
  148. tdxzTable: tdxzTable,
  149. activeName: "jbxx",
  150. infoObj: {},
  151. activities: [],
  152. //业务研判
  153. ywyptab: "1",
  154. sheets: [],
  155. //上传拍照
  156. fileList: {},
  157. checkform: {},
  158. decList: [],
  159. hgxList: []
  160. };
  161. },
  162. mounted() {
  163. // this.getsteps()
  164. },
  165. methods: {
  166. handleClick(val) {
  167. this.nowobj = val
  168. this.getsteps();
  169. this.reset();
  170. this.getInfos(val);
  171. this.getdict()
  172. },
  173. getInfos(val) {
  174. let id = val.dkjdxxId
  175. getDkjbxx(id).then((res) => {
  176. this.infoObj = res.data;
  177. });
  178. getDkjbywy(id).then((res) => {
  179. if (res.data) {
  180. this.sheets = JSON.parse(res.data.sheetJson);
  181. this.ywyptab = this.sheets[0].sheet;
  182. }
  183. });
  184. getHcInfo({
  185. dkid: this.nowobj.dkjdxxId,
  186. auditflowStep: 'WYDC',
  187. auditflowId: this.nowobj.auditflowId,
  188. // fieldworkId: this.nowobj.id,
  189. }).then((res) => {
  190. if (res.data) {
  191. this.checkform = res.data[0]
  192. this.checkform.fjs.map(f =>
  193. this.fileList.fjs.push({
  194. name: 'fjsimg',
  195. url: f.fjPreview
  196. })
  197. )
  198. this.checkform.sdfjs.map(f =>
  199. this.fileList.sdfjs.push({
  200. name: 'sgfjsimg',
  201. url: f.fjPreview
  202. })
  203. )
  204. }
  205. });
  206. },
  207. getdict() {
  208. this.decList = [];
  209. this.hgxList = [];
  210. getdecTree({
  211. dictType: '3DDLBM'
  212. }).then((res) => {
  213. res.data.map(di => {
  214. this.decList.push({
  215. value: di.dictValue,
  216. text: di.dictLabel
  217. })
  218. })
  219. });
  220. getdict({
  221. dictType: 'hgx_decide'
  222. }).then((res) => {
  223. res.rows.map(di => {
  224. this.hgxList.push({
  225. value: di.dictValue,
  226. text: di.dictLabel
  227. })
  228. })
  229. });
  230. },
  231. returnList() {
  232. this.$emit('returnList')
  233. },
  234. getsteps() {
  235. this.steps = [];
  236. getStep({
  237. dkjdxxId: this.nowobj.dkjdxxId
  238. }).then((res) => {
  239. this.steps = res.data;
  240. this.qrdis = this.steps.find((x) => x.auditflowStep.includes('WYQR'))
  241. this.tjdis = this.steps.find((x) => x.auditflowStep.includes('TJ'))
  242. });
  243. },
  244. reset() {
  245. this.checkform = {
  246. fieldworkId: this.nowobj.id,
  247. dlbm: "",
  248. dlmc: "",
  249. decide: "",
  250. notes: "",
  251. auditflowStep: "WYDC",
  252. fjs: [],
  253. sdfjs: []
  254. }
  255. this.fileList = {
  256. fjs: [],
  257. sdfjs: []
  258. }
  259. },
  260. afterRead(files, detail) {
  261. // files.forEach(element => {
  262. // setTimeout(() => {
  263. // element.status = null;
  264. // }, 2000);
  265. // });
  266. },
  267. toggle() {
  268. this.$refs.popup.open('center')
  269. },
  270. affirm(confirmState) {
  271. uni.$globalData = this.nowobj
  272. this.$tab.navigateTo('/pages/index/common/affirm?confirmState=' + confirmState)
  273. },
  274. save() {
  275. let a = this.decList.find(d => d.value == this.checkform.dlbm)
  276. if (a) this.checkform.dlmc = a.text;
  277. console.log(this.checkform, 'fjs')
  278. this.$refs.checkRef.validate().then(res => {
  279. hcWork(this.checkform).then(response => {
  280. this.$modal.msgSuccess("保存成功")
  281. this.getsteps()
  282. })
  283. })
  284. },
  285. savesign() {
  286. this.$refs.signatureRef.canvasToTempFilePath({
  287. success: (res) => {
  288. console.log(res, '---')
  289. uploadFile(res.tempFilePath, (data) => {
  290. this.checkform.dataUrl = data.path
  291. })
  292. }
  293. })
  294. },
  295. tj() {
  296. uni.$globalData = this.nowobj
  297. this.$tab.navigateTo('/pages/index/common/tjDialog')
  298. },
  299. selectfile(e, fname) {
  300. let _this = this
  301. //e.tempFilePaths
  302. e.tempFiles.map(item => {
  303. _this.fileList[fname].push({
  304. name: fname + 'img',
  305. url: item.path
  306. })
  307. uploadFile(item.path, (data) => {
  308. if (data) {
  309. _this.checkform[fname].push({
  310. fjPath: data.path,
  311. fjSize: Number((item.size / 1024 / 1024).toFixed(2)),
  312. fjType: item.fileType
  313. });
  314. } else _this.fileList[fname].pop()
  315. })
  316. })
  317. },
  318. fileDelete(e, fname) {
  319. let index = this.fileList[fname].findInex(f => f.url == e.tempFilePath)
  320. this.fileList[fname].splice(index, 1)
  321. this.checkform[fname].splice(index, 1);
  322. }
  323. },
  324. };
  325. </script>
  326. <style lang="scss">
  327. .details {
  328. width: 100%;
  329. .uni-icons {
  330. position: absolute;
  331. right: 20rpx;
  332. top: 70rpx;
  333. }
  334. // position: relative;
  335. .tabs {
  336. margin-bottom: 20rpx;
  337. }
  338. .hclist {
  339. height: 40vh;
  340. overflow-x: hidden;
  341. overflow-y: auto;
  342. background: #fff;
  343. padding: 10rpx;
  344. }
  345. .btns {
  346. width: 100%;
  347. position: absolute;
  348. bottom: 20rpx;
  349. display: flex;
  350. }
  351. }
  352. </style>
  353. <style scoped lang="scss">
  354. @import "./tabs.scss";
  355. .menu-list {
  356. margin: 0;
  357. }
  358. .custom-image-box {
  359. /* #ifndef APP-NVUE */
  360. display: flex;
  361. /* #endif */
  362. flex-direction: row;
  363. justify-content: space-between;
  364. align-items: center;
  365. }
  366. </style>