diff --git a/src/api/repair/tickets/Tickets.js b/src/api/repair/tickets/Tickets.js index 5da9083..69557c2 100644 --- a/src/api/repair/tickets/Tickets.js +++ b/src/api/repair/tickets/Tickets.js @@ -2,6 +2,7 @@ import request from '@/utils/request' const preUrl = '/repair/tickets' +// 新增 export function createTickets(data){ return request({ url: preUrl + "/create", @@ -9,3 +10,12 @@ export function createTickets(data){ data }) } + +// 分页 +export function getTicketsPage(params){ + return request({ + url: preUrl + "/page", + method: "get", + params + }) +} diff --git a/src/utils/dict.js b/src/utils/dict.js index 28dcf26..eb9e85e 100644 --- a/src/utils/dict.js +++ b/src/utils/dict.js @@ -202,6 +202,8 @@ export const DICT_TYPE = { REPAIR_WARES_ATTRIBUTE: 'wares_attribute', //配件来源 REPAIR_WARES_DATA_FORM: 'wares_data_form', + //维修工单状态 + REPAIR_TICKETS_STATUS: 'repair_tickets_status', // ---------会员相关---------member_coupon_type,member_coupon_out_rule,member_car,member_active //卡券类型 @@ -216,7 +218,7 @@ export const DICT_TYPE = { BALANCE_CHANGE_RULE:"balance_change_rule", //主体 BALANCE_CHANGE_MAIN:"balance_change_main", - //类型 + //类型 BALANCE_CHANGE_TYPE:"balance_change_type", diff --git a/src/views/repair/Components/ServerChoose.vue b/src/views/repair/Components/ServerChoose.vue new file mode 100644 index 0000000..bd75b68 --- /dev/null +++ b/src/views/repair/Components/ServerChoose.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/src/views/repair/Components/StaffChoose.vue b/src/views/repair/Components/StaffChoose.vue index 221ecd4..8131b62 100644 --- a/src/views/repair/Components/StaffChoose.vue +++ b/src/views/repair/Components/StaffChoose.vue @@ -10,7 +10,7 @@ import {getStaffList} from "@/api/company/staff"; export default { name: "StaffChoose", - props:{ + props: { value: { type: Object, } @@ -19,20 +19,21 @@ export default { return { staffList: [], staffSelected: undefined, + hasRequest: false } }, - watch:{ + watch: { staffSelected(val) { const staff = this.staffList.find(item => item.id === val); this.$emit("input", staff); }, - value(newVal){ - if (newVal){ + value(newVal) { + if (newVal) { this.staffSelected = newVal.id - }else { + } else { this.staffSelected = null } - } + }, }, mounted() { this.listStaff() @@ -40,8 +41,10 @@ export default { methods: { async listStaff() { try { + if (this.hasRequest) return; const res = await getStaffList() this.staffList = res.data + this.hasRequest = true } catch { } } diff --git a/src/views/repair/stockOperate/Components/SoIndex.vue b/src/views/repair/stockOperate/Components/SoIndex.vue index 98056e4..e208c58 100644 --- a/src/views/repair/stockOperate/Components/SoIndex.vue +++ b/src/views/repair/stockOperate/Components/SoIndex.vue @@ -264,7 +264,7 @@ export default { await this.pageSo() } catch { } - } + }, } } diff --git a/src/views/repair/tickets/Components/TicketItem.vue b/src/views/repair/tickets/Components/TicketItem.vue index 64d8332..3069d02 100644 --- a/src/views/repair/tickets/Components/TicketItem.vue +++ b/src/views/repair/tickets/Components/TicketItem.vue @@ -19,63 +19,65 @@ -
+
{{ scope.row.count }}
-
+
{{ scope.row.price }}
-
+
{{ scope.row.discount }}
-
+
{{ scope.row.totalPrice }}
-
+
{{ scope.row.repair ? scope.row.repair.name : scope.row.repair }}
-
+
{{ scope.row.sale ? scope.row.sale.name : scope.row.sale }}
-
- +
+ {{ scope.row.type }}
-
- - {{ scope.row.accountType }} +
+ + + +
-
+
{{ scope.row.remark }}
@@ -97,10 +99,12 @@ diff --git a/src/views/repair/tickets/Components/TicketTable.vue b/src/views/repair/tickets/Components/TicketTable.vue index 3c398e6..53c5a8c 100644 --- a/src/views/repair/tickets/Components/TicketTable.vue +++ b/src/views/repair/tickets/Components/TicketTable.vue @@ -52,22 +52,26 @@ {{ scope.$index + 1 }} - - + + + + - - - - - - - + + + + + + + - - - + + + @@ -206,10 +209,12 @@ import TicketItem from "@/views/repair/tickets/Components/TicketItem.vue"; import CarChoose from "@/views/repair/Components/CarChoose.vue"; import {createUniqueCodeByHead} from "@/utils/createUniqueCode"; import {createTickets} from "@/api/repair/tickets/Tickets"; +import RepairAdvice from "@/views/repair/tickets/form/RepairAdvice.vue"; +import QualityExplain from "@/views/repair/tickets/form/QualityExplain.vue"; export default { name: "UserInfo", - components: {CarChoose, TicketItem, StaffChoose, UserChoose}, + components: {QualityExplain, RepairAdvice, CarChoose, TicketItem, StaffChoose, UserChoose}, props: { createTicketType: { type: Boolean, @@ -257,7 +262,12 @@ export default { adviserName: null, payType: null, repairAdvice: null, - qualityExplain: null, + quality: { + qualityMileage: 3000, + qualityDay: 30 + }, + qualityMileage: null, + qualityDay: null, ticketType: null, itemList: [], }, @@ -330,10 +340,12 @@ export default { this.createInit() this.createItemInit() try { - // await createTickets(this.formData) + await createTickets(this.formData) this.$modal.msgSuccess("新增成功") this.init() - }catch{} + }catch{}finally { + this.formData.ticketNo = null + } }, // 初始化 init(){ @@ -364,7 +376,12 @@ export default { adviserName: null, payType: null, repairAdvice: null, - qualityExplain: null, + quality: { + qualityMileage: 3000, + qualityDay: 30 + }, + qualityMileage: null, + qualityDay: null, ticketType: null, itemList: [], } @@ -374,11 +391,20 @@ export default { this.projectList = [] this.partList = [] this.otherList = [] + this.resetTable() + }, + resetTable(){ + this.$refs['projectTable'].resetTable() + this.$refs['partTable'].resetTable() + this.$refs['otherTable'].resetTable() }, // 新增基础信息init createInit() { // 生成工单号 this.formData.ticketNo = createUniqueCodeByHead("GD") + // 质保说明 + this.formData.qualityMileage = this.formData.quality.qualityMileage + this.formData.qualityDay = this.formData.quality.qualityDay // 选择的用户 this.formData.userId = this.selectUser?.userId this.formData.userName = this.selectUser?.cusName @@ -426,6 +452,7 @@ export default { itemTypeId: item?.type?.id, remark: item.remark, itemStatus: item.itemStatus, + id: null } switch (type) { case 'project': @@ -443,7 +470,7 @@ export default { temp[type + 'Id'] = item.id return temp; }) - } + }, } } diff --git a/src/views/repair/tickets/form/QualityExplain.vue b/src/views/repair/tickets/form/QualityExplain.vue new file mode 100644 index 0000000..271fb3f --- /dev/null +++ b/src/views/repair/tickets/form/QualityExplain.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/src/views/repair/tickets/form/RepairAdvice.vue b/src/views/repair/tickets/form/RepairAdvice.vue new file mode 100644 index 0000000..3e68f6c --- /dev/null +++ b/src/views/repair/tickets/form/RepairAdvice.vue @@ -0,0 +1,47 @@ + + + + +