From 2222a406f534f264ec5b63b734afed15cae4571a Mon Sep 17 00:00:00 2001
From: xiaofajia <1665375861@qq.com>
Date: Wed, 13 Nov 2024 19:56:41 +0800
Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E4=BB=B6=E7=94=B3=E8=AF=B7=E5=8D=95?=
=?UTF-8?q?=E5=8A=A0=E4=B8=8A=E5=9B=BE=E7=89=87=E5=92=8C=E4=B8=80=E4=BA=9B?=
=?UTF-8?q?=E5=85=B6=E4=BB=96=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/repair/tickets/TWItem.js | 9 +
.../repair/tickets/Components/TWIAdd.vue | 405 ++++++++++++++++++
.../repair/tickets/Components/TicketItem.vue | 4 +-
.../tickets/Components/TicketItemShow.vue | 10 +-
.../repair/tickets/Components/TicketTable.vue | 2 +-
.../repair/tickets/Components/TicketWares.vue | 3 +-
.../tickets/Components/TicketWaresShow.vue | 96 ++++-
.../repair/tickets/Components/TicketsShow.vue | 72 +++-
.../repair/tickets/Components/UserInfo.vue | 4 +-
src/views/repair/tickets/form/TWOperate.vue | 280 ++++++------
10 files changed, 707 insertions(+), 178 deletions(-)
create mode 100644 src/views/repair/tickets/Components/TWIAdd.vue
diff --git a/src/api/repair/tickets/TWItem.js b/src/api/repair/tickets/TWItem.js
index cc11a64..496b8c1 100644
--- a/src/api/repair/tickets/TWItem.js
+++ b/src/api/repair/tickets/TWItem.js
@@ -19,3 +19,12 @@ export function updateIsShow(params){
params
})
}
+
+// 给配件申请表子表添加数据
+export function addTwi(data){
+ return request({
+ url: preUrl + '/addTwi',
+ method: 'post',
+ data
+ })
+}
diff --git a/src/views/repair/tickets/Components/TWIAdd.vue b/src/views/repair/tickets/Components/TWIAdd.vue
new file mode 100644
index 0000000..0346aa9
--- /dev/null
+++ b/src/views/repair/tickets/Components/TWIAdd.vue
@@ -0,0 +1,405 @@
+
+
+
+
+
+
+
+
+ 选择配件
+
+
+
+
+
+
+
+
+ {{ scope.$index + 1 }}
+
+
+
+
+
+
+
+ {{ scope.row.count }}
+
+
+
+
+
+ {{ scope.row.remark }}
+
+
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+ 新增配件
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/repair/tickets/Components/TicketItem.vue b/src/views/repair/tickets/Components/TicketItem.vue
index 8f67060..602a97f 100644
--- a/src/views/repair/tickets/Components/TicketItem.vue
+++ b/src/views/repair/tickets/Components/TicketItem.vue
@@ -52,7 +52,7 @@
- {{ scope.row.discount === 1 ? "无折扣" : scope.row.discount }}
+ {{ scope.row.discount }}
@@ -68,7 +68,7 @@
{{ scope.row.repair ? getRepairName(scope.row.repair) : scope.row.repair }}
-
+
diff --git a/src/views/repair/tickets/Components/TicketItemShow.vue b/src/views/repair/tickets/Components/TicketItemShow.vue
index be26ca7..692bbab 100644
--- a/src/views/repair/tickets/Components/TicketItemShow.vue
+++ b/src/views/repair/tickets/Components/TicketItemShow.vue
@@ -31,14 +31,10 @@
-
-
- {{scope.row.itemDiscount === 1 ? "无折扣" : scope.row.itemDiscount}}
-
-
+
-
+
@@ -68,7 +64,7 @@
-
+
diff --git a/src/views/repair/tickets/Components/TicketTable.vue b/src/views/repair/tickets/Components/TicketTable.vue
index 2eaaabb..187f53f 100644
--- a/src/views/repair/tickets/Components/TicketTable.vue
+++ b/src/views/repair/tickets/Components/TicketTable.vue
@@ -28,7 +28,7 @@
-
+
diff --git a/src/views/repair/tickets/Components/TicketWares.vue b/src/views/repair/tickets/Components/TicketWares.vue
index 474c941..2f7cef1 100644
--- a/src/views/repair/tickets/Components/TicketWares.vue
+++ b/src/views/repair/tickets/Components/TicketWares.vue
@@ -62,7 +62,8 @@
查看
审核
diff --git a/src/views/repair/tickets/Components/TicketWaresShow.vue b/src/views/repair/tickets/Components/TicketWaresShow.vue
index 6007a9b..39df452 100644
--- a/src/views/repair/tickets/Components/TicketWaresShow.vue
+++ b/src/views/repair/tickets/Components/TicketWaresShow.vue
@@ -71,11 +71,31 @@
+
+
+
+ 配件申请表
+
+
+
+
+
+
+
+
@@ -94,14 +114,19 @@
-
-
- °
+
+
+ √
-
+
+
+ √
+
+
+
- °
+ √
@@ -113,14 +138,19 @@
-
-
- °
+
+
+ √
-
+
+
+ √
+
+
+
- °
+ √
@@ -129,11 +159,13 @@
+
+
@@ -144,10 +176,12 @@ import {listTwItem, updateIsShow} from "@/api/repair/tickets/TWItem";
import DiscountInput from "@/views/repair/tickets/Components/DiscountInput.vue";
import item from "@/layout/components/Sidebar/Item.vue";
import {DICT_TYPE} from "@/utils/dict";
+import TWOperate from "@/views/repair/tickets/form/TWOperate.vue";
+import TWIAdd from "@/views/repair/tickets/Components/TWIAdd.vue";
export default {
name: "TicketWaresShow",
- components: {DiscountInput},
+ components: {TWIAdd, DiscountInput},
props: {
userRole: String,
type: Boolean
@@ -168,10 +202,21 @@ export default {
clickCellMap: {},
editProp: ['wares.price'],
dialogLoading: null,
- selectRow:[]
+ selectRow:[],
+ imageUrls: []
}
},
methods: {
+ handleSuccess(){
+ this.open(this.formData)
+ },
+ handleAddWares(){
+ this.dialogVisible = false
+ this.$refs.twiAdd.open(this.formData)
+ },
+ getImages(images){
+ this.imageUrls = images.split(",").map(item => process.env.VUE_APP_FILE_API + item)
+ },
async open(row) {
try {
this.dialogVisible = true
@@ -186,6 +231,9 @@ export default {
this.queryParams.twId = row.id
await this.getTwItem()
}
+ if (this.formData.images){
+ this.getImages(this.formData.images)
+ }
} finally {
this.dialogLoading.close()
}
@@ -194,15 +242,17 @@ export default {
try {
this.loading = true
const res = await listTwItem(this.queryParams)
- this.items = res.data
- this.items = [...this.items.map(item => {
- return {
- ...item,
- itemDiscount: 1,
+ if (res.data && res.data.length > 0){
+ this.items = res.data
+ this.items = [...this.items.map(item => {
+ return {
+ ...item,
+ itemDiscount: 1,
+ }
+ })]
+ if (this.type){
+ this.items = [...this.items.filter(item => item.waresStatus === "")]
}
- })]
- if (this.type){
- this.items = [...this.items.filter(item => item.waresStatus === "")]
}
} finally {
this.loading = false
diff --git a/src/views/repair/tickets/Components/TicketsShow.vue b/src/views/repair/tickets/Components/TicketsShow.vue
index 6f09554..743c870 100644
--- a/src/views/repair/tickets/Components/TicketsShow.vue
+++ b/src/views/repair/tickets/Components/TicketsShow.vue
@@ -174,12 +174,12 @@
材料信息
@@ -199,6 +199,29 @@
+
+
+
+
+ 合计
+
+
+
+
+
+ 总数量
+
+ {{ totalCount }}
+
+
+
+ 总金额
+
+ {{ totalMoney}}
+
+
+
+
@@ -212,7 +235,7 @@ import {getTicketsById, updateShow} from "@/api/repair/tickets/Tickets";
export default {
name: "TicketsShow",
- props:{
+ props: {
userRole: String
},
components: {TicketItemShow},
@@ -222,23 +245,44 @@ export default {
info: {},
projects: [],
wares: [],
- others: []
+ others: [],
+ allList: [],
+ totalCount: 0,
+ totalMoney: 0
}
},
methods: {
async open(row) {
+ this.reset()
const res = await getTicketsById(row.id)
- const data = res.data.items
- this.projects = data.filter(item => item.project)
- this.wares = data.filter(item => item.ware)
- this.others = data.filter(item => item.other)
+ this.allList = res.data.items
+ this.computed()
+ this.projects = this.allList.filter(item => item.project)
+ this.wares = this.allList.filter(item => item.ware)
+ this.others = this.allList.filter(item => item.other)
this.info = row
this.dialogVisible = true
},
- async changeShow(){
+ async changeShow() {
try {
await updateShow(this.info.id, this.info.partShow)
- }catch {}
+ } catch {
+ }
+ },
+ reset() {
+ this.info = {}
+ this.projects = []
+ this.wares = []
+ this.others = []
+ this.allList = []
+ },
+ computed(){
+ this.totalCount = 0
+ this.totalMoney = 0
+ if (this.allList && this.allList.length > 0){
+ this.totalCount = this.allList.reduce((acc, cur) => {return acc + cur.itemCount}, 0)
+ this.totalMoney = this.allList.reduce((acc, cur) => {return acc + cur.itemMoney}, 0)
+ }
}
}
}
diff --git a/src/views/repair/tickets/Components/UserInfo.vue b/src/views/repair/tickets/Components/UserInfo.vue
index ad1703b..7a81d9f 100644
--- a/src/views/repair/tickets/Components/UserInfo.vue
+++ b/src/views/repair/tickets/Components/UserInfo.vue
@@ -556,7 +556,7 @@ export default {
}
this.selectUser = {}
this.selectCar = {}
- this.selectStaff = {}
+ // this.selectStaff = {}
this.projectList = []
this.partList = []
this.otherList = []
@@ -619,7 +619,7 @@ export default {
case "03":
message += "其他:"
}
- this.$modal.msgError(message + item.itemName + (!item.repairIds ? "施工人员" : "销售人员") + "不能为空")
+ this.$modal.msgError(message + item.itemName + (!item.repairIds ? "施工人员" : "服务顾问") + "不能为空")
count++
}
})
diff --git a/src/views/repair/tickets/form/TWOperate.vue b/src/views/repair/tickets/form/TWOperate.vue
index a04a408..56b7d1a 100644
--- a/src/views/repair/tickets/form/TWOperate.vue
+++ b/src/views/repair/tickets/form/TWOperate.vue
@@ -1,120 +1,120 @@
-
-
-
-
- 工单信息
-
-
-
-
-
-
- 订单编号
-
- {{ info.ticketNo }}
-
-
-
- 维修类别
-
-
-
-
-
- 状态
-
-
-
-
-
- 客户名称
-
- {{ info.userName }}
-
-
-
- 车牌号
-
- {{ info.carNo }}
-
-
-
- 车系
-
- {{ info.carBrandName }}
-
-
-
- 手机号
-
- {{ info.userMobile }}
-
-
-
- 创建时间
-
- {{ parseTime(info.createTime, '{y}-{m}-{d}') }}
-
-
-
- 预计完工
-
- {{ parseTime(info.outTime, '{y}-{m}-{d}') }}
-
-
-
- 合计金额
-
- {{ info.totalPrice }}
-
-
-
- 参考成本
-
- {{ info.cost }}
-
-
-
- 参考毛利
-
- {{ info.profit }}
-
-
-
- 领料状态
-
-
-
-
-
- 服务顾问
-
- {{ info.adviserName }}
-
-
-
- 所属门店
-
- {{ info.corpId }}
-
-
-
- 工单状态
-
-
-
-
-
- 备注
-
- {{ info.remark }}
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -130,7 +130,6 @@
-
@@ -168,6 +167,19 @@
+
+
+
+
+
+ 上传配件申请单
+
+
+
+
+
+
+