| | |
| | | </view> |
| | | </view> |
| | | <view class="onve-right"> |
| | | <u-button class='greens' size="mini" v-if="current == 0">开始维修 |
| | | <u-button class='greens' size="mini" v-if="current == 0" @click="startRepair(item)">开始维修 |
| | | </u-button> |
| | | <u-button class='greens' size="mini" v-if="current == 1">完成维修 |
| | | <u-button class='greens' size="mini" v-if="current == 1" @click="finishRepair(item)">完成维修 |
| | | </u-button> |
| | | |
| | | <u-button class='o-r-down' plain type="error" size="mini" v-if="current != 2" @click="materialRequire">材料申请 |
| | | </u-button> |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | |
| | | <script> |
| | | import { |
| | | getList |
| | | getList,update |
| | | } from "@/api/repairsorder/repairsorder"; |
| | | export default { |
| | | data() { |
| | |
| | | repairsorderList: null |
| | | } |
| | | }, |
| | | onShow() { |
| | | this.getList() |
| | | }, |
| | | created() { |
| | | this.getList() |
| | | }, |
| | |
| | | getList(this.page.currentPage, this.page.pageSize, this.query).then(res => { |
| | | const data = res.data; |
| | | this.page.total = data.total; |
| | | data.records.forEach(e=>{ |
| | | if(e.picUrls.length==0){ |
| | | e.picUrls = null |
| | | } |
| | | }) |
| | | this.repairsorderList = data.records; |
| | | }) |
| | | }, |
| | |
| | | uni.navigateTo({ |
| | | url: '/pages/repairsorder/detail?id=' + id |
| | | }) |
| | | }, |
| | | //开始维修 |
| | | startRepair(item){ |
| | | uni.showModal({ |
| | | title:"提示", |
| | | content:"是否开始维修?", |
| | | success:(res)=> { |
| | | if(res.confirm){ |
| | | item.state = '2' |
| | | update(item).then(res=>{ |
| | | if(res.code == 200){ |
| | | this.page.currentPage = 1 |
| | | this.getList() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | //维修完成 |
| | | finishRepair(item){ |
| | | uni.showModal({ |
| | | title:"提示", |
| | | content:"是否结束任务?", |
| | | success:(res)=> { |
| | | if(res.confirm){ |
| | | item.state = '3' |
| | | update(item).then(res=>{ |
| | | if(res.code == 200){ |
| | | this.page.currentPage = 1 |
| | | this.getList() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | //维修材料申请 |
| | | materialRequire(){ |
| | | uni.navigateTo({ |
| | | url: '/pages/inventory/materialRequire' |
| | | }) |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |