Commit 2ffbcb83 authored by xiangzj's avatar xiangzj

代理服务优化

parent ce7d487d
......@@ -21,8 +21,10 @@ const config = {
}
// 设置后台接口服务的基础地址
config.baseUrl = 'http://192.168.3.91:8080';
config.baseSapUrl = 'http://192.168.3.109:8080'; //sap接口服务
// config.baseUrl = 'http://192.168.3.91:8080'; //测试环境java
// config.baseUrl = 'http://192.168.3.109:8000'; //测试环境sap
config.baseUrl = ''; //sap接口服务
// config.baseSapUrl = '/sapApi'; //sap接口服务
//config.baseUrl = "http://101.43.244.58:8080/";
//config.baseUrl = "/api";
//config.baseUrl = "http://101.200.162.168:8080";
......
......@@ -14,7 +14,7 @@ const install = (Vue, vm) => {
lang: (params = {}) => vm.$u.get('/lang/' + params.lang),
index: (params = {}) => vm.$u.get(config.adminPath + '/mobile/index', params),
getUserInfo: (params = {}) => vm.$u.get(config.adminPath + '/mobile/user/getUserInfo', params),
login: (params = {}) => vm.$u.post(config.adminPath + '/mobile/login/loginByPassword', params),
login: (params = {}) => vm.$u.post('/mobile/login/loginByPassword', params),
sendCode: (params = {}) => vm.$u.post(config.adminPath + '/mobile/login/sendCode', params),
registerUser: (params = {}) => vm.$u.post(config.adminPath + '/mobile/user/registerUser', params),
......@@ -30,6 +30,11 @@ const install = (Vue, vm) => {
empUser: {
listData: (params = {}) => vm.$u.get(config.adminPath + '/sys/empUser/listData', params),
},
sapApi: {
// 采购入库
sapRrm: (params = {}) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/cud_mm_rrm/rrm?sap-client=300', params),
sapPlnr: (params = {}) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/get_mm_plnr/plnr?sap-client=300', params,),
}
};
}
......
......@@ -11,7 +11,6 @@ const install = (Vue, vm) => {
// 请求参数默认配置
Vue.prototype.$u.http.setConfig({
baseUrl: vm.vuex_config.baseUrl,
baseSapUrl: vm.vuex_config.baseSapUrl,
originalData: true,
// 默认头部,http2约定header名称统一小写 aidex
header: {
......@@ -56,7 +55,7 @@ const install = (Vue, vm) => {
}
// 根据返回的code值来做不同的处理
switch (res.data?.code) {
switch (res.statusCode) {
case 401:
uni.reLaunch({
url: '/pages/sys/login/login'
......@@ -81,7 +80,7 @@ const install = (Vue, vm) => {
if (data.msg !== null) {
uni.showToast({
icon: 'none',
title: data.msg,
title: data.msg || '未连接到服务器',
duration: 3000
})
} else {
......
{
"name" : "mes-pda",
"appid" : "__UNI__2D1FF48",
"appid" : "__UNI__E23397B",
"description" : "MES-PDA",
"versionName" : "1.0.0",
"versionCode" : "100",
......@@ -60,12 +60,11 @@
"ad" : {}
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
},
"android" : {},
// "hdpi" : "unpackage/res/icons/72x72.png",
// "xhdpi" : "unpackage/res/icons/96x96.png",
// "xxhdpi" : "unpackage/res/icons/144x144.png",
// "xxxhdpi" : "unpackage/res/icons/192x192.png"
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
......
This diff is collapsed.
......@@ -3,99 +3,67 @@
<StickyNavBar>
<NavBar title="采购入库扫描"></NavBar>
<view class="btn">
<uni-easyinput prefixIcon="search" class="topSearch" v-model="value" focus placeholder="请扫描库位" @input="handleInput"></uni-easyinput>
<uni-easyinput prefixIcon="search" v-model="wxparams" focus placeholder="请扫描产品包装条码/外箱码" @input="handleInput"></uni-easyinput>
<uni-easyinput prefixIcon="search" class="topSearch" v-model="nlpla" focus placeholder="请扫描库位" @change="handleInputNlpla"></uni-easyinput>
<uni-easyinput
prefixIcon="search"
:disabled="isDisabled"
v-model="wxparams"
:focus="isFocus"
placeholder="请扫描产品包装条码/外箱码"
@input="handleInputPlnr"
></uni-easyinput>
</view>
</StickyNavBar>
<ContentLoadingMore class="contentMore">
<view class="total">
<view class="left">入库明细</view>
<view class="right">
批次数:
<text class="blue">{{ number }}</text>
<text class="blue">{{ goodsList.length }}</text>
<text class="line">|</text>
总数量:
<text class="blue">{{ total }}</text>
<text class="blue">{{ totalNum }}</text>
</view>
</view>
<view class="cardbox">
<view class="cardContent">
<view class="listItemTitle">
<view>
<view class="item">入库批次:L99999999</view>
<view class="item">物料编号:L99999999</view>
<view class="item">物料描述:L99999999</view>
<view class="item">入库数量:L99999999</view>
<view class="item">入库库位:L99999999</view>
</view>
<u-button size="mini" type="primary" plain>
<u-icon name="trash" size="28"></u-icon>
删除
</u-button>
</StickyNavBar>
<view class="cardbox">
<view class="cardContent" v-for="(item, index) in goodsList">
<view class="listItemTitle">
<view>
<view class="item">入库批次:{{ item.CHARG }}</view>
<view class="item">物料编号:{{ item.MATNR }}</view>
<view class="item">物料描述:{{ item.MAKTX }}</view>
<view class="item">入库数量:{{ item.ERFMG }}</view>
<view class="item">入库库位:{{ item.MATNR }}</view>
</view>
<view class="listBottom">
<view class="bottomTitle" @tap="show = !show">
<view class="desc">卷条码明细</view>
<view class="topIcons">
<view v-if="show">
<u-icon name="arrow-down" color="#aaa" size="32"></u-icon>
展开
</view>
<view v-else>
<u-icon name="arrow-up" color="#aaa" size="32"></u-icon>
收起
</view>
</view>
</view>
<view v-if="!show" class="bottomBox">
<view class="bottomItem">
<view class="items">C00990099900027</view>
<view class="items">C009900|防霉抗菌包装纸</view>
<view class="items">数量:80PCS</view>
<view class="items">生产日期:2023-10-27</view>
</view>
<view class="bottomItem">
<view class="items">C00990099900027</view>
<view class="items">C009900|防霉抗菌包装纸</view>
<view class="items">数量:80PCS</view>
<view class="items">生产日期:2023-10-27</view>
</view>
<view class="bottomItem">
<view class="items">C00990099900027</view>
<view class="items">C009900|防霉抗菌包装纸</view>
<view class="items">数量:80PCS</view>
<view class="items">生产日期:2023-10-27</view>
</view>
<view class="bottomItem">
<view class="items">C00990099900027</view>
<view class="items">C009900|防霉抗菌包装纸</view>
<view class="items">数量:80PCS</view>
<view class="items">生产日期:2023-10-27</view>
</view>
<view class="bottomItem">
<view class="items">C00990099900027</view>
<view class="items">C009900|防霉抗菌包装纸</view>
<view class="items">数量:80PCS</view>
<view class="items">生产日期:2023-10-27</view>
</view>
<view class="bottomItem">
<view class="items">C00990099900027</view>
<view class="items">C009900|防霉抗菌包装纸</view>
<view class="items">数量:80PCS</view>
<view class="items">生产日期:2023-10-27</view>
<u-button size="mini" type="primary" plain @click="deleGonds(index)">
<u-icon name="trash" size="28"></u-icon>
删除
</u-button>
</view>
<view class="listBottom">
<view class="bottomTitle" @tap="show = !show">
<view class="desc">卷条码明细</view>
<view class="topIcons">
<view v-if="show">
<u-icon name="arrow-down" color="#aaa" size="32"></u-icon>
展开
</view>
<view class="bottomItem">
<view class="items">C00990099900027</view>
<view class="items">C009900|防霉抗菌包装纸</view>
<view class="items">数量:80PCS</view>
<view class="items">生产日期:2023-10-27</view>
<view v-else>
<u-icon name="arrow-up" color="#aaa" size="32"></u-icon>
收起
</view>
</view>
</view>
<view v-if="!show" class="bottomBox">
<view class="bottomItem">
<view class="items">{{ item.CHARG }}</view>
<view class="items">{{ item.MATNR }}</view>
<view class="items">数量:{{ item.ERFMG }}</view>
<view class="items">生产日期:{{ item.BLDAT }}</view>
</view>
</view>
</view>
</view>
</ContentLoadingMore>
</view>
<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn>
</view>
</template>
......@@ -112,10 +80,10 @@ export default {
},
data() {
return {
number: 2,
total: 200,
number: 0,
totalNum: 0,
show: true,
value: '',
nlpla: '',
wxparams: '',
btnArr: [
{
......@@ -130,19 +98,110 @@ export default {
text: '提交',
way: 'goSubmit'
}
]
],
goodsList: [],
isFocus: false,
isDisabled: false
};
},
created() {
// this.getPlnr('10000820240325000001|10000320100');
},
methods: {
deleGonds(idx) {
this.goodsList.splice(idx, 1);
this.totalNum = 0;
this.goodsList.forEach((ele) => {
this.totalNum += ele.ERFMG;
});
},
getBtnHandle(row) {
this[row.way]();
},
goBack() {
uni.navigateBack();
},
goSubmit() {},
handleInput(e) {
console.log(e, 'eee');
goSubmit() {
if (this.goodsList.length === 0) {
return;
}
console.log([
{
BLDAT: '20240325',
BUDAT: '20240325',
ZENCODE: 'A001',
TYPE: 'CG',
ITEM: this.goodsList
}
]);
this.$u.api.sapApi
.sapRrm([
{
BLDAT: '20240325',
BUDAT: '20240325',
ZENCODE: 'A001',
TYPE: 'CG',
ITEM: this.goodsList
}
])
.then((res) => {
this.loading = false;
console.log(res);
if (res.every((item) => item.TYPE === 'S')) {
this.goodsList = [];
this.totalNum = 0;
this.nlpla = '';
this.wxparams = '';
this.$u.toast('提交成功');
}
res.forEach((ele) => {
if (ele.TYPE === 'E') {
this.$u.toast(ele.MESSAGE);
}
});
});
},
handleInputPlnr(e) {
this.isFocus = false;
e && this.getPlnr(e);
},
handleInputNlpla(e) {
if (e) {
this.nlpla = e;
this.goodsList.forEach((ele) => {
this.totalNum += ele.ERFMG;
ele.NLPLA = ele.NLPLA || this.nlpla;
});
}
},
getPlnr(plnr) {
this.totalNum = 0;
this.isDisabled = true;
this.$u.api.sapApi
.sapPlnr({
plnr
})
.then((res) => {
if (res.RESULT.TYPE === 'S') {
this.goodsList = this.goodsList.concat(res.DATA);
this.goodsList.forEach((ele) => {
this.totalNum += ele.ERFMG;
ele.NLPLA = ele.NLPLA || this.nlpla;
});
setTimeout(() => {
this.wxparams = '';
this.isFocus = true;
this.isDisabled = false;
}, 1000);
} else {
setTimeout(() => {
this.isFocus = true;
this.isDisabled = false;
}, 1000);
this.$u.toast(res.RESULT.MESSAGE);
}
this.loading = false;
});
}
}
};
......@@ -175,6 +234,7 @@ page {
color: #3f9dcc;
}
.total {
background: #fff;
color: #000;
padding: 0rpx 40rpx;
display: flex;
......@@ -204,11 +264,11 @@ page {
margin-top: 10rpx;
}
.item {
height: 50rpx;
line-height: 50rpx;
color: #000;
font-size: 28rpx;
font-weight: 500;
word-break: break-all;
}
}
.listBottom {
......@@ -247,4 +307,4 @@ page {
/deep/ .u-sticky {
top: 0 !important;
}
</style>
</style>
\ No newline at end of file
......@@ -77,9 +77,16 @@ class Request {
// 处理sap接口
let url= this.config.baseUrl
if(options.url.indexOf('sap') > -1){
url = this.config.baseSapUrl
// options.url = options.url.replace('/sap','')
options.header = {...options.header,'Authorization':'Basic cmVzdF91c2VyOkJzbjEyMzQ1Ng=='}
// url = '/sapApi'
url = 'http://192.168.3.109:8000'
options.header = {
...options.header,
'content-type': 'application/json;charset=UTF-8',
'Authorization':'Basic cmVzdF91c2VyOkJzbjEyMzQ1Ng==',
}
}else{
// url = '/api'
url = 'http://192.168.3.91:8080'
}
// 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
options.url = validate.url(options.url) ? options.url : (url + (options.url.indexOf('/') == 0 ?
......
......@@ -17,12 +17,19 @@ module.exports = {
devServer: {
proxy: {
'/api': {
target: 'http://localhost:8080/',
target: 'http://192.168.3.91:8080',
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
},
'/sapApi': {
target: 'http://192.168.3.109:8000',
changeOrigin: true,
pathRewrite: {
'^/sapApi': ''
}
}
},
}
}
\ 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 to comment