移动端
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

325 righe
11 KiB

  1. <template>
  2. <div class="app-container">
  3. <div class="header_main">
  4. 执法打卡
  5. <div class="return_btn" @click="onClickLeft"></div>
  6. </div>
  7. <baidu-map :center="center" panBy="[50,50]" :zoom="zoom" :scroll-wheel-zoom="true" :pinch-to-zoom="true" map-type="BMAP_NORMAL_MAP" style="height:150vh" >
  8. <!-- 必须给容器指高度,不然地图将显示在一个高度为0的容器中,看不到 -->
  9. <bm-geolocation anchor="BMAP_ANCHOR_BOTTOM_RIGHT" :showAddressBar="true" :autoLocation="true"></bm-geolocation>
  10. <bm-marker :position="center" :dragging="true" animation="BMAP_ANIMATION_BOUNCE" :icon="{url: '../../../../static/images/lawEnforcement/new/address.gif', size: {width: 50, height: 50}}"></bm-marker>
  11. </baidu-map>
  12. <div style="position:absolute;top: 75px;width: 100%;">
  13. <div class="main_box top_box">
  14. <van-field readonly v-model="form.caseSource" label="案件来源" :border="false" />
  15. <van-field readonly v-model="form.schemeId" label="关联方案" :border="false" />
  16. <van-field readonly v-model="form.caseName" label="案件名称" :border="false" />
  17. </div>
  18. <div class="main_box" style="margin-top: 10px;padding: 0rem 0.426667rem;">
  19. <div class="file_box">
  20. <p class="left_box">未</p>
  21. <div class="center_box">
  22. <p class="time">{{ nowTime }}<span>({{ nowDate }})</span></p>
  23. <p class="dress">{{clockinAddr}}</p>
  24. </div>
  25. <div class="file_box_btn" @click="$router.push({name:'lawEnforcementTaskRecord', query: {id:form.id,relationType:form.caseProgress,clockin_user:clockin_user}})">
  26. <img src="../../../../static/images/lawEnforcement/icon/task_icon.png">
  27. <p>打卡记录</p>
  28. </div>
  29. </div>
  30. <div class="file_box" style="border-top: 1px solid #DEDEDE">
  31. <van-uploader v-model="fileList" :after-read="afterRead" @delete="deleteFile" />
  32. </div>
  33. <div class="bz">
  34. <van-field placeholder="请输入备注" v-model="remark" :border="false" />
  35. </div>
  36. </div>
  37. <div class="main_box" style="margin-top: 10px;padding: 0.266667rem 0.426667rem;">
  38. <p class="now_dress">当前位置:{{clockinAddr}}</p>
  39. </div>
  40. </div>
  41. <!-- $router.push({name:'lawEnforcementSignInRecord'}) @click="submitForm"-->
  42. <div class="submitButton" @click="submitForm" >
  43. <p class="datetime">{{ nowTime }}</p>
  44. <p>打卡</p>
  45. </div>
  46. </div>
  47. </template>
  48. <script>
  49. import { getCase , schemeList , commonUpload , getUserProfile , addClockin } from "@/api/lawEnforcement/index";
  50. export default {
  51. name: "programmeDetail",
  52. data() {
  53. return {
  54. checked:'',
  55. showBankType:false,
  56. showPayeeType:false,
  57. showPicker:false,
  58. form:{
  59. clockinAddr:''
  60. },
  61. center: { lng: 122.089726, lat: 37.540728 }, //经纬度
  62. zoom: 15, //地图展示级别
  63. bankType:'',
  64. payeeType:'',
  65. value:'',
  66. bankTypeOptions:[],
  67. payeeTypeOptions:[],
  68. tEnforceSchemeHandlerList:[],
  69. minDate: new Date(2020, 0, 1),
  70. maxDate: new Date(2025, 10, 1),
  71. currentDate: new Date(2021, 0, 17),
  72. activeNames: ['1'],
  73. activeNames1: ['1'],
  74. activeNames2: ['1'],
  75. nowDate: this.format(new Date(),'yyyy-MM-dd'), // 当前日期
  76. nowTime: '', // 当前时间
  77. fileList:[],
  78. openPic:[],
  79. openPic2:[],
  80. clockinAddr:'',
  81. remark:'',
  82. clockin_user:''
  83. };
  84. },
  85. created() {
  86. // this.getDictionaries()
  87. var that = this;
  88. setInterval(function () {
  89. that.nowTime = that.format(new Date(),'HH:mm')
  90. }, 500);
  91. this.getDicts("case_source").then(response => {
  92. this.caseSourceOptions = response.data;
  93. });
  94. this.getDetail();
  95. getUserProfile().then(res => {
  96. this.clockin_user = res.data.userName;
  97. })
  98. },
  99. methods: {
  100. getDetail(){
  101. getCase(this.$route.query.id).then((response) => {
  102. response.data.caseSource = response.data.caseSource == '' ? '' : this.selectDictLabel(this.caseSourceOptions, response.data.caseSource);
  103. var schemeQueryParam = {
  104. applyStatus: "1",
  105. };
  106. schemeList(schemeQueryParam).then((res) => {
  107. let scheme = res.rows.filter(function (e) { return e.id == response.data.schemeId; });
  108. if (scheme.length > 0){
  109. response.data.schemeId = scheme[0].schemeName
  110. }
  111. });
  112. this.form = response.data;
  113. var that = this;
  114. that.getNowLocation();
  115. });
  116. },
  117. afterRead(file) {
  118. // 此时可以自行将文件上传至服务器
  119. this.openPic.push(file.file);
  120. let params1 = new FormData();
  121. params1.append("file", file.file);
  122. commonUpload(params1).then((r1) => {
  123. this.openPic2.push(r1.fileName);
  124. })
  125. },
  126. deleteFile(file,detail) {
  127. console.log(file)
  128. console.log(detail)
  129. this.openPic2.splice(detail.index,1);
  130. },
  131. getNowLocation(){
  132. let that = this;
  133. var location_lon = "";
  134. var location_lat = ""; // 经度,纬度
  135. navigator.geolocation.getCurrentPosition((position) => {
  136. console.log(position)
  137. let lat = position.coords.latitude;
  138. let lng = position.coords.longitude;
  139. const pointBak = new BMap.Point(lng, lat);
  140. const convertor = new BMap.Convertor();
  141. convertor.translate([pointBak], 1, 5,function(resPoint) {
  142. if(resPoint && resPoint.points && resPoint.points.length>0){
  143. lng = resPoint.points[0].lng;
  144. lat = resPoint.points[0].lat;
  145. }
  146. const point = new BMap.Point(lng, lat);
  147. const geo = new BMap.Geocoder();
  148. that.form.latitude = point.lat;
  149. that.form.longitude = point.lng;
  150. that.center.lng = point.lng;
  151. that.center.lat = point.lat;
  152. geo.getLocation(point, (res) => {
  153. console.log(res)
  154. that.clockinAddr = res.address;
  155. that.form.clockinAddr = res.address;
  156. });
  157. });
  158. });
  159. },
  160. submitForm(){
  161. let queryParams = {
  162. deptId: this.form.deptId,
  163. caseId: this.$route.query.id, // 案件ID
  164. relationType: this.form.caseProgress, // 案件所在阶段(2:勘察 3:立案 4:取证 5:处理 6:裁决 7:执行)
  165. clockinAddr: this.form.clockinAddr, // 打卡地址(中文汉字地址)
  166. clockinDate: this.format(new Date(),'yyyy-MM-dd'), // 打卡日期(仅日期,例如:2022-09-29 )
  167. clockinTime: this.format(new Date(),'HH:mm'), // 打卡时间 (仅日期,例如:11:19)
  168. clockinUser: this.clockin_user, // 打卡账号(获取当前登录执法人员用户的账号,一般是手机号账号)
  169. attachement: this.openPic2.join(','), // 打卡上传附件(附件的路径字符串,多个附件路径之前通过英文逗号分隔)
  170. latitude: this.form.latitude, // 打卡纬度(定位坐标纬度)
  171. longitude: this.form.longitude, // 打卡经度(定位坐标经度)
  172. remark:this.remark
  173. };
  174. console.log(queryParams)
  175. addClockin(queryParams).then(response => {
  176. if (response.code == 200){
  177. this.$toast.success('打卡成功');
  178. }
  179. })
  180. }
  181. // showPosition(position){
  182. // console.log("我当前经度为"+position.coords.latitude+",纬度为"+position.coords.longitude+"的地方哦")
  183. // },
  184. },
  185. }
  186. </script>
  187. <style scoped lang="scss">
  188. .app-container {
  189. padding: 0;
  190. height: 100vh;
  191. overflow: hidden;
  192. }
  193. .bz{
  194. padding-bottom: 15PX;
  195. /deep/ .van-cell{
  196. padding: 2px 8px;
  197. border: 1px solid #C9C9C9;
  198. border-radius: 8px;
  199. }
  200. }
  201. .header_main{
  202. height: 116px;
  203. background: url('../../../../static/images/lawEnforcement/new/list_head.png') no-repeat;
  204. background-size: 100% 100%;
  205. position: fixed;
  206. top: 0;
  207. left: 0;
  208. width: 100%;
  209. font-size: 36px;
  210. line-height: 116px;
  211. text-align: center;
  212. color: #fff;
  213. z-index: 999;
  214. .return_btn{
  215. width: 24px;
  216. height: 43.2px;
  217. background: url('../../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  218. background-size: 20px 36px;
  219. position: absolute;
  220. left: 38px;
  221. top: 36px;
  222. }
  223. .add_btn{
  224. width: 56.4px;
  225. height: 40.8px;
  226. background: url('../../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  227. background-size: 47px 34px;
  228. position: absolute;
  229. right: 38px;
  230. top: 36px;
  231. }
  232. }
  233. .top_box{
  234. background: url('../../../../static/images/lawEnforcement/icon/task_icon_03.png') no-repeat 97% 10%;
  235. padding: 10PX 0;
  236. /*background-size: 100% 100%;*/
  237. /deep/ .van-cell{
  238. background: none;
  239. }
  240. }
  241. .main_box{
  242. width: 96%;
  243. margin: 0 auto;
  244. border-radius: 10PX;
  245. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  246. overflow: hidden;
  247. background-color: #FFF;
  248. }
  249. .file_box{
  250. display: flex;
  251. align-items: center;
  252. font-size: 0.35rem;
  253. padding: 0.266667rem 0;
  254. .left_box{
  255. background: #C9C9C9;
  256. color: #ffffff;
  257. width: 27PX;
  258. height: 27PX;
  259. line-height: 27PX;
  260. text-align: center;
  261. border-radius: 100%;
  262. }
  263. .center_box{
  264. padding: 0rem 0.426667rem;
  265. .time{
  266. font-size: 0.5rem;
  267. span{
  268. font-size: 0.35rem;
  269. color: #878787;
  270. }
  271. }
  272. .dress{
  273. color: #B4B0B0;
  274. background: url('../../../../static/images/lawEnforcement/icon/task_icon_01.png') no-repeat left center;
  275. padding-left: 14PX;
  276. }
  277. }
  278. .file_box_btn{
  279. text-align: center;
  280. color: #1CB8B1;
  281. margin-left: auto;
  282. }
  283. }
  284. .now_dress{
  285. font-size: 0.35rem;
  286. background: url('../../../../static/images/lawEnforcement/icon/task_icon_02.png') no-repeat left center;
  287. padding-left: 20PX;
  288. line-height: 35PX;
  289. }
  290. .submitButton{
  291. width: 25vw;
  292. background-image: linear-gradient(to right, #2E79E9 , #77A6EF);
  293. text-align: center;
  294. color: #ffffff;
  295. height: 25vw;
  296. line-height: 70px;
  297. border-radius: 100%;
  298. position: absolute;
  299. bottom: 5%;
  300. left: 50%;
  301. transform: translateX(-50%);
  302. p{
  303. font-size: 0.4rem;
  304. line-height: 1;
  305. margin-top: 3vw;
  306. }
  307. .datetime{
  308. margin-top: 6vw;
  309. /*font-weight: bold;*/
  310. font-size: 0.6rem;
  311. }
  312. }
  313. </style>