1 line
14 KiB
Plaintext
1 line
14 KiB
Plaintext
{"version":3,"sources":["uni-app:///main.js","webpack:///D:/Lee/工地打卡小程序/building-sign/pagesA/overtimeEdit/overtimeEdit.vue?47d2","webpack:///D:/Lee/工地打卡小程序/building-sign/pagesA/overtimeEdit/overtimeEdit.vue?8796","webpack:///D:/Lee/工地打卡小程序/building-sign/pagesA/overtimeEdit/overtimeEdit.vue?cf8b","webpack:///D:/Lee/工地打卡小程序/building-sign/pagesA/overtimeEdit/overtimeEdit.vue?b276","uni-app:///pagesA/overtimeEdit/overtimeEdit.vue"],"names":["wx","__webpack_require_UNI_MP_PLUGIN__","__webpack_require__","createPage","Page","year","month","day","components","tabbar","data","statusHeight","userType","worksiteList","worksiteIndex","timeList","timeIndex","remarks","date","format","startDate","endDate","flag","isLoding","id","overtimeDetail","onLoad","onShareAppMessage","title","path","imageUrl","methods","getOvertimeDetail","console","getWorksiteList","getTimeList","timeArr","editEv","time","worksite_id","setTimeout","uni","delta","delEv","bindWorksiteChange","bindDateChange","bindTimeChange"],"mappings":";;;;;;;;;;;;;AAAA;AAGA;AACA;AAHA;AACAA,EAAE,CAACC,iCAAiC,GAAGC,mBAAmB;AAG1DC,UAAU,CAACC,qBAAI,CAAC,C;;;;;;;;;;;;;ACLhB;AAAA;AAAA;AAAA;AAAA;AAAqI;AACrI;AACgE;AACL;;;AAG3D;AACgL;AAChL,gBAAgB,uLAAU;AAC1B,EAAE,kFAAM;AACR,EAAE,mGAAM;AACR,EAAE,4GAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,uGAAU;AACZ;AACA;;AAEA;AACe,gF;;;;;;;;;;;;ACtBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA,aAAa,oMAEN;AACP,KAAK;AACL;AACA,aAAa,kOAEN;AACP,KAAK;AACL;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACnDA;AAAA;AAAA;AAAA;AAA0qB,CAAgB,wqBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;ACqD9rB;EACA;EACA;EACA;EACA;EACA;IACAC;EACA;IACAA;EACA;EACAC;EACAC;EACA;AACA;AAAA,eACA;EACAC;IACAC;EACA;EACAC;IACA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;QACAC;MACA;MACAC;MACAC;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;IACA;EACA;EACAC;IACA;MACA;IACA;IACA;IACA;IACA;IACA;EACA;EACAC;IACA;MACAC;MACAC;MACAC;IACA;IACA;IACA;EACA;EACAC;IACA;IACAC;MAAA;MACA;QAAAR;MAAA;QACA;UACAS;UACA;UACA;YAAA;UAAA;UACA;YAAA;UAAA;UACA;QACA;MACA;IACA;IAEA;IACAC;MAAA;MACA;QACA;UACA;UACA;QACA;MACA;IACA;IAEA;IACAC;MACA;MACA;QACAC;MACA;MACA;MACA;MACA;IACA;IAEA;IACAC;MAAA;MACA;QACA;QACA;UACA9B;UACA+B;UACAC;UACAtB;UACAO;QACA;QACA;UACA;YACA;YACAgB;cACAC;gBACAC;cACA;YACA;UACA;YACA;UACA;UACAF;YACA;UACA;QACA;MACA;IACA;IAEA;IACAG;MAAA;MACA;QAAAnB;MAAA;QACA;UACA;UACAgB;YACAC;cACAC;YACA;UACA;QACA;UACA;QACA;MACA;IACA;IAEA;IACAE;MACA;IACA;IAEA;IACAC;MACA;IACA;IAEA;IACAC;MACA;IACA;EACA;AACA;AAAA,2B","file":"pagesA/overtimeEdit/overtimeEdit.js","sourcesContent":["import 'uni-pages';\n// @ts-ignore\nwx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;\nimport Vue from 'vue'\nimport Page from './pagesA/overtimeEdit/overtimeEdit.vue'\ncreatePage(Page)","import { render, staticRenderFns, recyclableRender, components } from \"./overtimeEdit.vue?vue&type=template&id=74c4b20b&scoped=true&\"\nvar renderjs\nimport script from \"./overtimeEdit.vue?vue&type=script&lang=js&\"\nexport * from \"./overtimeEdit.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"74c4b20b\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"pagesA/overtimeEdit/overtimeEdit.vue\"\nexport default component.exports","export * from \"-!../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--16-0!../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./overtimeEdit.vue?vue&type=template&id=74c4b20b&scoped=true&\"","var components\ntry {\n components = {\n statusNav: function () {\n return import(\n /* webpackChunkName: \"components/status-nav/status-nav\" */ \"@/components/status-nav/status-nav.vue\"\n )\n },\n tabbar: function () {\n return import(\n /* webpackChunkName: \"components/tabbar/tabbar\" */ \"@/components/tabbar/tabbar.vue\"\n )\n },\n }\n} catch (e) {\n if (\n e.message.indexOf(\"Cannot find module\") !== -1 &&\n e.message.indexOf(\".vue\") !== -1\n ) {\n console.error(e.message)\n console.error(\"1. 排查组件名称拼写是否正确\")\n console.error(\n \"2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom\"\n )\n console.error(\n \"3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件\"\n )\n } else {\n throw e\n }\n}\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n var g0 = _vm.isLoding ? _vm.date.split(\"-\") : null\n var g1 = _vm.isLoding ? _vm.date.split(\"-\") : null\n var g2 = _vm.isLoding ? _vm.date.split(\"-\") : null\n _vm.$mp.data = Object.assign(\n {},\n {\n $root: {\n g0: g0,\n g1: g1,\n g2: g2,\n },\n }\n )\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./overtimeEdit.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./overtimeEdit.vue?vue&type=script&lang=js&\"","<template>\n\t<view class=\"pad-x120\">\r\n\t\t<!-- 头部 -->\n\t\t<status-nav navBarTitle=\"编辑加班\"></status-nav>\r\n\t\t<view class=\"content\" :style=\"{'padding-top':statusHeight+50+'px'}\" v-if=\"isLoding\">\r\n\t\t\t<view class=\"overtime-from font26\">\r\n\t\t\t\t<view class=\"item\">\r\n\t\t\t\t\t<view class=\"title\">工地</view>\r\n\t\t\t\t\t<picker class=\"input\" mode=\"selector\" :range=\"worksiteList\" @change=\"bindWorksiteChange\" :value=\"worksiteIndex\" :range-key=\"'name'\">\r\n\t\t\t\t\t\t<view class=\"name\">\r\n\t\t\t\t\t\t\t<text>{{worksiteList[worksiteIndex].name}}</text>\r\n\t\t\t\t\t\t\t<image src=\"/static/icon/icon-arrow-02.png\" mode=\"aspectFit\"></image>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</picker>\r\n\t\t\t\t</view>\r\n\t\t\t\t<view class=\"item\">\r\n\t\t\t\t\t<view class=\"title\">日期</view>\r\n\t\t\t\t\t<picker class=\"input\" mode=\"date\" :range=\"date\" @change=\"bindDateChange\" :start=\"startDate\" :end=\"endDate\">\r\n\t\t\t\t\t\t<view class=\"name\">\r\n\t\t\t\t\t\t\t<text>{{date.split('-')[0]+'年'+date.split('-')[1]+'月'+date.split('-')[2]+'日'}}</text>\r\n\t\t\t\t\t\t\t<image src=\"/static/icon/icon-arrow-02.png\" mode=\"aspectFit\"></image>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</picker>\r\n\t\t\t\t</view>\r\n\t\t\t\t<view class=\"item\">\r\n\t\t\t\t\t<view class=\"title\">加班时长</view>\r\n\t\t\t\t\t<view class=\"time-input\">\r\n\t\t\t\t\t\t<picker class=\"input\" mode=\"selector\" :range=\"timeList\" @change=\"bindTimeChange\" :value=\"timeIndex\">\r\n\t\t\t\t\t\t\t<view class=\"name\">\r\n\t\t\t\t\t\t\t\t<text>{{timeList[timeIndex]}}</text>\r\n\t\t\t\t\t\t\t\t<image src=\"/static/icon/icon-arrow-02.png\" mode=\"aspectFit\"></image>\r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t</picker>\r\n\t\t\t\t\t\t<view class=\"unit font24\">小时</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t\t<view class=\"item\">\r\n\t\t\t\t\t<view class=\"title\">备注</view>\r\n\t\t\t\t\t<textarea class=\"input textarea\" v-model=\"remarks\"></textarea>\r\n\t\t\t\t</view>\r\n\t\t\t\t<!-- 审核按钮 -->\r\n\t\t\t\t<view class=\"enter-detail-btns color-white font30\" style=\"margin: 0;\">\r\n\t\t\t\t\t<view class=\"btn\" @tap=\"editEv\">确认</view>\r\n\t\t\t\t\t<view class=\"btn\" @tap=\"delEv\">删除</view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t\t<!-- 尾部 -->\n\t\t<tabbar :userType=\"userType\" current=\"2\"></tabbar>\n\t</view>\n</template>\n<script>\r\n\timport tabbar from '@/components/tabbar/tabbar';\r\n\tfunction getDate(type) {\r\n\t const date = new Date();\r\n\t let year = date.getFullYear();\r\n\t let month = date.getMonth() + 1;\r\n\t let day = date.getDate();\r\n\t if (type === 'start') {\r\n\t year = year - 10;\r\n\t } else if (type === 'end') {\r\n\t year = year + 10;\r\n\t }\r\n\t month = month > 9 ? month : '0' + month;\r\n\t day = day > 9 ? day : '0' + day;\r\n\t return `${year}-${month}-${day}`;\r\n\t}\n\texport default {\n\t\tcomponents:{\r\n\t\t\ttabbar\n\t\t},\n\t\tdata() {\n\t\t\treturn {\r\n\t\t\t\tstatusHeight:uni.getSystemInfoSync().statusBarHeight, //状态栏高度\r\n\t\t\t\tuserType:'worker', //账户类型 工人:worker 负责人:director\r\n\t\t\t\tworksiteList:[], //工地列表\r\n\t\t\t\tworksiteIndex:0, //当前选择\r\n\t\t\t\ttimeList:[], //加班时长列表\r\n\t\t\t\ttimeIndex:0, //当前选择\r\n\t\t\t\tremarks:'', //备注\r\n\t\t\t\tdate: getDate({\r\n\t\t\t\t\tformat: true\r\n\t\t\t\t}),\r\n\t\t\t\tstartDate: getDate('start'),\r\n\t\t\t\tendDate: getDate('end'),\r\n\t\t\t\tflag:true, //是否允许提交\r\n\t\t\t\tisLoding:false, //是否加载完成\r\n\t\t\t\tid:0, //加班id\r\n\t\t\t\tovertimeDetail:{}, //加班详情\r\n\t\t\t}\n\t\t},\r\n\t\tonLoad(op) {\r\n\t\t\tif(op.id){\r\n\t\t\t\tthis.id = op.id;\r\n\t\t\t}\r\n\t\t\t// 获取工地列表\r\n\t\t\tthis.getWorksiteList();\r\n\t\t\t// 获取加班时间\r\n\t\t\tthis.getTimeList();\r\n\t\t},\r\n\t\tonShareAppMessage(res) {\r\n\t\t\tlet shareObj = {\r\n\t\t\t\ttitle:'工地打卡',\r\n\t\t\t\tpath: '/pages/pagehome/pagehome',\r\n\t\t\t\timageUrl:'/static/share-logo.jpg',\r\n\t\t\t}\r\n\t\t\t// 返回shareObj\r\n\t\t\treturn shareObj;\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\t// 获取工地列表\r\n\t\t\tgetOvertimeDetail(){\r\n\t\t\t\tthis.$requst.get('/api/v1/common/overtime-info',{id:this.id}).then(res=>{\r\n\t\t\t\t\tif(res.code==0){\r\n\t\t\t\t\t\tconsole.log(res,'加班详情');\r\n\t\t\t\t\t\tthis.remarks = res.data.remarks;\r\n\t\t\t\t\t\tthis.worksiteIndex = this.worksiteList.findIndex(item=> item.id === parseFloat(res.data.worksite_id));\r\n\t\t\t\t\t\tthis.timeIndex = this.timeList.findIndex(item=> item === parseFloat(res.data.time));\r\n\t\t\t\t\t\tthis.date = res.data.day_text;\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 获取工地列表\r\n\t\t\tgetWorksiteList(){\r\n\t\t\t\tthis.$requst.get('/api/v1/common/worksite-list').then(res=>{\r\n\t\t\t\t\tif(res.code==0){\r\n\t\t\t\t\t\tthis.worksiteList = res.data.list;\r\n\t\t\t\t\t\tthis.isLoding = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 获取加班时间\r\n\t\t\tgetTimeList(){\r\n\t\t\t\tlet timeArr = [];\r\n\t\t\t\tfor(let i=1;i<=48;i++){\r\n\t\t\t\t\ttimeArr.push(i-0.5,i)\r\n\t\t\t\t}\r\n\t\t\t\tthis.timeList = timeArr;\r\n\t\t\t\t// 获取加班详情\r\n\t\t\t\tthis.getOvertimeDetail();\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 编辑\r\n\t\t\teditEv(){\r\n\t\t\t\tif(this.flag){\r\n\t\t\t\t\tthis.flag = false;\r\n\t\t\t\t\tlet params = {\r\n\t\t\t\t\t\tday:this.date,\r\n\t\t\t\t\t\ttime:this.timeList[this.timeIndex],\r\n\t\t\t\t\t\tworksite_id:this.worksiteList[this.worksiteIndex].id,\r\n\t\t\t\t\t\tremarks:this.remarks,\r\n\t\t\t\t\t\tid:this.id\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.$requst.post('/api/v1/worker/overtime-edit',params).then(res=>{\r\n\t\t\t\t\t\tif(res.code==0){\r\n\t\t\t\t\t\t\tthis.$toolAll.tools.showToast('编辑成功');\r\n\t\t\t\t\t\t\tsetTimeout(()=>{\r\n\t\t\t\t\t\t\t\tuni.navigateBack({\r\n\t\t\t\t\t\t\t\t\tdelta: 1,\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t},1000)\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.$toolAll.tools.showToast(res.msg);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tsetTimeout(()=>{\r\n\t\t\t\t\t\t\tthis.flag = true;\r\n\t\t\t\t\t\t},2000)\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 删除\r\n\t\t\tdelEv(){\r\n\t\t\t\tthis.$requst.post('/api/v1/worker/overtime-del',{id:this.id}).then(res=>{\r\n\t\t\t\t\tif(res.code==0){\r\n\t\t\t\t\t\tthis.$toolAll.tools.showToast('删除成功');\r\n\t\t\t\t\t\tsetTimeout(()=>{\r\n\t\t\t\t\t\t\tuni.navigateBack({\r\n\t\t\t\t\t\t\t\tdelta: 1,\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t},1000)\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.$toolAll.tools.showToast(res.msg);\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 选择工地\r\n\t\t\tbindWorksiteChange(e) {\r\n\t\t\t\tthis.worksiteIndex = e.detail.value;\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 选择日期\r\n\t\t\tbindDateChange(e) {\r\n\t\t\t\tthis.date = e.detail.value;\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 选择加班时长\r\n\t\t\tbindTimeChange(e) {\r\n\t\t\t\tthis.timeIndex = e.detail.value;\r\n\t\t\t}\r\n\t\t}\n\t}\n</script>\n<style scoped>\r\n\t\n</style>"],"sourceRoot":""} |