Commit 8f8312e1 authored by xiangzj's avatar xiangzj

sap接口服务调整

parent 2a22a070
...@@ -22,6 +22,7 @@ const config = { ...@@ -22,6 +22,7 @@ const config = {
// 设置后台接口服务的基础地址 // 设置后台接口服务的基础地址
config.baseUrl = 'http://192.168.3.91:8080'; 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 = "http://101.43.244.58:8080/";
//config.baseUrl = "/api"; //config.baseUrl = "/api";
//config.baseUrl = "http://101.200.162.168:8080"; //config.baseUrl = "http://101.200.162.168:8080";
......
...@@ -18,143 +18,6 @@ const install = (Vue, vm) => { ...@@ -18,143 +18,6 @@ const install = (Vue, vm) => {
sendCode: (params = {}) => vm.$u.post(config.adminPath + '/mobile/login/sendCode', params), sendCode: (params = {}) => vm.$u.post(config.adminPath + '/mobile/login/sendCode', params),
registerUser: (params = {}) => vm.$u.post(config.adminPath + '/mobile/user/registerUser', params), registerUser: (params = {}) => vm.$u.post(config.adminPath + '/mobile/user/registerUser', params),
/**
* 系统设置API
*/
//获取工序清单
getProcessList: (params = {}) => vm.$u.get(config.adminPath + '/mobile/pro/process/getProcessList',
params),
getWorkstationList: (params = {}) => vm.$u.get(config.adminPath +
'/mobile/md/workstation/getWorkstationList', params),
getWorkUnitList: (params = {}) => vm.$u.get(config.adminPath +
'/md/workunit/getListByUser', params),
/**
* 生产管理相关API
**/
//获取当前工作站的生产任务
getTaskList: (params = {}) => vm.$u.get(config.adminPath + '/mobile/pro/protask/getTaskList', params),
//根据任务ID获取任务详情
getTaskInfo: (params = {}) => vm.$u.get(config.adminPath + '/mobile/pro/protask/' + params.taskId),
//修改任务状态
changeStatus: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/protask/change', params),
//生产报工
feedback: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/protask/feedback', params),
//增加检验
getTaskInfoByTaskCode: (params = {}) => vm.$u.get(config.adminPath + '/mobile/pro/protask/getProTaskByTaskCode', params),
//
getIpqcCode: (params = {}) => vm.$u.get(config.adminPath + '/system/autocode/get/IPQC_CODE', params),
//增加缺陷记录
addDefectrecord: (params = {}) => vm.$u.putJson(config.adminPath + '/mes/qc/defectrecord', params),
//查询缺陷列表
getDefectrecordList: (params = {}) => vm.$u.get(config.adminPath + '/mes/qc/defectrecord/list', params),
//查询检测项
getIpqcLineList: (params = {}) => vm.$u.get(config.adminPath + '/mes/qc/ipqcline/list', params),
//生产日志
productionLogList: (params = {}) => vm.$u.get(config.adminPath + '/mobile/pro/productionlog/list', params),
//增加生产日志
addProductionlog: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/productionlog/add', params),
//增加生产物料扣减
addMaterialusagerecord: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/materialusagerecord', params),
//生产物料扣减列表
materialusagerecordList: (params = {}) => vm.$u.get(config.adminPath + '/mobile/pro/materialusagerecord/list', params),
//查询检验列表
ipqcList: (params = {}) => vm.$u.get(config.adminPath + '/mes/qc/ipqc/list', params),
//增加检验
addIpqc: (params = {}) => vm.$u.postJson(config.adminPath + '/mes/qc/ipqc', params),
//根据字典类型查询字典数据信息
getDicts: (params = {}) => vm.$u.get(config.adminPath + '/system/dict/data/type/' + params),
//根据字典类型查询字典数据信息
getIssusLinebyWorkorderCodes: (params = {}) => vm.$u.post(config.adminPath + '/mobile/wm/issueline/listByWorkorderCodes', params),
/**
* 工艺工序相关API
*/
getProcessInfo: (params = {}) => vm.$u.get(config.adminPath + '/mobile/pro/process/' + params
.processId),
//获取当前产品的SOP
getSopList: (params = {}) => vm.$u.get(config.adminPath + '/mobile/pro/taskissue/getSopList', params),
//生产投料
addIssue: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/taskissue/add', params),
//整个领料单投料
addholeIssue: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/taskissue/addIssue', params),
//删除投料信息
removeTaskIssue: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/taskissue/' + params
.recordId),
//获取当前工作站、当前生产任务对应的投料清单
getTaskIssueList: (params = {}) => vm.$u.get(config.adminPath + '/mobile/pro/taskissue/getlist',
params),
//查询可用的领料单
getReserveIssue: (params = {}) => vm.$u.get(config.adminPath +
'/mobile/pro/taskissue/getReserveIssueList', params),
//打印流转单
//投料验证
listFeedingInspection: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/proMaterial/listIssueLine', params),
validateFeedingInspection: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/proMaterial/validateFeedingInspection', params),
validateFeedingInspectionById: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/proMaterial/validateFeedingInspectionById', params),
//查询反冲料列表
recoilMaterialList: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/proMaterial/getRecoilMaterial', params),
//增加反冲料
addRecoilMaterial: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/proMaterial/addRecoilMaterial', params),
//删除反冲料
deleteRecoilMaterial: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/proMaterial/deleteRecoilMaterial', params),
//领料申请
listMaterialRequest: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/proMaterial/listMaterialRequest', params),
addMaterialRequest: (params = {}) => vm.$u.postJson(config.adminPath + '/mobile/pro/proMaterial/addMaterialRequest', params),
getWproworkOrderProcessItem: (params = {}) => vm.$u.get(config.adminPath +'/pro/materialRequest/selectworkorder/' + params.workorderId),
//退料申请
listMaterialReturn: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/proMaterial/listIssueLine', params),
addMaterialReturn: (params = {}) => vm.$u.postJson(config.adminPath + '/mobile/pro/proMaterial/addMaterialReturn', params),
//质量相关api
//获取当前产品、当前质检类型的质检模板行信息
getQcTemplateLine: (params = {}) => vm.$u.get(config.adminPath + '/mobile/qc/templateindex/getLines', params),
//首页相关api
getIndexCardInfo: (params = {}) => vm.$u.get(config.adminPath + '/mobile/index/getIndexCardInfo',
params),
getM2mOrderFlowList: (params = {}) => vm.$u.get(config.adminPath + '/mobile/index/getM2mOrderFlowList',
params),
//获取卡可购买套餐包
getM2mOrderPackageList: (params = {}) => vm.$u.get(config.adminPath +
'/mobile/index/getM2mOrderPackageList', params),
//查看生产工单
getWorkorder: (params = {}) => vm.$u.get(config.adminPath + '/mes/pro/workorder/list', params),
logout: (params = {}) => vm.$u.get(config.adminPath + '/mobile/login/logout', params),
authInfo: (params = {}) => vm.$u.get(config.adminPath + '/authInfo', params),
menuTree: (params = {}) => vm.$u.get(config.adminPath + '/menuTree', params),
switchSys: (params = {}) => vm.$u.get(config.adminPath + '/switch/' + params.sysCode),
dictData: (params = {}) => vm.$u.get(config.adminPath + '/system/dict/data/type/' + params.dictType),
// 账号服务:验证码接口、忘记密码接口、注册账号接口等
validCode: (params = {}) => vm.$u.getText('/validCode', params),
getFpValidCode: (params = {}) => vm.$u.post('/account/getFpValidCode', params),
savePwdByValidCode: (params = {}) => vm.$u.post('/account/savePwdByValidCode', params),
getRegValidCode: (params = {}) => vm.$u.post('/account/getRegValidCode', params),
saveRegByValidCode: (params = {}) => vm.$u.post('/account/saveRegByValidCode', params),
// APP公共服务
upgradeCheck: () => vm.$u.post('/app/upgrade/check', {
appCode: config.appCode,
appVersion: config.appVersion
}),
commentSave: (params = {}) => vm.$u.post('/app/comment/save', params),
// 个人信息修改 // 个人信息修改
user: { user: {
saveUserInfo: (params = {}) => vm.$u.post(config.adminPath + '/mobile/user/saveUserInfo', params), saveUserInfo: (params = {}) => vm.$u.post(config.adminPath + '/mobile/user/saveUserInfo', params),
...@@ -167,47 +30,6 @@ const install = (Vue, vm) => { ...@@ -167,47 +30,6 @@ const install = (Vue, vm) => {
empUser: { empUser: {
listData: (params = {}) => vm.$u.get(config.adminPath + '/sys/empUser/listData', params), listData: (params = {}) => vm.$u.get(config.adminPath + '/sys/empUser/listData', params),
}, },
// 组织机构查询
office: {
treeData: (params = {}) => vm.$u.get(config.adminPath + '/sys/office/treeData', params),
},
//查看异常模块信息
abnormal: {
detail: (params = {}) => vm.$u.get(config.adminPath+'/qc/information/list',params),
newlyAdd: (params = {}) => vm.$u.postJson(config.adminPath+'/qc/report',params),
},
//查看图片
viewpicture: {
//查看工单
viewWorkorder: (params = {}) => vm.$u.get(config.adminPath+'/mobile/pro/protask/getProWorkder',params),
//查看图片
viewSop: (params = {}) => vm.$u.get(config.adminPath+'/mes/md/sop/getProWorkder/' + params.workorderId),
},
// 增删改查例子
testData: {
form: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/form', params),
list: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/listData', params),
save: (params = {}) => vm.$u.postJson(config.adminPath + '/test/testData/save', params),
disable: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/disable', params),
enable: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/enable', params),
delete: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/delete', params),
},
// 刀模版相关
dModel: {
// 获取领用单
getToolsByProcessIdAndArrangeCode: (params = {}) => vm.$u.putJson(config.adminPath + '/tm/tmToolRequestUse/getToolsByProcessIdAndArrangeCode', params),
// 获取上下机记录
getRecordsByProcessIdAndArrangeCode: (params = {}) => vm.$u.putJson(config.adminPath + '/tm/tmToolMachinesRecord/getRecordsByProcessIdAndArrangeCode', params),
// 新增
tmToolMachines: (params = {}) => vm.$u.postJson(config.adminPath + '/tm/tmToolMachines', params),
tmToolMachinesRecord: (params = {}) => vm.$u.putJson(config.adminPath + '/tm/tmToolMachinesRecord', params)
}
}; };
} }
......
...@@ -11,6 +11,7 @@ const install = (Vue, vm) => { ...@@ -11,6 +11,7 @@ const install = (Vue, vm) => {
// 请求参数默认配置 // 请求参数默认配置
Vue.prototype.$u.http.setConfig({ Vue.prototype.$u.http.setConfig({
baseUrl: vm.vuex_config.baseUrl, baseUrl: vm.vuex_config.baseUrl,
baseSapUrl: vm.vuex_config.baseSapUrl,
originalData: true, originalData: true,
// 默认头部,http2约定header名称统一小写 aidex // 默认头部,http2约定header名称统一小写 aidex
header: { header: {
......
...@@ -38,14 +38,14 @@ ...@@ -38,14 +38,14 @@
<view class="bottomTitle" @tap="show = !show"> <view class="bottomTitle" @tap="show = !show">
<view class="desc">卷条码明细</view> <view class="desc">卷条码明细</view>
<view class="topIcons"> <view class="topIcons">
<text v-if="show"> <view v-if="show">
<u-icon name="arrow-down" color="#aaa" size="32"></u-icon> <u-icon name="arrow-down" color="#aaa" size="32"></u-icon>
展开 展开
</text> </view>
<text v-else> <view v-else>
<u-icon name="arrow-up" color="#aaa" size="32"></u-icon> <u-icon name="arrow-up" color="#aaa" size="32"></u-icon>
收起 收起
</text> </view>
</view> </view>
</view> </view>
<view v-if="!show" class="bottomBox"> <view v-if="!show" class="bottomBox">
......
...@@ -14,14 +14,14 @@ ...@@ -14,14 +14,14 @@
<view class="bottomTitle" @tap="show = !show"> <view class="bottomTitle" @tap="show = !show">
<view class="desc">展开调整明细</view> <view class="desc">展开调整明细</view>
<view class="topIcons"> <view class="topIcons">
<text v-if="show"> <view v-if="show">
<u-icon name="arrow-down" color="#aaa" size="32"></u-icon> <u-icon name="arrow-down" color="#aaa" size="32"></u-icon>
展开 展开
</text> </view>
<text v-else> <view v-else>
<u-icon name="arrow-up" color="#aaa" size="32"></u-icon> <u-icon name="arrow-up" color="#aaa" size="32"></u-icon>
收起 收起
</text> </view>
</view> </view>
</view> </view>
<view v-if="!show" class="bottomBox"> <view v-if="!show" class="bottomBox">
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<view class="inventoryDetail"> <view class="inventoryDetail">
<view class="detailTitle">盘点明细</view> <view class="detailTitle">盘点明细</view>
<view class=""> <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-icon name="plus"></u-icon>
新增 新增
</u-button> </u-button>
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<view class="boxRight"> <view class="boxRight">
<view class="items">891/1000pcs</view> <view class="items">891/1000pcs</view>
<view class="itemsBtn"> <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> </view>
</view> </view>
...@@ -60,6 +60,23 @@ ...@@ -60,6 +60,23 @@
</view> </view>
</view> </view>
<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn> <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> </view>
</template> </template>
...@@ -76,7 +93,7 @@ export default { ...@@ -76,7 +93,7 @@ export default {
data() { data() {
return { return {
value: '', value: '',
show: false, show: true,
btnArr: [ btnArr: [
{ {
style: '', style: '',
...@@ -84,12 +101,19 @@ export default { ...@@ -84,12 +101,19 @@ export default {
text: '盘点确认', text: '盘点确认',
way: 'goBack' way: 'goBack'
} }
] ],
addShowModel: false,
checkShowModel: false,
addForm: {
name: ''
},
checkForm: {
name: ''
},
}; };
}, },
computed: {}, computed: {},
methods: { methods: {
handleClickWork() {},
handleInput(e) { handleInput(e) {
console.log(e, 'eee'); console.log(e, 'eee');
}, },
...@@ -102,7 +126,10 @@ export default { ...@@ -102,7 +126,10 @@ export default {
}, },
ontabtap(e, type) { ontabtap(e, type) {
console.log('切换tab', e, type); console.log('切换tab', e, type);
} },
addConfirm(){
this.addShowModel = false
},
} }
}; };
</script> </script>
...@@ -205,4 +232,10 @@ export default { ...@@ -205,4 +232,10 @@ export default {
justify-content: space-between; justify-content: space-between;
border-bottom: 1px solid #333; border-bottom: 1px solid #333;
} }
.slot-content{
padding: 20rpx;
.u-form-item{
padding: 0;
}
}
</style> </style>
...@@ -38,14 +38,14 @@ ...@@ -38,14 +38,14 @@
<view class="bottomTitle" @tap="show = !show"> <view class="bottomTitle" @tap="show = !show">
<view class="desc">卷条码明细</view> <view class="desc">卷条码明细</view>
<view class="topIcons"> <view class="topIcons">
<text v-if="show"> <view v-if="show">
<u-icon name="arrow-down" color="#aaa" size="32"></u-icon> <u-icon name="arrow-down" color="#aaa" size="32"></u-icon>
展开 展开
</text> </view>
<text v-else> <view v-else>
<u-icon name="arrow-up" color="#aaa" size="32"></u-icon> <u-icon name="arrow-up" color="#aaa" size="32"></u-icon>
收起 收起
</text> </view>
</view> </view>
</view> </view>
<view v-if="!show" class="bottomBox"> <view v-if="!show" class="bottomBox">
...@@ -122,28 +122,28 @@ export default { ...@@ -122,28 +122,28 @@ export default {
style: '', style: '',
type: 'warning', type: 'warning',
text: '返回', text: '返回',
way: 'goBack', way: 'goBack'
}, },
{ {
style: '', style: '',
type: 'primary', type: 'primary',
text: '提交', text: '提交',
way: 'goSubmit', way: 'goSubmit'
} }
], ]
}; };
}, },
methods: { methods: {
getBtnHandle(row){ getBtnHandle(row) {
this[row.way]() this[row.way]();
}, },
goBack(){ goBack() {
uni.navigateBack(); uni.navigateBack();
}, },
goSubmit(){}, goSubmit() {},
handleInput(e) { handleInput(e) {
console.log(e, 'eee'); console.log(e, 'eee');
}, }
} }
}; };
</script> </script>
......
...@@ -15,7 +15,7 @@ class Request { ...@@ -15,7 +15,7 @@ class Request {
let interceptorRequest = this.interceptor.request(options); let interceptorRequest = this.interceptor.request(options);
if (interceptorRequest === false) { if (interceptorRequest === false) {
// 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调 // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
return new Promise(()=>{}); return new Promise(() => {});
} }
this.options = interceptorRequest; this.options = interceptorRequest;
} }
...@@ -34,7 +34,7 @@ class Request { ...@@ -34,7 +34,7 @@ class Request {
clearTimeout(this.config.timer); clearTimeout(this.config.timer);
this.config.timer = null; this.config.timer = null;
// 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
if(this.config.originalData) { if (this.config.originalData) {
// 判断是否存在拦截器 // 判断是否存在拦截器
if (this.interceptor.response && typeof this.interceptor.response === 'function') { if (this.interceptor.response && typeof this.interceptor.response === 'function') {
let resInterceptors = this.interceptor.response(response); let resInterceptors = this.interceptor.response(response);
...@@ -51,7 +51,8 @@ class Request { ...@@ -51,7 +51,8 @@ class Request {
} }
} else { } else {
if (response.statusCode == 200) { 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); let resInterceptors = this.interceptor.response(response.data);
if (resInterceptors !== false) { if (resInterceptors !== false) {
resolve(resInterceptors); resolve(resInterceptors);
...@@ -73,15 +74,21 @@ class Request { ...@@ -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()方法 // 判断用户传递的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)); options.url : '/' + options.url));
// 是否显示loading // 是否显示loading
// 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
// 而没有清除前者的定时器,导致前者超时,一直显示loading // 而没有清除前者的定时器,导致前者超时,一直显示loading
if(this.config.showLoading && !this.config.timer) { if (this.config.showLoading && !this.config.timer) {
this.config.timer = setTimeout(() => { this.config.timer = setTimeout(() => {
uni.showLoading({ uni.showLoading({
title: this.config.loadingText, title: this.config.loadingText,
...@@ -102,6 +109,7 @@ class Request { ...@@ -102,6 +109,7 @@ class Request {
constructor() { constructor() {
this.config = { this.config = {
baseUrl: '', // 请求的根域名 baseUrl: '', // 请求的根域名
baseSapUrl: '', // SAP请求的根域名
// 默认的请求头 // 默认的请求头
header: {}, header: {},
method: 'POST', method: 'POST',
......
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