Commit f3ab7678 authored by Damon's avatar Damon

refactor: 页面-备件-物料

parent b256eb56
...@@ -186,7 +186,7 @@ let orderApiFun = function(vm){ ...@@ -186,7 +186,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);
......
...@@ -28,13 +28,13 @@ let partsApiFun = function (vm) { ...@@ -28,13 +28,13 @@ let partsApiFun = function (vm) {
*/ */
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 +42,7 @@ let partsApiFun = function (vm) { ...@@ -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 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);
......
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
"path": "deposit/index", "path": "deposit/index",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "备件押金", "navigationBarTitleText": "物料押金",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
"path": "warehouse/index", "path": "warehouse/index",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "备件订单", "navigationBarTitleText": "物料订单",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true "disableScroll": true
} }
...@@ -276,7 +276,7 @@ ...@@ -276,7 +276,7 @@
"path": "warehouse/spare", "path": "warehouse/spare",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "备件库", "navigationBarTitleText": "物料库",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true "disableScroll": true
} }
...@@ -294,7 +294,7 @@ ...@@ -294,7 +294,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
...@@ -304,7 +304,7 @@ ...@@ -304,7 +304,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
...@@ -323,7 +323,7 @@ ...@@ -323,7 +323,7 @@
"path": "warehouse/partsDetail", "path": "warehouse/partsDetail",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "", // 备件详情 "navigationBarTitleText": "", // 物料详情
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true "disableScroll": true
} }
...@@ -419,7 +419,7 @@ ...@@ -419,7 +419,7 @@
{ {
"path": "parts", "path": "parts",
"style": { "style": {
"navigationBarTitleText": "可用备件", "navigationBarTitleText": "可用物料",
"disableScroll": true "disableScroll": true
} }
} }
...@@ -548,7 +548,7 @@ ...@@ -548,7 +548,7 @@
{ {
"path":"application", "path":"application",
"style": { "style": {
"navigationBarTitleText": "备件申请", "navigationBarTitleText": "物料申请",
"navigationStyle": "custom", "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
} }
...@@ -556,7 +556,7 @@ ...@@ -556,7 +556,7 @@
{ {
"path": "addParts", "path": "addParts",
"style": { "style": {
"navigationBarTitleText": "备件选择", "navigationBarTitleText": "物料选择",
"disableScroll": true "disableScroll": true
} }
} }
...@@ -564,7 +564,7 @@ ...@@ -564,7 +564,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'
......
<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'
......
...@@ -182,7 +182,7 @@ ...@@ -182,7 +182,7 @@
} }
}, },
buttons() { buttons() {
//id: 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照; 4 备件申请 //id: 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照; 4 物料申请
// label: 按钮文字, // label: 按钮文字,
// type: 'image' 上图片下文字;'text' 纯文字, // type: 'image' 上图片下文字;'text' 纯文字,
// image: 图片名, // image: 图片名,
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
id: 3 id: 3
}, },
{ {
label: '备件申请', label: '物料申请',
type: 'image', type: 'image',
image: 'peijian.png', image: 'peijian.png',
show: this.allowFeedback, show: this.allowFeedback,
...@@ -340,7 +340,7 @@ ...@@ -340,7 +340,7 @@
} else { } else {
this.loadOrderRecord() // 履约记录 this.loadOrderRecord() // 履约记录
this.getSignDistance() // 定位 this.getSignDistance() // 定位
// this.getOrderPartsSum() // 备件单数量 // this.getOrderPartsSum() // 物料单数量
} }
}, },
onShow() { onShow() {
......
...@@ -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">
......
...@@ -123,7 +123,7 @@ export default { ...@@ -123,7 +123,7 @@ export default {
return { return {
loadmore: '上拉加载更多', loadmore: '上拉加载更多',
loading: '努力加载中', loading: '努力加载中',
nomore: this.pageNumber > 1 ? '没有更多了' : '未找到备件' nomore: this.pageNumber > 1 ? '没有更多了' : '未找到物料'
} }
} }
}, },
......
<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">
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,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()
...@@ -204,7 +204,7 @@ export default { ...@@ -204,7 +204,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(申请数量)两个字段。
......
...@@ -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