Commit f3ab7678 authored by Damon's avatar Damon

refactor: 页面-备件-物料

parent b256eb56
......@@ -186,7 +186,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);
......
......@@ -28,13 +28,13 @@ let partsApiFun = function (vm) {
*/
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 +42,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);
......
......@@ -250,72 +250,72 @@
"path": "deposit/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "备件押金",
"navigationBarTitleText": "物料押金",
"enablePullDownRefresh": false
}
},
{
"path": "setting/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "设置",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "setting/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "设置",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "warehouse/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "备件订单",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "warehouse/spare",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "备件库",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "warehouse/return",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "返件信息",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "warehouse/searchParts",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": " ", // 备件单搜索
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F5F7",
"disableScroll": true
}
},
{
"path": "warehouse/express",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": " ", // 备件单物流
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F5F7",
"disableScroll": true
}
"navigationBarTitleText": "物料订单",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "warehouse/spare",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "物料库",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "warehouse/return",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "返件信息",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "warehouse/searchParts",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": " ", // 物料单搜索
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F5F7",
"disableScroll": true
}
},
{
"path": "warehouse/express",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": " ", // 物料单物流
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F5F7",
"disableScroll": true
}
},
{
"path": "warehouse/records",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "出库记录",
"enablePullDownRefresh": false,
"enablePullDownRefresh": false,
"disableScroll": true
}
},
......@@ -323,7 +323,7 @@
"path": "warehouse/partsDetail",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "", // 备件详情
"navigationBarTitleText": "", // 物料详情
"enablePullDownRefresh": false,
"disableScroll": true
}
......@@ -397,29 +397,29 @@
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "document-tag",
"style": {
"navigationBarTitleText": "", // 合作商或品牌标签列表
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "specification",
"style": {
"navigationBarTitleText": "", // 完工-产品规格
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "document-tag",
"style": {
"navigationBarTitleText": "", // 合作商或品牌标签列表
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "specification",
"style": {
"navigationBarTitleText": "", // 完工-产品规格
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "parts",
"style": {
"navigationBarTitleText": "可用备件",
"navigationBarTitleText": "可用物料",
"disableScroll": true
}
}
......@@ -548,7 +548,7 @@
{
"path":"application",
"style": {
"navigationBarTitleText": "备件申请",
"navigationBarTitleText": "物料申请",
"navigationStyle": "custom",
"disableScroll": true
}
......@@ -556,7 +556,7 @@
{
"path": "addParts",
"style": {
"navigationBarTitleText": "备件选择",
"navigationBarTitleText": "物料选择",
"disableScroll": true
}
}
......@@ -564,7 +564,7 @@
"path" : "nodes",
"style" :
{
"navigationBarTitleText": "备件申请、返件成功",
"navigationBarTitleText": "物料申请、返件成功",
"navigationStyle":"custom",
"enablePullDownRefresh": false
}
......
This diff is collapsed.
<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'
......
......@@ -182,7 +182,7 @@
}
},
buttons() {
//id: 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照; 4 备件申请
//id: 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照; 4 物料申请
// label: 按钮文字,
// type: 'image' 上图片下文字;'text' 纯文字,
// image: 图片名,
......@@ -214,7 +214,7 @@
id: 3
},
{
label: '备件申请',
label: '物料申请',
type: 'image',
image: 'peijian.png',
show: this.allowFeedback,
......@@ -340,7 +340,7 @@
} else {
this.loadOrderRecord() // 履约记录
this.getSignDistance() // 定位
// this.getOrderPartsSum() // 备件单数量
// this.getOrderPartsSum() // 物料单数量
}
},
onShow() {
......
<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">
......@@ -65,8 +65,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()
},
......
......@@ -123,7 +123,7 @@ export default {
return {
loadmore: '上拉加载更多',
loading: '努力加载中',
nomore: this.pageNumber > 1 ? '没有更多了' : '未找到备件'
nomore: this.pageNumber > 1 ? '没有更多了' : '未找到物料'
}
}
},
......@@ -188,7 +188,7 @@ export default {
if (item && index) {
this.selectBrand(item, index)
this.scrollId = `brand${item.brandId}`
} else {
} else {
this.brandId = this.brand[0].brandId
this.lists = []
this.getPartsList()
......
<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">
......@@ -89,7 +89,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()
......@@ -204,7 +204,7 @@ export default {
},
/**
* workOrderId 工单ID,保内申请时必须指定
* applyType 申请类型:0 保内,1 备件,2 购买,10 使用备件
* applyType 申请类型:0 保内,1 物料,2 购买,10 使用物料
* remark 申请备注
* parts 申请的配件明细,JSON 格式,指定多条要申请的配件信息,
* 数组中的每个对象需要 part_id(配件ID)和 quantity(申请数量)两个字段。
......
......@@ -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