changeUser.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741
  1. <template>
  2. <view class="changeUser">
  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. <!-- <scroll-view scroll-y class="body"> -->
  9. <view class="body view-body">
  10. <!-- 转派 -->
  11. <template v-if="dataInfo.tabActiveValue === 'redeploy'">
  12. <view class="form_item">
  13. <view class="title select"><text class="required newicon newicon-bitian"></text>工作组:</view>
  14. <!-- <uni-data-select class="value" v-model="dataInfo.groupId" :localdata="dataInfo.groupList" :clear="false" placeholder="请选择工作组" @change="changeGroup" :class="{formRed: isSubmit && !dataInfo.groupId}"></uni-data-select> -->
  15. <uni-data-picker class="value" placeholder="请选择工作组"
  16. :localdata="dataInfo.groupList" v-model="dataInfo.groupId"
  17. :clear-icon="false" @change="changeGroup" :class="{formRed: isSubmit && !dataInfo.groupId}">
  18. </uni-data-picker>
  19. </view>
  20. <view class="form_item">
  21. <view class="title radio"><text class="required newicon newicon-bitian"></text>是否转派到人:</view>
  22. <uni-data-checkbox class="value" v-model="dataInfo.isAssignUser" :localdata="dataInfo.isAssignUserList" @change="changeIsAssignUser" />
  23. </view>
  24. <view class="form_item" v-if="dataInfo.isAssignUser === 1">
  25. <view class="title select"><text class="required newicon newicon-bitian"></text>转派对象:</view>
  26. <!-- <uni-data-select class="value" v-model="dataInfo.userId" :localdata="dataInfo.userList" :clear="false" placeholder="请选择转派对象" :class="{formRed: isSubmit && dataInfo.groupId && dataInfo.isAssignUser == 1 && !dataInfo.userId}"></uni-data-select> -->
  27. <uni-data-picker class="value" placeholder="请选择转派对象"
  28. :localdata="dataInfo.userList" v-model="dataInfo.userId"
  29. :clear-icon="false" :class="{formRed: isSubmit && dataInfo.groupId && dataInfo.isAssignUser == 1 && !dataInfo.userId}">
  30. </uni-data-picker>
  31. </view>
  32. </template>
  33. <!-- 指派 -->
  34. <template v-if="dataInfo.tabActiveValue === 'assign'">
  35. <view class="form_item">
  36. <view class="title select"><text class="required newicon newicon-bitian"></text>院区:</view>
  37. <!-- <uni-data-select class="value" v-model="dataInfo.branchId" :localdata="dataInfo.branchList" :clear="false" placeholder="请选择院区" @change="changeBranch" :class="{formRed: isSubmit && !dataInfo.branchId}"></uni-data-select> -->
  38. <uni-data-picker class="value" placeholder="请选择院区"
  39. :localdata="dataInfo.branchList" v-model="dataInfo.branchId"
  40. :clear-icon="false" @change="changeBranch" :class="{formRed: isSubmit && !dataInfo.branchId}">
  41. </uni-data-picker>
  42. </view>
  43. <view class="form_item">
  44. <view class="title select"><text class="required newicon newicon-bitian"></text>责任科室:</view>
  45. <!-- <uni-data-select class="value" v-model="dataInfo.dutyId" :localdata="dataInfo.dutyList" :clear="false" placeholder="请选择责任科室" @change="changeDuty" :class="{formRed: isSubmit && !dataInfo.dutyId}"></uni-data-select> -->
  46. <uni-data-picker class="value" placeholder="请选择责任科室"
  47. :localdata="dataInfo.dutyList" v-model="dataInfo.dutyId"
  48. :clear-icon="false" @change="changeDuty" :class="{formRed: isSubmit && !dataInfo.dutyId}">
  49. </uni-data-picker>
  50. </view>
  51. <view class="form_item">
  52. <view class="title select"><text class="required newicon newicon-bitian"></text>工作组:</view>
  53. <!-- <uni-data-select class="value" v-model="dataInfo.groupId" :localdata="dataInfo.groupList" :clear="false" placeholder="请选择工作组" @change="changeGroup" :class="{formRed: isSubmit && !dataInfo.groupId}"></uni-data-select> -->
  54. <uni-data-picker class="value" placeholder="请选择工作组"
  55. v-model="dataInfo.groupId" :localdata="dataInfo.groupList"
  56. :clear-icon="false" @change="changeGroup" :class="{formRed: isSubmit && !dataInfo.groupId}">
  57. </uni-data-picker>
  58. </view>
  59. <view class="form_item">
  60. <view class="title radio"><text class="required newicon newicon-bitian"></text>是否指派到人:</view>
  61. <uni-data-checkbox class="value" v-model="dataInfo.isAssignUser" :localdata="dataInfo.isAssignUserList" @change="changeIsAssignUser" />
  62. </view>
  63. <view class="form_item" v-if="dataInfo.isAssignUser === 1">
  64. <view class="title select"><text class="required newicon newicon-bitian"></text>指派对象:</view>
  65. <!-- <uni-data-select class="value" v-model="dataInfo.userId" :localdata="dataInfo.userList" :clear="false" placeholder="请选择指派对象" :class="{formRed: isSubmit && dataInfo.groupId && dataInfo.isAssignUser == 1 && !dataInfo.userId}"></uni-data-select> -->
  66. <uni-data-picker class="value" placeholder="请选择指派对象"
  67. v-model="dataInfo.userId" :localdata="dataInfo.userList"
  68. :clear-icon="false" :class="{formRed: isSubmit && dataInfo.groupId && dataInfo.isAssignUser == 1 && !dataInfo.userId}">
  69. </uni-data-picker>
  70. </view>
  71. </template>
  72. <!-- 退回 -->
  73. <template v-if="dataInfo.tabActiveValue === 'reassign'">
  74. <view class="form_item column">
  75. <view class="title"><text class="required newicon newicon-bitian"></text>退回原因:</view>
  76. <uni-easyinput class="value" type="textarea" v-model="dataInfo.reassignRemark" placeholder="请输入退回原因" :class="{formRed: isSubmit && !dataInfo.reassignRemark.trim()}" />
  77. <view class="tips">注:退回后,由调度台重新指派。</view>
  78. </view>
  79. </template>
  80. </view>
  81. <!-- </scroll-view> -->
  82. <view class="foot_common_btns">
  83. <button @click="goBack" type="default" class="cancelButton btn">返回</button>
  84. <button @click="submit" type="default" class="primaryButton btn">提交</button>
  85. </view>
  86. </view>
  87. </template>
  88. <script setup>
  89. import { ref, reactive } from 'vue'
  90. import { onLoad } from '@dcloudio/uni-app'
  91. import { api_group, api_department, api_incidentDetail, api_user, api_incidentTask, api_branch, api_dutyDepartment } from "@/http/api.js"
  92. import { defaultColor } from '@/static/js/theme.js'
  93. import { useSetTitle } from '@/share/useSetTitle.js'
  94. import { useMakePhoneCall } from '@/share/useMakePhoneCall.js'
  95. import { useGoBack } from '@/share/useGoBack.js'
  96. import { useLoginUserStore } from '@/stores/loginUser'
  97. useSetTitle();
  98. const loginUserStore = useLoginUserStore();
  99. const { makePhoneCall } = useMakePhoneCall();
  100. const { goBack } = useGoBack();
  101. // 主题颜色
  102. const primaryColor = ref(defaultColor)
  103. // 数据
  104. const dataInfo = reactive({
  105. tabs: [
  106. // {id: 1, name: '转派', value: 'redeploy', num: ''},
  107. // {id: 2, name: '指派', value: 'assign', num: ''},
  108. // {id: 3, name: '升级', value: 'upgrade', num: ''},
  109. // {id: 4, name: '退回', value: 'reassign', num: ''},
  110. ],
  111. tabActiveValue: 0,//当前选择的tab
  112. incidentId: undefined,//事件ID
  113. incidentData: {},//事件对象
  114. groupList: [], //工作组列表
  115. groupId: undefined, //工作组ID
  116. userList: [], //用户列表
  117. userId: undefined, //用户ID
  118. branchList: [], //院区列表
  119. branchId: undefined, //院区ID
  120. dutyList: [], //责任科室列表
  121. dutyId: undefined, //责任科室ID
  122. isAssignUser: 1, //工作组是否转派到人
  123. isAssignUserList: [
  124. { text: '是', value: 1 },
  125. { text: '否', value: 0 },
  126. ], //工作组是否转派到人选项
  127. reassignRemark: '',//退回原因
  128. })
  129. // 是否提交
  130. const isSubmit = ref(false)
  131. // 重置
  132. function reset(){
  133. dataInfo.branchId = undefined;
  134. dataInfo.branchList = [];
  135. dataInfo.dutyId = undefined;
  136. dataInfo.dutyList = [];
  137. dataInfo.groupId = undefined;
  138. dataInfo.groupList = [];
  139. dataInfo.userId = undefined;
  140. dataInfo.userList = [];
  141. dataInfo.isAssignUser = 1;
  142. dataInfo.reassignRemark = '';
  143. }
  144. // 初始化表单
  145. function initForm(){
  146. if(dataInfo.tabActiveValue === 'redeploy'){
  147. getGroups();
  148. }else if(dataInfo.tabActiveValue === 'assign'){
  149. getBranchs();
  150. }
  151. }
  152. // 点击tab
  153. function clickTab(tabValue){
  154. if(dataInfo.tabActiveValue == tabValue){
  155. return;
  156. }
  157. dataInfo.tabActiveValue = tabValue;
  158. isSubmit.value = false;
  159. reset();
  160. initForm()
  161. }
  162. // 获取事件详情
  163. function getIncidentDetail(){
  164. uni.showLoading({
  165. title: "加载中",
  166. mask: true,
  167. });
  168. api_incidentDetail(dataInfo.incidentId).then(res => {
  169. uni.hideLoading();
  170. if(res.status == 200){
  171. dataInfo.incidentData = res.data || {};
  172. if(res.data.state.value!='pending' && res.data.state.value!='handler' && res.data.state.value!='reassign'){
  173. uni.showToast({
  174. icon: 'none',
  175. title: '工单状态异常!请刷新页面再重试',
  176. });
  177. setTimeout(_=>{
  178. goBack()
  179. },1000)
  180. return
  181. }
  182. let transferFlag = false;//转派权限
  183. let assignFlag = false;//指派权限
  184. let menu = JSON.parse(uni.getStorageSync("menuList")) || []; //菜单
  185. menu.forEach((e) => {
  186. if (e.title=='故障管理') {
  187. e.childrens.forEach((el) => {
  188. if(el.link=='incidentManagement'){
  189. el.childrens.forEach(item =>{
  190. if (item.link == "assign") {
  191. assignFlag = true
  192. }
  193. if (item.link == "transfer") {
  194. transferFlag = true
  195. }
  196. })
  197. }
  198. });
  199. }
  200. });
  201. // 转派
  202. if(dataInfo.incidentData.state.value == 'handler' && dataInfo.incidentData.handlingPersonnelUser && dataInfo.incidentData.handlingPersonnelUser.id == loginUserStore.loginUser.user.id && !assignFlag && transferFlag){
  203. dataInfo.tabs.splice(0, 0, {id: 1, name: '转派', value: 'redeploy', num: ''});
  204. }else if(dataInfo.incidentData.state.value == 'pending'){
  205. let inUser = dataInfo.incidentData.currentLog && dataInfo.incidentData.currentLog.workerId == loginUserStore.loginUser.user.id;
  206. let inGroup = false;
  207. let groupList = loginUserStore.loginUser.user.group || [];
  208. groupList.forEach(item => {
  209. if(dataInfo.incidentData.currentLog){
  210. if (item.id == dataInfo.incidentData.currentLog.groupId) {
  211. inGroup = true;
  212. }
  213. }
  214. })
  215. if((inUser || inGroup)){
  216. dataInfo.tabs.splice(0, 0, {id: 1, name: '转派', value: 'redeploy', num: ''});
  217. }
  218. }
  219. // 指派
  220. if((dataInfo.incidentData.state.value == 'pending' || dataInfo.incidentData.state.value == 'handler' || dataInfo.incidentData.state.value == 'reassign') && assignFlag){
  221. let index = dataInfo.tabs.findIndex(v => v.value === 'reassign');
  222. if(index < 0){
  223. dataInfo.tabs = [{id: 1, name: '指派', value: 'assign', num: ''}];
  224. }else{
  225. dataInfo.tabs.splice(index, 0, {id: 1, name: '指派', value: 'assign', num: ''});
  226. }
  227. }
  228. // 退回
  229. if(dataInfo.incidentData.state.value == 'pending' || dataInfo.incidentData.state.value == 'handler'){
  230. if(dataInfo.tabs.length){
  231. dataInfo.tabs.splice(dataInfo.tabs.length, 0, {id: 4, name: '退回', value: 'reassign', num: ''});
  232. }else{
  233. dataInfo.tabs = [{id: 4, name: '退回', value: 'reassign', num: ''}];
  234. }
  235. }
  236. dataInfo.tabActiveValue = dataInfo.tabs[0].value;
  237. initForm()
  238. }else{
  239. uni.showToast({
  240. icon: 'none',
  241. title: res.msg || '请求数据失败!'
  242. });
  243. }
  244. })
  245. }
  246. // 获取院区列表
  247. function getBranchs(){
  248. let arr = loginUserStore.loginUser.hospital.filter(i=>i.parent==undefined)
  249. dataInfo.branchList = arr.map(v => ({
  250. text: v.hosName,
  251. value: v.id,
  252. }));
  253. // uni.showLoading({
  254. // title: "加载中",
  255. // mask: true,
  256. // });
  257. // let postData = {
  258. // "idx": 0,
  259. // "sum": 9999,
  260. // hospital:{
  261. // selectType:"level1",
  262. // }
  263. // // parent:{id:loginUserStore.loginUser.user.currentHospital.id}
  264. // };
  265. // api_branch(postData).then(res => {
  266. // uni.hideLoading();
  267. // if(res.status == 200){
  268. // res.list = res.list || [];
  269. // dataInfo.branchList = res.list.map(v => ({
  270. // text: v.hosName,
  271. // value: v.id,
  272. // }));
  273. // if(loginUserStore.loginUser.user.duty){
  274. // // 当前的所属责任科室
  275. // dataInfo.branchId = loginUserStore.loginUser.user.duty.branch;
  276. // changeBranch();
  277. // dataInfo.dutyId = loginUserStore.loginUser.user.duty.id;
  278. // changeDuty();
  279. // }else if(loginUserStore.loginUser.user.branch){
  280. // // 当前的所属院区
  281. // dataInfo.branchId = loginUserStore.loginUser.user.branch.id;
  282. // changeBranch();
  283. // }
  284. // }else{
  285. // uni.showToast({
  286. // icon: 'none',
  287. // title: res.msg || '请求数据失败!'
  288. // });
  289. // }
  290. // })
  291. }
  292. // 获取责任科室列表
  293. function getDutys(){
  294. uni.showLoading({
  295. title: "加载中",
  296. mask: true,
  297. });
  298. let postData = {
  299. "idx": 0,
  300. "sum": 9999,
  301. hospital: {
  302. parent:{
  303. id:dataInfo.branchId
  304. },
  305. type:{value:6}
  306. }
  307. };
  308. api_branch(postData).then(res => {
  309. uni.hideLoading();
  310. if(res.status == 200){
  311. res.list = res.list || [];
  312. dataInfo.dutyList = res.list.map(v => ({
  313. text: v.hosName,
  314. value: v.id,
  315. }));
  316. }else{
  317. uni.showToast({
  318. icon: 'none',
  319. title: res.msg || '请求数据失败!'
  320. });
  321. }
  322. })
  323. }
  324. // 获取工作组列表
  325. function getGroups(){
  326. uni.showLoading({
  327. title: "加载中",
  328. mask: true,
  329. });
  330. let duty = undefined;
  331. if(dataInfo.tabActiveValue === 'redeploy'){
  332. duty = dataInfo.incidentData.duty.id;
  333. }else if(dataInfo.tabActiveValue === 'assign'){
  334. duty = dataInfo.dutyId;
  335. }
  336. let postData = {
  337. "idx": 0,
  338. "sum": 9999,
  339. "group2": {
  340. "hospitals": duty
  341. }
  342. };
  343. api_group(postData).then(res => {
  344. uni.hideLoading();
  345. if(res.status == 200){
  346. res.list = res.list || [];
  347. let arr = res.list.filter(i=>i.type==3)
  348. dataInfo.groupList = arr.map(v => ({
  349. text: v.groupName,
  350. value: v.id,
  351. }));
  352. }else{
  353. uni.showToast({
  354. icon: 'none',
  355. title: res.msg || '请求数据失败!'
  356. });
  357. }
  358. })
  359. }
  360. // 获取用户列表
  361. function getUsers(){
  362. uni.showLoading({
  363. title: "加载中",
  364. mask: true,
  365. });
  366. let postData = {
  367. "idx": 0,
  368. "sum": 9999,
  369. "user": {
  370. "groupdata":{
  371. "id": dataInfo.groupId,
  372. },
  373. roleCodes: 'first-line support,second-line support'
  374. // "roledata": {
  375. // "rolecode": "first-line support"
  376. // },
  377. // "roledata2": {
  378. // "rolecode": "second-line support"
  379. // },
  380. // "selectType": "1",
  381. // "selectDetails": 1,
  382. // "simple": true,
  383. // "engineer": 1
  384. }
  385. };
  386. api_user(postData).then(res => {
  387. uni.hideLoading();
  388. if(res.status == 200){
  389. res.list = res.list || [];
  390. dataInfo.userList = res.list.map(v => ({
  391. text: v.name,
  392. value: v.id,
  393. }));
  394. }else{
  395. uni.showToast({
  396. icon: 'none',
  397. title: res.msg || '请求数据失败!'
  398. });
  399. }
  400. })
  401. }
  402. // 选择院区
  403. function changeBranch(){
  404. dataInfo.dutyId = undefined;
  405. dataInfo.dutyList = [];
  406. dataInfo.groupId = undefined;
  407. dataInfo.groupList = [];
  408. dataInfo.userId = undefined;
  409. dataInfo.userList = [];
  410. getDutys();
  411. }
  412. // 选择责任科室
  413. function changeDuty(){
  414. dataInfo.groupId = undefined;
  415. dataInfo.groupList = [];
  416. dataInfo.userId = undefined;
  417. dataInfo.userList = [];
  418. getGroups();
  419. }
  420. // 选择工作组
  421. function changeGroup(){
  422. dataInfo.userId = undefined;
  423. dataInfo.userList = [];
  424. getUsers();
  425. }
  426. // 选择是否转派到人
  427. function changeIsAssignUser(){
  428. dataInfo.userId = undefined;
  429. }
  430. // 提交
  431. function submit(){
  432. isSubmit.value = true;
  433. if(dataInfo.tabActiveValue === 'redeploy'){
  434. submitRedeploy();
  435. }else if(dataInfo.tabActiveValue === 'assign'){
  436. submitAssign();
  437. }else if(dataInfo.tabActiveValue === 'reassign'){
  438. submitReassign();
  439. }
  440. }
  441. // 转派提交
  442. function submitRedeploy(){
  443. if(!dataInfo.groupId){
  444. uni.showToast({
  445. icon: 'none',
  446. title: '请选择工作组'
  447. });
  448. return;
  449. }
  450. if(dataInfo.isAssignUser == 1 && !dataInfo.userId){
  451. uni.showToast({
  452. icon: 'none',
  453. title: '请选择指派对象'
  454. });
  455. return;
  456. }
  457. uni.showLoading({
  458. title: "加载中",
  459. mask: true,
  460. });
  461. let postData = {
  462. incident: dataInfo.incidentData,
  463. }
  464. postData.incident.candidateGroupId = dataInfo.groupId;
  465. if(dataInfo.userId){
  466. // 派人
  467. postData.incident.assignee = dataInfo.userId;
  468. delete postData.incident.candidateGroups
  469. } else {
  470. // 派组
  471. postData.incident.candidateGroups = dataInfo.groupId;
  472. delete postData.incident.assignee
  473. }
  474. api_incidentTask(dataInfo.tabActiveValue, postData).then(res => {
  475. uni.hideLoading();
  476. if(res.state == 200){
  477. uni.showToast({
  478. icon: 'none',
  479. title: '转派成功',
  480. mask: true,
  481. });
  482. setTimeout(() => {
  483. uni.reLaunch({
  484. url: '/pages/incidentList/incidentList',
  485. })
  486. }, 1500)
  487. }else{
  488. uni.showToast({
  489. icon: 'none',
  490. title: res.msg || '请求数据失败!'
  491. });
  492. }
  493. })
  494. }
  495. // 指派提交
  496. function submitAssign(){
  497. if(!dataInfo.branchId){
  498. uni.showToast({
  499. icon: 'none',
  500. title: '请选择院区'
  501. });
  502. return;
  503. }
  504. if(!dataInfo.dutyId){
  505. uni.showToast({
  506. icon: 'none',
  507. title: '请选择责任科室'
  508. });
  509. return;
  510. }
  511. if(!dataInfo.groupId){
  512. uni.showToast({
  513. icon: 'none',
  514. title: '请选择工作组'
  515. });
  516. return;
  517. }
  518. if(dataInfo.isAssignUser == 1 && !dataInfo.userId){
  519. uni.showToast({
  520. icon: 'none',
  521. title: '请选择指派对象'
  522. });
  523. return;
  524. }
  525. uni.showLoading({
  526. title: "加载中",
  527. mask: true,
  528. });
  529. let postData = {
  530. incident: dataInfo.incidentData,
  531. }
  532. postData.incident.candidateGroupId = dataInfo.groupId;
  533. if(dataInfo.userId){
  534. // 派人
  535. postData.incident.assignee = dataInfo.userId;
  536. delete postData.incident.candidateGroups
  537. } else {
  538. // 派组
  539. postData.incident.candidateGroups = dataInfo.groupId;
  540. delete postData.incident.assignee
  541. }
  542. postData.incident.duty = { id: dataInfo.dutyId };
  543. // postData.incident.hosId = dataInfo.branchId
  544. api_incidentTask(dataInfo.tabActiveValue, postData).then(res => {
  545. uni.hideLoading();
  546. if(res.state == 200){
  547. uni.showToast({
  548. icon: 'none',
  549. title: '指派成功',
  550. mask: true,
  551. });
  552. setTimeout(() => {
  553. uni.reLaunch({
  554. url: '/pages/incidentList/incidentList',
  555. })
  556. }, 1500)
  557. }else{
  558. uni.showToast({
  559. icon: 'none',
  560. title: res.msg || '请求数据失败!'
  561. });
  562. }
  563. })
  564. }
  565. // 退回提交
  566. function submitReassign(){
  567. if(!dataInfo.reassignRemark.trim()){
  568. uni.showToast({
  569. icon: 'none',
  570. title: '请填写退回原因'
  571. });
  572. return;
  573. }
  574. uni.showLoading({
  575. title: "加载中",
  576. mask: true,
  577. });
  578. let postData = {
  579. incident: dataInfo.incidentData,
  580. }
  581. postData.incident.reassignRemark = dataInfo.reassignRemark;
  582. api_incidentTask(dataInfo.tabActiveValue, postData).then(res => {
  583. uni.hideLoading();
  584. if(res.state == 200){
  585. uni.showToast({
  586. icon: 'none',
  587. title: '退回成功',
  588. mask: true,
  589. });
  590. setTimeout(() => {
  591. uni.reLaunch({
  592. url: '/pages/incidentList/incidentList',
  593. })
  594. }, 1500)
  595. }else{
  596. uni.showToast({
  597. icon: 'none',
  598. title: res.msg || '请求数据失败!'
  599. });
  600. }
  601. })
  602. }
  603. onLoad((option) => {
  604. dataInfo.incidentId = option.incidentId;
  605. getIncidentDetail();
  606. })
  607. </script>
  608. <style lang="scss" scoped>
  609. .changeUser{
  610. height: 100%;
  611. display: flex;
  612. flex-direction: column;
  613. justify-content: space-between;
  614. .head{
  615. height: 88rpx;
  616. display: flex;
  617. position: fixed;
  618. z-index: 99;
  619. width: 100%;
  620. background-color: #fff;
  621. font-size: 30rpx;
  622. .tab{
  623. flex: 1;
  624. display: flex;
  625. justify-content: center;
  626. align-items: center;
  627. border-bottom: 4rpx solid transparent;
  628. &.active{
  629. color: $uni-primary;
  630. border-color: $uni-primary;
  631. }
  632. }
  633. }
  634. .body{
  635. margin-top: 88rpx;
  636. padding: 0 24rpx;
  637. box-sizing: border-box;
  638. flex: 1;
  639. min-height: 0;
  640. .form_item{
  641. display: flex;
  642. align-items: center;
  643. padding-top: 24rpx;
  644. min-height: 86rpx;
  645. &.column{
  646. height: auto;
  647. flex-direction: column;
  648. align-items: flex-start;
  649. .title{
  650. margin-right: 0;
  651. }
  652. .value{
  653. margin-top: 10rpx;
  654. padding-left: 20rpx;
  655. box-sizing: border-box;
  656. }
  657. .tips{
  658. padding: 24rpx;
  659. text-align: center;
  660. font-size: 22rpx;
  661. color: #909399;
  662. width: 100%;
  663. box-sizing: border-box;
  664. }
  665. }
  666. .title{
  667. font-size: 26rpx;
  668. display: flex;
  669. align-items: center;
  670. margin-right: 12rpx;
  671. &.select{
  672. width: calc(5em + 20rpx);
  673. }
  674. }
  675. }
  676. }
  677. }
  678. </style>