| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329 |
- <template>
- <view>
- <button class="mini-btn" type="default" size="mini" v-for="item in orderButtonData" :disabled="disabledButton"
- @click="callBtnMethods(item.eventName)" :key="item.id">
- {{ item.text }}
- </button>
- <!-- <button class="mini-btn" type="default" size="mini" @click="debtn">删除</button> -->
- <!-- 弹框 -->
- <view>
- <uni-popup ref="inputDialog" type="dialog">
- <uni-popup-dialog ref="inputClose" mode="input" :title="title" @confirm="dialogInputConfirm">
- <view style="width:100%;">
- <uni-data-checkbox v-model="assignType" :localdata="assignTypeVisit" style="margin-bottom: 20px;" v-show="auditPlaceholder === 'show'"/>
- <uni-data-select v-model="Maintenancer" :localdata="maintenancerDate" @change="maintenancerChange" v-show="auditPlaceholder === 'show' && assignType === 0"/>
- <uni-easyinput type="textarea" autoHeight maxlength="100" v-model="cbreason" :placeholder="auditPlaceholder" v-show="auditPlaceholder !== 'show'"/>
- </view>
- </uni-popup-dialog>
- </uni-popup>
- </view>
- </view>
- </template>
- <script>
- import pageData from "@/pages/myTask/repairList/addRepair/pageData.js"
- export default {
- props: {
- orderButtonData: {
- type: Array,
- default () {
- return []
- }
- },
- wid: {
- type: String,
- default: ''
- },
- orderType: {
- type: String,
- default: ''
- },
- departid: {
- type: String,
- default: ''
- },
- maintenancer: {
- type: String,
- default: ''
- },
- fid:{
- type:String,
- default:''
- }
- },
- data() {
- return {
- disabledButton:false,
- assignType: 0,
- assignTypeVisit: [{
- text: '转同事',
- value: 0
- },{
- text: '转组长',
- value: 1
- }],
- title:'请输入内容',
- Maintenancer: '', //维修人
- maintenancerDate: [], // 人员信息
- workOrderButton: [], // 工单按钮权限
- cbreason: '', //审核原因
- auditPlaceholder: '请输入不通过审核原因'
- }
- },
- onLoad(option) {
- console.log(this.fid)
- },
- methods: {
- callBtnMethods(methodName) {
- this[methodName]();
- },
- /**
- * 工单列表(按钮)
- */
-
- // 工单指派
- transferBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/repairDetail/tranferDetail/tranferDetail?wid=" + this.wid
- })
- },
- // 工单撤回
- orderReuturnBtn() {
- this.confirmationAPI("FaultRepair/Retract", "信息", "是否要撤回工单", "取消了撤回")
- },
- // 工单退回
- orderBackBtn() {
- this.confirmationAPI("FaultRepair/ReBack", "信息", "是否要退回工单", "取消了退回")
- },
- // 工单编辑
- editBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/addRepair/addRepair?wid=" + this.wid + '&editState='+1
- })
- },
- // 工单删除
- deleteBtn() {
- this.confirmationAPI("FaultRepair/DeleteWorkOrder", "删除", "是否要删除", "取消了删除")
- },
- debtn() {
- this.confirmationAPI("FaultRepair/DeleteWorkOrder", "删除", "是否要删除", "取消了删除")
- },
- /**
- * 我的提交(工单)(按钮)
- */
-
- // 自行解决
- selfSolveBtn() {
- this.title = '异常结束'
- this.cbreason = ''
- this.auditPlaceholder = '请输入异常结束原因'
- this.$refs.inputDialog.open()
- },
- // 评价
- evaluateBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/repairDetail/evaluateDetail/evaluateDetail?wid=" + this.wid
- })
- },
- //返修
- backOrderBtn() {
- this.title = '返工'
- this.cbreason = ''
- this.auditPlaceholder = '请输入返工原因'
- this.$refs.inputDialog.open()
- },
- // 撤回
- returnBtn() {
- this.confirmationAPI("FaultRepair/MyRetract", "信息", "是否要撤回", "取消了撤回")
- },
- // 编辑撤回
- returnEditBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/repairDetail/returnEditDetail/returnEditDetail?wid=" + this.wid + '&editState='+1
- })
- },
- // 咨询工单接单
- receivingBtn() {
- this.confirmationAPI("Con_WorkOrder/SureWorkOrder", "信息", "是否要接单", "取消了接单")
- },
- // 咨询退回
- zxBackBtn() {
- this.confirmationAPI("Con_WorkOrder/BackWorkOrder", "信息", "是否要退回", "取消了退回")
- },
- //咨询处理
- zxDealBtn() {
- uni.navigateTo({
- url: "/pages/myTask/consultList/consultDetail/appointmentDeal/appointmentDeal?wid=" + this.wid
- })
- },
- //咨询编辑
- zxEditBtn() {
- uni.navigateTo({
- url: "/pages/myTask/consultList/consultDetail/editDetail/editDetail?wid=" + this.wid
- })
- },
- /**
- * 报修列表(按钮)
- */
-
- // 1查收
- checkBtn() {
- this.confirmationAPI("FaultRepair/checkWorkOrder", "信息", "是否要查收", "取消了查收")
- },
- // 2退回
- sendBackBtn() {
- this.cbreason = ''
- this.auditPlaceholder = '请输入退回原因'
- this.$refs.inputDialog.open()
- },
- // 4 协作
- cooperationBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/repairDetail/cooperationDetail/cooperationDetail?wid=" + this.wid
- + '&orderType=' + this.orderType + '&departid='+this.departid + '&maintenancer=' + this.maintenancer,
- })
- },
- // 转派
- assignBtn() {
- pageData.getApplicant(this.departid, (res) => {
- res.forEach(v => {
- if(v.text == this.maintenancer ) {
- v.disable = true
- }
- })
- this.maintenancerDate = res
- })
- this.title = '转派工单'
- this.cbreason = '1'
- this.auditPlaceholder = 'show'
- this.$refs.inputDialog.open()
- },
- maintenancerChange(e) {
- this.Maintenancer = e
- },
- // 完成
- finishBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/repairDetail/finishDetail/finishDetail?wid=" + this.wid
- })
- },
- // 挂起
- hangBtn() {
- this.confirmationAPI("FaultRepair/HangUp", "信息", "是否要挂起", "取消了挂起")
- },
- // 到达
- arriveBtn() {
- this.confirmationAPI("FaultRepair/Arrive", "信息", "是否要到达", "取消了到达")
- },
- // 车辆调度 ( 按钮开始 )
- // 编辑
- editVehBtn() {
- uni.navigateTo({
- url: "/pages/myTask/vehicleSchedulList/applicantsList/addVehicle/addVehicle?wid=" + this.wid + '&editState='+1
- })
- },
- // 撤回
- revocationBtn(){
- this.confirmationAPI("T_Car_WorkOrder/WithdrawWorkOrder", "信息", "是否撤回", "取消了撤回")
- },
- // 评价
- evaluateBtn(){
- uni.navigateTo({
- url: "/pages/myTask/vehicleSchedulList/components/vehiccleDetail/evaluateDetail/evaluateDetail?wid=" + this.wid
- })
- },
- // 接单
- takeOrderVeh(){
- console.log(this.fid)
- this.confirmationAPI("T_Car_WorkOrder/SureWorkOrder", "信息", "是否接单", "取消了接单")
- },
- // 退回
- sendBackVeh(){
- this.confirmationAPI("T_Car_WorkOrder/BackWorkOrder", "信息", "是否退回", "取消了退回")
- },
- // 抵达发车点
- departBtn(){
- this.confirmationAPI("T_Car_WorkOrder/StartCar", "信息", "是否抵达发车点", "取消了")
- },
- // 抵达目的地
- destinationBtn(){
- this.confirmationAPI("T_Car_WorkOrder/EndCar", "信息", "是否抵达目的地", "取消了")
- },
- // 车辆调度 ( 按钮结束 )
- // 审核通过确认框
- dialogInputConfirm() {
- uni.showLoading({
- title: '加载中'
- })
- // 关闭窗口后,恢复默认内容
- if (!this.cbreason) {
- this.$mHelper.toast(this.auditPlaceholder)
- return
- }
- if (this.auditPlaceholder === '请输入退回原因') {
- const addParams = {BackReason: this.cbreason,WorkOrderCode: this.wid}
- this.workOrderContent("FaultRepair/BackWorkOrder",addParams)
- }else if(this.auditPlaceholder === 'show') {
- if(!this.Maintenancer) {
- this.$mHelper.toast('请选择指派人');
- return
- }
- const addParams = {ToUserCode: this.Maintenancer,WorkOrderCode: this.wid,type: this.assignType}
- this.workOrderContent("FaultRepair/Transfer",addParams)
- }else if(this.auditPlaceholder === '请输入异常结束原因') {
- const addParams = {result: this.cbreason,WorkOrderCode: this.wid,type:1}
- this.workOrderContent("FaultRepair/DealWorkOrder ",addParams)
- }else if(this.auditPlaceholder === '请输入返工原因') {
- const addParams = {ReturnReason: this.cbreason,WorkOrderCode: this.wid}
- this.workOrderContent("FaultRepair/ReturnWorkOrder ",addParams)
- }
- this.$refs.inputDialog.close()
- },
- // 确认框方法,带输入框
- workOrderContent(url,addParams) {
- this.disabledButton = true
- this.$mHelper.httpPost(url,addParams,1 ,res=>this.disabledButton=res)
- uni.hideLoading()
- },
- //确认框方法
- confirmationAPI(url, title, content, canceContent) {
- this.disabledButton = true
- uni.showModal({
- title: title,
- content: content,
- success: (res) => {
- if (res.confirm) {
- const params = {}
- if(content == '是否要查收' || content == '是否要接单' || content == '是否要退回') {
- params.WorkOrderCode = this.wid
- }else if (content === '是否撤回' || content === '是否接单' || content === '是否退回' ){
- params.orderid = this.fid
- }else if(content === '是否抵达发车点' || content === '是否抵达目的地'){
- params.orderid = this.fid
- params.WorkOrderCode = this.wid
- } else{
- params.workordercode = this.wid
- }
-
- this.$mHelper.httpPost(url,params,1,res=>this.disabledButton=res)
- } else if (res.cancel) {
- this.disabledButton = false
- this.$mHelper.toast(canceContent);
- }
- }
- })
- },
-
- }
- }
- </script>
- <style lang="scss">
- .mini-btn {
- margin-right: 3px;
- color: #fff;
- background: #1e90ff;
- }
- </style>
|