人民医院前端

button.vue 18KB

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