diff --git a/components/orderCard.vue b/components/orderCard.vue
index 7e876a4..5e79c93 100644
--- a/components/orderCard.vue
+++ b/components/orderCard.vue
@@ -70,6 +70,9 @@
修改项目
+
+ 修改价格
+
查看详情
@@ -167,6 +170,14 @@ export default {
url: '/pages-order/orderDetail/orderDetail?id=' + this.order.id + '&isDetail=' + '1'
})
},
+ /**
+ * 修改配件价格
+ */
+ editWaresPrice(){
+ uni.navigateTo({
+ url: `/pages-order/orderDetail/orderDetail?id=${this.order.id}&isDetail=0`
+ });
+ },
/**
* 作废
diff --git a/pages-order/orderDetail/orderDetail.vue b/pages-order/orderDetail/orderDetail.vue
index 57b2c01..84b0fc5 100644
--- a/pages-order/orderDetail/orderDetail.vue
+++ b/pages-order/orderDetail/orderDetail.vue
@@ -120,7 +120,7 @@
-
+
{{ item.itemName }}
¥{{ item.itemMoney }}
@@ -133,7 +133,7 @@
折扣:
金额:
-
+
售价:{{ item.itemPrice || "" }}
数量:{{ item.itemCount || "" }}
@@ -150,11 +150,11 @@
{{item.saleName || ""}}
-
-
+
@@ -167,11 +167,11 @@
施工人员
{{ item.repairNames || ""}}
-
-
+
@@ -187,12 +187,18 @@
-
{{ item.itemName }}
¥{{ item.itemMoney }}
-
+
+ 售价:
+ 数量:
+ 单位:
+ 折扣:
+ 金额:{{ item.itemMoney || "" }}
+
+
售价:{{ item.itemPrice || "" }}
数量:{{ item.itemCount || "" }}
单位:{{ item.itemUnit || ""}}
@@ -467,6 +473,7 @@ export default {
},
submit (){
let canSubmit = true
+ let itemList = []
//校验所有项目、配件是否填写了价格、数量、折扣,并且是否合理
if(this.ticketInfo.projects && this.ticketInfo.projects.length>0){
this.ticketInfo.projects.map((item)=>{
@@ -490,30 +497,49 @@ export default {
item.itemDiscount = 1
}
item.itemMoney = item.itemPrice*item.itemCount*item.itemDiscount
+ let itemObj = {
+ id:item.id,
+ ticketId:item.ticketId,
+ itemPrice:item.itemPrice,
+ itemCount:item.itemCount,
+ itemDiscount:item.itemDiscount,
+ itemMoney:item.itemMoney,
+ }
+ itemList.push(itemObj)
})
}
- //APP暂时不修改配件的信息--
- // if(this.ticketInfo.wares && this.ticketInfo.wares.length>0){
- // this.ticketInfo.wares.map((item)=>{
- // if((item.itemPrice && item.itemPrice>0) && (item.itemCount && item.itemCount>0) && (item.itemDiscount && item.itemDiscount>0 && item.itemDiscount<=1)){
- // //数据符合要求重新计算
- // item.itemMoney = item.itemPrice*item.itemCount*item.itemDiscount
- // }else{
- // canSubmit=false
- // uni.showToast({
- // title: '维修配件'+item.itemName+'价格有误!',
- // icon: 'none'
- // })
- // return
- // }
- // })
- // }
+ //修改配件的信息
+ if(this.ticketInfo.wares && this.ticketInfo.wares.length>0){
+ this.ticketInfo.wares.map((item)=>{
+ //不校验项目金额、折扣、数量必填,但是为null的设置为0
+ if(!item.itemPrice){
+ item.itemPrice = 0
+ }
+ if(!item.itemCount){
+ item.itemCount = 0
+ }
+ if(!item.itemDiscount){
+ item.itemDiscount = 1
+ }
+ item.itemMoney = item.itemPrice*item.itemCount*item.itemDiscount
+ let itemObj = {
+ id:item.id,
+ ticketId:item.ticketId,
+ itemPrice:item.itemPrice,
+ itemCount:item.itemCount,
+ itemDiscount:item.itemDiscount,
+ itemMoney:item.itemMoney,
+ }
+ itemList.push(itemObj)
+ })
+ }
+
if(canSubmit){
//更新工单配件价格
request({
url: '/admin-api/repair/titem/updateRepairItem',
method: 'PUT',
- data:{"itemList":this.ticketInfo.projects,"delProjIdList":this.delProjId,"ticketId":this.ticketId}
+ data:{"itemList":itemList,"delProjIdList":this.delProjId,"ticketId":this.ticketId}
}).then((res) => {
if(res.code==200){
uni.showToast({
@@ -521,9 +547,18 @@ export default {
icon: 'none'
})
setTimeout(()=>{
- uni.navigateTo({
- url: '/pages-home/home/home'
- })
+ //判断角色
+ if(this.loginUser.roleCodes.includes('repair_warehouse')){
+ //仓管
+ uni.navigateTo({
+ url: '/pages-warehouse/home/home'
+ })
+ }else{
+ //其他
+ uni.navigateTo({
+ url: '/pages-home/home/home'
+ })
+ }
},700)
}else{
uni.showToast({
diff --git a/pages-warehouse/home/home.vue b/pages-warehouse/home/home.vue
index 59b26d9..1268639 100644
--- a/pages-warehouse/home/home.vue
+++ b/pages-warehouse/home/home.vue
@@ -51,7 +51,7 @@
-
+
{{ item.repairName }}{{ '配件申请单' }}
@@ -82,9 +82,13 @@
-
+
+
+
+
+
@@ -105,7 +109,7 @@ import {
getTenantId,
setJSONData
} from '@/utils/auth'
-import {getDictTextByCodeAndValue, formatDate, formatTimestamp} from "@/utils/utils";
+import {getDictTextByCodeAndValue, formatDate,builderOrder, formatTimestamp} from "@/utils/utils";
export default {
components: {
@@ -125,6 +129,9 @@ export default {
{
name: '待审核'
},
+ {
+ name: '进行中工单'
+ },
],
//配件单查询条件
queryParams: {
@@ -135,31 +142,24 @@ export default {
},
//配件单列表
ticketWares: [],
+ //工单列表
+ orderList:[],
//数量
total: 0,
//下拉刷新状态
isTriggered: false,
-
imgUrlPrex: config.baseImageUrl,
userInfo: {
avatar: undefined,
nickname: ''
},
isShow: true,
-
active: 0,
-
- bannerIndex: 0,
- shopList: [],
- bannerList: [],
- richTextHtml: null,
defaultAvatar: require('@/static/icons/avatar.png'),
//未读消息数量
noReadNum: 0,
//通知公告数量
noticeNum: 0,
- //是否首次打开页面
- ifFirstLogin:true,
}
},
onLoad() {
@@ -227,7 +227,12 @@ export default {
this.queryParams.pageNo = 1
this.total = 0
this.ticketWares = []
- this.getTicketWares()
+ this.orderList = []
+ if(this.active==3){
+ this.getOrderList()
+ }else{
+ this.getTicketWares()
+ }
},
/**
* 配件单查询
@@ -258,7 +263,54 @@ export default {
}
})
},
-
+ /**
+ * 查本人待处理工单
+ */
+ getOrderList(){
+ let paramsObj = {pageNo: this.queryParams.pageNo, pageSize: this.queryParams.pageSize ,ticketNo:this.queryParams.query}
+ request({
+ url: '/admin-api/repair/tickets/pageType',
+ method: 'get',
+ params:paramsObj
+ }).then((res) => {
+ console.log(res)
+ if (res.code == 200) {
+ let thisPageRecords = []
+ if(res.data && res.data.hasOwnProperty("records")){
+ for (let i = 0; i < res.data.records.length; i++) {
+ let order = res.data.records[i]
+ let viewOrder = builderOrder(order)
+ if(order.booking){
+ viewOrder['appointDate'] = formatTimestamp(order.createTime)
+ }
+ let projectList = []
+ if(order.itemList){
+ for (let j = 0; j < order.itemList.length; j++) {
+ let itemObj = order.itemList[j]
+ if("01"==itemObj.itemType){
+ projectList.push({
+ id:itemObj.id,
+ name:itemObj.itemName
+ })
+ }
+ }
+ }
+ viewOrder['projectList'] = projectList
+ thisPageRecords.push(viewOrder)
+ }
+ }
+ //判断 如果获取的数据的页码不是第一页,就让之前赋值获取过的数组数据 concat连接 刚获取的第n页数据
+ if (this.pageNo != 1) {
+ this.orderList = this.orderList.concat(thisPageRecords)
+ } else {
+ this.orderList = thisPageRecords
+ }
+ //将获取的总条数赋值
+ this.total = res.data.total
+ this.isTriggered = false
+ }
+ })
+ },
/**
* 上滑加载数据
@@ -272,7 +324,11 @@ export default {
//页码+1,调用获取数据的方法获取第二页数据
this.queryParams.pageNo++
//此处调用自己获取数据列表的方法
- this.getTicketWares()
+ if(this.active==3){
+ this.getOrderList()
+ }else{
+ this.getTicketWares()
+ }
},
/**
@@ -321,11 +377,6 @@ export default {
if (res.code == 200) {
this.noReadNum = res.data > 99 ? 99 : res.data
}
- if(this.ifFirstLogin && this.noReadNum>0){
- console.log("播放")
- this.$refs.tarBar.dianyidain()
- this.ifFirstLogin=false
- }
})
},
/**