人民医院前端

button.vue 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  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="debtn">删除</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' && assignType === 0"/>
  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. </template>
  22. <script>
  23. import pageData from "@/pages/myTask/repairList/addRepair/pageData.js"
  24. export default {
  25. props: {
  26. orderButtonData: {
  27. type: Array,
  28. default () {
  29. return []
  30. }
  31. },
  32. wid: {
  33. type: String,
  34. default: ''
  35. },
  36. orderType: {
  37. type: String,
  38. default: ''
  39. },
  40. departid: {
  41. type: String,
  42. default: ''
  43. },
  44. maintenancer: {
  45. type: String,
  46. default: ''
  47. },
  48. firstType: {
  49. type: Number,
  50. default: 0
  51. },
  52. fid:{
  53. type:String,
  54. default:''
  55. }
  56. },
  57. data() {
  58. return {
  59. disabledButton:false,
  60. assignType: 0,
  61. assignTypeVisit: [{
  62. text: '转同事',
  63. value: 0
  64. },{
  65. text: '转组长',
  66. value: 1
  67. }],
  68. title:'请输入内容',
  69. Maintenancer: '', //维修人
  70. maintenancerDate: [], // 人员信息
  71. workOrderButton: [], // 工单按钮权限
  72. cbreason: '', //审核原因
  73. auditPlaceholder: '请输入不通过审核原因'
  74. }
  75. },
  76. onLoad(option) {
  77. },
  78. methods: {
  79. callBtnMethods(methodName) {
  80. this[methodName]();
  81. },
  82. /**
  83. * 工单列表(按钮)
  84. */
  85. // 工单指派
  86. transferBtn() {
  87. uni.navigateTo({
  88. url: "/pages/myTask/repairList/repairDetail/tranferDetail/tranferDetail?wid=" + this.wid
  89. })
  90. },
  91. // 工单撤回
  92. orderReuturnBtn() {
  93. this.title = '撤回'
  94. this.cbreason = ''
  95. this.auditPlaceholder = '请输入要撤回原因'
  96. this.$refs.inputDialog.open()
  97. },
  98. // 工单退回
  99. orderBackBtn() {
  100. this.title = '退回'
  101. this.cbreason = ''
  102. this.auditPlaceholder = '请输入要退回原因'
  103. this.$refs.inputDialog.open()
  104. },
  105. // 工单编辑
  106. editBtn() {
  107. uni.navigateTo({
  108. url: "/pages/myTask/repairList/addRepair/addRepair?wid=" + this.wid + '&editState='+1
  109. })
  110. },
  111. // 工单删除
  112. deleteBtn() {
  113. this.confirmationAPI("FaultRepair/DeleteWorkOrder", "删除", "是否要删除", "取消了删除")
  114. },
  115. debtn() {
  116. this.confirmationAPI("Scheduling/DeleteSchedulingWorkOrder", "删除", "是否要删除", "取消了删除")
  117. },
  118. /**
  119. * 我的提交(工单)(按钮)
  120. */
  121. // 自行解决
  122. selfSolveBtn() {
  123. this.title = '异常结束'
  124. this.cbreason = ''
  125. this.auditPlaceholder = '请输入异常结束原因'
  126. this.$refs.inputDialog.open()
  127. },
  128. // 评价
  129. evaluateBtn() {
  130. uni.navigateTo({
  131. url: "/pages/myTask/repairList/repairDetail/evaluateDetail/evaluateDetail?wid=" + this.wid
  132. })
  133. },
  134. //返修
  135. backOrderBtn() {
  136. this.title = '返修'
  137. this.cbreason = ''
  138. this.auditPlaceholder = '请输入返修原因'
  139. this.$refs.inputDialog.open()
  140. },
  141. // 撤回
  142. returnBtn() {
  143. this.title = '撤回'
  144. this.cbreason = ''
  145. this.auditPlaceholder = '请输入撤回原因'
  146. this.$refs.inputDialog.open()
  147. },
  148. // 编辑撤回
  149. returnEditBtn() {
  150. uni.navigateTo({
  151. url: "/pages/myTask/repairList/repairDetail/returnEditDetail/returnEditDetail?wid=" + this.wid + '&editState='+1
  152. })
  153. },
  154. // 咨询工单接单
  155. receivingBtn() {
  156. this.confirmationAPI("Con_WorkOrder/SureWorkOrder", "信息", "是否要接单", "取消了接单")
  157. },
  158. // 咨询退回
  159. zxBackBtn() {
  160. this.confirmationAPI("Con_WorkOrder/BackWorkOrder", "信息", "是否要退回", "取消了退回")
  161. },
  162. //咨询处理
  163. zxDealBtn() {
  164. uni.navigateTo({
  165. url: "/pages/myTask/consultList/consultDetail/appointmentDeal/appointmentDeal?wid=" + this.wid
  166. })
  167. },
  168. //咨询编辑
  169. zxEditBtn() {
  170. uni.navigateTo({
  171. url: "/pages/myTask/consultList/consultDetail/editDetail/editDetail?wid=" + this.wid
  172. })
  173. },
  174. // 确认耗材
  175. readyBtn() {
  176. uni.navigateTo({
  177. url: "/pages/myTask/repairList/repairDetail/consumablesDeail/consumablesDeail?wid=" + this.wid
  178. })
  179. },
  180. /**
  181. * 报修列表(按钮)
  182. */
  183. // 1查收
  184. checkBtn() {
  185. this.confirmationAPI("FaultRepair/checkWorkOrder", "信息", "是否要查收", "取消了查收")
  186. },
  187. // 2退回
  188. sendBackBtn() {
  189. this.cbreason = ''
  190. this.auditPlaceholder = '请输入退回原因'
  191. this.$refs.inputDialog.open()
  192. },
  193. // 4 协作
  194. cooperationBtn() {
  195. uni.navigateTo({
  196. url: "/pages/myTask/repairList/repairDetail/cooperationDetail/cooperationDetail?wid=" + this.wid
  197. + '&orderType=' + this.orderType + '&departid='+this.departid + '&maintenancer=' + this.maintenancer,
  198. })
  199. },
  200. // 转派
  201. assignBtn() {
  202. pageData.getApplicant(this.departid, (res) => {
  203. res.forEach(v => {
  204. if(v.text == this.maintenancer ) {
  205. v.disable = true
  206. }
  207. })
  208. this.maintenancerDate = res
  209. })
  210. this.title = '转派工单'
  211. this.cbreason = '1'
  212. this.auditPlaceholder = 'show'
  213. this.$refs.inputDialog.open()
  214. },
  215. // 延期
  216. replayBtn() {
  217. uni.navigateTo({
  218. url: "/pages/myTask/repairList/repairDetail/replayDetail/replayDetail?wid=" + this.wid + '&orderType=' + this.orderType + '&firstType='+this.firstType
  219. })
  220. },
  221. maintenancerChange(e) {
  222. this.Maintenancer = e
  223. },
  224. // 完成
  225. finishBtn() {
  226. uni.navigateTo({
  227. url: "/pages/myTask/repairList/repairDetail/finishDetail/finishDetail?wid=" + this.wid
  228. })
  229. },
  230. // 挂起
  231. hangBtn() {
  232. this.confirmationAPI("FaultRepair/HangUp", "信息", "是否要挂起", "取消了挂起")
  233. },
  234. // 到达
  235. arriveBtn() {
  236. this.confirmationAPI("FaultRepair/Arrive", "信息", "是否要到达", "取消了到达")
  237. },
  238. /**
  239. * 综合调度(按钮)
  240. */
  241. // 撤回
  242. dispatchReturnBtn() {
  243. this.confirmationAPI("Scheduling/MyRetract", "信息", "是否要撤回", "取消了撤回")
  244. },
  245. // 接单
  246. dispatchReceivingBtn() {
  247. this.confirmationAPI("Scheduling/CheckWorkOrder", "信息", "是否要接单", "取消了接单")
  248. },
  249. // 送达
  250. dispatchArriveBtn() {
  251. uni.navigateTo({
  252. url: "/pages/myTask/comDispatch/comDispatchDetail/dealDetail/dealDetail?wid=" + this.wid + '&state='+ 1
  253. })
  254. },
  255. // 退回
  256. dispatchBackBtn() {
  257. this.confirmationAPI("Scheduling/BackWorkOrder", "信息", "是否要退回", "取消了退回")
  258. },
  259. // 评价
  260. dispatchEvaluateBtn() {
  261. uni.navigateTo({
  262. url: "/pages/myTask/repairList/repairDetail/evaluateDetail/evaluateDetail?wid=" + this.wid + '&state='+ 1
  263. })
  264. },
  265. // 编辑
  266. dispatchEditBtn() {
  267. uni.navigateTo({
  268. url: "/pages/myTask/comDispatch/addComDispatch/addComDispatch?wid=" + this.wid
  269. })
  270. },
  271. // 车辆调度 ( 按钮开始 )
  272. // 编辑
  273. editVehBtn() {
  274. uni.navigateTo({
  275. url: "/pages/myTask/vehicleSchedulList/applicantsList/addVehicle/addVehicle?wid=" + this.wid + '&editState='+1
  276. })
  277. },
  278. // 撤回
  279. revocationBtn(){
  280. this.confirmationAPI("T_Car_WorkOrder/WithdrawWorkOrder", "信息", "是否撤回", "取消了撤回")
  281. },
  282. // 评价
  283. evaluateBtn(){
  284. uni.navigateTo({
  285. url: "/pages/myTask/vehicleSchedulList/components/vehiccleDetail/evaluateDetail/evaluateDetail?wid=" + this.wid
  286. })
  287. },
  288. // 接单
  289. takeOrderVeh(){
  290. console.log(this.fid)
  291. this.confirmationAPI("T_Car_WorkOrder/SureWorkOrder", "信息", "是否接单", "取消了接单")
  292. },
  293. // 退回
  294. sendBackVeh(){
  295. this.confirmationAPI("T_Car_WorkOrder/BackWorkOrder", "信息", "是否退回", "取消了退回")
  296. },
  297. // 抵达发车点
  298. departBtn(){
  299. this.confirmationAPI("T_Car_WorkOrder/StartCar", "信息", "是否抵达发车点", "取消了")
  300. },
  301. // 抵达目的地
  302. destinationBtn(){
  303. this.confirmationAPI("T_Car_WorkOrder/EndCar", "信息", "是否抵达目的地", "取消了")
  304. },
  305. // 催办调度中心
  306. urgeMyBtn() {
  307. this.cbreason = ''
  308. this.auditPlaceholder = '请输入催办原因'
  309. this.$refs.inputDialog.open()
  310. },
  311. // 催办申请人
  312. urgeOLBtn() {
  313. this.cbreason = ''
  314. this.auditPlaceholder = '请输入要催办原因'
  315. this.$refs.inputDialog.open()
  316. },
  317. // 车辆调度 ( 按钮结束 )
  318. // 审核通过确认框
  319. dialogInputConfirm() {
  320. uni.showLoading({
  321. title: '加载中'
  322. })
  323. // 关闭窗口后,恢复默认内容
  324. if (!this.cbreason) {
  325. this.$mHelper.toast(this.auditPlaceholder)
  326. return
  327. }
  328. if (this.auditPlaceholder === '请输入退回原因') {
  329. const addParams = {BackReason: this.cbreason,WorkOrderCode: this.wid}
  330. this.workOrderContent("FaultRepair/BackWorkOrder",addParams)
  331. }else if(this.auditPlaceholder === 'show') {
  332. if(!this.Maintenancer) {
  333. this.$mHelper.toast('请选择指派人');
  334. return
  335. }
  336. const addParams = {ToUserCode: this.Maintenancer,WorkOrderCode: this.wid,type: this.assignType}
  337. this.workOrderContent("FaultRepair/Transfer",addParams)
  338. }else if(this.auditPlaceholder === '请输入异常结束原因') {
  339. const addParams = {result: this.cbreason,WorkOrderCode: this.wid,type:1}
  340. this.workOrderContent("FaultRepair/DealWorkOrder ",addParams)
  341. }else if(this.auditPlaceholder === '请输入返工原因') {
  342. const addParams = {ReturnReason: this.cbreason,WorkOrderCode: this.wid}
  343. this.workOrderContent("FaultRepair/ReturnWorkOrder ",addParams)
  344. }else if(this.auditPlaceholder === '请输入要退回原因') {
  345. // 调度中心
  346. const addParams = {BackReason: this.cbreason,WorkOrderCode: this.wid}
  347. this.workOrderContent("FaultRepair/ReBack",addParams)
  348. }else if(this.auditPlaceholder === '请输入要撤回原因') {
  349. // 调度中心
  350. const addParams = {BackReason: this.cbreason,workordercode: this.wid}
  351. this.workOrderContent("FaultRepair/Retract",addParams)
  352. }
  353. else if(this.auditPlaceholder === '请输入撤回原因') {
  354. // 申请人
  355. const addParams = {BackReason: this.cbreason,workordercode: this.wid}
  356. this.workOrderContent("FaultRepair/MyRetract",addParams)
  357. }
  358. else if(this.auditPlaceholder === '请输入催办原因') {
  359. // 调度中心
  360. const addParams = {reason: this.cbreason,workordercode: this.wid,urgetype:2}
  361. this.workOrderContent("WorkCommon/UrgeWorkOrder",addParams)
  362. }
  363. else if(this.auditPlaceholder === '请输入要催办原因') {
  364. // 申请人
  365. const addParams = {reason: this.cbreason,workordercode: this.wid,urgetype:1}
  366. this.workOrderContent("WorkCommon/UrgeWorkOrder",addParams)
  367. }
  368. this.$refs.inputDialog.close()
  369. },
  370. // 确认框方法,带输入框
  371. workOrderContent(url,addParams) {
  372. this.disabledButton = true
  373. this.$mHelper.httpPost(url,addParams,1 ,res=>this.disabledButton=res)
  374. uni.hideLoading()
  375. },
  376. //确认框方法
  377. confirmationAPI(url, title, content, canceContent) {
  378. this.disabledButton = true
  379. uni.showModal({
  380. title: title,
  381. content: content,
  382. success: (res) => {
  383. if (res.confirm) {
  384. const params = {}
  385. if(content == '是否要查收' || content == '是否要接单' || content == '是否要退回') {
  386. params.WorkOrderCode = this.wid
  387. }else if (content === '是否撤回' || content === '是否接单' || content === '是否退回' ){
  388. params.orderid = this.fid
  389. }else if(content === '是否抵达发车点' || content === '是否抵达目的地'){
  390. params.orderid = this.fid
  391. params.WorkOrderCode = this.wid
  392. } else{
  393. params.workordercode = this.wid
  394. }
  395. this.$mHelper.httpPost(url,params,1,res=>this.disabledButton=res)
  396. } else if (res.cancel) {
  397. this.disabledButton = false
  398. this.$mHelper.toast(canceContent);
  399. }
  400. }
  401. })
  402. },
  403. }
  404. }
  405. </script>
  406. <style lang="scss">
  407. .mini-btn {
  408. margin-right: 3px;
  409. color: #fff;
  410. background: #1e90ff;
  411. }
  412. </style>