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

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' method: 'delete'
}) })
} }
// 验证是否有项目或配件的价格为空或0
export function hasPrice(id){
return request({
url: preUrl + "/hasPrice?id=" + id,
method: 'get'
})
}

View File

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