Commit 8f8312e1 authored by xiangzj's avatar xiangzj

sap接口服务调整

parent 2a22a070
......@@ -22,6 +22,7 @@ const config = {
// 设置后台接口服务的基础地址
config.baseUrl = 'http://192.168.3.91:8080';
config.baseSapUrl = 'http://192.168.3.109:8080'; //sap接口服务
//config.baseUrl = "http://101.43.244.58:8080/";
//config.baseUrl = "/api";
//config.baseUrl = "http://101.200.162.168:8080";
......
This diff is collapsed.
......@@ -11,6 +11,7 @@ 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: {
......
......@@ -38,14 +38,14 @@
<view class="bottomTitle" @tap="show = !show">
<view class="desc">卷条码明细</view>
<view class="topIcons">
<text v-if="show">
<view v-if="show">
<u-icon name="arrow-down" color="#aaa" size="32"></u-icon>
展开
</text>
<text v-else>
</view>
<view v-else>
<u-icon name="arrow-up" color="#aaa" size="32"></u-icon>
收起
</text>
</view>
</view>
</view>
<view v-if="!show" class="bottomBox">
......
......@@ -14,14 +14,14 @@
<view class="bottomTitle" @tap="show = !show">
<view class="desc">展开调整明细</view>
<view class="topIcons">
<text v-if="show">
<view v-if="show">
<u-icon name="arrow-down" color="#aaa" size="32"></u-icon>
展开
</text>
<text v-else>
</view>
<view v-else>
<u-icon name="arrow-up" color="#aaa" size="32"></u-icon>
收起
</text>
</view>
</view>
</view>
<view v-if="!show" class="bottomBox">
......
......@@ -15,7 +15,7 @@
<view class="inventoryDetail">
<view class="detailTitle">盘点明细</view>
<view class="">
<u-button size="mini" class="" type="success" @click="handleClickWork()">
<u-button size="mini" class="" type="success" @click="addShowModel = true">
<u-icon name="plus"></u-icon>
新增
</u-button>
......@@ -52,7 +52,7 @@
<view class="boxRight">
<view class="items">891/1000pcs</view>
<view class="itemsBtn">
<u-button size="mini" class="" type="primary" @click="handleClickWork()">盘点</u-button>
<u-button size="mini" class="" type="primary" @click="checkShowModel=true">盘点</u-button>
</view>
</view>
</view>
......@@ -60,6 +60,23 @@
</view>
</view>
<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn>
<u-modal v-model="addShowModel" @confirm="addConfirm" ref="addShowModel" :show-title="false" :show-cancel-button="true">
<view class="slot-content">
<u-form :model="addForm" ref="addForm">
<u-form-item label="批号"><u-input v-model="addForm.name" /></u-form-item>
<u-form-item label="批次"><u-input v-model="addForm.name" /></u-form-item>
<u-form-item label="数量"><u-input v-model="addForm.name" /></u-form-item>
</u-form>
</view>
</u-modal>
<u-modal v-model="checkShowModel" @confirm="addConfirm" ref="checkShowModel" :show-title="false" :show-cancel-button="true">
<view class="slot-content">
<u-form :model="checkForm" ref="checkForm">
<uni-easyinput prefixIcon="search" class="topSearch" v-model="checkForm.name" focus placeholder="请扫描盘点库位条码" @input="handleInput"></uni-easyinput>
<u-form-item label="数量"><u-input v-model="checkForm.name" /></u-form-item>
</u-form>
</view>
</u-modal>
</view>
</template>
......@@ -76,7 +93,7 @@ export default {
data() {
return {
value: '',
show: false,
show: true,
btnArr: [
{
style: '',
......@@ -84,12 +101,19 @@ export default {
text: '盘点确认',
way: 'goBack'
}
]
],
addShowModel: false,
checkShowModel: false,
addForm: {
name: ''
},
checkForm: {
name: ''
},
};
},
computed: {},
methods: {
handleClickWork() {},
handleInput(e) {
console.log(e, 'eee');
},
......@@ -102,7 +126,10 @@ export default {
},
ontabtap(e, type) {
console.log('切换tab', e, type);
}
},
addConfirm(){
this.addShowModel = false
},
}
};
</script>
......@@ -205,4 +232,10 @@ export default {
justify-content: space-between;
border-bottom: 1px solid #333;
}
.slot-content{
padding: 20rpx;
.u-form-item{
padding: 0;
}
}
</style>
......@@ -38,14 +38,14 @@
<view class="bottomTitle" @tap="show = !show">
<view class="desc">卷条码明细</view>
<view class="topIcons">
<text v-if="show">
<view v-if="show">
<u-icon name="arrow-down" color="#aaa" size="32"></u-icon>
展开
</text>
<text v-else>
</view>
<view v-else>
<u-icon name="arrow-up" color="#aaa" size="32"></u-icon>
收起
</text>
</view>
</view>
</view>
<view v-if="!show" class="bottomBox">
......@@ -122,28 +122,28 @@ export default {
style: '',
type: 'warning',
text: '返回',
way: 'goBack',
way: 'goBack'
},
{
style: '',
type: 'primary',
text: '提交',
way: 'goSubmit',
way: 'goSubmit'
}
],
]
};
},
methods: {
getBtnHandle(row){
this[row.way]()
getBtnHandle(row) {
this[row.way]();
},
goBack(){
goBack() {
uni.navigateBack();
},
goSubmit(){},
goSubmit() {},
handleInput(e) {
console.log(e, 'eee');
},
}
}
};
</script>
......
......@@ -45,24 +45,24 @@
return {
loading: false,
loginForm: {
username: "admin",
password: "000000",
rememberMe: false,
validCode:'',
uuid: ""
username: "admin",
password: "000000",
rememberMe: false,
validCode:'',
uuid: ""
},
loginRules: {
username: {
rules: [
{ required: true, trigger: "blur", errorMessage: "请输入您的账号" }
],
},
username: {
rules: [
{ required: true, trigger: "blur", errorMessage: "请输入您的账号" }
],
},
password: {
rules: [
{ required: true, trigger: "blur", errorMessage: "请输入您的密码" }
]
}
password: {
rules: [
{ required: true, trigger: "blur", errorMessage: "请输入您的密码" }
]
}
},
}
},
......
......@@ -15,7 +15,7 @@ class Request {
let interceptorRequest = this.interceptor.request(options);
if (interceptorRequest === false) {
// 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
return new Promise(()=>{});
return new Promise(() => {});
}
this.options = interceptorRequest;
}
......@@ -34,7 +34,7 @@ class Request {
clearTimeout(this.config.timer);
this.config.timer = null;
// 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
if(this.config.originalData) {
if (this.config.originalData) {
// 判断是否存在拦截器
if (this.interceptor.response && typeof this.interceptor.response === 'function') {
let resInterceptors = this.interceptor.response(response);
......@@ -51,7 +51,8 @@ class Request {
}
} else {
if (response.statusCode == 200) {
if (this.interceptor.response && typeof this.interceptor.response === 'function') {
if (this.interceptor.response && typeof this.interceptor.response ===
'function') {
let resInterceptors = this.interceptor.response(response.data);
if (resInterceptors !== false) {
resolve(resInterceptors);
......@@ -73,15 +74,21 @@ 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是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
options.url = validate.url(options.url) ? options.url : (this.config.baseUrl + (options.url.indexOf('/') == 0 ?
options.url = validate.url(options.url) ? options.url : (url + (options.url.indexOf('/') == 0 ?
options.url : '/' + options.url));
// 是否显示loading
// 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
// 而没有清除前者的定时器,导致前者超时,一直显示loading
if(this.config.showLoading && !this.config.timer) {
if (this.config.showLoading && !this.config.timer) {
this.config.timer = setTimeout(() => {
uni.showLoading({
title: this.config.loadingText,
......@@ -102,6 +109,7 @@ class Request {
constructor() {
this.config = {
baseUrl: '', // 请求的根域名
baseSapUrl: '', // SAP请求的根域名
// 默认的请求头
header: {},
method: 'POST',
......@@ -116,7 +124,7 @@ class Request {
originalData: false, // 是否在拦截器中返回服务端的原始数据,见文档说明
loadingMask: true, // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
}
// 拦截器
this.interceptor = {
// 请求前的拦截
......@@ -144,7 +152,7 @@ class Request {
data
})
}
// put请求,不支持支付宝小程序(HX2.6.15)
this.put = (url, data = {}, header = {}) => {
return this.request({
......@@ -154,7 +162,7 @@ class Request {
data
})
}
// delete请求,不支持支付宝和头条小程序(HX2.6.15)
this.delete = (url, data = {}, header = {}) => {
return this.request({
......@@ -166,4 +174,4 @@ class Request {
}
}
}
export default new Request
export default new Request
\ 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