Compare commits

...

2 Commits

Author SHA1 Message Date
xiaofajia
530c652fd4 优化按钮权限控制(部分) 2024-11-01 20:42:44 +08:00
xiaofajia
50113c1dca 编辑工单和删除工单 2024-11-01 20:21:34 +08:00
3 changed files with 49 additions and 5 deletions

View File

@ -167,3 +167,11 @@ export function updateTicket(data){
data
})
}
// 删除工单
export function removeTicketById(id){
return request({
url: preUrl + "/remove?id=" + id,
method: 'delete'
})
}

View File

@ -44,6 +44,12 @@
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
>查看
</el-button>
<el-button v-hasPermi="['repair:tkm:edit']" size="mini" type="text" icon="el-icon-setting" @click="handleEditTicket(scope.row)">
编辑工单
</el-button>
<el-button v-hasPermi="['repair:tkm:remove']" size="mini" type="text" icon="el-icon-remove" @click="handleRemove(scope.row)">
删除
</el-button>
<el-button v-if="userRole === 'service_advisor' && isFinish" size="mini" type="text" icon="el-icon-refresh" @click="handleEditRecord(scope.row)">
维修记录设置
</el-button>
@ -151,11 +157,12 @@
</el-dialog>
<RecordSetting ref="recordSet" />
<EditTickets ref="editTickets" @success="listTickets"/>
</div>
</template>
<script>
import {getPageType, updateTake, getTicketsById} from "@/api/repair/tickets/Tickets";
import {getPageType, updateTake, getTicketsById, removeTicketById} from "@/api/repair/tickets/Tickets";
import TicketsShow from "@/views/repair/tickets/Components/TicketsShow.vue";
import UpdateRepair from "@/views/repair/tickets/form/UpdateRepair.vue";
import TWOperate from "@/views/repair/tickets/form/TWOperate.vue";
@ -165,10 +172,11 @@ import {getIfLeader} from "@/api/repair/repairworker";
import UpdateRecord from "@/views/repair/tickets/form/UpdateRecord.vue";
import {getUserProfile} from "@/api/system/user";
import RecordSetting from "@/views/repair/tickets/form/RecordSetting.vue";
import EditTickets from "@/views/repair/tickets/form/EditTickets.vue";
export default {
name: "TicketManagerItem",
components: {RecordSetting, UpdateRecord, TWOperate, UpdateRepair, TicketsShow},
components: {EditTickets, RecordSetting, UpdateRecord, TWOperate, UpdateRepair, TicketsShow},
props: {
isFinish: {
type: Boolean,
@ -401,6 +409,20 @@ export default {
handleEditRecord(row){
this.$refs.recordSet.open(row.id)
},
handleEditTicket(row){
this.$refs.editTickets.open(row)
},
async handleRemove(row){
try {
const id = row.id
if (id){
await this.$modal.confirm("确认删除工单" + row.ticketNo + "吗?")
await removeTicketById(id)
await this.listTickets()
this.$modal.msgSuccess("删除成功")
}
}catch{}
}
}
}
</script>

View File

@ -104,7 +104,7 @@
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
>查看
</el-button>
<el-button v-if="TicketType === 'tu' && isWXCW && scope.row.isFinish === '1'" size="mini" type="text" icon="el-icon-finished"
<el-button v-if="scope.row.isFinish === '1'" v-hasPermi="['repair:tk:paid']" size="mini" type="text" icon="el-icon-finished"
@click="handlePaid(scope.row)"
>结算
</el-button>
@ -119,9 +119,12 @@
@click="handlePrint(scope.row)"
>下载打印
</el-button>
<el-button size="mini" type="text" icon="el-icon-setting" @click="handleEditTicket(scope.row)">
<el-button size="mini" v-hasPermi="['repair:tk:edit']" type="text" icon="el-icon-setting" @click="handleEditTicket(scope.row)">
编辑工单
</el-button>
<el-button size="mini" v-hasPermi="['repair:tk:remove']" type="text" icon="el-icon-remove" @click="handleRemove(scope.row)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
@ -178,7 +181,7 @@
</template>
<script>
import {setTicketsVoid, setTicketsPaid, setTicketsPrint} from '@/api/repair/tickets/Tickets'
import {setTicketsVoid, setTicketsPaid, setTicketsPrint, removeTicketById} from '@/api/repair/tickets/Tickets'
import TicketsShow from "@/views/repair/tickets/Components/TicketsShow.vue";
import {getByNameAndMobile} from "@/api/base/customer";
import EditTickets from "@/views/repair/tickets/form/EditTickets.vue";
@ -297,6 +300,17 @@ export default {
},
returnSuccess(){
this.$emit("success")
},
async handleRemove(row){
try {
const id = row.id
if (id){
await this.$modal.confirm("确认删除工单" + row.ticketNo + "吗?")
await removeTicketById(id)
await this.listTickets()
this.$modal.msgSuccess("删除成功")
}
}catch{}
}
}
}