服务顾问通知客户取车前,判断项目价格、配件价格是否已填写

This commit is contained in:
xiaofajia 2024-11-16 15:37:33 +08:00
parent b49c27c10f
commit cfa1e585bc
2 changed files with 54 additions and 31 deletions

View File

@ -175,3 +175,11 @@ export function removeTicketById(id){
method: 'delete'
})
}
// 验证是否有项目或配件的价格为空或0
export function hasPrice(id){
return request({
url: preUrl + "/hasPrice?id=" + id,
method: 'get'
})
}

View File

@ -147,7 +147,7 @@
</template>
<script>
import {getPageByRole, inspection, confirm, noticeCus} from "@/api/repair/tickets/Tickets";
import {getPageByRole, inspection, confirm, noticeCus, hasPrice} from "@/api/repair/tickets/Tickets";
import TicketsShow from "@/views/repair/tickets/Components/TicketsShow.vue";
import UpdateRepair from "@/views/repair/tickets/form/UpdateRepair.vue";
import {getUserProfile} from "@/api/system/user";
@ -260,36 +260,51 @@ export default {
this.$refs.updateRepair.open(row)
},
async noticeCus(row){
this.$confirm('请选择使用什么方式通知客户?', '选择', {
confirmButtonText: '短信通知',
cancelButtonText: '拨打电话',
type: 'info'
}).then(async () => {
this.isNoticeChoose = false
this.noticeData = {
time: [],
name: null,
mobile: null,
id: null,
remark: null,
}
this.noticeDialog = true
this.noticeData.id = row.id
try {
this.noticeLoading = true
const res = await getUserProfile()
this.noticeData.name = res.data.nickname
this.noticeData.mobile = res.data.mobile
} finally {
this.noticeLoading = false
}
}).catch(() => {
this.isNoticeChoose = true
this.noticeDialog = true
this.noticeData.name = row.userName
this.noticeData.mobile = row.userMobile
})
// 0
const flag = await hasPrice(row.id)
let choose = true
if (!flag.data){
await this.$confirm('有项目或配件的价格为0是否确认通知客户?', '选择', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'info'
}).then(() => {
choose = true
}).catch(() => {
choose = false
})
}
if (choose){
this.$confirm('请选择使用什么方式通知客户?', '选择', {
confirmButtonText: '短信通知',
cancelButtonText: '拨打电话',
type: 'info'
}).then(async () => {
this.isNoticeChoose = false
this.noticeData = {
time: [],
name: null,
mobile: null,
id: null,
remark: null,
}
this.noticeDialog = true
this.noticeData.id = row.id
try {
this.noticeLoading = true
const res = await getUserProfile()
this.noticeData.name = res.data.nickname
this.noticeData.mobile = res.data.mobile
} finally {
this.noticeLoading = false
}
}).catch(() => {
this.isNoticeChoose = true
this.noticeDialog = true
this.noticeData.name = row.userName
this.noticeData.mobile = row.userMobile
})
}
},
async doNotice(){
try {