人民医院前端

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