This commit is contained in:
PQZ 2024-10-22 18:32:35 +08:00
commit cd830ea98d
11 changed files with 436 additions and 72 deletions

View File

@ -1,21 +1,20 @@
<template>
<view class="orderCard">
<view class="orderCard" @click="viewDetail">
<view class="title">
{{ order.carNo }} 的配件申请
{{ order.licenseNumber }} 的配件申请
</view>
<view class="desc">
申请时间{{order.createTime}}
申请时间{{formatTimestamp(order.createTime)}}
</view>
<view class="message red">
<view class="remark">
<view class="message red" v-if="order.status=='05'">
<view class="remark">
原因{{ order.remark }}
</view>
</view>
<image class="stateImg" src="@/static/images/nothing.png" ></image>
<image v-if="order.status=='05'" class="stateImg" src="@/pages-repair/static/weitongguo.png" ></image>
<image v-if="order.status=='01'" class="stateImg" src="@/pages-repair/static/daishenhe.png" ></image>
<image v-if="order.status=='02'" class="stateImg" src="@/pages-repair/static/yitongguo.png" ></image>
</view>
</view>
</template>
<script>
@ -23,6 +22,7 @@ import {
getUserInfo,
getStrData
} from '@/utils/auth';
import {formatTimestamp,getOrderStatusText,builderOrder,saveTicketsRecords} from "@/utils/utils";
import request from '@/utils/request';
export default {
name: "orderCard",
@ -57,6 +57,9 @@ export default {
},
methods: {
formatTimestamp(value){
return formatTimestamp(value)
},
getFlagColor(flag) {
if (flag == 1) {
return '#E8A321'
@ -64,6 +67,9 @@ export default {
return '#999'
}
},
viewDetail(){
this.$emit("childEvent",this.order)
}
}
}
</script>
@ -103,7 +109,7 @@ export default {
font-size: 30rpx;
color: #333333;
margin-left: 5px;
}
}
.desc{
font-size: 28rpx;
color: #858BA0

View File

@ -148,7 +148,12 @@ export default {
}).then(res => {
this.list = res.data.records
this.list.map((item) => {
item.workTypeText = getDictTextByCodeAndValue('repair_work_type', item.workType)
getDictTextByCodeAndValue("repair_work_type",item.workType).then(value => {
item.workTypeText = value
}).catch(error => {
item.workTypeText = "未知"
console.error(error);
});
})
})
},
@ -163,7 +168,12 @@ export default {
}).then((res) => {
this.list = res.data
this.list.map((item) => {
item.workTypeText = getDictTextByCodeAndValue('repair_work_type', item.workType)
getDictTextByCodeAndValue("repair_work_type",item.workType).then(value => {
item.workTypeText = value
}).catch(error => {
item.workTypeText = "未知"
console.error(error);
});
})
if (this.list.length > 0) {
console.log(this.list[0].userId)

View File

@ -185,7 +185,7 @@
<view class="projBaseInfo">
<view>售价{{ item.itemPrice || "" }}</view>
<view>数量{{ item.itemCount || "" }}</view>
<view>单位{{ getItemUnit(item.itemUnit) || ""}}</view>
<view>单位{{ item.itemUnit || ""}}</view>
<view>折扣{{ item.itemDiscount || "" }}</view>
<view>金额{{ item.itemMoney || "" }}</view>
</view>
@ -633,10 +633,26 @@ export default {
//
if (null != resultObj.records){
resultObj.records.map((item)=>{
item.typeStr = getDictTextByCodeAndValue('repair_records_type',item.type)
getDictTextByCodeAndValue("repair_records_type",item.type).then(value => {
item.typeStr = value
}).catch(error => {
item.typeStr = "未知"
console.error(error);
});
item.createTime = formatTimestamp(item.createTime)
})
}
//
if (null != resultObj.wares){
resultObj.wares.map((item)=>{
getDictTextByCodeAndValue("repair_unit",item.itemUnit).then(value => {
item.itemUnit = value
}).catch(error => {
item.itemUnit = "未知"
console.error(error);
});
})
}
this.ticketInfo = resultObj
//
this.checkRoleOperate()
@ -697,10 +713,6 @@ export default {
// url: `/pages-order/choosePeople/choosePeople?type=${type}&id=${this.ticketId}`
})
},
//
getItemUnit(unitCode){
return getDictTextByCodeAndValue("repair_unit",unitCode);
},
/**
* 点击配件申请单提醒查看相关配件
* @param wareId

View File

@ -20,7 +20,7 @@
<view class="repairName">{{ item.name }}</view>
<view class="repairBottom">
<text class="repairDesc">单位
<text class="repairUnit">{{ getItemUnit(item.unit) }}</text>
<text class="repairUnit">{{ item.unit }}</text>
</text>
<view class="repairBtns">
<u-icon name="minus-circle-fill" size="24" @click="delNum(item)"></u-icon>
@ -175,6 +175,13 @@ export default {
}else{
m.num = 0
}
//
getDictTextByCodeAndValue("repair_unit",m.unit).then(value => {
m.unit = value
}).catch(error => {
m.unit = "未知"
console.error(error);
});
return m
})
// concat n
@ -269,10 +276,6 @@ export default {
this.activeId = value
this.onRefresherrefresh()
},
//
getItemUnit(unitCode){
return getDictTextByCodeAndValue("repair_unit",unitCode);
},
}
}
</script>

View File

@ -12,7 +12,7 @@
<view class="orderList">
<scroll-view scroll-y="true" style="height: 100%" class="itemContent" @scrolltolower="onReachBottomCus"
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
<order-card v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="onRefresherrefresh" @startWork="startWork"></order-card>
<order-card v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="viewDetail" ></order-card>
<view style="text-align: center" v-if="orderList.length==0">
<image class="" src="@/static/images/nothing.png" ></image>
</view>
@ -27,6 +27,7 @@
import tabBarVue from '@/components/tabBar/tabBar.vue'
import OrderCard from "@/components/applyCard.vue";
import request from '@/utils/request';
import {getUserInfo} from '@/utils/auth';
export default {
components: {
OrderCard,
@ -52,39 +53,60 @@
},
{
id: 2,
title: '已通过'
title: '待领料'
},
{
id: 3,
title: '待退料'
},
],
orderList: [
{
carNo: "川E795C0",
createTime: '2024-10-20 12:00',
ticketsStatus: '05',
remark: '大厦预订奴化时间内丢进爱上牛津阿斯顿你'
},
{
carNo: "川E795C1",
createTime: '2024-10-20 12:00',
ticketsStatus: '02',
remark: '大厦预订奴化时间内丢进爱上牛津阿斯顿你'
},
{
carNo: "川E795C2",
createTime: '2024-10-20 12:00',
ticketsStatus: '01',
remark: '大厦预订奴化时间内丢进爱上牛津阿斯顿你'
}
// {
// carNo: "E795C0",
// createTime: '2024-10-20 12:00',
// ticketsStatus: '05',
// remark: ''
// },
// {
// carNo: "E795C1",
// createTime: '2024-10-20 12:00',
// ticketsStatus: '02',
// remark: ''
// },
// {
// carNo: "E795C2",
// createTime: '2024-10-20 12:00',
// ticketsStatus: '01',
// remark: ''
// }
],
userInfo:null,
};
},
onLoad(){
this.userInfo = getUserInfo()
console.log(this.userInfo)
this.getOrderList()
},
methods:{
changeTabFun(id) {
this.activeKey = id
this.onRefresherrefresh()
},
/**
* 上滑加载数据
*/
onReachBottomCus() {
// *
if (this.pageNo * this.pageSize >= this.total) {
uni.$u.toast('没有更多数据了')
return
}
//+1,
this.pageNo++
//
this.getOrderList()
},
/**
* 下拉刷新数据
*/
@ -92,11 +114,74 @@
this.isTriggered = true
this.pageNo = 1
this.total = 0
//this.orderList = []
this.orderList = []
this.getOrderList()
},
/**
* 查看申请单详情
*/
viewDetail(item){
if(0==this.activeKey || 1==this.activeKey){
//
uni.navigateTo({
url: '/pages-repair/applyList/todoDetail?viewType=apply&id='+item.id
})
}else{
//\退
uni.navigateTo({
url: '/pages-repair/applyList/todoDetail?viewType=receive&id='+item.id
})
}
},
/**
* 查数据
*/
getOrderList(){
let url=""
let params = {
pageNo:this.pageNo,
pageSize:this.pageSize
}
if(0==this.activeKey){
//
url = "/admin-api/repair/tw/page"
params.type="01"
}else if(1==this.activeKey){
//
url = "/admin-api/repair/tw/page"
params.type="01"
params.status="05"
}else if(2==this.activeKey){
//
url = "/admin-api/repair/so/page"
params.soType = "02"
params.userId = this.userInfo.id
params.soStatus = "04"
}else if(3==this.activeKey){
//退
url = "/admin-api/repair/so/page"
params.soType = "04"
params.userId = this.userInfo.id
params.soStatus = "07"
}
request({
url: url,
method: 'get',
params:params
}).then((res) => {
if (res.code == 200) {
if(res.data.records.length > 0){
if (this.pageNo != 1) {
this.orderList = this.orderList.concat(res.data.records)
} else {
this.orderList = res.data.records
}
}
//
this.total = res.data.total
this.isTriggered = false
}
})
}
}
}

