Commit f242b1ca authored by 刘文虎's avatar 刘文虎

1.5.7版本更新 收货 盘点功能

parent aebe688a
import util from '@/utils/util.js' import util from '@/utils/util.js'
const jsonType = {'content-type': 'application/json'} const jsonType = {
const formType = {'content-type': 'application/x-www-form-urlencoded'} 'content-type': 'application/json'
const dataType = {'content-type': 'multipart/form-data'} }
const formType = {
'content-type': 'application/x-www-form-urlencoded'
}
const dataType = {
'content-type': 'multipart/form-data'
}
let inventoryApiFun = function(vm){ let inventoryApiFun = function(vm) {
// 接口公共前缀 // 接口公共前缀
let parts="/wxh-worker-rest/rest/parts/" //收货 inventory 模块 let parts = "/wxh-worker-rest/rest/parts/" //收货 inventory 模块
/** /**
* 收货列表 * 盘点列表
*/ */
let inventoryListByInventoryModules = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/take/stock/take/stock', params); let inventoryListByInventoryModules = async (params = {}) => await vm.$u.get(parts + vm.vuex_token +
'/take/stock/take/stock', params);
/** /**
* 收货单详情 * 盘点详情
*/ */
let inventoryDetailByInventoryModules = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/take/stock/sign/detail/'+ params); let inventoryDetailByInventoryModules = async (params = {}) => await vm.$u.get(parts + vm.vuex_token +
'/take/stock/detail/' + params);
/** /**
* 确认收货 * 新增盘点
*/ */
let addInventoryByInventoryModules = async (params = {}) => await vm.$u.post(parts + vm.vuex_token + '/take/stock/detail/add', params,formType); let addInventoryByInventoryModules = async (params = {}) => await vm.$u.post(parts + vm.vuex_token +
'/take/stock/detail/add', params, formType);
/**
* 删除盘点
*/
let deleteInventoryByInventoryModules = async (params = {}) => await vm.$u.get(parts + vm.vuex_token +
'/take/stock/detail/delete/' + params);
/**
* 提交盘点
*/
let confirmInventoryByInventoryModules = async (params = {}) => await vm.$u.get(parts + vm.vuex_token +
'/take/stock/take/submit/' + params);
/**
* 提交盘点
*/
let applyReInventoryByInventoryModules = async (params = {}) => await vm.$u.get(parts + vm.vuex_token +
'/take/stock/take/submit/' + params);
const inventoryApi = { const inventoryApi = {
inventoryListByInventoryModules, inventoryListByInventoryModules,
inventoryDetailByInventoryModules, inventoryDetailByInventoryModules,
addInventoryByInventoryModules, addInventoryByInventoryModules,
deleteInventoryByInventoryModules,
confirmInventoryByInventoryModules,
applyReInventoryByInventoryModules
} }
return inventoryApi return inventoryApi
} }
......
// 自定义filter // 自定义filter
export function myFilter(value, options,key="label") { export function myFilter(value, options, key = "label") {
if (options && options instanceof Array) { if (options && options instanceof Array) {
let arr = options.filter(item => item.value === value) let arr = options.filter(item => item.value === value)
if (arr.length) { if (arr.length) {
...@@ -13,12 +13,12 @@ export function myFilter(value, options,key="label") { ...@@ -13,12 +13,12 @@ export function myFilter(value, options,key="label") {
} }
// showToast // showToast
export function showToast(title,mask=true) { export function showToast(title, mask = true) {
uni.showToast({ uni.showToast({
title, title,
icon: 'none', icon: 'none',
mask, mask,
duration:2000 duration: 2000
}) })
} }
...@@ -47,3 +47,11 @@ export function showModal({ ...@@ -47,3 +47,11 @@ export function showModal({
}); });
}, 1); }, 1);
} }
export function setNeedRefresh() {
var pages = getCurrentPages();
if (pages.length >= 2) {
var page = pages[pages.length - 2];
page.needRefresh = true
}
}
export const inventoryStatusOptions = [{
value: "0",
label: "盘点中",
},
{
value: "1",
label: "已提交",
},
{
value: "2",
label: "申请重盘",
},
{
value: "3",
label: "盘点完成",
},
]
export const takeDetailStatusOptions = [{
value: "0",
label: "匹配",
},
{
value: "1",
label: "已使用",
},
{
value: "2",
label: "未在库",
}
]
...@@ -7,3 +7,19 @@ export const receiveStatusOptions = [{ ...@@ -7,3 +7,19 @@ export const receiveStatusOptions = [{
value: 1 value: 1
} }
] ]
export const statusOptions = [{
label: '未使用',
value: "0"
},
{
label: '已使用',
value: "1"
}
]
export const statusColorOptions = {
"已使用": '#666666',
"匹配": '#2272ff',
"未在库": '#FA5A49'
}
<template> <template>
<!-- 底部按钮 --> <!-- 底部按钮 -->
<view class="fixed-button"><xh-button @handleClick="handleClick" :text="text"></xh-button></view> <view class="fixed-button"><xh-button :disabled="disabled" :text="text" @handleClick="handleClick"></xh-button></view>
</template> </template>
<script> <script>
import XhButton from "./xh-button.vue" import XhButton from './xh-button.vue';
export default { export default {
name:"FixedButton", name: 'FixedButton',
components:{ components: {
XhButton XhButton
}, },
props:{ props: {
text:{ text: {
type:String, type: String | null,
default:"提交" default: '提交'
},
disabled:{
type:Boolean,
default: false
} }
}, },
data() { data() {
...@@ -26,9 +30,9 @@ export default { ...@@ -26,9 +30,9 @@ export default {
} }
}; };
}, },
methods:{ methods: {
handleClick(){ handleClick() {
this.$emit("handleClick") this.$emit('handleClick');
} }
} }
}; };
...@@ -39,6 +43,7 @@ export default { ...@@ -39,6 +43,7 @@ export default {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
position: fixed; position: fixed;
z-index: 99999;
left: 0; left: 0;
padding: 0 30rpx; padding: 0 30rpx;
padding-bottom: constant(safe-area-inset-bottom); padding-bottom: constant(safe-area-inset-bottom);
......
<template> <template>
<u-button class="settle-button" type="primary" shape="circle" @click="handleClick" :custom-style="buttonStyle">{{ text }}</u-button> <u-button class="settle-button" type="primary" shape="circle" @click="handleClick" :disabled="disabled" :custom-style="buttonStyle">{{ text }}</u-button>
</template> </template>
<script> <script>
...@@ -7,8 +7,12 @@ export default { ...@@ -7,8 +7,12 @@ export default {
name: 'XhButton', name: 'XhButton',
props: { props: {
text: { text: {
type: String, type: String | null,
default: '提交' default: '提交'
},
disabled:{
type:Boolean,
default: false
} }
}, },
data() { data() {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
export default { export default {
props: { props: {
customStyle: { customStyle: {
type: String, type: String|null,
default: 'background-color: #FFFFFF' default: 'background-color: #FFFFFF'
}, },
imageName: { // 图片 imageName: { // 图片
......
...@@ -388,7 +388,8 @@ ...@@ -388,7 +388,8 @@
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "充电桩收货", "navigationBarTitleText": "充电桩收货",
"enablePullDownRefresh": false "enablePullDownRefresh": false,
"disableScroll": true
} }
}, },
......
This diff is collapsed.
This diff is collapsed.
...@@ -265,9 +265,6 @@ export default { ...@@ -265,9 +265,6 @@ export default {
app.getBaseInfo(self); app.getBaseInfo(self);
}, },
handleClick(path, isWarehouse) { handleClick(path, isWarehouse) {
this.$u.route({
url: 'pages/mine/' + path
});
if (this.vuex_token) { if (this.vuex_token) {
// 没入驻不能进入仓配相关页面 // 没入驻不能进入仓配相关页面
if (isWarehouse && this.needSettled) { if (isWarehouse && this.needSettled) {
...@@ -284,7 +281,6 @@ export default { ...@@ -284,7 +281,6 @@ export default {
} else { } else {
this.$u.route({ url: 'pages/login/index' }); this.$u.route({ url: 'pages/login/index' });
} }
}, },
handleClickSetting() { handleClickSetting() {
this.$u.route({ url: 'pages/mine/setting/index' }); this.$u.route({ url: 'pages/mine/setting/index' });
...@@ -449,7 +445,7 @@ export default { ...@@ -449,7 +445,7 @@ export default {
} }
.ware-house-title-received { .ware-house-title-received {
font-size: 24rpx; font-size: 24rpx;
color: #409eff; color: #2272ff;
} }
} }
.ware-house-content { .ware-house-content {
......
This diff is collapsed.
...@@ -3,7 +3,11 @@ ...@@ -3,7 +3,11 @@
<view class="xh-select" :style="{ width: width }"> <view class="xh-select" :style="{ width: width }">
<view class="u-flex u-row-between picker-common" :class="{ border: border }" :style="{ background: background }"> <view class="u-flex u-row-between picker-common" :class="{ border: border }" :style="{ background: background }">
<picker mode="selector" :value="index" :range-key="rangeKey" :range="list" @click="onOpen" @change="pickerChange" @cancel="close" class="u-flex-1" :disabled="disabled"> <picker mode="selector" :value="index" :range-key="rangeKey" :range="list" @click="onOpen" @change="pickerChange" @cancel="close" class="u-flex-1" :disabled="disabled">
<view class="txt">{{ text || placeholder }}</view> <view class="txt">
<view class="text-inner">
{{ text || placeholder }}
</view>
</view>
</picker> </picker>
<u-icon class="input-icon" color="#2272FF" :name="show ? 'arrow-up' : 'arrow-down'"></u-icon> <u-icon class="input-icon" color="#2272FF" :name="show ? 'arrow-up' : 'arrow-down'"></u-icon>
</view> </view>
...@@ -121,7 +125,6 @@ export default { ...@@ -121,7 +125,6 @@ export default {
border-radius: 6px; border-radius: 6px;
color: #333333; color: #333333;
padding-left: 10px; padding-left: 10px;
padding-right: 50rpx;
width: 100%; width: 100%;
height: 36px; height: 36px;
.u-flex-1 { .u-flex-1 {
...@@ -129,11 +132,15 @@ export default { ...@@ -129,11 +132,15 @@ export default {
.txt { .txt {
font-size: 14px; font-size: 14px;
width: 100%; width: 100%;
.text-inner{
padding-right: 50rpx;
width: 100%;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
} }
}
} }
.border { .border {
border: 2upx solid #eeeeee; border: 2upx solid #eeeeee;
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
<view class="goods-count"> <view class="goods-count">
<view class="goods-count-item"> <view class="goods-count-item">
<view class="goods-count-item-title">充电桩库存量</view> <view class="goods-count-item-title">充电桩库存量</view>
<view class="goods-count-item-count">{{inventoryCount}}</view> <view class="goods-count-item-count">{{signCount}}</view>
</view> </view>
<view class="goods-count-line"></view> <view class="goods-count-line"></view>
<view class="goods-count-item"> <view class="goods-count-item">
<view class="goods-count-item-title">充电桩盘点量</view> <view class="goods-count-item-title">充电桩盘点量</view>
<view class="goods-count-item-count">{{checkCount}}</view> <view class="goods-count-item-count">{{takeCount}}</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
export default { export default {
name: 'GoodsCount', name: 'GoodsCount',
props:{ props:{
inventoryCount:{ signCount:{
type:Number, type:Number,
default:0 default:0
}, },
checkCount:{ takeCount:{
type:Number, type:Number,
default:0 default:0
}, },
......
...@@ -4,54 +4,61 @@ ...@@ -4,54 +4,61 @@
<view class="tools-box-left"> <view class="tools-box-left">
<view class="tools-box-left-title">选择品牌</view> <view class="tools-box-left-title">选择品牌</view>
<view class="tools-box-left-select"><xh-picker-select background="#f4f5f7" placeholder="全部" :rangeKey="rangeKey" :value="value" :list="brandList" @change="pickerchange"></xh-picker-select></view> <view class="tools-box-left-select">
<xh-picker-select background="#f4f5f7" placeholder="全部" :rangeKey="rangeKey" :value="value" :list="brandList" @change="pickerchange"></xh-picker-select>
</view> </view>
<view class="tools-box-navi">
<xh-button @handleClick="naviTo" text="去盘点"></xh-button>
</view> </view>
<view class="tools-box-navi"><xh-button :disabled="buttonShow" @handleClick="naviTo" text="去盘点"></xh-button></view>
</view> </view>
</template> </template>
<script> <script>
import XhPickerSelect from '../XhPickerSelect.vue'; import XhPickerSelect from '../XhPickerSelect.vue';
import XhButton from "@/components/mine/xh-button.vue" import XhButton from '@/components/mine/xh-button.vue';
import { receiveStatusOptions } from '@/common/optinos/mine/received.js'; import { showToast } from '@/common/common.js';
export default { export default {
props: ['current','value'], props: {
current: {
type: Number | null
},
value: {
type: Number | null
},
takeStatus: {
type: Number | null,
default: 9
}
},
components: { components: {
XhPickerSelect, XhPickerSelect,
XhButton XhButton
}, },
data() { data() {
return { return {
receiveStatusOptions, rangeKey: 'name',
rangeKey:"name", brandList: []
brandList: [
{
id:0,
name:'全部',
},
{
id:982,
name:'长城',
},
],
}; };
}, },
computed: {
buttonShow() {
return this.takeStatus !== 0 && this.takeStatus !== 1;
}
},
methods: { methods: {
// 获取品牌列表 // 获取品牌列表
async getBrandList() { async getBrandList() {
let res = await this.$u.api.brandListByReceivedModules(); let res = await this.$u.api.brandListByReceivedModules();
let { code, data } = res; let { code, data, message } = res;
if (code === 200){ if (code === 200) {
this.brandList = data || []; this.brandList = data || [];
} else {
showToast(message);
} }
}, },
pickerchange(data) { pickerchange(data) {
this.$emit('pickerchange', data); this.$emit('pickerchange', data);
}, },
naviTo(){ naviTo() {
this.$emit('toAdd'); this.$emit('toAdd');
} }
} }
...@@ -66,27 +73,27 @@ export default { ...@@ -66,27 +73,27 @@ export default {
align-items: center; align-items: center;
margin-bottom: 30rpx; margin-bottom: 30rpx;
height: 100rpx; height: 100rpx;
background-color: #FFFFFF; background-color: #ffffff;
padding: 0 30rpx; padding: 0 30rpx;
border-radius: 12rpx; border-radius: 12rpx;
&-left{ &-left {
display: flex; display: flex;
align-items: center; align-items: center;
&-title{ &-title {
width: 120rpx; width: 120rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
margin-right: 20rpx; margin-right: 20rpx;
} }
&-select{ &-select {
width: 240rpx; width: 240rpx;
background-color: #ffffff; background-color: #ffffff;
border-radius: 8rpx; border-radius: 8rpx;
} }
} }
&-navi{ &-navi {
width: 180rpx; width: 180rpx;
} }
} }
......
<template> <template>
<uni-swipe-action-item :right-options="rightOptions" @click.stop="swipeClick" > <uni-swipe-action-item :right-options="rightOptions" @click.stop="swipeClick">
<view class="receiving-info" @click.stop="handleClick"> <view class="receiving-info" @click.stop="handleClick">
<view class="receiving-info-content"> <view class="receiving-info-content">
<text class="receiving-info-content-left">箱码</text> <text class="receiving-info-content-left">箱码</text>
<text class="receiving-info-content-right">{{ detail.code }}</text> <text class="receiving-info-content-right">{{ detail.productCode }}</text>
</view> </view>
<view class="receiving-info-content"> <view class="receiving-info-content">
<text class="receiving-info-content-left">状态</text> <text class="receiving-info-content-left">状态</text>
<text class="receiving-info-content-right" :class="[statusColor]">{{ statusLabel }}</text> <text class="receiving-info-content-right" :style="{ color: statusColor }">{{ takeStatusLabel }}</text>
</view> </view>
</view> </view>
</uni-swipe-action-item> </uni-swipe-action-item>
</template> </template>
<script> <script>
import { myFilter } from '@/common/common.js'; import { statusColorOptions } from '@/common/optinos/mine/received.js';
import { receiveStatusOptions } from '@/common/optinos/mine/received.js'; import { takeDetailStatusOptions } from '@/common/optinos/mine/inventory.js';
import { showModal } from '@/common/common.js'; import { showModal,myFilter } from '@/common/common.js';
export default { export default {
name: 'ReceivingInfo', name: 'ReceivingInfo',
props: { props: {
...@@ -26,17 +26,14 @@ export default { ...@@ -26,17 +26,14 @@ export default {
}, },
/* 品牌类型 */ /* 品牌类型 */
options: { options: {
type: Array|null, type: Array | null,
default: () => [] default: () => []
} }
}, },
data() { data() {
return { return {
receiveStatusOptions, takeDetailStatusOptions,
statusColorOptions: { statusColorOptions,
1: 'receiving-info-footer-status-grey',
2: 'receiving-info-footer-status-blue'
},
rightOptions: [ rightOptions: [
{ {
text: '取消', text: '取消',
...@@ -55,11 +52,10 @@ export default { ...@@ -55,11 +52,10 @@ export default {
}, },
computed: { computed: {
statusColor() { statusColor() {
return this.statusColorOptions[this.detail.status] || ''; return this.statusColorOptions[this.takeStatusLabel] || '';
}, },
statusLabel() { takeStatusLabel(){
// 按钮文字 return myFilter(this.detail.status, this.takeDetailStatusOptions);
return myFilter(this.detail.status, this.receiveStatusOptions, 'name');
}, },
brandLabel() { brandLabel() {
return myFilter(this.detail.brand, this.options); return myFilter(this.detail.brand, this.options);
...@@ -78,14 +74,14 @@ export default { ...@@ -78,14 +74,14 @@ export default {
}, },
handleClick() { handleClick() {
this.$emit('handleClick', this.detail.id); this.$emit('handleClick', this.detail.detailId);
}, },
openDelete(index) { openDelete(index) {
showModal({ showModal({
content: '删除车辆后,将无法收到车辆信息,是否删除该车辆?', content: '是否删除该数据?',
success: res => { success: res => {
if (res.confirm) { if (res.confirm) {
this.$emit('handleDelete', this.detail.id ); this.$emit('handleDelete', this.detail.detailId);
} }
} }
}); });
......
...@@ -73,8 +73,8 @@ export default { ...@@ -73,8 +73,8 @@ export default {
let { scanType, result } = res; let { scanType, result } = res;
console.log('类型:' + scanType); console.log('类型:' + scanType);
console.log('内容:' + result); console.log('内容:' + result);
this.dataValue = result; this.dataValue = result.substring(0,200);
this.$emit('onBarCodeChange', result); this.$emit('onBarCodeChange', this.dataValue);
} }
}); });
}, },
......
<template>
<view class="receive-images">
<view class="title-view">
<view class="title-left-view" >
<text>{{ uploadForm.label }}</text>
</view>
<view class="info-tip-text" v-if="!disabled">{{ uploadForm.tips }}</view>
<view class="image-view">
<block v-for="(item, key) in uploadForm.imgs" :key="key">
<view class="info-image-box" v-if="key < uploadForm.count">
<image class="info-image-box-inner" mode="aspectFill" v-if="item.path" :src="item.path" @click="perview(key)"></image>
<view class="info-image-box-close" v-if="!disabled" @click="removeImage(key)"><u-icon name="close"></u-icon></view>
</view>
</block>
<view class="info-image-box" @click="handleClick" v-if="!disabled&&uploadForm.imgs.length < uploadForm.count">
<view class="info-image-box-add"><u-icon name="plus"></u-icon></view>
</view>
</view>
<view v-if="!disabled&&uploadForm.imgs.length == 0" class="bottom-tip-view">
<image class="bottom-tip-image" mode="widthFix" :src="tishiImage"></image>
<text>最少上传一张箱码照片</text>
</view>
</view>
</view>
</template>
<script>
import base from '@/components/upload/index';
export default {
name: 'ReceiveImages',
mixins: [base],
props: {
disabled: {
type: Boolean,
default: false,
},
},
data() {
return {
tishiImage: process.uniEnv.qn_base_url + 'tishi.png',
uploadForm: {
filedName: '',
count: 3,
label: '箱码照片',
tips: '上传箱码照片',
imgs: []
}
};
},
computed: {},
created() {},
mounted() {
this.initImages();
},
methods: {
initImages(images) {
this.uploadForm.imgs = images || [];
console.log(this.uploadForm.imgs)
},
valueChange(e) {
this.$emit('onScanCodeChange', e);
},
async handleClick() {
if(this.disabled) return false;
let { count, imgs } = this.uploadForm;
// let imgCount=count-imgs.length;
// 已满3张不能再上传
if (imgs.length === count) {
return false;
}
let imgList = await this.chooseImg({ count: 1, size: ['compressed'] });
this.uploadForm.imgs.push(...imgList);
console.log(this.uploadForm.imgs)
this.updateImages();
},
// 预览
perview(index) {
let urls = this.uploadForm.imgs.map(item => {
return item.path;
});
uni.previewImage({
current: index,
urls: urls
});
},
removeImage(index) {
this.uploadForm.imgs.splice(index, 1);
this.updateImages();
},
updateImages() {
this.$emit('updateImages', this.uploadForm.imgs);
}
}
};
</script>
<style lang="scss" scoped>
.receive-images {
background-color: #ffffff;
border-radius: 12rpx;
padding: 20rpx 30rpx;
margin-bottom: 20rpx;
color: #333333;
.title-view {
font-size: 32rpx;
.title-left-view {
font-weight: bold;
}
.info-tip-text {
font-size: 24rpx;
color: #666666;
margin-top: 10rpx;
}
}
.bottom-tip-view {
color: #999999;
font-size: 20rpx;
display: flex;
align-items: flex-start;
margin-top: 30rpx;
}
.bottom-tip-image {
width: 22rpx;
height: 22rpx;
margin-right: 8rpx;
margin-top: 4rpx;
flex-shrink: 0;
}
.image-view {
margin-top: 30rpx;
display: flex;
.info-image-box {
width: 216rpx;
height: 216rpx;
background-color: #cccccc;
position: relative;
margin-right: 20rpx;
border-radius: 12rpx;
&:last-child {
margin-right: 0;
}
}
.info-image-box-inner {
border-radius: 12rpx;
overflow: hidden;
width: 100%;
height: 100%;
}
.info-image-box-close {
width: 38rpx;
height: 38rpx;
border-radius: 50%;
background-color: #666666;
font-size: 22rpx;
line-height: 38rpx;
color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: -8rpx;
right: -8rpx;
z-index: 1;
}
.info-image-box-add {
width: 100%;
height: 100%;
font-size: 120rpx;
color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
}
}
}
</style>
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
computed: {}, computed: {},
created() {}, created() {},
mounted() { mounted() {
this.initImages(); // this.initImages();
}, },
methods: { methods: {
initImages(images) { initImages(images) {
...@@ -69,9 +69,9 @@ export default { ...@@ -69,9 +69,9 @@ export default {
if (imgs.length === count) { if (imgs.length === count) {
return false; return false;
} }
let imgList = await this.chooseImg({ count: 1, size: ['compressed'] }); // size: ["original",'compressed']
let imgList = await this.chooseImg({ count: 1 });
this.uploadForm.imgs.push(...imgList); this.uploadForm.imgs.push(...imgList);
console.log(this.uploadForm.imgs)
this.updateImages(); this.updateImages();
}, },
// 预览 // 预览
......
...@@ -80,8 +80,8 @@ export default { ...@@ -80,8 +80,8 @@ export default {
console.log('类型:' + scanType); console.log('类型:' + scanType);
console.log('内容:' + result); console.log('内容:' + result);
if (scanType === 'QR_CODE') { if (scanType === 'QR_CODE') {
this.dataValue = result; this.dataValue = result.substring(0,200);
this.$emit("onScanCodeChange",result) this.$emit("onScanCodeChange",this.dataValue)
} }
} }
}); });
......
...@@ -22,15 +22,16 @@ ...@@ -22,15 +22,16 @@
<script> <script>
import XhPickerSelect from '../XhPickerSelect.vue'; import XhPickerSelect from '../XhPickerSelect.vue';
import { receiveStatusOptions } from '@/common/optinos/mine/received.js'; import { receiveStatusOptions } from '@/common/optinos/mine/received.js';
import { showToast } from '@/common/common.js';
export default { export default {
props: ['current','value'], props: ['current', 'value'],
components: { components: {
XhPickerSelect XhPickerSelect
}, },
data() { data() {
return { return {
receiveStatusOptions, receiveStatusOptions,
rangeKey:"name", rangeKey: 'name',
brandList: [] brandList: []
}; };
}, },
...@@ -38,9 +39,11 @@ export default { ...@@ -38,9 +39,11 @@ export default {
// 获取品牌列表 // 获取品牌列表
async getBrandList() { async getBrandList() {
let res = await this.$u.api.brandListByReceivedModules(); let res = await this.$u.api.brandListByReceivedModules();
let { code, data } = res; let { code, data, message } = res;
if (code === 200){ if (code === 200) {
this.brandList = data || []; this.brandList = data || [];
} else {
showToast(message);
} }
}, },
// tab栏切换 // tab栏切换
......
...@@ -9,14 +9,14 @@ ...@@ -9,14 +9,14 @@
<text class="receiving-info-content-right">{{ detail.brandName }}</text> <text class="receiving-info-content-right">{{ detail.brandName }}</text>
</view> </view>
<view class="receiving-info-footer"> <view class="receiving-info-footer">
<view :class="[statusColor]">{{ detail.status }}</view> <view :class="[statusColor]">{{ statusLabel }}</view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { myFilter } from '@/common/common.js'; import { myFilter } from '@/common/common.js';
import { receiveStatusOptions } from '@/common/optinos/mine/received.js'; import { statusOptions } from '@/common/optinos/mine/received.js';
export default { export default {
name: 'ReceivingInfo', name: 'ReceivingInfo',
props: { props: {
...@@ -27,23 +27,23 @@ export default { ...@@ -27,23 +27,23 @@ export default {
}, },
data() { data() {
return { return {
receiveStatusOptions statusOptions
}; };
}, },
computed: { computed: {
statusColor() { statusColor() {
return this.detail.status === "已使用" ? 'receiving-info-footer-status-grey' : 'receiving-info-footer-status-blue'; return this.detail.status === "1" ? 'receiving-info-footer-status-grey' : 'receiving-info-footer-status-blue';
}, },
statusLabel() { statusLabel() {
// 按钮文字 // 按钮文字
return myFilter(this.detail.status, this.receiveStatusOptions, 'name'); return myFilter(this.detail.status, this.statusOptions);
}, },
}, },
created() {}, created() {},
methods: { methods: {
handleClick() { handleClick() {
this.$emit('handleClick', this.detail.id); this.$emit('handleClick', this.detail.signId);
} }
} }
}; };
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
enable-back-to-top enable-back-to-top
> >
<!-- 加载中 && 没有下拉:显示加载中 --> <!-- 加载中 && 没有下拉:显示加载中 -->
<view class="loading-view" v-if="!loaded && _freshing"><u-loading mode="flower"></u-loading></view> <view class="loading-view" v-if="!loaded && freshing"><u-loading mode="flower"></u-loading></view>
<!-- 无数据 --> <!-- 无数据 -->
<NoOrder v-else-if="noParts" imageName="wupeijianxinxi.png" text="当前暂无物料信息" :customStyle="noPartsCustomStyle" /> <NoOrder v-else-if="noParts" imageName="wupeijianxinxi.png" text="当前暂无物料信息" :customStyle="noPartsCustomStyle" />
<template v-else> <template v-else>
...@@ -92,7 +92,7 @@ export default { ...@@ -92,7 +92,7 @@ export default {
loadStatus: 'loading', // 底部加载状态 loadStatus: 'loading', // 底部加载状态
loaded: false, // 页面加载 loaded: false, // 页面加载
triggered: true, // true:下拉刷新 triggered: true, // true:下拉刷新
_freshing: false, // 防止下拉刷新重复触发 freshing: false, // 防止下拉刷新重复触发
buttonType: 'expand' // 申请按钮宽 collapse': '80rpx', 'expand': '220rpx'' buttonType: 'expand' // 申请按钮宽 collapse': '80rpx', 'expand': '220rpx''
}; };
}, },
...@@ -157,7 +157,7 @@ export default { ...@@ -157,7 +157,7 @@ export default {
// 跳转到第几个tab页 // 跳转到第几个tab页
this.currentIndex = e.index; this.currentIndex = e.index;
} }
this._freshing = false; this.freshing = false;
this.reloadPartsList(); // 加载数据 this.reloadPartsList(); // 加载数据
}, },
onShow() { onShow() {
...@@ -204,9 +204,9 @@ export default { ...@@ -204,9 +204,9 @@ export default {
} }
this.$nextTick(() => { this.$nextTick(() => {
// 页面刷新完之后更新下拉状态 // 页面刷新完之后更新下拉状态
if (this._freshing) { if (this.freshing) {
this.triggered = false; this.triggered = false;
this._freshing = false; this.freshing = false;
} }
}); });
this.loaded = true; // 加载完成 this.loaded = true; // 加载完成
...@@ -270,8 +270,8 @@ export default { ...@@ -270,8 +270,8 @@ export default {
}, },
// 下拉刷新 // 下拉刷新
onRefresh() { onRefresh() {
if (this._freshing) return; if (this.freshing) return;
this._freshing = true; this.freshing = true;
this.reloadPartsList(); this.reloadPartsList();
}, },
// 重置下拉状态 // 重置下拉状态
......
This diff is collapsed.
<template> <template>
<!-- 收货详情 --> <!-- 收货详情 -->
<view class="ware-house"> <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="{ backgroundColor: '#F4F5F7' }" title="盘点" titleColor="#333333" :border-bottom="false" title-bold></u-navbar>
<view class="tools-box"> <view class="tools-box">
<text class="tools-box-title">品牌</text> <text class="tools-box-title">品牌</text>
<view class="select-view"> <view class="select-view">
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
</view> </view>
<!-- 列表 --> <!-- 列表 -->
<view class="tab-view"> <view class="tab-view">
<receive-qr-code @onScanCodeChange="onScanCodeChange"></receive-qr-code> <receive-qr-code :disabled="disabled" :value="form.productCode" @onScanCodeChange="onScanCodeChange"></receive-qr-code>
<receive-images ref="receive-images" @updateImages="updateImages"></receive-images> <receive-images ref="receive-images" :value="form.image" :disabled="disabled" @updateImages="updateImages"></receive-images>
</view> </view>
<!-- 底部按钮 --> <!-- 底部按钮 -->
<fixed-button text="保存并下一个" @handleClick="submit"></fixed-button> <fixed-button text="保存并下一个" @handleClick="submit" v-if="!disabled"></fixed-button>
<!-- 通用提示框 --> <!-- 通用提示框 -->
<view><u-toast ref="uToast" /></view> <view><u-toast ref="uToast" /></view>
</view> </view>
...@@ -36,7 +36,7 @@ import FixedButton from '@/components/mine/fixed-button.vue'; ...@@ -36,7 +36,7 @@ import FixedButton from '@/components/mine/fixed-button.vue';
import ReceiveQrCode from './components/receiveDetail/receiveQrCode.vue'; import ReceiveQrCode from './components/receiveDetail/receiveQrCode.vue';
import ReceiveImages from './components/receiveDetail/receiveImages.vue'; import ReceiveImages from './components/receiveDetail/receiveImages.vue';
import { receiveStatusOptions } from '@/common/optinos/mine/received.js'; import { receiveStatusOptions } from '@/common/optinos/mine/received.js';
import { showToast } from '@/common/common.js'; import { showToast,setNeedRefresh } from '@/common/common.js';
export default { export default {
components: { components: {
XhPickerSelect, XhPickerSelect,
...@@ -48,16 +48,8 @@ export default { ...@@ -48,16 +48,8 @@ export default {
return { return {
receiveStatusOptions, receiveStatusOptions,
rangeKey: 'name', rangeKey: 'name',
brandList: [ disabled:false,
{ brandList: [],
id: 0,
name: '全部'
},
{
id: 982,
name: '长城'
}
],
form: { form: {
id: '', id: '',
takeId: '', takeId: '',
...@@ -71,42 +63,53 @@ export default { ...@@ -71,42 +63,53 @@ export default {
computed: {}, computed: {},
onLoad(e) { onLoad(e) {
this.getBrandList(); this.getBrandList();
if (e && e.id) { console.log(e)
this.form.id = e.id; if (e) {
let {id,takeId}=e
this.form.takeId = takeId;
if(id){
this.form.id = id;
this.getDetail(); this.getDetail();
this.disabled = true; this.disabled = true;
} }
}
}, },
onShow() {}, onShow() {},
methods: { methods: {
pickerchange(data) { pickerchange(data) {
this.form.brandId = data.id; this.form.brandId = data.id;
this.form.brandName = data.brandName; this.form.brandName = data.name;
}, },
onScanCodeChange(data) { onScanCodeChange(data) {
this.form.productCode = data; this.form.productCode = data;
}, },
updateImages(data) { updateImages(data) {
let image = data.map(item => process.uniEnv.qn_asset_url + '/' + item.src + '?imageView2/1/w/100/h/100/q/75'); let image = data.map(item => process.uniEnv.qn_asset_url + '/' + item.src);
// + '?imageView2/1/w/100/h/100/q/75' 添加此项为图片参数,配置大小
this.form.image = image.join(";"); this.form.image = image.join(";");
}, },
// 获取品牌列表 // 获取品牌列表
async getBrandList() { async getBrandList() {
let res = await this.$u.api.brandListByReceivedModules(); let res = await this.$u.api.brandListByReceivedModules();
let { code, data } = res; let { code, data,message } = res;
if (code === 200) { if (code === 200) {
this.brandList = data || []; this.brandList = data || [];
}else{
showToast(message);
} }
}, },
async getDetail() { async getDetail() {
let res = await this.$u.api.inventoryDetailByInventoryModules(this.form.id); let res = await this.$u.api.inventoryDetailByInventoryModules(this.form.id);
let { code, data } = res; let { code, data,message } = res;
if (code === 200) { if (code === 200) {
let image = data.image.split(';').map(item => { let image = data.image.split(';').map(item => {
return { path: item }; return { path: item };
}); });
this.$refs['receive-images'].initImages(image); this.$refs['receive-images'].initImages(image);
this.form = Object.assign(this.form, data); this.form = Object.assign(this.form, data);
}else{
showToast(message);
} }
}, },
submit() { submit() {
...@@ -128,18 +131,21 @@ export default { ...@@ -128,18 +131,21 @@ export default {
}, },
async createdReceive(form) { async createdReceive(form) {
let res=await this.$u.api.addInventoryByInventoryModules(form) let res=await this.$u.api.addInventoryByInventoryModules(form)
let { code, data } = res; let { code, data,message } = res;
if (code === 200) { if (code === 200) {
showToast('操作成功'); showToast('操作成功');
setNeedRefresh()
setTimeout(() => { setTimeout(() => {
this.replacePage() this.replacePage()
}, 1500); }, 1500);
}else{
showToast(message);
} }
}, },
// 刷新当前页 // 刷新当前页
replacePage() { replacePage() {
uni.redirectTo({ uni.redirectTo({
url: 'pages/mine/warehouse/receiveDetail' url: `pages/mine/warehouse/inventoryDetail?takeId=${this.form.takeId}`
}); });
} }
} }
......
<template> <template>
<!-- 收货详情 --> <!-- 收货详情 -->
<view class="ware-house"> <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="{ backgroundColor: '#F4F5F7' }" title="收货" titleColor="#333333" :border-bottom="false" title-bold></u-navbar>
<view class="tools-box"> <view class="tools-box">
<text class="tools-box-title">品牌</text> <text class="tools-box-title">品牌</text>
<view class="select-view"> <view class="select-view">
...@@ -38,7 +38,7 @@ import ReceiveQrCode from './components/receiveDetail/receiveQrCode.vue'; ...@@ -38,7 +38,7 @@ import ReceiveQrCode from './components/receiveDetail/receiveQrCode.vue';
import ReceiveBarCode from './components/receiveDetail/receiveBarCode.vue'; import ReceiveBarCode from './components/receiveDetail/receiveBarCode.vue';
import ReceiveImages from './components/receiveDetail/receiveImages.vue'; import ReceiveImages from './components/receiveDetail/receiveImages.vue';
import { receiveStatusOptions } from '@/common/optinos/mine/received.js'; import { receiveStatusOptions } from '@/common/optinos/mine/received.js';
import { showToast } from '@/common/common.js'; import { showToast,setNeedRefresh } from '@/common/common.js';
export default { export default {
components: { components: {
XhPickerSelect, XhPickerSelect,
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
brandList: [], brandList: [],
disabled: false, disabled: false,
form: { form: {
id: '', // id: '',
brandId: '', brandId: '',
brandName:"", brandName:"",
productCode: '', // 箱码二维码 productCode: '', // 箱码二维码
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
methods: { methods: {
pickerchange(data) { pickerchange(data) {
this.form.brandId = data.id; this.form.brandId = data.id;
this.form.brandName = data.brandName; this.form.brandName = data.name;
}, },
onScanCodeChange(data) { onScanCodeChange(data) {
this.form.productCode = data; this.form.productCode = data;
...@@ -85,30 +85,36 @@ export default { ...@@ -85,30 +85,36 @@ export default {
this.form.courierNumber = data; this.form.courierNumber = data;
}, },
updateImages(data) { updateImages(data) {
let image = data.map(item => process.uniEnv.qn_asset_url + '/' + item.src + '?imageView2/1/w/100/h/100/q/75'); let image = data.map(item => process.uniEnv.qn_asset_url + '/' + item.src);
this.form.image = image.join(";"); this.form.image = image.join(";");
}, },
// 获取品牌列表 // 获取品牌列表
async getBrandList() { async getBrandList() {
let res = await this.$u.api.brandListByReceivedModules(); let res = await this.$u.api.brandListByReceivedModules();
let { code, data } = res; let { code, data,message } = res;
if (code === 200) { if (code === 200) {
this.brandList = data || []; this.brandList = data || [];
}else{
showToast(message);
} }
}, },
async getDetail() { async getDetail() {
let res = await this.$u.api.receiveDetailByReceivedModules(this.form.id); let res = await this.$u.api.receiveDetailByReceivedModules(this.form.id);
let { code, data } = res; let { code, data,message } = res;
if (code === 200) { if (code === 200) {
let image = data.image.split(';').map(item => { let image = data.image.split(';').map(item => {
return { path: item }; return { path: item };
}); });
this.$refs['receive-images'].initImages(image); this.$refs['receive-images'].initImages(image);
this.form = Object.assign(this.form, data); this.form = Object.assign(this.form, data);
if(!this.form.signId){
showToast('箱码不存在');
}
}else{
showToast(message);
} }
}, },
submit() { submit() {
console.log(this.form)
let { brandId, productCode, courierNumber, image } = this.form; let { brandId, productCode, courierNumber, image } = this.form;
if (!brandId) { if (!brandId) {
showToast('请选择品牌'); showToast('请选择品牌');
...@@ -131,12 +137,15 @@ export default { ...@@ -131,12 +137,15 @@ export default {
}, },
async createdReceive(form) { async createdReceive(form) {
let res=await this.$u.api.addReceiveByReceivedModules(form) let res=await this.$u.api.addReceiveByReceivedModules(form)
let { code, data } = res; let { code, data,message } = res;
if (code === 200) { if (code === 200) {
showToast('操作成功'); showToast('操作成功');
setNeedRefresh()
setTimeout(() => { setTimeout(() => {
this.replacePage() this.replacePage()
}, 1500); }, 1500);
}else{
showToast(message);
} }
}, },
// 刷新当前页 // 刷新当前页
......
...@@ -13,17 +13,17 @@ ...@@ -13,17 +13,17 @@
refresher-enabled="true" refresher-enabled="true"
:refresher-triggered="triggered" :refresher-triggered="triggered"
:refresher-threshold="100" :refresher-threshold="100"
:scroll-top="scrollTop"
refresher-background="#F4F5F7" refresher-background="#F4F5F7"
@refresherrefresh="onRefresh" @refresherrefresh="onRefresh"
@refresherrestore="onRestore" @refresherrestore="onRestore"
@scroll="scroll"
enable-back-to-top enable-back-to-top
> >
<NoOrder v-if="noParts" imageName="zwdd.png" :customStyle="noOrderCustomStyle" /> <NoOrder v-if="noParts" imageName="zwdd.png" text="暂无数据" :customStyle="noOrderCustomStyle" />
<template v-else> <template v-else>
<view v-for="(item, index) in list" :key="index"><receiving-info :detail="item" @handleClick="handleClick"></receiving-info></view> <view v-for="(item, index) in list" :key="index"><receiving-info :detail="item" @handleClick="handleClick"></receiving-info></view>
<view class="load-more-view" v-show="(form.pageNumber == 1 && loaded) || form.pageNumber > 1"><u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore></view> <view class="load-more-view" v-show="(form.pageNumber == 1 && loaded) || form.pageNumber > 1">
<u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</view>
</template> </template>
<view class="loading-view" v-if="!loaded && !freshing"><u-loading mode="flower"></u-loading></view> <view class="loading-view" v-if="!loaded && !freshing"><u-loading mode="flower"></u-loading></view>
</scroll-view> </scroll-view>
...@@ -43,6 +43,7 @@ import ReceivingInfo from './components/received/receivingInfo.vue'; ...@@ -43,6 +43,7 @@ import ReceivingInfo from './components/received/receivingInfo.vue';
import NoOrder from '@/components/order/noOrder.vue'; import NoOrder from '@/components/order/noOrder.vue';
import ApplyButton from '@/components/parts/applyButton.vue'; import ApplyButton from '@/components/parts/applyButton.vue';
import { receiveStatusOptions } from '@/common/optinos/mine/received.js'; import { receiveStatusOptions } from '@/common/optinos/mine/received.js';
import { showToast } from '@/common/common.js';
export default { export default {
components: { components: {
ReceivedHead, ReceivedHead,
...@@ -54,17 +55,12 @@ export default { ...@@ -54,17 +55,12 @@ export default {
data() { data() {
return { return {
receiveStatusOptions, receiveStatusOptions,
list: [ list: [], // 物料订单列表
{ id: 123456, status: "未使用", productCode: 'dsadq4231', brandName: '比亚迪',courierNumber:"SF7720" },
{ id: 1111, status: "未使用", productCode: 'dsadq4231', brandName: '比亚迪' ,courierNumber:"SF7720"},
{ id: 1111, status: "未使用", productCode: 'dsadq4231', brandName: '比亚迪',courierNumber:"SF7720" },
{ id: 1111, status: "未使用", productCode: 'dsadq4231', brandName: '比亚迪',courierNumber:"SF7720" },
], // 物料订单列表
form: { form: {
pageNumber: 0, pageNumber: 0,
pageSize: 10, pageSize: 10,
status: 0, status: 0,
brandId: 982, brandId: ''
}, },
show: false, show: false,
loadStatus: 'loading', // 底部加载状态 loadStatus: 'loading', // 底部加载状态
...@@ -106,7 +102,7 @@ export default { ...@@ -106,7 +102,7 @@ export default {
// this.status = e.index; // this.status = e.index;
// } // }
this.freshing = false; this.freshing = false;
this.getBrandList() // 获取品牌列表 this.getBrandList(); // 获取品牌列表
this.reloadList(); // 加载数据 this.reloadList(); // 加载数据
}, },
onShow() { onShow() {
...@@ -125,12 +121,12 @@ export default { ...@@ -125,12 +121,12 @@ export default {
this.reloadList(); this.reloadList();
}, },
pickerchange(data) { pickerchange(data) {
this.form.brandId = data.id||""; this.form.brandId = data.id || '';
this.reloadList(); this.reloadList();
}, },
// 获取品牌列表 // 获取品牌列表
getBrandList(){ getBrandList() {
this.$refs["received-head"].getBrandList() this.$refs['received-head'].getBrandList();
}, },
// 页面数据:收货列表 // 页面数据:收货列表
async getList() { async getList() {
...@@ -139,18 +135,20 @@ export default { ...@@ -139,18 +135,20 @@ export default {
if (this.form.pageNumber == 1) { if (this.form.pageNumber == 1) {
this.loaded = false; this.loaded = false;
} }
var param = this.form var param = this.form;
let res = await this.$u.api.receiveListByReceivedModules(param); let res = await this.$u.api.receiveListByReceivedModules(param);
if (res.code == 200) { if (res.code == 200) {
if (this.form.pageNumber == 1) { if (this.form.pageNumber == 1) {
this.list = []; this.list = [];
} }
let list = res.data || []; let { list, count } = res.data;
this.list.push(...list); let arr = list || [];
this.loadStatus = list.length < this.pageSize ? 'nomore' : 'loadmore'; // 底部加载状态 this.list.push(...arr);
this.loadStatus = arr.length < this.form.pageSize ? 'nomore' : 'loadmore'; // 底部加载状态
} else { } else {
// this.loadStatus = 'loadmore'; // this.loadStatus = 'loadmore';
console.log(res.message); console.log(res.message);
showToast(res.message);
} }
this.$nextTick(() => { this.$nextTick(() => {
// 页面刷新完之后更新下拉状态 // 页面刷新完之后更新下拉状态
...@@ -221,7 +219,7 @@ export default { ...@@ -221,7 +219,7 @@ export default {
/* 兼容 iOS < 11.2 */ /* 兼容 iOS < 11.2 */
padding-bottom: env(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);
/* 兼容 iOS >= 11.2 */ /* 兼容 iOS >= 11.2 */
.tab-view{ .tab-view {
height: 100%; height: 100%;
overflow: auto; overflow: auto;
margin-bottom: 100rpx; margin-bottom: 100rpx;
......
This diff is collapsed.
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