WeldingOperations.vue 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001
  1. <template>
  2. <view style="position: relative;" v-show="isShow">
  3. <form @submit="onSubmit">
  4. <scroll-view scroll-y class="container">
  5. <div class="helpBox">
  6. <semp-notice-bar scrollable showType="slider" icon="sound" setIconColor="#eb9064" round bgColor="#fff" iconSize="40" textFontSize="36rpx" :strText="helpTips" @tap="onOperateIllustrateTo"></semp-notice-bar>
  7. </div>
  8. <view class="formBox">
  9. <view class="hiddenDangerBox">
  10. <view class="hiddenDangerItemBox workBox" style="margin-top: 0px;">
  11. <view class="hiddenDangerHeader">申报信息</view>
  12. <view class="hiddenDangerBody">
  13. <view class="fway-form-item">
  14. <view class="fway-form-lable"><text class="mustTips">*</text>作业类型</view>
  15. <view class="fway-form-input-select">
  16. <radio-group @change="bindWorkTypeChange">
  17. <label class="fway-form-radioBox" style="margin-right: 0;" v-for="(item, index) in WorkTypeData" :key="index">
  18. <radio style="transform:scale(1)" color="#3e6ffd" :value="item.dicDataValue"></radio>{{item.dicDataName}}
  19. </label>
  20. </radio-group>
  21. </view>
  22. </view>
  23. <view class="fway-form-item" v-show="data.jobType == '1'">
  24. <view class="fway-form-lable" style="width: 320rpx;"><text class="mustTips">*</text>购气单位/个人名称</view>
  25. <view class="fway-form-input-inline" style="width: calc(100% - 350rpx);">
  26. <input type="text" class="fway-form-input" placeholder="请填写名称" v-model="data.companyName" @tap="inputTap" data-focus="companyName" :focus="focusID == 'companyName' ? true : false" />
  27. </view>
  28. </view>
  29. <view class="fway-form-item">
  30. <view class="fway-form-lable" style="width: 330rpx;"><text class="mustTips">*</text>经营单位类别(甲方)</view>
  31. <view class="fway-form-input-select" style="width: calc(100% - 360rpx);">
  32. <radio-group @change="bindUnitTypeChange">
  33. <label class="fway-form-checkbox" style="margin-right: 0;" v-for="(item, index) in UnitTypeData" :key="index">
  34. <radio style="transform:scale(1);" color="#3e6ffd" :value="item.dicDataName"></radio>{{item.dicDataName}}
  35. </label>
  36. </radio-group>
  37. </view>
  38. </view>
  39. <view class="fway-form-item">
  40. <view class="fway-form-lable"><text class="mustTips">*</text>作业场所</view>
  41. <view class="fway-form-input-select">
  42. <picker mode="selector" placeholder="请选择作业所属场所" :range="PlaceData" :value="indexPlace" @change="bindPlaceChange" range-key="dicDataName">
  43. <view class="fway-form-input" :class="indexPlace == -1 ? 'fway-form-place' : ''">
  44. {{ indexPlace == -1 ? '请选择作业所属场所' : PlaceData[indexPlace].dicDataName }}
  45. </view>
  46. </picker>
  47. <image class="fway-form-selectImg" mode="aspectFill" src="/static/img/common/selectImg.png"></image>
  48. </view>
  49. </view>
  50. <view class="fway-form-item">
  51. <view class="fway-form-lable"><text class="mustTips">*</text>场所名称</view>
  52. <view class="fway-form-input-select">
  53. <picker mode="selector" placeholder="请选择场所名称" :range="FirstPlaceNameData" :value="indexFirstPlaceName" @change="bindFirstPlaceNameChange" range-key="dicDataName">
  54. <view class="fway-form-input" :class="indexFirstPlaceName == -1 ? 'fway-form-place' : ''">
  55. {{ indexFirstPlaceName == -1 ? '请选择场所名称' : FirstPlaceNameData[indexFirstPlaceName].dicDataName }}
  56. </view>
  57. </picker>
  58. <image class="fway-form-selectImg" mode="aspectFill" src="/static/img/common/selectImg.png"></image>
  59. </view>
  60. </view>
  61. <view class="fway-form-item" v-show="indexFirstPlaceName != -1">
  62. <view class="fway-form-lable" style="width: 230rpx;"><text class="mustTips">*</text>子类场所名称</view>
  63. <view class="fway-form-input-select" style="width: calc(100% - 260rpx);">
  64. <picker mode="selector" placeholder="请选择子类场所名称" :range="SecondPlaceNameData" :value="indexSecondPlaceName" @change="bindSecondPlaceNameChange" range-key="dicDataName">
  65. <view class="fway-form-input" :class="indexSecondPlaceName == -1 ? 'fway-form-place' : ''">
  66. {{ indexSecondPlaceName == -1 ? '请选择子类场所名称' : SecondPlaceNameData[indexSecondPlaceName].dicDataName }}
  67. </view>
  68. </picker>
  69. <image class="fway-form-selectImg" mode="aspectFill" src="/static/img/common/selectImg.png"></image>
  70. </view>
  71. </view>
  72. <view class="fway-form-item">
  73. <view class="fway-form-lable"><text class="mustTips">*</text>作业区域</view>
  74. <view class="fway-form-input-select">
  75. <picker mode="multiSelector" placeholder="请选择施工作业地所在区域" :range="AreaData" :value="indexArea" @columnchange="bindAreaColChange" @change="bindAreaChange" range-key="areaName">
  76. <view class="fway-form-input" :class="selectAreaName == '' ? 'fway-form-place' : ''">
  77. {{ selectAreaName == '' ? '请选择施工作业地所在区域' : selectAreaName }}
  78. </view>
  79. </picker>
  80. <image class="fway-form-selectImg" mode="aspectFill" src="/static/img/common/selectImg.png"></image>
  81. </view>
  82. </view>
  83. <view class="fway-form-item">
  84. <view class="fway-form-lable"><text class="mustTips">*</text>作业地点</view>
  85. <view class="fway-form-input-inline">
  86. <view class="fway-form-input-inline" @tap="onMapTo" style="width: 100%;">
  87. <input type="text" disabled class="fway-form-input" placeholder="请准确标记施工作业地具体位置" v-model="data.address" />
  88. </view>
  89. <view class="fway-form-input-inline" v-if="data.address" style="width: 100%;">
  90. <input type="text" class="fway-form-input" placeholder="请填写详细地址" v-model="data.fullAddress" @tap="inputTap" data-focus="fullAddress" :focus="focusID == 'fullAddress' ? true : false" maxlength="100" />
  91. </view>
  92. </view>
  93. </view>
  94. <view class="fway-form-item">
  95. <view class="fway-form-lable"><text class="mustTips">*</text>作业时间</view>
  96. <view class="fway-form-input-select">
  97. <uni-datetime-picker type="datetime" placeholder="请选择作业开始时间" :start="minDateTime" :end="maxDateTime" v-model="data.startWorkTime" :border="true" :clear-icon="false" @change="bindStartTimeChange" @changeStatus="bindWorkTimeChangeStatus" hide-second="false" />
  98. </view>
  99. </view>
  100. <view class="fway-form-item" v-if="isShowEndTime">
  101. <view class="fway-form-lable"></view>
  102. <view class="fway-form-input-select">
  103. <uni-datetime-picker type="datetime" placeholder="请选择作业结束时间" :start="endMinDateTime" :end="endMaxDateTime" v-model="data.endWorkTime" :border="true" :clear-icon="false" @change="bindEndTimeChange" @changeStatus="bindWorkTimeChangeStatus" hide-second="false" />
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. <view class="hiddenDangerItemBox reportPersonBox">
  109. <view class="hiddenDangerHeader">申报人信息</view>
  110. <view class="hiddenDangerBody">
  111. <view class="hiddenDangerItem" style="margin-bottom: 0;">
  112. <view class="hiddenDangerItemBody">
  113. <view class="fway-form-item">
  114. <view class="fway-form-lable"><text class="mustTips">*</text>姓名</view>
  115. <view class="fway-form-input-inline">
  116. <input type="text" class="fway-form-input" placeholder="请录入申报人姓名" v-model="data.name" @tap="inputTap" data-focus="name" :focus="focusID == 'name' ? true : false" maxlength="20" />
  117. </view>
  118. </view>
  119. <view class="fway-form-item">
  120. <view class="fway-form-lable"><text class="mustTips">*</text>联系方式</view>
  121. <view class="fway-form-input-inline">
  122. <input type="number" class="fway-form-input" placeholder="请录入申报人的联系电话" v-model="data.phoneNumber" @tap="inputTap" data-focus="phoneNumber" :focus="focusID == 'phoneNumber' ? true : false" />
  123. </view>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. <view class="tipsBox">
  130. <view class="tipsHeader">作业票模板下载</view>
  131. <view class="tipsBody">
  132. <view class="tipsItem" v-for="(item, index) in downloadFileList" :key="index">
  133. <image class="tipsItemImg" src="../../static/img/write/doc.png"></image>
  134. <text class="tipsItemText">{{item.name}}</text>
  135. <view class="tipsItemBtn" @tap="toDownloadFile(item.src)">
  136. <text class="tipsItemBtnText">下载</text>
  137. <image class="tipsItemBtnImg" src="../../static/img/write/yun.png"></image>
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. <view class="remarkBox">
  143. <view class="remarkHeader">备注:</view>
  144. <view class="remarkBody">
  145. <view class="remarkItem">1.请提前24小时完成电气焊作业申报。</view>
  146. <view class="remarkItem">2.24小时内紧急作业(应急抢险等)请拨打12345政务服务热线申报。</view>
  147. </view>
  148. </view>
  149. </view>
  150. </view>
  151. </scroll-view>
  152. <view class="fway-btnBox" v-show="isShowFormBtn">
  153. <button class="fway-btn" formType="submit">立即上报</button>
  154. </view>
  155. </form>
  156. </view>
  157. </template>
  158. <script>
  159. var qqMap = require('@/static/js/qqmap-wx-jssdk.min.js');
  160. var qqMapsdk;
  161. var that;
  162. export default {
  163. data() {
  164. return {
  165. isShow: false,
  166. data: {
  167. longitude: '',
  168. latitude: '',
  169. areaCode: '',
  170. province: '',
  171. city: '',
  172. county: '',
  173. town: '',
  174. street: '',
  175. address: '',
  176. fullAddress: '',
  177. industryId: '',
  178. jobType: '',
  179. businessUnitType: '',
  180. workplace: '',
  181. workplaceName: '',
  182. workArea: '',
  183. workAreaId: '',
  184. startWorkTime: '',
  185. endWorkTime: '',
  186. name: '',
  187. phoneNumber: '',
  188. isSecret: false,
  189. description: '',
  190. companyName: '',
  191. files: []
  192. },
  193. // 作业类型
  194. WorkTypeData: [],
  195. // 经营单位类别
  196. UnitTypeData: [],
  197. // 作业场所
  198. indexPlace: -1,
  199. PlaceData: [],
  200. // 场所名称
  201. indexFirstPlaceName: -1,
  202. FirstPlaceNameData: [],
  203. indexSecondPlaceName: -1,
  204. SecondPlaceNameData: [],
  205. // 作业区域
  206. selectAllAreaData: [],
  207. AreaData: [],
  208. indexArea: [-1, -1],
  209. selectAreaName: '',
  210. // 作业时间
  211. minDateTime:'',// 开始时间范围最小时间
  212. maxDateTime:'',// 开始时间范围最大时间
  213. isShowEndTime:false,// 是否显示结束时间
  214. endMinDateTime:'',// 结束时间最小时间
  215. endMaxDateTime: '', // 结束时间最大时间
  216. isShowFormBtn: true,
  217. helpID: '',
  218. helpTips: '',
  219. focusID: '',
  220. fileSize: 10, // 单位M
  221. downloadFileList: [
  222. {name: '气割动火安全作业票(个体)', src: 'https://www.zgsafesp.cn/doc/气割动火安全作业票(个体).docx'},
  223. {name: '气割动火安全作业票(企业)', src: 'https://www.zgsafesp.cn/doc/气割动火安全作业票(企业).docx'},
  224. {name: '电焊动火安全作业票(个体)', src: 'https://www.zgsafesp.cn/doc/电焊动火安全作业票(个体).docx'},
  225. {name: '电焊动火安全作业票(企业)', src: 'https://www.zgsafesp.cn/doc/电焊动火安全作业票(企业).docx'}
  226. ]
  227. }
  228. },
  229. onLoad(option) {
  230. that = this;
  231. that.data.industryId = decodeURIComponent(option.id);
  232. qqMapsdk = new qqMap({
  233. key: 'TE4BZ-ZFEAT-45CX3-VPZ3R-GOLS6-EGF54'
  234. });
  235. that.onGetBaseData(function(){
  236. that.GetDateTime();
  237. that.isShow = true;
  238. });
  239. },
  240. onShow() {
  241. that.data.phoneNumber = that.data.phoneNumber ? that.data.phoneNumber : uni.getStorageSync('userInfo').userTel || '';
  242. that.data.name = that.data.name ? that.data.name : uni.getStorageSync('userInfo').userName || '';
  243. },
  244. methods: {
  245. // 获取初始化数据
  246. onGetBaseData(fun){
  247. that.$admin.req({
  248. method: 'GET',
  249. url: '/api/v1/Snapshot/industry/base/' + that.data.industryId
  250. }).then(res => {
  251. if (res) {
  252. that.helpID = res.bulletinId;
  253. that.helpTips = res.industry.txtHelpRemarks || '填报有疑问?点击查看更详细的操作指引';
  254. // 作业类型数据
  255. that.WorkTypeData = res.jobType;
  256. // 经营单位类别
  257. that.UnitTypeData = res.businessUnitType;
  258. // 作业场所
  259. that.PlaceData = res.workplace;
  260. // 场所名称集合
  261. that.FirstPlaceNameData = res.workplaceName;
  262. // 区域集合
  263. that.selectAllAreaData = res.areaTree;
  264. that.AreaData[0] = that.selectAllAreaData;
  265. that.AreaData[1] = that.selectAllAreaData[0].children;
  266. } else {
  267. that.$util.msg('服务异常,请稍后重试!');
  268. }
  269. typeof fun === 'function' && fun();
  270. })
  271. },
  272. // 获取时间范围时间戳
  273. GetDateTime(){
  274. // 获取当前时间
  275. let nowDate = new Date().getTime();
  276. // 开始时间取值范围为,当前时间24小时后,72小时中
  277. that.minDateTime = nowDate + 24 * 60 * 60 *1000;
  278. that.maxDateTime = nowDate + 72 * 60 * 60 *1000;
  279. that.endMinDateTime = that.minDateTime;
  280. that.endMaxDateTime = that.maxDateTime;
  281. },
  282. // 作业类型下拉选择
  283. bindWorkTypeChange(e){
  284. if (e.detail.value){
  285. that.data.jobType = e.detail.value;
  286. }
  287. },
  288. // 经营单位
  289. bindUnitTypeChange(e){
  290. if (e.detail.value){
  291. that.data.businessUnitType = e.detail.value;
  292. }
  293. },
  294. // 作业场所
  295. bindPlaceChange(e){
  296. if (e.detail.value){
  297. that.indexPlace = e.detail.value
  298. }
  299. },
  300. // 场所名称
  301. bindFirstPlaceNameChange(e){
  302. if (e.detail.value){
  303. that.indexFirstPlaceName = e.detail.value;
  304. // 第二级数据
  305. that.SecondPlaceNameData = [];
  306. that.indexSecondPlaceName = -1;
  307. let firstObj = that.FirstPlaceNameData[that.indexFirstPlaceName];
  308. that.SecondPlaceNameData = firstObj.children
  309. }
  310. },
  311. bindSecondPlaceNameChange(e){
  312. if (e.detail.value){
  313. that.indexSecondPlaceName = e.detail.value;
  314. }
  315. },
  316. // 作业区域
  317. bindAreaColChange(e) {
  318. if (e.detail.column == 0){
  319. // 选择第一列
  320. that.indexArea[1] = -1;
  321. that.AreaData[1] = [];
  322. that.indexArea[0] = e.detail.value;
  323. that.selectAreaName = that.AreaData[0][that.indexArea[0]].areaName;
  324. if (e.detail.value != -1) {
  325. // 构建二级分类数据
  326. that.AreaData[1] = that.AreaData[0][that.indexArea[0]].children
  327. that.$forceUpdate()
  328. }
  329. }else if (e.detail.column == 1) {
  330. // 选择第二列
  331. if (that.indexArea[0] != -1){
  332. that.indexArea[1] = e.detail.value;
  333. that.selectAreaName = that.AreaData[0][that.indexArea[0]].areaName + '-' + that.AreaData[1][that.indexArea[1]].areaName;
  334. }
  335. }
  336. },
  337. bindAreaChange(e){
  338. that.indexArea[0] = e.detail.value[0];
  339. that.indexArea[1] = e.detail.value[1];
  340. if (that.indexArea[0] != -1){
  341. that.selectAreaName = that.AreaData[0][that.indexArea[0]].areaName;
  342. if (that.indexArea[1] != -1){
  343. that.selectAreaName += that.AreaData[1][that.indexArea[1]].areaName;
  344. }
  345. }
  346. },
  347. // 验证地理位置是否在自贡市
  348. onGetAddress(latitude, longitude, fun) {
  349. qqMapsdk.reverseGeocoder({
  350. location: {
  351. latitude: latitude,
  352. longitude: longitude
  353. },
  354. success(res) {
  355. // 地址信息
  356. if (res.result.address_component.city != '自贡市') {
  357. typeof fun === 'function' && fun(false);
  358. } else {
  359. typeof fun === 'function' && fun(res.result);
  360. }
  361. },
  362. fail: function(error) {
  363. console.error(error);
  364. typeof fun === 'function' && fun(false);
  365. }
  366. });
  367. },
  368. onMapTo() {
  369. // 判断微信位置是否开启
  370. let appAuthorizeSetting = uni.getAppAuthorizeSetting();
  371. if (appAuthorizeSetting.locationAuthorized != 'authorized') {
  372. that.$util.msg("定位失败,请在手机设置中打开微信位置权限");
  373. return;
  374. }
  375. that.$util.msg("标记地点请与作业区域选择一致", function(){
  376. uni.chooseLocation({
  377. success: function(res) {
  378. if (res.name) {
  379. that.onGetAddress(res.latitude, res.longitude, function(data) {
  380. if (data) {
  381. that.data.longitude = res.longitude;
  382. that.data.latitude = res.latitude;
  383. that.data.areaCode = data.ad_info.adcode;
  384. that.data.province = data.address_component.province;
  385. that.data.city = data.address_component.city;
  386. that.data.county = data.address_component.district;
  387. that.data.town = data.address_reference.town.title;
  388. that.data.street = data.address_component.street;
  389. // that.data.address = data.address;
  390. if (res.address) {
  391. let address = res.address;
  392. try {
  393. address = address.replace('四川省自贡市', '');
  394. that.data.address = res.name + '(' + address + ')';
  395. } catch (d) {
  396. that.data.address = res.name + '(' + address + ')';
  397. }
  398. } else {
  399. that.data.address = res.name;
  400. }
  401. } else {
  402. that.$util.msg("选择的地点不属于自贡市行政管辖范围,请重新确认作业地点");
  403. }
  404. })
  405. } else {
  406. that.$util.msg("作业地点定位失败,请重新选择");
  407. }
  408. },
  409. fail() {
  410. that.$util.msg("作业地点定位失败,请重新选择");
  411. }
  412. });
  413. });
  414. },
  415. bindWorkTimeChangeStatus(status){
  416. that.isShowFormBtn = !status;
  417. },
  418. // 开始时间选择
  419. bindStartTimeChange(e){
  420. that.data.startWorkTime = e;
  421. that.data.endWorkTime = '';
  422. that.endMinDateTime = new Date(e + ':00').getTime();
  423. that.endMaxDateTime = new Date(e + ':00').getTime() + 72 * 60 * 60 *1000;
  424. that.isShowEndTime = true;
  425. },
  426. // 结束时间选择
  427. bindEndTimeChange(e){
  428. that.data.endWorkTime = e;
  429. },
  430. // 监听input框点击设置焦点
  431. inputTap(e) {
  432. if(that.focusID != e.currentTarget.dataset.focus){
  433. uni.hideKeyboard();
  434. setTimeout(function() {
  435. that.focusID = e.currentTarget.dataset.focus
  436. }, 200)
  437. }
  438. },
  439. // 操作指引
  440. onOperateIllustrateTo() {
  441. uni.navigateTo({
  442. url: '/pagesCare/Home/OperatingInstructions?helpID=' + encodeURIComponent(that.helpID)
  443. })
  444. },
  445. // 下载模板
  446. toDownloadFile(src){
  447. let startIndex = src.lastIndexOf("/") + 1;
  448. // 提取文件名
  449. let fileName = src.substring(startIndex);// 截取文件名称部分
  450. uni.downloadFile({
  451. url: src,
  452. filePath: uni.env.USER_DATA_PATH + "/" + fileName,
  453. success: (res) => {
  454. if (res.statusCode === 200) {
  455. uni.openDocument({
  456. filePath: res.filePath,
  457. showMenu: true,
  458. fail: () =>{
  459. that.$util.msg("文件打开失败!请稍后重试");
  460. }
  461. });
  462. }
  463. },
  464. fail: () =>{
  465. that.$util.msg("文件下载失败!请稍后重试");
  466. }
  467. });
  468. },
  469. // 表单验证
  470. formValidation() {
  471. if(!that.data.jobType){
  472. that.$util.msg("请选择作业类型!");
  473. return false;
  474. }
  475. if(that.data.jobType == '1' && !that.data.companyName){
  476. that.$util.msg("请填写购气单位/个人名称!");
  477. return false;
  478. }
  479. if(!that.data.businessUnitType){
  480. that.$util.msg("请选择经营单位类别!");
  481. return false;
  482. }
  483. if (that.indexPlace == -1) {
  484. that.$util.msg("请选择作业所属场所!");
  485. return false;
  486. }
  487. if (that.indexFirstPlaceName == -1) {
  488. that.$util.msg("请选择场所名称!");
  489. return false;
  490. }
  491. if (that.indexSecondPlaceName == -1) {
  492. that.$util.msg("请选择子类场所名称!");
  493. return false;
  494. }
  495. if (that.indexArea[0] == -1) {
  496. that.$util.msg("请选择作业所属区域!");
  497. return false;
  498. } else {
  499. if (that.AreaData[1].length > 0 && that.indexArea[1] == -1) {
  500. that.$util.msg("请选择作业所属区域!");
  501. return false;
  502. }
  503. }
  504. if (!that.data.startWorkTime || !that.data.endWorkTime) {
  505. that.$util.msg("请选择作业时间!");
  506. return false;
  507. } else {
  508. if(new Date(that.data.startWorkTime + ':00').getTime() >= new Date(that.data.endWorkTime + ':00').getTime()){
  509. that.$util.msg("作业开始时间不能大于结束时间!");
  510. return false;
  511. }
  512. if(that.minDateTime > new Date(that.data.startWorkTime + ':00').getTime()){
  513. that.data.startWorkTime = '';
  514. that.data.endWorkTime = '';
  515. that.isShowEndTime = false;
  516. that.$util.msg("需提前24小时完成作业申报!");
  517. return false;
  518. }
  519. }
  520. if (!that.data.address) {
  521. that.$util.msg("请选择作业地点!");
  522. return false;
  523. }
  524. if (that.data.fullAddress) {
  525. if (escape(that.data.fullAddress).indexOf("%u") == -1) {
  526. that.$util.msg("请输入正确的地址信息!");
  527. return false;
  528. }
  529. }
  530. if (!that.data.name) {
  531. that.$util.msg("请输入申报人姓名!");
  532. return false;
  533. }
  534. if (!that.data.phoneNumber) {
  535. that.$util.msg("请输入申报人手机号码!");
  536. return false;
  537. }
  538. if (that.$util.e_checkPhone(that.data.phoneNumber) === false) {
  539. that.$util.msg('申报人手机号码格式不正确!');
  540. return false;
  541. }
  542. if (that.data.isSecret == null) {
  543. that.$util.msg("请选择是否保密!");
  544. return false;
  545. }
  546. return true;
  547. },
  548. // 表单提交
  549. onSubmit(e) {
  550. if (!that.formValidation()) {
  551. return;
  552. }
  553. that.data.workplace = that.PlaceData[that.indexPlace].dicDataName;
  554. that.data.workplaceName = that.FirstPlaceNameData[that.indexFirstPlaceName].dicDataName + '-' + that.SecondPlaceNameData[that.indexSecondPlaceName].dicDataName;
  555. that.data.workArea = that.selectAreaName;
  556. that.data.workAreaId = that.AreaData[1][that.indexArea[1]].id;
  557. if(that.data.jobType != '1'){
  558. that.data.companyName = '';
  559. }
  560. let params = that.data;
  561. console.log(JSON.stringify(params))
  562. that.$admin.req({
  563. method: 'POST',
  564. url: '/api/v1/Snapshot/order',
  565. data: params
  566. }).then(res => {
  567. if (res) {
  568. if (res.no && res.password) {
  569. uni.showModal({
  570. title: "您的诉求已上报成功! ",
  571. content: '工单编号:' + res.no + '\r\n查询密码:' + res.password,
  572. showCancel: false,
  573. confirmText: '确定',
  574. confirmColor: '#3e6ffd',
  575. success: res => {
  576. let obj = uni.getStorageSync('userInfo');
  577. obj.userName = that.data.name;
  578. uni.setStorageSync('userInfo', obj);
  579. uni.switchTab({
  580. url: "/pages/Index/Mine"
  581. })
  582. }
  583. })
  584. } else {
  585. that.$util.msg(res.msg || "对不起,提交失败,请稍后重试!");
  586. }
  587. } else {
  588. that.$util.msg("对不起,提交失败,请稍后重试!");
  589. }
  590. });
  591. },
  592. }
  593. }
  594. </script>
  595. <style lang="less">
  596. .container {
  597. background-color: #f7f7f7;
  598. font-size: 0;
  599. }
  600. .helpBox {
  601. padding: 20rpx;
  602. }
  603. .formBox {
  604. margin: 0;
  605. padding-bottom: 140rpx;
  606. }
  607. .fway-btnBox{
  608. position: absolute;
  609. bottom: 0;
  610. width: 100%;
  611. padding: 20rpx 0 30rpx;
  612. background-color: #f7f7f7;
  613. z-index: 9;
  614. }
  615. .fway-btn{
  616. height: 80rpx;
  617. line-height: 80rpx;
  618. font-size: 40rpx;
  619. }
  620. .hiddenDangerBox {
  621. padding: 0 20rpx;
  622. }
  623. .hiddenDangerItemBox {
  624. padding: 0;
  625. background-color: #fff;
  626. margin-top: 20rpx;
  627. box-shadow: 0rpx 5rpx 12rpx 0rpx #c7c7c7;
  628. border-radius: 10rpx;
  629. }
  630. .hiddenDangerHeader {
  631. padding: 30rpx 20rpx 20rpx;
  632. font-size: 44rpx;
  633. font-weight: bold;
  634. color: #000;
  635. }
  636. .hiddenDangerBody {
  637. padding: 0 20rpx 10rpx;
  638. }
  639. .hiddenDangerItem {
  640. margin-bottom: 20rpx;
  641. }
  642. .hiddenDangerItemHeader {
  643. padding: 10rpx 0;
  644. display: flex;
  645. justify-content: left;
  646. align-items: center;
  647. }
  648. .mustTips {
  649. width: 30rpx;
  650. font-size: 40rpx;
  651. font-weight: bold;
  652. color: #fd0101;
  653. }
  654. .itemHeaderText {
  655. color: #000;
  656. font-size: 36rpx;
  657. }
  658. .itemHeaderTips {
  659. font-size: 28rpx;
  660. color: #777;
  661. }
  662. .hiddenDangerItemBody {
  663. padding: 0;
  664. }
  665. .hiddenDangerHeaderBtn {
  666. width: calc(100% - 288rpx);
  667. display: inline-block;
  668. vertical-align: middle;
  669. text-align: right;
  670. }
  671. .fway-form-item {
  672. padding: 0 10rpx;
  673. }
  674. .fway-form-textarea {
  675. width: calc(100% - 40rpx);
  676. padding: 20rpx;
  677. height: 180rpx;
  678. }
  679. .fway-form-tips {
  680. padding: 10rpx 0;
  681. }
  682. .workBox .fway-form-lable {
  683. width: 170rpx;
  684. font-size: 36rpx;
  685. }
  686. .workBox .lableTips{
  687. font-size: 28rpx;
  688. color: #777;
  689. }
  690. .workBox .fway-form-input-select {
  691. width: calc(100% - 200rpx);
  692. position: relative;
  693. }
  694. .workBox .fway-form-input-inline {
  695. width: calc(100% - 200rpx);
  696. position: relative;
  697. }
  698. .workBox .fway-form-input-select .fway-form-input {
  699. width: calc(100% - 60rpx);
  700. padding-right: 40rpx;
  701. }
  702. .workBox .fway-form-input-select .fway-form-selectImg{
  703. position: absolute;
  704. right: 10rpx;
  705. top: 34rpx;
  706. }
  707. .reportPersonBox .fway-form-item {
  708. border-bottom: 2rpx #eaeaea solid;
  709. }
  710. .reportPersonBox .fway-form-lable {
  711. padding: 10rpx 0;
  712. width: 200rpx;
  713. color: #777;
  714. font-size: 36rpx;
  715. }
  716. .reportPersonBox .fway-form-input-inline {
  717. width: calc(100% - 200rpx);
  718. padding: 10rpx 0 0;
  719. }
  720. .reportPersonBox .fway-form-input {
  721. background-color: #fff;
  722. }
  723. .fway-form-input {
  724. width: calc(100% - 40rpx);
  725. padding: 0 20rpx;
  726. height: 80rpx;
  727. line-height: 80rpx;
  728. font-size: 36rpx;
  729. }
  730. .fway-form-textarea {
  731. width: calc(100% - 40rpx);
  732. padding: 20rpx;
  733. height: 180rpx;
  734. font-size: 36rpx;
  735. line-height: 46rpx;
  736. }
  737. .fway-form-checkbox, .fway-form-radioBox{
  738. font-size: 36rpx;
  739. }
  740. .workBoxHeader{
  741. display: flex;
  742. justify-content: space-between;
  743. align-items: center;
  744. }
  745. .workBoxHeaderAdd{
  746. color: #3e6ffd;
  747. font-weight: normal;
  748. font-size: 32rpx;
  749. }
  750. .workPersonItem{
  751. border: 2rpx #c7c7c7 dotted;
  752. border-radius: 20rpx;
  753. margin-bottom: 20rpx;
  754. }
  755. .workPersonItemTitle{
  756. padding: 20rpx 30rpx 10rpx;
  757. font-size: 36rpx;
  758. font-weight: bold;
  759. color: #000;
  760. display: flex;
  761. justify-content: space-between;
  762. align-items: center;
  763. }
  764. .workPersonItemTitleDelete{
  765. color: #fd0101;
  766. font-weight: normal;
  767. font-size: 32rpx;
  768. }
  769. .workPersonItemBody{
  770. padding-bottom: 10rpx;
  771. }
  772. .chooseFileItem{
  773. padding: 0 0 0 10rpx;
  774. }
  775. .chooseFileItemHeader{
  776. display: flex;
  777. justify-content: space-between;
  778. align-items: center;
  779. height: 60rpx;
  780. line-height: 60rpx;
  781. font-size: 32rpx;
  782. }
  783. .chooseFileItemBtn{
  784. height: 50rpx;
  785. line-height: 50rpx;
  786. color: #FFFFFF;
  787. background-color: #3e6ffd;
  788. text-align: center;
  789. border-radius: 20rpx;
  790. padding: 0 40rpx;
  791. }
  792. .photoListBox {
  793. width: calc(100% - 20rpx);
  794. padding: 10rpx 0 20rpx;
  795. display: flex;
  796. justify-content: left;
  797. align-items: start;
  798. flex-wrap: wrap;
  799. align-content: start;
  800. }
  801. .photoItemBox {
  802. width: calc(25% - 20rpx);
  803. height: 130rpx;
  804. position: relative;
  805. border: 2rpx #E5E5E5 solid;
  806. border-radius: 10rpx;
  807. }
  808. .photoItemBox + .photoItemBox{
  809. margin-left: 20rpx;
  810. }
  811. .photoItemBox + .photoItemBoxsel{
  812. margin-left: 20rpx;
  813. }
  814. .photoItemBoxsel {
  815. width: calc(25% - 20rpx);
  816. height: 130rpx;
  817. position: relative;
  818. background-color: #f7f7f7;
  819. border-radius: 10rpx;
  820. display: flex;
  821. justify-content: center;
  822. align-items: center;
  823. }
  824. .photoItemImg {
  825. width: 100%;
  826. height: 100%;
  827. }
  828. .photoItemImgsel{
  829. width: 60rpx;
  830. height: 60rpx;
  831. }
  832. .closeBtn {
  833. background-color: #00000060;
  834. width: 30rpx;
  835. height: 30rpx;
  836. position: absolute;
  837. padding: 10rpx;
  838. top: 0;
  839. right: 0;
  840. }
  841. .fileListBox{
  842. padding: 20rpx 10rpx;
  843. }
  844. .fileItemBox{
  845. display: flex;
  846. justify-content: space-between;
  847. align-items: center;
  848. width: 100%;
  849. }
  850. .fileItemBox + .fileItemBox{
  851. margin-top: 20rpx;
  852. }
  853. .fileName{
  854. width: calc(100% - 70rpx);
  855. margin-right: 20rpx;
  856. white-space: nowrap;
  857. overflow: hidden;
  858. text-overflow: ellipsis;
  859. color: #53d4fc;
  860. font-size: 32rpx;
  861. }
  862. .fileDeleteBtn{
  863. width: 50rpx;
  864. height: 50rpx;
  865. }
  866. .tipsBox{
  867. background-color: #f7f7f7;
  868. margin-top: 20rpx;
  869. }
  870. .tipsHeader{
  871. padding: 30rpx 20rpx 10rpx;
  872. font-size: 44rpx;
  873. font-weight: bold;
  874. color: #000;
  875. }
  876. .tipsBody{
  877. padding: 0 20rpx 10rpx;
  878. }
  879. .tipsItem{
  880. display: flex;
  881. justify-content: space-between;
  882. align-items: center;
  883. border-bottom: 2rpx #d2d2d2 dashed;
  884. padding: 20rpx 0;
  885. }
  886. .tipsItemImg{
  887. width: 40rpx;
  888. height: 50rpx;
  889. margin-right: 20rpx;
  890. }
  891. .tipsItemText{
  892. width: calc(100% - 220rpx);
  893. font-size: 36rpx;
  894. white-space: nowrap;
  895. overflow: hidden;
  896. text-overflow: ellipsis;
  897. color: #000;
  898. }
  899. .tipsItemBtn{
  900. width: 160rpx;
  901. padding: 10rpx 0;
  902. text-align: center;
  903. border: 2rpx #d2d2d2 solid;
  904. border-radius: 30rpx;
  905. font-size: 36rpx;
  906. }
  907. .tipsItemBtnText{
  908. margin-right: 10rpx;
  909. vertical-align: middle;
  910. }
  911. .tipsItemBtnImg{
  912. width: 40rpx;
  913. height: 40rpx;
  914. vertical-align: middle;
  915. }
  916. .remarkBox{
  917. margin-top: 20rpx;
  918. }
  919. .remarkHeader{
  920. padding: 10rpx 20rpx;
  921. font-size: 44rpx;
  922. color: #000;
  923. }
  924. .remarkBody{
  925. padding: 0 20rpx;
  926. }
  927. .remarkItem{
  928. padding: 10rpx 0;
  929. color: #000;
  930. font-size: 36rpx;
  931. line-height: 44rpx;
  932. }
  933. </style>