人民医院前端

addOrEditDispatch.vue 47KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531
  1. <template>
  2. <div>
  3. <el-form
  4. ref="ruleForm"
  5. :model="ruleForm"
  6. :rules="rules"
  7. label-width="120px"
  8. class="order_form"
  9. >
  10. <el-col :span="24">
  11. <el-row>
  12. <el-col :span="12">
  13. <el-form-item label="工号搜索">
  14. <el-input
  15. v-model="usercodeSearch"
  16. placeholder="请输入工号"
  17. @blur="getUserData"
  18. />
  19. </el-form-item>
  20. </el-col>
  21. </el-row>
  22. <el-row>
  23. <el-col :span="12">
  24. <el-form-item label="申请科室" prop="ApplicationDept">
  25. <select-dept-tree
  26. :deptparam="deptidArr"
  27. @post-deptid="getDeptid"
  28. />
  29. </el-form-item>
  30. </el-col>
  31. <el-col :span="12">
  32. <el-form-item label="科室电话" prop="DeptPhone">
  33. <el-input
  34. v-model="ruleForm.DeptPhone"
  35. placeholder="请输入科室电话"
  36. />
  37. </el-form-item>
  38. </el-col>
  39. <el-col :span="12">
  40. <el-form-item label="申请人" prop="Applicant">
  41. <el-select
  42. v-model="ruleForm.Applicant"
  43. filterable
  44. placeholder="请选择申请人"
  45. style="width: 100%"
  46. @change="changeRepairman"
  47. >
  48. <el-option
  49. v-for="item in repairman"
  50. :key="item.usercode"
  51. :label="item.username"
  52. :value="item.usercode"
  53. />
  54. </el-select>
  55. </el-form-item>
  56. </el-col>
  57. <el-col :span="12">
  58. <el-form-item label="联系电话" prop="phone">
  59. <el-input v-model="ruleForm.phone" placeholder="请输入联系电话" />
  60. </el-form-item>
  61. </el-col>
  62. <el-col :span="12">
  63. <el-form-item label="科室位置" prop="position">
  64. <el-input
  65. v-model="ruleForm.position"
  66. type="text"
  67. placeholder="请输入科室位置"
  68. />
  69. </el-form-item>
  70. </el-col>
  71. </el-row>
  72. <el-row v-if="typeAlias === 'YQT'">
  73. <el-col>
  74. <el-form-item label="设备信息" required>
  75. <el-button
  76. :disabled="butIsDisabled"
  77. icon="el-icon-plus"
  78. @click="addItem()"
  79. >添加</el-button
  80. >
  81. </el-form-item>
  82. </el-col>
  83. </el-row>
  84. <el-row v-if="typeAlias === 'YQT'">
  85. <el-row v-for="(item, index) in devList" :key="index">
  86. <el-col :span="7">
  87. <el-form-item prop="devname">
  88. <el-select
  89. :disabled="butIsDisabled"
  90. v-model="item.devname"
  91. placeholder="请选择设备"
  92. @change="selectChange"
  93. >
  94. <el-option
  95. v-for="item in airArr"
  96. :key="item.F_DictionaryValueId"
  97. :label="item.F_Name"
  98. :value="`${item.F_Name},${item.F_DictionaryValueId}`"
  99. />
  100. </el-select>
  101. </el-form-item>
  102. </el-col>
  103. <el-col :span="7">
  104. <el-form-item prop="num">
  105. <el-input-number
  106. :disabled="butIsDisabled"
  107. v-model="item.num"
  108. :min="1"
  109. size="mini"
  110. />
  111. </el-form-item>
  112. </el-col>
  113. <el-col :span="10">
  114. <el-form-item prop="F_IsBorrow">
  115. <el-radio-group
  116. :disabled="butIsDisabled"
  117. v-model="item.F_IsBorrow"
  118. >
  119. <el-radio label="1">借</el-radio>
  120. <el-radio label="2">还</el-radio>
  121. </el-radio-group>
  122. <el-button
  123. type="primary"
  124. icon="el-icon-close"
  125. circle
  126. @click="removeItem(index)"
  127. />
  128. </el-form-item>
  129. </el-col>
  130. </el-row>
  131. </el-row>
  132. <el-row v-if="typeAlias === '2001'">
  133. <el-col>
  134. <el-form-item label="设备信息" required>
  135. <el-button
  136. :disabled="butIsDisabled"
  137. icon="el-icon-plus"
  138. @click="addItem()"
  139. >添加</el-button
  140. >
  141. </el-form-item>
  142. </el-col>
  143. </el-row>
  144. <el-row v-if="typeAlias === '2001'">
  145. <el-row v-for="(item, index) in devList" :key="index">
  146. <el-col :span="7">
  147. <el-form-item prop="devname">
  148. <el-select
  149. :disabled="butIsDisabled"
  150. v-model="item.devname"
  151. placeholder="请选择设备"
  152. @change="selectChange"
  153. >
  154. <el-option
  155. v-for="item in equipArr"
  156. :key="item.F_DictionaryValueId"
  157. :label="item.F_Name"
  158. :value="`${item.F_Name},${item.F_DictionaryValueId}`"
  159. />
  160. </el-select>
  161. </el-form-item>
  162. </el-col>
  163. <el-col :span="7">
  164. <el-form-item prop="num">
  165. <el-input-number
  166. :disabled="butIsDisabled"
  167. v-model="item.num"
  168. :min="1"
  169. size="mini"
  170. />
  171. </el-form-item>
  172. </el-col>
  173. <el-col :span="10">
  174. <el-form-item prop="F_IsBorrow">
  175. <el-radio-group
  176. :disabled="butIsDisabled"
  177. v-model="item.F_IsBorrow"
  178. >
  179. <el-radio label="1">借</el-radio>
  180. <el-radio label="2">还</el-radio>
  181. </el-radio-group>
  182. <el-button
  183. type="primary"
  184. icon="el-icon-close"
  185. circle
  186. @click="removeItem(index)"
  187. />
  188. </el-form-item>
  189. </el-col>
  190. </el-row>
  191. </el-row>
  192. <el-row v-if="typeAlias === '2002'">
  193. <el-col>
  194. <el-form-item label="物资信息">
  195. <el-button
  196. :disabled="butIsDisabled"
  197. icon="el-icon-plus"
  198. @click="addItem()"
  199. >添加</el-button
  200. >
  201. </el-form-item>
  202. </el-col>
  203. </el-row>
  204. <el-row v-if="typeAlias === '2002'">
  205. <el-row v-for="(item, index) in devList" :key="index">
  206. <el-col :span="12">
  207. <el-form-item prop="devname">
  208. <el-select
  209. :disabled="butIsDisabled"
  210. v-model="item.devname"
  211. placeholder="请选择物资"
  212. >
  213. <el-option
  214. v-for="item in goodsArr"
  215. :key="item.F_DictionaryValueId"
  216. :label="item.F_Name"
  217. :value="`${item.F_Name},${item.F_DictionaryValueId}`"
  218. />
  219. </el-select>
  220. </el-form-item>
  221. </el-col>
  222. <el-col :span="12">
  223. <el-form-item prop="num">
  224. <el-input-number
  225. :disabled="butIsDisabled"
  226. v-model="item.num"
  227. :min="1"
  228. size="medium"
  229. />
  230. <el-button
  231. type="primary"
  232. icon="el-icon-close"
  233. circle
  234. @click="removeItem(index)"
  235. />
  236. </el-form-item>
  237. </el-col>
  238. </el-row>
  239. </el-row>
  240. <el-row v-if="typeAlias === '2003'">
  241. <el-col>
  242. <el-form-item label="病床信息" required>
  243. <el-button
  244. :disabled="butIsDisabled"
  245. icon="el-icon-plus"
  246. @click="addItem()"
  247. >添加</el-button
  248. >
  249. </el-form-item>
  250. </el-col>
  251. </el-row>
  252. <el-row v-if="typeAlias === '2003'">
  253. <el-row v-for="(item, index) in devList" :key="index">
  254. <el-col :span="7">
  255. <el-form-item prop="devname">
  256. <el-select
  257. :disabled="butIsDisabled"
  258. v-model="item.devname"
  259. placeholder="请选择病床"
  260. >
  261. <el-option
  262. v-for="item in bedsArr"
  263. :key="item.F_DictionaryValueId"
  264. :label="item.F_Name"
  265. :value="`${item.F_Name},${item.F_DictionaryValueId}`"
  266. />
  267. </el-select>
  268. </el-form-item>
  269. </el-col>
  270. <el-col :span="7">
  271. <el-form-item prop="num">
  272. <el-input-number
  273. :disabled="butIsDisabled"
  274. v-model="item.num"
  275. :min="1"
  276. size="mini"
  277. />
  278. </el-form-item>
  279. </el-col>
  280. <el-col :span="10">
  281. <el-form-item prop="F_IsBorrow">
  282. <el-radio-group
  283. :disabled="butIsDisabled"
  284. v-model="item.F_IsBorrow"
  285. >
  286. <el-radio label="1">借</el-radio>
  287. <el-radio label="2">还</el-radio>
  288. </el-radio-group>
  289. <el-button
  290. type="primary"
  291. icon="el-icon-close"
  292. circle
  293. @click="removeItem(index)"
  294. />
  295. </el-form-item>
  296. </el-col>
  297. </el-row>
  298. </el-row>
  299. <el-row v-if="typeAlias === '2006'">
  300. <el-col>
  301. <el-form-item label="标本信息" required>
  302. <el-button
  303. :disabled="butIsDisabled"
  304. icon="el-icon-plus"
  305. @click="addItem()"
  306. >添加</el-button
  307. >
  308. </el-form-item>
  309. </el-col>
  310. </el-row>
  311. <el-row v-if="typeAlias === '2006'">
  312. <el-row v-for="(item, index) in devList" :key="index">
  313. <el-col :span="12">
  314. <el-form-item prop="devname">
  315. <el-cascader
  316. ref="cascaderbb"
  317. :options="bborderData"
  318. :props="TagProps"
  319. clearable
  320. placeholder="请选择标本"
  321. @change="(devname) => handleChange(devname, index)"
  322. ></el-cascader>
  323. </el-form-item>
  324. </el-col>
  325. <el-col :span="12">
  326. <el-form-item prop="num">
  327. <el-input-number
  328. :disabled="butIsDisabled"
  329. v-model="item.num"
  330. :min="1"
  331. size="medium"
  332. />
  333. <el-button
  334. type="primary"
  335. icon="el-icon-close"
  336. circle
  337. @click="removeItem(index)"
  338. />
  339. </el-form-item>
  340. </el-col>
  341. </el-row>
  342. </el-row>
  343. <el-row v-if="typeAlias === '2007'">
  344. <el-col>
  345. <el-form-item label="送达科室" required>
  346. <el-button
  347. :disabled="butIsDisabled"
  348. icon="el-icon-plus"
  349. @click="addItem()"
  350. >添加</el-button
  351. >
  352. </el-form-item>
  353. </el-col>
  354. </el-row>
  355. <el-row v-if="typeAlias === '2007'">
  356. <el-row v-for="(item, index) in devList" :key="index">
  357. <el-col :span="7">
  358. <el-form-item prop="F_ToDept">
  359. <el-cascader
  360. ref="cascaderdept"
  361. filterable
  362. v-model="item.F_ToDept"
  363. :options="deptorderData"
  364. :props="DeptTagProps"
  365. clearable
  366. placeholder="请选择科室"
  367. @change="(F_ToDept) => handleDeptChange(F_ToDept, index)"
  368. ></el-cascader>
  369. </el-form-item>
  370. </el-col>
  371. <el-col :span="7">
  372. <el-form-item prop="devname">
  373. <el-select
  374. :disabled="butIsDisabled"
  375. v-model="item.devarr"
  376. multiple
  377. collapse-tags
  378. placeholder="请选择血液类型"
  379. @change="(devarr) => getBloodsarr(devarr, index)"
  380. >
  381. <el-option
  382. v-for="item in bloodArr"
  383. :key="item.F_DictionaryValueId"
  384. :label="item.F_Name"
  385. :value="`${item.F_Name},${item.F_DictionaryValueId}`"
  386. />
  387. </el-select>
  388. </el-form-item>
  389. </el-col>
  390. <el-col :span="10">
  391. <el-form-item prop="num">
  392. <el-input-number
  393. :disabled="butIsDisabled"
  394. v-model="item.num"
  395. :min="1"
  396. size="mini"
  397. />
  398. <el-button
  399. type="primary"
  400. icon="el-icon-close"
  401. circle
  402. @click="removeItem(index)"
  403. />
  404. </el-form-item>
  405. </el-col>
  406. </el-row>
  407. </el-row>
  408. <el-row v-if="typeAlias === '2005'">
  409. <el-col>
  410. <el-form-item label="药品信息">
  411. <el-button
  412. :disabled="butIsDisabled"
  413. icon="el-icon-plus"
  414. @click="addItem()"
  415. >添加</el-button
  416. >
  417. </el-form-item>
  418. </el-col>
  419. </el-row>
  420. <el-row v-if="typeAlias === '2005'">
  421. <el-row v-for="(item, index) in devList" :key="index">
  422. <el-col :span="12">
  423. <el-form-item prop="devname">
  424. <el-select
  425. :disabled="butIsDisabled"
  426. filterable
  427. allow-create
  428. default-first-option
  429. v-model="item.devname"
  430. placeholder="请选择药品"
  431. >
  432. <el-option
  433. v-for="item in drugArr"
  434. :key="item.F_DictionaryValueId"
  435. :label="item.F_Name"
  436. :value="`${item.F_Name},${item.F_DictionaryValueId}`"
  437. />
  438. </el-select>
  439. </el-form-item>
  440. </el-col>
  441. <el-col :span="12">
  442. <el-form-item prop="num">
  443. <el-input-number
  444. :disabled="butIsDisabled"
  445. v-model="item.num"
  446. :min="1"
  447. size="medium"
  448. />
  449. <el-button
  450. type="primary"
  451. icon="el-icon-close"
  452. circle
  453. @click="removeItem(index)"
  454. />
  455. </el-form-item>
  456. </el-col>
  457. </el-row>
  458. </el-row>
  459. <el-col v-if="typeAlias === '2004'" :span="12">
  460. <el-form-item label="处方数量">
  461. <el-input-number
  462. :disabled="butIsDisabled"
  463. v-model="ruleForm.cfnum"
  464. :min="1"
  465. size="medium"
  466. class="inputNumber"
  467. />
  468. </el-form-item>
  469. </el-col>
  470. <!-- <el-row v-if="typeAlias === '2006'">
  471. <el-col :span="24">
  472. <el-form-item label="送达地点" prop="toplace">
  473. <el-select v-model="ruleForm.toplace" filterable placeholder="请选择送达地点" style="width: 100%;">
  474. <el-option v-for="(item,index) in placeArr" :key="index" :label="item.F_Name" :value="item.F_Name">
  475. </el-option>
  476. </el-select>
  477. </el-form-item>
  478. </el-col>
  479. </el-row> -->
  480. <!-- <el-row v-if="typeAlias !== '2006'">
  481. <el-col :span="24">
  482. <el-form-item label="送达地点" prop="toplace">
  483. <el-input v-model="ruleForm.toplace" type="text" placeholder="请输入送达地点" />
  484. </el-form-item>
  485. </el-col>
  486. </el-row> -->
  487. <el-row>
  488. <el-col :span="24">
  489. <el-form-item label="备注" prop="content">
  490. <el-input
  491. v-model="ruleForm.content"
  492. type="textarea"
  493. placeholder="请输入备注"
  494. />
  495. </el-form-item>
  496. </el-col>
  497. </el-row>
  498. <el-row>
  499. <el-col :span="24">
  500. <el-form-item label="上传附件" prop="repairImageid">
  501. <el-upload
  502. :headers="headers"
  503. :file-list="fileList"
  504. :on-remove="handle_remove"
  505. :on-success="handle_success"
  506. :action="imgUrl"
  507. list-type="picture-card"
  508. >
  509. <i class="el-icon-plus" />
  510. </el-upload>
  511. </el-form-item>
  512. </el-col>
  513. </el-row>
  514. <el-row>
  515. <!-- <el-col :span="10">
  516. <el-form-item label="紧急情况">
  517. <el-radio-group v-model="ruleForm.EmergencyTypes">
  518. <el-radio label="一般">一般</el-radio>
  519. <el-radio label="紧急">紧急</el-radio>
  520. </el-radio-group>
  521. </el-form-item>
  522. </el-col> -->
  523. <el-col v-if="iswomanage != 1 && iswomanage != 2" :span="24">
  524. <el-form-item label="处理方式" prop="opt">
  525. <el-radio-group v-model="ruleForm.opt">
  526. <el-radio label="0">立即办理</el-radio>
  527. <el-radio label="1">暂存</el-radio>
  528. <el-radio label="2">转派</el-radio>
  529. </el-radio-group>
  530. </el-form-item>
  531. </el-col>
  532. </el-row>
  533. <el-row
  534. v-if="ruleForm.opt == '2' && iswomanage != 1 && iswomanage != 2"
  535. >
  536. <el-col :span="12">
  537. <el-form-item label="指派科室">
  538. <select-dept-tree
  539. :deptparam="deptidArr1"
  540. @post-deptid="getDeptid1"
  541. />
  542. </el-form-item>
  543. </el-col>
  544. <el-col v-if="typeAlias !== '2007'" :span="12">
  545. <el-form-item label="接收人">
  546. <el-select
  547. v-model="ruleForm.clid"
  548. clearable
  549. filterable
  550. placeholder="请选择接收人"
  551. style="width: 100%"
  552. @change="changeRepairman1"
  553. >
  554. <el-option
  555. v-for="item in repairman1"
  556. :key="item.usercode"
  557. :label="item.username + '(' + item.count + ')'"
  558. :value="item.usercode"
  559. />
  560. </el-select>
  561. </el-form-item>
  562. </el-col>
  563. <el-col v-if="typeAlias === '2007'">
  564. <el-table :data="devList">
  565. <el-table-column prop="F_ToDept" label="送达科室" align="center">
  566. <template slot-scope="scope">
  567. <span v-if="scope.row.F_ToDept">{{
  568. $store.getters.deptmap[parseInt(scope.row.F_ToDept)].text
  569. }}</span>
  570. </template>
  571. </el-table-column>
  572. <el-table-column prop="devname" label="血液类型" align="center">
  573. <template slot-scope="scope">
  574. <span>{{ scope.row.devname.split("?")[0] }}</span>
  575. </template>
  576. </el-table-column>
  577. <el-table-column prop="num" label="数量" align="center" />
  578. <el-table-column
  579. prop="F_AssignUser"
  580. label="指派人"
  581. align="center"
  582. >
  583. <template slot-scope="scope">
  584. <el-select
  585. v-model="scope.row.F_AssignUser"
  586. clearable
  587. filterable
  588. placeholder="请选择接收人"
  589. style="width: 100%"
  590. @change="changeRepairman1"
  591. >
  592. <el-option
  593. v-for="item in repairman1"
  594. :key="item.usercode"
  595. :label="item.username + '(' + item.count + ')'"
  596. :value="item.usercode"
  597. />
  598. </el-select>
  599. </template>
  600. </el-table-column>
  601. </el-table>
  602. </el-col>
  603. </el-row>
  604. <el-row>
  605. <el-form-item>
  606. <el-button type="primary" @click="submitForm">提交工单</el-button>
  607. </el-form-item>
  608. </el-row>
  609. </el-col>
  610. </el-form>
  611. </div>
  612. </template>
  613. <script>
  614. import {
  615. GetDicValueList,
  616. GetequipList,
  617. AddSchedulingWorkOrder,
  618. UpdateSchedulingWorkOrder,
  619. GetOrderDetail,
  620. } from "@/api/comDispatch/addOrEditDispatch";
  621. import { getUserMsg } from "@/api/orderManagement/orderList";
  622. import { getDeptTree } from "@/api/systemSetup/roleSetting/userManage";
  623. import {
  624. GetPerson,
  625. GetDicValue,
  626. getClassByDeptId,
  627. GetBBXXList,
  628. } from "@/api/commonAPI";
  629. import { getTypeDetail } from "@/api/systemSetup/roleSetting/department";
  630. import { Send, ws } from "../../../utils/telWebsocket.js";
  631. import { mapGetters } from "vuex";
  632. export default {
  633. name: "AddOrEditDispatch",
  634. props: {
  635. ordreId: {
  636. type: Number,
  637. default: 0,
  638. },
  639. orderTypeData: {
  640. type: Object,
  641. default() {
  642. return {};
  643. },
  644. },
  645. layerid: {
  646. type: String,
  647. default: "",
  648. },
  649. callid: {
  650. type: String,
  651. default: "",
  652. },
  653. wid: {
  654. type: String,
  655. default: "",
  656. },
  657. fid: {
  658. type: String,
  659. default: "",
  660. },
  661. iswomanage: {
  662. type: String,
  663. default: "",
  664. },
  665. },
  666. data() {
  667. return {
  668. usercodeSearch: "",
  669. typeAlias: "",
  670. cid: "",
  671. butIsDisabled: false,
  672. butIsDisabledMyList: false,
  673. headers: {
  674. Authorization: "Bearer " + localStorage.getItem("Admin-Token"),
  675. },
  676. imgUrl:
  677. this.$store.getters.serverConfig.BASE_API +
  678. "FaultRepair/UploadFile?token=" +
  679. localStorage.getItem("Admin-Token"),
  680. type2Arr: [],
  681. firstOrderTypeParam: {
  682. typeid: 1,
  683. name: "",
  684. pid: 0,
  685. },
  686. hospitalsParam: {
  687. id: 0,
  688. name: "",
  689. },
  690. departmentsParam: {
  691. id: 0,
  692. name: "",
  693. },
  694. repairmanParam: {
  695. id: 0,
  696. name: "",
  697. },
  698. devList: [
  699. {
  700. devname: "",
  701. num: 1,
  702. F_IsBorrow: "",
  703. F_ToDept: "",
  704. F_AssignUser: "",
  705. },
  706. ],
  707. TagProps: {
  708. checkStrictly: true,
  709. value: "id",
  710. label: "text",
  711. children: "children",
  712. emitPath: false,
  713. },
  714. DeptTagProps: {
  715. checkStrictly: true,
  716. children: "children",
  717. label: "text",
  718. value: "id",
  719. emitPath: false,
  720. },
  721. autodeptid: [],
  722. bborderData: [],
  723. deptorderData: [],
  724. placeArr: [],
  725. detailists: [],
  726. deptidArr: [],
  727. deptidArr1: [],
  728. repairman: [],
  729. repairman1: [],
  730. airArr: [],
  731. equipArr: [],
  732. goodsArr: [],
  733. bedsArr: [],
  734. bloodArr: [],
  735. // specimenArr: [],
  736. // fjcspecimenArr: [],
  737. drugArr: [],
  738. fileList: [],
  739. ruleForm: {
  740. orderType: 2003, // 工单类型
  741. F_Type2: "",
  742. ApplicationDept: "",
  743. DeptPhone: "",
  744. Applicant: "",
  745. hospital: 0, // 院区
  746. department: "", // 科室
  747. deptid: 0, // 科室id
  748. username: 0, // 申请人
  749. usercode: 0, // 申请人id
  750. phone: "", // 联系电话
  751. position: "",
  752. // toplace: "",
  753. content: "",
  754. cfnum: "",
  755. opt: "2",
  756. clid: "",
  757. EmergencyTypes: "",
  758. remark: "", // 备注
  759. repairImageid: "",
  760. },
  761. rules: {
  762. ApplicationDept: [
  763. {
  764. required: true,
  765. message: "请选择申请科室",
  766. trigger: "change",
  767. },
  768. ],
  769. Applicant: [
  770. {
  771. required: true,
  772. message: "请选择申请人",
  773. trigger: "change",
  774. },
  775. ],
  776. position: [
  777. {
  778. required: true,
  779. message: "科室位置不能为空",
  780. trigger: "blur",
  781. },
  782. ],
  783. // toplace: [{
  784. // required: true,
  785. // message: '送达地点不能为空',
  786. // trigger: 'blur'
  787. // }],
  788. // content: [{
  789. // required: true,
  790. // message: '工单内容不能为空',
  791. // trigger: 'blur'
  792. // }],
  793. phone: [
  794. {
  795. required: true,
  796. message: "手机号不能为空",
  797. trigger: "blur",
  798. },
  799. // {
  800. // pattern: /^((0\d{2,3}-\d{5,8})|(1[345789]\d{9}))$/,
  801. // message: '请输入正确的电话号码或者固话号码',
  802. // trigger: 'blur'
  803. // }
  804. ],
  805. },
  806. };
  807. },
  808. watch: {
  809. "orderTypeData.F_Type2": function () {
  810. console.log(this.orderTypeData, "7777778888888888");
  811. this.getTreebiaoben(this.orderTypeData.F_TypeName2);
  812. this.type2Arr = this.orderTypeData.type2Arr;
  813. console.log(this.type2Arr[0]);
  814. this.devList = [
  815. {
  816. devname: "",
  817. num: 1,
  818. F_IsBorrow: "",
  819. F_ToDept: "",
  820. },
  821. ];
  822. if (this.type2Arr.length > 0) {
  823. this.typeAlias =
  824. this.$store.getters.workTypeMap[parseInt(this.type2Arr[0])].tag || "";
  825. console.log(this.typeAlias, "标识11");
  826. }
  827. this.ruleForm.F_Type2 = this.orderTypeData.F_Type2;
  828. //默认
  829. if (this.orderTypeData.F_Type2) {
  830. this.getAuto();
  831. // this.deptidArr1 = this.$store.getters.deptmap[parseInt(autodept)].ids
  832. // this.autodeptid = this.$store.getters.workTypeMap[parseInt(this.orderTypeData.F_Type2)].autoDept
  833. // if(this.autodeptid){
  834. // this.deptidArr1 = this.$store.getters.deptmap[parseInt(this.autodeptid)].ids
  835. // this.ruleForm.DealDept = this.$store.getters.workTypeMap[parseInt(this.orderTypeData.F_Type2)].autoDept
  836. // this.getClassUser(this.autodeptid)
  837. // }else{
  838. // this.deptidArr1 = []
  839. // this.repairman1 = []
  840. // this.ruleForm.DealDept = ''
  841. // this.ruleForm.clid = ''
  842. // }
  843. }
  844. },
  845. },
  846. computed: {
  847. ...mapGetters([
  848. "telTopRightState", // 状态信息
  849. ]),
  850. },
  851. created() {
  852. this.cid = this.callid;
  853. if (!this.cid) {
  854. this.cid = window.localStorage.getItem("callidSave");
  855. }
  856. this.getairs();
  857. this.getequis();
  858. this.getgoods();
  859. this.getbeds();
  860. this.getbloods();
  861. this.getTreeDeptList();
  862. // this.getbiaoben()
  863. // this.getTreebiaoben()
  864. // this.getfjcbiaoben()
  865. this.getdrugs();
  866. this.getPlace();
  867. if (this.wid) {
  868. this.butIsDisabled = true;
  869. this.getDetail();
  870. if (this.iswomanage === "2") {
  871. this.butIsDisabledMyList = true;
  872. }
  873. }
  874. if (this.iswomanage === "1") {
  875. this.usercodeSearch = window.localStorage.getItem("storageUsercode");
  876. const deptid = this.$store.getters.teamId;
  877. this.deptidArr = this.$store.getters.deptmap[parseInt(deptid)].ids;
  878. this.ruleForm.ApplicationDept = deptid;
  879. this.getRepairman(deptid, 0);
  880. this.getDeptAddress(deptid);
  881. this.ruleForm.Applicant = this.$store.getters.usercode;
  882. this.ruleForm.phone = this.$store.getters.mobile;
  883. this.ruleForm.position = this.$store.getters.location;
  884. // this.ruleForm.toplace = this.$store.getters.location
  885. }
  886. if (this.iswomanage == 1) {
  887. this.ruleForm.clid = "";
  888. this.ruleForm.DealDept = "";
  889. }
  890. // this.getUserData()
  891. },
  892. methods: {
  893. getAuto() {
  894. this.deptidArr1 = [];
  895. this.repairman1 = [];
  896. this.ruleForm.DealDept = "";
  897. this.ruleForm.clid = "";
  898. const autoData = JSON.parse(
  899. this.$store.getters.workTypeMap[parseInt(this.orderTypeData.F_Type2)]
  900. .autoDept || "[]"
  901. );
  902. const applyHos = this.deptidArr[0];
  903. console.log(autoData, applyHos);
  904. if (!autoData) {
  905. return;
  906. }
  907. var hosall = [];
  908. for (var i = 0; i < autoData.length; i++) {
  909. hosall.push(autoData[i].autoyq);
  910. }
  911. for (var i = 0; i < autoData.length; i++) {
  912. if (autoData[i].autoyq == applyHos) {
  913. //有院区
  914. this.deptidArr1 =
  915. this.$store.getters.deptmap[parseInt(autoData[i].autodept)].ids;
  916. this.ruleForm.DealDept = autoData[i].autodept;
  917. this.getClassUser(autoData[i].autodept);
  918. this.ruleForm.clid = autoData[i].autousercode;
  919. } else if (autoData[i].autoyq == "0" && hosall.indexOf(applyHos) < 0) {
  920. //全部
  921. this.deptidArr1 =
  922. this.$store.getters.deptmap[parseInt(autoData[i].autodept)].ids;
  923. this.ruleForm.DealDept = autoData[i].autodept;
  924. this.getClassUser(autoData[i].autodept);
  925. this.ruleForm.clid = autoData[i].autousercode;
  926. }
  927. }
  928. },
  929. changeMuter(data) {},
  930. getBloodsarr(val, index) {
  931. var namestr = "";
  932. var idstr = "";
  933. for (var i = 0; i < val.length; i++) {
  934. namestr += val[i].split(",")[0] + ",";
  935. idstr += val[i].split(",")[1] + ",";
  936. }
  937. this.devList[index].devname =
  938. namestr.slice(0, namestr.length - 1) +
  939. "?" +
  940. idstr.slice(0, idstr.length - 1);
  941. },
  942. getTreebiaoben(str) {
  943. const params = {
  944. flag: 1,
  945. typename: str,
  946. };
  947. GetBBXXList(params).then((res) => {
  948. this.bborderData = res.data;
  949. });
  950. },
  951. getTreeDeptList() {
  952. return new Promise((resolve) => {
  953. const params = {};
  954. getDeptTree(params).then((response) => {
  955. if (response.state.toLowerCase() === "success") {
  956. this.deptorderData = response.data;
  957. }
  958. });
  959. resolve();
  960. });
  961. },
  962. handleChange(data, index) {
  963. const obj = this.$refs["cascaderbb"][index].getCheckedNodes();
  964. this.devList[index].devname = obj[0].data.text + "," + data;
  965. },
  966. handleDeptChange(data, index) {
  967. const obj = this.$refs["cascaderdept"][index].getCheckedNodes();
  968. if (obj) {
  969. this.devList[index].F_ToDept = obj[0].data.id;
  970. }
  971. },
  972. getUserData() {
  973. if (!this.usercodeSearch) {
  974. return;
  975. }
  976. const params = {
  977. usercode: this.usercodeSearch,
  978. };
  979. getUserMsg(params).then((res) => {
  980. const data = res.data;
  981. this.ruleForm.ApplicationDept = data.F_DeptId;
  982. this.deptidArr =
  983. this.$store.getters.deptmap[parseInt(data.F_DeptId)].ids;
  984. this.getRepairman(data.F_DeptId, 0);
  985. this.getDeptAddress(data.F_DeptId);
  986. this.ruleForm.Applicant = data.F_UserCode;
  987. this.ruleForm.phone = data.F_Telephone;
  988. this.ruleForm.position = data.F_Location;
  989. this.getAuto();
  990. // this.ruleForm.toplace = data.F_Location
  991. });
  992. },
  993. getPlace() {
  994. GetDicValue("SDKS").then((res) => {
  995. this.placeArr = res.rows;
  996. });
  997. },
  998. addItem() {
  999. const params = {
  1000. devname: "",
  1001. num: 1,
  1002. F_IsBorrow: "",
  1003. F_ToDept: "",
  1004. };
  1005. this.devList.push(params);
  1006. },
  1007. removeItem(index) {
  1008. console.log(index);
  1009. this.devList.splice(index, 1);
  1010. },
  1011. selectChange(val) {
  1012. console.log(val);
  1013. },
  1014. getDeptid(data) {
  1015. this.deptidArr = data;
  1016. this.ruleForm.ApplicationDept = data[data.length - 1];
  1017. this.ruleForm.Applicant = "";
  1018. this.getRepairman(data[data.length - 1], 0);
  1019. this.getDeptAddress(data[data.length - 1]);
  1020. this.getAuto();
  1021. },
  1022. getDeptid1(data) {
  1023. this.ruleForm.DealDept = data[data.length - 1];
  1024. this.getClassUser(data[data.length - 1]);
  1025. },
  1026. getDeptAddress(id) {
  1027. getTypeDetail(id).then((res) => {
  1028. this.ruleForm.position = res.data.F_Location;
  1029. this.ruleForm.DeptPhone = res.data.F_OfficeTelephone;
  1030. });
  1031. },
  1032. getClassUser(id) {
  1033. const params = {
  1034. deptid: id,
  1035. };
  1036. this.repairman1 = [];
  1037. this.ruleForm.clid = "";
  1038. if (id) {
  1039. getClassByDeptId(params).then((res) => {
  1040. this.repairman1 = res.rows;
  1041. });
  1042. }
  1043. },
  1044. getRepairman(id, state) {
  1045. return new Promise((resolve) => {
  1046. const params = {
  1047. deptid: id, // 字典管理的工单标识
  1048. };
  1049. GetPerson(params).then((res) => {
  1050. if (state === 0) {
  1051. this.repairman = res.rows;
  1052. } else if (state === 1) {
  1053. this.assignman = res.rows;
  1054. }
  1055. });
  1056. resolve();
  1057. });
  1058. },
  1059. getRepairman1(id, state) {
  1060. return new Promise((resolve) => {
  1061. const params = {
  1062. deptid: id, // 字典管理的工单标识
  1063. };
  1064. GetPerson(params).then((res) => {
  1065. if (state === 0) {
  1066. this.repairman1 = res.rows;
  1067. } else if (state === 1) {
  1068. this.assignman1 = res.rows;
  1069. }
  1070. });
  1071. resolve();
  1072. });
  1073. },
  1074. changeRepairman(data) {
  1075. const user = this.repairman.find((o) => {
  1076. return o.usercode === data.toString();
  1077. });
  1078. if (user) {
  1079. this.ruleForm.phone = user.usertelphone;
  1080. }
  1081. },
  1082. changeRepairman1(data) {},
  1083. handle_success(res) {
  1084. this.ruleForm.repairImageid += res.data[0].F_FileId + ",";
  1085. },
  1086. handle_remove(res) {
  1087. if (res.F_FileId) {
  1088. var oldstr = res.F_FileId + ",";
  1089. }
  1090. if (res.response) {
  1091. var str = res.response.data[0].F_FileId + ",";
  1092. }
  1093. if (oldstr) {
  1094. this.ruleForm.repairImageid = this.ruleForm.repairImageid.replace(
  1095. oldstr,
  1096. ""
  1097. );
  1098. }
  1099. if (str) {
  1100. this.ruleForm.repairImageid = this.ruleForm.repairImageid.replace(
  1101. str,
  1102. ""
  1103. );
  1104. }
  1105. },
  1106. getairs() {
  1107. const params = {
  1108. Flag: "YQT",
  1109. Name: "",
  1110. };
  1111. return new Promise((resolve) => {
  1112. GetDicValueList(params).then((response) => {
  1113. this.airArr = response.rows;
  1114. });
  1115. resolve();
  1116. });
  1117. },
  1118. getequis() {
  1119. const params = {
  1120. Flag: "SBXX",
  1121. Name: "",
  1122. };
  1123. return new Promise((resolve) => {
  1124. GetDicValueList(params).then((response) => {
  1125. this.equipArr = response.rows;
  1126. });
  1127. resolve();
  1128. });
  1129. },
  1130. getgoods() {
  1131. const params = {
  1132. Flag: "WZXX",
  1133. Name: "",
  1134. };
  1135. GetDicValueList(params).then((res) => {
  1136. this.goodsArr = res.rows;
  1137. });
  1138. },
  1139. getbeds() {
  1140. const params = {
  1141. Flag: "BCXX",
  1142. Name: "",
  1143. };
  1144. GetDicValueList(params).then((res) => {
  1145. this.bedsArr = res.rows;
  1146. });
  1147. },
  1148. getbloods() {
  1149. const params = {
  1150. Flag: "XYLX",
  1151. Name: "",
  1152. };
  1153. GetDicValueList(params).then((res) => {
  1154. this.bloodArr = res.rows;
  1155. });
  1156. },
  1157. // getbiaoben() {
  1158. // const params = {
  1159. // Flag: 'BBXX',
  1160. // Name: ''
  1161. // }
  1162. // GetDicValueList(params).then((res) => {
  1163. // this.specimenArr = res.rows
  1164. // })
  1165. // },
  1166. // getfjcbiaoben() {
  1167. // const params = {
  1168. // Flag: 'abc',
  1169. // Name: ''
  1170. // }
  1171. // GetDicValueList(params).then((res) => {
  1172. // this.fjcspecimenArr = res.rows
  1173. // })
  1174. // },
  1175. getdrugs() {
  1176. const params = {
  1177. Flag: "YPXX",
  1178. Name: "",
  1179. };
  1180. GetDicValueList(params).then((res) => {
  1181. this.drugArr = res.rows;
  1182. });
  1183. },
  1184. getDetail() {
  1185. const datas = {
  1186. WorkOrderCode: this.wid,
  1187. };
  1188. // 详情
  1189. GetOrderDetail(datas)
  1190. .then((response) => {
  1191. if (response.state.toLowerCase() === "success") {
  1192. const res = response.data[0];
  1193. this.firstOrderTypeParam.name = res.TypeName;
  1194. this.$emit("r2type", res.F_WorkOrderCategory);
  1195. this.ruleForm.F_Type2 = res.F_WorkOrderCategory;
  1196. if (res.F_WorkOrderCategory) {
  1197. this.type2Arr =
  1198. this.$store.getters.workTypeMap[
  1199. parseInt(res.F_WorkOrderCategory)
  1200. ].ids.slice(1);
  1201. this.typeAlias =
  1202. this.$store.getters.workTypeMap[parseInt(this.type2Arr[0])].tag;
  1203. }
  1204. if (res.F_ApplicationDept) {
  1205. this.deptidArr =
  1206. this.$store.getters.deptmap[
  1207. parseInt(res.F_ApplicationDept)
  1208. ].ids;
  1209. this.getRepairman(res.F_ApplicationDept, 0);
  1210. this.getDeptAddress(res.F_ApplicationDept);
  1211. this.ruleForm.ApplicationDept = res.F_ApplicationDept;
  1212. this.ruleForm.Applicant = res.F_Applicant;
  1213. }
  1214. if (res.F_DealDept) {
  1215. this.ruleForm.opt = "2";
  1216. this.deptidArr1 =
  1217. this.$store.getters.deptmap[parseInt(res.F_DealDept)].ids;
  1218. this.getRepairman1(res.F_DealDept, 0);
  1219. this.ruleForm.DealDept = res.F_DealDept;
  1220. this.ruleForm.clid = res.F_DealMan;
  1221. } else {
  1222. this.ruleForm.opt = "2";
  1223. }
  1224. if (res.FileUrl) {
  1225. for (var i = 0; i < res.FileUrl.length; i++) {
  1226. this.ruleForm.repairImageid += res.FileUrl[i].F_FileId + ",";
  1227. this.fileList.push({
  1228. F_FileId: res.FileUrl[i].F_FileId,
  1229. name: res.FileUrl[i].F_FileName,
  1230. url: res.FileUrl[i].F_FileUrl,
  1231. });
  1232. }
  1233. }
  1234. this.ruleForm.cfnum = res.F_RemindCount;
  1235. this.ruleForm.phone = res.F_Phone;
  1236. this.ruleForm.position = res.F_Location;
  1237. this.ruleForm.content = res.F_Content;
  1238. this.usercodeSearch = res.F_Applicant;
  1239. // this.ruleForm.toplace = res.F_ToPlace
  1240. // this.ruleForm.EmergencyTypes = res.F_EmergencyTypes
  1241. // const jcarr = []
  1242. // const fjcarr = []
  1243. // this.specimenArr.forEach(function(v, n) {
  1244. // jcarr.push(v.F_DictionaryValueId)
  1245. // })
  1246. // this.fjcspecimenArr.forEach(function(v, n) {
  1247. // fjcarr.push(v.F_DictionaryValueId)
  1248. // })
  1249. const arr = [];
  1250. res.PSInfo.forEach(function (v, n) {
  1251. arr.push({
  1252. devname: v.F_DicName + "," + v.F_DicId,
  1253. num: v.F_Number,
  1254. });
  1255. // if(jcarr.indexOf(v.F_DicId)>=0){
  1256. // arr.push({
  1257. // devname: v.F_DicName + ',' + v.F_DicId,
  1258. // num: v.F_Number,
  1259. // muterType:'0'
  1260. // })
  1261. // }
  1262. // if(fjcarr.indexOf(v.F_DicId)>=0){
  1263. // arr.push({
  1264. // devname: v.F_DicName + ',' + v.F_DicId,
  1265. // num: v.F_Number,
  1266. // muterType:'1'
  1267. // })
  1268. // }
  1269. });
  1270. this.devList = arr;
  1271. }
  1272. })
  1273. .catch(() => {});
  1274. },
  1275. getUrl() {
  1276. if (window.location.href.indexOf("callScreen") >= 0) {
  1277. this.$store.dispatch("delView", this.$route);
  1278. const scoketDatas = {
  1279. Type: "SayFree",
  1280. AgentID: window.localStorage.getItem("storageUsercode"),
  1281. AgentExten: window.localStorage.getItem("ext"),
  1282. };
  1283. if (this.telTopRightState == "话后处理中") {
  1284. Send(scoketDatas);
  1285. }
  1286. window.sessionStorage.setItem("isBusyOrFree", 1); // 0是置忙1是置闲
  1287. this.$router.push({
  1288. path: "/Dashboard",
  1289. });
  1290. }
  1291. // else {
  1292. // window.location.reload()
  1293. // }
  1294. },
  1295. submitForm() {
  1296. // console.log(this.devList)
  1297. // return;
  1298. if (this.orderTypeData.type2Arr.length == 0 && !this.wid) {
  1299. this.$message.error("请选择工单类别");
  1300. return;
  1301. }
  1302. if (
  1303. this.typeAlias === "2001" ||
  1304. this.typeAlias === "2003" ||
  1305. this.typeAlias === "YQT" ||
  1306. this.typeAlias === "2006" ||
  1307. this.typeAlias === "2007"
  1308. ) {
  1309. if (this.devList.length == 0) {
  1310. this.$message.error("请选择对应物资信息");
  1311. return;
  1312. }
  1313. }
  1314. if (
  1315. this.typeAlias === "2001" ||
  1316. this.typeAlias === "2003" ||
  1317. this.typeAlias === "YQT"
  1318. ) {
  1319. if (this.devList.length > 0 && !this.devList[0].F_IsBorrow) {
  1320. this.$message.error("请选择对应物资信息");
  1321. return;
  1322. }
  1323. }
  1324. if (this.typeAlias === "2007") {
  1325. this.ruleForm.clid = "";
  1326. if (this.devList.length > 0 && !this.devList[0].F_ToDept) {
  1327. this.$message.error("请选择对应物资信息");
  1328. return;
  1329. }
  1330. }
  1331. if (this.telTopRightState == "通话中") {
  1332. if (window.location.href.indexOf("callScreen") >= 0) {
  1333. this.$message("请挂断后再提交工单");
  1334. return;
  1335. }
  1336. }
  1337. var details = [];
  1338. let isNull = false;
  1339. if (this.typeAlias !== "2004") {
  1340. var this_ = this;
  1341. this.devList.forEach(function (v, n) {
  1342. if (!isNull && !v.devname) {
  1343. isNull = true;
  1344. }
  1345. if (
  1346. this_.typeAlias === "2001" ||
  1347. this_.typeAlias === "2003" ||
  1348. this_.typeAlias === "YQT"
  1349. ) {
  1350. details.push({
  1351. F_DicId: v.devname.split(",")[1],
  1352. F_DicName: v.devname.split(",")[0],
  1353. F_Number: v.num,
  1354. F_IsBorrow: v.F_IsBorrow,
  1355. });
  1356. } else if (this_.typeAlias === "2007") {
  1357. details.push({
  1358. F_DicId: v.devname.split("?")[1],
  1359. F_DicName: v.devname.split("?")[0],
  1360. F_Number: v.num,
  1361. F_ToDept: v.F_ToDept,
  1362. F_AssignUser: v.F_AssignUser,
  1363. });
  1364. } else {
  1365. details.push({
  1366. F_DicId: v.devname.split(",")[1],
  1367. F_DicName: v.devname.split(",")[0],
  1368. F_Number: v.num,
  1369. });
  1370. }
  1371. });
  1372. }
  1373. // console.log(details)
  1374. // return;
  1375. if (isNull) {
  1376. if (
  1377. this.typeAlias === "2001" ||
  1378. this.typeAlias === "2003" ||
  1379. this.typeAlias === "2006" ||
  1380. this.typeAlias === "2007" ||
  1381. this.typeAlias === "YQT"
  1382. ) {
  1383. this.$message.error("请选择对应物资信息");
  1384. return;
  1385. } else {
  1386. details = [];
  1387. }
  1388. }
  1389. if (this.iswomanage == 1 || this.iswomanage == 2) {
  1390. this.ruleForm.DealDept = "";
  1391. this.ruleForm.clid = "";
  1392. this.ruleForm.opt = "1";
  1393. }
  1394. if (this.ruleForm.opt == "0") {
  1395. details = [];
  1396. }
  1397. if (this.ruleForm.opt == "0" || this.ruleForm.opt == "1") {
  1398. this.ruleForm.DealDept = "";
  1399. this.ruleForm.clid = "";
  1400. }
  1401. this.$refs.ruleForm.validate((valid) => {
  1402. if (valid) {
  1403. if (this.ruleForm.repairImageid === "") {
  1404. this.ruleForm.repairImageid = "";
  1405. } else {
  1406. this.ruleForm.repairImageid = this.ruleForm.repairImageid.slice(
  1407. 0,
  1408. this.ruleForm.repairImageid.length - 1
  1409. );
  1410. }
  1411. var datas = {
  1412. CallId: this.cid,
  1413. CallRecordsId: "",
  1414. LeaveRecordId: this.fid,
  1415. ApplicationDept: this.ruleForm.ApplicationDept,
  1416. Applicant: this.ruleForm.Applicant,
  1417. phone: this.ruleForm.phone,
  1418. DeptPhone: this.ruleForm.DeptPhone,
  1419. Location: this.ruleForm.position,
  1420. WorkOrderCategory: this.ruleForm.F_Type2,
  1421. // ToPlace: this.ruleForm.toplace,
  1422. Content: this.ruleForm.content,
  1423. opt: this.ruleForm.opt,
  1424. DealDept: this.ruleForm.DealDept,
  1425. DealMan: this.ruleForm.clid,
  1426. // EmergencyTypes: this.ruleForm.EmergencyTypes,
  1427. File: this.ruleForm.repairImageid,
  1428. detailists: details,
  1429. };
  1430. var editdatas = {
  1431. usertype: "1",
  1432. WorkOrderCode: this.wid,
  1433. ApplicationDept: this.ruleForm.ApplicationDept,
  1434. Applicant: this.ruleForm.Applicant,
  1435. phone: this.ruleForm.phone,
  1436. DeptPhone: this.ruleForm.DeptPhone,
  1437. Location: this.ruleForm.position,
  1438. WorkOrderCategory: this.ruleForm.F_Type2,
  1439. // ToPlace: this.ruleForm.toplace,
  1440. Content: this.ruleForm.content,
  1441. opt: this.ruleForm.opt,
  1442. DealDept: this.ruleForm.DealDept,
  1443. DealMan: this.ruleForm.clid,
  1444. // EmergencyTypes: this.ruleForm.EmergencyTypes,
  1445. File: this.ruleForm.repairImageid,
  1446. detailists: details,
  1447. };
  1448. // 添加
  1449. if (this.wid) {
  1450. if (this.iswomanage === "1") {
  1451. editdatas.usertype = 1;
  1452. } else {
  1453. editdatas.usertype = 1;
  1454. }
  1455. UpdateSchedulingWorkOrder(editdatas)
  1456. .then((response) => {
  1457. if (response.state.toLowerCase() === "success") {
  1458. // this.$parent.$layer.closeAll()
  1459. // this.$parent.$layer.close(this.layerid)
  1460. // this.$parent.getList() // 重新加载父级数据
  1461. this.$emit("closeLayer");
  1462. this.$message.success("恭喜你,修改成功!");
  1463. this.usercodeSearch = "";
  1464. }
  1465. })
  1466. .catch(() => {});
  1467. } else {
  1468. AddSchedulingWorkOrder(datas)
  1469. .then((response) => {
  1470. if (response.state.toLowerCase() === "success") {
  1471. this.getUrl();
  1472. this.$parent.$layer.closeAll();
  1473. // this.$parent.$layer.close(this.layerid)
  1474. // this.$parent.getList() // 重新加载父级数据
  1475. // this.$refs.ruleForm.resetFields()
  1476. // this.$message.success('恭喜你,添加成功!')
  1477. // this.fileList = []
  1478. // this.ruleForm.repairImageid = ''
  1479. if (window.location.href.indexOf("addWorkOrder") >= 0) {
  1480. this.$message({
  1481. message: "工单已提交成功!",
  1482. type: "success",
  1483. duration: 500,
  1484. });
  1485. this.$router.push({
  1486. path: "/orderManage/mySubmit",
  1487. });
  1488. } else {
  1489. this.$message({
  1490. message: "恭喜你,添加工单成功!",
  1491. type: "success",
  1492. duration: 500,
  1493. });
  1494. }
  1495. }
  1496. })
  1497. .catch(() => {});
  1498. }
  1499. }
  1500. });
  1501. },
  1502. },
  1503. };
  1504. </script>
  1505. <style rel="stylesheet/scss" lang="scss">
  1506. .addOp span {
  1507. display: inline-block;
  1508. width: 30px;
  1509. height: 30px;
  1510. line-height: 30px;
  1511. text-align: center;
  1512. border-radius: 50%;
  1513. background-color: #409eff;
  1514. color: #fff;
  1515. vertical-align: middle;
  1516. margin-right: 5px;
  1517. cursor: pointer;
  1518. }
  1519. </style>