服务顾问设置哪些维修图片可以给客户看
This commit is contained in:
parent
89c2467bb5
commit
20490a3920
18
src/api/repair/repairRecord/index.js
Normal file
18
src/api/repair/repairRecord/index.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 根据条件查询维修记录
|
||||||
|
export function queryList(params){
|
||||||
|
return request({
|
||||||
|
url: '/dl/repair-records/list',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置图片是否开放给用户
|
||||||
|
export function updateOpen(ids, isOpen){
|
||||||
|
return request({
|
||||||
|
url: '/dl/repair-records-item/updateOpen?ids=' + ids + '&isOpen=' + isOpen,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
@ -220,6 +220,8 @@ export const DICT_TYPE = {
|
|||||||
TICKET_WARES_STATUS: 'ticket_wares_status',
|
TICKET_WARES_STATUS: 'ticket_wares_status',
|
||||||
// 领料、退料配件状态
|
// 领料、退料配件状态
|
||||||
TW_ITEM_STATUS: 'tw_item_status',
|
TW_ITEM_STATUS: 'tw_item_status',
|
||||||
|
// 维修记录类型
|
||||||
|
REPAIR_RECORDS_TYPE: 'repair_records_type',
|
||||||
|
|
||||||
// ---------会员相关---------member_coupon_type,member_coupon_out_rule,member_car,member_active
|
// ---------会员相关---------member_coupon_type,member_coupon_out_rule,member_car,member_active
|
||||||
//卡券类型
|
//卡券类型
|
||||||
|
@ -44,6 +44,9 @@
|
|||||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
|
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
|
||||||
>查看
|
>查看
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button v-if="userRole === 'service_advisor' && isFinish" size="mini" type="text" icon="el-icon-refresh" @click="handleEditRecord(scope.row)">
|
||||||
|
维修记录设置
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="(scope.row.ticketsWorkStatus === '01' && userRole === 'repair_staff') && nowUser.id === scope.row.nowRepairId"
|
v-if="(scope.row.ticketsWorkStatus === '01' && userRole === 'repair_staff') && nowUser.id === scope.row.nowRepairId"
|
||||||
size="mini" type="text" icon="el-icon-check" @click="handleTake(scope.row)">
|
size="mini" type="text" icon="el-icon-check" @click="handleTake(scope.row)">
|
||||||
@ -143,6 +146,8 @@
|
|||||||
<el-button @click="doBack(true)" type="success" :disabled="partList.length === 0">退料全部</el-button>
|
<el-button @click="doBack(true)" type="success" :disabled="partList.length === 0">退料全部</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<RecordSetting ref="recordSet" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -156,10 +161,11 @@ import {updateTicketWares} from "@/api/repair/tickets/TicketWares";
|
|||||||
import {getIfLeader} from "@/api/repair/repairworker";
|
import {getIfLeader} from "@/api/repair/repairworker";
|
||||||
import UpdateRecord from "@/views/repair/tickets/form/UpdateRecord.vue";
|
import UpdateRecord from "@/views/repair/tickets/form/UpdateRecord.vue";
|
||||||
import {getUserProfile} from "@/api/system/user";
|
import {getUserProfile} from "@/api/system/user";
|
||||||
|
import RecordSetting from "@/views/repair/tickets/form/RecordSetting.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TicketManagerItem",
|
name: "TicketManagerItem",
|
||||||
components: {UpdateRecord, TWOperate, UpdateRepair, TicketsShow},
|
components: {RecordSetting, UpdateRecord, TWOperate, UpdateRepair, TicketsShow},
|
||||||
props: {
|
props: {
|
||||||
isFinish: {
|
isFinish: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@ -197,7 +203,7 @@ export default {
|
|||||||
formData: {},
|
formData: {},
|
||||||
remark: null,
|
remark: null,
|
||||||
leader: false,
|
leader: false,
|
||||||
nowUser: null
|
nowUser: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -389,9 +395,9 @@ export default {
|
|||||||
this.$refs.updateRecord.open(row)
|
this.$refs.updateRecord.open(row)
|
||||||
},
|
},
|
||||||
// 设置维修图片可不可见
|
// 设置维修图片可不可见
|
||||||
async handleEditRecord(row){
|
handleEditRecord(row){
|
||||||
console.log(row)
|
this.$refs.recordSet.open(row.id)
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
188
src/views/repair/tickets/form/RecordSetting.vue
Normal file
188
src/views/repair/tickets/form/RecordSetting.vue
Normal file
@ -0,0 +1,188 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-dialog title="维修记录" :visible.sync="recordDialog" width="80%" v-dialogDrag append-to-body ref="recordRef">
|
||||||
|
<el-form :model="recordQuery" :inline="true" ref="recordQueryForm" label-width="10rem">
|
||||||
|
<el-form-item label="项目" prop="repairItemId">
|
||||||
|
<el-select v-model="recordQuery.repairItemId" clearable filterable>
|
||||||
|
<el-option v-for="project in projectList" :key="project.id" :label="project.itemName" :value="project.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="记录类型" prop="type">
|
||||||
|
<el-select v-model="recordQuery.type" clearable filterable>
|
||||||
|
<el-option v-for="item in this.getDictDatas(DICT_TYPE.REPAIR_RECORDS_TYPE)" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" @click="handleRecordQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" @click="resetRecordQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-table :data="recordList" :stripe="true" :show-overflow-tooltip="true" v-loading="recordTableLoading">
|
||||||
|
<el-table-column label="序号" align="center" width="55">
|
||||||
|
<template scope="scope">
|
||||||
|
<span>{{ scope.$index + 1 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="记录类型" align="center" prop="type" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.REPAIR_RECORDS_TYPE" :value="scope.row.type" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="项目名称" align="center" prop="repairItemId" width="200">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{getProjectName(scope.row.repairItemId)}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="描述" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="操作" align="center" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" size="mini" @click="handleSetting(scope.row)">
|
||||||
|
设置客户查看权限
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog title="客户查看权限设置" :visible.sync="settingDialog" v-dialogDrag append-to-body width="60%">
|
||||||
|
<el-row :gutter="1">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-radio v-model="radio" label="-1">全部</el-radio>
|
||||||
|
<el-radio v-model="radio" label="0">客户不可见</el-radio>
|
||||||
|
<el-radio v-model="radio" label="1">客户可见</el-radio>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-table :data="items" :stripe="true" :show-overflow-tooltip="true" @selection-change="selectRow">
|
||||||
|
<el-table-column align="center" type="selection" width="55" />
|
||||||
|
<el-table-column align="center" label="图片" prop="image">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-image
|
||||||
|
style="width: 100px; height: 100px"
|
||||||
|
:src="scope.row.image"
|
||||||
|
:preview-src-list="srcList">
|
||||||
|
</el-image>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="状态" prop="isOpen">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{scope.row.isOpen === '0' ? '客户不可见' : '客户可见'}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="success" :disabled="!(selectRows.length > 0 && radio !== '1')" @click="doUpdate('1')">设置客户可见</el-button>
|
||||||
|
<el-button type="danger" :disabled="!(selectRows.length > 0 && radio !== '0')" @click="doUpdate('0')">设置客户不可见</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {queryList, updateOpen} from "@/api/repair/repairRecord";
|
||||||
|
import {getTicketsById} from "@/api/repair/tickets/Tickets";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "RecordSetting",
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
recordDialog: false,
|
||||||
|
recordQuery:{
|
||||||
|
ticketId: null,
|
||||||
|
repairItemId: null,
|
||||||
|
dealUserId: null,
|
||||||
|
type: null
|
||||||
|
},
|
||||||
|
recordList: [],
|
||||||
|
dialogLoading: null,
|
||||||
|
projectList: [],
|
||||||
|
recordTableLoading: false,
|
||||||
|
items: [],
|
||||||
|
settingDialog: false,
|
||||||
|
srcList: [],
|
||||||
|
radio: '-1',
|
||||||
|
finalItems: [],
|
||||||
|
selectRows: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch:{
|
||||||
|
radio(val){
|
||||||
|
this.filterByRadio(val)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
async open(id){
|
||||||
|
this.resetForm("recordQueryForm")
|
||||||
|
this.recordQuery.ticketId = id
|
||||||
|
try {
|
||||||
|
this.recordDialog = true
|
||||||
|
this.dialogLoading = this.$loading({
|
||||||
|
target: this.$refs.recordRef.$el
|
||||||
|
})
|
||||||
|
const response = await getTicketsById(id)
|
||||||
|
this.projectList = response.data.projects
|
||||||
|
await this.getRecordList()
|
||||||
|
}finally {
|
||||||
|
this.dialogLoading.close()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getRecordList(){
|
||||||
|
try {
|
||||||
|
this.recordTableLoading = true
|
||||||
|
const res = await queryList(this.recordQuery)
|
||||||
|
this.recordList = res.data
|
||||||
|
}finally {
|
||||||
|
this.recordTableLoading = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleRecordQuery(){
|
||||||
|
this.getRecordList()
|
||||||
|
},
|
||||||
|
resetRecordQuery(){
|
||||||
|
const id = this.recordQuery.ticketId
|
||||||
|
this.resetForm('recordQueryForm')
|
||||||
|
this.recordQuery.ticketId = id
|
||||||
|
this.handleRecordQuery()
|
||||||
|
},
|
||||||
|
getProjectName(id){
|
||||||
|
return this.projectList.filter(item => item.id === id)?.[0]?.itemName || "无项目"
|
||||||
|
},
|
||||||
|
handleSetting(row){
|
||||||
|
this.radio = '-1'
|
||||||
|
this.items = row.itemList
|
||||||
|
this.items = [...this.items.map(item => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
image: process.env.VUE_APP_FILE_API + item.image
|
||||||
|
}
|
||||||
|
})]
|
||||||
|
this.finalItems = this.items
|
||||||
|
this.srcList = this.items.map(item => item.image)
|
||||||
|
this.settingDialog = true
|
||||||
|
},
|
||||||
|
filterByRadio(val){
|
||||||
|
if (val === '-1'){
|
||||||
|
this.items = this.finalItems
|
||||||
|
}else {
|
||||||
|
this.items = this.finalItems.filter(item => item.isOpen === val)
|
||||||
|
}
|
||||||
|
this.srcList = this.items.map(item => item.image)
|
||||||
|
},
|
||||||
|
selectRow(val){
|
||||||
|
this.selectRows = val
|
||||||
|
},
|
||||||
|
async doUpdate(isOpen){
|
||||||
|
try {
|
||||||
|
const ids = this.selectRows.map(item => item.id).join(",")
|
||||||
|
await updateOpen(ids, isOpen)
|
||||||
|
this.settingDialog = false
|
||||||
|
await this.getRecordList()
|
||||||
|
this.$modal.msgSuccess("设置成功")
|
||||||
|
}catch{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
|
||||||
|
</style>
|
@ -47,6 +47,9 @@
|
|||||||
<el-button @click="handleEdit(scope.row)" v-if="userRole === 'service_advisor'" size="mini" type="text" icon="el-icon-setting">
|
<el-button @click="handleEdit(scope.row)" v-if="userRole === 'service_advisor'" size="mini" type="text" icon="el-icon-setting">
|
||||||
编辑工单
|
编辑工单
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button v-if="userRole === 'service_advisor'" size="mini" type="text" icon="el-icon-refresh" @click="handleEditRecord(scope.row)">
|
||||||
|
维修记录设置
|
||||||
|
</el-button>
|
||||||
<el-button v-if="!(userRole === 'service_advisor' && scope.row.ticketsWorkStatus === '03')" size="mini" type="text" icon="el-icon-edit-outline" @click="handleDispose(scope.row)">
|
<el-button v-if="!(userRole === 'service_advisor' && scope.row.ticketsWorkStatus === '03')" size="mini" type="text" icon="el-icon-edit-outline" @click="handleDispose(scope.row)">
|
||||||
处理
|
处理
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -127,6 +130,7 @@
|
|||||||
|
|
||||||
<UpdateRepair ref="updateRepair" @success="getList"/>
|
<UpdateRepair ref="updateRepair" @success="getList"/>
|
||||||
<EditTickets ref="editTickets" @success="getList"/>
|
<EditTickets ref="editTickets" @success="getList"/>
|
||||||
|
<RecordSetting ref="recordSet" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -136,10 +140,11 @@ import TicketsShow from "@/views/repair/tickets/Components/TicketsShow.vue";
|
|||||||
import UpdateRepair from "@/views/repair/tickets/form/UpdateRepair.vue";
|
import UpdateRepair from "@/views/repair/tickets/form/UpdateRepair.vue";
|
||||||
import {getUserProfile} from "@/api/system/user";
|
import {getUserProfile} from "@/api/system/user";
|
||||||
import EditTickets from "@/views/repair/tickets/form/EditTickets.vue";
|
import EditTickets from "@/views/repair/tickets/form/EditTickets.vue";
|
||||||
|
import RecordSetting from "@/views/repair/tickets/form/RecordSetting.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TicketFinishManager",
|
name: "TicketFinishManager",
|
||||||
components: {EditTickets, UpdateRepair, TicketsShow},
|
components: {RecordSetting, EditTickets, UpdateRepair, TicketsShow},
|
||||||
props:{
|
props:{
|
||||||
userRole: String
|
userRole: String
|
||||||
},
|
},
|
||||||
@ -272,7 +277,11 @@ export default {
|
|||||||
},
|
},
|
||||||
handleEdit(row){
|
handleEdit(row){
|
||||||
this.$refs.editTickets.open(row)
|
this.$refs.editTickets.open(row)
|
||||||
}
|
},
|
||||||
|
// 设置维修图片可不可见
|
||||||
|
handleEditRecord(row){
|
||||||
|
this.$refs.recordSet.open(row.id)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user