Commit b7091b1c authored by Damon's avatar Damon

build: merge dev-1.5.0

parents ee1d935a 54dd796e
......@@ -11,6 +11,6 @@ const UNI_APP = {
qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
qn_asset_url: 'http://deudn.c.pp.cc/',
argoDebugMode: 1,
version: 'v1.4.9'
version: 'v1.5.0'
}
module.exports = UNI_APP;
;(function() {
let NODE_ENV = 'prod' // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null
let VERSION_NUMBER = '1.4.9' //版本号
let VERSION_NUMBER = '1.5.0' //版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
if (process.env.NODE_ENV === 'development') {
if (NODE_ENV === 'dev') {
......
......@@ -10,7 +10,7 @@ const UNI_APP = {
qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
qn_asset_url: 'https://qn-static.banshouhui.com',
argoDebugMode: 0,
version: 'v1.4.9'
version: 'v1.5.0'
}
module.exports = UNI_APP;
......@@ -11,6 +11,6 @@ const UNI_APP = {
qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
qn_asset_url: 'https://qn-static.banshouhui.com',
argoDebugMode: 1,
version: 'v1.4.9'
version: 'v1.5.0'
}
module.exports = UNI_APP;
......@@ -188,7 +188,7 @@ let orderApiFun = function(vm){
let applyList = async (params = {}) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/orders', params);
// 返件列表
let returnedParts = async (params = {}) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/return', params);
// 备件仓列表
// 物料仓列表
let reserveList = async (params = {}) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/items/reserve', params);
// 配件物流
let getLogistics = async (orderId) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/orders/'+ orderId +'/express',{}, formType);
......
......@@ -19,22 +19,30 @@ let partsApiFun = function (vm) {
* 配件过滤-品类列表
*/
let getCategoryList = async () => await vm.$u.get(base + vm.vuex_token + '/allow/category/list');
/**
* 配件过滤-一级分类
*/
let getClassify = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/type/classify/' + params.id);
/**
* 配件过滤-品牌列表
*/
let getBrandList = async (params = {}) => await vm.$u.get(base + vm.vuex_token + '/allow/brand/list', params);
let getBrandList = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/type/towLevel/' + params.categoryId + '/' + params.classifyId);
/**
* 配件过滤-三级分类列表
*/
let getThreeLevel = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/type/threeLevel/' + params.categoryId + '/' + params.classifyId + '?partnerCompanyId = ' + params.partnerCompanyId + '&speciesId=' + params.speciesId);
/**
* 查询配件列表
*/
let getPartsList = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/parts/v2', params);
/**
* 配件申请单-创建申请单/使用备件
* 配件申请单-创建申请单/使用物料
*/
let applyParts = async (params = {}) => await vm.$u.post(parts + vm.vuex_token + '/orders', params, dataType)
let createParts = async (params = {}) => await vm.$u.post(parts + vm.vuex_token + '/orders/create', params, formType)
/**
* 查询自己的备件仓
* 查询自己的物料仓
*/
let getMyReserve = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/items/reserve', params);
/**
......@@ -42,7 +50,7 @@ let partsApiFun = function (vm) {
*/
let getWorkOrderParts = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/items/workOrder/' + params.workOrderId);
/**
* 返件-备件/新件
* 返件-物料/新件
*/
let returnParts = async (params = {}) => await vm.$u.post(parts + vm.vuex_token + '/return/new', params, formType);
......@@ -50,7 +58,9 @@ let partsApiFun = function (vm) {
getSiteAddress,
updateAddress,
getCategoryList,
getClassify,
getBrandList,
getThreeLevel,
getPartsList,
applyParts,
getMyReserve,
......
......@@ -35,6 +35,21 @@ let settledApiFun = function(vm){
let syncAddress = async (params = {}) => await vm.$u.post(ucenterApiUrl+'/v1/settled/sync-address', params);
//我的合同//
let Mycontract = async (params)=>await vm.$u.get(ucenterApiUrl+'/v1/settled-contract/info'+'?Authorization='+ vm.vuex_token + params)
// 我的地址-获取所有地址
let getMyAddress = async (params = {}) => await vm.$u.get(ucenterApiUrl+`/wxh-worker-rest/rest/myAddress/${vm.vuex_token}/list`, params)
// 我的地址-新增保存
let saveMyAddress = async (params = {}) => await vm.$u.post(ucenterApiUrl+`/wxh-worker-rest/rest/myAddress/${vm.vuex_token}/save`, params)
// 我的地址-删除地址
let deleteMyAddress = async (params = {}) => await vm.$u.delete(ucenterApiUrl+`/wxh-worker-rest/rest/myAddress/${vm.vuex_token}/${params.id}`)
// 我的地址-获取默认
let getDefaultAddress = async (params = {}) => await vm.$u.get(ucenterApiUrl+`/wxh-worker-rest/rest/myAddress/${vm.vuex_token}/default`, params)
// 我的地址-设置默认
let setDefaultAddress = async (params = {}) => await vm.$u.put(ucenterApiUrl+`/wxh-worker-rest/rest/myAddress/${vm.vuex_token}/default/${params.id}`)
const settledApi = {
getSettleBaseInfo,
......@@ -53,6 +68,11 @@ let settledApiFun = function(vm){
listByNotice,
syncAddress,
Mycontract,
getMyAddress,
saveMyAddress,
deleteMyAddress,
getDefaultAddress,
setDefaultAddress
}
return settledApi
}
......
<!-- ******************* 配件选择 ******************* -->
<!-- ******************* 物料选择 ******************* -->
<template>
<view>
<view>
<view class="list u-flex u-row-between">
<image class="item-image" :src="mixingImage" v-if="item.required"></image>
<view class="u-m-r-20">{{item.fieldsTitle}}</view>
<view class="u-flex-1 add-parts" @click="toParts" v-if="!disabled && lists.length > 0">
添加备件<u-icon name="arrow-right" color="#2979ff" size="30"></u-icon>
</view>
</view>
<image class="item-image" :src="mixingImage" v-if="item.required"></image>
<view class="u-m-r-20">{{ item.fieldsTitle }}</view>
<view
class="u-flex-1 add-parts"
@click="toParts"
v-if="!disabled && lists.length > 0"
>
添加物料<u-icon name="arrow-right" color="#2979ff" size="30"></u-icon>
</view>
</view>
<view class="complete-part">
<view v-if="lists.length > 0">
<adjust-parts v-for="(item, index) in lists" :key="index" :info="item" @change="partsChange($event, index)" :disabled="disabled"></adjust-parts>
<adjust-parts
v-for="(item, index) in lists"
:key="index"
:info="item"
@change="partsChange($event, index)"
@minusValue="minusValue($event, index)"
:disabled="disabled"
></adjust-parts>
</view>
<view class="u-flex select-part" v-else>
<view class="u-flex select-part" v-else>
<view class="img">
<image :src="noPartsImage" class="part-icon" />
</view>
<view class="u-flex content">
<text class="title">暂无备件信息</text>
<text class="desc">可选择备件仓备件</text>
<text class="title">暂无物料信息</text>
<text class="desc">可选择物料仓物料</text>
</view>
<view class="btn">
<u-button shape="circle" :custom-style="customStyle" @click="toParts">
......@@ -27,141 +38,152 @@
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import adjustParts from "@/components/select-parts/adjust"
import stringMixin from './stringMixin'
export default {
name: 'XhParts',
components: {
adjustParts
import adjustParts from '@/components/select-parts/adjust'
import stringMixin from './stringMixin'
export default {
name: 'XhParts',
components: {
adjustParts,
},
mixins: [stringMixin],
props: {
orderId: {
type: String,
default: '',
},
mixins: [stringMixin],
props: {
orderId: {
type: String,
default: ''
},
categoryId: {
type: String,
default: ''
},
brandId: {
type: String,
default: ''
}
},
data() {
return {
lists: []
}
},
computed: {
customStyle() {
return {
'width': '200rpx',
'height': '80rpx',
'color': '#2272FF',
'font-size': '32rpx',
}
},
mixingImage() {
return process.uniEnv.qn_base_url + 'mixing.png'
},
noPartsImage() {
return process.uniEnv.qn_base_url + 'no_parts.png'
},
selectedParts() {
return this.lists.filter((item) => {
return item.quantity > 0
})
}
categoryId: {
type: String,
default: '',
},
mounted() {
this.getWorkOrderParts()
brandId: {
type: String,
default: '',
},
methods: {
getWorkOrderParts() {
// this.lists = JSON.parse(this.dataValue) || []
this.lists = this.dataValue ? JSON.parse(this.dataValue) : []
},
partsChange(val, index) {
this.$set(this.lists[index], 'quantity', val)
this.valueChange(JSON.stringify(this.selectedParts))
},
valChange(val) {
val.forEach(v => {
const index = this.lists.findIndex(k => k.part_id === v.part_id)
if (index < 0) {
this.lists.push(v)
} else {
this.$set(this.lists, index, v)
}
})
this.valueChange(JSON.stringify(this.selectedParts))
},
toParts() {
uni.navigateTo({
url: `/pages/order/parts?workOrderId=${this.orderId}&brandId=${this.brandId}&categoryId=${this.categoryId}`
})
},
data() {
return {
lists: [],
}
},
computed: {
customStyle() {
return {
width: '200rpx',
height: '80rpx',
color: '#2272FF',
'font-size': '32rpx',
}
}
}
},
mixingImage() {
return process.uniEnv.qn_base_url + 'mixing.png'
},
noPartsImage() {
return process.uniEnv.qn_base_url + 'no_parts.png'
}
},
mounted() {
this.getWorkOrderParts()
},
methods: {
getWorkOrderParts() {
// this.lists = JSON.parse(this.dataValue) || []
console.log("this.dataValue", this.dataValue)
this.lists = this.dataValue ? JSON.parse(this.dataValue) : []
},
partsChange(val, index) {
this.$set(this.lists[index], 'quantity', val)
this.valueChange(JSON.stringify(this.lists))
},
minusValue(val, index) {
if (val === 0) {
uni.showModal({
title: '温馨提示',
content: '确定要删除该物料?',
success: (res) => {
if (res.confirm) {
this.lists.splice(index, 1)
} else if (res.cancel) {
this.partsChange(1, index)
}
},
})
}
},
valChange(val) {
val.forEach((v) => {
const index = this.lists.findIndex((k) => k.part_id === v.part_id)
if (index < 0) {
this.lists.push(v)
} else {
this.$set(this.lists, index, v)
}
})
this.valueChange(this.lists)
},
toParts() {
uni.navigateTo({
url: `/pages/order/parts?workOrderId=${this.orderId}&brandId=${this.brandId}&categoryId=${this.categoryId}`,
})
},
},
}
</script>
<style lang="scss" scoped>
.item-image {
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
.required {
padding-right: 10rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #fa3534;
}
.add-parts {
color: #2272FF;
text-align: right;
}
.complete-part {
.select-part {
.item-image {
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
.required {
padding-right: 10rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #fa3534;
}
.add-parts {
color: #2272ff;
text-align: right;
}
.complete-part {
.select-part {
align-items: center;
height: 240rpx;
.img {
display: flex;
align-items: center;
height: 240rpx;
.img {
display: flex;
align-items: center;
margin-right: 30rpx;
.part-icon {
width: 110rpx;
height: 110rpx;
border-radius: 50%;
}
margin-right: 30rpx;
.part-icon {
width: 110rpx;
height: 110rpx;
border-radius: 50%;
}
.content {
padding-right: 8px;
flex: 1;
color: #3b4144;
flex-direction: column;
justify-content: space-between;
overflow: hidden;
.title {
text-align: left;
color: #2272FF;
font-size: 38rpx;
font-weight: bold;
margin-right: auto;
}
.desc {
text-align: left;
color: #999;
font-size: 26rpx;
margin-right: auto;
}
}
.content {
padding-right: 8px;
flex: 1;
color: #3b4144;
flex-direction: column;
justify-content: space-between;
overflow: hidden;
.title {
text-align: left;
color: #2272ff;
font-size: 38rpx;
font-weight: bold;
margin-right: auto;
}
.desc {
text-align: left;
color: #999;
font-size: 26rpx;
margin-right: auto;
}
}
}
}
</style>
......@@ -8,74 +8,74 @@
<image :src="baseImageUrl + item.image" class="image-content"></image>
</view>
<view :class="['text-content', item.type]">{{item.label}}</view>
</u-button>
<view v-if="item.count && item.count > 0" class="bradge-vidw">{{item.count}}</view>
</u-button>
<view v-if="item.count && item.count > 0" class="bradge-vidw">{{item.count}}</view>
</view>
</view>
</template>
<script>
export default {
props: {
// label: 按钮文字,
// type: 'text'普通按钮;'image'图文按钮
// image: type='image'的时候,按钮图片
// show: 是否显示,
// disabled: 是否禁用,true禁用;false 可以点击
props: {
// label: 按钮文字,
// type: 'text'普通按钮;'image'图文按钮
// image: type='image'的时候,按钮图片
// show: 是否显示,
// disabled: 是否禁用,true禁用;false 可以点击
// customStyle: 自定义button样式
buttons: {
type: Array,
default () {
// id: 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照; 4 配件申请
// label: 按钮文字,
// type: 'image' 上图片下文字;'text' 纯文字,
// image: 图片名,
// show: 是否显示,
// disabled: 是 禁用;否 正常,
// id: 区分各个按钮
return [{
label: '过程反馈',
type: 'image',
image: 'guochengfankui.png',
show: false,
disabled: false,
id: 1
},
{
label: '异常签到',
type: 'image',
image: 'yichangqiandao.png',
show: false, // 待签到显示
disabled: false,
id: 2
},
{
label: '现场拍照',
type: 'image',
image: 'xiancahngpaizhao.png',
show: false,
disabled: false,
id: 3
},
{
label: '备件申请',
type: 'image',
image: 'peijian.png',
show: false,
disabled: false,
count: 0,
id: 4
},
{
label: '去接单',
type: 'text',
image: '',
show: true,
disabled: false,
id: 0,
customStyle: {
'background-color': '#D1D4D4'
}
// id: 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照; 4 物料申请
// label: 按钮文字,
// type: 'image' 上图片下文字;'text' 纯文字,
// image: 图片名,
// show: 是否显示,
// disabled: 是 禁用;否 正常,
// id: 区分各个按钮
return [{
label: '过程反馈',
type: 'image',
image: 'guochengfankui.png',
show: false,
disabled: false,
id: 1
},
{
label: '异常签到',
type: 'image',
image: 'yichangqiandao.png',
show: false, // 待签到显示
disabled: false,
id: 2
},
{
label: '现场拍照',
type: 'image',
image: 'xiancahngpaizhao.png',
show: false,
disabled: false,
id: 3
},
{
label: '物料申请',
type: 'image',
image: 'peijian.png',
show: false,
disabled: false,
count: 0,
id: 4
},
{
label: '去接单',
type: 'text',
image: '',
show: true,
disabled: false,
id: 0,
customStyle: {
'background-color': '#D1D4D4'
}
}]
}
}
......@@ -106,7 +106,7 @@
'display': 'flex',
'flex-direction': 'column',
'height': '104rpx',
'width': '100%',
'width': '100%',
},
'disabled': {
......@@ -121,7 +121,7 @@
}
},
},
methods: {
methods: {
// 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照
handleClick(item) {
if (item.disabled) return
......@@ -140,13 +140,13 @@
.button-view {
max-width: 600rpx;
display: flex;
display: flex;
position: relative;
&.image {}
&.text {
width: 100%;
display: flex;
width: 100%;
display: flex;
justify-content: flex-end;
}
......@@ -154,17 +154,17 @@
display: flex;
flex-direction: column;
width: 100%;
&.image {
margin-right: 22rpx;
&.image {
margin-right: 22rpx;
}
&.text {
width: 360rpx;
margin-left: 18rpx;
&.one {
width: 600rpx;
margin-left: 0rpx;
}
&.text {
width: 360rpx;
margin-left: 18rpx;
&.one {
width: 600rpx;
margin-left: 0rpx;
}
}
.image-view {
flex-shrink: 0;
......@@ -195,21 +195,21 @@
}
}
}
.bradge-vidw {
height: 24rpx;
border-radius: 12rpx;
background-color: #FFFFFF;
position: absolute;
top: -10rpx;
right: 4rpx;
border: 2rpx solid #FA5A49;
color: #FA5A49;
font-size: 16rpx;
line-height: 24rpx;
text-align: center;
min-width: 36rpx;
z-index: 1;
}
}
.bradge-vidw {
height: 24rpx;
border-radius: 12rpx;
background-color: #FFFFFF;
position: absolute;
top: -10rpx;
right: 4rpx;
border: 2rpx solid #FA5A49;
color: #FA5A49;
font-size: 16rpx;
line-height: 24rpx;
text-align: center;
min-width: 36rpx;
z-index: 1;
}
}
}
</style>
</style>
......@@ -40,9 +40,14 @@
<view class="reason-view" v-if="showReason">
<view class="reason-title"><text>未通过原因:</text></view>
<view class="reason-text"
><text v-for="(item, index) in orderData.auditResults" :key="index">{{
>
<text v-for="(item, index) in orderData.partAuditResults" :key="index">{{
item
}}</text></view
}}</text>
<text v-for="(item, index) in orderData.auditResults" :key="index">{{
item
}}</text>
</view
>
</view>
<view class="bottom-view">
......
<template>
<!-- 已申请配件cell -->
<!-- 已申请物料cell -->
<view class="return-cell" @click="handleClick">
<view class="title-view">
<text class="title-text" :style="{'color': titleColor}">{{title}}</text>
......
<template>
<!-- 申请配件按钮 -->
<!-- 申请物料按钮 -->
<view class="apply-button">
<u-button :custom-style="customStyle" shape="circle" @click.stop="handleClick" type="primary">
<u-icon class="apply-icon" name="plus"></u-icon>
<text class="apply-text" v-if="showText">申请备件</text>
<text class="apply-text" v-if="showText">申请物料</text>
</u-button>
</view>
</template>
......@@ -32,11 +32,11 @@
'width': this.typeWidth[this.type],
}
}
},
created() {
setTimeout(()=> {
this.$emit('update:type', 'collapse')
}, 3000)
},
created() {
setTimeout(()=> {
this.$emit('update:type', 'collapse')
}, 3000)
},
methods: {
handleClick() {
......@@ -48,12 +48,12 @@
<style lang="scss" scoped>
.apply-button {
.apply-icon {
font-size: 36rpx;
.apply-icon {
font-size: 36rpx;
}
.apply-text {
font-size: 32rpx;
font-size: 32rpx;
padding-left: 10rpx;
}
}
</style>
</style>
......@@ -5,21 +5,21 @@
<!-- 申请列表 -->
<view class="apply-list-view">
<view class="content-view">
<view class="list-content">
<swiper class="swiper" :indicator-dots="true" style="height: 100%;" :current="currentIndex">
<swiper-item v-for="(item, index) in list" :key="index">
<view class="cell-view">
<view class="shadow-view">
<AppliedCell @operate="handleOperate" @express="handleClickExpress" @action="handleClickCell" :info="item" :type="vertical" class="applied-cell"></AppliedCell>
</view>
</view>
</swiper-item>
<view class="list-content">
<swiper class="swiper" :indicator-dots="true" style="height: 100%;" :current="currentIndex">
<swiper-item v-for="(item, index) in list" :key="index">
<view class="cell-view">
<view class="shadow-view">
<AppliedCell @operate="handleOperate" @express="handleClickExpress" @action="handleClickCell" :info="item" :type="vertical" class="applied-cell"></AppliedCell>
</view>
</view>
</swiper-item>
</swiper>
</view>
<view class="bottom-view">
<view class="bottom-warehouse">
<view class="bottom-title">
<text>备件订单</text>
<text>物料订单</text>
<view class="order-file-right" @click="$u.throttle(handleClick, 500)">
<text>点击查看</text>
<u-icon name="arrow-right"></u-icon>
......@@ -110,12 +110,12 @@
},
handleOperate(partsId, operateType, willStatus) {
this.$emit('operate', partsId, operateType, willStatus)
},
handleClickCell(info) {
this.$emit('action', info)
},
handleClickExpress() {
this.$emit('express', info)
},
handleClickCell(info) {
this.$emit('action', info)
},
handleClickExpress() {
this.$emit('express', info)
},
handleApply() {
this.$emit('apply')
......@@ -143,21 +143,21 @@
flex-direction: column;
.list-content {
height: 100%;
.swiper {
.cell-view {
height: 100%;
padding-bottom: 100rpx;
// display: flex;
// flex-direction: column;
.shadow-view{
border-radius: 12rpx;
margin:30rpx;
height: 100%;
box-shadow: 0px 6px 10px rgba(22,72,155,0.15);
}
}
height: 100%;
.swiper {
.cell-view {
height: 100%;
padding-bottom: 100rpx;
// display: flex;
// flex-direction: column;
.shadow-view{
border-radius: 12rpx;
margin:30rpx;
height: 100%;
box-shadow: 0px 6px 10px rgba(22,72,155,0.15);
}
}
}
}
......@@ -171,10 +171,10 @@
font-weight: bold;
font-size: 32rpx;
margin: 0rpx 30rpx 40rpx 30rpx;
display: flex;
justify-content: space-between;
display: flex;
justify-content: space-between;
align-items: center;
.order-file-right {
.order-file-right {
font-weight: 400;
color: #2272FF;
font-size: 26rpx;
......@@ -239,4 +239,4 @@
}
}
}
</style>
</style>
<template>
<!-- 已申请配件cell -->
<!-- 已申请物料cell -->
<view class="applied-cell" @click="handleClick">
<view class="title-view">
<text class="title-text">{{title}}</text>
......
## 配件数量调整组件使用说明
## 物料数量调整组件使用说明
```
该组件用于仓库配件的数量调整
该组件用于仓库物料的数量调整
```
## API
......@@ -17,8 +17,8 @@
```json
{
"name": "正泰漏保", // 配件名称
"quantity": 1, // 配件数量
"name": "正泰漏保", // 物料名称
"quantity": 1, // 物料数量
"min": 1, // 数量最小值
"max": 100 // 数量最大值
}
......
......@@ -5,7 +5,7 @@
{{info.name}}
</view>
<view class="num">
<u-number-box v-if="!disabled" v-model="info.quantity" :min="info.min || 0" :max="info.max || 9999" @change="numChange"></u-number-box>
<u-number-box v-if="!disabled" v-model="info.quantity" :min="info.min || 0" :max="info.max || 9999" @change="numChange" @minus="minusValue" @blur="minusValue"></u-number-box>
<text class="nums" v-else>x{{ info.quantity || 1 }}</text>
</view>
</view>
......@@ -37,6 +37,9 @@
methods: {
numChange(event) {
this.$emit('change', event.value)
},
minusValue(event) {
this.$emit('minusValue', event.value)
}
}
}
......
## 配件选择组件使用说明
## 物料选择组件使用说明
```
该组件用于备件申请,数量调整
该组件用于物料申请,数量调整
```
## API
......
......@@ -19,6 +19,7 @@
</view>
<view class="u-flex bottom-right">
<button :class="['btn', btnActive]" @click="submit">{{ submitTxt }}</button>
<button v-if="cancelStatus" :class="['btn', btnNotActive]" @click="cancel">不用物料</button>
</view>
</view>
</template>
......@@ -44,7 +45,13 @@
return false
}
},
partNum: { // 配件数量
cancelStatus: { // 是否显示取消按钮
type: Boolean,
default() {
return false
}
},
partNum: { // 物料数量
type: Number,
default () {
return 0
......@@ -61,10 +68,10 @@
default () {
return '确定'
}
},
customStyle: {
type: String,
default: 'background-color: #FFFFFF;padding: 0 30rpx;'
},
customStyle: {
type: String,
default: 'background-color: #FFFFFF;'
},
},
......@@ -79,6 +86,9 @@
},
btnActive() {
return this.btnStatus ? 'btn-active' : ''
},
btnNotActive() {
return this.btnStatus ? '' : 'btn-active'
}
},
watch: {
......@@ -95,6 +105,9 @@
},
submit() {
if (this.btnStatus) this.$emit('submit')
},
cancel() {
if (!this.btnStatus) this.$emit('cancel')
}
}
}
......@@ -128,7 +141,7 @@
.bottom-center {
flex: 1;
align-items: flex-start;
margin: 0 20rpx;
margin-right: 20rpx;
.center-list {
&:nth-of-type(1) {
color: #666;
......@@ -165,7 +178,8 @@
}
}
.bottom-right {
width: 360rpx;
flex: 1;
// width: 360rpx;
// margin-right: 20rpx;
.btn {
width: 100%;
......@@ -176,6 +190,7 @@
text-align: center;
background: #D1D4D4;
color: #fff;
margin: 0 10rpx;
&::after {
content: '';
height: 0;
......
## 提交工具栏组件使用说明
```
该组件用于勾选配件,显示配件数量以及提交操作
该组件用于勾选物料,显示物料数量以及提交操作
```
## API
......@@ -13,7 +13,7 @@
| showChecked | Boolean | true | true/false | 是否显示勾选 |
| allChecked | Boolean | true | true/false | 是否全选 |
| btnStatus | Boolean | true | true/false | 确定按钮是否可点击 |
| partNum | Number | 0 | | 配件数量 |
| partNum | Number | 0 | | 物料数量 |
| num | Number | 0 | | 合计总件数 |
| submitTxt | String | 确定 | | 确定按钮文字 |
......@@ -50,7 +50,7 @@ export default {
}
},
computed: {
// 配件数
// 物料数
partNum() {
return 0
},
......
<template>
<view class="item" @click="$u.throttle(editSite, 500)">
<view class="userinfo u-flex">
<view class="item">
<view class="userinfo u-flex" @click="$u.throttle(selectSite, 500)">
<view class="name">{{ formatName }}</view>
<view class="mobile">{{ formatMobile }}</view>
</view>
<view class="siteinfo u-flex u-row-between u-col-top">
<view class="txt">{{ formatAddress }}</view>
<u-icon custom-prefix="wxh" name="pen" size="32"></u-icon>
<view class="txt" @click="$u.throttle(selectSite, 500)">{{ formatAddress }}</view>
<u-icon custom-prefix="wxh" name="pen" size="32" @click="$u.throttle(editSite, 500)"></u-icon>
</view>
<view class="default" v-show="isDefault">
<u-icon name="checkmark-circle" color="#2272FF" size="32"></u-icon>
<text class="txt">默认地址</text>
<view class="u-flex u-row-between default" v-if="siteType !== 'view'">
<view @click="$u.throttle(setDefault, 500)">
<u-icon name="checkmark-circle" :color="isDefault ? '#2272FF' : '#999'" size="32"></u-icon>
<text class="txt">默认地址</text>
</view>
<view @click="$u.throttle(remove, 500)">
<text class="txt">删除</text>
</view>
</view>
</view>
</template>
......@@ -84,9 +89,18 @@ export default {
}
},
methods: {
selectSite() {
this.$emit('select-site', this.info)
},
editSite() {
this.$emit('edit-site', this.info)
},
setDefault() {
this.$emit('set-default', this.info)
},
remove() {
this.$emit('remove', this.info)
}
}
};
</script>
......
......@@ -260,7 +260,7 @@
"path": "deposit/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "备件押金",
"navigationBarTitleText": "物料押金",
"enablePullDownRefresh": false
}
},
......@@ -277,7 +277,7 @@
"path": "warehouse/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "备件订单",
"navigationBarTitleText": "物料订单",
"enablePullDownRefresh": false,
"disableScroll": true
}
......@@ -286,7 +286,7 @@
"path": "warehouse/spare",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "备件库",
"navigationBarTitleText": "物料库",
"enablePullDownRefresh": false,
"disableScroll": true
}
......@@ -304,7 +304,7 @@
"path": "warehouse/searchParts",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": " ", // 备件单搜索
"navigationBarTitleText": " ",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F5F7",
"disableScroll": true
......@@ -314,7 +314,7 @@
"path": "warehouse/express",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": " ", // 备件单物流
"navigationBarTitleText": " ",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F5F7",
"disableScroll": true
......@@ -333,7 +333,7 @@
"path": "warehouse/partsDetail",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "", // 备件详情
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"disableScroll": true
}
......@@ -411,7 +411,7 @@
{
"path": "document-tag",
"style": {
"navigationBarTitleText": "", // 合作商或品牌标签列表
"navigationBarTitleText": "",
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true
......@@ -420,7 +420,7 @@
{
"path": "specification",
"style": {
"navigationBarTitleText": "", // 完工-产品规格
"navigationBarTitleText": "",
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true
......@@ -429,7 +429,7 @@
{
"path": "parts",
"style": {
"navigationBarTitleText": "可用备件",
"navigationBarTitleText": "可用物料",
"disableScroll": true
}
}
......@@ -558,7 +558,7 @@
{
"path":"application",
"style": {
"navigationBarTitleText": "备件申请",
"navigationBarTitleText": "物料申请",
"navigationStyle": "custom",
"disableScroll": true
}
......@@ -566,7 +566,7 @@
{
"path": "addParts",
"style": {
"navigationBarTitleText": "备件选择",
"navigationBarTitleText": "物料选择",
"disableScroll": true
}
}
......@@ -574,7 +574,7 @@
"path" : "nodes",
"style" :
{
"navigationBarTitleText": "备件申请、返件成功",
"navigationBarTitleText": "物料申请、返件成功",
"navigationStyle":"custom",
"enablePullDownRefresh": false
}
......
......@@ -5,7 +5,7 @@
<text class="title-view">我的</text>
</u-navbar>
<view class="mine-content">
<view class="header-view">
<view class="header-view">
<view class="header-left-view">
<view class="head-image">
<image :style="headImageStyle" :src="headImageUrl"></image>
......@@ -17,28 +17,28 @@
<u-icon class="tel-arrow-icon" name="arrow-up-fill"></u-icon>
</view>
</view>
</view>
<view class="header-right-view" @click="$u.throttle(handleClickSetting, 500)">
<view class="setting-view">
<image :src="shezhiImage" class="right-image-view"></image>
<text>设置</text>
</view>
<view v-if="isSuperuser" class="super-button"><u-button@click="handleSuperButton">切换用户</u-button></view>
</view>
</view>
<view class="ware-house-view">
<view class="ware-house-title">仓配功能</view>
<view class="ware-house-content">
<view v-for="(item, index) in warehouseItems" :key="index" class="ware-house-content-item" @click="handleClick(item.pathName)">
<view class="ware-house-image">
<image :src="item.icon" :style="item.imageStyle"></image>
</view>
<view>{{item.title}}</view>
</view>
</view>
</view>
<view class="header-right-view" @click="$u.throttle(handleClickSetting, 500)">
<view class="setting-view">
<image :src="shezhiImage" class="right-image-view"></image>
<text>设置</text>
</view>
<view v-if="isSuperuser" class="super-button"><u-button@click="handleSuperButton">切换用户</u-button></view>
</view>
</view>
<view class="ware-house-view">
<view class="ware-house-title">仓配功能</view>
<view class="ware-house-content">
<view v-for="(item, index) in warehouseItems" :key="index" class="ware-house-content-item" @click="handleClick(item.pathName)">
<view class="ware-house-image">
<image :src="item.icon" :style="item.imageStyle"></image>
</view>
<view>{{item.title}}</view>
</view>
</view>
</view>
<view class="list-view">
<view class="list-view">
<view v-for="(group, ind) in items" :key="ind" class="group-view">
<u-cell-group :border="false">
<view v-for="(item, index) in group" :key="index">
......@@ -48,7 +48,7 @@
<view slot="value" class="item-value">{{value}}</view>
</u-cell-item>
</view>
</u-cell-group>
</u-cell-group>
</view>
</view>
</view>
......@@ -136,38 +136,38 @@
imageStyle: 'width:32rpx;height:32rpx'
}]
]
},
warehouseItems() {
},
warehouseItems() {
return [
{
pathName: 'warehouse/index',
title: '备件订单',
title: '物料订单',
value: '',
icon: process.uniEnv.qn_base_url + 'wodepeijian.png',
icon: process.uniEnv.qn_base_url + 'wodepeijian.png',
imageStyle: 'width:60rpx;height:54rpx'
},
{
pathName: 'warehouse/spare',
title: '备件库',
value: '',
icon: process.uniEnv.qn_base_url + 'wodebeijian.png',
imageStyle: 'width:60rpx;height:54rpx'
},
{
pathName: 'warehouse/return',
title: '返件信息',
value: '',
icon: process.uniEnv.qn_base_url + 'fanjianxinxi.png',
imageStyle: 'width:56rpx;height:54rpx'
},
{
pathName: 'warehouse/records',
title: '出库记录',
value: '',
icon: process.uniEnv.qn_base_url + 'churuku.png',
imageStyle: 'width:50rpx;height:54rpx'
},
]
},
{
pathName: 'warehouse/spare',
title: '物料库',
value: '',
icon: process.uniEnv.qn_base_url + 'wodebeijian.png',
imageStyle: 'width:60rpx;height:54rpx'
},
{
pathName: 'warehouse/return',
title: '返件信息',
value: '',
icon: process.uniEnv.qn_base_url + 'fanjianxinxi.png',
imageStyle: 'width:56rpx;height:54rpx'
},
{
pathName: 'warehouse/records',
title: '出库记录',
value: '',
icon: process.uniEnv.qn_base_url + 'churuku.png',
imageStyle: 'width:50rpx;height:54rpx'
},
]
},
telTip() {
return this.mobile || '绑定手机号'
......@@ -180,20 +180,20 @@
},
headSize() {
return this.avatar ? 112 : 120
},
shezhiImage() {
return process.uniEnv.qn_base_url + 'shezhi.png'
},
isSuperuser() {
return this.vuex_superuser
},
shezhiImage() {
return process.uniEnv.qn_base_url + 'shezhi.png'
},
isSuperuser() {
return this.vuex_superuser
}
},
watch: {
vuex_token(val, oldVal) {
if (val && !this.isSuperuser) {
this.allowLogin()
}
},
},
watch: {
vuex_token(val, oldVal) {
if (val && !this.isSuperuser) {
this.allowLogin()
}
},
},
onLoad() {
app.trackPage('我的首页')
......@@ -225,9 +225,9 @@
} else {
this.$u.route({url: "pages/login/index"})
}
},
handleClickSetting() {
this.$u.route({url: 'pages/mine/setting/index'})
},
handleClickSetting() {
this.$u.route({url: 'pages/mine/setting/index'})
},
handleClickName() {
if(this.vuex_token && this.settled) {
......@@ -248,8 +248,8 @@
},
async allowLogin() { // 超级用户,显示登录按钮
let res = await this.$u.api.allowLogin()
if (res && res.code == 200) {
this.$u.vuex('vuex_superuser', res.data);
if (res && res.code == 200) {
this.$u.vuex('vuex_superuser', res.data);
}
},
......@@ -281,143 +281,143 @@
}
.mine-content {
position: relative;
position: relative;
padding: 26rpx 30rpx 30rpx 20rpx;
.header-view {
display: flex;
align-items: flex-start;
justify-content: space-between;
margin-bottom: 60rpx;
.header-left-view {
display: flex;
align-items: center;
.head-image {
width: 120rpx;
height: 120rpx;
background-color: #FFFFFF;
border-radius: 60rpx;
display: flex;
align-items: center;
justify-content: center;
}
.header-content {
color: #FFFFFF;
z-index: 1;
margin-left: 24rpx;
.name-view {
font-size: 40rpx;
font-weight: bold;
margin-bottom: 6rpx;
margin-top: -4rpx;
}
.tel-view {
background-color: #FFFFFF;
border-radius: 26rpx;
color: #2272FF;
width: 180rpx;
height: 52rpx;
font-size: 20rpx;
display: flex;
align-items: center;
justify-content: center;
&.active {
color: #FFFFFF;
border: 2rpx solid #FFFFFF;
background-color: #2272FF;
}
.tel-arrow-icon {
transform: rotate(90deg);
margin-left: 6rpx;
}
}
}
align-items: flex-start;
justify-content: space-between;
margin-bottom: 60rpx;
.header-left-view {
display: flex;
align-items: center;
.head-image {
width: 120rpx;
height: 120rpx;
background-color: #FFFFFF;
border-radius: 60rpx;
display: flex;
align-items: center;
justify-content: center;
}
.header-content {
color: #FFFFFF;
z-index: 1;
margin-left: 24rpx;
.name-view {
font-size: 40rpx;
font-weight: bold;
margin-bottom: 6rpx;
margin-top: -4rpx;
}
.tel-view {
background-color: #FFFFFF;
border-radius: 26rpx;
color: #2272FF;
width: 180rpx;
height: 52rpx;
font-size: 20rpx;
display: flex;
align-items: center;
justify-content: center;
&.active {
color: #FFFFFF;
border: 2rpx solid #FFFFFF;
background-color: #2272FF;
}
.tel-arrow-icon {
transform: rotate(90deg);
margin-left: 6rpx;
}
}
}
}
.header-right-view {
.setting-view {
display: flex;
justify-content: flex-end;
align-items: center;
color: #FFFFFF;
margin-right: 4rpx;
font-size: 26rpx;
margin-top: -24rpx;
.right-image-view {
width: 34rpx;
height: 32rpx;
margin-right: 10rpx;
}
}
.super-button {
margin-top: 20rpx;
}
.header-right-view {
.setting-view {
display: flex;
justify-content: flex-end;
align-items: center;
color: #FFFFFF;
margin-right: 4rpx;
font-size: 26rpx;
margin-top: -24rpx;
.right-image-view {
width: 34rpx;
height: 32rpx;
margin-right: 10rpx;
}
}
.super-button {
margin-top: 20rpx;
}
}
}
.ware-house-view {
background-color: #FFFFFF;
border-radius: 12rpx;
padding: 30rpx 30rpx 40rpx 30rpx;
height: 240rpx;
.ware-house-title {
color: #333333;
font-weight: bold;
font-size: 32rpx;
margin-bottom: 30rpx;
}
.ware-house-content {
display: flex;
justify-content: space-around;
align-items: center;
.ware-house-content-item {
color: #333333;
font-size: 26rpx;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
.ware-house-image {
width: 60rpx;
height: 60rpx;
margin-bottom: 14rpx;
display: flex;
justify-content: center;
align-items: center;
}
}
}
}
.ware-house-view {
background-color: #FFFFFF;
border-radius: 12rpx;
padding: 30rpx 30rpx 40rpx 30rpx;
height: 240rpx;
.ware-house-title {
color: #333333;
font-weight: bold;
font-size: 32rpx;
margin-bottom: 30rpx;
}
.ware-house-content {
display: flex;
justify-content: space-around;
align-items: center;
.ware-house-content-item {
color: #333333;
font-size: 26rpx;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
.ware-house-image {
width: 60rpx;
height: 60rpx;
margin-bottom: 14rpx;
display: flex;
justify-content: center;
align-items: center;
}
}
}
}
.list-view {
.group-view {
margin-top: 20rpx;
background-color: #FFFFFF;
border-radius: 12rpx;
overflow: hidden;
.item-title {
font-size: 32rpx;
color: #333333;
margin-left: 16rpx;
line-height: 32rpx;
}
.item-value {
font-size: 26rpx;
color: #999999;
}
.line-view {
height: 2rpx;
background-color: #F4F5F7;
margin: 30rpx;
}
.group-view {
margin-top: 20rpx;
background-color: #FFFFFF;
border-radius: 12rpx;
overflow: hidden;
.item-title {
font-size: 32rpx;
color: #333333;
margin-left: 16rpx;
line-height: 32rpx;
}
.item-value {
font-size: 26rpx;
color: #999999;
}
.line-view {
height: 2rpx;
background-color: #F4F5F7;
margin: 30rpx;
}
}
}
......
......@@ -308,7 +308,11 @@ export default {
handleClickCellButton(item, type) {
if (type == 'exception') {
this.$u.api.workerDealWithError(item.orderId).then(() => {})
}
}
let partAuditResults = item.partAuditResults ? ['orderSpareParts'] : []
let auditResults = item.auditResults ? Object.keys(item.auditResults) : []
auditResults = auditResults.concat(partAuditResults)
// 去完工
uni.navigateTo({
url:
......@@ -329,7 +333,7 @@ export default {
'&brandId=' +
item.lianbaoBrandId +
'&auditResults=' +
(item.auditResults ? Object.keys(item.auditResults).join() : '') +
(auditResults ? auditResults.join() : '') +
'&orderNumber=' +
item.orderNumber
})
......
......@@ -67,6 +67,7 @@ export default {
location: '',
address: '',
type: '充电桩安装',
id: null,
name: '',
mobile: '',
nameStatus: true,
......@@ -107,6 +108,10 @@ export default {
this.siteType = 'edit';
}
if(e.id) {
this.id = decodeURIComponent(e.id);
}
if(e.name) {
this.name = decodeURIComponent(e.name);
}
......@@ -264,19 +269,20 @@ export default {
if(!this.validateForm()) {
return false
}
if (this.siteType === 'add') {
} else if (this.siteType === 'select') {
if (this.siteType === 'select') {
this.commitSite()
} else if (this.siteType === 'edit') {
} else {
if (this.$u.test.isEmpty(this.siteInfo)) {
let params = {
updateFlag: true,
mobile: this.mobile,
name: this.name,
provinceName: this.region[0],
cityName: this.region[1],
districtName: this.region[2],
address: this.region.join("") + this.address
};
let res = await this.$u.api.updateAddress(params);
if (this.id) params.id = this.id
let res = await this.$u.api.saveMyAddress(params);
if (res && res.code == 200) {
this.$u.route({ type: 'back' });
this.show = false
......
<template>
<view class="address-wrap">
<view class="u-flex address-wrap">
<w-navbar title="收货地址"></w-navbar>
<view class="body" v-if="hasAdderss">
<w-address @editSite="toAddSite" :info="info" :is-default="true" />
<view class="lists">
<view class="body" v-for="(item, index) in lists" :key="item.id">
<w-address @editSite="toEditSite(item)" @selectSite="selectSite(item)" @setDefault="setDefault(item, index)" @remove="remove(item)" :info="item" :is-default="item.enable === 1" />
</view>
</view>
<view class="addSite" @tap="toAddSite">
<view class="add">
新建收货地址
</view>
</view>
</view>
</template>
......@@ -15,31 +23,24 @@ export default {
background: {
backgroundColor: 'none'
},
info: {
name: '',
mobile: '',
address: '',
region: [],
},
lists: [],
type: ''
};
},
computed: {
editPen() {
return process.uniEnv.qn_base_url + 'icon/edit-pen.png'
},
hasAdderss() {
return this.info.address
},
addressInfo() {
submitBtn() {
return {
name: this.name,
mobile: this.mobile,
address: this.address,
region: this.region || [],
color: '#FFFFFF',
backgroundColor: '#2272FF'
}
}
},
onLoad() {
onLoad(options) {
if (options) this.type = options.type
getApp().trackPage('我的收获地址页')
},
onShow() {
......@@ -53,32 +54,92 @@ export default {
this.getMineSite()
},
getMineSite() {
this.$u.api.getSiteAddress().then((res) => {
this.$u.api.getMyAddress().then((res) => {
const data = res.data
if(res.code == 200 && !this.$u.test.isEmpty(data)) {
let region = []
if(data.provinceName && data.cityName && data.districtName) {
region = [data.provinceName, data.cityName, data.districtName]
}
this.info = {
name: data.name,
mobile: data.mobile,
address: data.address,
region: region,
if (data.length > 0) {
this.lists = data.map(v => {
let region = []
if(v.provinceName && v.cityName && v.districtName) {
region = [v.provinceName, v.cityName, v.districtName]
}
v.region = region
return v
})
}
})
},
toAddSite() {
this.$u.route({
url: 'pages/mine/address/addSite',
params: {
type: 'add'
}
})
},
setDefault(val) {
this.$u.api.setDefaultAddress({id: val.id}).then((res) => {
if (res.code === 200) {
this.lists.forEach(v => {
this.$set(v, 'enable', v.id === val.id ? 1 : 0)
})
}
})
},
remove(val) {
uni.showModal({
title: '温馨提示',
content: '确定要删除该收货地址?',
success: (res) => {
if (res.confirm) {
uni.showLoading({
title: '加载中',
})
this.$u.api.deleteMyAddress({id: val.id}).then((res) => {
uni.hideLoading()
if (res.code === 200) {
this.getMineSite()
} else {
uni.showToast({
icon: "none",
title: res.data.message,
})
}
})
}
}
})
},
toAddSite(title){
const region = this.info.region.join('-')
selectSite(val) {
if (this.type === 'parts') {
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2]; //上一个页面
let address = val.region.join("") + val.address
let site = {
name: val.name,
mobile: val.mobile,
address: address,
region: val.region,
id: val.id
}
prevPage.$vm.updateSite(site)
this.$u.route({
type: 'back'
})
} else {
this.toEditSite(val)
}
},
toEditSite(val){
const region = val.region.join('-')
this.$u.route({
url: 'pages/mine/address/addSite',
params: {
type: 'edit',
region: region,
name: this.info.name,
mobile: this.info.mobile,
address: this.info.address,
name: val.name,
mobile: val.mobile,
address: val.address,
id: val.id
}
})
}
......@@ -89,6 +150,13 @@ export default {
<style lang="scss" scoped>
.address-wrap {
background-color: #F4F5F7;
flex-direction:column;
height: 100vh;
.lists {
width: 100%;
flex: 1;
overflow-y:auto;
}
}
.body {
padding: 30rpx;
......@@ -96,4 +164,24 @@ export default {
border-radius: 12rpx;
background-color: #FFFFFF;
}
.addSite {
display: flex;
justify-content: space-around;
width: 600rpx;
height: 100rpx;
line-height: 100rpx;
margin: 50rpx 0;
background-color: #2272FF;
border-radius: 60rpx;
font-size: 30rpx;
.add{
display: flex;
align-items: center;
color: #ffffff;
.icon{
margin-right: 10rpx;
}
}
}
</style>
<template>
<!-- 备件订单 -->
<!-- 物料订单 -->
<view class="ware-house">
<u-navbar back-icon-color="#333333" background="#FFFFFF" title="备件订单" titleColor="#333333"
:border-bottom="false" title-bold></u-navbar>
<u-navbar back-icon-color="#333333" background="#FFFFFF" title="物料订单" titleColor="#333333"
:border-bottom="false" title-bold></u-navbar>
<!-- 搜索 -->
<view class="search-view" @click.self="handleClickSearch">
<u-search :clearabled="false" disabled @custom="handleClickSearch" placeholder="请输入关键字"
:action-style="actionStyle" placeholder-color="#999999" color="#333333" bg-color="#FFFFFF" height="72"
search-icon-color="#999999">
</u-search>
</view>
</view>
<!-- 各个tab -->
<view class="u-tabs-box">
<u-tabs height="66" activeColor="#2272FF" bg-color="none" inactive-color="#999" bar-height="4"
bar-width="44" :offset="[0,0]" :list="list" count="total" :current="currentIndex" @change="change"
:is-scroll="false" font-size="28" bold></u-tabs>
</view>
</view>
<!-- 列表 -->
<view class="tab-view">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring
refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100" @scroll="scroll"
:scroll-top="scrollTop" refresher-background="#F4F5F7"
@refresherrefresh="onRefresh" @refresherrestore="onRestore" enable-back-to-top>
@refresherrefresh="onRefresh" @refresherrestore="onRestore" enable-back-to-top>
<!-- 加载中 && 没有下拉:显示加载中 -->
<view class="loading-view" v-if="!loaded && _freshing">
<u-loading mode="flower"></u-loading>
</view>
</view>
<!-- 无数据 -->
<NoOrder v-else-if="noParts" imageName="wupeijianxinxi.png" text="当前暂无备件信息"
<NoOrder v-else-if="noParts" imageName="wupeijianxinxi.png" text="当前暂无物料信息"
:customStyle="noPartsCustomStyle" />
<template v-else>
<template v-else>
<!-- 列表 -->
<view v-for="(item, index) in partsList" :key="item.id">
<AppliedCell @operate="handleOperate" :info="item" @action="handleClickCell" @express="handleClickExpress"></AppliedCell>
</view>
</view>
<!-- 底部加载状态 -->
<view class="load-more-view">
<u-loadmore v-show="(pageNumber == 1 && loaded) || pageNumber > 1" :status="loadStatus"
......@@ -41,11 +41,11 @@
</view>
</template>
</scroll-view>
</view>
</view>
<!-- 悬浮申请按钮 -->
<view class="fixed-button">
<ApplyButton :type.sync="buttonType" @click="handleClickApply" />
</view>
</view>
<!-- 通用提示框 -->
<view>
<u-toast ref="uToast" />
......@@ -67,11 +67,11 @@
return {
pageNumber: 0,
pageSize: 10,
partsList: [], // 备件订单列表
partsList: [], // 物料订单列表
currentIndex: 0, // 当前tab的index
loadStatus: 'loading', // 底部加载状态
loaded: false, // 页面加载
triggered: true, // true:下拉刷新
triggered: true, // true:下拉刷新
_freshing: false, // 防止下拉刷新重复触发
buttonType: 'expand' // 申请按钮宽 collapse': '80rpx', 'expand': '220rpx''
};
......@@ -101,23 +101,23 @@
// 'status': 20
// }
]
},
},
// 当下tab
currentTab() {
return this.list[this.currentIndex]
},
},
// 搜索图标
sousuoImage() {
return process.uniEnv.qn_base_url + 'sousuo.png'
},
},
// 无数据
noParts() {
return this.partsList.length == 0 && this.loaded
},
},
// 无数据页面样式
noPartsCustomStyle() {
return 'margin-top: 100rpx;background-color: #F4F5F7'
},
},
// 搜索控件右面'搜索'/'取消'按钮风格
actionStyle() {
return {
......@@ -128,14 +128,14 @@
},
},
onLoad(e) {
getApp().trackPage('备件订单页')
getApp().trackPage('物料订单页')
if (e && e.index) { // 跳转到第几个tab页
this.currentIndex = e.index
}
this._freshing = false;
this.reloadPartsList() // 加载数据
},
onShow() {
onShow() {
let pages = getCurrentPages()
let page = pages[pages.length - 1]
if (page.needRefresh) { // 需要初始化页面
......@@ -168,7 +168,7 @@
this.$u.api.applyList(param).then((res) => {
if (res.code == 200) {
if (this.pageNumber == 1) {
this.partsList = []
this.partsList = []
}
let list = res.data || []
this.partsList.push(...list)
......@@ -184,7 +184,7 @@
})
this.loaded = true // 加载完成
});
},
},
// 点击了订单cell的按钮
handleOperate(partsId, operateType) {
this.$u.api[operateType](partsId).then(res => {
......@@ -212,14 +212,14 @@
uni.navigateTo({
url: 'pages/mine/warehouse/partsDetail'
})
},
},
// 点击了订单cell的物流号,跳转到物流页面
handleClickExpress(info) {
this.setPageInfo(info)
uni.navigateTo({
url: 'pages/mine/warehouse/express'
})
},
},
// 本页数据设置,用于其他页面访问本页数据
setPageInfo(info) {
var pages = getCurrentPages();
......@@ -227,42 +227,42 @@
var page = pages[pages.length - 1];
page.info = info
}
},
},
// 点击了悬浮申请按钮
handleClickApply() {
uni.navigateTo({
url: 'pages/parts/application?applyType=1'
})
},
},
// 点击了搜索,跳转到搜索页面
handleClickSearch() {
var pages = getCurrentPages();
uni.navigateTo({
url: 'pages/mine/warehouse/searchParts'
})
},
},
// 下拉刷新
onRefresh() {
if (this._freshing) return;
this._freshing = true;
this.reloadPartsList()
},
},
// 重置下拉状态
onRestore() {
this.triggered = 'restore'; // 需要重置
},
},
// 初始化加载
reloadPartsList() { // 第一页数据
this.pageNumber = 0
this.loadStatus = 'loading'
this.getUnstockedList(this.currentTab.status)
},
},
// 滚到底部
reachBottom(e) {
if (this.loadStatus != 'loadmore') return
this.loadStatus == 'loading'
this.getUnstockedList(this.currentTab.status)
},
},
// 滚动触发悬浮按钮变为收起状态
scroll() {
this.buttonType = 'collapse'
......
<template>
<!-- 我的备件 -->
<!-- 我的物料 -->
<view class="ware-house-spare">
<u-navbar back-icon-color="#333333" background="#FFFFFF" title="备件库" titleColor="#333333"
:border-bottom="false" title-bold></u-navbar>
<u-navbar back-icon-color="#333333" background="#FFFFFF" title="物料库" titleColor="#333333"
:border-bottom="false" title-bold></u-navbar>
<!-- 搜索 -->
<view class="search-view">
<u-search v-model="keyword" :action-text="searchButtonText" @search="handleClickSearch" @clear="handleClear"
@custom="handleClickButton" placeholder="请输入关键字" :action-style="actionStyle" placeholder-color="#999999"
color="#333333" bg-color="#FFFFFF" height="72" search-icon-color="#999999">
</u-search>
</view>
</view>
<!-- 无结果 -->
<NoOrder v-if="noParts" imageName="wupeijianxinxi.png" text="当前暂无备件信息" :customStyle="noPartsCustomStyle" />
<!-- 备件 -->
<NoOrder v-if="noParts" imageName="wupeijianxinxi.png" text="当前暂无物料信息" :customStyle="noPartsCustomStyle" />
<!-- 物料 -->
<template v-else>
<view class="title-view" v-if="loaded">
<view>备件列表</view>
<view class="title-right-view">
<view>物料列表</view>
<view class="title-right-view">
<!-- 开启退件模式 -->
<view class="bounce-view" v-if="!showBounce" @click="showBounce = true">退件</view>
<view class="bounce-view" v-if="!showBounce" @click="showBounce = true">退件</view>
<!-- 取消退件模式 -->
<u-button v-else :custom-style="buttonStyle" shape="circle" @click="handleClickBounce">退件 ×</u-button>
</view>
</view>
<!-- 备件列表 -->
</view>
<!-- 物料列表 -->
<view class="tab-view">
<scroll-view scroll-y style="height: 100%;width: 100%;" scroll-anchoring enable-back-to-top @scroll="scroll">
<!-- 加载转圈页面 -->
<!-- 加载转圈页面 -->
<view class="loading-view" v-if="!loaded">
<u-loading mode="flower"></u-loading>
</view>
</view>
<!-- 列表 -->
<template v-else>
<view class="list-item" v-for="(item, index) in partsList" :key="item.id">
<SpareCell :item="item" :showChecked="showBounce" type="stock"
@change="handleChange($event, index)"@numChange="handleNumChange($event, index)" />
</view>
</view>
<!-- 底部加载状态 -->
<view class="load-more-view">
<u-loadmore v-show="partsList.length > 0" status="nomore" bgColor="#F4F5F7">
......@@ -43,14 +43,14 @@
</view>
</template>
</scroll-view>
</view>
</view>
<!-- 底部按钮控件 -->
<view class="bar" v-show="showBounce">
<SubmitBar :partNum="subBarInfo.partNum" :num="subBarInfo.num" :btnStatus="subBarInfo.btnStatus"
submitTxt="退件" :allChecked="subBarInfo.allChecked" :customStyle="customStyle" @select="allSelect"
@submit="$u.throttle(handleSubmit, 500)" />
</view>
</template>
</template>
<!-- 悬浮申请按钮 -->
<view class="fixed-button" v-show="!showBounce">
<ApplyButton :type.sync="buttonType" @click="handleClickApply"/>
......@@ -75,7 +75,7 @@
},
data() {
return {
partsList: [], // 备件列表
partsList: [], // 物料列表
loaded: false, // 加载状态
showBounce: false, // 是否进入推荐模式
keyword: '', // 搜索框内的关键字
......@@ -83,19 +83,19 @@
buttonType: 'expand' // 申请按钮宽 collapse': '80rpx', 'expand': '220rpx''
};
},
computed: {
computed: {
// 搜索图标
sousuoImage() {
return process.uniEnv.qn_base_url + 'sousuo.png'
},
},
// 无结果,展示无结果页面
noParts() {
return this.partsList.length == 0 && this.loaded
},
},
// 无结果页面样式
noPartsCustomStyle() {
return 'margin-top: 100rpx;background-color: #F4F5F7'
},
},
// 取消退件模式按钮风格
buttonStyle() {
return {
......@@ -105,7 +105,7 @@
color: '#2272FF',
fontSize: '26rpx',
}
},
},
// 搜索控件右面'搜索'/'取消'按钮风格
actionStyle() {
return {
......@@ -113,7 +113,7 @@
'color': '#2272FF',
'margin-left': '20rpx'
}
},
},
// 底部按钮控件数据
subBarInfo() {
var i = 0
......@@ -130,27 +130,27 @@
btnStatus: j > 0, // 提交按钮可以点击
allChecked: j > 0 && j == this.partsList.length // 勾选了全选
}
},
},
// 底部按钮控件样式
customStyle() {
return 'background-color: #F4F5F7;padding: 0rpx;'
},
},
// 搜索控件右面按钮文字 已经搜索过 && 搜多过的文字和传入后台的文字相同:取消;其他:搜索
searchButtonText() {
return this.searchedKeyword == this.keyword && this.keyword ? '取消' : '搜索'
},
// 选中的退件
selectedParts() {
return this.partsList.filter((item)=> {
return item.selected == true
})
},
// 选中的退件
selectedParts() {
return this.partsList.filter((item)=> {
return item.selected == true
})
}
},
onLoad(e) {
getApp().trackPage('备件库页')
this.getReserveList() // 获取备件列表
getApp().trackPage('物料库页')
this.getReserveList() // 获取物料列表
},
onShow() {
onShow() {
// 退件之后刷新页面
let pages = getCurrentPages();
let page = pages[pages.length - 1];
......@@ -162,7 +162,7 @@
}
},
methods: {
getReserveList() { // 备件列表
getReserveList() { // 物料列表
this.loaded = false
var param = {}
if (this.keyword) {
......@@ -213,23 +213,23 @@
item.quantity = value ? item.stock : 0
}
},
handleChange(value, index) { // 备件cell勾选改变
handleChange(value, index) { // 物料cell勾选改变
this.partsList[index].selected = value
},
handleNumChange(value, index) { // 备件cell内数量改变
handleNumChange(value, index) { // 物料cell内数量改变
this.partsList[index].quantity = value
},
handleSubmit() { // 提交
this.$u.route({
url: 'pages/parts/returnParts',
})
},
// 点击了申请备件按钮
},
// 点击了申请物料按钮
handleClickApply() {
uni.navigateTo({
url: 'pages/parts/application?applyType=1'
})
},
},
// 滚动触发悬浮按钮变为收起状态
scroll() {
this.buttonType = 'collapse'
......
......@@ -250,7 +250,7 @@
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="exception || readOnly"
:disabled="readOnly"
@value-change="fieldValueChange"
>
</xh-parts>
......@@ -989,11 +989,10 @@ export default {
this.$u.api.saveCompleteData(param, this.orderId).then(async (res) => {
if (res.code == 200) {
//完工项信息保存成功再次完工工单
if (!this.exception) {
// 核销配件
const submitPart = await this.submitParts()
if (!submitPart) return
}
// if (!this.exception) { // 核销配件
// const submitPart = await this.submitParts()
// if (!submitPart) return
// }
if (this.inGuaranteePeriod === 'Y') {
this.$u.api.inOrderFinish(this.orderId).then((res) => {
......
<template>
<view class="doc-tag">
<u-navbar back-icon-color="#333333" background="#FFFFFF" :title="titles[type]" titleColor="#333333"
<u-navbar back-icon-color="#333333" background="#FFFFFF" :title="titles[type]" titleColor="#333333"
:border-bottom="false" title-bold></u-navbar>
<!-- 合作商或品牌标签列表 -->
<view class="label-content">
......@@ -19,18 +19,18 @@
export default {
data() {
return {
labels: [], // 标签列表
selectedId: '', // 已选中标签的id
type: '1', // '1': '合作商', '2': '品牌', '9': '备件品牌'
labels: [], // 标签列表
selectedId: '', // 已选中标签的id
type: '1', // '1': '合作商', '2': '品牌', '9': '物料品牌'
};
},
onLoad(e) {
if (e && e.selectedId) { // 有已选中标签的id
this.selectedId = e.selectedId
}
if (e && e.categoryId) { // 有品类
this.type = '9'
this.getBrandList(e.categoryId)
onLoad(e) {
if (e && e.selectedId) { // 有已选中标签的id
this.selectedId = e.selectedId
}
if (e && e.categoryId) { // 有品类
this.type = '9'
this.getBrandList(e.categoryId)
} else if (e && e.partnerCompanyId) { // 有合作商id,获取品牌标签
this.type = '2'
this.loadFileLabel(e.partnerCompanyId)
......@@ -38,67 +38,67 @@
this.type = '1'
this.loadFileLabel()
}
},
computed:{
titles() {
return {
'1': '合作商',
'2': '品牌',
'9': ' ' // 备件品牌
}
},
keys() {
return {
'1': 'id', // 合作商
'2': 'id', // 品牌
'9': 'brandId' // 备件品牌
}
},
nameKeys() {
return {
'1': 'name', // 合作商
'2': 'name', // 品牌
'9': 'brandName' // 备件品牌
}
}
},
computed:{
titles() {
return {
'1': '合作商',
'2': '品牌',
'9': ' ' // 物料品牌
}
},
keys() {
return {
'1': 'id', // 合作商
'2': 'id', // 品牌
'9': 'brandId' // 物料品牌
}
},
nameKeys() {
return {
'1': 'name', // 合作商
'2': 'name', // 品牌
'9': 'brandName' // 物料品牌
}
}
},
methods: {
// 选中标签
handleClick(label, index) {
this.selectedId = label[this.keys[this.type]]
// 向上个页面传值
var pages = getCurrentPages();
if (pages.length >= 2) {
var page = pages[pages.length - 2];
page.selectedItem = {
type: this.type,
id: this.selectedId,
item: label,
index: index
}
}
uni.navigateBack()
this.selectedId = label[this.keys[this.type]]
// 向上个页面传值
var pages = getCurrentPages();
if (pages.length >= 2) {
var page = pages[pages.length - 2];
page.selectedItem = {
type: this.type,
id: this.selectedId,
item: label,
index: index
}
}
uni.navigateBack()
},
// 获取合作商列表
async loadFileLabel(partnerCompanyId) {
let param = {
type: this.type, // 1:合作商标签,2:品牌标签
}
if (this.type == '2') {
param.partnerCompanyId = partnerCompanyId // 品牌的时候有效
type: this.type, // 1:合作商标签,2:品牌标签
}
if (this.type == '2') {
param.partnerCompanyId = partnerCompanyId // 品牌的时候有效
}
let res = await this.$u.api.fileLabel(param)
if (res && res.code == 200) {
this.labels = res.data || []
this.labels = res.data || []
}
},
// 获取备件品牌
// 获取物料品牌
getBrandList(categoryId) {
this.$u.api.getBrandList({categoryId: categoryId}).then(res => {
if (res.code === 200) {
if (res.code === 200) {
this.labels = res.data || []
}
})
......@@ -118,12 +118,12 @@
width: 100%;
display: flex;
align-items: center;
overflow: auto;
overflow: auto;
flex-wrap: wrap;
padding: 0 10rpx 14rpx 30rpx;
.label-item {
padding-right: 20rpx;
padding-right: 20rpx;
padding-bottom: 30rpx;
flex-shrink: 0;
......@@ -153,4 +153,4 @@
}
}
}
</style>
</style>
......@@ -19,7 +19,7 @@
<view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image>
</view>
<view class="message">当前无可用备件</view>
<view class="message">当前无可用物料</view>
</view>
<view class="bar" v-if="lists.length > 0">
......@@ -27,9 +27,12 @@
:partNum="partNum"
:num="num"
:btnStatus="partNum > 0"
submitTxt="用物料"
:allChecked="allChecked"
:cancelStatus="true"
@select="allSelect"
@submit="submit"
@cancel="cancel"
/>
</view>
</view>
......@@ -65,8 +68,8 @@
}
},
onLoad(e) {
this.workOrderId = parseInt(e.workOrderId)
this.categoryId = parseInt(e.categoryId)
this.workOrderId = parseInt(e.workOrderId)
this.categoryId = parseInt(e.categoryId)
this.brandId = parseInt(e.brandId)
this.getReserve()
},
......@@ -105,7 +108,8 @@
name: v.name,
part_id: v.skuId,
quantity: v.quantity,
max: v.max
max: v.max,
cost: v.cost || 0
}
})
......@@ -114,6 +118,9 @@
prevPage.$vm.$refs['fileChildParts'][0].valChange(lists)
this.$u.route({ type: 'back' })
},
cancel() {
this.$u.route({ type: 'back' })
},
qnFile(src) {
return process.uniEnv.qn_base_url + src
}
......
<template>
<view class="u-flex content">
<view class="categary" v-if="type === '2'">
<view class="u-flex u-col-center">
<view
:class="['txt', {'active': classifyId === item.id }]"
v-for="item in classify"
:key="item.id"
@click="changeClassify(item)"
>{{item.label}}</view>
</view>
</view>
<view class="search">
<u-search
:clearabled="true"
......@@ -11,15 +22,6 @@
></u-search>
</view>
<view class="categary" v-if="type === '2'">
<view class="u-flex u-col-center">
<picker mode="selector" :value="categaryIndex" range-key="label" :range="categary" @click="show = true" @change="changeCategary">
<view class="txt">{{categary[categaryIndex].label || '请选择'}}</view>
</picker>
<u-icon class="input-icon" color="#2272FF" :name="show ? 'arrow-up' : 'arrow-down'"></u-icon>
</view>
</view>
<view class="warp u-flex">
<view class="brand u-flex" v-if="brand.length > 0">
<view class="label-content u-flex">
......@@ -29,18 +31,67 @@
class="u-flex"
:scroll-into-view="scrollId"
>
<view :id="`brand${item.brandId}`" :class="['label-title', { selected: item.brandId == brandId }]" v-for="(item, index) in brand" :key="index" @click="selectBrand(item, index)">{{ item.label }}</view>
<view
:id="`brand${item.id}`"
:class="['label-title', { selected: item.id == brandId }]"
v-for="(item, index) in brand"
:key="index"
@click="selectBrand(item, index)"
>{{ item.label }}</view>
</scroll-view>
</view>
<view class="more u-flex" @click="handleClick">
<!-- <picker mode="selector" :value="brandIndex" range-key="label" :range="brand" @click="show = true" @change="changeBrand"> -->
<view class="more-text">更多</view>
<!-- </picker> -->
<view class="more-text">更多</view>
<u-icon class="input-icon" color="#2272FF" name="arrow-right"></u-icon>
</view>
</view>
<view class="model u-flex" v-if="showMore !== true && model.length > 0">
<view class="label-content u-flex">
<scroll-view
style="width:100%;white-space: nowrap;"
scroll-x="true"
class="u-flex"
:scroll-into-view="scrollModelId"
>
<view
:id="`model${item.id}`"
:class="['label-title', { selected: item.id == modelId }]"
v-for="(item, index) in model"
:key="index"
@click="selectModel(item, index)"
>{{ item.label }}</view>
</scroll-view>
</view>
<view class="more u-flex" @click="showMore = true">
<u-icon class="input-icon" color="#666" name="arrow-down"></u-icon>
</view>
</view>
<view class="allModel u-flex" v-if="showMore === true && model.length > 0">
<view class="label-content u-flex">
<scroll-view
style="width:100%;height: 320rpx;"
scroll-y="true"
class="u-flex"
:scroll-into-view="scrollModelId"
>
<view
:id="`model${item.id}`"
:class="['label-title', { selected: item.id == modelId }]"
v-for="(item, index) in model"
:key="index"
@click="selectModel(item, index)"
>{{ item.label }}</view>
</scroll-view>
</view>
<view class="more u-flex" @click="showMore = false">
<u-icon class="input-icon" color="#666" name="arrow-up"></u-icon>
</view>
</view>
<view class="lists">
<view class="mask" v-if="showMore === true" @click="showMore = false"></view>
<scroll-view
style="height:100%;"
:scroll-top="scrollTop"
......@@ -49,7 +100,7 @@
@scrolltolower="loadMore"
>
<select-parts
v-for="(item, index) in lists"
v-for="(item, index) in lists"
:key="index"
:info="item"
:show-checked="false"
......@@ -64,7 +115,7 @@
</view>
<view class="bar" v-show="partNum > 0">
<submit-bar
<submit-bar
:partNum="partNum"
:num="num"
:btnStatus="partNum > 0"
......@@ -77,91 +128,116 @@
</template>
<script>
import selectParts from "@/components/select-parts/index"
import submitBar from "@/components/submit-bar/index"
import selectParts from '@/components/select-parts/index'
import submitBar from '@/components/submit-bar/index'
export default {
components: {
selectParts,
submitBar
submitBar,
},
data() {
return {
keyword: '',
show: false,
showMore: false,
categary: [],
classify: [],
brand: [],
model: [],
categaryIndex: 0,
categaryId: '',
brandIndex: 0,
categoryId: '',
classifyId: '',
brandId: 0,
scrollId: '',
loadStatus: "loadmore",
scrollModelId: '',
modelId: 0,
loadStatus: 'loadmore',
lists: [],
submitList: [],
pageSize: 20,
pageNumber: 1,
type: '1',
};
}
},
computed: {
searchStyle() {
return {
color: "#2272FF"
};
color: '#2272FF',
}
},
// 配件数
partNum() {
return this.submitList.reduce((counter, item) => !item.disabled && item.quantity > 0 ? counter += 1 : counter, 0)
return this.submitList.reduce(
(counter, item) =>
!item.disabled && item.quantity > 0 ? (counter += 1) : counter,
0
)
},
// 总数
num() {
return this.submitList.reduce((counter, { disabled, quantity }) => !disabled ? counter += quantity : counter, 0)
return this.submitList.reduce(
(counter, { disabled, quantity }) =>
!disabled ? (counter += quantity) : counter,
0
)
},
loadText() {
return {
loadmore: '上拉加载更多',
loading: '努力加载中',
nomore: this.pageNumber > 1 ? '没有更多了' : '未找到物料',
}
},
loadText() {
return {
loadmore: '上拉加载更多',
loading: '努力加载中',
nomore: this.pageNumber > 1 ? '没有更多了' : '未找到备件'
}
}
},
onLoad(e) {
getApp().trackPage('选择配件页')
if (e) {
if (e.type == 1) {
this.categaryId = e.categaryId || ''
this.type = e.type
this.getBrandList(e.brandId)
} else if (e.type == 2) {
this.type = e.type
this.getCategaryList()
}
}
getApp().trackPage('选择配件页')
if (e) {
if (e.type == 1) {
this.categoryId = e.categaryId || ''
this.type = e.type
this.getBrandList(e.brandId)
} else if (e.type == 2) {
this.type = e.type
this.getCategaryList()
}
}
},
onShow() {
let pages = getCurrentPages();
let page = pages[pages.length - 1];
let selectedItem = page.selectedItem;
if (selectedItem) {
page.selectedItem = null
this.selectBrand(selectedItem.item, selectedItem.index)
this.scrollId = `brand${selectedItem.id}`
}
let pages = getCurrentPages()
let page = pages[pages.length - 1]
let selectedItem = page.selectedItem
if (selectedItem) {
page.selectedItem = null
this.selectBrand(selectedItem.item, selectedItem.index)
this.scrollId = `brand${selectedItem.id}`
}
},
methods: {
// 获取品类
getCategaryList() {
this.$u.api.getCategoryList().then(res => {
this.$u.api.getCategoryList().then((res) => {
if (res.code === 200) {
const data = res.data
if (data.length > 0) {
this.categary = data.map(v => {
v.label = v.categoryName
this.categoryId = data[0].categoryId
this.getClassify()
} else {
this.getPartsList()
}
}
})
},
// 获取一级分类
getClassify() {
this.$u.api.getClassify({ id: this.categoryId }).then((res) => {
if (res.code === 200) {
const data = res.data
if (data.length > 0) {
this.classify = data.map((v) => {
v.label = v.name
return v
})
this.categaryId = this.categary[0].categoryId
this.classifyId = this.classify[0].id
this.getBrandList()
} else {
this.getPartsList()
......@@ -169,50 +245,101 @@ export default {
}
})
},
// 获取品牌
// 获取二级分类
getBrandList(id) {
this.$u.api.getBrandList({categoryId: this.categaryId}).then(res => {
this.$u.api.getBrandList({ categoryId: this.categoryId, classifyId: this.classifyId }).then((res) => {
if (res.code === 200) {
const data = res.data
if (data.length > 0) {
let item, index
this.brand = data.map((v, i) => {
if (id && parseInt(id) === v.brandId) {
item = v
index = i
}
v.label = v.brandName
return v
})
if (item && index) {
this.selectBrand(item, index)
this.scrollId = `brand${item.brandId}`
} else {
this.brandId = this.brand[0].brandId
this.lists = []
this.getPartsList()
let lists
if (this.classifyId === 1) {
lists = data.partnerCompany
} else {
lists = data.classify
}
let item, index
this.brand = lists.map((v, i) => {
if (id && parseInt(id) === v.id) {
item = v
index = i
}
v.label = v.name
return v
})
if (item && index) {
this.selectBrand(item, index)
this.scrollId = `brand${item.id}`
} else {
this.brandId = this.brand?.[0]?.id
this.lists = []
this.getThreeLevel()
}
}
})
},
// 获取三级分类
getThreeLevel() {
const params = {
categoryId: this.categoryId,
classifyId: this.classifyId,
partnerCompanyId: '',
speciesId: ''
}
if (this.classifyId === 1) {
params.partnerCompanyId = this.brandId
} else {
params.speciesId = this.brandId
}
this.$u.api.getThreeLevel(params).then(res => {
if (res.code === 200) {
const data = res.data
let item, index
this.model = data.map((v, i) => {
// if (id && parseInt(id) === v.id) {
// item = v
// index = i
// }
v.label = v.name
return v
})
if (item && index) {
this.selectModel(item, index)
this.scrollModelId = `model${item.id}`
} else {
this.modelId = this.model?.[0]?.id
this.lists = []
this.getPartsList()
}
}
})
},
// 获取配件列表
getPartsList() {
this.page++;
this.loadStatus = "loading";
this.page++
this.loadStatus = 'loading'
const params = {
pageNumber: this.pageNumber,
pageSize: this.pageSize,
categoryId: this.categaryId || '',
brandId: this.brandId || '',
keyword: this.keyword
categoryId: this.categoryId || '',
keyword: this.keyword,
classifyId: this.classifyId,
brandId: this.modelId,
speciesId: '',
partnerCompanyId: '',
}
if (this.classifyId === 1) {
params.partnerCompanyId = this.brandId
} else {
params.speciesId = this.brandId
}
this.$u.api.getPartsList(params).then(res => {
this.$u.api.getPartsList(params).then((res) => {
if (res.code === 200) {
const data = res.data
if (data.length > 0) {
const lists = data.map(v => {
const lists = data.map((v) => {
v.quantity = 0
v.disabled = true
v.max = 9999
......@@ -222,11 +349,11 @@ export default {
})
this.lists = this.lists.concat(lists)
this.pageNumber++
this.loadStatus = lists.length < this.pageSize ? "nomore" : "loadmore"
this.loadStatus =
lists.length < this.pageSize ? 'nomore' : 'loadmore'
} else {
this.loadStatus = "nomore"
this.loadStatus = 'nomore'
}
}
})
},
......@@ -238,49 +365,54 @@ export default {
this.getPartsList()
},
// 选择品类
changeCategary(data) {
this.categaryIndex = data.detail.value
this.categaryId = this.categary[this.categaryIndex || 0].categoryId
this.brandIndex = ''
changeClassify(data) {
this.classifyId = data.id
this.show = false
this.brand = []
this.pageNumber = 1
this.getBrandList()
},
// 下拉选择品牌
changeBrand(data) {
this.brandIndex = data.detail.value
this.brandId = this.brand[this.brandIndex].brandId
this.scrollId = `brand${this.brandId}`
this.lists = []
this.pageNumber = 1
this.getPartsList()
},
// 点击选择品牌
selectBrand(item, index) {
this.scrollId = ''
this.brandIndex = index
this.brandId = item.brandId
this.brandId = item.id
this.model = []
this.lists = []
this.pageNumber = 1
this.getThreeLevel()
},
// 点击选择三级分类
selectModel(item, index) {
this.scrollModelId = ''
this.modelId = item.id
this.lists = []
this.pageNumber = 1
this.getPartsList()
},
// 加载更多
loadMore() {
if (this.loadStatus !== "nomore") {
this.getPartsList();
if (this.loadStatus !== 'nomore') {
this.getPartsList()
}
},
// 点击更多
handleClick() {
this.$u.route({url: 'pages/order/document-tag' + '?categoryId=' + this.categaryId + '&selectedId=' + this.brandId})
},
// 点击更多
handleClick() {
this.$u.route({
url:
'pages/order/document-tag' +
'?categoryId=' +
this.categoryId +
'&selectedId=' +
this.brandId,
})
},
// 加入申请
apply(item, index) {
this.$set(this.lists[index], 'disabled', false)
this.$set(this.lists[index], 'quantity', 1)
// 如果购物车没有该记录,则添加
const findIndex = this.submitList.findIndex(v => v.id === item.id)
const findIndex = this.submitList.findIndex((v) => v.id === item.id)
if (findIndex === -1) this.submitList.push(item)
},
// 改变数量
......@@ -288,25 +420,27 @@ export default {
this.$set(this.lists[index], 'quantity', val)
if (val === 0) this.$set(this.lists[index], 'disabled', true)
// 如果购物车有该记录,则更新
const findIndex = this.submitList.findIndex(v => v.id === item.id)
const findIndex = this.submitList.findIndex((v) => v.id === item.id)
this.$set(this.submitList[findIndex], 'quantity', val)
},
// 提交
submit() {
const lists = this.submitList.filter(v => !v.disabled && v.quantity > 0).map(v => {
return {
part_id: v.skuId,
name: v.name,
quantity: v.quantity
}
})
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2]; //上一个页面
const lists = this.submitList
.filter((v) => !v.disabled && v.quantity > 0)
.map((v) => {
return {
part_id: v.skuId,
name: v.name,
quantity: v.quantity,
}
})
let pages = getCurrentPages()
let prevPage = pages[pages.length - 2] //上一个页面
prevPage.$vm.updateParts(lists)
this.$u.route({ type: 'back' })
}
},
},
};
}
</script>
<style lang="scss" scoped>
......@@ -319,18 +453,22 @@ export default {
}
.categary {
width: 100%;
padding: 0 30rpx 30rpx;
padding: 20rpx 30rpx 0rpx;
.txt {
font-size: 32rpx;
font-size: 36rpx;
color: #333;
margin-right: 30rpx;
}
.active {
font-size: 48rpx;
color: #333;
font-weight: bold;
margin-right: 15rpx;
margin-right: 30rpx;
}
}
.warp {
border-radius: 30rpx 30rpx 0 0;
padding: 30rpx 30rpx 0 30rpx;
width: 100%;
background: #fff;
flex-direction: column;
......@@ -339,20 +477,50 @@ export default {
overflow: hidden;
.brand {
width: 100%;
border-bottom: 2rpx solid #F4F5F7;
padding-bottom: 20rpx;
padding: 20rpx 30rpx 0rpx 30rpx;
.label-content {
flex: 1;
overflow: hidden;
padding-right: 20rpx;
border-right: 2rpx solid #f4f5f7;
.label-title {
color: #666;
padding: 10rpx 0rpx;
margin-right: 40rpx;
display: inline-block;
font-size: 32rpx;
&.selected {
color: #2272ff;
border-bottom: 4rpx solid #2272ff;
font-size: 36rpx;
font-weight: bold;
}
}
}
.more {
width: 100rpx;
padding-left: 20rpx;
.more-text {
color: #2272ff;
font-size: 26rpx;
}
}
}
.model {
width: 100%;
padding: 30rpx 30rpx 0 30rpx;
.label-content {
flex: 1;
overflow: hidden;
padding-right: 20rpx;
border-right: 2rpx solid #F4F5F7;
.label-title {
color:#666;
background: #F4F5F7;
padding: 12rpx 40rpx;
background: #f4f5f7;
color: #999;
padding: 7rpx 30rpx;
margin-right: 20rpx;
border-radius: 10rpx;
display:inline-block;
display: inline-block;
font-size: 26rpx;
border-radius: 30rpx;
&.selected {
color: #fff;
background: #2272ff;
......@@ -360,18 +528,53 @@ export default {
}
}
.more {
width: 100rpx;
padding-left: 20rpx;
.more-text {
color: #2272FF;
}
}
.allModel {
width: 100%;
padding: 30rpx 30rpx 0 30rpx;
flex-flow: column;
border-radius: 0 0 30rpx 30rpx;
.label-content {
flex: 1;
overflow: hidden;
width: 100%;
.label-title {
background: #f4f5f7;
color: #999;
padding: 7rpx 30rpx;
margin: 0rpx 15rpx 20rpx 0;
display: inline-block;
font-size: 26rpx;
border-radius: 30rpx;
&.selected {
color: #fff;
background: #2272ff;
}
}
}
.more {
padding: 20rpx 0;
width: 100%;
justify-content: flex-end;
}
}
.lists {
width: 100%;
flex: 1;
overflow-y: auto;
padding: 30rpx 30rpx 0 30rpx;
position: relative;
.mask {
position: absolute;
z-index: 9;
background: #00000082;
width: 100%;
left: 0;
top: 0;
bottom: 0;
}
.load-more {
padding: 50rpx 0;
}
......@@ -379,7 +582,7 @@ export default {
}
.bar {
width: 100%;
border-top: 2rpx solid #F4F5F7;
border-top: 2rpx solid #f4f5f7;
padding: 0 20rpx;
background: #fff;
}
......
<template>
<view class="app-wrap">
<w-navbar title="备件申请" navbar-color="#FFFFFF" />
<w-navbar title="物料申请" navbar-color="#FFFFFF" />
<view class="content">
<view class="card parts">
<view class="title" v-if="isEmptyParts">备件信息</view>
<view class="title" v-if="isEmptyParts">物料信息</view>
<view class="u-flex u-row-between title" v-else>
<view>选择备件</view>
<view>选择物料</view>
<u-icon name="arrow-right" size="24" color="#2272FF"
@click="$u.throttle(addParts, 500)" label="添加备件"
@click="$u.throttle(addParts, 500)" label="添加物料"
label-pos="left" label-color="#2272FF" label-size="26"/>
</view>
<view class="body">
......@@ -17,7 +17,7 @@
<view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image>
</view>
<view class="message">当前还未选择备件,请点击添加,添加后在'我的->备件订单'查看</view>
<view class="message">当前还未选择物料,请点击添加,添加后在'我的->物料订单'查看</view>
<button class="add-button" plain="true" @click="$u.throttle(addParts, 500)">去添加</button>
</view>
<view v-else class="list">
......@@ -26,6 +26,7 @@
:info="row"
:show-checked="false"
@change="numChange($event, index)"
@minusValue="minusValue($event, index)"
></select-parts>
</view>
</view>
......@@ -34,9 +35,12 @@
</view>
</view>
<view class="card address">
<view class="title">收件信息</view>
<view class="u-flex u-row-between">
<view class="title">收件信息</view>
<view class="more" @click="toAddress">更多地址></view>
</view>
<view class="body">
<w-address :info="addressInfo" @editSite="editSite" />
<w-address :info="addressInfo" @editSite="editSite" @selectSite="editSite" siteType="view" />
</view>
</view>
</view>
......@@ -89,7 +93,7 @@ export default {
}
},
onLoad(e) {
getApp().trackPage('备件申请页')
getApp().trackPage('物料申请页')
this.orderId = e && Number(e.orderId) || 0
this.applyType = e && Number(e.applyType) || 0
this.initData()
......@@ -100,7 +104,7 @@ export default {
this.loadOrderInfo()
},
loadAddress() {
this.$u.api.getSiteAddress().then((res) => {
this.$u.api.getDefaultAddress().then((res) => {
if(res.code == 200 && res.data) {
this.addressInfo.name = res.data.name
this.addressInfo.mobile = res.data.mobile
......@@ -139,6 +143,14 @@ export default {
}
})
},
toAddress() {
this.$u.route({
url: "pages/mine/address/index",
params: {
type: 'parts'
}
})
},
updateSite(site) {
this.addressInfo = site
},
......@@ -161,6 +173,21 @@ export default {
numChange(val, index) {
this.$set(this.parts[index], 'quantity', val)
},
minusValue(val, index) {
if (val === 0) {
uni.showModal({
title: '温馨提示',
content: '确定要删除该物料?',
success: (res) => {
if (res.confirm) {
this.parts.splice(index, 1)
} else if (res.cancel) {
this.$set(this.parts[index], 'quantity', 1)
}
},
})
}
},
updateParts(parts) {
// if(this.$u.test.isEmpty(parts)) {
// this.parts = []
......@@ -204,7 +231,7 @@ export default {
},
/**
* workOrderId 工单ID,保内申请时必须指定
* applyType 申请类型:0 保内,1 备件,2 购买,10 使用备件
* applyType 申请类型:0 保内,1 物料,2 购买,10 使用物料
* remark 申请备注
* parts 申请的配件明细,JSON 格式,指定多条要申请的配件信息,
* 数组中的每个对象需要 part_id(配件ID)和 quantity(申请数量)两个字段。
......@@ -280,6 +307,10 @@ export default {
font-weight: bold;
color: #333333;
}
.more {
color: #2272FF;
font-size: 28rpx;
}
.body {
.list {
.sold-out {
......
......@@ -30,7 +30,7 @@
{
type: 'parts',
icon: 'successful.png',
title: '您的备件申请已提交成功',
title: '您的物料申请已提交成功',
message: '工作人员正在加紧审核中',
btnTxt: '我知道了'
},
......@@ -57,9 +57,9 @@
},
computed: {
title() {
if (this.nodeInfo.type == 'parts') return '备件申请结果页'
if (this.nodeInfo.type == 'parts') return '物料申请结果页'
if (this.nodeInfo.type == 'return') return '退件结果页'
return '备件申请结果页'
return '物料申请结果页'
},
nodeInfo() {
return this.nodes[this.curType]
......@@ -81,7 +81,7 @@
var prevPage = pages[pages.length - 2];
prevPage.needRefresh = true
}
if(this.isParts){ // 添加备件
if(this.isParts){ // 添加物料
this.$u.route({type:'back'})
}
if(this.isReturn){ // 退件
......
......@@ -67,7 +67,7 @@
},
validateForm() {
if(this.$u.test.isEmpty(this.parts)) {
this.$u.toast('备件不能为空')
this.$u.toast('物料不能为空')
return false
}
if(this.curWay == 0) {
......
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