diff --git a/pages/exitMaterial/exitMaterial.vue b/pages/exitMaterial/exitMaterial.vue index d1fce36..f14fed3 100644 --- a/pages/exitMaterial/exitMaterial.vue +++ b/pages/exitMaterial/exitMaterial.vue @@ -113,19 +113,21 @@ - + filterable + > - + filterable + > @@ -231,25 +233,28 @@ import { basePath } from '../../public' deptChange (e) { let that = this console.log(e, that.fetchedList); - for (let i = 0; i < that.fetchedList.length; i++) { - if (e == that.fetchedList[i].id) { - that.newAdd.unitName = that.fetchedList[i].name - } - } - this.$api.fetchMaterial.getProjList({ - id: e - }, null).then(res => { + that.fetchedList.forEach(list => { + if (e.value == list.id) that.newAdd.unitName = list.name + }) + that.$api.fetchMaterial.getProjList({ + id: e.value + }).then(res => { console.log(res); if (res.data.code == 200) { - that.projRange = res.data.data.map((item) => { + that.projRange = res.data.data.map(item => { return { text: item['name'], value: item['id'] } }) + } else { + uni.showToast({ + icon: 'none', + title: res.data.msg + }) } }).catch(err => { - + console.log(err); }) }, formSubmit () { @@ -291,7 +296,10 @@ import { basePath } from '../../public' } } }).catch(err => { - + uni.showToast({ + icon: 'none', + title: '单位与工程不匹配!' + }) }) }) }, diff --git a/pages/orderCart/orderCart.vue b/pages/orderCart/orderCart.vue index f79a5c0..40151eb 100644 --- a/pages/orderCart/orderCart.vue +++ b/pages/orderCart/orderCart.vue @@ -58,17 +58,19 @@ - + filterable + > - + filterable + > @@ -266,9 +268,6 @@ import { basePath } from '../../public'; let that = this let nowRole = uni.getStorageSync('roles') let found = false - /* that.ableUseArr.forEach(item => { - if (nowRole.includes(item)) found = true - }) */ for (let role of nowRole) { console.log(role); if (that.ableUseArr.includes(role)) { @@ -278,9 +277,6 @@ import { basePath } from '../../public'; } console.log(found); await this.getgreementId() - /* if(this.deptFormData.deptName = ''){ - return; - } */ if (!found) { uni.showToast({ icon: 'none', @@ -350,7 +346,7 @@ import { basePath } from '../../public'; console.log(e); // 切换部门时展示工程 this.$api.fetchMaterial.getProjList({ - id: e + id: e.value }, null).then(res => { console.log(res); if (res.data.code == 200) {