Commit b7091b1c authored by Damon's avatar Damon

build: merge dev-1.5.0

parents ee1d935a 54dd796e
...@@ -11,6 +11,6 @@ const UNI_APP = { ...@@ -11,6 +11,6 @@ const UNI_APP = {
qn_base_url: 'https://qn-static.banshouhui.com/self-support/', qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
qn_asset_url: 'http://deudn.c.pp.cc/', qn_asset_url: 'http://deudn.c.pp.cc/',
argoDebugMode: 1, argoDebugMode: 1,
version: 'v1.4.9' version: 'v1.5.0'
} }
module.exports = UNI_APP; module.exports = UNI_APP;
;(function() { ;(function() {
let NODE_ENV = 'prod' // dev:开发环境 | test:测试环境 | prod:生产环境 let NODE_ENV = 'prod' // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null let ENV_VAR = null
let VERSION_NUMBER = '1.4.9' //版本号 let VERSION_NUMBER = '1.5.0' //版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频 //小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
if (NODE_ENV === 'dev') { if (NODE_ENV === 'dev') {
......
...@@ -10,7 +10,7 @@ const UNI_APP = { ...@@ -10,7 +10,7 @@ const UNI_APP = {
qn_base_url: 'https://qn-static.banshouhui.com/self-support/', qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
qn_asset_url: 'https://qn-static.banshouhui.com', qn_asset_url: 'https://qn-static.banshouhui.com',
argoDebugMode: 0, argoDebugMode: 0,
version: 'v1.4.9' version: 'v1.5.0'
} }
module.exports = UNI_APP; module.exports = UNI_APP;
...@@ -11,6 +11,6 @@ const UNI_APP = { ...@@ -11,6 +11,6 @@ const UNI_APP = {
qn_base_url: 'https://qn-static.banshouhui.com/self-support/', qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
qn_asset_url: 'https://qn-static.banshouhui.com', qn_asset_url: 'https://qn-static.banshouhui.com',
argoDebugMode: 1, argoDebugMode: 1,
version: 'v1.4.9' version: 'v1.5.0'
} }
module.exports = UNI_APP; module.exports = UNI_APP;
...@@ -188,7 +188,7 @@ let orderApiFun = function(vm){ ...@@ -188,7 +188,7 @@ let orderApiFun = function(vm){
let applyList = async (params = {}) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/orders', params); 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 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 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); 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) { ...@@ -19,22 +19,30 @@ let partsApiFun = function (vm) {
* 配件过滤-品类列表 * 配件过滤-品类列表
*/ */
let getCategoryList = async () => await vm.$u.get(base + vm.vuex_token + '/allow/category/list'); 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 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 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 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); let getMyReserve = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/items/reserve', params);
/** /**
...@@ -42,7 +50,7 @@ let partsApiFun = function (vm) { ...@@ -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 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); let returnParts = async (params = {}) => await vm.$u.post(parts + vm.vuex_token + '/return/new', params, formType);
...@@ -50,7 +58,9 @@ let partsApiFun = function (vm) { ...@@ -50,7 +58,9 @@ let partsApiFun = function (vm) {
getSiteAddress, getSiteAddress,
updateAddress, updateAddress,
getCategoryList, getCategoryList,
getClassify,
getBrandList, getBrandList,
getThreeLevel,
getPartsList, getPartsList,
applyParts, applyParts,
getMyReserve, getMyReserve,
......
...@@ -36,6 +36,21 @@ let settledApiFun = function(vm){ ...@@ -36,6 +36,21 @@ let settledApiFun = function(vm){
//我的合同// //我的合同//
let Mycontract = async (params)=>await vm.$u.get(ucenterApiUrl+'/v1/settled-contract/info'+'?Authorization='+ vm.vuex_token + 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 = { const settledApi = {
getSettleBaseInfo, getSettleBaseInfo,
getSettleArea, getSettleArea,
...@@ -53,6 +68,11 @@ let settledApiFun = function(vm){ ...@@ -53,6 +68,11 @@ let settledApiFun = function(vm){
listByNotice, listByNotice,
syncAddress, syncAddress,
Mycontract, Mycontract,
getMyAddress,
saveMyAddress,
deleteMyAddress,
getDefaultAddress,
setDefaultAddress
} }
return settledApi return settledApi
} }
......
<!-- ******************* 配件选择 ******************* --> <!-- ******************* 物料选择 ******************* -->
<template> <template>
<view> <view>
<view class="list u-flex u-row-between"> <view class="list u-flex u-row-between">
<image class="item-image" :src="mixingImage" v-if="item.required"></image> <image class="item-image" :src="mixingImage" v-if="item.required"></image>
<view class="u-m-r-20">{{item.fieldsTitle}}</view> <view class="u-m-r-20">{{ item.fieldsTitle }}</view>
<view class="u-flex-1 add-parts" @click="toParts" v-if="!disabled && lists.length > 0"> <view
添加备件<u-icon name="arrow-right" color="#2979ff" size="30"></u-icon> 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> </view>
<view class="complete-part"> <view class="complete-part">
<view v-if="lists.length > 0"> <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>
<view class="u-flex select-part" v-else> <view class="u-flex select-part" v-else>
<view class="img"> <view class="img">
<image :src="noPartsImage" class="part-icon" /> <image :src="noPartsImage" class="part-icon" />
</view> </view>
<view class="u-flex content"> <view class="u-flex content">
<text class="title">暂无备件信息</text> <text class="title">暂无物料信息</text>
<text class="desc">可选择备件仓备件</text> <text class="desc">可选择物料仓物料</text>
</view> </view>
<view class="btn"> <view class="btn">
<u-button shape="circle" :custom-style="customStyle" @click="toParts"> <u-button shape="circle" :custom-style="customStyle" @click="toParts">
...@@ -31,39 +42,39 @@ ...@@ -31,39 +42,39 @@
</template> </template>
<script> <script>
import adjustParts from "@/components/select-parts/adjust" import adjustParts from '@/components/select-parts/adjust'
import stringMixin from './stringMixin' import stringMixin from './stringMixin'
export default { export default {
name: 'XhParts', name: 'XhParts',
components: { components: {
adjustParts adjustParts,
}, },
mixins: [stringMixin], mixins: [stringMixin],
props: { props: {
orderId: { orderId: {
type: String, type: String,
default: '' default: '',
}, },
categoryId: { categoryId: {
type: String, type: String,
default: '' default: '',
}, },
brandId: { brandId: {
type: String, type: String,
default: '' default: '',
} },
}, },
data() { data() {
return { return {
lists: [] lists: [],
} }
}, },
computed: { computed: {
customStyle() { customStyle() {
return { return {
'width': '200rpx', width: '200rpx',
'height': '80rpx', height: '80rpx',
'color': '#2272FF', color: '#2272FF',
'font-size': '32rpx', 'font-size': '32rpx',
} }
}, },
...@@ -72,11 +83,6 @@ ...@@ -72,11 +83,6 @@
}, },
noPartsImage() { noPartsImage() {
return process.uniEnv.qn_base_url + 'no_parts.png' return process.uniEnv.qn_base_url + 'no_parts.png'
},
selectedParts() {
return this.lists.filter((item) => {
return item.quantity > 0
})
} }
}, },
mounted() { mounted() {
...@@ -85,49 +91,65 @@ ...@@ -85,49 +91,65 @@
methods: { methods: {
getWorkOrderParts() { getWorkOrderParts() {
// this.lists = JSON.parse(this.dataValue) || [] // this.lists = JSON.parse(this.dataValue) || []
console.log("this.dataValue", this.dataValue)
this.lists = this.dataValue ? JSON.parse(this.dataValue) : [] this.lists = this.dataValue ? JSON.parse(this.dataValue) : []
}, },
partsChange(val, index) { partsChange(val, index) {
this.$set(this.lists[index], 'quantity', val) this.$set(this.lists[index], 'quantity', val)
this.valueChange(JSON.stringify(this.selectedParts)) 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) { valChange(val) {
val.forEach(v => { val.forEach((v) => {
const index = this.lists.findIndex(k => k.part_id === v.part_id) const index = this.lists.findIndex((k) => k.part_id === v.part_id)
if (index < 0) { if (index < 0) {
this.lists.push(v) this.lists.push(v)
} else { } else {
this.$set(this.lists, index, v) this.$set(this.lists, index, v)
} }
}) })
this.valueChange(JSON.stringify(this.selectedParts)) this.valueChange(this.lists)
}, },
toParts() { toParts() {
uni.navigateTo({ uni.navigateTo({
url: `/pages/order/parts?workOrderId=${this.orderId}&brandId=${this.brandId}&categoryId=${this.categoryId}` url: `/pages/order/parts?workOrderId=${this.orderId}&brandId=${this.brandId}&categoryId=${this.categoryId}`,
}) })
} },
} },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.item-image { .item-image {
width: 24rpx; width: 24rpx;
height: 24rpx; height: 24rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
.required { .required {
padding-right: 10rpx; padding-right: 10rpx;
font-size: 28rpx; font-size: 28rpx;
line-height: 40rpx; line-height: 40rpx;
color: #fa3534; color: #fa3534;
} }
.add-parts { .add-parts {
color: #2272FF; color: #2272ff;
text-align: right; text-align: right;
} }
.complete-part { .complete-part {
.select-part { .select-part {
align-items: center; align-items: center;
height: 240rpx; height: 240rpx;
...@@ -150,7 +172,7 @@ ...@@ -150,7 +172,7 @@
overflow: hidden; overflow: hidden;
.title { .title {
text-align: left; text-align: left;
color: #2272FF; color: #2272ff;
font-size: 38rpx; font-size: 38rpx;
font-weight: bold; font-weight: bold;
margin-right: auto; margin-right: auto;
...@@ -163,5 +185,5 @@ ...@@ -163,5 +185,5 @@
} }
} }
} }
} }
</style> </style>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
buttons: { buttons: {
type: Array, type: Array,
default () { default () {
// id: 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照; 4 配件申请 // id: 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照; 4 物料申请
// label: 按钮文字, // label: 按钮文字,
// type: 'image' 上图片下文字;'text' 纯文字, // type: 'image' 上图片下文字;'text' 纯文字,
// image: 图片名, // image: 图片名,
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
id: 3 id: 3
}, },
{ {
label: '备件申请', label: '物料申请',
type: 'image', type: 'image',
image: 'peijian.png', image: 'peijian.png',
show: false, show: false,
......
...@@ -40,9 +40,14 @@ ...@@ -40,9 +40,14 @@
<view class="reason-view" v-if="showReason"> <view class="reason-view" v-if="showReason">
<view class="reason-title"><text>未通过原因:</text></view> <view class="reason-title"><text>未通过原因:</text></view>
<view class="reason-text" <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>
<text v-for="(item, index) in orderData.auditResults" :key="index">{{
item item
}}</text></view }}</text>
</view
> >
</view> </view>
<view class="bottom-view"> <view class="bottom-view">
......
<template> <template>
<!-- 已申请配件cell --> <!-- 已申请物料cell -->
<view class="return-cell" @click="handleClick"> <view class="return-cell" @click="handleClick">
<view class="title-view"> <view class="title-view">
<text class="title-text" :style="{'color': titleColor}">{{title}}</text> <text class="title-text" :style="{'color': titleColor}">{{title}}</text>
......
<template> <template>
<!-- 申请配件按钮 --> <!-- 申请物料按钮 -->
<view class="apply-button"> <view class="apply-button">
<u-button :custom-style="customStyle" shape="circle" @click.stop="handleClick" type="primary"> <u-button :custom-style="customStyle" shape="circle" @click.stop="handleClick" type="primary">
<u-icon class="apply-icon" name="plus"></u-icon> <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> </u-button>
</view> </view>
</template> </template>
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<view class="bottom-view"> <view class="bottom-view">
<view class="bottom-warehouse"> <view class="bottom-warehouse">
<view class="bottom-title"> <view class="bottom-title">
<text>备件订单</text> <text>物料订单</text>
<view class="order-file-right" @click="$u.throttle(handleClick, 500)"> <view class="order-file-right" @click="$u.throttle(handleClick, 500)">
<text>点击查看</text> <text>点击查看</text>
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
......
<template> <template>
<!-- 已申请配件cell --> <!-- 已申请物料cell -->
<view class="applied-cell" @click="handleClick"> <view class="applied-cell" @click="handleClick">
<view class="title-view"> <view class="title-view">
<text class="title-text">{{title}}</text> <text class="title-text">{{title}}</text>
......
## 配件数量调整组件使用说明 ## 物料数量调整组件使用说明
``` ```
该组件用于仓库配件的数量调整 该组件用于仓库物料的数量调整
``` ```
## API ## API
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
```json ```json
{ {
"name": "正泰漏保", // 配件名称 "name": "正泰漏保", // 物料名称
"quantity": 1, // 配件数量 "quantity": 1, // 物料数量
"min": 1, // 数量最小值 "min": 1, // 数量最小值
"max": 100 // 数量最大值 "max": 100 // 数量最大值
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
{{info.name}} {{info.name}}
</view> </view>
<view class="num"> <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> <text class="nums" v-else>x{{ info.quantity || 1 }}</text>
</view> </view>
</view> </view>
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
methods: { methods: {
numChange(event) { numChange(event) {
this.$emit('change', event.value) this.$emit('change', event.value)
},
minusValue(event) {
this.$emit('minusValue', event.value)
} }
} }
} }
......
## 配件选择组件使用说明 ## 物料选择组件使用说明
``` ```
该组件用于备件申请,数量调整 该组件用于物料申请,数量调整
``` ```
## API ## API
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
</view> </view>
<view class="u-flex bottom-right"> <view class="u-flex bottom-right">
<button :class="['btn', btnActive]" @click="submit">{{ submitTxt }}</button> <button :class="['btn', btnActive]" @click="submit">{{ submitTxt }}</button>
<button v-if="cancelStatus" :class="['btn', btnNotActive]" @click="cancel">不用物料</button>
</view> </view>
</view> </view>
</template> </template>
...@@ -44,7 +45,13 @@ ...@@ -44,7 +45,13 @@
return false return false
} }
}, },
partNum: { // 配件数量 cancelStatus: { // 是否显示取消按钮
type: Boolean,
default() {
return false
}
},
partNum: { // 物料数量
type: Number, type: Number,
default () { default () {
return 0 return 0
...@@ -64,7 +71,7 @@ ...@@ -64,7 +71,7 @@
}, },
customStyle: { customStyle: {
type: String, type: String,
default: 'background-color: #FFFFFF;padding: 0 30rpx;' default: 'background-color: #FFFFFF;'
}, },
}, },
...@@ -79,6 +86,9 @@ ...@@ -79,6 +86,9 @@
}, },
btnActive() { btnActive() {
return this.btnStatus ? 'btn-active' : '' return this.btnStatus ? 'btn-active' : ''
},
btnNotActive() {
return this.btnStatus ? '' : 'btn-active'
} }
}, },
watch: { watch: {
...@@ -95,6 +105,9 @@ ...@@ -95,6 +105,9 @@
}, },
submit() { submit() {
if (this.btnStatus) this.$emit('submit') if (this.btnStatus) this.$emit('submit')
},
cancel() {
if (!this.btnStatus) this.$emit('cancel')
} }
} }
} }
...@@ -128,7 +141,7 @@ ...@@ -128,7 +141,7 @@
.bottom-center { .bottom-center {
flex: 1; flex: 1;
align-items: flex-start; align-items: flex-start;
margin: 0 20rpx; margin-right: 20rpx;
.center-list { .center-list {
&:nth-of-type(1) { &:nth-of-type(1) {
color: #666; color: #666;
...@@ -165,7 +178,8 @@ ...@@ -165,7 +178,8 @@
} }
} }
.bottom-right { .bottom-right {
width: 360rpx; flex: 1;
// width: 360rpx;
// margin-right: 20rpx; // margin-right: 20rpx;
.btn { .btn {
width: 100%; width: 100%;
...@@ -176,6 +190,7 @@ ...@@ -176,6 +190,7 @@
text-align: center; text-align: center;
background: #D1D4D4; background: #D1D4D4;
color: #fff; color: #fff;
margin: 0 10rpx;
&::after { &::after {
content: ''; content: '';
height: 0; height: 0;
......
## 提交工具栏组件使用说明 ## 提交工具栏组件使用说明
``` ```
该组件用于勾选配件,显示配件数量以及提交操作 该组件用于勾选物料,显示物料数量以及提交操作
``` ```
## API ## API
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
| showChecked | Boolean | true | true/false | 是否显示勾选 | | showChecked | Boolean | true | true/false | 是否显示勾选 |
| allChecked | Boolean | true | true/false | 是否全选 | | allChecked | Boolean | true | true/false | 是否全选 |
| btnStatus | Boolean | true | true/false | 确定按钮是否可点击 | | btnStatus | Boolean | true | true/false | 确定按钮是否可点击 |
| partNum | Number | 0 | | 配件数量 | | partNum | Number | 0 | | 物料数量 |
| num | Number | 0 | | 合计总件数 | | num | Number | 0 | | 合计总件数 |
| submitTxt | String | 确定 | | 确定按钮文字 | | submitTxt | String | 确定 | | 确定按钮文字 |
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
} }
}, },
computed: { computed: {
// 配件数 // 物料数
partNum() { partNum() {
return 0 return 0
}, },
......
<template> <template>
<view class="item" @click="$u.throttle(editSite, 500)"> <view class="item">
<view class="userinfo u-flex"> <view class="userinfo u-flex" @click="$u.throttle(selectSite, 500)">
<view class="name">{{ formatName }}</view> <view class="name">{{ formatName }}</view>
<view class="mobile">{{ formatMobile }}</view> <view class="mobile">{{ formatMobile }}</view>
</view> </view>
<view class="siteinfo u-flex u-row-between u-col-top"> <view class="siteinfo u-flex u-row-between u-col-top">
<view class="txt">{{ formatAddress }}</view> <view class="txt" @click="$u.throttle(selectSite, 500)">{{ formatAddress }}</view>
<u-icon custom-prefix="wxh" name="pen" size="32"></u-icon> <u-icon custom-prefix="wxh" name="pen" size="32" @click="$u.throttle(editSite, 500)"></u-icon>
</view> </view>
<view class="default" v-show="isDefault"> <view class="u-flex u-row-between default" v-if="siteType !== 'view'">
<u-icon name="checkmark-circle" color="#2272FF" size="32"></u-icon> <view @click="$u.throttle(setDefault, 500)">
<u-icon name="checkmark-circle" :color="isDefault ? '#2272FF' : '#999'" size="32"></u-icon>
<text class="txt">默认地址</text> <text class="txt">默认地址</text>
</view> </view>
<view @click="$u.throttle(remove, 500)">
<text class="txt">删除</text>
</view>
</view>
</view> </view>
</template> </template>
...@@ -84,9 +89,18 @@ export default { ...@@ -84,9 +89,18 @@ export default {
} }
}, },
methods: { methods: {
selectSite() {
this.$emit('select-site', this.info)
},
editSite() { editSite() {
this.$emit('edit-site', this.info) this.$emit('edit-site', this.info)
}, },
setDefault() {
this.$emit('set-default', this.info)
},
remove() {
this.$emit('remove', this.info)
}
} }
}; };
</script> </script>
......
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
"path": "deposit/index", "path": "deposit/index",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "备件押金", "navigationBarTitleText": "物料押金",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
...@@ -277,7 +277,7 @@ ...@@ -277,7 +277,7 @@
"path": "warehouse/index", "path": "warehouse/index",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "备件订单", "navigationBarTitleText": "物料订单",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true "disableScroll": true
} }
...@@ -286,7 +286,7 @@ ...@@ -286,7 +286,7 @@
"path": "warehouse/spare", "path": "warehouse/spare",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "备件库", "navigationBarTitleText": "物料库",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true "disableScroll": true
} }
...@@ -304,7 +304,7 @@ ...@@ -304,7 +304,7 @@
"path": "warehouse/searchParts", "path": "warehouse/searchParts",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": " ", // 备件单搜索 "navigationBarTitleText": " ",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F5F7", "navigationBarBackgroundColor": "#F4F5F7",
"disableScroll": true "disableScroll": true
...@@ -314,7 +314,7 @@ ...@@ -314,7 +314,7 @@
"path": "warehouse/express", "path": "warehouse/express",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": " ", // 备件单物流 "navigationBarTitleText": " ",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F5F7", "navigationBarBackgroundColor": "#F4F5F7",
"disableScroll": true "disableScroll": true
...@@ -333,7 +333,7 @@ ...@@ -333,7 +333,7 @@
"path": "warehouse/partsDetail", "path": "warehouse/partsDetail",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "", // 备件详情 "navigationBarTitleText": "",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true "disableScroll": true
} }
...@@ -411,7 +411,7 @@ ...@@ -411,7 +411,7 @@
{ {
"path": "document-tag", "path": "document-tag",
"style": { "style": {
"navigationBarTitleText": "", // 合作商或品牌标签列表 "navigationBarTitleText": "",
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true "disableScroll": true
...@@ -420,7 +420,7 @@ ...@@ -420,7 +420,7 @@
{ {
"path": "specification", "path": "specification",
"style": { "style": {
"navigationBarTitleText": "", // 完工-产品规格 "navigationBarTitleText": "",
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true "disableScroll": true
...@@ -429,7 +429,7 @@ ...@@ -429,7 +429,7 @@
{ {
"path": "parts", "path": "parts",
"style": { "style": {
"navigationBarTitleText": "可用备件", "navigationBarTitleText": "可用物料",
"disableScroll": true "disableScroll": true
} }
} }
...@@ -558,7 +558,7 @@ ...@@ -558,7 +558,7 @@
{ {
"path":"application", "path":"application",
"style": { "style": {
"navigationBarTitleText": "备件申请", "navigationBarTitleText": "物料申请",
"navigationStyle": "custom", "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
} }
...@@ -566,7 +566,7 @@ ...@@ -566,7 +566,7 @@
{ {
"path": "addParts", "path": "addParts",
"style": { "style": {
"navigationBarTitleText": "备件选择", "navigationBarTitleText": "物料选择",
"disableScroll": true "disableScroll": true
} }
} }
...@@ -574,7 +574,7 @@ ...@@ -574,7 +574,7 @@
"path" : "nodes", "path" : "nodes",
"style" : "style" :
{ {
"navigationBarTitleText": "备件申请、返件成功", "navigationBarTitleText": "物料申请、返件成功",
"navigationStyle":"custom", "navigationStyle":"custom",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
......
...@@ -141,14 +141,14 @@ ...@@ -141,14 +141,14 @@
return [ return [
{ {
pathName: 'warehouse/index', pathName: 'warehouse/index',
title: '备件订单', title: '物料订单',
value: '', value: '',
icon: process.uniEnv.qn_base_url + 'wodepeijian.png', icon: process.uniEnv.qn_base_url + 'wodepeijian.png',
imageStyle: 'width:60rpx;height:54rpx' imageStyle: 'width:60rpx;height:54rpx'
}, },
{ {
pathName: 'warehouse/spare', pathName: 'warehouse/spare',
title: '备件库', title: '物料库',
value: '', value: '',
icon: process.uniEnv.qn_base_url + 'wodebeijian.png', icon: process.uniEnv.qn_base_url + 'wodebeijian.png',
imageStyle: 'width:60rpx;height:54rpx' imageStyle: 'width:60rpx;height:54rpx'
......
...@@ -309,6 +309,10 @@ export default { ...@@ -309,6 +309,10 @@ export default {
if (type == 'exception') { if (type == 'exception') {
this.$u.api.workerDealWithError(item.orderId).then(() => {}) 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({ uni.navigateTo({
url: url:
...@@ -329,7 +333,7 @@ export default { ...@@ -329,7 +333,7 @@ export default {
'&brandId=' + '&brandId=' +
item.lianbaoBrandId + item.lianbaoBrandId +
'&auditResults=' + '&auditResults=' +
(item.auditResults ? Object.keys(item.auditResults).join() : '') + (auditResults ? auditResults.join() : '') +
'&orderNumber=' + '&orderNumber=' +
item.orderNumber item.orderNumber
}) })
......
...@@ -67,6 +67,7 @@ export default { ...@@ -67,6 +67,7 @@ export default {
location: '', location: '',
address: '', address: '',
type: '充电桩安装', type: '充电桩安装',
id: null,
name: '', name: '',
mobile: '', mobile: '',
nameStatus: true, nameStatus: true,
...@@ -107,6 +108,10 @@ export default { ...@@ -107,6 +108,10 @@ export default {
this.siteType = 'edit'; this.siteType = 'edit';
} }
if(e.id) {
this.id = decodeURIComponent(e.id);
}
if(e.name) { if(e.name) {
this.name = decodeURIComponent(e.name); this.name = decodeURIComponent(e.name);
} }
...@@ -264,19 +269,20 @@ export default { ...@@ -264,19 +269,20 @@ export default {
if(!this.validateForm()) { if(!this.validateForm()) {
return false return false
} }
if (this.siteType === 'add') { if (this.siteType === 'select') {
} else if (this.siteType === 'select') {
this.commitSite() this.commitSite()
} else if (this.siteType === 'edit') { } else {
if (this.$u.test.isEmpty(this.siteInfo)) { if (this.$u.test.isEmpty(this.siteInfo)) {
let params = { let params = {
updateFlag: true, mobile: this.mobile,
name: this.name,
provinceName: this.region[0], provinceName: this.region[0],
cityName: this.region[1], cityName: this.region[1],
districtName: this.region[2], districtName: this.region[2],
address: this.region.join("") + this.address 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) { if (res && res.code == 200) {
this.$u.route({ type: 'back' }); this.$u.route({ type: 'back' });
this.show = false this.show = false
......
<template> <template>
<view class="address-wrap"> <view class="u-flex address-wrap">
<w-navbar title="收货地址"></w-navbar> <w-navbar title="收货地址"></w-navbar>
<view class="body" v-if="hasAdderss"> <view class="lists">
<w-address @editSite="toAddSite" :info="info" :is-default="true" /> <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>
</view> </view>
</template> </template>
...@@ -15,31 +23,24 @@ export default { ...@@ -15,31 +23,24 @@ export default {
background: { background: {
backgroundColor: 'none' backgroundColor: 'none'
}, },
info: { lists: [],
name: '', type: ''
mobile: '',
address: '',
region: [],
},
}; };
}, },
computed: { computed: {
editPen() { editPen() {
return process.uniEnv.qn_base_url + 'icon/edit-pen.png' return process.uniEnv.qn_base_url + 'icon/edit-pen.png'
}, },
hasAdderss() { submitBtn() {
return this.info.address
},
addressInfo() {
return { return {
name: this.name, color: '#FFFFFF',
mobile: this.mobile, backgroundColor: '#2272FF'
address: this.address,
region: this.region || [],
} }
} }
}, },
onLoad() { onLoad(options) {
if (options) this.type = options.type
getApp().trackPage('我的收获地址页') getApp().trackPage('我的收获地址页')
}, },
onShow() { onShow() {
...@@ -53,32 +54,92 @@ export default { ...@@ -53,32 +54,92 @@ export default {
this.getMineSite() this.getMineSite()
}, },
getMineSite() { getMineSite() {
this.$u.api.getSiteAddress().then((res) => { this.$u.api.getMyAddress().then((res) => {
const data = res.data const data = res.data
if(res.code == 200 && !this.$u.test.isEmpty(data)) { if (data.length > 0) {
this.lists = data.map(v => {
let region = [] let region = []
if(data.provinceName && data.cityName && data.districtName) { if(v.provinceName && v.cityName && v.districtName) {
region = [data.provinceName, data.cityName, data.districtName] region = [v.provinceName, v.cityName, v.districtName]
} }
this.info = { v.region = region
name: data.name, return v
mobile: data.mobile, })
address: data.address,
region: region,
} }
})
},
toAddSite() {
this.$u.route({
url: 'pages/mine/address/addSite',
params: {
type: 'add'
} }
}) })
}, },
toAddSite(title){ setDefault(val) {
const region = this.info.region.join('-') 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,
})
}
})
}
}
})
},
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({ this.$u.route({
url: 'pages/mine/address/addSite', url: 'pages/mine/address/addSite',
params: { params: {
type: 'edit', type: 'edit',
region: region, region: region,
name: this.info.name, name: val.name,
mobile: this.info.mobile, mobile: val.mobile,
address: this.info.address, address: val.address,
id: val.id
} }
}) })
} }
...@@ -89,6 +150,13 @@ export default { ...@@ -89,6 +150,13 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.address-wrap { .address-wrap {
background-color: #F4F5F7; background-color: #F4F5F7;
flex-direction:column;
height: 100vh;
.lists {
width: 100%;
flex: 1;
overflow-y:auto;
}
} }
.body { .body {
padding: 30rpx; padding: 30rpx;
...@@ -96,4 +164,24 @@ export default { ...@@ -96,4 +164,24 @@ export default {
border-radius: 12rpx; border-radius: 12rpx;
background-color: #FFFFFF; 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> </style>
<template> <template>
<!-- 备件订单 --> <!-- 物料订单 -->
<view class="ware-house"> <view class="ware-house">
<u-navbar back-icon-color="#333333" background="#FFFFFF" title="备件订单" titleColor="#333333" <u-navbar back-icon-color="#333333" background="#FFFFFF" title="物料订单" titleColor="#333333"
:border-bottom="false" title-bold></u-navbar> :border-bottom="false" title-bold></u-navbar>
<!-- 搜索 --> <!-- 搜索 -->
<view class="search-view" @click.self="handleClickSearch"> <view class="search-view" @click.self="handleClickSearch">
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<u-loading mode="flower"></u-loading> <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" /> :customStyle="noPartsCustomStyle" />
<template v-else> <template v-else>
<!-- 列表 --> <!-- 列表 -->
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
return { return {
pageNumber: 0, pageNumber: 0,
pageSize: 10, pageSize: 10,
partsList: [], // 备件订单列表 partsList: [], // 物料订单列表
currentIndex: 0, // 当前tab的index currentIndex: 0, // 当前tab的index
loadStatus: 'loading', // 底部加载状态 loadStatus: 'loading', // 底部加载状态
loaded: false, // 页面加载 loaded: false, // 页面加载
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('备件订单页') getApp().trackPage('物料订单页')
if (e && e.index) { // 跳转到第几个tab页 if (e && e.index) { // 跳转到第几个tab页
this.currentIndex = e.index this.currentIndex = e.index
} }
......
<template> <template>
<!-- 我的备件 --> <!-- 我的物料 -->
<view class="ware-house-spare"> <view class="ware-house-spare">
<u-navbar back-icon-color="#333333" background="#FFFFFF" title="备件库" titleColor="#333333" <u-navbar back-icon-color="#333333" background="#FFFFFF" title="物料库" titleColor="#333333"
:border-bottom="false" title-bold></u-navbar> :border-bottom="false" title-bold></u-navbar>
<!-- 搜索 --> <!-- 搜索 -->
<view class="search-view"> <view class="search-view">
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
</u-search> </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> <template v-else>
<view class="title-view" v-if="loaded"> <view class="title-view" v-if="loaded">
<view>备件列表</view> <view>物料列表</view>
<view class="title-right-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>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<u-button v-else :custom-style="buttonStyle" shape="circle" @click="handleClickBounce">退件 ×</u-button> <u-button v-else :custom-style="buttonStyle" shape="circle" @click="handleClickBounce">退件 ×</u-button>
</view> </view>
</view> </view>
<!-- 备件列表 --> <!-- 物料列表 -->
<view class="tab-view"> <view class="tab-view">
<scroll-view scroll-y style="height: 100%;width: 100%;" scroll-anchoring enable-back-to-top @scroll="scroll"> <scroll-view scroll-y style="height: 100%;width: 100%;" scroll-anchoring enable-back-to-top @scroll="scroll">
<!-- 加载转圈页面 --> <!-- 加载转圈页面 -->
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
}, },
data() { data() {
return { return {
partsList: [], // 备件列表 partsList: [], // 物料列表
loaded: false, // 加载状态 loaded: false, // 加载状态
showBounce: false, // 是否进入推荐模式 showBounce: false, // 是否进入推荐模式
keyword: '', // 搜索框内的关键字 keyword: '', // 搜索框内的关键字
...@@ -147,8 +147,8 @@ ...@@ -147,8 +147,8 @@
} }
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('备件库页') getApp().trackPage('物料库页')
this.getReserveList() // 获取备件列表 this.getReserveList() // 获取物料列表
}, },
onShow() { onShow() {
// 退件之后刷新页面 // 退件之后刷新页面
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
} }
}, },
methods: { methods: {
getReserveList() { // 备件列表 getReserveList() { // 物料列表
this.loaded = false this.loaded = false
var param = {} var param = {}
if (this.keyword) { if (this.keyword) {
...@@ -213,10 +213,10 @@ ...@@ -213,10 +213,10 @@
item.quantity = value ? item.stock : 0 item.quantity = value ? item.stock : 0
} }
}, },
handleChange(value, index) { // 备件cell勾选改变 handleChange(value, index) { // 物料cell勾选改变
this.partsList[index].selected = value this.partsList[index].selected = value
}, },
handleNumChange(value, index) { // 备件cell内数量改变 handleNumChange(value, index) { // 物料cell内数量改变
this.partsList[index].quantity = value this.partsList[index].quantity = value
}, },
handleSubmit() { // 提交 handleSubmit() { // 提交
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
url: 'pages/parts/returnParts', url: 'pages/parts/returnParts',
}) })
}, },
// 点击了申请备件按钮 // 点击了申请物料按钮
handleClickApply() { handleClickApply() {
uni.navigateTo({ uni.navigateTo({
url: 'pages/parts/application?applyType=1' url: 'pages/parts/application?applyType=1'
......
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
:itemIndex="itemIndex" :itemIndex="itemIndex"
:item="item" :item="item"
:value="form[item.fieldsName] || ''" :value="form[item.fieldsName] || ''"
:disabled="exception || readOnly" :disabled="readOnly"
@value-change="fieldValueChange" @value-change="fieldValueChange"
> >
</xh-parts> </xh-parts>
...@@ -989,11 +989,10 @@ export default { ...@@ -989,11 +989,10 @@ export default {
this.$u.api.saveCompleteData(param, this.orderId).then(async (res) => { this.$u.api.saveCompleteData(param, this.orderId).then(async (res) => {
if (res.code == 200) { if (res.code == 200) {
//完工项信息保存成功再次完工工单 //完工项信息保存成功再次完工工单
if (!this.exception) { // if (!this.exception) { // 核销配件
// 核销配件 // const submitPart = await this.submitParts()
const submitPart = await this.submitParts() // if (!submitPart) return
if (!submitPart) return // }
}
if (this.inGuaranteePeriod === 'Y') { if (this.inGuaranteePeriod === 'Y') {
this.$u.api.inOrderFinish(this.orderId).then((res) => { this.$u.api.inOrderFinish(this.orderId).then((res) => {
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
return { return {
labels: [], // 标签列表 labels: [], // 标签列表
selectedId: '', // 已选中标签的id selectedId: '', // 已选中标签的id
type: '1', // '1': '合作商', '2': '品牌', '9': '备件品牌' type: '1', // '1': '合作商', '2': '品牌', '9': '物料品牌'
}; };
}, },
onLoad(e) { onLoad(e) {
...@@ -44,21 +44,21 @@ ...@@ -44,21 +44,21 @@
return { return {
'1': '合作商', '1': '合作商',
'2': '品牌', '2': '品牌',
'9': ' ' // 备件品牌 '9': ' ' // 物料品牌
} }
}, },
keys() { keys() {
return { return {
'1': 'id', // 合作商 '1': 'id', // 合作商
'2': 'id', // 品牌 '2': 'id', // 品牌
'9': 'brandId' // 备件品牌 '9': 'brandId' // 物料品牌
} }
}, },
nameKeys() { nameKeys() {
return { return {
'1': 'name', // 合作商 '1': 'name', // 合作商
'2': 'name', // 品牌 '2': 'name', // 品牌
'9': 'brandName' // 备件品牌 '9': 'brandName' // 物料品牌
} }
} }
}, },
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
this.labels = res.data || [] this.labels = res.data || []
} }
}, },
// 获取备件品牌 // 获取物料品牌
getBrandList(categoryId) { getBrandList(categoryId) {
this.$u.api.getBrandList({categoryId: categoryId}).then(res => { this.$u.api.getBrandList({categoryId: categoryId}).then(res => {
if (res.code === 200) { if (res.code === 200) {
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<view slot="error" style="font-size: 24rpx;">加载失败</view> <view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image> </u-image>
</view> </view>
<view class="message">当前无可用备件</view> <view class="message">当前无可用物料</view>
</view> </view>
<view class="bar" v-if="lists.length > 0"> <view class="bar" v-if="lists.length > 0">
...@@ -27,9 +27,12 @@ ...@@ -27,9 +27,12 @@
:partNum="partNum" :partNum="partNum"
:num="num" :num="num"
:btnStatus="partNum > 0" :btnStatus="partNum > 0"
submitTxt="用物料"
:allChecked="allChecked" :allChecked="allChecked"
:cancelStatus="true"
@select="allSelect" @select="allSelect"
@submit="submit" @submit="submit"
@cancel="cancel"
/> />
</view> </view>
</view> </view>
...@@ -105,7 +108,8 @@ ...@@ -105,7 +108,8 @@
name: v.name, name: v.name,
part_id: v.skuId, part_id: v.skuId,
quantity: v.quantity, quantity: v.quantity,
max: v.max max: v.max,
cost: v.cost || 0
} }
}) })
...@@ -114,6 +118,9 @@ ...@@ -114,6 +118,9 @@
prevPage.$vm.$refs['fileChildParts'][0].valChange(lists) prevPage.$vm.$refs['fileChildParts'][0].valChange(lists)
this.$u.route({ type: 'back' }) this.$u.route({ type: 'back' })
}, },
cancel() {
this.$u.route({ type: 'back' })
},
qnFile(src) { qnFile(src) {
return process.uniEnv.qn_base_url + src return process.uniEnv.qn_base_url + src
} }
......
This diff is collapsed.
<template> <template>
<view class="app-wrap"> <view class="app-wrap">
<w-navbar title="备件申请" navbar-color="#FFFFFF" /> <w-navbar title="物料申请" navbar-color="#FFFFFF" />
<view class="content"> <view class="content">
<view class="card parts"> <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 class="u-flex u-row-between title" v-else>
<view>选择备件</view> <view>选择物料</view>
<u-icon name="arrow-right" size="24" color="#2272FF" <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"/> label-pos="left" label-color="#2272FF" label-size="26"/>
</view> </view>
<view class="body"> <view class="body">
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<view slot="error" style="font-size: 24rpx;">加载失败</view> <view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image> </u-image>
</view> </view>
<view class="message">当前还未选择备件,请点击添加,添加后在'我的->备件订单'查看</view> <view class="message">当前还未选择物料,请点击添加,添加后在'我的->物料订单'查看</view>
<button class="add-button" plain="true" @click="$u.throttle(addParts, 500)">去添加</button> <button class="add-button" plain="true" @click="$u.throttle(addParts, 500)">去添加</button>
</view> </view>
<view v-else class="list"> <view v-else class="list">
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
:info="row" :info="row"
:show-checked="false" :show-checked="false"
@change="numChange($event, index)" @change="numChange($event, index)"
@minusValue="minusValue($event, index)"
></select-parts> ></select-parts>
</view> </view>
</view> </view>
...@@ -34,9 +35,12 @@ ...@@ -34,9 +35,12 @@
</view> </view>
</view> </view>
<view class="card address"> <view class="card address">
<view class="u-flex u-row-between">
<view class="title">收件信息</view> <view class="title">收件信息</view>
<view class="more" @click="toAddress">更多地址></view>
</view>
<view class="body"> <view class="body">
<w-address :info="addressInfo" @editSite="editSite" /> <w-address :info="addressInfo" @editSite="editSite" @selectSite="editSite" siteType="view" />
</view> </view>
</view> </view>
</view> </view>
...@@ -89,7 +93,7 @@ export default { ...@@ -89,7 +93,7 @@ export default {
} }
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('备件申请页') getApp().trackPage('物料申请页')
this.orderId = e && Number(e.orderId) || 0 this.orderId = e && Number(e.orderId) || 0
this.applyType = e && Number(e.applyType) || 0 this.applyType = e && Number(e.applyType) || 0
this.initData() this.initData()
...@@ -100,7 +104,7 @@ export default { ...@@ -100,7 +104,7 @@ export default {
this.loadOrderInfo() this.loadOrderInfo()
}, },
loadAddress() { loadAddress() {
this.$u.api.getSiteAddress().then((res) => { this.$u.api.getDefaultAddress().then((res) => {
if(res.code == 200 && res.data) { if(res.code == 200 && res.data) {
this.addressInfo.name = res.data.name this.addressInfo.name = res.data.name
this.addressInfo.mobile = res.data.mobile this.addressInfo.mobile = res.data.mobile
...@@ -139,6 +143,14 @@ export default { ...@@ -139,6 +143,14 @@ export default {
} }
}) })
}, },
toAddress() {
this.$u.route({
url: "pages/mine/address/index",
params: {
type: 'parts'
}
})
},
updateSite(site) { updateSite(site) {
this.addressInfo = site this.addressInfo = site
}, },
...@@ -161,6 +173,21 @@ export default { ...@@ -161,6 +173,21 @@ export default {
numChange(val, index) { numChange(val, index) {
this.$set(this.parts[index], 'quantity', val) 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) { updateParts(parts) {
// if(this.$u.test.isEmpty(parts)) { // if(this.$u.test.isEmpty(parts)) {
// this.parts = [] // this.parts = []
...@@ -204,7 +231,7 @@ export default { ...@@ -204,7 +231,7 @@ export default {
}, },
/** /**
* workOrderId 工单ID,保内申请时必须指定 * workOrderId 工单ID,保内申请时必须指定
* applyType 申请类型:0 保内,1 备件,2 购买,10 使用备件 * applyType 申请类型:0 保内,1 物料,2 购买,10 使用物料
* remark 申请备注 * remark 申请备注
* parts 申请的配件明细,JSON 格式,指定多条要申请的配件信息, * parts 申请的配件明细,JSON 格式,指定多条要申请的配件信息,
* 数组中的每个对象需要 part_id(配件ID)和 quantity(申请数量)两个字段。 * 数组中的每个对象需要 part_id(配件ID)和 quantity(申请数量)两个字段。
...@@ -280,6 +307,10 @@ export default { ...@@ -280,6 +307,10 @@ export default {
font-weight: bold; font-weight: bold;
color: #333333; color: #333333;
} }
.more {
color: #2272FF;
font-size: 28rpx;
}
.body { .body {
.list { .list {
.sold-out { .sold-out {
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
{ {
type: 'parts', type: 'parts',
icon: 'successful.png', icon: 'successful.png',
title: '您的备件申请已提交成功', title: '您的物料申请已提交成功',
message: '工作人员正在加紧审核中', message: '工作人员正在加紧审核中',
btnTxt: '我知道了' btnTxt: '我知道了'
}, },
...@@ -57,9 +57,9 @@ ...@@ -57,9 +57,9 @@
}, },
computed: { computed: {
title() { title() {
if (this.nodeInfo.type == 'parts') return '备件申请结果页' if (this.nodeInfo.type == 'parts') return '物料申请结果页'
if (this.nodeInfo.type == 'return') return '退件结果页' if (this.nodeInfo.type == 'return') return '退件结果页'
return '备件申请结果页' return '物料申请结果页'
}, },
nodeInfo() { nodeInfo() {
return this.nodes[this.curType] return this.nodes[this.curType]
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
var prevPage = pages[pages.length - 2]; var prevPage = pages[pages.length - 2];
prevPage.needRefresh = true prevPage.needRefresh = true
} }
if(this.isParts){ // 添加备件 if(this.isParts){ // 添加物料
this.$u.route({type:'back'}) this.$u.route({type:'back'})
} }
if(this.isReturn){ // 退件 if(this.isReturn){ // 退件
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
}, },
validateForm() { validateForm() {
if(this.$u.test.isEmpty(this.parts)) { if(this.$u.test.isEmpty(this.parts)) {
this.$u.toast('备件不能为空') this.$u.toast('物料不能为空')
return false return false
} }
if(this.curWay == 0) { 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