From e67a8e54381be6234793c5df536d184426e060f3 Mon Sep 17 00:00:00 2001
From: xiaofajia <1665375861@qq.com>
Date: Sat, 23 Nov 2024 15:16:37 +0800
Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E6=96=99=E9=85=8D=E4=BB=B6=E4=B8=8A?=
=?UTF-8?q?=E4=BC=A0=E5=9B=BE=E7=89=87=E7=94=B1=E5=91=98=E5=B7=A5=E4=B8=8A?=
=?UTF-8?q?=E4=BC=A0=E6=94=B9=E4=BB=93=E5=BA=93=E4=B8=8A=E4=BC=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config.js | 4 +-
pages-repair/applyList/todoDetail.vue | 2 +-
.../inOutWarehouse/inOutWarehouse.vue | 92 +++++++++++++------
3 files changed, 68 insertions(+), 30 deletions(-)
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: '通知成功!',