Commit 029b2358 by LJM

js

parent 813dd6ef
......@@ -3,3 +3,4 @@
/unpackage
/*.hbuilderx
/.DS_Store
/node_modules
\ No newline at end of file
......@@ -37,12 +37,6 @@
.icon-a-juxing11 {
font-size: 30rpx;
color: #c6c7cc;
display: none;
}
&:focus-within {
.icon-a-juxing11 {
display: block;
}
}
}
}
......@@ -52,11 +46,11 @@
flex-wrap: wrap;
.box {
position: relative;
padding: 15rpx 17rpx 0 17rpx;
padding: 15rpx 17rpx 12rpx 17rpx;
width: 345rpx;
height: 250rpx;
background: #ffffff;
box-shadow: 0px 3rpx 3rpx 0px rgba(198, 199, 204, 0.3);
border: 1px solid transparent;
border-radius: 10rpx;
margin-right: 15rpx;
margin-bottom: 15rpx;
......@@ -109,7 +103,14 @@
margin-bottom: 20rpx;
}
.btn-box {
justify-content: flex-end;
.b1 {
font-size: 15rpx;
color: #919399;
}
.b2 {
font-size: 15rpx;
color: #1969f9;
}
.btn {
width: 68rpx;
height: 30rpx;
......@@ -292,21 +293,63 @@
left: 0;
right: 0;
width: 100%;
height: 75rpx;
background: #1969f9;
font-size: 23rpx;
color: #ffffff;
.btn1 {
height: 75rpx;
background: #1969f9;
font-size: 23rpx;
color: #ffffff;
}
.btn2 {
height: 75rpx;
background: #ffe0d7;
font-size: 23rpx;
color: #ff3700;
font-weight: bold;
}
}
.btn1 {
position: absolute;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: 75rpx;
background: #ffe0d7;
font-size: 23rpx;
color: #ff3700;
font-weight: bold;
.tip-box {
margin-top: 36rpx;
margin-bottom: 23rpx;
height: 60rpx;
background: #fff5ec;
border-radius: 30rpx 30rpx 30rpx 30rpx;
.iconfont {
font-size: 30rpx;
color: #f98119;
margin-left: 23rpx;
}
.tt {
margin-left: 12rpx;
font-size: 20rpx;
color: #f98119;
}
}
.input-wrap {
margin-bottom: 25rpx;
.label-title {
font-size: 20rpx;
color: #484b59;
font-weight: bold;
margin-bottom: 10rpx;
}
.input-box {
.uni-input {
height: 55rpx;
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
font-size: 17rpx;
padding-left: 18rpx;
}
.uni-textarea {
width: 100%;
height: 110rpx;
background: #ffffff;
border-radius: 10px;
border: 1px solid #1969f9;
font-size: 17rpx;
padding: 18rpx;
}
}
}
}
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"lodash": {
"version": "4.17.21",
"resolved": "https://repo.huaweicloud.com/repository/npm/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
}
}
}
......@@ -12,45 +12,64 @@
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请输入物流单号" placeholder-style="color:#919399" focus />
<template v-if="index == 0">
<input class="uni-input" placeholder="请输入物流单号" placeholder-style="color:#919399" focus v-model="searchParams.tracking_no" @input="handleInput" />
</template>
<template v-else-if="index == 1">
<input class="uni-input" placeholder="请输入入库单号" placeholder-style="color:#919399" focus v-model="searchParams.stock_in_sn" @input="handleInput" />
</template>
<template v-else-if="index == 2">
<input class="uni-input" placeholder="请输入入仓号" placeholder-style="color:#919399" focus v-model="searchParams.stock_in_with_stock_in_items_inhouse" @input="handleInput" />
</template>
</view>
<text class="iconfont icon-a-juxing11"></text>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
</view>
<view class="list row bothSide">
<view class="box" v-for="(item, index) in list">
<view class="check-box-icon"></view>
<view class="list row bothSide" v-if="list.length > 0">
<view class="box" v-for="(item, index) in list" :key="index" :class="{ curr: filter_list[index] }">
<view class="check-box-icon" @click="filterChange(index)"></view>
<view class="text-item row verCenter">
<text class="label">入库单号:</text>
<text class="t1">{{ item.stock_in_sn }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">物流单号:</text>
<text class="t1">{{ item.logistics_sn }}</text>
<text class="t1">{{ item.tracking_no }}</text>
</view>
<view class="bor row"></view>
<view class="text-item row verCenter">
<text class="label">入仓号:</text>
<text class="tt">--</text>
<text class="tt">{{ item.stock_in_items[0].inhouse }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">货品名称:</text>
<text class="tt">--</text>
<text class="tt">{{ item.stock_in_items[0].goods_name }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">标准品牌:</text>
<text class="tt">--</text>
<text class="tt">{{ item.stock_in_items[0].brand_name }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">预期数量:</text>
<text class="tt">--</text>
<text class="tt">{{ item.stock_in_items[0].expect_qty }}</text>
</view>
<view class="btn-box row bothSide">
<view class="row verCenter" style="margin-left: 79rpx;">
<text class="b1"></text>
<text class="b2">{{ item.stock_in_items.length }}</text>
<text class="b1">个物料</text>
</view>
<view class="btn1 row rowCenter verCenter" @click="showDrawer(item.stock_in_sn)">详情</view>
</view>
<view class="btn-box row"><view class="btn1 row rowCenter verCenter" @click="showDrawer(item.stock_in_sn)">详情</view></view>
</view>
</view>
<view class="no-date column rowCenter verCenter" v-else>
<text class="iconfont icon-a-juxing21"></text>
<text class="text">查不到当前数据</text>
</view>
<view class="fix-btn row verCenter">
<view class="btn1 row rowCenter verCenter">无单号登记</view>
<view class="btn2 row rowCenter verCenter">到货登记</view>
<view class="btn1 row rowCenter verCenter" @click="showDrawers()">无单号登记</view>
<view class="btn2 row rowCenter verCenter" @click="addStockInRegister(1)">到货登记</view>
</view>
<!-- 入库单详情弹窗 -->
<uni-drawer ref="showRight" mode="right">
......@@ -66,40 +85,69 @@
</view>
<view class="item row verCenter">
<text class="label">状 态:</text>
<text class="text">{{ detail.stock_in_register_status_cn }}</text>
<text class="text">{{ detail.stock_in_status_cn }}</text>
</view>
<view class="item row verCenter">
<text class="label">物流单号:</text>
<text class="text">{{ detail.logistics_sn }}</text>
<text class="text">{{ detail.tracking_no }}</text>
</view>
</view>
<view class="pp">货品详情</view>
<view class="drawer-list">
<scroll-view style="max-height: 755rpx" scroll-y="true">
<view class="box">
<view class="box" v-for="(item, index) in detail.stock_in_items" :key="index">
<view class="row verCenter top">
<text class="t1">{{ index + 1 }}.</text>
<text class="t2">SDF44555SDF5ASD54ASDA</text>
<text class="t2">{{ item.goods_name }}</text>
</view>
<view class="row verCenter">
<view class="bar row verCenter" style="flex: 0 0 40%;">
<text class="tt">标准品牌:</text>
<text class="yy">AS2D1ASD</text>
<text class="yy">{{ item.brand_name }}</text>
</view>
<view class="bar row verCenter" style="flex: 0 0 30%;">
<text class="tt">数量:</text>
<text class="yy">100</text>
<text class="yy">{{ item.expect_qty }}</text>
</view>
<view class="bar row verCenter" style="flex: 0 0 30%;">
<text class="tt">入仓号:</text>
<text class="yy">A65512</text>
<text class="yy">{{ item.inhouse }}</text>
</view>
</view>
</view>
</scroll-view>
</view>
<view class="time">创建时间:{{ detail.create_time_cn }}</view>
<view class="btn row rowCenter verCenter">到货登记</view>
<view class="btn row rowCenter verCenter"><view class="row btn1 row rowCenter verCenter" style="width:100%" @click="addStockInRegister(2, detail.stock_in_id)">到货登记</view></view>
</view>
</uni-drawer>
<!-- 无单号登记弹窗 -->
<uni-drawer ref="showRightAdd" mode="right">
<view class="uni-drawer-layer">
<view class="title row rowCenter verCenter">
<text class="iconfont icon-juxing2" @click="closeDrawer()"></text>
<text class="text">无单号登记</text>
</view>
<view class="tip-box row verCenter">
<text class="iconfont icon-a-juxing4"></text>
<text class="tt">注意:物流单号、其它信息必填其一</text>
</view>
<view class="input-wrap column">
<text class="label-title">物流公司:</text>
<view class="input-box"><input type="text" class="uni-input" placeholder-style="color:#919399" placeholder="请输入物流公司(必填)" v-model="formParams.logistics_company" /></view>
</view>
<view class="input-wrap column">
<text class="label-title">物流单号:</text>
<view class="input-box"><input type="text" class="uni-input" placeholder-style="color:#919399" placeholder="请输入物流单号" v-model="formParams.logistics_sn" /></view>
</view>
<view class="input-wrap column">
<text class="label-title">其它信息:</text>
<view class="input-box"><textarea class="uni-textarea" name="" placeholder-style="color:#919399" placeholder="其它信息" v-model="formParams.other_info"></textarea></view>
</view>
<view class="row bothSide btn">
<view class="btn2 row rowCenter verCenter" @click="closeDrawer()" style="width: 50%;">关 闭</view>
<view class="btn1 row rowCenter verCenter" @click="addStockInRegisterSubmit()" style="width:50%;">登记</view>
</view>
</view>
</uni-drawer>
</view>
......@@ -107,16 +155,31 @@
<script>
import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce';
export default {
data() {
return {
input_flag: false,
page: 1,
limit: 100,
limit: 1000,
index: 0,
array: ['物流单号', '入库单号', '入仓号'],
list: [],
detail: {},
stock_in_register_status: 1 //新创建
filter_list: [], //筛选已选中的列表
detail: {}, //详情的数据
searchParams: {
stock_in_sn: '', //入库单号
tracking_no: '', //物流单号
stock_in_with_stock_in_items_inhouse: '' //入仓单号
},
formParams: {
logistics_company: '',
logistics_sn: '',
other_info: ''
},
filter_id: [] //入库单列表的入库登记
};
},
onNavigationBarButtonTap(e) {
......@@ -131,12 +194,62 @@ export default {
},
methods: {
/**
* 找出false对应的下标
* @param {Object} arr
* @param {Object} target
*/
findIndex(arr, target) {
const result = [];
arr.map((item, index) => {
if (item === target) {
result.push(index);
}
});
return result;
},
/**
* 筛选过滤出选中的元素
*/
filterChange(index) {
this.$set(this.filter_list, index, (this.filter_list[index] = !this.filter_list[index]));
let filter_arr = this.findIndex(this.filter_list, true);
this.filter_id = filter_arr.map(i => this.list[i].stock_in_id);
},
/**
* 清空数据
*/
clearInput() {
this.input_flag = false;
if (this.index == 0) {
this.searchParams.tracking_no = '';
} else if (this.index == 1) {
this.searchParams.stock_in_sn = '';
} else if (this.index == 2) {
this.searchParams.other_info = '';
}
this.getData();
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
var val = event.target.value;
if (val) {
this.input_flag = true;
} else {
this.input_flag = false;
}
this.getData();
}, 500),
/**
* 获取列表数据
*/
getData() {
this.request(API.stockInRegisterList, 'POST', { page: this.page, limit: this.limit, stock_in_register_status: this.stock_in_register_status }, false).then(res => {
this.request(API.stockInMobileRegisterList, 'POST', { page: this.page, limit: this.limit, is_register: 0, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.list = res.data.list;
this.filter_list = createArray(this.list.length, false);
} else {
uni.showToast({
title: res.msg,
......@@ -150,7 +263,7 @@ export default {
* @param {Object} stock_in_sn 入库单号
*/
getDetail(stock_in_sn) {
this.request(API.stockInRegisterList, 'POST', { page: this.page, limit: this.limit, stock_in_register_status: this.stock_in_register_status, stock_in_sn: stock_in_sn }, false).then(res => {
this.request(API.stockInMobileRegisterList, 'POST', { page: this.page, limit: this.limit, stock_in_sn: stock_in_sn, is_register: 0 }, true).then(res => {
if (res.code === 0) {
this.detail = res.data.list[0];
} else {
......@@ -161,6 +274,79 @@ export default {
}
});
},
/**
* 无单号登记
*/
addStockInRegisterSubmit() {
if (!this.formParams.logistics_company) {
uni.showToast({
title: '请填写物流公司',
icon: 'error'
});
return false;
}
if (this.formParams.logistics_sn == '' && this.formParams.other_info == '') {
uni.showModal({
title: '提示',
content: '物流单号、其它信息必填其一',
showCancel: false
});
return false;
}
this.request(API.addStockInRegister, 'POST', this.formParams, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '登记成功',
icon: 'success'
});
setTimeout(() => {
this.getData();
}, 2000);
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 到货登记
* @param {Object} type 1列表登记 2详情登记
* @param {Object} id
*/
addStockInRegister(type, id) {
var stock_in_id = [];
if (type == 1) {
if (this.filter_id.length == 0) {
uni.showToast({
title: '请选择货品',
icon: 'error'
});
return false;
}
stock_in_id = this.filter_id;
} else if (type == 2) {
stock_in_id[0] = id;
}
this.request(API.addStockInRegister, 'POST', { stock_in_id: JSON.stringify(stock_in_id) }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '登记成功',
icon: 'success'
});
setTimeout(() => {
this.getData();
}, 2000);
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
......@@ -169,8 +355,12 @@ export default {
this.$refs.showRight.open();
this.getDetail(stock_in_sn);
},
showDrawers() {
this.$refs.showRightAdd.open();
},
closeDrawer() {
this.$refs.showRight.close();
this.$refs.showRightAdd.close();
}
}
};
......
......@@ -12,48 +12,63 @@
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请输入物流单号" placeholder-style="color:#919399" />
<template v-if="index == 0">
<input class="uni-input" placeholder="请输入物流单号" placeholder-style="color:#919399" focus v-model="searchParams.tracking_no" @input="handleInput" />
</template>
<template v-else-if="index == 1">
<input class="uni-input" placeholder="请输入入库单号" placeholder-style="color:#919399" focus v-model="searchParams.stock_in_sn" @input="handleInput" />
</template>
<template v-else-if="index == 2">
<input class="uni-input" placeholder="请输入入仓号" placeholder-style="color:#919399" focus v-model="searchParams.stock_in_with_stock_in_items_inhouse" @input="handleInput" />
</template>
</view>
<text class="iconfont icon-a-juxing11"></text>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
</view>
<view class="list row bothSide">
<view class="box curr" @click="showDrawer()" v-for="(item, index) in 20">
<view class="check-box-icon"></view>
<view class="list row bothSide" v-if="list.length > 0">
<view class="box" v-for="(item, index) in list" :key="index" :class="{ curr: filter_list[index] }">
<view class="check-box-icon" @click="filterChange(index)"></view>
<view class="text-item row verCenter">
<text class="label">入库单号:</text>
<text class="t1">ASN2201010001</text>
<text class="t1">{{ item.stock_in_sn }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">物流单号:</text>
<text class="t1">SF2135661465161</text>
<text class="t1">{{ item.tracking_no }}</text>
</view>
<view class="bor row"></view>
<view class="text-item row verCenter">
<text class="label">入仓号:</text>
<text class="tt">A65512、A65512、A65512、A65512、A65512、</text>
<text class="tt">{{ item.stock_in_items[0].inhouse }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">货品名称:</text>
<text class="tt">TI</text>
<text class="tt">{{ item.stock_in_items[0].goods_name }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">标准品牌:</text>
<text class="tt">TI</text>
<text class="tt">{{ item.stock_in_items[0].brand_name }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">预期数量:</text>
<text class="tt">预期数量:</text>
<text class="tt">{{ item.stock_in_items[0].expect_qty }}</text>
</view>
<view class="btn-box row bothSide">
<view class="row verCenter" style="margin-left: 79rpx;">
<text class="b1"></text>
<text class="b2">{{ item.stock_in_items.length }}</text>
<text class="b1">个物料</text>
</view>
<view class="btn1 row rowCenter verCenter" @click="showDrawer(item.stock_in_sn)">详情</view>
</view>
<view class="btn-box row"><view class="btn1 row rowCenter verCenter">详情</view></view>
</view>
</view>
<view class="fix-btn row verCenter">
<view class="btn3 row rowCenter verCenter">
<text class="check-box-icon curr"></text>
<view class="btn3 row rowCenter verCenter" @click="allChnage()">
<text class="check-box-icon" :class="{ curr: this.filter_list.length == this.filter_id.length }"></text>
<text class="text">全选</text>
</view>
<view class="btn4 row rowCenter verCenter" @click="showDrawer()">取消登记</view>
<view class="btn4 row rowCenter verCenter" @click="delStockInRegister(1)">取消登记</view>
</view>
<!-- 入库单详情弹窗 -->
<uni-drawer ref="showRight" mode="right">
......@@ -65,37 +80,37 @@
<view class="field-item row">
<view class="item row verCenter">
<text class="label">入库单号:</text>
<text class="text">ASN2201010001</text>
<text class="text">{{ detail.stock_in_sn }}</text>
</view>
<view class="item row verCenter">
<text class="label">状 态:</text>
<text class="text">入库单详情</text>
<text class="text">{{ detail.stock_in_status_cn }}</text>
</view>
<view class="item row verCenter">
<text class="label">物流单号:</text>
<text class="text">SF2135661465161</text>
<text class="text">{{ detail.tracking_no }}</text>
</view>
</view>
<view class="pp">货品详情</view>
<view class="drawer-list">
<scroll-view style="max-height: 755rpx" scroll-y="true">
<view class="box">
<view class="box" v-for="(item, index) in detail.stock_in_items" :key="index">
<view class="row verCenter top">
<text class="t1">{{ index + 1 }}.</text>
<text class="t2">SDF44555SDF5ASD54ASDA</text>
<text class="t2">{{ item.goods_name }}</text>
</view>
<view class="row verCenter">
<view class="bar row verCenter" style="flex: 0 0 40%;">
<text class="tt">标准品牌:</text>
<text class="yy">AS2D1ASD</text>
<text class="yy">{{ item.brand_name }}</text>
</view>
<view class="bar row verCenter" style="flex: 0 0 30%;">
<text class="tt">数量:</text>
<text class="yy">100</text>
<text class="yy">{{ item.expect_qty }}</text>
</view>
<view class="bar row verCenter" style="flex: 0 0 30%;">
<text class="tt">入仓号:</text>
<text class="yy">A65512</text>
<text class="yy">{{ item.inhouse }}</text>
</view>
</view>
</view>
......@@ -104,14 +119,14 @@
<view class="field-item row">
<view class="item row verCenter">
<text class="label">到货日期:</text>
<text class="tt">2023-04-01 11:28:59</text>
<text class="tt">{{ detail.arrival_time_cn }}</text>
</view>
<view class="item row verCenter">
<text class="label">到货操作人:</text>
<text class="tt">朱国军</text>
<text class="tt">{{ detail.arrival_name }}</text>
</view>
</view>
<view class="btn1 row rowCenter verCenter">取消登记</view>
<view class="btn row rowCenter verCenter"><view class="btn2 row rowCenter verCenter" @click="delStockInRegister(2, detail.stock_in_id)" style="width: 100%;">取消登记</view></view>
</view>
</uni-drawer>
</view>
......@@ -119,11 +134,27 @@
<script>
import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce';
export default {
data() {
return {
input_flag: false,
all_flag: false, //全选标记
page: 1,
limit: 1000,
index: 0,
array: ['物流单号', '入库单号', '入仓号']
array: ['物流单号', '入库单号', '入仓号'],
list: [],
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤id
detail: {}, //详情的数据
searchParams: {
stock_in_sn: '', //入库单号
tracking_no: '', //物流单号
stock_in_with_stock_in_items_inhouse: '' //入仓单号
}
};
},
onNavigationBarButtonTap(e) {
......@@ -133,13 +164,151 @@ export default {
});
}
},
onShow() {
this.getData();
},
methods: {
/**
* 找出false对应的下标
* @param {Object} arr
* @param {Object} target
*/
findIndex(arr, target) {
const result = [];
arr.map((item, index) => {
if (item === target) {
result.push(index);
}
});
return result;
},
/**
* 筛选过滤出选中的元素
*/
filterChange(index) {
this.$set(this.filter_list, index, (this.filter_list[index] = !this.filter_list[index]));
let filter_arr = this.findIndex(this.filter_list, true);
this.filter_id = filter_arr.map(i => this.list[i].stock_in_id);
},
/**
* 全选
*/
allChnage() {
this.all_flag = !this.all_flag;
this.filter_list = createArray(this.list.length, this.all_flag);
if (this.all_flag) {
this.filter_id = this.list.map(function(item) {
return item.stock_in_id;
});
} else {
this.filter_id = [];
}
},
/**
* 清空数据
*/
clearInput() {
this.input_flag = false;
if (this.index == 0) {
this.searchParams.tracking_no = '';
} else if (this.index == 1) {
this.searchParams.stock_in_sn = '';
} else if (this.index == 2) {
this.searchParams.other_info = '';
}
this.getData();
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
var val = event.target.value;
if (val) {
this.input_flag = true;
} else {
this.input_flag = false;
}
this.getData();
}, 500),
/**
* 获取列表数据
*/
getData() {
this.request(API.stockInMobileRegisterList, 'POST', { page: this.page, limit: this.limit, is_register: 1, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.list = res.data.list;
this.filter_list = createArray(this.list.length, false);
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 获取详情
* @param {Object} stock_in_sn 入库单号
*/
getDetail(stock_in_sn) {
this.request(API.stockInMobileRegisterList, 'POST', { page: this.page, limit: this.limit, stock_in_sn: stock_in_sn }, true).then(res => {
if (res.code === 0) {
this.detail = res.data.list[0];
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 取消登记
* @param {Object} type
* @param {Object} id
*/
delStockInRegister(type, id) {
var stock_in_id = [];
if (type == 1) {
if (this.filter_id.length == 0) {
uni.showToast({
title: '请选择货品',
icon: 'error'
});
return false;
}
stock_in_id = this.filter_id;
} else if (type == 2) {
stock_in_id[0] = id;
}
this.request(API.delStockInRegister, 'POST', { stock_in_id: JSON.stringify(stock_in_id) }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '操作成功',
icon: 'success'
});
setTimeout(() => {
this.getData();
}, 2000);
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
showDrawer() {
showDrawer(stock_in_sn) {
this.$refs.showRight.open();
this.getDetail(stock_in_sn);
},
showDrawers() {
this.$refs.showRightAdd.open();
},
closeDrawer() {
this.$refs.showRight.close();
......
......@@ -21,7 +21,15 @@ const API = {
/**
* 到货记录
* */
stockInRegisterList: API_BASE + '/api/stockIn/stockInRegister/stockInRegisterList',
stockInMobileRegisterList: API_BASE + '/api/stockIn/stockInRegister/stockInMobileRegisterList',
/**
* 新增到货记录
* */
addStockInRegister: API_BASE + '/api/stockIn/stockInRegister/addStockInRegister',
/**
* 删除到货登记
* */
delStockInRegister: API_BASE + '/api/stockIn/stockInRegister/delStockInRegister',
}
......
......@@ -7,7 +7,7 @@ const request = (url = '', type = 'GET', param = {}, Loading) => {
const oa_skey = uni.getStorageSync('oa_skey') || '';
var params = Object.assign(param, {
pf: 20
is_mobile: 1
});
//是否启动加载
......@@ -64,7 +64,19 @@ const getPlatform = () => {
return platform;
}
/**
* 来创建指定长度且所有元素都被初始化为 false 的数组
*/
const createArray = (length, value) => {
return Array(length).fill(value);
}
module.exports = {
request,
getPlatform
getPlatform,
createArray
}
\ No newline at end of file
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 sign in to comment