人民医院前端

button.vue 22KB

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