processing.vue 62 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146
  1. <template>
  2. <div class="againAssign">
  3. <div class="conentBox">
  4. <div class="header">处理方案</div>
  5. <div v-if="modelData.incident.id" class="conent">
  6. <div class="navBar">
  7. <div
  8. class="fl"
  9. :class="{ p50: modelData.incident.handlerUser.id != loginUser.id }"
  10. >
  11. <a
  12. :class="{ active: actives == 'info' }"
  13. href="javascript:;"
  14. @click="toInfo('info')"
  15. >事件信息</a
  16. >
  17. </div>
  18. <!-- <div
  19. class="fl"
  20. :class="{ p50: modelData.incident.handlerUser.id != loginUser.id }"
  21. >
  22. <a
  23. :class="{ active: actives == 'handlerLog' }"
  24. href="javascript:;"
  25. @click="toInfo('handlerLog')"
  26. >处理日志</a>
  27. </div> -->
  28. <div
  29. class="fl"
  30. :class="{ p50: modelData.incident.handlerUser.id != loginUser.id }"
  31. >
  32. <a
  33. :class="{ active: actives == 'progress' }"
  34. href="javascript:;"
  35. @click="toInfo('progress')"
  36. >处理进度</a
  37. >
  38. </div>
  39. <div
  40. class="fl"
  41. v-if="modelData.incident.handlerUser.id == loginUser.id"
  42. >
  43. <a
  44. :class="{ active: actives == 'handlerInfo' }"
  45. href="javascript:;"
  46. @click="toInfo('handlerInfo')"
  47. >处理信息</a
  48. >
  49. </div>
  50. </div>
  51. <div class="label headtop" id="info">事件信息</div>
  52. <div class="info">
  53. <EventInformation :model="modelData" :id="id"></EventInformation>
  54. <p class="info_hide">
  55. <span class="fl hide" @click="hides()" v-if="!item_hides"
  56. >展开详情 >></span
  57. >
  58. <span class="fl hide" @click="hides()" v-if="item_hides"
  59. >隐藏详情<<</span
  60. >
  61. </p>
  62. <div class="imgs-container" v-if="imgs.length">
  63. <div class="imgs-cont" @click="showImgs(imgs)">
  64. <img
  65. v-if="
  66. img.suffix == 'jpeg' ||
  67. img.suffix == 'jpg' ||
  68. img.suffix == 'gif' ||
  69. img.suffix == 'png' ||
  70. img.suffix == 'svg' ||
  71. img.suffix == 'pdf'
  72. "
  73. :src="img.previewUrl"
  74. v-for="(img, index) in imgs"
  75. class="imgs"
  76. />
  77. <p v-else>
  78. <a :href="[img.previewUrl]">{{ img.name }}</a>
  79. </p>
  80. </div>
  81. </div>
  82. <!-- <HandlerLog :data="modelData.incident.handlerLogs" id="handlerLog"></HandlerLog> -->
  83. <div class="label" id="progress">处理进度</div>
  84. <div
  85. :class="{ progress: true, progressHide: !pro_hides }"
  86. id="progressBox"
  87. >
  88. <div class="progress_info" v-for="item in progressInfo">
  89. <div class="progress_info_L">{{ item.activityName }}</div>
  90. <div class="progress_info_R">
  91. <div class="time">
  92. <i
  93. :class="{
  94. iconfont: true,
  95. 'icon-icon_weizuo': item.endTime != '',
  96. 'icon-icon_zhengzaijinx': item.endTime == '',
  97. }"
  98. ></i>
  99. <span class="text1">
  100. {{ item.startTime | timeFormat("MM-dd HH:mm:ss") }}
  101. <template v-if="item.userName">
  102. ,{{ item.userName }}
  103. </template>
  104. </span>
  105. </div>
  106. <div :class="{ cont: true, blue: item.endTime != '' }">
  107. <p class="text2" v-if="item.desc" v-html="item.desc"></p>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. <p class="info_hide">
  113. <span class="fl hide" @click="proHides()">{{
  114. pro_hides ? "隐藏详情 <<" : "展开详情 >>"
  115. }}</span>
  116. </p>
  117. <div v-if="modelData.incident.handlerUser.id == loginUser.id">
  118. <div class="label" id="handlerInfo">处理信息</div>
  119. <!-- 添加耗材 start -->
  120. <div style="margin-top:16px;margin-bottom:16px;">
  121. <div v-for="(item, i) in hcList" :key="i" class="hcList">
  122. <cube-select
  123. placeholder="请选择耗材"
  124. class="hcItem"
  125. v-model="item.assetConsumablesId"
  126. :options="hcs"
  127. ></cube-select>
  128. <cube-input
  129. type="number"
  130. v-model="item.extra1"
  131. placeholder="请输入价格"
  132. class="hcItem"
  133. ></cube-input>
  134. <cube-input
  135. type="number"
  136. v-model="item.consumablesSum"
  137. placeholder="请输入数量"
  138. class="hcItem"
  139. ></cube-input>
  140. <span
  141. class="icon iconfont icon-shanchu hcItemClose"
  142. @click="removeHc(item.id)"
  143. ></span>
  144. </div>
  145. </div>
  146. <div
  147. class="addHc"
  148. @click="addHc()"
  149. v-if="incidentWithConsumable == 1"
  150. >
  151. <i class="cubeic-add"></i>增加耗材
  152. </div>
  153. <!-- 添加耗材 end -->
  154. <div class="handlerInfo">
  155. <cube-form
  156. :model="model"
  157. @validate="validateHandler"
  158. @submit="submitHandler"
  159. >
  160. <cube-form-group>
  161. <!-- <cube-form-item :field="fields[12]" class="btn_plcaeholde"> -->
  162. <!-- <cube-button @click="showDatePicker">{{model.dateValue || 'Please select date'}}</cube-button> -->
  163. <!-- <date-picker ref="datePicker" :min="[2008, 8, 8]" :max="[2020, 10, 20]" @select="dateSelectHandler"></date-picker> -->
  164. <!-- </cube-form-item> -->
  165. <!-- <cube-form-item :field="fields[13]" class="btn_plcaeholde"></cube-form-item> -->
  166. <div class="handleRadio">
  167. <cube-radio-group
  168. v-model="order"
  169. :options="handleTypes"
  170. position="right"
  171. :hollow-style="true"
  172. />
  173. </div>
  174. <cube-form-item
  175. :field="fields[0]"
  176. v-if="order == 1"
  177. ></cube-form-item>
  178. <cube-form-item
  179. :field="fields[1]"
  180. class="btn_plcaeholde"
  181. v-if="order == 1"
  182. >
  183. <cube-button @click="showCategoryPicker()">{{
  184. selectedCategoryTxt
  185. ? selectedCategoryTxt
  186. : "请选择事件分类"
  187. }}</cube-button>
  188. </cube-form-item>
  189. <cube-form-item
  190. :field="fields[2]"
  191. v-if="order == 1"
  192. ></cube-form-item>
  193. <cube-form-item
  194. :field="fields[3]"
  195. class="incidentTitle"
  196. v-if="order == 1"
  197. >
  198. <div class="titleRefer">
  199. <textarea
  200. class="titleTxtArea fl"
  201. placeholder="请输入处理方案"
  202. v-model="incidentTitle"
  203. @input="inpTitle()"
  204. ></textarea>
  205. <span class="abtn fl" @click="referKnowledge()"
  206. >引入知识库</span
  207. >
  208. </div>
  209. </cube-form-item>
  210. <div class="label formLabel" v-if="order == 1">
  211. 报修图片
  212. <span>(最多可上传3张JPG或PNG,每张不能超过10M)</span>
  213. </div>
  214. <div class="uplod" v-if="order == 1">
  215. <cube-upload
  216. ref="upload"
  217. :max="3"
  218. :action="action"
  219. :simultaneous-uploads="3"
  220. @files-added="filesAdded"
  221. @file-submitted="fileSubmitted"
  222. />
  223. </div>
  224. <cube-form-item
  225. :field="fields[4]"
  226. v-if="order == 1"
  227. ></cube-form-item>
  228. <cube-form-item
  229. :field="fields[5]"
  230. class="btn_plcaeholde"
  231. v-if="order == 1 && !!model.knowledge"
  232. ></cube-form-item>
  233. <cube-form-item
  234. :field="fields[14]"
  235. v-if="order == 1"
  236. ></cube-form-item>
  237. <cube-form-item
  238. :field="fields[10]"
  239. v-if="order == 1 && !!model.isHelper"
  240. >
  241. <div class="synerBox">
  242. <cube-checkbox-group
  243. v-model="synergeticChecked"
  244. :options="synergeticList"
  245. />
  246. </div>
  247. </cube-form-item>
  248. <cube-form-item
  249. :field="fields[11]"
  250. v-if="order == 1 && !!model.isHelper"
  251. ></cube-form-item>
  252. <cube-form-item
  253. :field="fields[6]"
  254. v-if="order == 2"
  255. ></cube-form-item>
  256. <!-- <cube-form-item
  257. :field="fields[15]"
  258. v-if="order == 5"
  259. ></cube-form-item> -->
  260. <cube-form-item
  261. :field="fields[7]"
  262. v-if="order == 2"
  263. ></cube-form-item>
  264. <cube-form-item
  265. :field="fields[8]"
  266. v-if="order == 3"
  267. ></cube-form-item>
  268. <cube-form-item
  269. :field="fields[9]"
  270. v-if="order == 3"
  271. ></cube-form-item>
  272. <!-- <cube-form-item
  273. :field="fields[16]"
  274. class="incidentTitle"
  275. >
  276. <div class="titleRefer">
  277. <textarea
  278. style="margin-top:0.1rem;width:100%;"
  279. class="titleTxtArea fl"
  280. placeholder="请输入处理日志"
  281. v-model="handlerLog"
  282. ></textarea>
  283. </div>
  284. </cube-form-item> -->
  285. </cube-form-group>
  286. <cube-form-group class="sub">
  287. <cube-button type="submit" @click="subVali()"
  288. >提交</cube-button
  289. >
  290. </cube-form-group>
  291. </cube-form>
  292. </div>
  293. </div>
  294. </div>
  295. </div>
  296. <load-ing v-if="!modelData.incident.id"></load-ing>
  297. <promp-ting
  298. :conents="promptingConent"
  299. :status="promptingStatus"
  300. ></promp-ting>
  301. </div>
  302. </div>
  303. </template>
  304. <script>
  305. import CubePage from "./../components/cube-page.vue";
  306. import CubeButtonGroup from "./../components/cube-button-group.vue";
  307. import DatePicker from "./../components/date-picker.vue";
  308. import CubeExtendPopup from "./../components/extend-popup.vue";
  309. import LoadIng from "./../views/loading.vue";
  310. import PrompTing from "./../views/prompting.vue";
  311. import EventInformation from './../components/EventInformation/index.vue'
  312. // import HandlerLog from "./../views/handlerLog.vue";
  313. // import host from '../request/host'
  314. // 知识库类型
  315. const solution = {
  316. props: {
  317. value: {
  318. default() {
  319. return [];
  320. },
  321. },
  322. },
  323. data() {
  324. return {
  325. selected: [],
  326. selectData: [],
  327. initVal: JSON.parse(localStorage.getItem("solution")) || [0, 0, 0],
  328. };
  329. },
  330. render(createElement) {
  331. return createElement(
  332. "cube-button",
  333. {
  334. on: {
  335. click: this.showPicker,
  336. },
  337. },
  338. this.selected.length
  339. ? this.selected[this.selected.length - 1]
  340. : "请选择知识库类型"
  341. );
  342. },
  343. created() {
  344. this.getTree();
  345. },
  346. mounted() {},
  347. methods: {
  348. showPicker() {
  349. this.picker.show();
  350. },
  351. selectHandler(selectedVal, selectedIndex, selectedTxt) {
  352. var selected = [];
  353. selectedTxt.forEach(function (v, i) {
  354. if (v != "") {
  355. selected.push(v);
  356. }
  357. });
  358. this.selected = selected;
  359. this.$emit("input", selectedVal);
  360. localStorage.setItem("solution", JSON.stringify(selectedIndex));
  361. },
  362. // 获取事件分类数据
  363. getTree() {
  364. let that = this;
  365. that.$http
  366. .post("service/solution/fetchDataList/solutionType", {
  367. idx: 0,
  368. sum: 100,
  369. })
  370. .then(function (res) {
  371. // console.log(res);
  372. var list = res.data.list;
  373. var tree = [];
  374. list.forEach((v, i) => {
  375. if (!v.parent) {
  376. tree[i] = {
  377. value: v.id,
  378. text: v.typeName,
  379. children: [],
  380. };
  381. } else {
  382. tree.forEach((val, idx) => {
  383. if (
  384. v.parent &&
  385. !v.parent.parent &&
  386. val.text == v.parent.typeName
  387. ) {
  388. tree[idx].children.push({
  389. value: v.id,
  390. text: v.typeName,
  391. children: [],
  392. });
  393. } else if (v.parent.parent) {
  394. tree[idx].children.forEach((value, index) => {
  395. if (value.text == v.parent.typeName) {
  396. tree[idx].children[index].children.push({
  397. value: v.id,
  398. text: v.typeName,
  399. });
  400. }
  401. });
  402. }
  403. });
  404. }
  405. });
  406. that.selectData = tree;
  407. that.picker = that.$createCascadePicker({
  408. title: "知识库类型选择",
  409. data: that.selectData,
  410. selectedIndex: that.initVal,
  411. onSelect: that.selectHandler,
  412. });
  413. });
  414. },
  415. },
  416. };
  417. export default {
  418. data() {
  419. return {
  420. loginUser: JSON.parse(localStorage.getItem("loginUser")),
  421. incidentWithConsumable: localStorage.getItem("incidentWithConsumable"), //是否绑定耗材
  422. id: "",
  423. resignComment: "", //重新指派原因
  424. item_hides: false,
  425. actives: "info",
  426. processInstanceId: "",
  427. progressInfo: [], //处理进度
  428. imgs: [], //图片
  429. model: {}, //提交数据
  430. validity: {},
  431. valid: undefined,
  432. action: {
  433. target:
  434. this.$host + "/service/common/common/uploadAttachment/incident/",
  435. data: {},
  436. },
  437. isUploading: false,
  438. loadShow: false,
  439. pro_hides: false, //展开/收起处理进度
  440. name: "",
  441. phone: "",
  442. label: "incidentInfo", //顶部快速定位
  443. modelData: {
  444. incident: {},
  445. }, //上传的model
  446. incidentTitle: "", //处理方案
  447. handlerLog: "", //处理日志
  448. referenceInfo: {}, //引用信息
  449. selectedCategoryTxt: "", //事件分类选中展示
  450. selectedAreaId: "", //区域选中id--seimin
  451. selectedAreaName: "", //区域选中名称--seimin
  452. selectedPlaceId: "", //地点选中id--seimin
  453. selectedPlaceName: "", //地点选中名称--seimin
  454. model: {
  455. handleCategory: "", //处理方式
  456. closecode: "", //关闭代码
  457. category: [], //确认事件分类
  458. handleDescription: "", //处理方案
  459. knowledge: false, //是否提交知识库
  460. isHelper: false, //是否需要协同
  461. solutionType: [], //知识库类型
  462. handlerUser: "", //升级/转派对象
  463. isupreason: "", //升级原因
  464. transferReason: "", //转派原因
  465. synergeticChecked: [], //选中协同对象
  466. synergeticReason: "", //协同原因
  467. selectArea: "",
  468. selectPlace: "",
  469. },
  470. // showPrompting:false,
  471. promptingConent: "",
  472. promptingStatus: "",
  473. order: 1, //处理方式 1:直接处理,2:升级,3:转派,4:协同
  474. handleCategoryArr: [], //处理方式数组
  475. closecodeArr: [], //关闭代码数组
  476. // handlerUserArr: [], //处理人数组
  477. synergeticList: [], //协同对象列表
  478. synergeticChecked: [], //选中协同对象
  479. handleTypes: [
  480. {
  481. label: "直接处理",
  482. value: 1,
  483. },
  484. {
  485. label: "升级",
  486. value: 2,
  487. },
  488. {
  489. label: "转派",
  490. value: 3,
  491. },
  492. // {
  493. // label: "指派",
  494. // value: 5
  495. // }
  496. // {
  497. // label: "协同",
  498. // value: 4
  499. // }
  500. ],
  501. vali: false,
  502. fields: [
  503. {
  504. type: "select",
  505. modelKey: "handleCategory",
  506. label: "处理方式:",
  507. props: {
  508. options: this.handleCategoryArr,
  509. title: "请选择处理方式",
  510. placeholder: "请选择处理方式",
  511. },
  512. rules: {
  513. required: true,
  514. },
  515. },
  516. {
  517. component: "button",
  518. modelKey: "category",
  519. label: "确认事件分类:",
  520. rules: {
  521. required: true,
  522. },
  523. },
  524. {
  525. type: "select",
  526. modelKey: "closecode",
  527. label: "关闭代码:",
  528. props: {
  529. options: this.closecodeArr,
  530. title: "请选择关闭代码",
  531. placeholder: "请选择关闭代码",
  532. },
  533. rules: {
  534. required: true,
  535. },
  536. },
  537. {
  538. type: "textarea",
  539. modelKey: "handleDescription",
  540. label: "处理方案:",
  541. props: {
  542. placeholder: "请填写处理方案",
  543. },
  544. rules: {
  545. required: true,
  546. },
  547. debounce: 100,
  548. },
  549. {
  550. type: "switch",
  551. modelKey: "knowledge",
  552. label: "是否提交知识库:",
  553. rules: {
  554. required: false,
  555. },
  556. },
  557. {
  558. component: solution,
  559. modelKey: "solutionType",
  560. label: "知识库类型:",
  561. rules: {
  562. required: true,
  563. },
  564. messages: {
  565. required: "",
  566. },
  567. },
  568. {
  569. type: "select",
  570. modelKey: "handlerUser",
  571. label: "升级对象:",
  572. props: {
  573. options: [],
  574. placeholder: "请选择升级对象",
  575. },
  576. rules: {
  577. required: true,
  578. },
  579. },
  580. {
  581. type: "input",
  582. modelKey: "isupreason",
  583. label: "升级原因:",
  584. props: {
  585. placeholder: "请输入升级原因",
  586. },
  587. rules: {
  588. required: true,
  589. },
  590. },
  591. {
  592. type: "select",
  593. modelKey: "handlerUser",
  594. label: "转派对象:",
  595. props: {
  596. options: [],
  597. placeholder: "请选择转派对象",
  598. },
  599. rules: {
  600. required: true,
  601. },
  602. },
  603. {
  604. type: "input",
  605. modelKey: "transferReason",
  606. label: "转派原因:",
  607. props: {
  608. placeholder: "请输入转派原因",
  609. },
  610. rules: {
  611. required: true,
  612. },
  613. },
  614. {
  615. type: "checkbox-group",
  616. modelKey: "synergeticChecked",
  617. label: "协同对象:",
  618. props: {
  619. options: [],
  620. placeholder: "请选择协同对象",
  621. },
  622. rules: {
  623. required: false,
  624. },
  625. },
  626. {
  627. type: "input",
  628. modelKey: "synergeticReason",
  629. label: "协同原因:",
  630. props: {
  631. placeholder: "请输入协同原因",
  632. },
  633. rules: {
  634. required: false,
  635. },
  636. },
  637. {
  638. type: "select",
  639. modelKey: "selectArea",
  640. label: "区域:",
  641. props: {
  642. options: [],
  643. title: "请选择区域:",
  644. placeholder: "请选择区域:",
  645. },
  646. events: {
  647. change: (id, index, text) => {
  648. // console.log(id,index,text,9999)
  649. this.getPlaceList(id).then((res) => {
  650. this.selectedAreaId = id;
  651. this.selectedAreaName = text;
  652. // {{modelData.incident.place?modelData.incident.place.area.area:'--'}}
  653. console.log(this.modelData, "asad");
  654. if (this.modelData.incident.place) {
  655. this.$set(this.modelData.incident.place, "area", {
  656. id,
  657. area: text,
  658. });
  659. } else {
  660. this.$set(this.modelData.incident, "place", {
  661. area: {
  662. id,
  663. area: text,
  664. },
  665. });
  666. }
  667. });
  668. },
  669. },
  670. rules: {
  671. required: true,
  672. },
  673. },
  674. {
  675. type: "select",
  676. modelKey: "selectPlace",
  677. label: "地点:",
  678. props: {
  679. options: [],
  680. title: "请选择地点:",
  681. placeholder: "请选择地点:",
  682. },
  683. events: {
  684. change: (id, index, text) => {
  685. this.selectedPlaceId = id;
  686. this.selectedPlaceName = text;
  687. this.$set(
  688. this.modelData.incident,
  689. "houseNumber",
  690. this.selectedAreaName + this.selectedPlaceName
  691. );
  692. if (this.modelData.incident.place) {
  693. this.$set(this.modelData.incident.place, "place", text);
  694. this.$set(this.modelData.incident.place, "id", id);
  695. } else {
  696. this.$set(this.modelData.incident, "place", {
  697. id,
  698. place: text,
  699. });
  700. }
  701. },
  702. },
  703. rules: {
  704. required: true,
  705. },
  706. },
  707. {
  708. type: "switch",
  709. modelKey: "isHelper",
  710. label: "是否需要协同:",
  711. rules: {
  712. required: false,
  713. },
  714. },
  715. {
  716. type: "select",
  717. modelKey: "handlerUser",
  718. label: "指派对象:",
  719. props: {
  720. options: [],
  721. placeholder: "请选择指派对象",
  722. },
  723. rules: {
  724. required: true,
  725. },
  726. },
  727. {
  728. type: "textarea",
  729. modelKey: "handlerLog",
  730. label: "处理日志:",
  731. props: {
  732. placeholder: "请填写处理日志",
  733. },
  734. rules: {
  735. required: false,
  736. },
  737. debounce: 100,
  738. },
  739. ],
  740. hcList: [], //绑定的耗材列表
  741. idMock: 0, //自增id,mock
  742. hcs: [], //耗材列表
  743. };
  744. },
  745. watch: {
  746. // 监听synergeticChecked变化
  747. synergeticChecked: {
  748. handler: function (n, o) {
  749. this.model.synergeticChecked = n;
  750. },
  751. },
  752. },
  753. methods: {
  754. // 获取耗材列表
  755. getHcs() {
  756. this.$http
  757. .post("service/bpm/data/fetchDataList/consumable", {
  758. idx: 0,
  759. sum: 1000,
  760. consumable: {isInventory:1},
  761. })
  762. .then((res) => {
  763. if (res.data.status == 200) {
  764. this.hcs = res.data.list.map((v) => ({
  765. value: v.id,
  766. text: v.name+'【'+v.brandModel+'】'+'【'+v.specification+'】',
  767. }));
  768. }
  769. });
  770. },
  771. // 增加耗材
  772. addHc() {
  773. let sourceId = this.modelData.incident.id;
  774. // consumablesSum 耗材数量
  775. // assetConsumablesId 耗材id
  776. // sourceId 事件id
  777. this.hcList.push({
  778. id: ++this.idMock,
  779. type: 2,
  780. consumablesSum: null,
  781. assetConsumablesId: null,
  782. sourceId,
  783. extra1: null,
  784. source: 1627,
  785. });
  786. },
  787. // 删除耗材
  788. removeHc(id) {
  789. this.hcList = this.hcList.filter((v) => v.id != id);
  790. },
  791. //获取区域
  792. getAreaList() {
  793. return new Promise((resolve, reject) => {
  794. this.$http
  795. .post("service/user/data/fetchDataList/area", { idx: 0, sum: 1000 })
  796. .then((res) => {
  797. if (res.data.status == 200) {
  798. let arr = res.data.list.map((item) => {
  799. return { value: item.id, text: item.area };
  800. });
  801. // console.log(arr,2222)
  802. // this.selectedAreaArr = arr;
  803. this.fields.forEach((item) => {
  804. if (item.modelKey === "selectArea") {
  805. item.props.options = arr;
  806. }
  807. });
  808. resolve(res);
  809. }
  810. });
  811. });
  812. },
  813. //根据区域获取地点
  814. getPlaceList(id) {
  815. return new Promise((resolve, reject) => {
  816. this.$http
  817. .post("service/user/data/fetchDataList/place", {
  818. idx: 0,
  819. sum: 1000,
  820. place: { area: { id } },
  821. })
  822. .then((res) => {
  823. if (res.data.status == 200) {
  824. let arr = res.data.list.map((item) => {
  825. return { value: item.id, text: item.place };
  826. });
  827. // console.log(arr,2222)
  828. // this.selectedAreaArr = arr;
  829. this.fields.forEach((item) => {
  830. if (item.modelKey === "selectPlace") {
  831. item.props.options = arr;
  832. }
  833. });
  834. resolve(res);
  835. }
  836. });
  837. });
  838. },
  839. // 获取事件数据
  840. getParamsData() {
  841. var that = this;
  842. that.$http
  843. .get(
  844. "/service/form/renderForm/handlerform/" +
  845. that.processInstanceId +
  846. "/" +
  847. that.loginUser.id +
  848. "/" +
  849. that.id,
  850. {}
  851. )
  852. .then(function (res) {
  853. console.log(res.data, 666);
  854. that.modelData = res.data.model;
  855. //seimin
  856. localStorage.setItem("modelData", JSON.stringify(that.modelData));
  857. });
  858. },
  859. //展示图片
  860. showImgs(imgs){
  861. this.$createImagePreview({
  862. imgs:imgs.map(v=>v.previewUrl)
  863. }).show()
  864. },
  865. // 获取图片
  866. getImgs() {
  867. var that = this;
  868. that.$http
  869. .get(
  870. "service/common/common/listAttachment/incident/" +
  871. that.processInstanceId,
  872. {}
  873. )
  874. .then(function (res) {
  875. that.imgs = res.data.data.splice(0, 3);
  876. });
  877. },
  878. // 事件分类回显
  879. setCategory() {
  880. let that = this;
  881. // console.log(898);
  882. // console.log(that.modelData.incident.category);
  883. // let cate = that.modelData.incident.category;
  884. if (localStorage.getItem("referenceInfo")) {
  885. that.referenceInfo = JSON.parse(localStorage.getItem("referenceInfo"));
  886. // that.incidentTitle = that.model.handleDescription =
  887. // that.referenceInfo.content;
  888. //baba
  889. var selectedVal = []; //存id,对应value
  890. var selectedIndex = []; //存索引
  891. var selectedTxt = []; //存名称
  892. if (this.referenceInfo.category) {
  893. console.log(this.selectData, "所有事件分类");
  894. console.log(this.referenceInfo.category, "返回的数据");
  895. var category = this.referenceInfo.category;
  896. selectedVal = [category.id]; //存id,对应value
  897. // selectedVal
  898. if (category.parentCategory) {
  899. //上级
  900. selectedVal.unshift(category.parentCategory.id);
  901. if (category.parentCategory.parentCategory) {
  902. //上上级
  903. selectedVal.unshift(category.parentCategory.parentCategory.id);
  904. }
  905. }
  906. // selectedIndex selectedTxt
  907. //一级
  908. if (selectedVal[0]) {
  909. this.selectData.forEach(function (v, i) {
  910. if (v.value == selectedVal[0]) {
  911. selectedIndex.push(i);
  912. selectedTxt.push(v.text);
  913. }
  914. });
  915. // 二级
  916. if (selectedVal[1]) {
  917. this.selectData[selectedIndex[0].toString()].children.forEach(
  918. function (v, i) {
  919. if (v.value == selectedVal[1]) {
  920. selectedIndex.push(i);
  921. selectedTxt.push(v.text);
  922. }
  923. }
  924. );
  925. // 三级
  926. if (selectedVal[2]) {
  927. this.selectData[selectedIndex[0].toString()].children[
  928. selectedIndex[1].toString()
  929. ].children.forEach(function (v, i) {
  930. if (v.value == selectedVal[2]) {
  931. selectedIndex.push(i);
  932. selectedTxt.push(v.text);
  933. }
  934. });
  935. }
  936. }
  937. }
  938. console.log(selectedVal, selectedIndex, selectedTxt, "获取的数据");
  939. }
  940. //回显
  941. var selected = [];
  942. selectedTxt.forEach(function (v, i) {
  943. if (v != "") {
  944. selected.push(v);
  945. }
  946. });
  947. this.selected = selected;
  948. this.selectedCategoryTxt = selected.length
  949. ? selected[selected.length - 1]
  950. : "";
  951. this.model.category = selectedVal;
  952. localStorage.setItem("category", JSON.stringify(selectedIndex));
  953. localStorage.setItem("categoryVal", JSON.stringify(selectedVal));
  954. localStorage.setItem(
  955. "selectedCategoryTxt",
  956. JSON.stringify(this.selectedCategoryTxt)
  957. );
  958. }
  959. },
  960. // 获取处理进度
  961. getProgressInfo() {
  962. var that = this;
  963. that.$http
  964. .post(
  965. "/service/bpm/bpm/flowTracingCustom/" + that.processInstanceId,
  966. {}
  967. )
  968. .then(function (res) {
  969. console.log(res.data);
  970. that.progressInfo = res.data.data;
  971. //处理日志startcaca
  972. if (that.modelData.incident.handlerLogs) {
  973. //添加日志
  974. that.modelData.incident.handlerLogs.forEach((v) => {
  975. that.progressInfo.push({
  976. startTime: v.opTime,
  977. endTime: 1,
  978. desc: v.opValue,
  979. userName: v.userName,
  980. activityName: "事件处理",
  981. });
  982. });
  983. }
  984. //处理数据
  985. that.progressInfo.forEach((v) => {
  986. if (!v.endTime) {
  987. v.endTime = 1;
  988. }
  989. v.startTime = new Date(v.startTime).getTime();
  990. });
  991. var kaishi = that.progressInfo.shift();
  992. var jiedan = that.progressInfo.shift();
  993. that.progressInfo.sort(function (o, c) {
  994. return c.startTime - o.startTime;
  995. });
  996. that.progressInfo.length && (that.progressInfo[0].endTime = "");
  997. that.progressInfo.push(jiedan);
  998. that.progressInfo.push(kaishi);
  999. console.log(that.progressInfo);
  1000. //处理日志end
  1001. });
  1002. },
  1003. //隐藏显示详情
  1004. hides() {
  1005. this.item_hides = !this.item_hides;
  1006. $("#shows").slideToggle();
  1007. },
  1008. // 处理进度隐藏/展开
  1009. proHides() {
  1010. if (!this.pro_hides) {
  1011. $("#progressBox").animate({
  1012. height: $("#progressBox")[0].scrollHeight,
  1013. });
  1014. } else {
  1015. $("#progressBox").animate({ height: "1.7rem" });
  1016. }
  1017. this.pro_hides = !this.pro_hides;
  1018. },
  1019. // 快速定位
  1020. toInfo(id) {
  1021. this.actives = id;
  1022. $("body,html").animate(
  1023. {
  1024. scrollTop:
  1025. $("#" + id).offset().top -
  1026. $(".header")[0].offsetHeight -
  1027. $(".navBar")[0].offsetHeight,
  1028. },
  1029. 260
  1030. );
  1031. },
  1032. // 输入处理方案
  1033. inpTitle() {
  1034. this.model.handleDescription = this.incidentTitle;
  1035. },
  1036. subVali() {
  1037. this.vali = true;
  1038. },
  1039. // 获取处理方式
  1040. getHandleCategory() {
  1041. var that = this;
  1042. this.$http
  1043. .post("service/common/common/getDictionary", {
  1044. key: "incident_handleCategory",
  1045. type: "list",
  1046. })
  1047. .then(function (res) {
  1048. res.data.forEach(function (v, i) {
  1049. that.handleCategoryArr.push({
  1050. text: v.name,
  1051. value: v.id,
  1052. });
  1053. });
  1054. that.fields[0].props.options = that.handleCategoryArr;
  1055. });
  1056. },
  1057. // 获取关闭代码
  1058. getClosecode() {
  1059. var that = this;
  1060. this.$http
  1061. .post("service/common/common/getDictionary", {
  1062. key: "incident_closecode",
  1063. type: "list",
  1064. })
  1065. .then(function (res) {
  1066. res.data.forEach(function (v, i) {
  1067. that.closecodeArr.push({
  1068. text: v.desc,
  1069. value: v.id,
  1070. });
  1071. });
  1072. that.fields[2].props.options = that.closecodeArr;
  1073. });
  1074. },
  1075. // 获取指派对象baba
  1076. getZpUser() {
  1077. var that = this;
  1078. var postData = {
  1079. idx: 0,
  1080. sum: 1000,
  1081. user: {
  1082. roledata: { rolecode: "first-line support" },
  1083. roledata2: { rolecode: "second-line support" },
  1084. selectType: "1",
  1085. },
  1086. };
  1087. this.$http
  1088. .post("service/user/data/fetchDataList/user", postData)
  1089. .then(function (res) {
  1090. var handlerUserArr = [];
  1091. res.data.list.forEach(function (v, i) {
  1092. handlerUserArr.push({
  1093. text: v.name,
  1094. value: v.id,
  1095. });
  1096. });
  1097. that.fields[15].props.options = handlerUserArr;
  1098. });
  1099. },
  1100. // 获取升级对象
  1101. getUpUser() {
  1102. var that = this;
  1103. var postData = {
  1104. idx: 0,
  1105. sum: 1000,
  1106. user: {
  1107. roledata: { rolecode: "second-line support" },
  1108. selectType: "1",
  1109. },
  1110. };
  1111. this.$http
  1112. .post("service/user/data/fetchDataList/user", postData)
  1113. .then(function (res) {
  1114. var handlerUserArr = [];
  1115. res.data.list.forEach(function (v, i) {
  1116. handlerUserArr.push({
  1117. text: v.name,
  1118. value: v.id,
  1119. });
  1120. });
  1121. that.fields[6].props.options = handlerUserArr;
  1122. });
  1123. },
  1124. // 获取转派对象
  1125. getRotateUser() {
  1126. var that = this;
  1127. var postData = {
  1128. idx: 0,
  1129. sum: 1000,
  1130. user: {
  1131. roledata: { rolecode: "first-line support" },
  1132. selectType: "1",
  1133. },
  1134. };
  1135. this.$http
  1136. .post("service/user/data/fetchDataList/user", postData)
  1137. .then(function (res) {
  1138. var handlerUserArr = [];
  1139. res.data.list.forEach(function (v, i) {
  1140. handlerUserArr.push({
  1141. text: v.name,
  1142. value: v.id,
  1143. });
  1144. });
  1145. that.fields[8].props.options = handlerUserArr;
  1146. });
  1147. },
  1148. // 获取协同对象
  1149. getSynerUser() {
  1150. var that = this;
  1151. var postData = {
  1152. idx: 0,
  1153. sum: 1000,
  1154. };
  1155. this.$http
  1156. .post("service/user/data/fetchDataList/user", postData)
  1157. .then(function (res) {
  1158. var handlerUserArr = [];
  1159. res.data.list.forEach(function (v, i) {
  1160. handlerUserArr.push({
  1161. label: v.name,
  1162. value: v.id,
  1163. });
  1164. });
  1165. that.fields[10].props.options = handlerUserArr;
  1166. that.synergeticList = handlerUserArr;
  1167. });
  1168. },
  1169. // 获取页面数据
  1170. getMessage() {
  1171. var that = this;
  1172. if (localStorage.getItem("model")) {
  1173. that.model = JSON.parse(localStorage.getItem("model"));
  1174. }
  1175. if (localStorage.getItem("modelData")) {
  1176. that.modelData = JSON.parse(localStorage.getItem("modelData"));
  1177. }
  1178. if (localStorage.getItem("referenceInfo")) {
  1179. that.referenceInfo = JSON.parse(localStorage.getItem("referenceInfo"));
  1180. that.incidentTitle = that.model.handleDescription =
  1181. that.referenceInfo.content;
  1182. }
  1183. if (localStorage.getItem("order")) {
  1184. that.order = localStorage.getItem("order") - 0;
  1185. }
  1186. if (localStorage.getItem("selectedCategoryTxt")) {
  1187. that.selectedCategoryTxt = JSON.parse(
  1188. localStorage.getItem("selectedCategoryTxt")
  1189. );
  1190. }
  1191. that.getProgressInfo();
  1192. },
  1193. // 事件分类
  1194. showCategoryPicker() {
  1195. this.categoryPicker.show();
  1196. },
  1197. selectCategoryHandler(selectedVal, selectedIndex, selectedTxt) {
  1198. console.log(selectedVal, selectedIndex, selectedTxt);
  1199. var selected = [];
  1200. selectedTxt.forEach(function (v, i) {
  1201. if (v != "") {
  1202. selected.push(v);
  1203. }
  1204. });
  1205. this.selected = selected;
  1206. this.selectedCategoryTxt = selected.length
  1207. ? selected[selected.length - 1]
  1208. : "";
  1209. this.model.category = selectedVal;
  1210. localStorage.setItem("category", JSON.stringify(selectedIndex));
  1211. localStorage.setItem("categoryVal", JSON.stringify(selectedVal));
  1212. localStorage.setItem(
  1213. "selectedCategoryTxt",
  1214. JSON.stringify(this.selectedCategoryTxt)
  1215. );
  1216. },
  1217. getIncidentcategory() {
  1218. var that = this;
  1219. this.$http
  1220. .post("service/bpm/data/fetchDataList/incidentcategory", {
  1221. idx: 0,
  1222. sum: 1000,
  1223. })
  1224. .then(function (res) {
  1225. var list = res.data.list;
  1226. var tree = [];
  1227. list.forEach((v, i) => {
  1228. if (!v.parent) {
  1229. tree[i] = {
  1230. value: v.id,
  1231. text: v.category,
  1232. children: [],
  1233. };
  1234. } else {
  1235. tree.forEach((val, idx) => {
  1236. if (
  1237. v.parent &&
  1238. !v.parent.parent &&
  1239. val.text == v.parent.category
  1240. ) {
  1241. tree[idx].children.push({
  1242. value: v.id,
  1243. text: v.category,
  1244. children: [],
  1245. });
  1246. } else if (v.parent.parent) {
  1247. tree[idx].children.forEach((value, index) => {
  1248. if (value.text == v.parent.category) {
  1249. tree[idx].children[index].children.push({
  1250. value: v.id,
  1251. text: v.category,
  1252. });
  1253. }
  1254. });
  1255. }
  1256. });
  1257. }
  1258. });
  1259. if (!localStorage.getItem("category")) {
  1260. let cate = that.modelData.incident.category;
  1261. let cateGrand =
  1262. cate.parentCategory &&
  1263. cate.parentCategory.parentCategory &&
  1264. cate.parentCategory.parentCategory.id;
  1265. let cateFa = cate.parentCategory && cate.parentCategory.id;
  1266. let cateSelf = cate.id;
  1267. console.log(cate, tree);
  1268. var i1 = 0,
  1269. i2 = 0,
  1270. i3 = 0;
  1271. var selectedVal = [];
  1272. var selectedIndex = [];
  1273. var selectedTxt = [];
  1274. tree.forEach((v, i) => {
  1275. if (v.value == cateGrand) {
  1276. selectedVal.push(v.value);
  1277. selectedIndex.push(i);
  1278. selectedTxt.push(v.text);
  1279. v.children.forEach((va, ind) => {
  1280. if (va.value == cateFa) {
  1281. selectedVal.push(va.value);
  1282. selectedIndex.push(ind);
  1283. selectedTxt.push(va.text);
  1284. va.children.forEach((val, idx) => {
  1285. if (val.value == cateSelf) {
  1286. selectedVal.push(val.value);
  1287. selectedIndex.push(idx);
  1288. selectedTxt.push(val.text);
  1289. }
  1290. });
  1291. }
  1292. });
  1293. }
  1294. });
  1295. console.log(selectedVal, selectedIndex, selectedTxt);
  1296. // console.log(i1,i2,i3);
  1297. // var cateData=[i1,i2,i3]
  1298. that.selectData = tree;
  1299. // 获取事件分类并设置
  1300. that.setCategory();
  1301. that.categoryPicker = that.$createCascadePicker({
  1302. title: "事件分类选择",
  1303. data: that.selectData,
  1304. selectedIndex: selectedIndex,
  1305. onSelect: that.selectCategoryHandler,
  1306. });
  1307. setTimeout(() => {
  1308. that.selectCategoryHandler(
  1309. selectedVal,
  1310. selectedIndex,
  1311. selectedTxt
  1312. );
  1313. }, 500);
  1314. } else {
  1315. that.selectData = tree;
  1316. // 获取事件分类并设置
  1317. that.setCategory();
  1318. that.categoryPicker = that.$createCascadePicker({
  1319. title: "事件分类选择",
  1320. data: that.selectData,
  1321. selectedIndex: JSON.parse(localStorage.getItem("category")) || [
  1322. 0, 0, 0,
  1323. ],
  1324. onSelect: that.selectCategoryHandler,
  1325. });
  1326. that.model.category = JSON.parse(
  1327. localStorage.getItem("categoryVal")
  1328. );
  1329. }
  1330. });
  1331. },
  1332. // 暂时存值
  1333. setLocalStroageData() {
  1334. var that = this;
  1335. var a1 = [],
  1336. a2 = [],
  1337. a3 = [],
  1338. category = [],
  1339. solutionType = [],
  1340. synergeticChecked = [];
  1341. that.model.category.forEach(function (v, i) {
  1342. if (v) {
  1343. a1.push(v);
  1344. }
  1345. });
  1346. category = a1;
  1347. that.model.solutionType.forEach(function (v, i) {
  1348. if (v) {
  1349. a2.push(v);
  1350. }
  1351. });
  1352. solutionType = a2;
  1353. that.synergeticChecked.forEach(function (v, i) {
  1354. a3.push({ id: v });
  1355. });
  1356. synergeticChecked = a3;
  1357. that.modelData.incident.category = {
  1358. id: category[category.length - 1],
  1359. };
  1360. that.modelData.loginUser = that.loginUser;
  1361. if (that.order == 1) {
  1362. // 直接处理
  1363. that.modelData.handler_code = "resolve";
  1364. that.modelData.msgflag = "申请关闭";
  1365. that.modelData.submit = "申请关闭";
  1366. that.modelData.incident.handleDescription =
  1367. that.model.handleDescription;
  1368. that.modelData.incident.handleCategory = {
  1369. id: that.model.handleCategory,
  1370. };
  1371. that.modelData.incident.closecode = { id: that.model.closecode };
  1372. that.modelData.isSolution = that.model.knowledge;
  1373. that.modelData.bpm_activiti = {
  1374. solutionType: {
  1375. id: solutionType[solutionType.length - 1],
  1376. },
  1377. };
  1378. // 协同
  1379. that.modelData.incident.synergeticReason = that.model.synergeticReason;
  1380. delete that.modelData.isupreason;
  1381. delete that.modelData.examine;
  1382. delete that.modelData.assignee;
  1383. delete that.modelData.transferReason;
  1384. that.modelData.incident.synergetic = synergeticChecked;
  1385. } else if (that.order == 2) {
  1386. // 升级
  1387. that.modelData.handler_code = "function";
  1388. that.modelData.msgflag = "升级";
  1389. that.modelData.submit = "升级";
  1390. that.modelData.isupreason = that.model.isupreason;
  1391. that.modelData.assignee = that.model.handlerUser;
  1392. that.modelData.examine = {
  1393. upgradeAuditor: { id: that.modelData.assignee },
  1394. };
  1395. delete that.modelData.transferReason;
  1396. delete that.modelData.incident.synergetic;
  1397. delete that.modelData.incident.synergeticReason;
  1398. if (that.modelData.isSolution) {
  1399. delete that.modelData.isSolution;
  1400. }
  1401. } else if (that.order == 3) {
  1402. // 转派
  1403. that.modelData.handler_code = "forward";
  1404. that.modelData.msgflag = "转派";
  1405. that.modelData.submit = "转派";
  1406. that.modelData.transferReason = that.model.transferReason;
  1407. that.modelData.assignee = that.model.handlerUser;
  1408. delete that.modelData.isupreason;
  1409. delete that.modelData.examine;
  1410. delete that.modelData.incident.synergetic;
  1411. delete that.modelData.incident.synergeticReason;
  1412. if (that.modelData.isSolution) {
  1413. delete that.modelData.isSolution;
  1414. }
  1415. }
  1416. that.model.fileUrl = "url";
  1417. that.loadShow = true;
  1418. },
  1419. // 处理方案引入知识库
  1420. referKnowledge() {
  1421. var that = this;
  1422. if (!that.model.handleDescription) {
  1423. alert("请输入处理方案");
  1424. return;
  1425. }
  1426. that.setLocalStroageData();
  1427. localStorage.setItem("modelData", JSON.stringify(that.modelData));
  1428. localStorage.setItem("model", JSON.stringify(that.model));
  1429. localStorage.setItem("order", that.order);
  1430. this.$router.push({
  1431. name: "ReferenceList",
  1432. params: { data: that.model.handleDescription },
  1433. });
  1434. },
  1435. // 新增耗材
  1436. addHcPost() {
  1437. //添加耗材发送请求 start
  1438. let data = JSON.parse(JSON.stringify(this.hcList));
  1439. data.forEach((v) => {
  1440. delete v.id;
  1441. });
  1442. return this.$http.post("service/cmdb/inOutStore/out", { data });
  1443. //添加耗材发送请求 end
  1444. },
  1445. async basePost() {
  1446. if (this.hcList.length) {
  1447. let flag = this.hcList.every(
  1448. (v) => v.consumablesSum && v.assetConsumablesId && v.extra1
  1449. );
  1450. if (!flag) {
  1451. this.$createDialog({
  1452. type: "alert",
  1453. title: "请填写必填项",
  1454. content: "耗材信息填写不完整",
  1455. icon: "cubeic-wrong",
  1456. }).show();
  1457. return;
  1458. }
  1459. console.log(this.hcList);
  1460. let re = await this.addHcPost();
  1461. if (re.data.status != 200) {
  1462. this.$createDialog({
  1463. type: "alert",
  1464. title: "提示",
  1465. content: re.data.msg,
  1466. icon: "cubeic-wrong",
  1467. }).show();
  1468. return;
  1469. }
  1470. }
  1471. let that = this;
  1472. if (this.order == 5) {
  1473. that.$http
  1474. .post(
  1475. "service/bpm/bpm/delegateTask/" + that.modelData.incident.taskId,
  1476. { assginee: that.model.handlerUser }
  1477. )
  1478. .then(function (res) {
  1479. if (res.data) {
  1480. $("#fade").fadeIn();
  1481. that.promptingConent = "恭喜您,提交成功!";
  1482. that.promptingStatus = true;
  1483. that.dialog = that
  1484. .$createDialog({
  1485. type: "alert",
  1486. title: "提交成功",
  1487. content: "点击返回首页",
  1488. icon: "cubeic-right",
  1489. onConfirm: (e, promptValue) => {
  1490. that.$router.push({ path: "/main" });
  1491. },
  1492. })
  1493. .show();
  1494. localStorage.removeItem("category");
  1495. localStorage.removeItem("model");
  1496. localStorage.removeItem("modelData");
  1497. localStorage.removeItem("referenceInfo");
  1498. localStorage.removeItem("solution");
  1499. localStorage.removeItem("order");
  1500. setTimeout(function () {
  1501. $("#fade").fadeOut();
  1502. }, 2000);
  1503. } else {
  1504. $("#fade").fadeIn();
  1505. that.promptingConent = "系统错误,请稍后再试!";
  1506. that.promptingStatus = false;
  1507. that.loadShow = false;
  1508. that.dialog = that
  1509. .$createDialog({
  1510. type: "alert",
  1511. title: "系统错误,请稍后再试!",
  1512. content: "点击返回首页",
  1513. icon: "cubeic-wrong",
  1514. onConfirm: (e, promptValue) => {
  1515. that.$router.push({ path: "/main" });
  1516. },
  1517. })
  1518. .show();
  1519. setTimeout(function () {
  1520. $("#fade").fadeOut();
  1521. }, 2000);
  1522. }
  1523. });
  1524. } else {
  1525. that.$http
  1526. .post(
  1527. "service/bpm/bpm/completeTask/" +
  1528. that.modelData.incident.taskId +
  1529. "/" +
  1530. that.loginUser.id,
  1531. that.modelData
  1532. )
  1533. .then(function (res) {
  1534. if (res.data) {
  1535. setTimeout(function () {
  1536. that.$refs.upload.start();
  1537. }, 100);
  1538. $("#fade").fadeIn();
  1539. that.promptingConent = "恭喜您,提交成功!";
  1540. that.promptingStatus = true;
  1541. that.dialog = that
  1542. .$createDialog({
  1543. type: "alert",
  1544. title: "提交成功",
  1545. content: "点击返回首页",
  1546. icon: "cubeic-right",
  1547. onConfirm: (e, promptValue) => {
  1548. that.$router.push({ path: "/main" });
  1549. },
  1550. })
  1551. .show();
  1552. localStorage.removeItem("category");
  1553. localStorage.removeItem("model");
  1554. localStorage.removeItem("modelData");
  1555. localStorage.removeItem("referenceInfo");
  1556. localStorage.removeItem("solution");
  1557. localStorage.removeItem("order");
  1558. setTimeout(function () {
  1559. $("#fade").fadeOut();
  1560. }, 2000);
  1561. } else {
  1562. $("#fade").fadeIn();
  1563. that.promptingConent = "系统错误,请稍后再试!";
  1564. that.promptingStatus = false;
  1565. that.loadShow = false;
  1566. that.dialog = that
  1567. .$createDialog({
  1568. type: "alert",
  1569. title: "系统错误,请稍后再试!",
  1570. content: "点击返回首页",
  1571. icon: "cubeic-wrong",
  1572. onConfirm: (e, promptValue) => {
  1573. that.$router.push({ path: "/main" });
  1574. },
  1575. })
  1576. .show();
  1577. setTimeout(function () {
  1578. $("#fade").fadeOut();
  1579. }, 2000);
  1580. }
  1581. });
  1582. }
  1583. },
  1584. // 提交
  1585. submitHandler() {
  1586. var that = this;
  1587. that.setLocalStroageData();
  1588. // that.modelData.incident.place = {
  1589. // area:{
  1590. // id:this.selectedAreaId,
  1591. // area:this.selectedAreaName
  1592. // },
  1593. // id:this.selectedPlaceId,
  1594. // place:this.selectedPlaceName
  1595. // };//增加区域地点
  1596. console.log(that.model, that.modelData, 11111);
  1597. // console.log(this.selectedPlaceId,this.selectedAreaId,8888);//2020年4月25日16:12:55
  1598. that.model.fileUrl = "url";
  1599. that.loadShow = true;
  1600. //填写了处理日志,并且是处理中状态
  1601. if (
  1602. that.handlerLog &&
  1603. that.handlerLog.trim() &&
  1604. that.modelData.incident.state.value == "handler"
  1605. ) {
  1606. that.$http
  1607. .post("service/bpm/data/addData/operationLog", {
  1608. operationLog: {
  1609. opType: "handlerLog",
  1610. opValue: that.handlerLog,
  1611. extra1: that.modelData.incident.id,
  1612. },
  1613. })
  1614. .then(function (result1) {
  1615. that.basePost();
  1616. });
  1617. } else {
  1618. that.basePost();
  1619. }
  1620. event.preventDefault();
  1621. },
  1622. validateHandler(result) {
  1623. // console.log(result);
  1624. this.validity = result.validity;
  1625. this.valid = result.valid;
  1626. // if (this.vali == true) {
  1627. // $("#fade").fadeIn();
  1628. // this.promptingConent = "提交失败,请填写必填信息!";
  1629. // this.promptingStatus = false;
  1630. // setTimeout(function() {
  1631. // $("#fade").fadeOut();
  1632. // }, 2000);
  1633. // }
  1634. // this.vali = false;
  1635. },
  1636. dateSelectHandler(selectedVal) {
  1637. this.model.dateValue = new Date(
  1638. selectedVal[0],
  1639. selectedVal[1] - 1,
  1640. selectedVal[2]
  1641. ).toDateString();
  1642. },
  1643. filesAdded(files) {
  1644. let hasIgnore = false;
  1645. const maxSize = 1000 * 1024 * 1024; // 1M
  1646. for (let k in files) {
  1647. const file = files[k];
  1648. if (file.size > maxSize) {
  1649. file.ignore = true;
  1650. hasIgnore = true;
  1651. }
  1652. }
  1653. hasIgnore &&
  1654. this.$createToast({
  1655. type: "warn",
  1656. time: 1000,
  1657. txt: "不能上传超过100M的文件",
  1658. }).show();
  1659. // 暂停上传
  1660. this.$refs.upload.pause();
  1661. },
  1662. fileSubmitted(files) {
  1663. this.action.data = { fileName: files.name };
  1664. },
  1665. },
  1666. created() {
  1667. this.processInstanceId = this.$route.params.data
  1668. ? this.$route.params.data.processInstanceId
  1669. : JSON.parse(localStorage.getItem("modelData")).incident
  1670. .processInstanceId;
  1671. this.id = this.$route.params.data
  1672. ? this.$route.params.data.id
  1673. : JSON.parse(localStorage.getItem("modelData")).incident.id;
  1674. this.action.target += this.processInstanceId;
  1675. this.getParamsData();
  1676. this.getHcs();
  1677. this.getImgs();
  1678. // 处理方式
  1679. this.getHandleCategory();
  1680. // 关闭代码
  1681. this.getClosecode();
  1682. // 升级对象
  1683. this.getUpUser();
  1684. // 指派对象
  1685. this.getZpUser();
  1686. // 转派对象
  1687. this.getRotateUser();
  1688. // 协同对象
  1689. this.getSynerUser();
  1690. // 获取页面数据
  1691. this.getMessage();
  1692. // 事件分类
  1693. this.getIncidentcategory();
  1694. },
  1695. mounted() {
  1696. console.log(this.modelData, this.model, 999);
  1697. // 获取区域列表
  1698. // this.getAreaList().then(res=>{
  1699. // if(this.modelData.incident.place){
  1700. // // 获取地点列表
  1701. // this.getPlaceList(this.modelData.incident.place.area.id)
  1702. // .then(res1=>{
  1703. // this.selectedAreaId = this.modelData.incident.place.area.id;
  1704. // this.selectedAreaName = this.modelData.incident.place.area.area;
  1705. // this.model.selectArea = this.modelData.incident.place.area.id;
  1706. // this.selectedPlaceId = this.modelData.incident.place.id;
  1707. // this.selectedPlaceName = this.modelData.incident.place.place;
  1708. // this.model.selectPlace = this.modelData.incident.place.id;
  1709. // });
  1710. // }
  1711. // })
  1712. },
  1713. components: {
  1714. CubePage,
  1715. CubeButtonGroup,
  1716. DatePicker,
  1717. // JsonView
  1718. CubeExtendPopup,
  1719. LoadIng,
  1720. PrompTing,
  1721. EventInformation,
  1722. // HandlerLog
  1723. },
  1724. };
  1725. </script>
  1726. <style>
  1727. .hcList {
  1728. display: flex;
  1729. align-items: center;
  1730. margin-top: 0.1rem;
  1731. }
  1732. .hcItem {
  1733. flex: 4;
  1734. margin: 0 0.05rem;
  1735. }
  1736. .hcItemClose {
  1737. flex: 1;
  1738. font-size: 0.4rem;
  1739. }
  1740. .addHc {
  1741. width: 90%;
  1742. height: 1rem;
  1743. margin: 0 auto;
  1744. border: 0.02rem solid #ccc;
  1745. display: flex;
  1746. justify-content: center;
  1747. align-items: center;
  1748. }
  1749. .addHc .cubeic-add {
  1750. font-size: 0.8rem;
  1751. }
  1752. .newIncident .cube-form-group {
  1753. border-bottom: 0.02rem solid rgb(245, 245, 245);
  1754. }
  1755. .newIncident .sub .cube-btn {
  1756. margin-top: 1.1rem;
  1757. }
  1758. .btn_plcaeholde .cube-btn {
  1759. padding-left: 0;
  1760. padding-right: 0;
  1761. text-align: left;
  1762. color: inherit;
  1763. background: none;
  1764. border: none;
  1765. }
  1766. .btn_plcaeholde .cube-btn:active {
  1767. background-color: #fff;
  1768. }
  1769. .btn_plcaeholde .cube-btn::after {
  1770. content: ">";
  1771. float: right;
  1772. margin-right: 0.15rem;
  1773. }
  1774. .cube-form_standard .cube-upload-def .cube-upload-btn,
  1775. .cube-form_standard .cube-upload-def .cube-upload-file {
  1776. margin-left: 3% !important;
  1777. }
  1778. .sub .cube-btn {
  1779. background-color: #005395 !important;
  1780. width: 90%;
  1781. margin: 0 auto;
  1782. border-radius: 8px;
  1783. }
  1784. .cube-picker-wheel-item {
  1785. text-overflow: ellipsis;
  1786. }
  1787. </style>
  1788. <style lang="less" scoped>
  1789. .header {
  1790. width: 100%;
  1791. height: 0.88rem;
  1792. line-height: 0.88rem;
  1793. text-align: center;
  1794. color: #fff;
  1795. font-size: 0.37rem;
  1796. background: linear-gradient(#2e2f32, #414246);
  1797. position: fixed;
  1798. top: 0;
  1799. z-index: 6;
  1800. }
  1801. .incidentTitle {
  1802. .titleRefer {
  1803. display: flex;
  1804. align-items: center;
  1805. justify-content: space-between;
  1806. .titleTxtArea {
  1807. font-size: 0.3rem;
  1808. color: #333;
  1809. height: 2rem;
  1810. width: 62%;
  1811. &:focus {
  1812. outline: none;
  1813. }
  1814. }
  1815. .abtn {
  1816. display: inline-block;
  1817. width: 37%;
  1818. text-align: center;
  1819. height: 0.48rem;
  1820. color: #005395;
  1821. font-size: 0.28rem;
  1822. }
  1823. }
  1824. }
  1825. .form-custom {
  1826. .cube-form-item {
  1827. .cube-btn {
  1828. padding-left: 0;
  1829. padding-right: 0;
  1830. text-align: left;
  1831. color: inherit;
  1832. background: none;
  1833. border: none;
  1834. }
  1835. }
  1836. }
  1837. .label {
  1838. background-color: rgb(238, 238, 238);
  1839. height: 0.6rem;
  1840. line-height: 0.6rem;
  1841. padding-left: 0.2rem;
  1842. font-size: 0.24rem;
  1843. color: #666666;
  1844. span {
  1845. font-size: 0.2rem;
  1846. display: inline-block;
  1847. margin-left: 0.08rem;
  1848. color: #999999;
  1849. }
  1850. &.formLabel {
  1851. background-color: #fff;
  1852. }
  1853. }
  1854. .zhidu {
  1855. display: flex;
  1856. height: 0.7rem;
  1857. line-height: 0.7rem;
  1858. border-bottom: 0.02rem solid rgb(245, 245, 245);
  1859. div:nth-child(1) {
  1860. width: 27.5%;
  1861. padding-left: 6%;
  1862. }
  1863. }
  1864. .bgColor {
  1865. background-color: white;
  1866. &.newIncident {
  1867. padding-top: 1.84rem;
  1868. }
  1869. }
  1870. .uplod {
  1871. padding: 0 0.24rem;
  1872. border-bottom: 0.02rem solid rgb(245, 245, 245);
  1873. }
  1874. .handleRadio {
  1875. border-bottom: 0.02rem solid rgb(245, 245, 245);
  1876. }
  1877. .synerBox {
  1878. height: 3rem;
  1879. overflow: scroll;
  1880. }
  1881. i.iconfont.blue {
  1882. color: #005395;
  1883. // &::after {
  1884. // content: "";
  1885. // width: 0.01rem;
  1886. // height: 0.4rem;
  1887. // background: #005395;
  1888. // position: relative;
  1889. // display: block;
  1890. // left: 0.14rem;
  1891. // }
  1892. }
  1893. .againAssign {
  1894. .header {
  1895. width: 100%;
  1896. height: 0.88rem;
  1897. line-height: 0.88rem;
  1898. text-align: center;
  1899. color: #fff;
  1900. font-size: 0.37rem;
  1901. background: linear-gradient(#2e2f32, #414246);
  1902. position: fixed;
  1903. top: 0;
  1904. z-index: 6;
  1905. }
  1906. .navBar {
  1907. width: 100%;
  1908. height: 0.96rem;
  1909. line-height: 0.96rem;
  1910. background-color: #fafafa;
  1911. font-size: 0.28rem;
  1912. position: fixed;
  1913. top: 0.88rem;
  1914. z-index: 9;
  1915. div {
  1916. width: 33.33%;
  1917. text-align: center;
  1918. &.p50 {
  1919. width: 49.99%;
  1920. }
  1921. a {
  1922. display: inline-block;
  1923. height: 0.9rem;
  1924. width: 1.7rem;
  1925. padding: 0 0.1rem;
  1926. &.active {
  1927. color: #005395;
  1928. border-bottom: 0.06rem solid #005395;
  1929. }
  1930. }
  1931. }
  1932. }
  1933. .headtop {
  1934. margin-top: 1.84rem;
  1935. }
  1936. .label {
  1937. background-color: #eeeeee;
  1938. height: 0.6rem;
  1939. line-height: 0.58rem;
  1940. padding-left: 0.2rem;
  1941. font-size: 0.24rem;
  1942. color: #666666;
  1943. span {
  1944. font-size: 0.2rem;
  1945. display: inline-block;
  1946. margin-left: 0.08rem;
  1947. color: #999999;
  1948. }
  1949. &.formLabel {
  1950. background-color: #fff;
  1951. }
  1952. }
  1953. .conentBox {
  1954. width: 100%;
  1955. .conent {
  1956. font-size: 0.32rem;
  1957. font-weight: 400;
  1958. line-height: 0.45rem;
  1959. // border-bottom: 0.16rem solid #e5e5e5;
  1960. .shows {
  1961. display: none;
  1962. }
  1963. .boeder_B {
  1964. border-bottom: 0.01rem solid #ccc;
  1965. }
  1966. p {
  1967. &.desc {
  1968. overflow: hidden;
  1969. }
  1970. .grayFont {
  1971. width: 75%;
  1972. text-align: right;
  1973. overflow-x: scroll;
  1974. }
  1975. }
  1976. .bottom {
  1977. overflow: hidden;
  1978. line-height: 0.86rem;
  1979. border-bottom: 0.01rem solid #e6e6e6;
  1980. font-size: 0.24rem;
  1981. color: #999;
  1982. padding: 0 0.24rem 0 0.48rem;
  1983. }
  1984. .info {
  1985. color: #999;
  1986. font-size: 0.28rem;
  1987. overflow: hidden;
  1988. .head {
  1989. border-bottom: 0.01rem solid #e6e6e6;
  1990. p {
  1991. padding: 0.24rem 0.3rem;
  1992. i {
  1993. color: #00559d;
  1994. }
  1995. }
  1996. }
  1997. p {
  1998. line-height: 0.4rem;
  1999. padding: 0.1rem 0.24rem;
  2000. overflow: hidden;
  2001. .overflowEllipsis2 {
  2002. margin-left: 1.96rem;
  2003. }
  2004. }
  2005. .info_hide {
  2006. padding: 0.2rem 0.24rem;
  2007. border-bottom: 0.01rem solid #e6e6e6;
  2008. .hide {
  2009. color: #00559d;
  2010. }
  2011. }
  2012. .imgs-container {
  2013. a {
  2014. color: #03c !important;
  2015. &:visited {
  2016. color: #551a8b !important;
  2017. }
  2018. }
  2019. img {
  2020. width: 1.5rem;
  2021. height: 1.5rem;
  2022. margin-right: 0.7rem;
  2023. &:nth-child(1) {
  2024. margin-left: 0.75rem;
  2025. }
  2026. }
  2027. }
  2028. .progress {
  2029. padding: 0.2rem 0.2rem;
  2030. overflow: hidden;
  2031. transition-duration: 0.2s;
  2032. transition-timing-function: linear;
  2033. &.progressHide {
  2034. height: 1.7rem;
  2035. }
  2036. .progress_info {
  2037. overflow: hidden;
  2038. margin-bottom: 0.1rem;
  2039. &:nth-last-child(1) {
  2040. .cont {
  2041. border: none !important;
  2042. }
  2043. }
  2044. .progress_info_L {
  2045. float: left;
  2046. color: #333;
  2047. max-width: 18%;
  2048. }
  2049. .progress_info_R {
  2050. float: right;
  2051. margin-left: 0.09rem;
  2052. width: 80%;
  2053. font-size: 0.25rem;
  2054. .time {
  2055. i {
  2056. margin-left: -0.15rem;
  2057. &.icon-icon_weizuo {
  2058. color: #005495;
  2059. }
  2060. &.icon-icon_zhengzaijinx {
  2061. color: #48a843;
  2062. font-size: 0.37rem;
  2063. }
  2064. }
  2065. span {
  2066. margin-left: 0.15rem;
  2067. }
  2068. }
  2069. .cont {
  2070. border-left: 1px solid #999;
  2071. padding-left: 0.4rem;
  2072. min-height: 0.4rem;
  2073. &.blue {
  2074. border-left: 1px solid #005395;
  2075. }
  2076. }
  2077. .text1 {
  2078. font-size: 0.15rem;
  2079. }
  2080. .text2 {
  2081. color: #666;
  2082. word-break: break-all;
  2083. }
  2084. p {
  2085. padding: 0;
  2086. }
  2087. }
  2088. }
  2089. }
  2090. }
  2091. .txtLabel {
  2092. width: 100%;
  2093. overflow: hidden;
  2094. padding: 0.32rem 0.24rem 0.32rem 0.32rem;
  2095. .txt {
  2096. width: 30%;
  2097. color: #666;
  2098. }
  2099. .cube-textarea-wrapper {
  2100. width: 62%;
  2101. }
  2102. }
  2103. .sub {
  2104. background: #ececec;
  2105. .cube-btn {
  2106. background-color: #005395 !important;
  2107. width: 90%;
  2108. margin: 0.2rem auto;
  2109. border-radius: 8px;
  2110. }
  2111. }
  2112. }
  2113. }
  2114. .showwrap {
  2115. width: 75%;
  2116. text-align: right;
  2117. }
  2118. }
  2119. </style>