| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586 |
- <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="deleteBtn">删除</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'"/>
- <uni-easyinput type="textarea" autoHeight maxlength="100" v-model="cbreason" :placeholder="auditPlaceholder" v-show="auditPlaceholder !== 'show'"/>
- </view>
- </uni-popup-dialog>
- </uni-popup>
- </view>
- <view>
- <uni-popup ref="selectDialog" type="dialog">
- <uni-popup-dialog ref="inputClose" mode="input" title="原因" @confirm="dialogSelectConfirm">
- <view style="width:100%;">
- <dictionaries-select :flag="flag" @post-select-dic="postSelectDic" style="margin-bottom: 20px;" ></dictionaries-select>
- <uni-datetime-picker v-if="this.flag === 'GQYY'" v-model="dateTimeValue"></uni-datetime-picker>
- <uni-easyinput type="textarea" autoHeight maxlength="100" v-model="cbreason" placeholder="请输入原因" v-show="value == '其他'"/>
- </view>
- </uni-popup-dialog>
- </uni-popup>
- </view>
- </view>
- </template>
- <script>
- import dictionariesSelect from '@/pages/components/dictionariesSelect/dictionariesSelect.vue' //upload
- import pageData from "@/pages/myTask/repairList/addRepair/pageData.js"
- export default {
- components: {
- dictionariesSelect
- },
- props: {
- orderButtonData: {
- type: Array,
- default () {
- return []
- }
- },
- wid: {
- type: String,
- default: ''
- },
- orderType: {
- type: String,
- default: ''
- },
- typeName: {
- type: String,
- default: ''
- },
- departid: {
- type: String,
- default: ''
- },
- applicationDept: {
- type: String,
- default: ''
- },
- maintenancer: {
- type: String,
- default: ''
- },
- firstType: {
- type: Number,
- default: 0
- },
- fid:{
- type:String,
- default:''
- }
- },
- data() {
- return {
- flag: '',
- key: 0,
- value: '',
- orderT: '',
- orderid: '',
- disabledButton:false,
- assignType: 0,
- assignTypeVisit: [{
- text: '转同事',
- value: 0
- },{
- text: '转组长',
- value: 1
- }],
- title:'请输入内容',
- Maintenancer: '', //维修人
- maintenancerDate: [], // 人员信息
- workOrderButton: [], // 工单按钮权限
- dateTimeValue:this.$mHelper.getNowDate()+' 23:59:59',
- cbreason: '', //审核原因
- auditPlaceholder: '请输入不通过审核原因'
- }
- },
- onLoad(option) {
- console.log(this.orderType)
- },
- methods: {
- postSelectDic(e) {
- this.key = Number(e.split(',')[0])
- this.value = e.split(',')[1]
- },
- callBtnMethods(methodName) {
- this[methodName]();
- },
- /**
- * 工单列表(按钮)
- */
-
- // 工单指派
- transferBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/repairDetail/tranferDetail/tranferDetail?wid=" + this.wid+ '&orderType=' + this.orderType +'&departid='+ this.applicationDept
- })
- },
- // 工单撤回
- orderReuturnBtn() {
- this.title = '撤回'
- this.cbreason = ''
- this.auditPlaceholder = '请输入要撤回原因'
- this.$refs.inputDialog.open()
- },
- // 工单退回
- orderBackBtn() {
- this.title = '退回'
- this.cbreason = ''
- this.auditPlaceholder = '请输入要退回原因'
- this.$refs.inputDialog.open()
- },
- // 工单编辑
- editBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/addRepair/addRepair?wid=" + this.wid + '&editState='+1
- })
- },
- // 工单删除
- deleteBtn() {
- this.confirmationAPI("FaultRepair/DeleteWorkOrder", "删除", "是否要删除", "取消了删除")
- },
- debtn() {
- this.confirmationAPI("Scheduling/DeleteSchedulingWorkOrder", "删除", "是否要删除", "取消了删除")
- },
- /**
- * 我的提交(工单)(按钮)
- */
-
- // 自行解决
- selfSolveBtn() {
- this.title = '异常结束'
- this.cbreason = ''
- this.auditPlaceholder = '请输入异常结束原因'
- this.$refs.inputDialog.open()
- },
- // 评价
- evaluateReapirBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/repairDetail/evaluateDetail/evaluateDetail?wid=" + this.wid
- })
- },
- //返修
- backOrderBtn() {
- this.flag = 'FXYY'
- this.$refs.selectDialog.open()
- },
- // 撤回
- returnBtn() {
- this.title = '撤回'
- this.cbreason = ''
- this.auditPlaceholder = '请输入撤回原因'
- this.$refs.inputDialog.open()
- },
- // 编辑撤回
- returnEditBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/repairDetail/returnEditDetail/returnEditDetail?wid=" + this.wid + '&editState='+1
- })
- },
- // 咨询工单接单
- receivingBtn() {
- this.confirmationAPI("Con_WorkOrder/SureWorkOrder", "信息", "是否要接单", "取消了接单")
- },
- // 咨询退回
- zxBackBtn() {
- this.flag = 'TDYY'
- this.orderT = 'zx'
- this.$refs.selectDialog.open()
- },
- //咨询处理
- 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
- })
- },
- // 确认耗材
- readyBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/repairDetail/consumablesDeail/consumablesDeail?wid=" + this.wid
- })
- },
- /**
- * 报修列表(按钮)
- */
-
- // 1接单
- checkBtn() {
- this.confirmationAPI("FaultRepair/checkWorkOrder", "接单", "是否要接单", "取消了接单")
- },
- // 2退回
- sendBackBtn() {
- this.flag = 'TDYY'
- this.orderT = 'bx'
- this.$refs.selectDialog.open()
- },
- // 4 协作
- cooperationBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/repairDetail/cooperationDetail/cooperationDetail?wid=" + this.wid
- + '&orderType=' + this.orderType + '&departid='+this.departid + '&maintenancer=' + this.maintenancer,
- })
- },
- // 转同事
- trunColleagueBtn() {
- 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()
- },
- // 延期
- replayBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/repairDetail/replayDetail/replayDetail?wid=" + this.wid + '&orderType=' + this.orderType + '&firstType='+this.firstType
- })
- },
- maintenancerChange(e) {
- this.Maintenancer = e
- },
- // 完成
- finishBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/repairDetail/finishDetail/finishDetail?wid=" + this.wid + '&showBeforePic=' + (this.typeName.indexOf('基建') >=0 ? 1 : 0)
- })
- },
- // 挂起
- hangBtn() {
- this.flag = 'GQYY'
- this.$refs.selectDialog.open()
- },
- // 到达
- arriveBtn() {
- this.confirmationAPI("FaultRepair/Arrive", "信息", "是否要到达", "取消了到达")
- },
- // 转值班
- trunWorkBtn() {
- this.confirmationAPI("FaultRepair/Transfer", "转值班", "是否要转值班", "已经取消")
- },
- // 内协作
- inWorkBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/repairDetail/cooperationDetail/cooperationDetail?wid=" + this.wid
- + '&orderType=' + this.orderType + '&departid='+this.departid + '&maintenancer=' + this.maintenancer+ '&state=' + 'in',
- })
- },
- // 外协作
- outWorkBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/repairDetail/cooperationDetail/cooperationDetail?wid=" + this.wid
- + '&orderType=' + this.orderType + '&departid='+this.departid + '&maintenancer=' + this.maintenancer+ '&state=' + 'out',
- })
- },
- // 转部门
- trunDepartBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/repairDetail/tranferDetail/tranferDetail?wid=" + this.wid + '&state='+ 'trunWork'
- })
- },
- // 转组长
- groupLeaderBtn() {
- this.confirmationAPI("FaultRepair/Transfer", "转组长", "是否要转组长", "已经取消")
- },
- /**
- * 综合调度(按钮)
- */
- // 撤回
- dispatchReturnBtn() {
- this.confirmationAPI("Scheduling/MyRetract", "信息", "是否要撤回", "取消了撤回")
- },
- // 接单
- dispatchReceivingBtn() {
- this.confirmationAPI("Scheduling/CheckWorkOrder", "信息", "是否要接单", "取消了接单")
- },
- // 送达
- dispatchArriveBtn() {
- uni.navigateTo({
- url: "/pages/myTask/comDispatch/comDispatchDetail/dealDetail/dealDetail?wid=" + this.wid + '&state='+ 1
- })
- },
- // 收取
- collectSpecimensBtn() {
- uni.navigateTo({
- url: "/pages/myTask/comDispatch/comDispatchDetail/dealDetail/dealDetail?wid=" + this.wid + '&state='+ 2
- })
- },
- // 退回
- dispatchBackBtn() {
- this.flag = 'TDYY'
- this.orderT = 'zh'
- this.$refs.selectDialog.open()
- },
- // 评价
- dispatchEvaluateBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/repairDetail/evaluateDetail/evaluateDetail?wid=" + this.wid + '&state='+ 1
- })
- },
- // 编辑
- dispatchEditBtn() {
- uni.navigateTo({
- url: "/pages/myTask/comDispatch/addComDispatch/addComDispatch?wid=" + this.wid
- })
- },
- disTrunBtn() {
- uni.navigateTo({
- url: "/pages/myTask/repairList/repairDetail/tranferDetail/tranferDetail?wid=" + this.wid+"&zhdd=1"+ '&orderType=' + this.orderType +'&departid='+ this.applicationDept
- })
- },
- // 车辆调度 ( 按钮开始 )
- // 编辑
- 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(){
- this.confirmationAPI("T_Car_WorkOrder/SureWorkOrder", "信息", "是否接单", "取消了接单")
- },
- // 退回
- sendBackVeh(){
- this.flag = 'TDYY'
- this.orderT = 'cl'
- this.$refs.selectDialog.open()
- },
- // 抵达发车点
- departBtn(){
- this.confirmationAPI("T_Car_WorkOrder/StartCar", "信息", "是否抵达发车点", "取消了")
- },
- // 抵达目的地
- destinationBtn(){
- this.confirmationAPI("T_Car_WorkOrder/EndCar", "信息", "是否抵达目的地", "取消了")
- },
- // 撤回完成按钮
- // 业务咨询
- finishYWBtn() {
- this.$mHelper.getOrderId('1000', (id) => {
- this.title = '完成'
- this.cbreason = ''
- this.orderid = id
- this.auditPlaceholder = '请输入完成原因'
- this.$refs.inputDialog.open()
- })
- },
- // 综合调度
- finishZHBtn() {
- this.$mHelper.getOrderId('2000', (id) => {
- this.title = '完成'
- this.cbreason = ''
- this.orderid = id
- this.auditPlaceholder = '请输入完成原因'
- this.$refs.inputDialog.open()
- })
- },
- // 故障报修
- finishBXBtn() {
- this.$mHelper.getOrderId('3000', (id) => {
- this.title = '完成'
- this.cbreason = ''
- this.orderid = id
- this.auditPlaceholder = '请输入完成原因'
- this.$refs.inputDialog.open()
- })
- },
- // 车辆调度
- finishCLBtn() {
- this.$mHelper.getOrderId('4000', (id) => {
- this.title = '完成'
- this.cbreason = ''
- this.orderid = id
- this.auditPlaceholder = '请输入完成原因'
- this.$refs.inputDialog.open()
- })
- },
- // 催办调度中心
- urgeMyBtn() {
- this.cbreason = ''
- this.auditPlaceholder = '请输入催办原因'
- this.$refs.inputDialog.open()
- },
- // 催办申请人
- urgeOLBtn() {
- this.cbreason = ''
- this.auditPlaceholder = '请输入要催办原因'
- this.$refs.inputDialog.open()
- },
- // 原因下拉框
- dialogSelectConfirm() {
- uni.showLoading({
- title: '加载中'
- })
- if(!this.key) {
- this.$mHelper.toast('请选择操作原因');
- return
- }
- if(this.value == '其他' && !this.cbreason){
- this.$mHelper.toast('请输入其他原因');
- return
- }
- if (this.flag === 'FXYY') {
- const addParams = {key: this.key,WorkOrderCode: this.wid, value: this.value,ReturnReason: this.cbreason}
- this.workOrderContent("FaultRepair/ReturnWorkOrder",addParams)
- }else if (this.flag === 'GQYY') {
- const addParams = {key: this.key,workordercode: this.wid, value: this.value,expectfinishtime:this.dateTimeValue, reason: this.cbreason}
- this.workOrderContent("FaultRepair/HangUp",addParams)
- }else if (this.flag === 'TDYY') {
- if(this.orderT == 'zx') {
- const addParams = {key: this.key,WorkOrderCode: this.wid, value: this.value,reason: this.cbreason}
- this.workOrderContent("Con_WorkOrder/BackWorkOrder",addParams)
- }else if(this.orderT == 'bx') {
- const addParams = {key: this.key,WorkOrderCode: this.wid, value: this.value,BackReason: this.cbreason}
- this.workOrderContent("FaultRepair/BackWorkOrder",addParams)
- }else if(this.orderT == 'zh') {
- const addParams = {key: this.key,WorkOrderCode: this.wid, value: this.value,BackReason: this.cbreason}
- this.workOrderContent("Scheduling/BackWorkOrder",addParams)
- }else{
- const addParams = {key: this.key,orderid: this.fid, value: this.value,reason: this.cbreason}
- this.workOrderContent("T_Car_WorkOrder/BackWorkOrder",addParams)
- }
-
- }
- this.cbreason = ''
- this.$refs.selectDialog.close()
- },
- // 车辆调度 ( 按钮结束 )
- // 审核通过确认框
- dialogInputConfirm() {
- uni.showLoading({
- title: '加载中'
- })
- // 关闭窗口后,恢复默认内容
- if (!this.cbreason) {
- this.$mHelper.toast(this.auditPlaceholder)
- return
- }
- 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 = {BackReason: this.cbreason,WorkOrderCode: this.wid}
- this.workOrderContent("FaultRepair/ReBack",addParams)
- }else if(this.auditPlaceholder === '请输入要撤回原因') {
- // 调度中心
- const addParams = {BackReason: this.cbreason,workordercode: this.wid}
- this.workOrderContent("FaultRepair/Retract",addParams)
- }
- else if(this.auditPlaceholder === '请输入撤回原因') {
- // 申请人
- const addParams = {BackReason: this.cbreason,workordercode: this.wid}
- this.workOrderContent("FaultRepair/MyRetract",addParams)
- }
- else if(this.auditPlaceholder === '请输入催办原因') {
- // 调度中心
- const addParams = {reason: this.cbreason,workordercode: this.wid,urgetype:2}
- this.workOrderContent("WorkCommon/UrgeWorkOrder",addParams)
- }
- else if(this.auditPlaceholder === '请输入要催办原因') {
- // 申请人
- const addParams = {reason: this.cbreason,workordercode: this.wid,urgetype:1}
- this.workOrderContent("WorkCommon/UrgeWorkOrder",addParams)
- }
- else if(this.auditPlaceholder === '请输入完成原因') {
- const addParams = {reason: this.cbreason,workordercode: this.wid,type:this.orderid}
- this.workOrderContent("WorkCommon/FinishWorkOrder",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 == '是否要退回') {
- 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 if(content === '是否要转值班' ){
- params.workordercode = this.wid
- params.type = 2
- params.toUserCode = ''
- }else if(content === '是否要转组长' ){
- params.workordercode = this.wid
- params.type = 1
- params.toUserCode = ''
- } 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">
- @import '@/common/addFormDeep.scss';
-
- .mini-btn {
- margin-right: 3px;
- color: #fff;
- background: #1e90ff;
- font-size: 1rem !important;
- }
-
- </style>
|