diff --git a/client_mp/common/http.api.js b/client_mp/common/http.api.js index 1ca9035..9a52683 100644 --- a/client_mp/common/http.api.js +++ b/client_mp/common/http.api.js @@ -34,7 +34,9 @@ const install = (Vue, vm) => { let checkInspectRecord = (id, params)=> vm.$u.put(`/quality/inspectrecord/${id}/check/`, params); - let upInspectDept = (id, params)=>vm.$u.put(`/quality/inspectdept/${id}/up/`, params); + let upInspectDept = (id, params)=>vm.$u.put(`/quality/inspectdept/${id}/up/`, params);//提交记录 + + let appointChecker = (params) => vm.$u.post('/quality/inspectrecord/appoint/', params);//检查指派 vm.$u.api = {getUserInfo, getCode, codeLogin, @@ -46,7 +48,8 @@ const install = (Vue, vm) => { getSubtaskDept, getInspectRecord, checkInspectRecord, - upInspectDept + upInspectDept, + appointChecker, }; } diff --git a/client_mp/common/http.interceptor.js b/client_mp/common/http.interceptor.js index 354eeb2..a9f9ab7 100644 --- a/client_mp/common/http.interceptor.js +++ b/client_mp/common/http.interceptor.js @@ -47,9 +47,9 @@ const install = (Vue, vm) => { } else if(res.code === 401){ vm.$u.toast('验证失败,请重新登录'); - // uni.reLaunch({ - // url:'/pages/login/login' - // }) + uni.reLaunch({ + url:'/pages/login/login' + }) return false; } else{ diff --git a/client_mp/pages.json b/client_mp/pages.json index 359281e..d2c52dc 100644 --- a/client_mp/pages.json +++ b/client_mp/pages.json @@ -15,7 +15,7 @@ "path" : "pages/home/home", "style" : { - "navigationBarTitleText": "主页", + "navigationBarTitleText": "", "enablePullDownRefresh": false } diff --git a/client_mp/pages/home/home.vue b/client_mp/pages/home/home.vue index 2565085..2988d8d 100644 --- a/client_mp/pages/home/home.vue +++ b/client_mp/pages/home/home.vue @@ -13,17 +13,17 @@ - + {{item.name}} - + diff --git a/client_mp/pages/inspectrecord/index.vue b/client_mp/pages/inspectrecord/index.vue index 470bff3..4c95ea9 100644 --- a/client_mp/pages/inspectrecord/index.vue +++ b/client_mp/pages/inspectrecord/index.vue @@ -1,7 +1,7 @@ @@ -110,30 +122,50 @@ // records1:[], // records2:[], is_self: false, - showNo: false + showNo: false, + mutiSelect:false, + showMembers:false, + members:[], + selects:[] } }, onLoad(options) { this.initData = options; + let pages = getCurrentPages(); + let prePage = pages[pages.length - 2]; + if(prePage && prePage.subtask){ + this.members = prePage.subtask.members + }else{ + this.$u.api.getSubinspectTask(this.initData.subtask).then(res=>{ + this.members = res.data.members + }) + } }, onShow() { this.getSubtaskDept(); - this.$u.api.getInspectRecords({ - subtask: this.initData.subtask, - dept: this.initData.dept, - pageoff: true - }).then(res => { - this.records_ = res.data - this.records = res.data - this.sectionChange(this.currentIndex) - // this.setCollapse(this.records_) - }) + this.getRecords() }, methods: { getSubtaskDept() { this.$u.api.getSubtaskDept(this.initData.id).then(res => { this.initData = res.data + if(this.initData.state == '已提交'){ + this.sectionChange(1) + } + }) + }, + getRecords(){ + this.$u.api.getInspectRecords({ + subtask: this.initData.subtask, + dept: this.initData.dept, + pageoff: true + }).then(res => { + this.records_ = res.data + this.records = res.data + this.mutiSelect = false + this.sectionChange(this.currentIndex) + // this.setCollapse(this.records_) }) }, selfChange(val) { @@ -153,6 +185,13 @@ sectionChange(index) { this.currentIndex = index; }, + mutiSelectChange(){ + if(this.mutiSelect){ + for(var i=0;i0){ + this.showMembers=true + this.selects = selects + }else{ + this.$u.toast('请选择检查项') + } + + }, + pickerConfirm(index){ + var that = this + let checker = that.members[index].member + uni.showModal({ + title: '提交', + content: '确认将'+ that.selects.length +'个检查指派给'+ that.members[index].member__name +'吗?', + success: function (res) { + if (res.confirm) { + that.$u.api.appointChecker({records:that.selects, checker:checker}).then(res=>{ + that.$u.toast('成功') + that.getRecords() + }) + } else if (res.cancel) { + + } + } + }); + }, upReport(){ let that = this uni.showModal({ @@ -217,8 +289,8 @@ success: function (res) { if (res.confirm) { that.$u.api.upInspectDept(that.initData.id).then(res=>{ - this.initData = res.data - this.$u.toast('提交成功') + that.initData = res.data + that.$u.toast('提交成功') }).catch(e=>{}) } else if (res.cancel) { diff --git a/client_mp/pages/inspectrecord/recorddetail.vue b/client_mp/pages/inspectrecord/recorddetail.vue index 851907b..d752926 100644 --- a/client_mp/pages/inspectrecord/recorddetail.vue +++ b/client_mp/pages/inspectrecord/recorddetail.vue @@ -3,8 +3,10 @@ - 类别:{{form.item_.type}} + + 类别:{{form.item_.type}} {{form.item_.sortnum}}.{{form.item_.name}} + {{form.item_.require}} diff --git a/client_mp/pages/inspectrecord/recorddo.vue b/client_mp/pages/inspectrecord/recorddo.vue index 54cda2e..c6720d8 100644 --- a/client_mp/pages/inspectrecord/recorddo.vue +++ b/client_mp/pages/inspectrecord/recorddo.vue @@ -4,7 +4,7 @@ :errorType="errorType"> - 类别:{{form.item_.type}} + 类别:{{form.item_.type}} {{form.item_.sortnum}}.{{form.item_.name}} diff --git a/client_mp/pages/subtask/my.vue b/client_mp/pages/subtask/my.vue index f1e66a9..4bdcaff 100644 --- a/client_mp/pages/subtask/my.vue +++ b/client_mp/pages/subtask/my.vue @@ -1,7 +1,7 @@