assign.vue 45 KB

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