rapidRepNext.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949
  1. <template>
  2. <view class="handler">
  3. <view class="head">
  4. <view class="tab" :class="{active: tab.value === dataInfo.tabActiveValue}" v-for="tab in dataInfo.tabs" :key="tab.id" @click="clickTab(tab.value)">
  5. {{tab.name}}<text v-if="tab.num !== ''">({{tab.num}})</text>
  6. </view>
  7. </view>
  8. <view class="body view-body page_padding">
  9. <!-- 科内报修 -->
  10. <template v-if="dataInfo.tabActiveValue === 'doing'">
  11. <view class="form_item" v-if="hospitalModel.valueconfig!=1">
  12. <view class="title select"><text class="required newicon newicon-bitian"></text>院区:</view>
  13. <uni-data-picker class="value" placeholder="请选择院区"
  14. v-model="dataInfo.branch" :localdata="branchData" @change="doingDeptChange"
  15. :clear-icon="false" :class="{formRed: isSubmit && !dataInfo.branch}">
  16. </uni-data-picker>
  17. </view>
  18. <!-- <view class="form_item">
  19. <view class="title select"><text class="required newicon newicon-bitian"></text>报修科室:</view>
  20. <uni-data-picker class="value" placeholder="请选择报修科室"
  21. v-model="dataInfo.department" :localdata="dataInfo.repairTypeList"
  22. :clear-icon="false" :class="{formRed: isSubmit && !dataInfo.department}">
  23. </uni-data-picker>
  24. </view> -->
  25. <view class="form_item">
  26. <view class="title select"><text class="required newicon newicon-bitian"></text>报修科室:</view>
  27. <view class="value category" @click="selectDepartment">
  28. <text class="categoryName ellipsis-multiline">{{dataInfo.departmentName}}</text>
  29. <text class="newicon newicon-weibiaoti2010104"></text>
  30. </view>
  31. </view>
  32. <view class="candidate" v-if="itemUser">
  33. <view class="candidate-item" v-for="(item, index) in itemUser.commonDeptDTO" :key="item" @click="itemCandidate(item)">{{item.dept}}</view>
  34. </view>
  35. <view class="form_item column">
  36. <view class="title"><text class="required newicon newicon-bitian"></text>详细地址:</view>
  37. <uni-easyinput class="value" type="textarea" v-model="dataInfo.address" placeholder="请输入详细地址" :class="{formRed: isSubmit && !dataInfo.address }" />
  38. </view>
  39. <view class="candidate">
  40. <view class="candidate-item" v-for="item in dataInfo.addressList" :key="item.id" @click="itemAddres(item)">{{item.name}}</view>
  41. </view>
  42. <view class="form_item" :class="{formRed: isSubmit && !dataInfo.contacts}">
  43. <view class="title select"><text class="required newicon newicon-bitian"></text>联系人:</view>
  44. <input class="item-input" placeholder="请输入联系人" v-model="dataInfo.contacts" />
  45. </view>
  46. <view class="form_item" :class="{formRed: isSubmit && !dataInfo.contactsInformation}">
  47. <view class="title select"><text class="required newicon newicon-bitian"></text>联系电话:</view>
  48. <input class="item-input" placeholder="请输入联系电话" v-model="dataInfo.contactsInformation"/>
  49. </view>
  50. </template>
  51. <!-- 公共报修 -->
  52. <template v-if="dataInfo.tabActiveValue === 'overtime'">
  53. <view class="form_item" v-if="isRepair.valueconfig==1 && hospitalModel.valueconfig!=1">
  54. <view class="title select"><text class="required newicon newicon-bitian"></text>院区:</view>
  55. <uni-data-picker class="value" placeholder="请选择院区" @change="overDeptChange"
  56. v-model="dataInfo.branch" :localdata="branchData"
  57. :clear-icon="false" :class="{formRed: isSubmit && !dataInfo.branch}">
  58. </uni-data-picker>
  59. </view>
  60. <view class="form_item" v-if="isRepair.valueconfig==1">
  61. <view class="title select"><text class="required newicon newicon-bitian"></text>楼栋:</view>
  62. <uni-data-picker class="value" placeholder="请选择楼栋" @change="areaChange"
  63. v-model="dataInfo.areaId" :localdata="dataInfo.buildingTypeList"
  64. :clear-icon="false" :class="{formRed: isSubmit && !dataInfo.areaId}">
  65. </uni-data-picker>
  66. </view>
  67. <view class="form_item" v-if="isRepair.valueconfig==1">
  68. <view class="title select"><text class="required newicon newicon-bitian"></text>楼层:</view>
  69. <uni-data-picker class="value" placeholder="请选择楼层"
  70. v-model="dataInfo.placeId" :localdata="dataInfo.placeTypeList"
  71. :clear-icon="false" :class="{formRed: isSubmit && !dataInfo.placeId}">
  72. </uni-data-picker>
  73. </view>
  74. <view class="form_item column" v-if="isRepair.valueconfig==1">
  75. <view class="title"><text class="required newicon newicon-bitian"></text>详细地址:</view>
  76. <uni-easyinput class="value" type="textarea" v-model="dataInfo.address" placeholder="请输入详细地址" :class="{formRed: isSubmit && !dataInfo.address}" />
  77. </view>
  78. <view class="form_item" :class="{formRed: isSubmit && !dataInfo.contacts}">
  79. <view class="title select"><text class="required newicon newicon-bitian"></text>联系人:</view>
  80. <input class="item-input value" placeholder="请输入联系人" v-model="dataInfo.contacts"/>
  81. </view>
  82. <view class="form_item" :class="{formRed: isSubmit && !dataInfo.contactsInformation}">
  83. <view class="title select"><text class="required newicon newicon-bitian"></text>联系电话:</view>
  84. <input class="item-input value" placeholder="请输入联系电话" v-model="dataInfo.contactsInformation"/>
  85. </view>
  86. </template>
  87. </view>
  88. <view class="foot_common_btns">
  89. <button @click="goBackOrToList" type="default" class="primaryButton btn">上一步</button>
  90. <button @click="submit" type="default" class="primaryButton btn">提交</button>
  91. </view>
  92. <NumberModal v-if="dataInfo.isNumber" @cancelEmit="cancelNumber" @confirmEmit="conformNumber" @removeEmit="removeNumber" :selectData="dataInfo.selectData" :selectType="dataInfo.selectType" :evtNumber="dataInfo.evtNumber" showRemove></NumberModal>
  93. </view>
  94. </template>
  95. <script setup>
  96. import { ref, reactive, computed } from 'vue'
  97. import NumberModal from '@/components/NumberModal.vue';
  98. import { onLoad } from '@dcloudio/uni-app'
  99. import { generateNumberArray } from '@/utils/index.js'
  100. import { api_getDictionary, api_sj,api_request, getFetchDataList, api_place, api_getSolution, api_area, api_user, api_incidentTask, api_branch, api_dutyDepartment, api_department, api_querySummaryDoc, api_addSummaryDoc, api_departmentDetail } from "@/http/api.js"
  101. import { defaultColor } from '@/static/js/theme.js'
  102. import { useSetTitle } from '@/share/useSetTitle.js'
  103. import { useMakePhoneCall } from '@/share/useMakePhoneCall.js'
  104. import { useUploadFile } from '@/share/useUploadFile.js'
  105. import { useGoBack } from '@/share/useGoBack.js'
  106. import { useLoginUserStore } from '@/stores/loginUser'
  107. import { useHandlerStore } from '@/stores/handler'
  108. useSetTitle();
  109. const loginUserStore = useLoginUserStore();
  110. const handlerStore = useHandlerStore();
  111. const { makePhoneCall } = useMakePhoneCall();
  112. const { uploadFile } = useUploadFile();
  113. const { goBack } = useGoBack();
  114. // 主题颜色
  115. const primaryColor = ref(defaultColor)
  116. // 备用机选项
  117. const machineData = ref([
  118. {
  119. text:'是',
  120. value:1
  121. },
  122. {
  123. text:'否',
  124. value:0
  125. },
  126. ])
  127. const isDept = ref({})
  128. const isRepair = ref({})
  129. const hospitalModel = ref({})
  130. const branchData = ref([])
  131. const candidateData = ref(loginUserStore.loginUser.user)
  132. const repairIncident = ref(null)
  133. // 数据
  134. const dataInfo = reactive({
  135. tabs: [
  136. {id: 5, name: '科内报修', value: 'doing', num: ''},
  137. {id: 6, name: '公共报修', value: 'overtime', num: ''},
  138. ],
  139. tabActiveValue: 'doing',//当前选择的tab
  140. incidentId: undefined,//事件ID
  141. incidentData: {
  142. repairIncidentType:{
  143. id:''
  144. },
  145. department:{
  146. id:''
  147. }
  148. },//事件对象
  149. repairTypeList:[],//科室数据
  150. buildingTypeList:[],//楼栋数据
  151. placeTypeList:[],//楼层数据
  152. department:'',//报修科室id
  153. departmentName:'',//报修科室
  154. address:'',//详细地址
  155. contacts:'',//联系人
  156. contactsInformation:'',//手机
  157. areaId:'',//楼栋
  158. placeId:'',//楼层
  159. branch:'', //院区
  160. addressList: [], //科室地点
  161. })
  162. // 故障处理用是否提供备用机
  163. const newProvideBackupMachine = ref(0)
  164. // 知识库id
  165. const solutionId = ref(null)
  166. // 是否提交
  167. const isSubmit = ref(false)
  168. // 处理图片
  169. const handlerImgRef = ref(null)
  170. // 用户信息
  171. const itemUser = ref(null)
  172. // 是否进入汇总单
  173. const isInSummaryOrder = computed(() => {
  174. return dataInfo.tabActiveValue === 'doing' && dataInfo.incidentData.duty && dataInfo.incidentData.duty.addSummary == 1 && (dataInfo.incidentData.handlingPersonnelUser.id == loginUserStore.loginUser.user.id);
  175. })
  176. // 上一步或者返回列表
  177. function goBackOrToList(){
  178. uni.setStorageSync('rapidRepNext',JSON.stringify(dataInfo))
  179. uni.navigateTo({
  180. url: `/pages/repair/rapidRep`
  181. })
  182. }
  183. // 重置
  184. function reset(){
  185. // dataInfo.department = '',//报修科室
  186. dataInfo.address = '',//详细地址
  187. // dataInfo.contacts = '',//联系人
  188. // dataInfo.contactsInformation = ''//手机
  189. dataInfo.areaId = ''//楼栋
  190. dataInfo.placeId = '' //院区
  191. dataInfo.placeTypeList = []
  192. }
  193. // 初始化表单
  194. function initForm(){
  195. if(dataInfo.tabActiveValue === 'doing'){
  196. // getRepairTypes()
  197. getUserInfo()
  198. }else if(dataInfo.tabActiveValue === 'overtime'){
  199. getbuildingList()
  200. }
  201. }
  202. function itemCandidate(item){
  203. // console.log(55,index)
  204. // let arr = loginUserStore.loginUser.user.commonDept.split(',')
  205. // console.log(66,arr)
  206. dataInfo.department = item.id
  207. dataInfo.departmentName = item.dept
  208. }
  209. function itemAddres(item){
  210. dataInfo.address = item.name
  211. }
  212. function getUserInfo(){
  213. let user = loginUserStore.loginUser.user
  214. let postData = {
  215. idx: 0,
  216. sum: 999,
  217. user: {
  218. hospital:{
  219. id:user.currentHospital.id
  220. },
  221. name: user.name,
  222. }
  223. }
  224. api_user(postData).then(res => {
  225. if(res.status == 200){
  226. let user = loginUserStore.loginUser.user
  227. if(uni.getStorageSync('rapidRepNext')){
  228. let data = JSON.parse(uni.getStorageSync('rapidRepNext'))
  229. if(data){
  230. dataInfo.departmentName = data.departmentName
  231. dataInfo.department = data.department
  232. }
  233. }else{
  234. dataInfo.departmentName = res.list[0].dept.dept
  235. dataInfo.department = res.list[0].dept.id
  236. }
  237. itemUser.value = res.list.find(i=>i.id==user.id)
  238. }else{
  239. uni.showToast({
  240. icon: 'none',
  241. title: res.msg || '请求数据失败!'
  242. });
  243. }
  244. })
  245. }
  246. // 点击tab
  247. function clickTab(tabValue){
  248. if(dataInfo.tabActiveValue == tabValue){
  249. return;
  250. }
  251. dataInfo.tabActiveValue = tabValue;
  252. isSubmit.value = false;
  253. reset();
  254. if(tabValue=='doing'){
  255. let user = loginUserStore.loginUser.user
  256. if(user){
  257. dataInfo.department = user.dept.id
  258. }
  259. }else{
  260. dataInfo.department = ''
  261. }
  262. dataInfo.category = dataInfo.incidentData.category || {};
  263. dataInfo.synergetic = dataInfo.incidentData.synergetic || [];
  264. newProvideBackupMachine.value = dataInfo.incidentData.provideBackupMachine
  265. initForm();
  266. }
  267. // 获取事件详情
  268. function getIncidentDetail(){
  269. let user = loginUserStore.loginUser.user
  270. if(uni.getStorageSync('rapidRepNext')){
  271. let data = JSON.parse(uni.getStorageSync('rapidRepNext'))
  272. if(data){
  273. dataInfo.department = data.department//报修科室
  274. dataInfo.departmentName = data.departmentName//报修科室
  275. dataInfo.address = data.address//详细地址
  276. dataInfo.contacts = data.contacts//联系人
  277. dataInfo.contactsInformation = data.contactsInformation//手机
  278. dataInfo.branch = Number(data.branch)//院区
  279. dataInfo.areaId = data.areaId//楼栋
  280. // getRepairTypes()
  281. }
  282. }else if(user){
  283. if(user.currentHospital.parent){
  284. dataInfo.branch = user.currentHospital.parent.id
  285. }else{
  286. dataInfo.branch = user.currentHospital.id
  287. }
  288. dataInfo.contacts = user.name
  289. dataInfo.contactsInformation = user.phone
  290. dataInfo.department = user.dept.id
  291. dataInfo.departmentName = user.dept.dept
  292. // getRepairTypes()
  293. }
  294. if(uni.getStorageSync('repairData')){
  295. let data = JSON.parse(uni.getStorageSync('repairData'))
  296. if(data){
  297. dataInfo.description = data.description
  298. dataInfo.handlerImgList = data.handlerImgList
  299. dataInfo.serverId = data.serverId
  300. dataInfo.assetId = data.assetId
  301. }
  302. }
  303. let data = JSON.parse(uni.getStorageSync('sysData'))
  304. isDept.value = data.find(i=>i.keyconfig=='deptRepair')
  305. isRepair.value = data.find(i=>i.keyconfig=='publicRepair')
  306. hospitalModel.value = data.find(i=>i.keyconfig=='hospitalModel')
  307. if(isDept.value.valueconfig==1 && isRepair.value.valueconfig==1){
  308. dataInfo.tabs = [
  309. {id: 5, name: '科内报修', value: 'doing', num: ''},
  310. {id: 6, name: '公共报修', value: 'overtime', num: ''},
  311. ]
  312. dataInfo.tabActiveValue = 'doing'
  313. }else if(isDept.value.valueconfig==1){
  314. dataInfo.tabs = [
  315. {id: 5, name: '科内报修', value: 'doing', num: ''},
  316. ]
  317. dataInfo.tabActiveValue = 'doing'
  318. }else if(isRepair.value.valueconfig==1){
  319. dataInfo.tabs = [
  320. {id: 6, name: '公共报修', value: 'overtime', num: ''},
  321. ]
  322. dataInfo.tabActiveValue = 'overtime'
  323. getbuildingList()
  324. } else if (isDept.value.valueconfig==0 && isRepair.value.valueconfig==0){
  325. dataInfo.tabs = [
  326. {id: 5, name: '科内报修', value: 'doing', num: ''},
  327. {id: 6, name: '公共报修', value: 'overtime', num: ''},
  328. ]
  329. dataInfo.tabActiveValue = 'doing'
  330. }
  331. let postData = {
  332. "key": 'repair_incident_type',
  333. "type": "list",
  334. };
  335. api_getDictionary(postData).then(res => {
  336. res = res || [];
  337. repairIncident.value = res
  338. })
  339. getBranch()
  340. }
  341. // 获取院区列表
  342. function getBranch(){
  343. let arr = loginUserStore.loginUser.hospital.filter(i=>i.parent==undefined)
  344. branchData.value = arr.map(v => ({
  345. text: v.hosName,
  346. value: v.id,
  347. }));
  348. }
  349. // 科内报修选择院区
  350. function doingDeptChange(){
  351. dataInfo.department = ''
  352. dataInfo.departmentName = ''
  353. // getRepairTypes()
  354. }
  355. // 公区报修选择院区
  356. function overDeptChange(){
  357. getbuildingList()
  358. }
  359. // 跳转到搜索报修科室
  360. function selectDepartment(){
  361. uni.setStorageSync('rapidRepNext',JSON.stringify(dataInfo))
  362. uni.navigateTo({
  363. url: `/pages/searchDept/searchDept?type=repair&branchId=${dataInfo.branch}`
  364. })
  365. }
  366. // 获取报修科室列表
  367. function getRepairTypes(){
  368. uni.showLoading({
  369. title: "加载中",
  370. mask: true,
  371. });
  372. let postData = {
  373. department: {
  374. hospital: dataInfo.branch,
  375. },
  376. idx:0,
  377. sum:9999
  378. }
  379. api_department(postData).then(res => {
  380. uni.hideLoading();
  381. res = res.list || [];
  382. dataInfo.repairTypeList = res.map(v => ({
  383. text: v.dept,
  384. value: v.id,
  385. floor: v.floor
  386. }));
  387. let isDeptId = dataInfo.repairTypeList.filter(i=>i.value==dataInfo.department)
  388. if(isDeptId.length==0){
  389. dataInfo.department = ''
  390. }
  391. })
  392. }
  393. // 获取楼栋
  394. function getbuildingList(){
  395. uni.showLoading({
  396. title: "加载中",
  397. mask: true,
  398. });
  399. let postData = {
  400. idx: 0,
  401. sum: 9999,
  402. building:{
  403. hosId: dataInfo.branch,
  404. }
  405. };
  406. getFetchDataList("simple/data", "building", postData)
  407. .then((res) => {
  408. uni.hideLoading();
  409. res = res.list || [];
  410. dataInfo.buildingTypeList = res.map(v => ({
  411. text: v.buildingName,
  412. value: v.id
  413. }));
  414. });
  415. }
  416. // 获取科室地点
  417. function getAddressList(){
  418. uni.showLoading({
  419. title: "加载中",
  420. mask: true,
  421. });
  422. let postData = {
  423. idx: 0,
  424. sum: 10,
  425. qrCode:{
  426. deptId: dataInfo.department,
  427. }
  428. };
  429. getFetchDataList("simple/data", "qrCode", postData)
  430. .then((res) => {
  431. uni.hideLoading();
  432. dataInfo.addressList = res.list || [];
  433. });
  434. }
  435. function areaChange(e){
  436. getPlaceList(dataInfo.areaId)
  437. }
  438. // 获取楼层
  439. function getPlaceList(e){
  440. let postData = {
  441. idx: 0,
  442. sum: 9999,
  443. floor: {
  444. buildId:e,
  445. hosId:dataInfo.branch
  446. }
  447. };
  448. getFetchDataList("simple/data", "floor", postData)
  449. .then((res) => {
  450. uni.hideLoading();
  451. res = res.list || [];
  452. dataInfo.placeTypeList = res.map(v => ({
  453. text: v.floorName,
  454. value: v.id
  455. }));
  456. });
  457. }
  458. // 提交
  459. function submit(){
  460. isSubmit.value = true;
  461. submitHandler()
  462. }
  463. // 处理提交事件
  464. async function handlerOrder(){
  465. let postData = {
  466. incident: dataInfo.incidentData,
  467. serverId: ''
  468. }
  469. postData.incident.place = {}
  470. if(dataInfo.tabActiveValue === 'doing'){
  471. let data = repairIncident.value.find(i=>i.value=='dept')
  472. dataInfo.incidentData.repairIncidentType.id = data.id
  473. let result = await api_departmentDetail(dataInfo.department);
  474. let deptDTO = result.data || {};
  475. postData.incident.place.id = deptDTO.floor ? deptDTO.floor.id : undefined;
  476. }else if(dataInfo.tabActiveValue === 'overtime'){
  477. let data = repairIncident.value.find(i=>i.value=='public')
  478. dataInfo.incidentData.repairIncidentType.id = data.id
  479. postData.incident.place.id = dataInfo.placeId;
  480. }
  481. dataInfo.incidentData.department.id = dataInfo.department
  482. postData.incident.description = dataInfo.description;
  483. if(dataInfo.serverId){
  484. postData.serverId = dataInfo.serverId;
  485. }else{
  486. delete postData.serverId
  487. }
  488. postData.incident.assetId = dataInfo.assetId;
  489. postData.incident.houseNumber = dataInfo.address;
  490. postData.incident.contacts = dataInfo.contacts;
  491. postData.incident.contactsInformation = dataInfo.contactsInformation;
  492. postData.incident.hosId = dataInfo.branch;
  493. let repairsType = uni.getStorageSync('repairsType')
  494. // postData.incident.buildId = dataInfo.areaId; //areaId:楼栋
  495. // postData.incident.floorId = dataInfo.placeId;//placeId:楼层
  496. // buildId
  497. // floorId
  498. api_getDictionary({
  499. key: "incident_source",
  500. type: "list"
  501. }).then(res1=>{
  502. let incidentSourceList = res1 || [];
  503. let im = incidentSourceList.find(v => v.value === 'im');
  504. // api_sj().then(res2=>{
  505. // postData.incident.incidentsign = res2.data;
  506. postData.incident.source = im;
  507. postData.incident.fromWx = true;
  508. postData.incident.requester = loginUserStore.loginUser.user;
  509. postData.incident.acceptUser = loginUserStore.loginUser.user;
  510. postData.incident.deleteFlag = 0
  511. api_request(postData).then(res=>{
  512. if(res.state == 200){
  513. dataInfo.incidentId = res.data.id
  514. let handlerOrder$ = res.data;
  515. let requestList = [handlerOrder$];
  516. if(dataInfo.handlerImgList.length){ // 有图片
  517. dataInfo.handlerImgList.forEach(v => {
  518. let handlerOrderImg$ = handlerOrderImg(v);
  519. requestList.push(handlerOrderImg$);
  520. })
  521. console.log(9999,requestList);
  522. Promise.all(requestList).then(resList => {
  523. uni.hideLoading();
  524. console.log(9999,resList);
  525. // if(resList[0].state == 200){
  526. uni.showToast({
  527. icon: 'none',
  528. title: '报修成功',
  529. mask: true,
  530. });
  531. setTimeout(() => {
  532. uni.setStorageSync('rapidRepNext','')
  533. uni.setStorageSync('repairData','')
  534. if(repairsType=='home'){
  535. uni.reLaunch({
  536. url: '/pages/repair/home',
  537. })
  538. }else{
  539. uni.navigateTo({
  540. url: `/pages/myRepair/myRepair?type=1`
  541. })
  542. }
  543. }, 1500)
  544. // }else{
  545. // uni.showToast({
  546. // icon: 'none',
  547. // title: resList[0].msg || '请求数据失败!'
  548. // });
  549. // }
  550. })
  551. }else{
  552. uni.showToast({
  553. icon: 'none',
  554. title: '报修成功',
  555. mask: true,
  556. });
  557. setTimeout(() => {
  558. uni.setStorageSync('rapidRepNext','')
  559. uni.setStorageSync('repairData','')
  560. if(repairsType=='home'){
  561. uni.reLaunch({
  562. url: '/pages/repair/home',
  563. })
  564. }else{
  565. uni.navigateTo({
  566. url: `/pages/myRepair/myRepair?type=1`
  567. })
  568. }
  569. }, 1500)
  570. }
  571. }else{
  572. uni.showToast({
  573. icon: 'none',
  574. title: res.msg || '请求数据失败!'
  575. });
  576. }
  577. })
  578. // })
  579. })
  580. }
  581. // 处理图片
  582. function handlerOrderImg(imgObj){
  583. let allData = null
  584. if(imgObj.extname=='mp4' ||
  585. imgObj.extname=='avi' ||
  586. imgObj.extname=='mpeg' ||
  587. imgObj.extname=='wmv'){
  588. allData = uploadFile(imgObj, 'wechatIncidentVideo', dataInfo.incidentId)
  589. }else{
  590. allData = uploadFile(imgObj, 'wechatRequesterIncident', dataInfo.incidentId)
  591. }
  592. return allData
  593. }
  594. // 处理提交
  595. function submitHandler(){
  596. console.log(dataInfo);
  597. if(dataInfo.tabActiveValue=='doing'){
  598. if(dataInfo.department==''){
  599. uni.showToast({
  600. icon: 'none',
  601. title: '请选择报修科室'
  602. });
  603. return;
  604. }
  605. }else{
  606. if(dataInfo.branch==''){
  607. uni.showToast({
  608. icon: 'none',
  609. title: '请选择院区'
  610. });
  611. return;
  612. }
  613. if(dataInfo.areaId==''){
  614. uni.showToast({
  615. icon: 'none',
  616. title: '请选择楼栋'
  617. });
  618. return;
  619. }
  620. if(dataInfo.placeId==''){
  621. uni.showToast({
  622. icon: 'none',
  623. title: '请选择楼层'
  624. });
  625. return;
  626. }
  627. }
  628. if(dataInfo.address==''){
  629. uni.showToast({
  630. icon: 'none',
  631. title: '请输入详细地址'
  632. });
  633. return;
  634. }
  635. if(dataInfo.contacts==''){
  636. uni.showToast({
  637. icon: 'none',
  638. title: '请输入联系人'
  639. });
  640. return;
  641. }
  642. if(dataInfo.contactsInformation==''){
  643. uni.showToast({
  644. icon: 'none',
  645. title: '请输入联系电话'
  646. });
  647. return;
  648. }
  649. console.log(dataInfo.handlerImgList)
  650. uni.showLoading({
  651. title: "加载中",
  652. mask: true,
  653. });
  654. handlerOrder()
  655. }
  656. // 获取文本内容
  657. function getHtml(html) {
  658. const tempDiv = document.createElement('div');
  659. tempDiv.innerHTML = html;
  660. return tempDiv.textContent || tempDiv.innerText || '';
  661. }
  662. onLoad((option) => {
  663. initForm()
  664. getIncidentDetail();
  665. getAddressList();
  666. })
  667. </script>
  668. <style lang="scss" scoped>
  669. .handler{
  670. height: 100%;
  671. display: flex;
  672. flex-direction: column;
  673. justify-content: space-between;
  674. .head{
  675. height: 88rpx;
  676. display: flex;
  677. position: fixed;
  678. z-index: 99;
  679. width: 100%;
  680. background-color: #fff;
  681. font-size: 30rpx;
  682. .tab{
  683. flex: 1;
  684. display: flex;
  685. justify-content: center;
  686. align-items: center;
  687. border-bottom: 4rpx solid transparent;
  688. &.active{
  689. color: $uni-primary;
  690. border-color: $uni-primary;
  691. }
  692. }
  693. }
  694. .body{
  695. margin-top: 88rpx;
  696. box-sizing: border-box;
  697. flex: 1;
  698. min-height: 0;
  699. &.bg{
  700. background-color: #F7F7F7;
  701. }
  702. .summaryItem{
  703. &:first-of-type{
  704. .summaryItem_head{
  705. border-bottom: 1rpx solid #DDDDDD;
  706. }
  707. }
  708. .summary_total{
  709. padding: 20rpx 0;
  710. display: flex;
  711. justify-content: center;
  712. align-items: center;
  713. }
  714. .summaryItem_head{
  715. padding: 24rpx;
  716. font-size: 26rpx;
  717. color: #3A3A3A;
  718. }
  719. .summaryItem_body{
  720. font-size: 30rpx;
  721. background-color: #fff;
  722. .summaryItem_bodyItem{
  723. padding: 24rpx;
  724. border-bottom: 1rpx solid #DDDDDD;
  725. .summaryItem_bodyItem_top{
  726. display: flex;
  727. justify-content: space-between;
  728. align-items: center;
  729. .value{
  730. padding-left: 48rpx;
  731. flex-shrink: 0;
  732. }
  733. }
  734. .summaryItem_bodyItem_bottom{
  735. margin-top: 24rpx;
  736. display: flex;
  737. justify-content: space-between;
  738. align-items: center;
  739. .name{
  740. text-align: right;
  741. flex: 1;
  742. }
  743. .value{
  744. width: 240rpx;
  745. text-align: right;
  746. padding-left: 48rpx;
  747. flex-shrink: 0;
  748. }
  749. }
  750. }
  751. }
  752. .summaryItem_foot{
  753. font-size: 30rpx;
  754. background-color: #fff;
  755. &.total{
  756. margin-top: 24rpx;
  757. }
  758. .summaryItem_foot_total{
  759. padding: 24rpx 0;
  760. display: flex;
  761. justify-content: center;
  762. align-items: center;
  763. }
  764. .summaryItem_foot_add{
  765. border-top: 1rpx solid #DDDDDD;
  766. padding: 24rpx 0;
  767. display: flex;
  768. justify-content: center;
  769. align-items: center;
  770. .newicon-icon-test{
  771. font-size: 30rpx;
  772. font-weight: bold;
  773. }
  774. }
  775. }
  776. }
  777. .form_item_column{
  778. padding-top: 24rpx;
  779. min-height: 86rpx;
  780. .form_item{
  781. padding-top: 0;
  782. min-height: auto;
  783. }
  784. }
  785. .candidate{
  786. display: flex;
  787. flex-wrap: wrap;
  788. .candidate-item{
  789. padding: 6rpx 15rpx;
  790. font-size: 26rpx;
  791. color: #949494;
  792. background: #E9E9E9;
  793. border-radius: 50rpx;
  794. margin-right: 20rpx;
  795. margin-top: 15rpx;
  796. }
  797. }
  798. .form_item{
  799. display: flex;
  800. align-items: center;
  801. padding-top: 24rpx;
  802. min-height: 86rpx;
  803. &.column{
  804. height: auto;
  805. flex-direction: column;
  806. align-items: flex-start;
  807. .import-rep{
  808. padding: 5rpx 10rpx;
  809. border-radius: 50rpx;
  810. background: #d1fcd5;
  811. color: #49b856;
  812. font-size: 24rpx;
  813. }
  814. .title{
  815. margin-right: 0;
  816. }
  817. .title-width{
  818. width: 100%;
  819. }
  820. .title-fl-sb{
  821. display: flex;
  822. justify-content: space-between;
  823. width: 100%;
  824. }
  825. .value{
  826. margin-top: 10rpx;
  827. padding-left: 20rpx;
  828. box-sizing: border-box;
  829. }
  830. .tips{
  831. padding: 24rpx;
  832. text-align: center;
  833. font-size: 22rpx;
  834. color: #909399;
  835. width: 100%;
  836. box-sizing: border-box;
  837. }
  838. }
  839. .title{
  840. font-size: 26rpx;
  841. display: flex;
  842. align-items: center;
  843. margin-right: 12rpx;
  844. flex-shrink: 0;
  845. &.select{
  846. width: calc(5em + 20rpx);
  847. }
  848. }
  849. .value{
  850. width: 100%;
  851. &.category{
  852. width: 100%;
  853. display: flex;
  854. justify-content: space-between;
  855. align-items: center;
  856. .categoryName{
  857. font-size: 26rpx;
  858. color: #555;
  859. flex: 1;
  860. }
  861. .newicon-weibiaoti2010104{
  862. color: $uni-primary;
  863. margin-left: 24rpx;
  864. }
  865. }
  866. .imgTips{
  867. color: #909399;
  868. font-size: 22rpx;
  869. }
  870. }
  871. .item-input{
  872. border: 1px solid #DBDBDB;
  873. height: 70rpx;
  874. line-height: 70rpx;
  875. padding: 0 10rpx;
  876. border-radius: 4rpx;
  877. width: 100%;
  878. font-size: 14px;
  879. }
  880. .synergeticNames{
  881. font-size: 26rpx;
  882. margin-right: 24rpx;
  883. }
  884. .synergeticAdd{
  885. flex-shrink: 0;
  886. }
  887. }
  888. }
  889. }
  890. </style>