assign.vue 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502
  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. dataInfo.operateType = type
  809. dataInfo.tabType = tabType
  810. handlerStore.setHandlerData(dataInfo, 'assign', 'assign');
  811. uni.navigateTo({
  812. url: `/pages/repository/repository?incidentId=${dataInfo.incidentId}`
  813. })
  814. }
  815. // 处理提交
  816. function submitHandler(){
  817. console.log(dataInfo);
  818. if(!dataInfo.handleDescription.trim() && dataInfo.category.hasSimple != 1){
  819. uni.showToast({
  820. icon: 'none',
  821. title: '请填写解决方案'
  822. });
  823. return;
  824. }
  825. if(!dataInfo.category.id && dataInfo.category.hasSimple != 1){
  826. uni.showToast({
  827. icon: 'none',
  828. title: '请选择故障现象'
  829. });
  830. return;
  831. }
  832. if(!dataInfo.handleCategory){
  833. uni.showToast({
  834. icon: 'none',
  835. title: '请选择处理方式'
  836. });
  837. return;
  838. }
  839. if(!dataInfo.closecode && dataInfo.category.hasSimple != 1){
  840. uni.showToast({
  841. icon: 'none',
  842. title: '请选择处理结果'
  843. });
  844. return;
  845. }
  846. if(!dataInfo.incidentData.duty){
  847. uni.showToast({
  848. icon: 'none',
  849. title: '您选择的故障现象没有设置责任科室'
  850. });
  851. return;
  852. }
  853. console.log(dataInfo)
  854. console.log(dataInfo.handlerImgList)
  855. console.log(dataInfo.incidentData.repairImgList)
  856. uni.showLoading({
  857. title: "加载中",
  858. mask: true,
  859. });
  860. if(dataInfo.handlerImgList.length){
  861. // 有处理图片
  862. let handlerOrder$ = handlerOrder();
  863. let requestList = [handlerOrder$];
  864. Promise.all(requestList).then(resList => {
  865. console.log(resList);
  866. if(resList[0].state == 200){
  867. dataInfo.incidentId = resList[0].data.id;
  868. handlerImgRef.value.upload();
  869. }else{
  870. uni.hideLoading();
  871. uni.showToast({
  872. icon: 'none',
  873. title: resList[0].msg || '请求数据失败!'
  874. });
  875. }
  876. })
  877. }else if(dataInfo.incidentData.repairImgList.length){
  878. // 有报修图片,无处理图片
  879. let handlerOrder$ = handlerOrder();
  880. let requestList = [handlerOrder$];
  881. Promise.all(requestList).then(resList => {
  882. console.log(resList);
  883. if(resList[0].state == 200){
  884. dataInfo.incidentId = resList[0].data.id;
  885. handlerImgSuccessNew();
  886. }else{
  887. uni.hideLoading();
  888. uni.showToast({
  889. icon: 'none',
  890. title: resList[0].msg || '请求数据失败!'
  891. });
  892. }
  893. })
  894. }else{
  895. // 没有图片
  896. let handlerOrder$ = handlerOrder();
  897. let requestList = [handlerOrder$];
  898. Promise.all(requestList).then(resList => {
  899. uni.hideLoading();
  900. console.log(resList);
  901. if(resList[0].state == 200){
  902. incidentBuildStore.clearIncidentBuildData();
  903. uni.showToast({
  904. icon: 'none',
  905. title: '建单成功',
  906. mask: true,
  907. });
  908. setTimeout(() => {
  909. uni.reLaunch({
  910. url: '/pages/incidentList/incidentList',
  911. })
  912. }, 1500)
  913. }else{
  914. uni.showToast({
  915. icon: 'none',
  916. title: resList[0].msg || '请求数据失败!'
  917. });
  918. }
  919. })
  920. }
  921. }
  922. // 派单提交
  923. function submitAssign(){
  924. if(!dataInfo.groupId){
  925. uni.showToast({
  926. icon: 'none',
  927. title: '请选择工作组'
  928. });
  929. return;
  930. }
  931. if(dataInfo.isAssignUser == 1 && !dataInfo.userId){
  932. uni.showToast({
  933. icon: 'none',
  934. title: '请选择指派对象'
  935. });
  936. return;
  937. }
  938. if(!dataInfo.incidentData.duty){
  939. uni.showToast({
  940. icon: 'none',
  941. title: '您选择的故障现象没有设置责任科室'
  942. });
  943. return;
  944. }
  945. uni.showLoading({
  946. title: "加载中",
  947. mask: true,
  948. });
  949. if(dataInfo.incidentData.repairImgList.length){
  950. // 有图片
  951. let assignOrder$ = assignOrder();
  952. let requestList = [assignOrder$];
  953. Promise.all(requestList).then(resList => {
  954. console.log(resList);
  955. if(resList[0].state == 200){
  956. dataInfo.incidentId = resList[0].data.id;
  957. // handlerImgRef.value.upload();
  958. handlerImgSuccessNew();
  959. }else{
  960. uni.hideLoading();
  961. uni.showToast({
  962. icon: 'none',
  963. title: resList[0].msg || '请求数据失败!'
  964. });
  965. }
  966. })
  967. }else{
  968. // 没有图片
  969. let assignOrder$ = assignOrder();
  970. let requestList = [assignOrder$];
  971. Promise.all(requestList).then(resList => {
  972. uni.hideLoading();
  973. console.log(resList);
  974. if(resList[0].state == 200){
  975. incidentBuildStore.clearIncidentBuildData();
  976. uni.showToast({
  977. icon: 'none',
  978. title: '建单成功',
  979. mask: true,
  980. });
  981. setTimeout(() => {
  982. uni.reLaunch({
  983. url: '/pages/incidentList/incidentList',
  984. })
  985. }, 1500)
  986. }else{
  987. uni.showToast({
  988. icon: 'none',
  989. title: resList[0].msg || '请求数据失败!'
  990. });
  991. }
  992. })
  993. }
  994. }
  995. // 补单提交
  996. function submitSupplement(){
  997. console.log(dataInfo);
  998. if(!dataInfo.handleDescription.trim() && dataInfo.category.hasSimple != 1){
  999. uni.showToast({
  1000. icon: 'none',
  1001. title: '请填写解决方案'
  1002. });
  1003. return;
  1004. }
  1005. if(!dataInfo.category.id && dataInfo.category.hasSimple != 1){
  1006. uni.showToast({
  1007. icon: 'none',
  1008. title: '请选择故障现象'
  1009. });
  1010. return;
  1011. }
  1012. if(!dataInfo.handleCategory){
  1013. uni.showToast({
  1014. icon: 'none',
  1015. title: '请选择处理方式'
  1016. });
  1017. return;
  1018. }
  1019. if(!dataInfo.closecode && dataInfo.category.hasSimple != 1){
  1020. uni.showToast({
  1021. icon: 'none',
  1022. title: '请选择处理结果'
  1023. });
  1024. return;
  1025. }
  1026. if(!dataInfo.incidentData.duty){
  1027. uni.showToast({
  1028. icon: 'none',
  1029. title: '您选择的故障现象没有设置责任科室'
  1030. });
  1031. return;
  1032. }
  1033. console.log(dataInfo)
  1034. console.log(dataInfo.handlerImgList)
  1035. console.log(dataInfo.incidentData.repairImgList)
  1036. uni.showLoading({
  1037. title: "加载中",
  1038. mask: true,
  1039. });
  1040. if(dataInfo.handlerImgList.length){
  1041. // 有处理图片
  1042. let supplementOrder$ = supplementOrder();
  1043. let requestList = [supplementOrder$];
  1044. Promise.all(requestList).then(resList => {
  1045. console.log(resList);
  1046. if(resList[0].state == 200){
  1047. dataInfo.incidentId = resList[0].data.id;
  1048. handlerImgRef.value.upload();
  1049. }else{
  1050. uni.hideLoading();
  1051. uni.showToast({
  1052. icon: 'none',
  1053. title: resList[0].msg || '请求数据失败!'
  1054. });
  1055. }
  1056. })
  1057. }else if(dataInfo.incidentData.repairImgList.length){
  1058. // 有报修图片,无处理图片
  1059. let supplementOrder$ = supplementOrder();
  1060. let requestList = [supplementOrder$];
  1061. Promise.all(requestList).then(resList => {
  1062. console.log(resList);
  1063. if(resList[0].state == 200){
  1064. dataInfo.incidentId = resList[0].data.id;
  1065. handlerImgSuccessNew();
  1066. }else{
  1067. uni.hideLoading();
  1068. uni.showToast({
  1069. icon: 'none',
  1070. title: resList[0].msg || '请求数据失败!'
  1071. });
  1072. }
  1073. })
  1074. }else{
  1075. // 没有图片
  1076. let supplementOrder$ = supplementOrder();
  1077. let requestList = [supplementOrder$];
  1078. Promise.all(requestList).then(resList => {
  1079. uni.hideLoading();
  1080. console.log(resList);
  1081. if(resList[0].state == 200){
  1082. incidentBuildStore.clearIncidentBuildData();
  1083. uni.showToast({
  1084. icon: 'none',
  1085. title: '建单成功',
  1086. mask: true,
  1087. });
  1088. setTimeout(() => {
  1089. uni.reLaunch({
  1090. url: '/pages/incidentList/incidentList',
  1091. })
  1092. }, 1500)
  1093. }else{
  1094. uni.showToast({
  1095. icon: 'none',
  1096. title: resList[0].msg || '请求数据失败!'
  1097. });
  1098. }
  1099. })
  1100. }
  1101. }
  1102. // 菜单权限
  1103. function menuAuthHandle(){
  1104. let shijianliebiao_supplement = false;//故障处理权限
  1105. for (let i = 0; i < loginUserStore.loginUser.menu.length; i++) {
  1106. if (loginUserStore.loginUser.menu[i].link == "shijianliebiao_supplement") {
  1107. shijianliebiao_supplement = true
  1108. }
  1109. }
  1110. // 补单
  1111. if(shijianliebiao_supplement){
  1112. let index = dataInfo.tabs.findIndex(v => v.value === 'assign');
  1113. dataInfo.tabs.splice(index, 0, {id: 7, name: '补单', value: 'supplement', num: ''});
  1114. }
  1115. }
  1116. // 获取文本内容
  1117. function getHtml(html) {
  1118. const tempDiv = document.createElement('div');
  1119. tempDiv.innerHTML = html;
  1120. return tempDiv.textContent || tempDiv.innerText || '';
  1121. }
  1122. onLoad((option) => {
  1123. menuAuthHandle()
  1124. // 跳转页面选择了选项
  1125. if(handlerStore.handler.data){
  1126. Object.assign(dataInfo, handlerStore.handler.data);
  1127. console.log(dataInfo)
  1128. if(handlerStore.handler.sign === 'assign'){
  1129. dataInfo.tabActiveValue = 'direct';
  1130. }else if(handlerStore.handler.sign === 'assign_supplement'){
  1131. dataInfo.tabActiveValue = 'supplement';
  1132. next();
  1133. }
  1134. let storeData = handlerStore.handler.data
  1135. if(storeData.type == 'rep'){
  1136. if(storeData.handleDescription){
  1137. dataInfo.handleDescription = getHtml(storeData.handleDescription);
  1138. solutionId.value = storeData.solutionId
  1139. }
  1140. if(storeData.tabType == 'direct'){
  1141. dataInfo.tabActiveValue = 'direct'
  1142. }else{
  1143. dataInfo.tabActiveValue = 'supplement'
  1144. dataInfo.supplementFlag = false
  1145. }
  1146. }
  1147. handlerStore.clearHandlerData();
  1148. if(dataInfo.category){
  1149. dataInfo.incidentData.category = dataInfo.category;
  1150. // 处理责任科室
  1151. if(dataInfo.category.branchType == 1){
  1152. // 分院区
  1153. if(dataInfo.incidentData.branch){
  1154. let dutyConfig = dataInfo.category.branchUserGroups.find(v=>v.branchId == dataInfo.incidentData.branch);
  1155. if(dutyConfig && dutyConfig.dutyId && dutyConfig.dutyName){
  1156. dataInfo.incidentData.duty = {id:dutyConfig.dutyId,dept:dutyConfig.dutyName};
  1157. }else{
  1158. dataInfo.incidentData.duty = undefined;
  1159. }
  1160. }else{
  1161. dataInfo.incidentData.duty = undefined;
  1162. }
  1163. }else{
  1164. // 不分院区
  1165. dataInfo.incidentData.duty = dataInfo.category.dutyDepartment;
  1166. }
  1167. }
  1168. }else if(incidentBuildStore.incidentBuild.data){
  1169. // 初始化
  1170. Object.assign(dataInfo.incidentData, incidentBuildStore.incidentBuild.data);
  1171. if(dataInfo.incidentData.category){
  1172. dataInfo.category = dataInfo.incidentData.category;
  1173. // 处理责任科室
  1174. if(dataInfo.category.branchType == 1){
  1175. // 分院区
  1176. if(dataInfo.incidentData.branch){
  1177. let dutyConfig = dataInfo.category.branchUserGroups.find(v=>v.branchId == dataInfo.incidentData.branch);
  1178. if(dutyConfig && dutyConfig.dutyId && dutyConfig.dutyName){
  1179. dataInfo.incidentData.duty = {id:dutyConfig.dutyId,dept:dutyConfig.dutyName};
  1180. }else{
  1181. dataInfo.incidentData.duty = undefined;
  1182. }
  1183. }else{
  1184. dataInfo.incidentData.duty = undefined;
  1185. }
  1186. }else{
  1187. // 不分院区
  1188. dataInfo.incidentData.duty = dataInfo.category.dutyDepartment;
  1189. }
  1190. }
  1191. if(dataInfo.incidentData.priority){
  1192. dataInfo.incidentData.priority = { id: dataInfo.incidentData.priority };
  1193. }
  1194. if(dataInfo.incidentData.source){
  1195. dataInfo.incidentData.source = { id: dataInfo.incidentData.source };
  1196. }
  1197. if(dataInfo.incidentData.requester){
  1198. dataInfo.incidentData.requester = dataInfo.incidentData.requester
  1199. }
  1200. }
  1201. if(!dataInfo.tabActiveValue){
  1202. dataInfo.tabActiveValue = dataInfo.tabs[0].value;
  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>