diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4d4bb6f --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +**/*.log + +tests/**/coverage/ +tests/e2e/reports +selenium-debug.log + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.local + +package-lock.json +yarn.lock + +unpackage/ diff --git a/apis/apiTest.js b/apis/apiTest.js index 4e39475..3b9f334 100644 --- a/apis/apiTest.js +++ b/apis/apiTest.js @@ -257,7 +257,7 @@ const repairTestInStore = { const backMaterialReceive = { async backMaterialReceiveList (data = {} , header = {}){ - return await Http.post( + return await Http.get( HttpConfig.basePath, HttpConfig.serviceUrl.backMaterialReceive.backMaterialReceiveList, data, @@ -272,6 +272,19 @@ const backMaterialReceive = { header ) }, + async backMaterialSetNumBack (data = {} , header = {}){ + return await Http.post( + HttpConfig.basePath, + HttpConfig.serviceUrl.backMaterialReceive.backMaterialSetNumBack, + data, + header + ) + }, + + + + + fetchMaterialOutStore } export { diff --git a/apis/http.js b/apis/http.js index 6844bc3..3808859 100644 --- a/apis/http.js +++ b/apis/http.js @@ -1,17 +1,21 @@ -class HttpConfig{ - - // 演示基地址 - authPath = 'http://112.29.103.165:21624/auth' - systemPath = 'http://112.29.103.165:21624/system' - basePath = 'http://112.29.103.165:21624/base' - materialPath = 'http://112.29.103.165:21624/material' - - // 14服务器 - /* authPath = 'http://192.168.0.14:21624/auth' - systemPath = 'http://192.168.0.14:21624/system' - basePath = 'http://192.168.0.14:21624/base' - materialPath = 'http://192.168.0.14:21624/material' */ - +class HttpConfig { + // #ifdef H5 + baseUrl = "/api" + // #endif + // #ifdef APP-PLUS + baseUrl = "http://112.29.103.165:21624" + // #endif + // 演示基地址 + authPath = `${this.baseUrl}/auth` + systemPath = `${this.baseUrl}/system` + basePath = `${this.baseUrl}/base` + materialPath = `${this.baseUrl}/material` + // 14服务器 + /* authPath = 'http://192.168.0.14:21624/auth' + systemPath = 'http://192.168.0.14:21624/system' + basePath = 'http://192.168.0.14:21624/base' + materialPath = 'http://192.168.0.14:21624/material' */ + /* 调试ip 刘川:10.40.92.209 @@ -24,8 +28,8 @@ class HttpConfig{ materialPath = 'http://169.254.91.222:9302' */ // 短链 serviceUrl = { - login:{ - code: '/sendCode',// 获取验证码 + login: { + code: '/sendCode', // 获取验证码 }, user: { logOut: '/logout', // 退出登录 @@ -50,7 +54,7 @@ class HttpConfig{ exitMaterial: { exitDeptList: '/back_apply/getbackUnit', // 获取退料单位,工程列表 exitMaterialList: '/back_apply/getbackList', // 获取机具退料列表 - exitMaterialDetail: '/back_apply/view' ,// 获取退料设备详情 + exitMaterialDetail: '/back_apply/view', // 获取退料设备详情 subExitMaterial: '/back_apply/upload', // 提交退料清单 delMaterial: '/back_apply/del', // 删除退料申请 newExitList: '/back_apply/addBackTask', // 新建退料任务单 @@ -63,7 +67,7 @@ class HttpConfig{ subExitExam: '/back_apply/audit', // 提交单个审核 }, newInStore: { - + }, fix: { fixList: '/repair/getAppRepairTaskList', // 获取维修列表 @@ -77,7 +81,8 @@ class HttpConfig{ }, backMaterialReceive: { backMaterialReceiveList: '/backReceive/getbackReceiveList', // 获取退料接收列表 - backMaterialReceiveDetail: '/backReceive/receiveView' + backMaterialReceiveDetail: '/backReceive/receiveView', + backMaterialSetNumBack: '/backReceive/setNumBack', } } } diff --git a/manifest.json b/manifest.json index 1f0f3a7..bc787de 100644 --- a/manifest.json +++ b/manifest.json @@ -72,5 +72,18 @@ "uniStatistics" : { "enable" : false }, + + "h5" : { + "devServer":{ + "proxy":{ + "^/api":{ + "target":"http://112.29.103.165:21624", + "ws": true, + "changeOrigin": true, + "pathRewrite":{"^/api":""} + } + } + } + }, "vueVersion" : "2" } diff --git a/package.json b/package.json index 0b915f1..c2e7a60 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "dependencies": { + "qs": "^6.11.2", "uni-read-pages": "^1.0.5", "uni-simple-router": "^2.0.8-beta.4" } diff --git a/pages.json b/pages.json index 1d84e54..df7e131 100644 --- a/pages.json +++ b/pages.json @@ -368,7 +368,8 @@ "navigationBarTextStyle": "black", "navigationBarTitleText": "uni-app", "navigationBarBackgroundColor": "#F8F8F8", - "backgroundColor": "#F8F8F8" + "backgroundColor": "#F8F8F8", + "maxWidth": 750 }, "uniIdRouter": {} } diff --git a/pages/backMaterialReceive/backMaterialReceive.vue b/pages/backMaterialReceive/backMaterialReceive.vue index d7e1632..e90c9f3 100644 --- a/pages/backMaterialReceive/backMaterialReceive.vue +++ b/pages/backMaterialReceive/backMaterialReceive.vue @@ -62,9 +62,9 @@ --> - + - + diff --git a/pages/numReceive/numReceive.vue b/pages/numReceive/numReceive.vue index f25432b..dab5666 100644 --- a/pages/numReceive/numReceive.vue +++ b/pages/numReceive/numReceive.vue @@ -18,7 +18,7 @@ -

待修数量

+

待修数量

@@ -26,10 +26,7 @@ - + 确认 @@ -54,9 +51,28 @@ } }, methods: { - subForm () { + subForm() { + //三个数量之和小于等于10 才可提交 + // "taskId": "294", + // { + // "parentId": 34, + // "typeId": "5", + // "backNum": "1", + // "backStatus":: "3",//合格为 1 待修2 待报废2 + // "manageType": "1", + // "createBy": "1" + // } let that = this - that.totalNum = Number(that.lowerIpt.passedNum) + Number(that.lowerIpt.waitRepairNum) + Number(that.lowerIpt.waitCrashNum) + if (!this.lowerIpt.passedNum && !this.lowerIpt.waitRepairNum && !this.lowerIpt.waitCrashNum) { + uni.showToast({ + icon: 'none', + title: '!请至少填写一个数据' + }) + return + + } + that.totalNum = Number(that.lowerIpt.passedNum) + Number(that.lowerIpt.waitRepairNum) + Number(that + .lowerIpt.waitCrashNum) console.log(that.totalNum); if (that.totalNum > that.upperInfo.num) { uni.showToast({ @@ -64,42 +80,110 @@ title: '接收总量不能大于退库数量!' }) } else { - console.log(1); + that.$api.backMaterialReceive.backMaterialSetNumBack({ + taskId: this.upperInfo.taskId, + arr: this.handleSubmitData() + }).then(res => { + console.log("res===", res) + uni.showToast({ + icon: 'none', + title: '接收成功' + }) + setTimeout(() => { + uni.navigateBack() + }, + 300) + }) + } + + + + + + }, + handleSubmitData() { + let list = [] + const baseInfo = { + parentId: this.upperInfo.id, + typeId: this.upperInfo.typeId, + manageType: this.upperInfo.manageType, + createBy: this.upperInfo.userId + } + let passInfo = { + backStatus: 1, + backNum: this.lowerIpt.passedNum + } + let repairInfo = { + backStatus: 2, + backNum: this.lowerIpt.waitRepairNum + } + let crashInfo = { + backStatus: 3, + backNum: this.lowerIpt.waitCrashNum + } + + if (this.lowerIpt.passedNum) { + let info = { + ...baseInfo, + ...passInfo + } + list.push(info) + } + if (this.lowerIpt.waitRepairNum) { + let info = { + ...baseInfo, + ...repairInfo + } + list.push(info) + } + if (this.lowerIpt.waitCrashNum) { + let info = { + ...baseInfo, + ...crashInfo + } + list.push(info) + } + return list } }, onLoad(params) { - console.log(params); + console.log("ev", params); this.upperInfo = params } } + \ No newline at end of file diff --git a/public.js b/public.js index 6ca5571..647fc42 100644 --- a/public.js +++ b/public.js @@ -3,15 +3,34 @@ 阮世耀:10.40.92.195 韩遨宇:10.40.92.253 */ +// #ifdef H5 +const baseUrl = "/api" +// #endif +// #ifdef APP-PLUS +const baseUrl = "http://112.29.103.165:21624" +// #endif +// // #ifdef H5 +// authPath = '/api/auth' +// systemPath = '/api/system' +// basePath = '/api/base' +// materialPath = '/api/material' +// // #endif +// // #ifdef APP-PLUS +// authPath = 'http://112.29.103.165:21624/auth' +// systemPath = 'http://112.29.103.165:21624/system' +// basePath = 'http://112.29.103.165:21624/base' +// materialPath = '/material +// // #endif + // auth层 -const authPath = 'http://112.29.103.165:21624/auth' +let authPath = `${baseUrl}/auth` // 公用服务 -const systemPath = 'http://112.29.103.165:21624/system' +let systemPath = `${baseUrl}/system` // base层 -const basePath = 'http://112.29.103.165:21624/base' +let basePath = `${baseUrl}/base` export { authPath,