This commit is contained in:
Vinjor 2024-11-21 16:28:27 +08:00
commit 812c7d47a2
3 changed files with 95 additions and 79 deletions

View File

@ -1,9 +1,9 @@
// 应用全局配置 // 应用全局配置
module.exports = { module.exports = {
// baseUrl: 'https://www.nuoyunr.com', baseUrl: 'https://www.nuoyunr.com',
// baseUrl: 'http://124.222.105.7:48080', // baseUrl: 'http://124.222.105.7:48080',
// baseUrl: 'http://192.168.1.4:48080', // baseUrl: 'http://192.168.1.4:48080',
baseUrl: "http://localhost:48080", // baseUrl: "http://localhost:48080",
imagesUrl: 'http://shequ.0315e.com/static/images/pages/', imagesUrl: 'http://shequ.0315e.com/static/images/pages/',
baseImageUrl: 'https://www.nuoyunr.com/minio/', baseImageUrl: 'https://www.nuoyunr.com/minio/',
shareUrl: 'https://www.lighting-it.cn/share?inviteId=', shareUrl: 'https://www.lighting-it.cn/share?inviteId=',

View File

@ -199,6 +199,7 @@ export default {
}, },
// //
canClick:true, canClick:true,
subLoading: false
}; };
}, },
onLoad(data) { onLoad(data) {
@ -356,11 +357,14 @@ export default {
}) })
}, },
confirmOpe(type) { confirmOpe(type) {
if (!this.subLoading){
this.subLoading = true
if(this.selectWares.length==0){ if(this.selectWares.length==0){
uni.showToast({ uni.showToast({
title: '请选中要审核的配件!', title: '请选中要审核的配件!',
icon: 'none' icon: 'none'
}) })
this.subLoading = false
return return
} }
if (this.canClick) { if (this.canClick) {
@ -401,11 +405,14 @@ export default {
uni.navigateBack() uni.navigateBack()
}, 700) }, 700)
} }
this.subLoading = false
}) })
} catch (e) { } catch (e) {
this.subLoading = false
this.canClick = true this.canClick = true
} }
} }
}
}, },
} }
} }

View File

@ -96,7 +96,7 @@
<text class="label"></text> <text class="label"></text>
<text class="repairNum"></text> <text class="repairNum"></text>
<view class="submit" @click="submit" v-if="!isInput">保存</view> <view class="submit" @click="submit" v-if="!isInput">保存</view>
<view class="submit" @click="inWare" v-else>入库</view> <view class="submit" @click="inWare" v-else :disabled="subLoading">入库</view>
</view> </view>
</view> </view>
</template> </template>
@ -143,6 +143,7 @@ export default {
unitList: [], unitList: [],
query: null, query: null,
selectRows: [], selectRows: [],
subLoading: false
}; };
}, },
onLoad(data) { onLoad(data) {
@ -393,13 +394,15 @@ export default {
}).then(res => { }).then(res => {
this.partList = Object.entries(res.data) this.partList = Object.entries(res.data)
this.partList = this.partList.map(([key, value]) => { this.partList = this.partList.map(([key, value]) => {
return [key, value.filter(item => (!item.inCount && item.inCount !== item.goodsCount))] return [key, value.filter(item => {
return item.inCount !== item.goodsCount
})]
}) })
this.partList = this.partList.filter(([key, value]) => value.length > 0) this.partList = this.partList.filter(([key, value]) => value.length > 0)
this.partList.forEach(([key, value]) => { this.partList.forEach(([key, value]) => {
value.forEach(item => { value.forEach(item => {
item.goodsCount = item.goodsCount - item?.inCount | 0 item.goodsCount = item.goodsCount - (item.inCount ? item.inCount : 0)
item.inCount = item.goodsCount - item?.inCount | 0 item.inCount = item.goodsCount
}) })
}) })
const values = this.partList.map(([key, value]) => value) const values = this.partList.map(([key, value]) => value)
@ -422,15 +425,19 @@ export default {
* 入库 * 入库
*/ */
inWare() { inWare() {
if (!this.subLoading){
this.subLoading = true
const data = { const data = {
id: this.soId, id: this.soId,
soNo: createUniqueCodeByHead("RK") soNo: createUniqueCodeByHead("RK")
} }
if (this.selectRows && this.selectRows.length > 0){
data.soiList = [...this.selectRows]
data.waresList = [...this.selectRows.map(item => item.wares)]
}else {
const values = this.partList.map(([key, value]) => value).reduce((acc, item) => acc.concat(item)) const values = this.partList.map(([key, value]) => value).reduce((acc, item) => acc.concat(item))
if (this.selectRows && this.selectRows.length > 0){
const ids = this.selectRows.map(item => item.id)
const newSelect = values.filter(item => ids.includes(item.id))
data.soiList = [...newSelect]
data.waresList = [...newSelect.map(item => item.wares)]
}else {
data.soiList = [...values] data.soiList = [...values]
data.waresList = [...values.map(item => item.wares)] data.waresList = [...values.map(item => item.wares)]
} }
@ -448,7 +455,9 @@ export default {
uni.navigateBack() uni.navigateBack()
}, 700) }, 700)
} }
this.subLoading = false
}) })
}
// this.partList.forEach(item => { // this.partList.forEach(item => {
// item.inCount = item.count // item.inCount = item.count
// item.goodsId = item.id // item.goodsId = item.id