diff --git a/config.js b/config.js index 7101f2f..07e5515 100644 --- a/config.js +++ b/config.js @@ -1,9 +1,9 @@ // 应用全局配置 module.exports = { - baseUrl: 'https://www.nuoyunr.com', + // baseUrl: 'https://www.nuoyunr.com', // baseUrl: 'http://124.222.105.7:48080', // baseUrl: 'http://192.168.1.4:48080', - // baseUrl: "http://localhost:48080", + baseUrl: "http://localhost:48080", imagesUrl: 'http://shequ.0315e.com/static/images/pages/', baseImageUrl: 'https://www.nuoyunr.com/minio/', shareUrl: 'https://www.lighting-it.cn/share?inviteId=', diff --git a/pages-repair/applyList/todoDetail.vue b/pages-repair/applyList/todoDetail.vue index 2f4abe7..f35590d 100644 --- a/pages-repair/applyList/todoDetail.vue +++ b/pages-repair/applyList/todoDetail.vue @@ -59,7 +59,7 @@ {{ backText }} - + {{ yesText }} diff --git a/pages-warehouse/inOutWarehouse/inOutWarehouse.vue b/pages-warehouse/inOutWarehouse/inOutWarehouse.vue index 6d4d523..90a2a72 100644 --- a/pages-warehouse/inOutWarehouse/inOutWarehouse.vue +++ b/pages-warehouse/inOutWarehouse/inOutWarehouse.vue @@ -50,8 +50,18 @@ 采购 - {{ isReceive ? '通知领料' : '通知退料' }} + {{ isReceive ? '通知领料' : '通知退料' }} + + + + + + + + + @@ -62,6 +72,8 @@ import { getJSONData, setJSONData } from '@/utils/auth' import {getDictTextByCodeAndValue, createUniqueCodeByHead} from "@/utils/utils"; +import upload from "@/utils/upload"; +import config from "@/config"; export default { components: {VNavigationBar}, @@ -78,7 +90,9 @@ export default { active: '', isToBeReviewed: true, query: null, - selectRows: [] + selectRows: [], + fileList: [], + sizeType: ['compressed'], }; }, onLoad(data) { @@ -95,6 +109,36 @@ export default { computed: {}, methods: { + submitBefore(){ + if (this.isReceive){ + if (!this.selectRows || this.selectRows.length === 0){ + uni.showToast({ + title: '请选择配件!', + icon: 'none' + }) + return + } + this.$refs.popup.open() + }else { + this.submit() + } + }, + afterRead(file) { + for (let i = 0; i < file.tempFilePaths.length; i++) { + upload({ + url: '/admin-api/infra/file/upload', + filePath: file.tempFilePaths[i] + }).then((res) => { + this.fileList.push({ + url: config.baseImageUrl + res.data + }) + console.log(this.fileList) + }) + } + }, + deleteFile(file, index) { + this.fileList.splice(index, 1); + }, chooseItem(item) { const index = this.selectRows.findIndex(i => i.id === item.id) const parentIndex = this.wares.findIndex(i => i.id === item.id) @@ -152,27 +196,6 @@ export default { item.isSelected = this.selectRows.findIndex(i => i.id === item.id) !== -1 } }) - // res.data.map((item)=>{ - // if(!item.waresAlreadyCount){ - // item.waresAlreadyCount = 0 - // } - // if(!item.wares.stock){ - // item.wares.stock=0 - // } - // if(this.isReceive){ - // //领料,最大可领取数量为申请数量-已领取数量,同时不能大于库存数量,默认数量就是最大可领取数量 - // item.maxNum = parseInt(item.waresCount) - parseInt(item.waresAlreadyCount) - // if(item.maxNum >item.wares.stock){ - // item.maxNum = item.wares.stock - // } - // item.thisNum = item.maxNum - // }else{ - // //退料,最大数量为已领取数量,最小数量为0,默认数量为0 - // item.maxNum = item.waresAlreadyCount - // item.thisNum = 0 - // } - // }) - // this.wares = res.data; }) }, /** @@ -229,8 +252,15 @@ export default { userName: this.formData.repairName, soStatus: this.isReceive ? '04' : '07' } + if (!this.selectRows || this.selectRows.length === 0){ + uni.showToast({ + title: '请选择配件!', + icon: 'none' + }) + return + } // 过滤一下,thisNum不等0才行 - const flag = this.wares.filter(item => item.thisNum > 0) + const flag = this.selectRows.filter(item => item.thisNum > 0) if (!flag || flag.length === 0) { uni.showToast({ title: '请设置配件数量!', @@ -238,8 +268,8 @@ export default { }) return } - this.wares = flag - this.formData.repairSois = [...this.wares.map(item => { + // this.wares = flag + this.formData.repairSois = [...flag.map(item => { return { soiType: this.isReceive ? '02' : "04", goodsId: item.waresId, @@ -247,17 +277,25 @@ export default { } })] if (this.isReceive) { - this.formData.items = [...this.wares.map(item => { + this.formData.items = [...flag.map(item => { return { id: item.id, } })] } + if (this.isReceive && this.fileList && this.fileList.length > 0){ + this.formData.images = this.fileList.map(item => { + return item.path.replace(config.baseImageUrl, "") + }).join(",") + } request({ url: '/admin-api/repair/tw/pass', method: 'post', data: this.formData }).then((res) => { + if (this.isReceive){ + this.$refs.popup.close() + } if (res.code === 200) { uni.showToast({ title: '通知成功!',