人民医院前端

button.vue 18KB

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