View File

@ -0,0 +1,246 @@
<template>
<view class="container">
<VNavigationBar background-color="#fff" title="申请单详情" title-color="#333"></VNavigationBar>
<view class="body">
<view class="repairInfo">
<view class="header">
部件信息
</view>
<view class="repairItem" v-for="(item, index) in repairList" :key="index">
<view class="repairName">{{ item.waresName }} <text class="repairNum">×{{item.waresCount}}</text></view>
<view class="grid">
<view style="grid-area: a" class="girdItem">
<text class="label">配件分类</text>
<text class="value">{{ item.typeName }}</text>
</view>
<view style="grid-area: b" class="girdItem">
<text class="label">当前库存</text>
<text class="value">{{ item.wares.stock }}</text>
</view>
<view style="grid-area: c" class="girdItem">
<text class="label">单位</text>
<text class="value">{{ item.wares.unit }}</text>
</view>
<view style="grid-area: d" class="girdItem">
<text class="label">编码</text>
<text class="value">{{ item.wares.code || ""}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import VNavigationBar from "@/components/VNavigationBar.vue";
import request from '@/utils/request';
import {getDictTextByCodeAndValue} from "@/utils/utils";
export default {
components: {
VNavigationBar
},
data() {
return {
viewType:"",
id:"",
repairList: [
// {
// name: '7',
// num: 3,
// type: '',
// unit: '',
// total: 35,
// code: 'XCQHCJYS7 SPI SP 5W30 4L'
// },
// {
// name: '7',
// num: 3,
// type: '',
// unit: '',
// total: 35,
// code: 'XCQHCJYS7 SPI SP 5W30 4L'
// }
]
};
},
onLoad(data){
this.viewType = data.viewType
this.id = data.id
this.getDetail()
},
methods:{
getDetail(){
let url;
let params={};
if("apply"==this.viewType){
//
url = "/admin-api/repair/twi/list"
params.twId = this.id
}else{
//退
}
request({
url: url,
method: 'get',
params:params
}).then((res) => {
if (res.code == 200 && res.data.length>0) {
this.repairList = res.data
this.repairList.map((item)=>{
getDictTextByCodeAndValue("repair_unit",item.wares.unit).then(value => {
item.wares.unit = value
}).catch(error => {
item.wares.unit = "未知"
console.error(error);
});
})
}
})
},
}
}
</script>
<style lang="less" scoped>
.container {
height: 100%;
background: #F3F5F7;
display: flex;
flex-direction: column;
}
.body {
flex: 1;
height: 0;
overflow: auto;
.todoInfo {
margin: 20rpx 32rpx;
background-color: #fff;
border-radius: 8rpx 8rpx 8rpx 8rpx;
padding: 30rpx;
.todoName {
font-weight: bold;
font-size: 32rpx;
color: #333333;
margin-bottom: 16rpx;
}
.todoDate {
font-size: 24rpx;
color: #858BA0;
margin-bottom: 30rpx;
}
.line {
height: 1rpx;
background-color: #DDDDDD;
margin: 30rpx 0;
}
.grid {
display: grid;
grid-template-areas:
'a b'
'c c';
gap: 20rpx;
.gridItem {
display: flex;
flex-direction: column;
row-gap: 10rpx;
font-size: 28rpx;
.gridItemLabel {
color: #858BA0;
}
.gridItemValue {
color: #333333;
}
}
}
}
.repairInfo {
margin: 20rpx 32rpx;
background-color: #fff;
border-radius: 8rpx 8rpx 8rpx 8rpx;
.header {
padding: 30rpx;
border-bottom: 1rpx solid #DDDDDD;
}
.repairItem {
padding: 30rpx;
border-bottom: 1rpx solid #DDDDDD;
&:last-child {
border-bottom: none;
}
}
.repairName {
display: flex;
align-items: center;
column-gap: 20rpx;
font-size: 32rpx;
color: #333333;
margin-bottom: 30rpx;
.repairNum {
font-size: 28rpx;
color: #0174F6;
}
}
.grid {
display: grid;
grid-template-areas:
'a b'
'c d';
grid-template-columns: 1fr 1fr;
gap: 30rpx;
.girdItem {
display: flex;
flex-direction: column;
row-gap: 12rpx;
font-size: 28rpx;
.label {
color: #858BA0;
}
.value {
color: #333333;
}
}
}
}
}
.footer {
background-color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx 32rpx;
.yes, .no {
width: 310rpx;
height: 76rpx;
border-radius: 38rpx 38rpx 38rpx 38rpx;
display: flex;
align-items: center;
justify-content: center;
column-gap: 10rpx;
}
.yes {
background: #0174F6;
color: #FFFFFF;
}
.no {
border: 2rpx solid #858BA0;
color: #858BA0;
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -152,6 +152,13 @@
{
"navigationBarTitleText" : ""
}
},
{
"path" : "applyList/todoDetail",
"style" :
{
"navigationBarTitleText" : ""
}
}
]
},
@ -161,22 +168,19 @@
{
"path": "home/home",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": true
"navigationBarTitleText": ""
}
},
{
"path": "inOutWarehouse/inOutWarehouse",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
"navigationBarTitleText": ""
}
},
{
"path": "todoDetail/todoDetail",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": true
"navigationBarTitleText": ""
}
}
]

