人民医院前端

button.vue 23KB

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