From 47b60f5acbab26f708203c1c4beaa40dca801582 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Mon, 4 Nov 2024 17:05:12 +0800 Subject: [PATCH] 1 --- components/orderCard.vue | 9 + pages-home/home/home.vue | 59 ++- pages-home/service/sign-agin.vue | 620 +++++++++++++++++++++++++++++++ pages.json | 6 + 4 files changed, 691 insertions(+), 3 deletions(-) create mode 100644 pages-home/service/sign-agin.vue diff --git a/components/orderCard.vue b/components/orderCard.vue index 4f5e6db..47fde1c 100644 --- a/components/orderCard.vue +++ b/components/orderCard.vue @@ -73,6 +73,9 @@ 作废 + + 添加项目 + 查看详情 @@ -199,6 +202,12 @@ export default { ticketsStatus : '03' } }, + /** + * 添加项目 + */ + addProj(order){ + this.$emit('addProj',order); + }, /** * 作废请求后台方法 diff --git a/pages-home/home/home.vue b/pages-home/home/home.vue index e1f51cb..d37c797 100644 --- a/pages-home/home/home.vue +++ b/pages-home/home/home.vue @@ -96,7 +96,7 @@ - + @@ -104,6 +104,7 @@ + @@ -112,6 +113,7 @@ import tabBarVue from '@/components/tabBar/tabBar.vue' import VNavigationBar from '@/components/VNavigationBar.vue' import OrderCard from "@/components/orderCard.vue"; +import ProjectPicker from "@/components/projectPicker.vue"; import config from '@/config' import request from '@/utils/request'; import {formatTimestamp,getOrderStatusText,builderOrder,saveTicketsRecords} from "@/utils/utils"; @@ -119,13 +121,15 @@ import { getToken, getUserInfo, getStrData, - getTenantId + getTenantId, + setJSONData } from '@/utils/auth' export default { components: { OrderCard, tabBarVue, + ProjectPicker, VNavigationBar }, data() { @@ -180,6 +184,10 @@ export default { noReadNum:0, //通知公告数量 noticeNum:0, + //选中的维修单id + ticketId: null, + //新加的维修项目 + selectedProj: [], } }, onLoad(){ @@ -217,7 +225,52 @@ export default { } }, methods: { - + /** + * 添加项目 + */ + addProj(order){ + this.ticketId = order.id + this.$refs.proj.open() + }, + /** + * 添加项目回调 + */ + projConfirm(proj) { + this.selectedProj = proj + if(this.selectedProj.length>0){ + setJSONData("newProject",this.selectedProj) + uni.navigateTo({ + url: '/pages-home/service/sign-agin' + }) + } + console.log(this.selectedProj,"selectedProj") + console.log(this.ticketId,"this.ticketId") + }, + // 子表信息预处理 + formatItem(list) { + if (!(list && list.length > 0)) { + return [] + } + return list.map(item => { + const temp = { + ...item, + ticketId:this.ticketId, + itemName: item.name, + itemCount: 1, + itemUnit: item.unit, + itemPrice: item.price, + itemDiscount:1, + itemMoney: item.price, + itemTypeId: item.type, + remark: item.remark, + itemType: "01", + itemStatus:"01", + projectId: item.id, + id: null + } + return temp; + }) + }, socketSuccess(){ this.getNoReadNum() this.onRefresherrefresh() diff --git a/pages-home/service/sign-agin.vue b/pages-home/service/sign-agin.vue new file mode 100644 index 0000000..653947b --- /dev/null +++ b/pages-home/service/sign-agin.vue @@ -0,0 +1,620 @@ + + + + + diff --git a/pages.json b/pages.json index fae8af6..f1248f3 100644 --- a/pages.json +++ b/pages.json @@ -131,6 +131,12 @@ "navigationBarTitleText": "" } }, + { + "path": "service/sign-agin", + "style": { + "navigationBarTitleText": "" + } + }, { "path": "msg/message", "style": {