更新代码
This commit is contained in:
parent
85a6461d8b
commit
0d921e70a8
@ -36,3 +36,12 @@ export function setTicketsVoid(data){
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 结算
|
||||
export function setTicketsPaid(data){
|
||||
return request({
|
||||
url: preUrl + "/paid",
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
@ -96,7 +96,7 @@
|
||||
<el-table-column label="所属门店" align="center" prop="corpId" width="180"/>
|
||||
<el-table-column label="工单状态" align="center" prop="ticketsStatus" width="180">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :type="DICT_TYPE.REPAIR_TICKETS_STATUS" v-model="scope.row.ticketsStatus" />
|
||||
<dict-tag :type="DICT_TYPE.REPAIR_TICKETS_STATUS" v-model="scope.row.ticketsStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="180">
|
||||
@ -105,12 +105,14 @@
|
||||
>查看
|
||||
</el-button>
|
||||
<el-button v-if="TicketType === 'tu'" size="mini" type="text" icon="el-icon-finished"
|
||||
@click="handlePaid(scope.row)"
|
||||
>结算
|
||||
</el-button>
|
||||
<!-- <el-button v-if="TicketType === 'tp'" size="mini" type="text" icon="el-icon-refresh-right"-->
|
||||
<!-- >返结-->
|
||||
<!-- </el-button>-->
|
||||
<el-button v-if="TicketType !== 'tv'" size="mini" type="text" icon="el-icon-delete" @click="handleVoid(scope.row)"
|
||||
<!-- <el-button v-if="TicketType === 'tp'" size="mini" type="text" icon="el-icon-refresh-right"-->
|
||||
<!-- >返结-->
|
||||
<!-- </el-button>-->
|
||||
<el-button v-if="TicketType !== 'tv'" size="mini" type="text" icon="el-icon-delete"
|
||||
@click="handleVoid(scope.row)"
|
||||
>作废
|
||||
</el-button>
|
||||
</template>
|
||||
@ -138,12 +140,12 @@
|
||||
<!-- <el-table-column label="作废人" align="center" prop="soNo" width="180" />-->
|
||||
<!-- <el-table-column label="作废备注" align="center" prop="remark" width="180" />-->
|
||||
<!-- </el-table>-->
|
||||
<TicketsShow ref="ticketsShow" />
|
||||
<TicketsShow ref="ticketsShow"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {setTicketsVoid} from "@/api/repair/tickets/Tickets";
|
||||
import {setTicketsVoid, setTicketsPaid} from "@/api/repair/tickets/Tickets";
|
||||
import TicketsShow from "@/views/repair/tickets/Components/TicketsShow.vue";
|
||||
|
||||
export default {
|
||||
@ -174,7 +176,7 @@ export default {
|
||||
handleShow(row) {
|
||||
this.$refs.ticketsShow.open(row)
|
||||
},
|
||||
async handleVoid(row){
|
||||
async handleVoid(row) {
|
||||
this.$prompt('作废备注', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
@ -183,14 +185,37 @@ export default {
|
||||
this.formData.remark = value
|
||||
this.formData.ticketsStatus = "03"
|
||||
this.doVoid()
|
||||
}).catch(() => {})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
async doVoid(){
|
||||
async doVoid() {
|
||||
try {
|
||||
await setTicketsVoid(this.formData)
|
||||
this.$modal.msgSuccess("作废成功")
|
||||
this.$emit("setVoid")
|
||||
}catch{}
|
||||
} catch {
|
||||
}
|
||||
},
|
||||
handlePaid(row) {
|
||||
this.$prompt('结算备注', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
}).then(({value}) => {
|
||||
const data = {}
|
||||
data['id'] = row.id
|
||||
data['remark'] = value
|
||||
data['ticketsStatus'] = '02'
|
||||
this.doPaid(data)
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
async doPaid(data) {
|
||||
try {
|
||||
await setTicketsPaid(data)
|
||||
this.$modal.msgSuccess("结算成功")
|
||||
this.$emit("setVoid")
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-descriptions class="margin-top" :column="4" :size="'medium'" border style="margin-bottom: 1rem">
|
||||
<!-- <template slot="extra">-->
|
||||
<!-- <el-button v-if="createTicketType" type="success" size="small">新增客户信息</el-button>-->
|
||||
<!-- <el-button v-if="createTicketType" type="primary" size="small" :disabled="!selectUser.id">完善更多客户信息</el-button>-->
|
||||
<!-- <el-button type="primary" size="small">选择业务</el-button>-->
|
||||
<!-- </template>-->
|
||||
<!-- <template slot="extra">-->
|
||||
<!-- <el-button v-if="createTicketType" type="success" size="small">新增客户信息</el-button>-->
|
||||
<!-- <el-button v-if="createTicketType" type="primary" size="small" :disabled="!selectUser.id">完善更多客户信息</el-button>-->
|
||||
<!-- <el-button type="primary" size="small">选择业务</el-button>-->
|
||||
<!-- </template>-->
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
用户选择
|
||||
@ -30,12 +30,12 @@
|
||||
</template>
|
||||
<el-input disabled v-model="selectCar.vin"/>
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item>-->
|
||||
<!-- <template slot="label">-->
|
||||
<!-- 车牌-->
|
||||
<!-- </template>-->
|
||||
<!-- <el-input disabled v-model="selectCar.licenseNumber"/>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item>-->
|
||||
<!-- <template slot="label">-->
|
||||
<!-- 车牌-->
|
||||
<!-- </template>-->
|
||||
<!-- <el-input disabled v-model="selectCar.licenseNumber"/>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
品牌车系
|
||||
@ -92,17 +92,17 @@
|
||||
</template>
|
||||
<el-input v-model="selectCar.newMaintenanceMileage"/>
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item :span="3">-->
|
||||
<!-- <template slot="label">-->
|
||||
<!-- 备注-->
|
||||
<!-- </template>-->
|
||||
<!-- <el-input v-model="formData.remark"/>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item :span="3">-->
|
||||
<!-- <template slot="label">-->
|
||||
<!-- 备注-->
|
||||
<!-- </template>-->
|
||||
<!-- <el-input v-model="formData.remark"/>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
服务顾问
|
||||
</template>
|
||||
<StaffChoose v-model="selectStaff" />
|
||||
<StaffChoose v-model="selectStaff"/>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-row :gutter="5" style="margin-bottom: 1rem">
|
||||
@ -113,8 +113,10 @@
|
||||
<el-button size="small" @click="$refs['qualityExplain'].open()">质保说明</el-button>
|
||||
</el-col>
|
||||
<el-col v-if="createTicketType" :span="4.8">
|
||||
<el-button size="small" v-if="formData.endCheck.toString() === '1'" @click="formData.endCheck = 0">终检</el-button>
|
||||
<el-button size="small" v-if="formData.endCheck.toString() === '0'" @click="formData.endCheck = 1">不终检</el-button>
|
||||
<el-button size="small" v-if="formData.endCheck.toString() === '1'" @click="formData.endCheck = 0">终检
|
||||
</el-button>
|
||||
<el-button size="small" v-if="formData.endCheck.toString() === '0'" @click="formData.endCheck = 1">不终检
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col v-if="createTicketType" :span="4.8">
|
||||
<el-select v-model="formData.partDisposal" size="small">
|
||||
@ -134,18 +136,20 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<TicketItem item-type="project" :in-list-data="projectList" @tableData="projectData" ref="projectTable"/>
|
||||
<TicketItem v-if="createTicketType" :in-list-data="partList" item-type="part" @tableData="partData" ref="partTable"/>
|
||||
<TicketItem v-if="createTicketType" :in-list-data="otherList" item-type="other" @tableData="otherData" ref="otherTable"/>
|
||||
<TicketItem v-if="createTicketType" :in-list-data="partList" item-type="part" @tableData="partData"
|
||||
ref="partTable"/>
|
||||
<TicketItem v-if="createTicketType" :in-list-data="otherList" item-type="other" @tableData="otherData"
|
||||
ref="otherTable"/>
|
||||
<el-row :gutter="createTicketType ? 2 : 3" style="margin-top: 1rem">
|
||||
<el-col :span="createTicketType ? 12 : 16">
|
||||
<el-descriptions class="margin-top" :column="createTicketType ? 2 : 3" border :size="'medium'"
|
||||
style="margin-bottom: 1rem">
|
||||
<!-- <el-descriptions-item>-->
|
||||
<!-- <template slot="label">-->
|
||||
<!-- 工单号-->
|
||||
<!-- </template>-->
|
||||
<!-- <TicketChoose @selected="getTickets"/>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item>-->
|
||||
<!-- <template slot="label">-->
|
||||
<!-- 工单号-->
|
||||
<!-- </template>-->
|
||||
<!-- <TicketChoose @selected="getTickets"/>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
时间
|
||||
@ -192,15 +196,15 @@
|
||||
</el-col>
|
||||
<el-col :span="12" style="margin-top:1rem;display: flex;justify-content: right">
|
||||
<el-button type="success" @click="handleSave">完成</el-button>
|
||||
<el-button type="danger">结算</el-button>
|
||||
<!-- <el-button type="primary">通知施工</el-button>-->
|
||||
<!-- <el-button type="primary">领料</el-button>-->
|
||||
<!-- <el-button type="primary">退料</el-button>-->
|
||||
<el-button type="danger" @click="handlePaid">结算</el-button>
|
||||
<!-- <el-button type="primary">通知施工</el-button>-->
|
||||
<!-- <el-button type="primary">领料</el-button>-->
|
||||
<!-- <el-button type="primary">退料</el-button>-->
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<RepairAdvice ref="repairAdvice" v-model="formData.repairAdvice"/>
|
||||
<QualityExplain ref="qualityExplain" v-model="formData.quality" />
|
||||
<QualityExplain ref="qualityExplain" v-model="formData.quality"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -347,12 +351,13 @@ export default {
|
||||
await createTickets(this.formData)
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.init()
|
||||
}catch{}finally {
|
||||
} catch {
|
||||
} finally {
|
||||
this.formData.ticketNo = null
|
||||
}
|
||||
},
|
||||
// 初始化
|
||||
init(){
|
||||
init() {
|
||||
this.formData = {
|
||||
endCheck: 1,
|
||||
partDisposal: '01',
|
||||
@ -390,7 +395,7 @@ export default {
|
||||
itemList: [],
|
||||
ticketStatus: "01"
|
||||
}
|
||||
this.selectUser ={}
|
||||
this.selectUser = {}
|
||||
this.selectCar = {}
|
||||
this.selectStaff = {}
|
||||
this.projectList = []
|
||||
@ -398,7 +403,7 @@ export default {
|
||||
this.otherList = []
|
||||
this.resetTable()
|
||||
},
|
||||
resetTable(){
|
||||
resetTable() {
|
||||
this.$refs['projectTable'].resetTable()
|
||||
this.$refs['partTable'].resetTable()
|
||||
this.$refs['otherTable'].resetTable()
|
||||
@ -438,7 +443,7 @@ export default {
|
||||
},
|
||||
// 子表信息预处理
|
||||
formatItem(type, list) {
|
||||
if (!(list && list.length > 0)){
|
||||
if (!(list && list.length > 0)) {
|
||||
return []
|
||||
}
|
||||
return list.map(item => {
|
||||
@ -477,10 +482,10 @@ export default {
|
||||
})
|
||||
},
|
||||
// 查看工单
|
||||
async getTickets(id){
|
||||
async getTickets(id) {
|
||||
try {
|
||||
const res = await getTicketsById(id)
|
||||
const data= res.data
|
||||
const data = res.data
|
||||
this.formData = {
|
||||
...data,
|
||||
quality: {qualityMileage: data.qualityMileage, qualityDay: data.qualityDay}
|
||||
@ -491,12 +496,18 @@ export default {
|
||||
this.projectList = [itemList.find(item => item.itemType === '01')]
|
||||
this.partList = [itemList.find(item => item.itemType === '02')]
|
||||
this.otherList = [itemList.find(item => item.itemType === '03')]
|
||||
}catch{}
|
||||
} catch {
|
||||
}
|
||||
},
|
||||
// 挂单
|
||||
handlePendingSave(){
|
||||
handlePendingSave() {
|
||||
this.formData.ticketsStatus = "06"
|
||||
this.handleSave()
|
||||
},
|
||||
// 结算
|
||||
handlePaid() {
|
||||
this.formData.ticketsStatus = '02'
|
||||
this.handleSave()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user