人民医院前端

button.vue 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. <template>
  2. <view>
  3. <button class="mini-btn" type="default" size="mini" v-for="item in orderButtonData" :disabled="disabledButton"
  4. @click="callBtnMethods(item.eventName)" :key="item.id">
  5. {{ item.text }}
  6. </button>
  7. <!-- <button class="mini-btn" type="default" size="mini" @click="deleteBtn">删除</button> -->
  8. <!-- 弹框 -->
  9. <view>
  10. <uni-popup ref="inputDialog" type="dialog">
  11. <uni-popup-dialog ref="inputClose" mode="input" :title="title" @confirm="dialogInputConfirm">
  12. <view style="width:100%;">
  13. <!-- <uni-data-checkbox v-model="assignType" :localdata="assignTypeVisit" style="margin-bottom: 20px;" v-show="auditPlaceholder === 'show'"/> -->
  14. <uni-data-select v-model="Maintenancer" :localdata="maintenancerDate" @change="maintenancerChange" v-show="auditPlaceholder === 'show'"/>
  15. <uni-easyinput type="textarea" autoHeight maxlength="100" v-model="cbreason" :placeholder="auditPlaceholder" v-show="auditPlaceholder !== 'show'"/>
  16. </view>
  17. </uni-popup-dialog>
  18. </uni-popup>
  19. </view>
  20. <view>
  21. <uni-popup ref="selectDialog" type="dialog">
  22. <uni-popup-dialog ref="inputClose" mode="input" title="原因" @confirm="dialogSelectConfirm">
  23. <view style="width:100%;">
  24. <dictionaries-select :flag="flag" @post-select-dic="postSelectDic" style="margin-bottom: 20px;" ></dictionaries-select>
  25. <uni-easyinput type="textarea" autoHeight maxlength="100" v-model="cbreason" placeholder="请输入原因" v-show="value == '其他'"/>
  26. </view>
  27. </uni-popup-dialog>
  28. </uni-popup>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import dictionariesSelect from '@/pages/components/dictionariesSelect/dictionariesSelect.vue' //upload
  34. import pageData from "@/pages/myTask/repairList/addRepair/pageData.js"
  35. export default {
  36. components: {
  37. dictionariesSelect
  38. },
  39. props: {
  40. orderButtonData: {
  41. type: Array,
  42. default () {
  43. return []
  44. }
  45. },
  46. wid: {
  47. type: String,
  48. default: ''
  49. },
  50. orderType: {
  51. type: String,
  52. default: ''
  53. },
  54. departid: {
  55. type: String,
  56. default: ''
  57. },
  58. applicationDept: {
  59. type: String,
  60. default: ''
  61. },
  62. maintenancer: {
  63. type: String,
  64. default: ''
  65. },
  66. firstType: {
  67. type: Number,
  68. default: 0
  69. },
  70. fid:{
  71. type:String,
  72. default:''
  73. }
  74. },
  75. data() {
  76. return {
  77. flag: '',
  78. key: 0,
  79. value: '',
  80. orderT: '',
  81. orderid: '',
  82. disabledButton:false,
  83. assignType: 0,
  84. assignTypeVisit: [{
  85. text: '转同事',
  86. value: 0
  87. },{
  88. text: '转组长',
  89. value: 1
  90. }],
  91. title:'请输入内容',
  92. Maintenancer: '', //维修人
  93. maintenancerDate: [], // 人员信息
  94. workOrderButton: [], // 工单按钮权限
  95. cbreason: '', //审核原因
  96. auditPlaceholder: '请输入不通过审核原因'
  97. }
  98. },
  99. onLoad(option) {
  100. },
  101. methods: {
  102. postSelectDic(e) {
  103. this.key = Number(e.split(',')[0])
  104. this.value = e.split(',')[1]
  105. },
  106. callBtnMethods(methodName) {
  107. this[methodName]();
  108. },
  109. /**
  110. * 工单列表(按钮)
  111. */
  112. // 工单指派
  113. transferBtn() {
  114. uni.navigateTo({
  115. url: "/pages/myTask/repairList/repairDetail/tranferDetail/tranferDetail?wid=" + this.wid+ '&orderType='+this.orderType+'&departid='+ this.applicationDept
  116. })
  117. },
  118. // 工单撤回
  119. orderReuturnBtn() {
  120. this.title = '撤回'
  121. this.cbreason = ''
  122. this.auditPlaceholder = '请输入要撤回原因'
  123. this.$refs.inputDialog.open()
  124. },
  125. // 工单退回
  126. orderBackBtn() {
  127. this.title = '退回'
  128. this.cbreason = ''
  129. this.auditPlaceholder = '请输入要退回原因'
  130. this.$refs.inputDialog.open()
  131. },
  132. // 工单编辑
  133. editBtn() {
  134. uni.navigateTo({
  135. url: "/pages/myTask/repairList/addRepair/addRepair?wid=" + this.wid + '&editState='+1
  136. })
  137. },
  138. // 工单删除
  139. deleteBtn() {
  140. this.confirmationAPI("FaultRepair/DeleteWorkOrder", "删除", "是否要删除", "取消了删除")
  141. },
  142. debtn() {
  143. this.confirmationAPI("Scheduling/DeleteSchedulingWorkOrder", "删除", "是否要删除", "取消了删除")
  144. },
  145. /**
  146. * 我的提交(工单)(按钮)
  147. */
  148. // 自行解决
  149. selfSolveBtn() {
  150. this.title = '异常结束'
  151. this.cbreason = ''
  152. this.auditPlaceholder = '请输入异常结束原因'
  153. this.$refs.inputDialog.open()
  154. },
  155. // 评价
  156. evaluateReapirBtn() {
  157. uni.navigateTo({
  158. url: "/pages/myTask/repairList/repairDetail/evaluateDetail/evaluateDetail?wid=" + this.wid
  159. })
  160. },
  161. //返修
  162. backOrderBtn() {
  163. this.flag = 'FXYY'
  164. this.$refs.selectDialog.open()
  165. },
  166. // 撤回
  167. returnBtn() {
  168. this.title = '撤回'
  169. this.cbreason = ''
  170. this.auditPlaceholder = '请输入撤回原因'
  171. this.$refs.inputDialog.open()
  172. },
  173. // 编辑撤回
  174. returnEditBtn() {
  175. uni.navigateTo({
  176. url: "/pages/myTask/repairList/repairDetail/returnEditDetail/returnEditDetail?wid=" + this.wid + '&editState='+1
  177. })
  178. },
  179. // 咨询工单接单
  180. receivingBtn() {
  181. this.confirmationAPI("Con_WorkOrder/SureWorkOrder", "信息", "是否要接单", "取消了接单")
  182. },
  183. // 咨询退回
  184. zxBackBtn() {
  185. this.flag = 'TDYY'
  186. this.orderT = 'zx'
  187. this.$refs.selectDialog.open()
  188. },
  189. //咨询处理
  190. zxDealBtn() {
  191. uni.navigateTo({
  192. url: "/pages/myTask/consultList/consultDetail/appointmentDeal/appointmentDeal?wid=" + this.wid
  193. })
  194. },
  195. //咨询编辑
  196. zxEditBtn() {
  197. uni.navigateTo({
  198. url: "/pages/myTask/consultList/consultDetail/editDetail/editDetail?wid=" + this.wid
  199. })
  200. },
  201. // 确认耗材
  202. readyBtn() {
  203. uni.navigateTo({
  204. url: "/pages/myTask/repairList/repairDetail/consumablesDeail/consumablesDeail?wid=" + this.wid
  205. })
  206. },
  207. /**
  208. * 报修列表(按钮)
  209. */
  210. // 1接单
  211. checkBtn() {
  212. this.confirmationAPI("FaultRepair/checkWorkOrder", "接单", "是否要接单", "取消了接单")
  213. },
  214. // 2退回
  215. sendBackBtn() {
  216. this.flag = 'TDYY'
  217. this.orderT = 'bx'
  218. this.$refs.selectDialog.open()
  219. },
  220. // 4 协作
  221. cooperationBtn() {
  222. uni.navigateTo({
  223. url: "/pages/myTask/repairList/repairDetail/cooperationDetail/cooperationDetail?wid=" + this.wid
  224. + '&orderType=' + this.orderType + '&departid='+this.departid + '&maintenancer=' + this.maintenancer,
  225. })
  226. },
  227. // 转同事
  228. trunColleagueBtn() {
  229. pageData.getApplicant(this.departid, (res) => {
  230. res.forEach(v => {
  231. if(v.text == this.maintenancer ) {
  232. v.disable = true
  233. }
  234. })
  235. this.maintenancerDate = res
  236. })
  237. this.title = '转派工单'
  238. this.cbreason = '1'
  239. this.auditPlaceholder = 'show'
  240. this.$refs.inputDialog.open()
  241. },
  242. // 延期
  243. replayBtn() {
  244. uni.navigateTo({
  245. url: "/pages/myTask/repairList/repairDetail/replayDetail/replayDetail?wid=" + this.wid + '&orderType=' + this.orderType + '&firstType='+this.firstType
  246. })
  247. },
  248. maintenancerChange(e) {
  249. this.Maintenancer = e
  250. },
  251. // 完成
  252. finishBtn() {
  253. uni.navigateTo({
  254. url: "/pages/myTask/repairList/repairDetail/finishDetail/finishDetail?wid=" + this.wid
  255. })
  256. },
  257. // 挂起
  258. hangBtn() {
  259. this.flag = 'GQYY'
  260. this.$refs.selectDialog.open()
  261. },
  262. // 到达
  263. arriveBtn() {
  264. this.confirmationAPI("FaultRepair/Arrive", "信息", "是否要到达", "取消了到达")
  265. },
  266. // 转值班
  267. trunWorkBtn() {
  268. this.confirmationAPI("FaultRepair/Transfer", "转值班", "是否要转值班", "已经取消")
  269. },
  270. // 内协作
  271. inWorkBtn() {
  272. uni.navigateTo({
  273. url: "/pages/myTask/repairList/repairDetail/cooperationDetail/cooperationDetail?wid=" + this.wid
  274. + '&orderType=' + this.orderType + '&departid='+this.departid + '&maintenancer=' + this.maintenancer+ '&state=' + 'in',
  275. })
  276. },
  277. // 外协作
  278. outWorkBtn() {
  279. uni.navigateTo({
  280. url: "/pages/myTask/repairList/repairDetail/cooperationDetail/cooperationDetail?wid=" + this.wid
  281. + '&orderType=' + this.orderType + '&departid='+this.departid + '&maintenancer=' + this.maintenancer+ '&state=' + 'out',
  282. })
  283. },
  284. // 转部门
  285. trunDepartBtn() {
  286. uni.navigateTo({
  287. url: "/pages/myTask/repairList/repairDetail/tranferDetail/tranferDetail?wid=" + this.wid + '&state='+ 'trunWork'
  288. })
  289. },
  290. // 转组长
  291. groupLeaderBtn() {
  292. this.confirmationAPI("FaultRepair/Transfer", "转组长", "是否要转组长", "已经取消")
  293. },
  294. /**
  295. * 综合调度(按钮)
  296. */
  297. // 撤回
  298. dispatchReturnBtn() {
  299. this.confirmationAPI("Scheduling/MyRetract", "信息", "是否要撤回", "取消了撤回")
  300. },
  301. // 接单
  302. dispatchReceivingBtn() {
  303. this.confirmationAPI("Scheduling/CheckWorkOrder", "信息", "是否要接单", "取消了接单")
  304. },
  305. // 送达
  306. dispatchArriveBtn() {
  307. uni.navigateTo({
  308. url: "/pages/myTask/comDispatch/comDispatchDetail/dealDetail/dealDetail?wid=" + this.wid + '&state='+ 1
  309. })
  310. },
  311. // 收取
  312. collectSpecimensBtn() {
  313. uni.navigateTo({
  314. url: "/pages/myTask/comDispatch/comDispatchDetail/dealDetail/dealDetail?wid=" + this.wid + '&state='+ 2
  315. })
  316. },
  317. // 退回
  318. dispatchBackBtn() {
  319. this.flag = 'TDYY'
  320. this.orderT = 'zh'
  321. this.$refs.selectDialog.open()
  322. },
  323. // 评价
  324. dispatchEvaluateBtn() {
  325. uni.navigateTo({
  326. url: "/pages/myTask/repairList/repairDetail/evaluateDetail/evaluateDetail?wid=" + this.wid + '&state='+ 1
  327. })
  328. },
  329. // 编辑
  330. dispatchEditBtn() {
  331. uni.navigateTo({
  332. url: "/pages/myTask/comDispatch/addComDispatch/addComDispatch?wid=" + this.wid
  333. })
  334. },
  335. disTrunBtn() {
  336. uni.navigateTo({
  337. url: "/pages/myTask/repairList/repairDetail/tranferDetail/tranferDetail?wid=" + this.wid+"&zhdd=1"
  338. })
  339. },
  340. // 车辆调度 ( 按钮开始 )
  341. // 编辑
  342. editVehBtn() {
  343. uni.navigateTo({
  344. url: "/pages/myTask/vehicleSchedulList/applicantsList/addVehicle/addVehicle?wid=" + this.wid + '&editState='+1
  345. })
  346. },
  347. // 撤回
  348. revocationBtn(){
  349. this.confirmationAPI("T_Car_WorkOrder/WithdrawWorkOrder", "信息", "是否撤回", "取消了撤回")
  350. },
  351. // 评价
  352. evaluateBtn(){
  353. uni.navigateTo({
  354. url: "/pages/myTask/vehicleSchedulList/components/vehiccleDetail/evaluateDetail/evaluateDetail?wid=" + this.wid
  355. })
  356. },
  357. // 接单
  358. takeOrderVeh(){
  359. this.confirmationAPI("T_Car_WorkOrder/SureWorkOrder", "信息", "是否接单", "取消了接单")
  360. },
  361. // 退回
  362. sendBackVeh(){
  363. this.flag = 'TDYY'
  364. this.orderT = 'cl'
  365. this.$refs.selectDialog.open()
  366. },
  367. // 抵达发车点
  368. departBtn(){
  369. this.confirmationAPI("T_Car_WorkOrder/StartCar", "信息", "是否抵达发车点", "取消了")
  370. },
  371. // 抵达目的地
  372. destinationBtn(){
  373. this.confirmationAPI("T_Car_WorkOrder/EndCar", "信息", "是否抵达目的地", "取消了")
  374. },
  375. // 撤回完成按钮
  376. // 业务咨询
  377. finishYWBtn() {
  378. this.$mHelper.getOrderId('1000', (id) => {
  379. this.title = '完成'
  380. this.cbreason = ''
  381. this.orderid = id
  382. this.auditPlaceholder = '请输入完成原因'
  383. this.$refs.inputDialog.open()
  384. })
  385. },
  386. // 综合调度
  387. finishZHBtn() {
  388. this.$mHelper.getOrderId('2000', (id) => {
  389. this.title = '完成'
  390. this.cbreason = ''
  391. this.orderid = id
  392. this.auditPlaceholder = '请输入完成原因'
  393. this.$refs.inputDialog.open()
  394. })
  395. },
  396. // 故障报修
  397. finishBXBtn() {
  398. this.$mHelper.getOrderId('3000', (id) => {
  399. this.title = '完成'
  400. this.cbreason = ''
  401. this.orderid = id
  402. this.auditPlaceholder = '请输入完成原因'
  403. this.$refs.inputDialog.open()
  404. })
  405. },
  406. // 车辆调度
  407. finishCLBtn() {
  408. this.$mHelper.getOrderId('4000', (id) => {
  409. this.title = '完成'
  410. this.cbreason = ''
  411. this.orderid = id
  412. this.auditPlaceholder = '请输入完成原因'
  413. this.$refs.inputDialog.open()
  414. })
  415. },
  416. // 催办调度中心
  417. urgeMyBtn() {
  418. this.cbreason = ''
  419. this.auditPlaceholder = '请输入催办原因'
  420. this.$refs.inputDialog.open()
  421. },
  422. // 催办申请人
  423. urgeOLBtn() {
  424. this.cbreason = ''
  425. this.auditPlaceholder = '请输入要催办原因'
  426. this.$refs.inputDialog.open()
  427. },
  428. // 原因下拉框
  429. dialogSelectConfirm() {
  430. uni.showLoading({
  431. title: '加载中'
  432. })
  433. if(!this.key) {
  434. this.$mHelper.toast('请选择操作原因');
  435. return
  436. }
  437. if(this.value == '其他' && !this.cbreason){
  438. this.$mHelper.toast('请输入其他原因');
  439. return
  440. }
  441. if (this.flag === 'FXYY') {
  442. const addParams = {key: this.key,WorkOrderCode: this.wid, value: this.value,ReturnReason: this.cbreason}
  443. this.workOrderContent("FaultRepair/ReturnWorkOrder",addParams)
  444. }else if (this.flag === 'GQYY') {
  445. const addParams = {key: this.key,workordercode: this.wid, value: this.value, reason: this.cbreason}
  446. this.workOrderContent("FaultRepair/HangUp",addParams)
  447. }else if (this.flag === 'TDYY') {
  448. if(this.orderT == 'zx') {
  449. const addParams = {key: this.key,WorkOrderCode: this.wid, value: this.value,reason: this.cbreason}
  450. this.workOrderContent("Con_WorkOrder/BackWorkOrder",addParams)
  451. }else if(this.orderT == 'bx') {
  452. const addParams = {key: this.key,WorkOrderCode: this.wid, value: this.value,BackReason: this.cbreason}
  453. this.workOrderContent("FaultRepair/BackWorkOrder",addParams)
  454. }else if(this.orderT == 'zh') {
  455. const addParams = {key: this.key,WorkOrderCode: this.wid, value: this.value,BackReason: this.cbreason}
  456. this.workOrderContent("Scheduling/BackWorkOrder",addParams)
  457. }else{
  458. const addParams = {key: this.key,orderid: this.fid, value: this.value,reason: this.cbreason}
  459. this.workOrderContent("T_Car_WorkOrder/BackWorkOrder",addParams)
  460. }
  461. }
  462. this.cbreason = ''
  463. this.$refs.selectDialog.close()
  464. },
  465. // 车辆调度 ( 按钮结束 )
  466. // 审核通过确认框
  467. dialogInputConfirm() {
  468. uni.showLoading({
  469. title: '加载中'
  470. })
  471. // 关闭窗口后,恢复默认内容
  472. if (!this.cbreason) {
  473. this.$mHelper.toast(this.auditPlaceholder)
  474. return
  475. }
  476. if(this.auditPlaceholder === 'show') {
  477. if(!this.Maintenancer) {
  478. this.$mHelper.toast('请选择指派人');
  479. return
  480. }
  481. const addParams = {ToUserCode: this.Maintenancer,WorkOrderCode: this.wid,type: this.assignType}
  482. this.workOrderContent("FaultRepair/Transfer",addParams)
  483. }else if(this.auditPlaceholder === '请输入异常结束原因') {
  484. const addParams = {result: this.cbreason,WorkOrderCode: this.wid,type:1}
  485. this.workOrderContent("FaultRepair/DealWorkOrder ",addParams)
  486. }else if(this.auditPlaceholder === '请输入要退回原因') {
  487. // 调度中心
  488. const addParams = {BackReason: this.cbreason,WorkOrderCode: this.wid}
  489. this.workOrderContent("FaultRepair/ReBack",addParams)
  490. }else if(this.auditPlaceholder === '请输入要撤回原因') {
  491. // 调度中心
  492. const addParams = {BackReason: this.cbreason,workordercode: this.wid}
  493. this.workOrderContent("FaultRepair/Retract",addParams)
  494. }
  495. else if(this.auditPlaceholder === '请输入撤回原因') {
  496. // 申请人
  497. const addParams = {BackReason: this.cbreason,workordercode: this.wid}
  498. this.workOrderContent("FaultRepair/MyRetract",addParams)
  499. }
  500. else if(this.auditPlaceholder === '请输入催办原因') {
  501. // 调度中心
  502. const addParams = {reason: this.cbreason,workordercode: this.wid,urgetype:2}
  503. this.workOrderContent("WorkCommon/UrgeWorkOrder",addParams)
  504. }
  505. else if(this.auditPlaceholder === '请输入要催办原因') {
  506. // 申请人
  507. const addParams = {reason: this.cbreason,workordercode: this.wid,urgetype:1}
  508. this.workOrderContent("WorkCommon/UrgeWorkOrder",addParams)
  509. }
  510. else if(this.auditPlaceholder === '请输入完成原因') {
  511. const addParams = {reason: this.cbreason,workordercode: this.wid,type:this.orderid}
  512. this.workOrderContent("WorkCommon/FinishWorkOrder",addParams)
  513. }
  514. this.$refs.inputDialog.close()
  515. },
  516. // 确认框方法,带输入框
  517. workOrderContent(url,addParams) {
  518. this.disabledButton = true
  519. this.$mHelper.httpPost(url,addParams,1 ,res=>this.disabledButton=res)
  520. uni.hideLoading()
  521. },
  522. //确认框方法
  523. confirmationAPI(url, title, content, canceContent) {
  524. this.disabledButton = true
  525. uni.showModal({
  526. title: title,
  527. content: content,
  528. success: (res) => {
  529. if (res.confirm) {
  530. const params = {}
  531. if(content == '是否要接单' || content == '是否要退回') {
  532. params.WorkOrderCode = this.wid
  533. }else if (content === '是否撤回' || content === '是否接单' || content === '是否退回' ){
  534. params.orderid = this.fid
  535. }else if(content === '是否抵达发车点' || content === '是否抵达目的地'){
  536. params.orderid = this.fid
  537. params.WorkOrderCode = this.wid
  538. }else if(content === '是否要转值班' ){
  539. params.workordercode = this.wid
  540. params.type = 2
  541. params.toUserCode = ''
  542. }else if(content === '是否要转组长' ){
  543. params.workordercode = this.wid
  544. params.type = 1
  545. params.toUserCode = ''
  546. } else{
  547. params.workordercode = this.wid
  548. }
  549. this.$mHelper.httpPost(url,params,1,res=>this.disabledButton=res)
  550. } else if (res.cancel) {
  551. this.disabledButton = false
  552. this.$mHelper.toast(canceContent);
  553. }
  554. }
  555. })
  556. },
  557. }
  558. }
  559. </script>
  560. <style lang="scss">
  561. @import '@/common/addFormDeep.scss';
  562. .mini-btn {
  563. margin-right: 3px;
  564. color: #fff;
  565. background: #1e90ff;
  566. font-size: 1rem !important;
  567. }
  568. </style>