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 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 inventoryListByInventoryModules = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/take/stock/take/stock', params); let deleteInventoryByInventoryModules = async (params = {}) => await vm.$u.get(parts + vm.vuex_token +
'/take/stock/detail/delete/' + params);
/** /**
* 收货单详情 * 提交盘点
*/ */
let inventoryDetailByInventoryModules = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/take/stock/sign/detail/'+ params); let confirmInventoryByInventoryModules = async (params = {}) => await vm.$u.get(parts + vm.vuex_token +
'/take/stock/take/submit/' + params);
/** /**
* 确认收货 * 提交盘点
*/ */
let addInventoryByInventoryModules = async (params = {}) => await vm.$u.post(parts + vm.vuex_token + '/take/stock/detail/add', params,formType); 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
} }
module.exports = { module.exports = {
inventoryApiFun inventoryApiFun
} }
// 自定义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
}) })
} }
...@@ -46,4 +46,12 @@ export function showModal({ ...@@ -46,4 +46,12 @@ export function showModal({
} }
}); });
}, 1); }, 1);
} }
\ No newline at end of file
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,9 +132,13 @@ export default { ...@@ -129,9 +132,13 @@ export default {
.txt { .txt {
font-size: 14px; font-size: 14px;
width: 100%; width: 100%;
overflow: hidden; .text-inner{
text-overflow: ellipsis; padding-right: 50rpx;
white-space: nowrap; width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
} }
} }
} }
......
...@@ -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
}, },
......
...@@ -3,55 +3,62 @@ ...@@ -3,55 +3,62 @@
<view class="tools-box"> <view class="tools-box">
<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">
</view> <xh-picker-select background="#f4f5f7" placeholder="全部" :rangeKey="rangeKey" :value="value" :list="brandList" @change="pickerchange"></xh-picker-select>
</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);
...@@ -76,16 +72,16 @@ export default { ...@@ -76,16 +72,16 @@ export default {
this.openDelete(); this.openDelete();
} }
}, },
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);
} }
}); });
}, },
......
...@@ -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,10 +39,12 @@ export default { ...@@ -38,10 +39,12 @@ 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栏切换
change(index) { change(index) {
......
...@@ -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);
} }
} }
}; };
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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