View File

@ -126,31 +126,29 @@ export function saveTicketsRecords(id,ticketsWorkStatus,itemId,itemStatus,record
* 翻译字典
* @param dictCode
*/
export function getDictTextByCodeAndValue(dictCode,value){
export async function getDictTextByCodeAndValue(dictCode, value) {
let dictArray = getStorageWithExpiry(dictCode);
if(null==dictArray || undefined==dictArray){
request({
if (null == dictArray || undefined == dictArray) {
let res = await request({
url: '/admin-api/system/dict-data/type',
method: 'get',
params:{type:dictCode}
}).then((res) => {
console.log(res)
if (res.code == 200) {
setStorageWithExpiry(dictCode,res.data,3600)
dictArray = res.data
let dictObj = dictArray.find(item=>item.value==value)
if(dictObj){
return dictObj.label
}else{
return "未知数据"
}
}
params: {type: dictCode}
})
}else{
let dictObj = dictArray.find(item=>item.value==value)
if(dictObj){
if (res.code == 200) {
setStorageWithExpiry(dictCode, res.data, 3600)
dictArray = res.data
let dictObj = dictArray.find(item => item.value == value)
if (dictObj) {
return dictObj.label
} else {
return "未知数据"
}
}
} else {
let dictObj = dictArray.find(item => item.value == value)
if (dictObj) {
return dictObj.label
}else{
} else {
return "未知数据"
}
}