assign.vue 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501
  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. <!-- <scroll-view scroll-y class="body page_padding"> -->
  9. <view class="body page_padding view-body">
  10. <!-- 故障处理 -->
  11. <template v-if="dataInfo.tabActiveValue === 'direct'">
  12. <view class="form_item column" v-if="dataInfo.category.hasSimple != 1">
  13. <view class="title title-width">
  14. <text class="required newicon newicon-bitian"></text>
  15. <view class="title-fl-sb">
  16. 解决方案:
  17. <view @click="importRep('reissue','direct')" class="import-rep">引入知识库({{dataInfo.introduceCount}})</view>
  18. </view>
  19. </view>
  20. <uni-easyinput class="value" type="textarea" v-model="dataInfo.handleDescription" placeholder="请输入解决方案" :class="{formRed: isSubmit && !dataInfo.handleDescription.trim()}" />
  21. </view>
  22. <view class="form_item" v-if="dataInfo.category.hasSimple != 1">
  23. <view class="title"><text class="required newicon newicon-bitian"></text>故障现象:</view>
  24. <view class="value category" @click="selectCategory">
  25. <text class="categoryName ellipsis-multiline">{{dataInfo.category.mutiCategory}}</text>
  26. <text class="newicon newicon-weibiaoti2010104"></text>
  27. </view>
  28. </view>
  29. <view class="form_item">
  30. <view class="title select"><text class="required newicon newicon-bitian"></text>处理方式:</view>
  31. <!-- <uni-data-select class="value" v-model="dataInfo.handleCategory" :localdata="dataInfo.handleCategoryList" :clear="false" placeholder="请选择处理方式" :class="{formRed: isSubmit && !dataInfo.handleCategory}"></uni-data-select> -->
  32. <uni-data-picker class="value" placeholder="请选择处理方式"
  33. :localdata="dataInfo.handleCategoryList" v-model="dataInfo.handleCategory"
  34. :clear-icon="false" :class="{formRed: isSubmit && !dataInfo.handleCategory}">
  35. </uni-data-picker>
  36. </view>
  37. <view class="form_item" v-if="dataInfo.category.hasSimple != 1">
  38. <view class="title select"><text class="required newicon newicon-bitian"></text>处理结果:</view>
  39. <!-- <uni-data-select class="value" v-model="dataInfo.closecode" :localdata="dataInfo.closecodeList" :clear="false" placeholder="请选择处理结果" :class="{formRed: isSubmit && !dataInfo.closecode}"></uni-data-select> -->
  40. <uni-data-picker class="value" placeholder="请选择处理结果"
  41. :localdata="dataInfo.closecodeList" v-model="dataInfo.closecode"
  42. :clear-icon="false" :class="{formRed: isSubmit && !dataInfo.closecode}">
  43. </uni-data-picker>
  44. </view>
  45. <view class="form_item">
  46. <view class="title"><text class="required newicon newicon-bitian transparent"></text>协同人员:</view>
  47. <text class="synergeticNames ellipsis">{{dataInfo.synergetic.map(v => v.name).join(',')}}</text>
  48. <button type="primary" plain size="mini" class="primaryPlainButton synergeticAdd" @click="synergeticAdd">+立即添加</button>
  49. </view>
  50. <view class="form_item_column">
  51. <view class="form_item">
  52. <view class="title"><text class="required newicon newicon-bitian transparent"></text>处理图片:</view>
  53. <view class="value">
  54. <uni-file-picker ref="handlerImgRef" v-model="dataInfo.handlerImgList" limit="3" @success="handlerImgSuccess" @fail="handlerImgFail" @select="handlerImgSelect" @delete="handlerImgDelete"></uni-file-picker>
  55. </view>
  56. </view>
  57. <view class="form_item">
  58. <view class="title transparent"><text class="required newicon newicon-bitian transparent"></text>处理图片:</view>
  59. <view class="value">
  60. <text class="imgTips ellipsis">(支持JPG/PNG格式图片,单张大小10M以内)</text>
  61. </view>
  62. </view>
  63. </view>
  64. </template>
  65. <!-- 补单 -->
  66. <template v-if="dataInfo.tabActiveValue === 'supplement' && dataInfo.supplementFlag">
  67. <view class="form_item">
  68. <view class="title select"><text class="required newicon newicon-bitian"></text>登记时间:</view>
  69. <uni-datetime-picker class="value" type="datetime" v-model="dataInfo.acceptDate" :class="{formRed: isSubmit && !dataInfo.acceptDate}" />
  70. </view>
  71. <view class="form_item">
  72. <view class="title select"><text class="required newicon newicon-bitian"></text>接单时间:</view>
  73. <uni-datetime-picker class="value" type="datetime" v-model="dataInfo.responseHandleTime" :class="{formRed: isSubmit && !dataInfo.responseHandleTime}" />
  74. </view>
  75. <view class="form_item">
  76. <view class="title select"><text class="required newicon newicon-bitian"></text>解决时间:</view>
  77. <uni-datetime-picker class="value" type="datetime" v-model="dataInfo.handleTime" :class="{formRed: isSubmit && !dataInfo.handleTime}" />
  78. </view>
  79. <view class="form_item">
  80. <view class="title select"><text class="required newicon newicon-bitian"></text>处理人:</view>
  81. <uni-data-picker class="value" placeholder="请选择处理人"
  82. :localdata="dataInfo.userList" v-model="dataInfo.handlingPersonnelUserId"
  83. :clear-icon="false" :class="{formRed: isSubmit && !dataInfo.handlingPersonnelUserId}">
  84. </uni-data-picker>
  85. </view>
  86. </template>
  87. <!-- 补单-下一步 -->
  88. <template v-if="dataInfo.tabActiveValue === 'supplement' && !dataInfo.supplementFlag">
  89. <view class="form_item column" v-if="dataInfo.category.hasSimple != 1">
  90. <view class="title title-width">
  91. <text class="required newicon newicon-bitian"></text>
  92. <view class="title-fl-sb">
  93. 解决方案:
  94. <view @click="importRep('reissue','reissue')" class="import-rep">引入知识库({{dataInfo.introduceCount}})</view>
  95. </view>
  96. </view>
  97. <uni-easyinput class="value" type="textarea" v-model="dataInfo.handleDescription" placeholder="请输入解决方案" :class="{formRed: isSubmit && !dataInfo.handleDescription.trim()}" />
  98. </view>
  99. <view class="form_item" v-if="dataInfo.category.hasSimple != 1">
  100. <view class="title"><text class="required newicon newicon-bitian"></text>故障现象:</view>
  101. <view class="value category" @click="selectCategory('assign_supplement')">
  102. <text class="categoryName ellipsis-multiline">{{dataInfo.category.mutiCategory}}</text>
  103. <text class="newicon newicon-weibiaoti2010104"></text>
  104. </view>
  105. </view>
  106. <view class="form_item">
  107. <view class="title select"><text class="required newicon newicon-bitian"></text>处理方式:</view>
  108. <uni-data-picker class="value" placeholder="请选择处理方式"
  109. :localdata="dataInfo.handleCategoryList" v-model="dataInfo.handleCategory"
  110. :clear-icon="false" :class="{formRed: isSubmit && !dataInfo.handleCategory}">
  111. </uni-data-picker>
  112. </view>
  113. <view class="form_item" v-if="dataInfo.category.hasSimple != 1">
  114. <view class="title select"><text class="required newicon newicon-bitian"></text>处理结果:</view>
  115. <uni-data-picker class="value" placeholder="请选择处理结果"
  116. :localdata="dataInfo.closecodeList" v-model="dataInfo.closecode"
  117. :clear-icon="false" :class="{formRed: isSubmit && !dataInfo.closecode}">
  118. </uni-data-picker>
  119. </view>
  120. <view class="form_item">
  121. <view class="title"><text class="required newicon newicon-bitian transparent"></text>协同人员:</view>
  122. <text class="synergeticNames ellipsis">{{dataInfo.synergetic.map(v => v.name).join(',')}}</text>
  123. <button type="primary" plain size="mini" class="primaryPlainButton synergeticAdd" @click="synergeticAdd('assign_supplement')">+立即添加</button>
  124. </view>
  125. <view class="form_item_column">
  126. <view class="form_item">
  127. <view class="title"><text class="required newicon newicon-bitian transparent"></text>处理图片:</view>
  128. <view class="value">
  129. <uni-file-picker ref="handlerImgRef" v-model="dataInfo.handlerImgList" limit="3" @success="handlerImgSuccess" @fail="handlerImgFail" @select="handlerImgSelect" @delete="handlerImgDelete"></uni-file-picker>
  130. </view>
  131. </view>
  132. <view class="form_item">
  133. <view class="title transparent"><text class="required newicon newicon-bitian transparent"></text>处理图片:</view>
  134. <view class="value">
  135. <text class="imgTips ellipsis">(支持JPG/PNG格式图片,单张大小10M以内)</text>
  136. </view>
  137. </view>
  138. </view>
  139. </template>
  140. <!-- 派单 -->
  141. <template v-if="dataInfo.tabActiveValue === 'assign'">
  142. <view class="form_item">
  143. <view class="title select"><text class="required newicon newicon-bitian"></text>工作组:</view>
  144. <!-- <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> -->
  145. <uni-data-picker class="value" placeholder="请选择工作组"
  146. :localdata="dataInfo.groupList" v-model="dataInfo.groupId"
  147. :clear-icon="false" @change="changeGroup" :class="{formRed: isSubmit && !dataInfo.groupId}">
  148. </uni-data-picker>
  149. </view>
  150. <view class="form_item">
  151. <view class="title radio"><text class="required newicon newicon-bitian"></text>是否转派到人:</view>
  152. <uni-data-checkbox class="value" v-model="dataInfo.isAssignUser" :localdata="dataInfo.isAssignUserList" @change="changeIsAssignUser" />
  153. </view>
  154. <view class="form_item" v-if="dataInfo.isAssignUser === 1">
  155. <view class="title select"><text class="required newicon newicon-bitian"></text>转派对象:</view>
  156. <!-- <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> -->
  157. <uni-data-picker class="value" placeholder="请选择转派对象"
  158. :localdata="dataInfo.userList" v-model="dataInfo.userId"
  159. :clear-icon="false" :class="{formRed: isSubmit && dataInfo.groupId && dataInfo.isAssignUser == 1 && !dataInfo.userId}">
  160. </uni-data-picker>
  161. </view>
  162. <!-- <view class="form_item_column">
  163. <view class="form_item">
  164. <view class="title"><text class="required newicon newicon-bitian transparent"></text>处理图片:</view>
  165. <view class="value">
  166. <uni-file-picker ref="handlerImgRef" v-model="dataInfo.handlerImgList" limit="3" @success="handlerImgSuccess" @fail="handlerImgFail" @select="handlerImgSelect" @delete="handlerImgDelete"></uni-file-picker>
  167. </view>
  168. </view>
  169. <view class="form_item">
  170. <view class="title transparent"><text class="required newicon newicon-bitian transparent"></text>处理图片:</view>
  171. <view class="value">
  172. <text class="imgTips ellipsis">(支持JPG/PNG格式图片,单张大小10M以内)</text>
  173. </view>
  174. </view>
  175. </view> -->
  176. </template>
  177. </view>
  178. <!-- </scroll-view> -->
  179. <view class="foot_common_btns">
  180. <template v-if="dataInfo.tabActiveValue === 'supplement' && dataInfo.supplementFlag">
  181. <button @click="goBack" type="default" class="primaryButton btn">上一步</button>
  182. <button @click="next" type="default" class="primaryButton btn">下一步</button>
  183. </template>
  184. <template v-else>
  185. <button @click="previous" type="default" class="primaryButton btn" v-if="dataInfo.tabActiveValue === 'supplement'">上一步</button>
  186. <button @click="goBack" type="default" class="cancelButton btn" v-else>返回</button>
  187. <button @click="submit" type="default" class="primaryButton btn">提交</button>
  188. </template>
  189. </view>
  190. </view>
  191. </template>
  192. <script setup>
  193. import { ref, reactive, computed } from 'vue'
  194. import { onLoad } from '@dcloudio/uni-app'
  195. import { generateNumberArray } from '@/utils/index.js'
  196. import { api_group, api_incidentDetail, api_user, api_incidentTask, api_branch, api_dutyDepartment, api_getDictionary, api_querySummaryDoc, api_addSummaryDoc, api_systemConfiguration, api_sj } from "@/http/api.js"
  197. import { defaultColor } from '@/static/js/theme.js'
  198. import { useSetTitle } from '@/share/useSetTitle.js'
  199. import { useMakePhoneCall } from '@/share/useMakePhoneCall.js'
  200. import { useUploadFile } from '@/share/useUploadFile.js'
  201. import { useGoBack } from '@/share/useGoBack.js'
  202. import { useLoginUserStore } from '@/stores/loginUser'
  203. import { useHandlerStore } from '@/stores/handler'
  204. import { useIncidentBuildStore } from '@/stores/incidentBuild'
  205. useSetTitle();
  206. const loginUserStore = useLoginUserStore();
  207. const handlerStore = useHandlerStore();
  208. const incidentBuildStore = useIncidentBuildStore();
  209. const { makePhoneCall } = useMakePhoneCall();
  210. const { uploadFile } = useUploadFile();
  211. const { goBack } = useGoBack();
  212. // 主题颜色
  213. const primaryColor = ref(defaultColor)
  214. // 知识库id
  215. const solutionId = ref(null)
  216. // 数据
  217. const dataInfo = reactive({
  218. tabs: [
  219. {id: 5, name: '直接处理', value: 'direct', num: ''},
  220. // {id: 7, name: '补单', value: 'supplement', num: ''},
  221. {id: 6, name: '派单', value: 'assign', num: ''},
  222. ],
  223. tabActiveValue: 0,//当前选择的tab
  224. incidentId: undefined,//事件ID
  225. incidentData: {},//事件对象
  226. groupList: [], //工作组列表
  227. groupId: undefined, //工作组ID
  228. userIdList: [], //延期天数列表
  229. userIdId: undefined, //延期天数ID
  230. deferralRemark: '',//延期说明
  231. summaryObj: {
  232. consumableList: [],//耗材列表
  233. workHourManagementList: [],//工时列表
  234. },//汇总单信息
  235. summaryId: undefined,//汇总单Id
  236. isNumber: false,//修改数量弹窗
  237. evtNumber: 1,//弹窗返回的数量
  238. selectData: {},//选择的对象
  239. selectType: {},//选择的对象类型
  240. handleDescription: '',//解决方案
  241. handleCategory: undefined,//处理方式
  242. handleCategoryList: [],//处理方式列表
  243. closecode: undefined,//处理结果
  244. closecodeList: [],//处理结果列表
  245. handlerImgList: [],//处理图片列表
  246. category: {},//故障现象
  247. synergetic: [],//协同人员
  248. isAssignUser: 1, //工作组是否转派到人
  249. isAssignUserList: [
  250. { text: '是', value: 1 },
  251. { text: '否', value: 0 },
  252. ], //工作组是否转派到人选项
  253. supplementFlag: true,//补单是否有下一步
  254. acceptDate: undefined,//补单-登记时间
  255. responseHandleTime: undefined,//补单-接单时间
  256. handleTime: undefined,//补单-解决时间
  257. handlingPersonnelUserId: undefined,//补单-处理人
  258. introduceCount :0 //引入次数
  259. })
  260. // 是否提交
  261. const isSubmit = ref(false)
  262. // 处理图片
  263. const handlerImgRef = ref(null)
  264. // 上传报修图片
  265. function handlerImgSuccessNew(){
  266. let requestList = [];
  267. // 报修图片
  268. dataInfo.incidentData.repairImgList.forEach(v => {
  269. let repairOrderImg$ = repairOrderImg(v);
  270. requestList.push(repairOrderImg$);
  271. })
  272. Promise.all(requestList).then(resList => {
  273. uni.hideLoading();
  274. console.log(resList);
  275. incidentBuildStore.clearIncidentBuildData();
  276. uni.showToast({
  277. icon: 'none',
  278. title: '建单成功',
  279. mask: true,
  280. });
  281. setTimeout(() => {
  282. uni.reLaunch({
  283. url: '/pages/incidentList/incidentList',
  284. })
  285. }, 1500)
  286. })
  287. }
  288. // 上传处理图片成功
  289. function handlerImgSuccess(e){
  290. dataInfo.handlerImgList.forEach(v => {
  291. v.url = v.path;
  292. })
  293. console.log(dataInfo.handlerImgList);
  294. let requestList = [];
  295. // 处理图片
  296. dataInfo.handlerImgList.forEach(v => {
  297. let handlerOrderImg$ = handlerOrderImg(v);
  298. requestList.push(handlerOrderImg$);
  299. })
  300. // 报修图片
  301. dataInfo.incidentData.repairImgList.forEach(v => {
  302. let repairOrderImg$ = repairOrderImg(v);
  303. requestList.push(repairOrderImg$);
  304. })
  305. Promise.all(requestList).then(resList => {
  306. uni.hideLoading();
  307. console.log(resList);
  308. incidentBuildStore.clearIncidentBuildData();
  309. uni.showToast({
  310. icon: 'none',
  311. title: '建单成功',
  312. mask: true,
  313. });
  314. setTimeout(() => {
  315. uni.reLaunch({
  316. url: '/pages/incidentList/incidentList',
  317. })
  318. }, 1500)
  319. })
  320. }
  321. // 上传处理图片失败
  322. function handlerImgFail(e){
  323. dataInfo.handlerImgList.forEach(v => {
  324. v.url = v.path;
  325. })
  326. console.log(dataInfo.handlerImgList);
  327. }
  328. // 选择上传图片
  329. function handlerImgSelect(e){
  330. dataInfo.handlerImgList = dataInfo.handlerImgList.concat(e.tempFiles);
  331. console.log(dataInfo.handlerImgList);
  332. }
  333. // 删除上传图片
  334. function handlerImgDelete(e){
  335. dataInfo.handlerImgList = dataInfo.handlerImgList.filter(v => e.tempFile.uuid != v.uuid);
  336. console.log(dataInfo.handlerImgList);
  337. }
  338. // 添加协同人员
  339. function synergeticAdd(sign = 'assign'){
  340. handlerStore.setHandlerData(dataInfo, 'assign', sign);
  341. uni.navigateTo({
  342. url: `/pages/synergeticAdd/synergeticAdd?incidentId=${dataInfo.incidentId}`
  343. })
  344. }
  345. // 选择故障现象
  346. function selectCategory(sign = 'assign'){
  347. handlerStore.setHandlerData(dataInfo, 'assign', sign);
  348. uni.navigateTo({
  349. url: `/pages/categoryOne/categoryOne?incidentId=${dataInfo.incidentId}`
  350. })
  351. }
  352. // 点击修改数量
  353. function numberClick(data, type){
  354. if(type === 'editConsumable'){
  355. dataInfo.evtNumber = data.consumablesNum;
  356. }else if(type === 'editWorkHourManagement'){
  357. dataInfo.evtNumber = data.workHourNum2;
  358. }
  359. dataInfo.isNumber = true;
  360. dataInfo.selectData = data;
  361. dataInfo.selectType = type;
  362. }
  363. // 确认修改数量
  364. function conformNumber(evtNumber){
  365. dataInfo.evtNumber = evtNumber;
  366. dataInfo.isNumber = false;
  367. addSummaryDoc();
  368. }
  369. // 移除数量
  370. function removeNumber(evtNumber){
  371. dataInfo.evtNumber = evtNumber;
  372. dataInfo.isNumber = false;
  373. removeSummaryDoc();
  374. }
  375. // 关闭修改数量
  376. function cancelNumber(){
  377. dataInfo.isNumber = false;
  378. }
  379. // 修改耗材/工时
  380. function addSummaryDoc(){
  381. uni.showLoading({
  382. title: "加载中",
  383. mask: true,
  384. });
  385. let postData = {
  386. "summaryId": dataInfo.summaryId,
  387. "modifyNum": 'edit',
  388. };
  389. if(dataInfo.selectType === 'editConsumable'){
  390. postData.consumableList = [
  391. {
  392. "consumablesId": dataInfo.selectData.consumableId,
  393. "consumablesNum": dataInfo.evtNumber,
  394. }
  395. ];
  396. }else if(dataInfo.selectType === 'editWorkHourManagement'){
  397. postData.workHourManagementList = [
  398. {
  399. "workHourId": dataInfo.selectData.id,
  400. "workHourNum": dataInfo.evtNumber,
  401. }
  402. ];
  403. }
  404. api_addSummaryDoc(postData).then(res => {
  405. uni.hideLoading();
  406. if(res.status == 200){
  407. uni.showToast({
  408. icon: 'none',
  409. title: '修改数量成功',
  410. mask: true,
  411. });
  412. getSummaryList();
  413. }else{
  414. uni.showToast({
  415. icon: 'none',
  416. title: res.msg || '请求数据失败!'
  417. });
  418. }
  419. })
  420. }
  421. // 移除耗材/工时
  422. function removeSummaryDoc(){
  423. uni.showLoading({
  424. title: "加载中",
  425. mask: true,
  426. });
  427. let postData = {
  428. "summaryId": dataInfo.summaryId,
  429. "remove": 'remove',
  430. };
  431. if(dataInfo.selectType === 'editConsumable'){
  432. postData.consumableList = [
  433. {
  434. "consumablesId": dataInfo.selectData.consumableId,
  435. "consumablesNum": dataInfo.evtNumber,
  436. }
  437. ];
  438. }else if(dataInfo.selectType === 'editWorkHourManagement'){
  439. postData.workHourManagementList = [
  440. {
  441. "workHourId": dataInfo.selectData.id,
  442. "workHourNum": dataInfo.evtNumber,
  443. }
  444. ];
  445. }
  446. api_addSummaryDoc(postData).then(res => {
  447. uni.hideLoading();
  448. if(res.status == 200){
  449. uni.showToast({
  450. icon: 'none',
  451. title: '移除成功',
  452. mask: true,
  453. });
  454. getSummaryList();
  455. }else{
  456. uni.showToast({
  457. icon: 'none',
  458. title: res.msg || '请求数据失败!'
  459. });
  460. }
  461. })
  462. }
  463. // 重置
  464. function reset(){
  465. dataInfo.userList = [];//处理人列表
  466. dataInfo.repairTypeList = []; //延期原因列表
  467. dataInfo.groupId = undefined; //延期原因ID
  468. dataInfo.userIdList = []; //延期天数列表
  469. dataInfo.userIdId = undefined; //延期天数ID
  470. dataInfo.deferralRemark = '';//延期说明
  471. dataInfo.summaryObj = {
  472. consumableList: [],//耗材列表
  473. workHourManagementList: [],//工时列表
  474. };//汇总单信息
  475. dataInfo.summaryId = undefined;//汇总单Id
  476. dataInfo.isNumber = false;//修改数量弹窗
  477. dataInfo.evtNumber = 1;//弹窗返回的数量
  478. dataInfo.selectData = {};//选择的对象
  479. dataInfo.selectType = {};//选择的对象类型
  480. dataInfo.handleDescription = '';//解决方案
  481. solutionId.value = null;//引用知识库id
  482. dataInfo.introduceCount = 0;//引用知识库次数
  483. dataInfo.handleCategory = undefined;//处理方式
  484. dataInfo.handleCategoryList = [];//处理方式列表
  485. dataInfo.closecode = undefined;//处理结果
  486. dataInfo.closecodeList = [];//处理结果列表
  487. dataInfo.handlerImgList = [];//处理图片列表
  488. dataInfo.category = {};//故障现象
  489. dataInfo.synergetic = [];//协同人员
  490. }
  491. // 初始化表单
  492. function initForm(){
  493. if(dataInfo.tabActiveValue === 'direct'){
  494. getHandleCategorys();
  495. getClosecodes();
  496. }else if(dataInfo.tabActiveValue === 'supplement'){
  497. getHandleCategorys();
  498. getClosecodes();
  499. getUsers();
  500. }else if(dataInfo.tabActiveValue === 'assign'){
  501. getGroups();
  502. }
  503. }
  504. // 点击tab
  505. function clickTab(tabValue){
  506. if(dataInfo.tabActiveValue == tabValue){
  507. return;
  508. }
  509. dataInfo.tabActiveValue = tabValue;
  510. isSubmit.value = false;
  511. reset();
  512. dataInfo.category = dataInfo.incidentData.category || {};
  513. dataInfo.synergetic = dataInfo.incidentData.synergetic || [];
  514. initForm();
  515. }
  516. // 选择工作组
  517. function changeGroup(){
  518. dataInfo.userId = undefined;
  519. dataInfo.userList = [];
  520. getUsers();
  521. }
  522. // 选择是否转派到人
  523. function changeIsAssignUser(){
  524. dataInfo.userId = undefined;
  525. }
  526. // 获取工作组列表
  527. function getGroups(){
  528. uni.showLoading({
  529. title: "加载中",
  530. mask: true,
  531. });
  532. let postData = {
  533. "idx": 0,
  534. "sum": 9999,
  535. "group": {
  536. "duty": dataInfo.incidentData.duty || undefined,
  537. "selectType": "nouser"
  538. }
  539. };
  540. api_group(postData).then(res => {
  541. uni.hideLoading();
  542. if(res.status == 200){
  543. res.list = res.list || [];
  544. dataInfo.groupList = res.list.map(v => ({
  545. text: v.groupName,
  546. value: v.id,
  547. }));
  548. }else{
  549. uni.showToast({
  550. icon: 'none',
  551. title: res.msg || '请求数据失败!'
  552. });
  553. }
  554. })
  555. }
  556. /**
  557. * 获取用户列表
  558. * @param {boolean} noGroup 是否查询组里的用户
  559. */
  560. function getUsers(noGroup = false){
  561. uni.showLoading({
  562. title: "加载中",
  563. mask: true,
  564. });
  565. let postData = {
  566. "idx": 0,
  567. "sum": 9999,
  568. "user": {
  569. "duty": dataInfo.incidentData.duty || undefined,
  570. "groupdata": (dataInfo.groupId && !noGroup) ? { "id": dataInfo.groupId } : undefined,
  571. "roledata": {
  572. "rolecode": "first-line support"
  573. },
  574. "selectType": "1",
  575. "selectDetails": 1,
  576. "simple": true,
  577. "engineer": 1,
  578. }
  579. };
  580. api_user(postData).then(res => {
  581. uni.hideLoading();
  582. if(res.status == 200){
  583. res.list = res.list || [];
  584. dataInfo.userList = res.list.map(v => ({
  585. text: v.name,
  586. value: v.id,
  587. }));
  588. }else{
  589. uni.showToast({
  590. icon: 'none',
  591. title: res.msg || '请求数据失败!'
  592. });
  593. }
  594. })
  595. }
  596. // 获取处理方式列表
  597. function getHandleCategorys(){
  598. uni.showLoading({
  599. title: "加载中",
  600. mask: true,
  601. });
  602. let postData = {
  603. "key": 'incident_handleCategory',
  604. "type": "list",
  605. };
  606. api_getDictionary(postData).then(res => {
  607. uni.hideLoading();
  608. res = res || [];
  609. dataInfo.handleCategoryList = res.map(v => ({
  610. text: v.name,
  611. value: v.id,
  612. key: v.value,
  613. }));
  614. if(!dataInfo.handleCategory){
  615. let handleCategory = dataInfo.handleCategoryList.find(v => v.key == 'SUPPORT');
  616. dataInfo.handleCategory = handleCategory ? handleCategory.value : undefined;
  617. }
  618. })
  619. }
  620. // 获取处理结果列表
  621. function getClosecodes(){
  622. uni.showLoading({
  623. title: "加载中",
  624. mask: true,
  625. });
  626. let postData = {
  627. "key": 'incident_closecode',
  628. "type": "list",
  629. };
  630. api_getDictionary(postData).then(res => {
  631. uni.hideLoading();
  632. res = res || [];
  633. dataInfo.closecodeList = res.map(v => ({
  634. text: v.name,
  635. value: v.id,
  636. key: v.value,
  637. }));
  638. if(!dataInfo.closecode){
  639. let closecode = dataInfo.closecodeList.find(v => v.key == '060');
  640. dataInfo.closecode = closecode ? closecode.value : undefined;
  641. }
  642. })
  643. }
  644. // 添加耗材
  645. function addConsumable(){
  646. uni.navigateTo({
  647. url: `/pages/consumableList/consumableList?incidentId=${dataInfo.incidentId}&summaryId=${dataInfo.summaryId}`
  648. })
  649. }
  650. // 添加工时
  651. function addWorkHourManagement(){
  652. uni.navigateTo({
  653. url: `/pages/workHourManagementOne/workHourManagementOne?incidentId=${dataInfo.incidentId}&summaryId=${dataInfo.summaryId}`
  654. })
  655. }
  656. // 补单-上一步
  657. function previous(){
  658. dataInfo.supplementFlag = true;
  659. }
  660. // 补单-下一步
  661. function next(){
  662. console.log(dataInfo)
  663. isSubmit.value = true;
  664. if(!dataInfo.acceptDate){
  665. uni.showToast({
  666. icon: 'none',
  667. title: '请选择登记时间'
  668. });
  669. return;
  670. }
  671. if(!dataInfo.responseHandleTime){
  672. uni.showToast({
  673. icon: 'none',
  674. title: '请选择接单时间'
  675. });
  676. return;
  677. }
  678. if(!dataInfo.handleTime){
  679. uni.showToast({
  680. icon: 'none',
  681. title: '请选择解决时间'
  682. });
  683. return;
  684. }
  685. if(!dataInfo.handlingPersonnelUserId){
  686. uni.showToast({
  687. icon: 'none',
  688. title: '请选择处理人'
  689. });
  690. return;
  691. }
  692. dataInfo.supplementFlag = false;
  693. isSubmit.value = false;
  694. }
  695. // 提交
  696. function submit(){
  697. isSubmit.value = true;
  698. if(dataInfo.tabActiveValue === 'direct'){
  699. submitHandler();
  700. }else if(dataInfo.tabActiveValue === 'supplement'){
  701. submitSupplement();
  702. }else if(dataInfo.tabActiveValue === 'assign'){
  703. submitAssign();
  704. }
  705. }
  706. // 处理提交事件
  707. async function handlerOrder(){
  708. let postData = {
  709. incident: dataInfo.incidentData,
  710. solutionId: solutionId.value
  711. }
  712. let result = await beforeBuild();
  713. if(result[0].status == 200 && result[1].status == 200){
  714. postData.incident.repairType = result[0].list.length ? result[0].list[0].valueconfig : undefined;
  715. postData.incident.incidentsign = result[1].data || undefined;
  716. }else{
  717. uni.showToast({
  718. icon: 'none',
  719. title: '请求数据失败!'
  720. });
  721. return;
  722. }
  723. postData.incident.handleDescription = dataInfo.handleDescription;
  724. postData.incident.handleCategory = {id: dataInfo.handleCategory};
  725. postData.incident.closecode = {id: dataInfo.closecode};
  726. postData.incident.category = dataInfo.category;
  727. postData.incident.synergetic = dataInfo.synergetic;
  728. postData.incident.directProcess = 1;//直接解决
  729. return api_incidentTask('accept', postData);
  730. }
  731. // 补单提交事件
  732. async function supplementOrder(){
  733. let postData = {
  734. incident: dataInfo.incidentData,
  735. solutionId: solutionId.value
  736. }
  737. let result = await beforeBuild();
  738. if(result[0].status == 200 && result[1].status == 200){
  739. postData.incident.repairType = result[0].list.length ? result[0].list[0].valueconfig : undefined;
  740. postData.incident.incidentsign = result[1].data || undefined;
  741. }else{
  742. uni.showToast({
  743. icon: 'none',
  744. title: '请求数据失败!'
  745. });
  746. return;
  747. }
  748. postData.incident.handleDescription = dataInfo.handleDescription;
  749. postData.incident.handleCategory = {id: dataInfo.handleCategory};
  750. postData.incident.closecode = {id: dataInfo.closecode};
  751. postData.incident.category = dataInfo.category;
  752. postData.incident.synergetic = dataInfo.synergetic;
  753. postData.incident.directProcess = 1;//直接解决
  754. postData.incident.acceptDate = dataInfo.acceptDate;
  755. postData.incident.responseHandleTime = dataInfo.responseHandleTime;
  756. postData.incident.handleTime = dataInfo.handleTime;
  757. postData.incident.handlingPersonnelUser = { id: dataInfo.handlingPersonnelUserId };
  758. console.log(postData.incident)
  759. return api_incidentTask('patchOrder', postData);
  760. }
  761. // 建单前的接口
  762. function beforeBuild(){
  763. let repairMain$ = api_systemConfiguration({
  764. "idx": 0,
  765. "sum": 1,
  766. "systemConfiguration": {
  767. "keyconfig": "repairMain"
  768. }
  769. })
  770. let sj$ = api_sj();
  771. return Promise.all([repairMain$, sj$])
  772. }
  773. // 派单提交事件
  774. async function assignOrder(){
  775. let postData = {
  776. incident: dataInfo.incidentData,
  777. }
  778. let result = await beforeBuild();
  779. if(result[0].status == 200 && result[1].status == 200){
  780. postData.incident.repairType = result[0].list.length ? result[0].list[0].valueconfig : undefined;
  781. postData.incident.incidentsign = result[1].data || undefined;
  782. }else{
  783. uni.showToast({
  784. icon: 'none',
  785. title: '请求数据失败!'
  786. });
  787. return;
  788. }
  789. if(dataInfo.userId){
  790. // 派人
  791. postData.incident.assignee = dataInfo.userId;
  792. } else {
  793. // 派组
  794. postData.incident.candidateGroups = dataInfo.groupId;
  795. }
  796. return api_incidentTask('accept', postData);
  797. }
  798. // 处理图片
  799. function handlerOrderImg(imgObj){
  800. return uploadFile(imgObj, 'incident', dataInfo.incidentId)
  801. }
  802. // 报修图片
  803. function repairOrderImg(imgObj){
  804. return uploadFile(imgObj, 'wechatRequesterIncident', dataInfo.incidentId)
  805. }
  806. // 引入知识库
  807. function importRep(type,tabType){
  808. handlerStore.setHandlerData(dataInfo, 'assign', 'assign');
  809. uni.navigateTo({
  810. url: `/pages/repository/repository?incidentId=${dataInfo.incidentId}
  811. &operateType=${type}&tabType=${tabType}`
  812. })
  813. }
  814. // 处理提交
  815. function submitHandler(){
  816. console.log(dataInfo);
  817. if(!dataInfo.handleDescription.trim() && dataInfo.category.hasSimple != 1){
  818. uni.showToast({
  819. icon: 'none',
  820. title: '请填写解决方案'
  821. });
  822. return;
  823. }
  824. if(!dataInfo.category.id && dataInfo.category.hasSimple != 1){
  825. uni.showToast({
  826. icon: 'none',
  827. title: '请选择故障现象'
  828. });
  829. return;
  830. }
  831. if(!dataInfo.handleCategory){
  832. uni.showToast({
  833. icon: 'none',
  834. title: '请选择处理方式'
  835. });
  836. return;
  837. }
  838. if(!dataInfo.closecode && dataInfo.category.hasSimple != 1){
  839. uni.showToast({
  840. icon: 'none',
  841. title: '请选择处理结果'
  842. });
  843. return;
  844. }
  845. if(!dataInfo.incidentData.duty){
  846. uni.showToast({
  847. icon: 'none',
  848. title: '您选择的故障现象没有设置责任科室'
  849. });
  850. return;
  851. }
  852. console.log(dataInfo)
  853. console.log(dataInfo.handlerImgList)
  854. console.log(dataInfo.incidentData.repairImgList)
  855. uni.showLoading({
  856. title: "加载中",
  857. mask: true,
  858. });
  859. if(dataInfo.handlerImgList.length){
  860. // 有处理图片
  861. let handlerOrder$ = handlerOrder();
  862. let requestList = [handlerOrder$];
  863. Promise.all(requestList).then(resList => {
  864. console.log(resList);
  865. if(resList[0].state == 200){
  866. dataInfo.incidentId = resList[0].data.id;
  867. handlerImgRef.value.upload();
  868. }else{
  869. uni.hideLoading();
  870. uni.showToast({
  871. icon: 'none',
  872. title: resList[0].msg || '请求数据失败!'
  873. });
  874. }
  875. })
  876. }else if(dataInfo.incidentData.repairImgList.length){
  877. // 有报修图片,无处理图片
  878. let handlerOrder$ = handlerOrder();
  879. let requestList = [handlerOrder$];
  880. Promise.all(requestList).then(resList => {
  881. console.log(resList);
  882. if(resList[0].state == 200){
  883. dataInfo.incidentId = resList[0].data.id;
  884. handlerImgSuccessNew();
  885. }else{
  886. uni.hideLoading();
  887. uni.showToast({
  888. icon: 'none',
  889. title: resList[0].msg || '请求数据失败!'
  890. });
  891. }
  892. })
  893. }else{
  894. // 没有图片
  895. let handlerOrder$ = handlerOrder();
  896. let requestList = [handlerOrder$];
  897. Promise.all(requestList).then(resList => {
  898. uni.hideLoading();
  899. console.log(resList);
  900. if(resList[0].state == 200){
  901. incidentBuildStore.clearIncidentBuildData();
  902. uni.showToast({
  903. icon: 'none',
  904. title: '建单成功',
  905. mask: true,
  906. });
  907. setTimeout(() => {
  908. uni.reLaunch({
  909. url: '/pages/incidentList/incidentList',
  910. })
  911. }, 1500)
  912. }else{
  913. uni.showToast({
  914. icon: 'none',
  915. title: resList[0].msg || '请求数据失败!'
  916. });
  917. }
  918. })
  919. }
  920. }
  921. // 派单提交
  922. function submitAssign(){
  923. if(!dataInfo.groupId){
  924. uni.showToast({
  925. icon: 'none',
  926. title: '请选择工作组'
  927. });
  928. return;
  929. }
  930. if(dataInfo.isAssignUser == 1 && !dataInfo.userId){
  931. uni.showToast({
  932. icon: 'none',
  933. title: '请选择指派对象'
  934. });
  935. return;
  936. }
  937. if(!dataInfo.incidentData.duty){
  938. uni.showToast({
  939. icon: 'none',
  940. title: '您选择的故障现象没有设置责任科室'
  941. });
  942. return;
  943. }
  944. uni.showLoading({
  945. title: "加载中",
  946. mask: true,
  947. });
  948. if(dataInfo.incidentData.repairImgList.length){
  949. // 有图片
  950. let assignOrder$ = assignOrder();
  951. let requestList = [assignOrder$];
  952. Promise.all(requestList).then(resList => {
  953. console.log(resList);
  954. if(resList[0].state == 200){
  955. dataInfo.incidentId = resList[0].data.id;
  956. // handlerImgRef.value.upload();
  957. handlerImgSuccessNew();
  958. }else{
  959. uni.hideLoading();
  960. uni.showToast({
  961. icon: 'none',
  962. title: resList[0].msg || '请求数据失败!'
  963. });
  964. }
  965. })
  966. }else{
  967. // 没有图片
  968. let assignOrder$ = assignOrder();
  969. let requestList = [assignOrder$];
  970. Promise.all(requestList).then(resList => {
  971. uni.hideLoading();
  972. console.log(resList);
  973. if(resList[0].state == 200){
  974. incidentBuildStore.clearIncidentBuildData();
  975. uni.showToast({
  976. icon: 'none',
  977. title: '建单成功',
  978. mask: true,
  979. });
  980. setTimeout(() => {
  981. uni.reLaunch({
  982. url: '/pages/incidentList/incidentList',
  983. })
  984. }, 1500)
  985. }else{
  986. uni.showToast({
  987. icon: 'none',
  988. title: resList[0].msg || '请求数据失败!'
  989. });
  990. }
  991. })
  992. }
  993. }
  994. // 补单提交
  995. function submitSupplement(){
  996. console.log(dataInfo);
  997. if(!dataInfo.handleDescription.trim() && dataInfo.category.hasSimple != 1){
  998. uni.showToast({
  999. icon: 'none',
  1000. title: '请填写解决方案'
  1001. });
  1002. return;
  1003. }
  1004. if(!dataInfo.category.id && dataInfo.category.hasSimple != 1){
  1005. uni.showToast({
  1006. icon: 'none',
  1007. title: '请选择故障现象'
  1008. });
  1009. return;
  1010. }
  1011. if(!dataInfo.handleCategory){
  1012. uni.showToast({
  1013. icon: 'none',
  1014. title: '请选择处理方式'
  1015. });
  1016. return;
  1017. }
  1018. if(!dataInfo.closecode && dataInfo.category.hasSimple != 1){
  1019. uni.showToast({
  1020. icon: 'none',
  1021. title: '请选择处理结果'
  1022. });
  1023. return;
  1024. }
  1025. if(!dataInfo.incidentData.duty){
  1026. uni.showToast({
  1027. icon: 'none',
  1028. title: '您选择的故障现象没有设置责任科室'
  1029. });
  1030. return;
  1031. }
  1032. console.log(dataInfo)
  1033. console.log(dataInfo.handlerImgList)
  1034. console.log(dataInfo.incidentData.repairImgList)
  1035. uni.showLoading({
  1036. title: "加载中",
  1037. mask: true,
  1038. });
  1039. if(dataInfo.handlerImgList.length){
  1040. // 有处理图片
  1041. let supplementOrder$ = supplementOrder();
  1042. let requestList = [supplementOrder$];
  1043. Promise.all(requestList).then(resList => {
  1044. console.log(resList);
  1045. if(resList[0].state == 200){
  1046. dataInfo.incidentId = resList[0].data.id;
  1047. handlerImgRef.value.upload();
  1048. }else{
  1049. uni.hideLoading();
  1050. uni.showToast({
  1051. icon: 'none',
  1052. title: resList[0].msg || '请求数据失败!'
  1053. });
  1054. }
  1055. })
  1056. }else if(dataInfo.incidentData.repairImgList.length){
  1057. // 有报修图片,无处理图片
  1058. let supplementOrder$ = supplementOrder();
  1059. let requestList = [supplementOrder$];
  1060. Promise.all(requestList).then(resList => {
  1061. console.log(resList);
  1062. if(resList[0].state == 200){
  1063. dataInfo.incidentId = resList[0].data.id;
  1064. handlerImgSuccessNew();
  1065. }else{
  1066. uni.hideLoading();
  1067. uni.showToast({
  1068. icon: 'none',
  1069. title: resList[0].msg || '请求数据失败!'
  1070. });
  1071. }
  1072. })
  1073. }else{
  1074. // 没有图片
  1075. let supplementOrder$ = supplementOrder();
  1076. let requestList = [supplementOrder$];
  1077. Promise.all(requestList).then(resList => {
  1078. uni.hideLoading();
  1079. console.log(resList);
  1080. if(resList[0].state == 200){
  1081. incidentBuildStore.clearIncidentBuildData();
  1082. uni.showToast({
  1083. icon: 'none',
  1084. title: '建单成功',
  1085. mask: true,
  1086. });
  1087. setTimeout(() => {
  1088. uni.reLaunch({
  1089. url: '/pages/incidentList/incidentList',
  1090. })
  1091. }, 1500)
  1092. }else{
  1093. uni.showToast({
  1094. icon: 'none',
  1095. title: resList[0].msg || '请求数据失败!'
  1096. });
  1097. }
  1098. })
  1099. }
  1100. }
  1101. // 菜单权限
  1102. function menuAuthHandle(){
  1103. let shijianliebiao_supplement = false;//故障处理权限
  1104. for (let i = 0; i < loginUserStore.loginUser.menu.length; i++) {
  1105. if (loginUserStore.loginUser.menu[i].link == "shijianliebiao_supplement") {
  1106. shijianliebiao_supplement = true
  1107. }
  1108. }
  1109. // 补单
  1110. if(shijianliebiao_supplement){
  1111. let index = dataInfo.tabs.findIndex(v => v.value === 'assign');
  1112. dataInfo.tabs.splice(index, 0, {id: 7, name: '补单', value: 'supplement', num: ''});
  1113. }
  1114. }
  1115. // 获取文本内容
  1116. function getHtml(html) {
  1117. const tempDiv = document.createElement('div');
  1118. tempDiv.innerHTML = html;
  1119. return tempDiv.textContent || tempDiv.innerText || '';
  1120. }
  1121. onLoad((option) => {
  1122. menuAuthHandle()
  1123. // 跳转页面选择了选项
  1124. if(handlerStore.handler.data){
  1125. Object.assign(dataInfo, handlerStore.handler.data);
  1126. console.log(dataInfo)
  1127. if(handlerStore.handler.sign === 'assign'){
  1128. dataInfo.tabActiveValue = 'direct';
  1129. }else if(handlerStore.handler.sign === 'assign_supplement'){
  1130. dataInfo.tabActiveValue = 'supplement';
  1131. next();
  1132. }
  1133. handlerStore.clearHandlerData();
  1134. if(dataInfo.category){
  1135. dataInfo.incidentData.category = dataInfo.category;
  1136. // 处理责任科室
  1137. if(dataInfo.category.branchType == 1){
  1138. // 分院区
  1139. if(dataInfo.incidentData.branch){
  1140. let dutyConfig = dataInfo.category.branchUserGroups.find(v=>v.branchId == dataInfo.incidentData.branch);
  1141. if(dutyConfig && dutyConfig.dutyId && dutyConfig.dutyName){
  1142. dataInfo.incidentData.duty = {id:dutyConfig.dutyId,dept:dutyConfig.dutyName};
  1143. }else{
  1144. dataInfo.incidentData.duty = undefined;
  1145. }
  1146. }else{
  1147. dataInfo.incidentData.duty = undefined;
  1148. }
  1149. }else{
  1150. // 不分院区
  1151. dataInfo.incidentData.duty = dataInfo.category.dutyDepartment;
  1152. }
  1153. }
  1154. }else if(incidentBuildStore.incidentBuild.data){
  1155. // 初始化
  1156. Object.assign(dataInfo.incidentData, incidentBuildStore.incidentBuild.data);
  1157. if(dataInfo.incidentData.category){
  1158. dataInfo.category = dataInfo.incidentData.category;
  1159. // 处理责任科室
  1160. if(dataInfo.category.branchType == 1){
  1161. // 分院区
  1162. if(dataInfo.incidentData.branch){
  1163. let dutyConfig = dataInfo.category.branchUserGroups.find(v=>v.branchId == dataInfo.incidentData.branch);
  1164. if(dutyConfig && dutyConfig.dutyId && dutyConfig.dutyName){
  1165. dataInfo.incidentData.duty = {id:dutyConfig.dutyId,dept:dutyConfig.dutyName};
  1166. }else{
  1167. dataInfo.incidentData.duty = undefined;
  1168. }
  1169. }else{
  1170. dataInfo.incidentData.duty = undefined;
  1171. }
  1172. }else{
  1173. // 不分院区
  1174. dataInfo.incidentData.duty = dataInfo.category.dutyDepartment;
  1175. }
  1176. }
  1177. if(dataInfo.incidentData.priority){
  1178. dataInfo.incidentData.priority = { id: dataInfo.incidentData.priority };
  1179. }
  1180. if(dataInfo.incidentData.source){
  1181. dataInfo.incidentData.source = { id: dataInfo.incidentData.source };
  1182. }
  1183. if(dataInfo.incidentData.requester){
  1184. dataInfo.incidentData.requester = dataInfo.incidentData.requester
  1185. }
  1186. }
  1187. if(!dataInfo.tabActiveValue){
  1188. dataInfo.tabActiveValue = dataInfo.tabs[0].value;
  1189. }
  1190. if(option.type&&decodeURIComponent(option.type=='rep')){
  1191. let handleDescription = decodeURIComponent(option.handleDescription)
  1192. solutionId.value = JSON.parse(decodeURIComponent(option.solutionId))
  1193. dataInfo.introduceCount = decodeURIComponent(option.introduceCount!="undefined"?option.introduceCount:0)
  1194. if(option.tabType&&decodeURIComponent(option.tabType)=='direct'){
  1195. dataInfo.tabActiveValue = 'direct'
  1196. }else{
  1197. dataInfo.tabActiveValue = 'supplement'
  1198. dataInfo.supplementFlag = false
  1199. }
  1200. if(handleDescription!='undefined'){
  1201. dataInfo.handleDescription = getHtml(handleDescription);
  1202. }
  1203. }
  1204. initForm()
  1205. })
  1206. </script>
  1207. <style lang="scss" scoped>
  1208. .handler{
  1209. height: 100%;
  1210. display: flex;
  1211. flex-direction: column;
  1212. justify-content: space-between;
  1213. .head{
  1214. height: 88rpx;
  1215. display: flex;
  1216. position: fixed;
  1217. z-index: 99;
  1218. width: 100%;
  1219. background-color: #fff;
  1220. font-size: 30rpx;
  1221. .tab{
  1222. flex: 1;
  1223. display: flex;
  1224. justify-content: center;
  1225. align-items: center;
  1226. border-bottom: 4rpx solid transparent;
  1227. &.active{
  1228. color: $uni-primary;
  1229. border-color: $uni-primary;
  1230. }
  1231. }
  1232. }
  1233. .body{
  1234. margin-top: 88rpx;
  1235. box-sizing: border-box;
  1236. flex: 1;
  1237. min-height: 0;
  1238. &.bg{
  1239. background-color: #F7F7F7;
  1240. }
  1241. .summaryItem{
  1242. &:first-of-type{
  1243. .summaryItem_head{
  1244. border-bottom: 1rpx solid #DDDDDD;
  1245. }
  1246. }
  1247. .summary_total{
  1248. padding: 20rpx 0;
  1249. display: flex;
  1250. justify-content: center;
  1251. align-items: center;
  1252. }
  1253. .summaryItem_head{
  1254. padding: 24rpx;
  1255. font-size: 26rpx;
  1256. color: #3A3A3A;
  1257. }
  1258. .summaryItem_body{
  1259. font-size: 30rpx;
  1260. background-color: #fff;
  1261. .summaryItem_bodyItem{
  1262. padding: 24rpx;
  1263. border-bottom: 1rpx solid #DDDDDD;
  1264. .summaryItem_bodyItem_top{
  1265. display: flex;
  1266. justify-content: space-between;
  1267. align-items: center;
  1268. .value{
  1269. padding-left: 48rpx;
  1270. flex-shrink: 0;
  1271. }
  1272. }
  1273. .summaryItem_bodyItem_bottom{
  1274. margin-top: 24rpx;
  1275. display: flex;
  1276. justify-content: space-between;
  1277. align-items: center;
  1278. .name{
  1279. text-align: right;
  1280. flex: 1;
  1281. }
  1282. .value{
  1283. width: 240rpx;
  1284. text-align: right;
  1285. padding-left: 48rpx;
  1286. flex-shrink: 0;
  1287. }
  1288. }
  1289. }
  1290. }
  1291. .summaryItem_foot{
  1292. font-size: 30rpx;
  1293. background-color: #fff;
  1294. &.total{
  1295. margin-top: 24rpx;
  1296. }
  1297. .summaryItem_foot_total{
  1298. padding: 24rpx 0;
  1299. display: flex;
  1300. justify-content: center;
  1301. align-items: center;
  1302. }
  1303. .summaryItem_foot_add{
  1304. border-top: 1rpx solid #DDDDDD;
  1305. padding: 24rpx 0;
  1306. display: flex;
  1307. justify-content: center;
  1308. align-items: center;
  1309. .newicon-icon-test{
  1310. font-size: 30rpx;
  1311. font-weight: bold;
  1312. }
  1313. }
  1314. }
  1315. }
  1316. .form_item_column{
  1317. padding-top: 24rpx;
  1318. min-height: 86rpx;
  1319. .form_item{
  1320. padding-top: 0;
  1321. min-height: auto;
  1322. }
  1323. }
  1324. .form_item{
  1325. display: flex;
  1326. align-items: center;
  1327. padding-top: 24rpx;
  1328. min-height: 86rpx;
  1329. &.column{
  1330. height: auto;
  1331. flex-direction: column;
  1332. align-items: flex-start;
  1333. .import-rep{
  1334. padding: 5rpx 10rpx;
  1335. border-radius: 50rpx;
  1336. background: #d1fcd5;
  1337. color: #49b856;
  1338. font-size: 24rpx;
  1339. }
  1340. .title{
  1341. margin-right: 0;
  1342. }
  1343. .title-width{
  1344. width: 100%;
  1345. }
  1346. .title-fl-sb{
  1347. display: flex;
  1348. justify-content: space-between;
  1349. width: 100%;
  1350. }
  1351. .value{
  1352. margin-top: 10rpx;
  1353. padding-left: 20rpx;
  1354. box-sizing: border-box;
  1355. }
  1356. .tips{
  1357. padding: 24rpx;
  1358. text-align: center;
  1359. font-size: 22rpx;
  1360. color: #909399;
  1361. width: 100%;
  1362. box-sizing: border-box;
  1363. }
  1364. }
  1365. .title{
  1366. font-size: 26rpx;
  1367. display: flex;
  1368. align-items: center;
  1369. margin-right: 12rpx;
  1370. flex-shrink: 0;
  1371. &.select{
  1372. width: calc(5em + 20rpx);
  1373. }
  1374. }
  1375. .value{
  1376. width: 100%;
  1377. &.category{
  1378. width: 100%;
  1379. display: flex;
  1380. justify-content: space-between;
  1381. align-items: center;
  1382. .categoryName{
  1383. font-size: 26rpx;
  1384. color: #555;
  1385. flex: 1;
  1386. }
  1387. .newicon-weibiaoti2010104{
  1388. color: $uni-primary;
  1389. margin-left: 24rpx;
  1390. }
  1391. }
  1392. .imgTips{
  1393. color: #909399;
  1394. font-size: 22rpx;
  1395. }
  1396. }
  1397. .synergeticNames{
  1398. font-size: 26rpx;
  1399. margin-right: 24rpx;
  1400. }
  1401. .synergeticAdd{
  1402. flex-shrink: 0;
  1403. }
  1404. }
  1405. }
  1406. }
  1407. </style>