Commit 38ba60f2 authored by Facius's avatar Facius

配件列表

parent 69044d8d
...@@ -182,7 +182,8 @@ let orderApiFun = function(vm){ ...@@ -182,7 +182,8 @@ let orderApiFun = function(vm){
let fileLabel = async (params = {}) => await vm.$u.get(prefix + 'config/' + vm.vuex_token + '/finish/file/lable/', params); let fileLabel = async (params = {}) => await vm.$u.get(prefix + 'config/' + vm.vuex_token + '/finish/file/lable/', params);
// 工单文件列表 // 工单文件列表
let fileList = async (params = {}) => await vm.$u.get(prefix + 'config/' + vm.vuex_token + '/finish/file', params); let fileList = async (params = {}) => await vm.$u.get(prefix + 'config/' + vm.vuex_token + '/finish/file', params);
// 订单配件列表
let applyList = async (params = {}) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/orders', params);
const orderApi = { const orderApi = {
listByRecommendOrder, listByRecommendOrder,
listOrderCount, listOrderCount,
...@@ -226,7 +227,8 @@ let orderApiFun = function(vm){ ...@@ -226,7 +227,8 @@ let orderApiFun = function(vm){
checkAddCustomer, checkAddCustomer,
fileLabel, fileLabel,
fileList, fileList,
completeNextStep completeNextStep,
applyList
} }
return orderApi return orderApi
} }
......
<template>
<!-- 已申请配件cell -->
<view class="applied-cell">
<view class="title-view">
<view v-for="(item, key) in labels" :key="key">
<text>{{item}}:</text>
<text>{{info[key]}}</text>
</view>
</view>
<view class="list-content">
<view v-for="(item, index) in info.items" :key="index">
<!-- <PartsCell @operate="handleOperate" :info="item"></PartsCell> -->
</view>
</view>
</view>
</template>
<script>
export default {
props: {
info: { // 申请材料列表
type: Object,
default() {
return {
status: 0, // -1 已驳回,-1 已取消,0 新申请,1 待审核,10 待发货,11 配货中,12 采购中,15 已发货,20 已签收,21 待返件,22 返件中,90 已转备件,100 已完成
}
}
}
},
data() {
return {
}
},
computed: {
texts() {
return {}
},
buttonText() {
return this.texts[this.info.status]
},
buttonStyle() {
return {
'height': '104rpx',
'width': '100%',
}
},
labels() {
return {
'id': '申请单号',
'statusText': '状态'
}
}
},
methods: {
handleOperate() {
this.$emit('operate', this.info)
}
}
}
</script>
<style lang="scss" scoped>
.applied-cell {
.title-view{
display: flex;
align-items: center;
justify-content: space-between;
}
.list-content {
}
}
</style>
<template> <template>
<!-- 申请列表 -->
<view> <u-popup v-model="show" mode="bottom" safe-area-inset-bottom width="690rpx" :mask-close-able="flase" close-icon-color="#FFFFFF" height="80%">
<!-- 申请列表 -->
</view> <view class="apply-list-view">
</template> <view class="colse-view">
<view class="right-view" @click.throttle="handleClose">
<script> <u-icon name="close"></u-icon>
</script> </view>
</view>
<style> <view class="list-content">
<view v-for="(item, index) in list" :key="index">
<AppliedCell @operate="handleOperate" :info="item"></AppliedCell>
</view>
</view>
<view class="bottom-view">
<u-button :custom-style="applyStyle" shape="circle" @click="handleApply" type="primary">申请配件</u-button>
</view>
</view>
</u-popup>
</template>
<script>
import AppliedCell from "@/components/parts/appliedPartsCell.vue"
export default {
components: {
AppliedCell
},
props: {
list: { // 申请材料列表
type: Array,
default () {
return []
}
},
show: {
type: Boolean,
default: false
}
},
data() {
return {
}
},
computed: {
applyStyle() {
return {
'height': '104rpx',
'width': '100%',
}
}
},
methods: {
handleClose() {
this.$emit('update:show', false)
},
handleOperate() {
this.$emit('operate')
},
handleApply() {
this.$emit('apply')
},
}
}
</script>
<style lang="scss" scoped>
.apply-list-view {
height: 100%;
display: flex;
flex-direction: column;
.colse-view {
height: 80rpx;
display: flex;
align-items: center;
justify-content: flex-end;
.right-view {
width: 80rpx;
height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
color: #FF0000;
}
}
.list-content {
height: 100%;
overflow: auto;
}
.bottom-view {
}
}
</style> </style>
<template> <template>
<view class="parts-view"> <view class="parts-view">
<u-navbar back-icon-color="#333333" background="#FFFFFF" title="配件申请" titleColor="#333333" <u-navbar back-icon-color="#333333" background="#FFFFFF" :title="title" titleColor="#333333"
:border-bottom="false" title-bold></u-navbar> :border-bottom="false" title-bold></u-navbar>
</view> </view>
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
}, },
types() { types() {
return { return {
'parts': 0, 'parts': 0, // 配件
'spare': 1 'spare': 1 // 备件
} }
} }
}, },
......
...@@ -62,18 +62,22 @@ ...@@ -62,18 +62,22 @@
</view> </view>
<!-- 不是从我的页面进来才显示 --> <!-- 不是从我的页面进来才显示 -->
<template v-if="!isOther"> <template v-if="!isOther">
<!-- 提示窗口 -->
<view> <view>
<u-toast ref="uToast" /> <u-toast ref="uToast" />
</view> </view>
<BottomButtons v-if="showBottomBtn" :buttons="buttons" @submit="handleSubmit"></BottomButtons> <BottomButtons v-if="showBottomBtn" :buttons="buttons" @submit="handleSubmit"></BottomButtons>
<!-- 拍照 -->
<take-photo type="test" v-if="takeStatus" @close="closeTake" :upload="false" :num="1"></take-photo> <take-photo type="test" v-if="takeStatus" @close="closeTake" :upload="false" :num="1"></take-photo>
<!-- <PopView title="查看交互规范" message="为完善交付质量,请查看对应的交付规范" :visible.sync="visible" @click="handleClick"/> --> <!-- 添加客服 -->
<u-popup border-radius="12" v-model="visible" safe-area-inset-bottom mode="center" width="690rpx" <u-popup border-radius="12" v-model="visible" safe-area-inset-bottom mode="center" width="690rpx"
:mask-close-able="false" close-icon-color="#FFFFFF"> :mask-close-able="false" close-icon-color="#FFFFFF">
<view class="order-pop-view"> <view class="order-pop-view">
<Customer type="pop" @click="handleDownload"></Customer> <Customer type="pop" @click="handleJoin"></Customer>
</view> </view>
</u-popup> </u-popup>
<!-- 已申请配件列表 -->
<ApplyList :show.sync="showApplyList" :list="partsList" @operate="handleOperate" @apply="handleApply"></ApplyList>
</template> </template>
</view> </view>
</template> </template>
...@@ -87,6 +91,7 @@ ...@@ -87,6 +91,7 @@
import Record from "@/components/order/performanceRecord.vue" import Record from "@/components/order/performanceRecord.vue"
import Detail from "@/components/order/detail.vue" import Detail from "@/components/order/detail.vue"
import BottomButtons from "@/components/order/bottomButtons.vue" import BottomButtons from "@/components/order/bottomButtons.vue"
import ApplyList from "@/components/parts/applyList.vue"
let now = new Date(new Date().toLocaleDateString()).getTime(); let now = new Date(new Date().toLocaleDateString()).getTime();
export default { export default {
components: { components: {
...@@ -96,7 +101,8 @@ ...@@ -96,7 +101,8 @@
Customer, Customer,
Record, Record,
Detail, Detail,
BottomButtons BottomButtons,
ApplyList
}, },
mixins: [baseFile], mixins: [baseFile],
data() { data() {
...@@ -156,6 +162,8 @@ ...@@ -156,6 +162,8 @@
timeout: false, timeout: false,
timestamp: 0, timestamp: 0,
showCountTime : false, // 从上个页面传入是否显示倒计时 showCountTime : false, // 从上个页面传入是否显示倒计时
showApplyList: false, // 显示已申请配件列表
partsList: [], // 已申请的配件列表
} }
}, },
computed: { computed: {
...@@ -623,14 +631,81 @@ ...@@ -623,14 +631,81 @@
break break
} }
}, },
handleApplyParts() { // 点击了配件申请按钮 async handleApplyParts() { // 点击了配件申请按钮
// 已经有配件 let res = await this.$u.api.applyList({
// 。。。 'pageSize': 1000,
// 没有配件 'pageNumbr': 1,
// 过程反馈 'status': -1, // -1 全部,0 新申请,15 待收件,30 待返件,31 返件中
uni.navigateTo({ 'workOrderId': this.order.orderId
url: 'pages/order/applyParts?orderId='+this.order.orderId
}) })
if(res && res.code == 200) {
this.partsList = res.data
var info = {
"id": -42709016.6594239,
"type": 88413470.94766659,
"orderNumber": "pariatur laborum ea ex esse",
"uid": -61461132.62552948,
"workerId": 70257764.93749124,
"siteId": 91073388.46493345,
"status": -78811049.71325992,
"totalPriceApply": -69669986.12053828,
"totalPriceOuter": -38559657.143752135,
"totalPriceWarranty": -9593647.922237426,
"totalPriceActual": 35845815.5364739,
"warehouseId": 43961846.7964488,
"applyRemark": "laborum",
"deliverRemark": "ipsum",
"createTime": "cillum in",
"updateTime": "quis anim Excepteur",
"items": [{
"id": 85963506.7881138,
"orderId": 76010853.55550486,
"name": "enim anim",
"partId": 83077645.73603413,
"status": 66648893.6392526,
"quantity": 56583424.78318676,
"priceApply": -64258092.910463735,
"priceActual": -99843111.0489868,
"returnType": 18577818.731817245,
"useCount": 88566288.29139715,
"createTime": "sit",
"updateTime": "voluptate magna",
"returnId": 80564978.93037826
}],
"images": "/rest/file/image/parts/invoice_1591333116039992.jpg,/rest/file/image/parts/invoice_1591333116048870.jpg",
"statusText": "待审核",
"productBarcode": "aliquip eiusmod",
"categoryName": "电冰箱",
"productId": -92130282.75386024,
"supplierId": -38136950.98157277,
"express": {
"orderId": -52586906.11654462,
"status": 30015312.066286445,
"name": "deserunt non pariatur",
"phoneNumber": "sint cupidatat culpa",
"areaCode": 80825529.78860953,
"address": "qui aliqua",
"createTime": "minim reprehenderit incididunt nostrud sunt",
"deliveryTime": "magna enim officia aliqua ut",
"updateTime": "exercitation aliqua mollit consequat ea",
"number": "fugiat amet dolore sint",
"com": "Ut cupidatat",
"remark": "Duis pariatur"
},
"measures": "est laboris aute",
"workOrderNumber": "OR20150327000003",
"productModel": "id sunt incididunt",
"workOrderId": 72686362.92537045,
"brandName": "长虹(CHANGHONG)"
}
console.log('-------data--------:', this.partsList, info)
this.partsList = [info]
}
if (this.partsList.length > 0) { // 已经有配件,弹出配件列表
this.showApplyList = true
} else { // 没有配件,跳到配件申请
this.toApplyParts()
}
}, },
handleBtn() { handleBtn() {
console.log('click button') console.log('click button')
...@@ -863,10 +938,21 @@ ...@@ -863,10 +938,21 @@
// url: 'pages/index/learn' // url: 'pages/index/learn'
// }) // })
// }, // },
handleDownload() { handleJoin() {
this.visible = false this.visible = false
// 添加客服 // 添加客服
}, },
handleOperate() { // 点了弹窗里的配件操作
},
handleApply() { // 点了弹窗的申请配件
this.toApplyParts()
},
toApplyParts() {
uni.navigateTo({
url: 'pages/order/applyParts?orderId='+this.order.orderId
})
}
} }
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment