WeldingOperations.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002
  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.dicDataName"></radio>{{item.dicDataName}}
  19. </label>
  20. </radio-group>
  21. </view>
  22. </view>
  23. <view class="fway-form-item" v-show="data.jobType == '气割'">
  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 == '气割' && !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 != '气割'){
  558. that.data.companyName = '';
  559. }
  560. that.data.jobType = that.data.jobType == '气割' ? '1' : (that.data.jobType == '电焊' ? '0' : null)
  561. let params = that.data;
  562. console.log(JSON.stringify(params))
  563. that.$admin.req({
  564. method: 'POST',
  565. url: '/api/v1/Snapshot/order',
  566. data: params
  567. }).then(res => {
  568. if (res) {
  569. if (res.no && res.password) {
  570. uni.showModal({
  571. title: "您的诉求已上报成功! ",
  572. content: '工单编号:' + res.no + '\r\n查询密码:' + res.password,
  573. showCancel: false,
  574. confirmText: '确定',
  575. confirmColor: '#3e6ffd',
  576. success: res => {
  577. let obj = uni.getStorageSync('userInfo');
  578. obj.userName = that.data.name;
  579. uni.setStorageSync('userInfo', obj);
  580. uni.switchTab({
  581. url: "/pages/Index/Mine"
  582. })
  583. }
  584. })
  585. } else {
  586. that.$util.msg(res.msg || "对不起,提交失败,请稍后重试!");
  587. }
  588. } else {
  589. that.$util.msg("对不起,提交失败,请稍后重试!");
  590. }
  591. });
  592. },
  593. }
  594. }
  595. </script>
  596. <style lang="less">
  597. .container {
  598. background-color: #f7f7f7;
  599. font-size: 0;
  600. }
  601. .helpBox {
  602. padding: 20rpx;
  603. }
  604. .formBox {
  605. margin: 0;
  606. padding-bottom: 140rpx;
  607. }
  608. .fway-btnBox{
  609. position: absolute;
  610. bottom: 0;
  611. width: 100%;
  612. padding: 20rpx 0 30rpx;
  613. background-color: #f7f7f7;
  614. z-index: 9;
  615. }
  616. .fway-btn{
  617. height: 80rpx;
  618. line-height: 80rpx;
  619. font-size: 40rpx;
  620. }
  621. .hiddenDangerBox {
  622. padding: 0 20rpx;
  623. }
  624. .hiddenDangerItemBox {
  625. padding: 0;
  626. background-color: #fff;
  627. margin-top: 20rpx;
  628. box-shadow: 0rpx 5rpx 12rpx 0rpx #c7c7c7;
  629. border-radius: 10rpx;
  630. }
  631. .hiddenDangerHeader {
  632. padding: 30rpx 20rpx 20rpx;
  633. font-size: 44rpx;
  634. font-weight: bold;
  635. color: #000;
  636. }
  637. .hiddenDangerBody {
  638. padding: 0 20rpx 10rpx;
  639. }
  640. .hiddenDangerItem {
  641. margin-bottom: 20rpx;
  642. }
  643. .hiddenDangerItemHeader {
  644. padding: 10rpx 0;
  645. display: flex;
  646. justify-content: left;
  647. align-items: center;
  648. }
  649. .mustTips {
  650. width: 30rpx;
  651. font-size: 40rpx;
  652. font-weight: bold;
  653. color: #fd0101;
  654. }
  655. .itemHeaderText {
  656. color: #000;
  657. font-size: 36rpx;
  658. }
  659. .itemHeaderTips {
  660. font-size: 28rpx;
  661. color: #777;
  662. }
  663. .hiddenDangerItemBody {
  664. padding: 0;
  665. }
  666. .hiddenDangerHeaderBtn {
  667. width: calc(100% - 288rpx);
  668. display: inline-block;
  669. vertical-align: middle;
  670. text-align: right;
  671. }
  672. .fway-form-item {
  673. padding: 0 10rpx;
  674. }
  675. .fway-form-textarea {
  676. width: calc(100% - 40rpx);
  677. padding: 20rpx;
  678. height: 180rpx;
  679. }
  680. .fway-form-tips {
  681. padding: 10rpx 0;
  682. }
  683. .workBox .fway-form-lable {
  684. width: 170rpx;
  685. font-size: 36rpx;
  686. }
  687. .workBox .lableTips{
  688. font-size: 28rpx;
  689. color: #777;
  690. }
  691. .workBox .fway-form-input-select {
  692. width: calc(100% - 200rpx);
  693. position: relative;
  694. }
  695. .workBox .fway-form-input-inline {
  696. width: calc(100% - 200rpx);
  697. position: relative;
  698. }
  699. .workBox .fway-form-input-select .fway-form-input {
  700. width: calc(100% - 60rpx);
  701. padding-right: 40rpx;
  702. }
  703. .workBox .fway-form-input-select .fway-form-selectImg{
  704. position: absolute;
  705. right: 10rpx;
  706. top: 34rpx;
  707. }
  708. .reportPersonBox .fway-form-item {
  709. border-bottom: 2rpx #eaeaea solid;
  710. }
  711. .reportPersonBox .fway-form-lable {
  712. padding: 10rpx 0;
  713. width: 200rpx;
  714. color: #777;
  715. font-size: 36rpx;
  716. }
  717. .reportPersonBox .fway-form-input-inline {
  718. width: calc(100% - 200rpx);
  719. padding: 10rpx 0 0;
  720. }
  721. .reportPersonBox .fway-form-input {
  722. background-color: #fff;
  723. }
  724. .fway-form-input {
  725. width: calc(100% - 40rpx);
  726. padding: 0 20rpx;
  727. height: 80rpx;
  728. line-height: 80rpx;
  729. font-size: 36rpx;
  730. }
  731. .fway-form-textarea {
  732. width: calc(100% - 40rpx);
  733. padding: 20rpx;
  734. height: 180rpx;
  735. font-size: 36rpx;
  736. line-height: 46rpx;
  737. }
  738. .fway-form-checkbox, .fway-form-radioBox{
  739. font-size: 36rpx;
  740. }
  741. .workBoxHeader{
  742. display: flex;
  743. justify-content: space-between;
  744. align-items: center;
  745. }
  746. .workBoxHeaderAdd{
  747. color: #3e6ffd;
  748. font-weight: normal;
  749. font-size: 32rpx;
  750. }
  751. .workPersonItem{
  752. border: 2rpx #c7c7c7 dotted;
  753. border-radius: 20rpx;
  754. margin-bottom: 20rpx;
  755. }
  756. .workPersonItemTitle{
  757. padding: 20rpx 30rpx 10rpx;
  758. font-size: 36rpx;
  759. font-weight: bold;
  760. color: #000;
  761. display: flex;
  762. justify-content: space-between;
  763. align-items: center;
  764. }
  765. .workPersonItemTitleDelete{
  766. color: #fd0101;
  767. font-weight: normal;
  768. font-size: 32rpx;
  769. }
  770. .workPersonItemBody{
  771. padding-bottom: 10rpx;
  772. }
  773. .chooseFileItem{
  774. padding: 0 0 0 10rpx;
  775. }
  776. .chooseFileItemHeader{
  777. display: flex;
  778. justify-content: space-between;
  779. align-items: center;
  780. height: 60rpx;
  781. line-height: 60rpx;
  782. font-size: 32rpx;
  783. }
  784. .chooseFileItemBtn{
  785. height: 50rpx;
  786. line-height: 50rpx;
  787. color: #FFFFFF;
  788. background-color: #3e6ffd;
  789. text-align: center;
  790. border-radius: 20rpx;
  791. padding: 0 40rpx;
  792. }
  793. .photoListBox {
  794. width: calc(100% - 20rpx);
  795. padding: 10rpx 0 20rpx;
  796. display: flex;
  797. justify-content: left;
  798. align-items: start;
  799. flex-wrap: wrap;
  800. align-content: start;
  801. }
  802. .photoItemBox {
  803. width: calc(25% - 20rpx);
  804. height: 130rpx;
  805. position: relative;
  806. border: 2rpx #E5E5E5 solid;
  807. border-radius: 10rpx;
  808. }
  809. .photoItemBox + .photoItemBox{
  810. margin-left: 20rpx;
  811. }
  812. .photoItemBox + .photoItemBoxsel{
  813. margin-left: 20rpx;
  814. }
  815. .photoItemBoxsel {
  816. width: calc(25% - 20rpx);
  817. height: 130rpx;
  818. position: relative;
  819. background-color: #f7f7f7;
  820. border-radius: 10rpx;
  821. display: flex;
  822. justify-content: center;
  823. align-items: center;
  824. }
  825. .photoItemImg {
  826. width: 100%;
  827. height: 100%;
  828. }
  829. .photoItemImgsel{
  830. width: 60rpx;
  831. height: 60rpx;
  832. }
  833. .closeBtn {
  834. background-color: #00000060;
  835. width: 30rpx;
  836. height: 30rpx;
  837. position: absolute;
  838. padding: 10rpx;
  839. top: 0;
  840. right: 0;
  841. }
  842. .fileListBox{
  843. padding: 20rpx 10rpx;
  844. }
  845. .fileItemBox{
  846. display: flex;
  847. justify-content: space-between;
  848. align-items: center;
  849. width: 100%;
  850. }
  851. .fileItemBox + .fileItemBox{
  852. margin-top: 20rpx;
  853. }
  854. .fileName{
  855. width: calc(100% - 70rpx);
  856. margin-right: 20rpx;
  857. white-space: nowrap;
  858. overflow: hidden;
  859. text-overflow: ellipsis;
  860. color: #53d4fc;
  861. font-size: 32rpx;
  862. }
  863. .fileDeleteBtn{
  864. width: 50rpx;
  865. height: 50rpx;
  866. }
  867. .tipsBox{
  868. background-color: #f7f7f7;
  869. margin-top: 20rpx;
  870. }
  871. .tipsHeader{
  872. padding: 30rpx 20rpx 10rpx;
  873. font-size: 44rpx;
  874. font-weight: bold;
  875. color: #000;
  876. }
  877. .tipsBody{
  878. padding: 0 20rpx 10rpx;
  879. }
  880. .tipsItem{
  881. display: flex;
  882. justify-content: space-between;
  883. align-items: center;
  884. border-bottom: 2rpx #d2d2d2 dashed;
  885. padding: 20rpx 0;
  886. }
  887. .tipsItemImg{
  888. width: 40rpx;
  889. height: 50rpx;
  890. margin-right: 20rpx;
  891. }
  892. .tipsItemText{
  893. width: calc(100% - 220rpx);
  894. font-size: 36rpx;
  895. white-space: nowrap;
  896. overflow: hidden;
  897. text-overflow: ellipsis;
  898. color: #000;
  899. }
  900. .tipsItemBtn{
  901. width: 160rpx;
  902. padding: 10rpx 0;
  903. text-align: center;
  904. border: 2rpx #d2d2d2 solid;
  905. border-radius: 30rpx;
  906. font-size: 36rpx;
  907. }
  908. .tipsItemBtnText{
  909. margin-right: 10rpx;
  910. vertical-align: middle;
  911. }
  912. .tipsItemBtnImg{
  913. width: 40rpx;
  914. height: 40rpx;
  915. vertical-align: middle;
  916. }
  917. .remarkBox{
  918. margin-top: 20rpx;
  919. }
  920. .remarkHeader{
  921. padding: 10rpx 20rpx;
  922. font-size: 44rpx;
  923. color: #000;
  924. }
  925. .remarkBody{
  926. padding: 0 20rpx;
  927. }
  928. .remarkItem{
  929. padding: 10rpx 0;
  930. color: #000;
  931. font-size: 36rpx;
  932. line-height: 44rpx;
  933. }
  934. </style>