人民医院前端

button.vue 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  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.confirmationAPI("FaultRepair/Retract", "信息", "是否要撤回工单", "取消了撤回")
  94. },
  95. // 工单退回
  96. orderBackBtn() {
  97. this.confirmationAPI("FaultRepair/ReBack", "信息", "是否要退回工单", "取消了退回")
  98. },
  99. // 工单编辑
  100. editBtn() {
  101. uni.navigateTo({
  102. url: "/pages/myTask/repairList/addRepair/addRepair?wid=" + this.wid + '&editState='+1
  103. })
  104. },
  105. // 工单删除
  106. deleteBtn() {
  107. this.confirmationAPI("FaultRepair/DeleteWorkOrder", "删除", "是否要删除", "取消了删除")
  108. },
  109. debtn() {
  110. this.confirmationAPI("FaultRepair/DeleteWorkOrder", "删除", "是否要删除", "取消了删除")
  111. },
  112. /**
  113. * 我的提交(工单)(按钮)
  114. */
  115. // 自行解决
  116. selfSolveBtn() {
  117. this.title = '异常结束'
  118. this.cbreason = ''
  119. this.auditPlaceholder = '请输入异常结束原因'
  120. this.$refs.inputDialog.open()
  121. },
  122. // 评价
  123. evaluateBtn() {
  124. uni.navigateTo({
  125. url: "/pages/myTask/repairList/repairDetail/evaluateDetail/evaluateDetail?wid=" + this.wid
  126. })
  127. },
  128. //返修
  129. backOrderBtn() {
  130. this.title = '返修'
  131. this.cbreason = ''
  132. this.auditPlaceholder = '请输入返修原因'
  133. this.$refs.inputDialog.open()
  134. },
  135. // 撤回
  136. returnBtn() {
  137. this.confirmationAPI("FaultRepair/MyRetract", "信息", "是否要撤回", "取消了撤回")
  138. },
  139. // 编辑撤回
  140. returnEditBtn() {
  141. uni.navigateTo({
  142. url: "/pages/myTask/repairList/repairDetail/returnEditDetail/returnEditDetail?wid=" + this.wid + '&editState='+1
  143. })
  144. },
  145. // 咨询工单接单
  146. receivingBtn() {
  147. this.confirmationAPI("Con_WorkOrder/SureWorkOrder", "信息", "是否要接单", "取消了接单")
  148. },
  149. // 咨询退回
  150. zxBackBtn() {
  151. this.confirmationAPI("Con_WorkOrder/BackWorkOrder", "信息", "是否要退回", "取消了退回")
  152. },
  153. //咨询处理
  154. zxDealBtn() {
  155. uni.navigateTo({
  156. url: "/pages/myTask/consultList/consultDetail/appointmentDeal/appointmentDeal?wid=" + this.wid
  157. })
  158. },
  159. //咨询编辑
  160. zxEditBtn() {
  161. uni.navigateTo({
  162. url: "/pages/myTask/consultList/consultDetail/editDetail/editDetail?wid=" + this.wid
  163. })
  164. },
  165. // 确认耗材
  166. readyBtn() {
  167. uni.navigateTo({
  168. url: "/pages/myTask/repairList/repairDetail/consumablesDeail/consumablesDeail?wid=" + this.wid
  169. })
  170. },
  171. /**
  172. * 报修列表(按钮)
  173. */
  174. // 1查收
  175. checkBtn() {
  176. this.confirmationAPI("FaultRepair/checkWorkOrder", "信息", "是否要查收", "取消了查收")
  177. },
  178. // 2退回
  179. sendBackBtn() {
  180. this.cbreason = ''
  181. this.auditPlaceholder = '请输入退回原因'
  182. this.$refs.inputDialog.open()
  183. },
  184. // 4 协作
  185. cooperationBtn() {
  186. uni.navigateTo({
  187. url: "/pages/myTask/repairList/repairDetail/cooperationDetail/cooperationDetail?wid=" + this.wid
  188. + '&orderType=' + this.orderType + '&departid='+this.departid + '&maintenancer=' + this.maintenancer,
  189. })
  190. },
  191. // 转派
  192. assignBtn() {
  193. pageData.getApplicant(this.departid, (res) => {
  194. res.forEach(v => {
  195. if(v.text == this.maintenancer ) {
  196. v.disable = true
  197. }
  198. })
  199. this.maintenancerDate = res
  200. })
  201. this.title = '转派工单'
  202. this.cbreason = '1'
  203. this.auditPlaceholder = 'show'
  204. this.$refs.inputDialog.open()
  205. },
  206. // 延期
  207. replayBtn() {
  208. uni.navigateTo({
  209. url: "/pages/myTask/repairList/repairDetail/replayDetail/replayDetail?wid=" + this.wid + '&orderType=' + this.orderType + '&firstType='+this.firstType
  210. })
  211. },
  212. maintenancerChange(e) {
  213. this.Maintenancer = e
  214. },
  215. // 完成
  216. finishBtn() {
  217. uni.navigateTo({
  218. url: "/pages/myTask/repairList/repairDetail/finishDetail/finishDetail?wid=" + this.wid
  219. })
  220. },
  221. // 挂起
  222. hangBtn() {
  223. this.confirmationAPI("FaultRepair/HangUp", "信息", "是否要挂起", "取消了挂起")
  224. },
  225. // 到达
  226. arriveBtn() {
  227. this.confirmationAPI("FaultRepair/Arrive", "信息", "是否要到达", "取消了到达")
  228. },
  229. /**
  230. * 综合调度(按钮)
  231. */
  232. // 撤回
  233. dispatchReturnBtn() {
  234. this.confirmationAPI("Scheduling/MyRetract", "信息", "是否要撤回", "取消了撤回")
  235. },
  236. // 接单
  237. dispatchReceivingBtn() {
  238. this.confirmationAPI("Scheduling/CheckWorkOrder", "信息", "是否要接单", "取消了接单")
  239. },
  240. // 送达
  241. dispatchArriveBtn() {
  242. uni.navigateTo({
  243. url: "/pages/myTask/comDispatch/comDispatchDetail/dealDetail/dealDetail?wid=" + this.wid + '&state='+ 1
  244. })
  245. },
  246. // 退回
  247. dispatchBackBtn() {
  248. this.confirmationAPI("Scheduling/BackWorkOrder", "信息", "是否要退回", "取消了退回")
  249. },
  250. // 评价
  251. dispatchEvaluateBtn() {
  252. uni.navigateTo({
  253. url: "/pages/myTask/repairList/repairDetail/evaluateDetail/evaluateDetail?wid=" + this.wid + '&state='+ 1
  254. })
  255. },
  256. // 编辑
  257. dispatchEditBtn() {
  258. uni.navigateTo({
  259. url: "/pages/myTask/comDispatch/addComDispatch/addComDispatch?wid=" + this.wid
  260. })
  261. },
  262. // 车辆调度 ( 按钮开始 )
  263. // 编辑
  264. editVehBtn() {
  265. uni.navigateTo({
  266. url: "/pages/myTask/vehicleSchedulList/applicantsList/addVehicle/addVehicle?wid=" + this.wid + '&editState='+1
  267. })
  268. },
  269. // 撤回
  270. revocationBtn(){
  271. this.confirmationAPI("T_Car_WorkOrder/WithdrawWorkOrder", "信息", "是否撤回", "取消了撤回")
  272. },
  273. // 评价
  274. evaluateBtn(){
  275. uni.navigateTo({
  276. url: "/pages/myTask/vehicleSchedulList/components/vehiccleDetail/evaluateDetail/evaluateDetail?wid=" + this.wid
  277. })
  278. },
  279. // 接单
  280. takeOrderVeh(){
  281. console.log(this.fid)
  282. this.confirmationAPI("T_Car_WorkOrder/SureWorkOrder", "信息", "是否接单", "取消了接单")
  283. },
  284. // 退回
  285. sendBackVeh(){
  286. this.confirmationAPI("T_Car_WorkOrder/BackWorkOrder", "信息", "是否退回", "取消了退回")
  287. },
  288. // 抵达发车点
  289. departBtn(){
  290. this.confirmationAPI("T_Car_WorkOrder/StartCar", "信息", "是否抵达发车点", "取消了")
  291. },
  292. // 抵达目的地
  293. destinationBtn(){
  294. this.confirmationAPI("T_Car_WorkOrder/EndCar", "信息", "是否抵达目的地", "取消了")
  295. },
  296. // 车辆调度 ( 按钮结束 )
  297. // 审核通过确认框
  298. dialogInputConfirm() {
  299. uni.showLoading({
  300. title: '加载中'
  301. })
  302. // 关闭窗口后,恢复默认内容
  303. if (!this.cbreason) {
  304. this.$mHelper.toast(this.auditPlaceholder)
  305. return
  306. }
  307. if (this.auditPlaceholder === '请输入退回原因') {
  308. const addParams = {BackReason: this.cbreason,WorkOrderCode: this.wid}
  309. this.workOrderContent("FaultRepair/BackWorkOrder",addParams)
  310. }else if(this.auditPlaceholder === 'show') {
  311. if(!this.Maintenancer) {
  312. this.$mHelper.toast('请选择指派人');
  313. return
  314. }
  315. const addParams = {ToUserCode: this.Maintenancer,WorkOrderCode: this.wid,type: this.assignType}
  316. this.workOrderContent("FaultRepair/Transfer",addParams)
  317. }else if(this.auditPlaceholder === '请输入异常结束原因') {
  318. const addParams = {result: this.cbreason,WorkOrderCode: this.wid,type:1}
  319. this.workOrderContent("FaultRepair/DealWorkOrder ",addParams)
  320. }else if(this.auditPlaceholder === '请输入返工原因') {
  321. const addParams = {ReturnReason: this.cbreason,WorkOrderCode: this.wid}
  322. this.workOrderContent("FaultRepair/ReturnWorkOrder ",addParams)
  323. }
  324. this.$refs.inputDialog.close()
  325. },
  326. // 确认框方法,带输入框
  327. workOrderContent(url,addParams) {
  328. this.disabledButton = true
  329. this.$mHelper.httpPost(url,addParams,1 ,res=>this.disabledButton=res)
  330. uni.hideLoading()
  331. },
  332. //确认框方法
  333. confirmationAPI(url, title, content, canceContent) {
  334. this.disabledButton = true
  335. uni.showModal({
  336. title: title,
  337. content: content,
  338. success: (res) => {
  339. if (res.confirm) {
  340. const params = {}
  341. if(content == '是否要查收' || content == '是否要接单' || content == '是否要退回') {
  342. params.WorkOrderCode = this.wid
  343. }else if (content === '是否撤回' || content === '是否接单' || content === '是否退回' ){
  344. params.orderid = this.fid
  345. }else if(content === '是否抵达发车点' || content === '是否抵达目的地'){
  346. params.orderid = this.fid
  347. params.WorkOrderCode = this.wid
  348. } else{
  349. params.workordercode = this.wid
  350. }
  351. this.$mHelper.httpPost(url,params,1,res=>this.disabledButton=res)
  352. } else if (res.cancel) {
  353. this.disabledButton = false
  354. this.$mHelper.toast(canceContent);
  355. }
  356. }
  357. })
  358. },
  359. }
  360. }
  361. </script>
  362. <style lang="scss">
  363. .mini-btn {
  364. margin-right: 3px;
  365. color: #fff;
  366. background: #1e90ff;
  367. }
  368. </style>