领料配件上传图片由员工上传改仓库上传
This commit is contained in:
parent
3bb57a7285
commit
e67a8e5438
@ -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=',
|
||||||
|
|||||||
@ -59,7 +59,7 @@
|
|||||||
<view class="no" @click="confirmOpe('no')">
|
<view class="no" @click="confirmOpe('no')">
|
||||||
{{ backText }}
|
{{ backText }}
|
||||||
</view>
|
</view>
|
||||||
<view class="yes" @click="openFile">
|
<view class="yes" @click="confirmOpe('yes')">
|
||||||
{{ yesText }}
|
{{ yesText }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -50,8 +50,18 @@
|
|||||||
<text class="label"></text>
|
<text class="label"></text>
|
||||||
<text class="repairNum"></text>
|
<text class="repairNum"></text>
|
||||||
<view class="submit" @click="toPart">采购</view>
|
<view class="submit" @click="toPart">采购</view>
|
||||||
<view class="submit" @click="submit">{{ isReceive ? '通知领料' : '通知退料' }}</view>
|
<view class="submit" @click="submitBefore">{{ isReceive ? '通知领料' : '通知退料' }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<uni-popup ref="popup" background-color="#fff">
|
||||||
|
<view class="popup-content" style="padding: 15px;">
|
||||||
|
<view class="dl-avatar-box">
|
||||||
|
<uni-file-picker :value="fileList" :sizeType="sizeType" @select="afterRead" @delete="deleteFile"
|
||||||
|
limit="9" title="请上传配件申请单照片(最多选择9张图片)"></uni-file-picker>
|
||||||
|
</view>
|
||||||
|
<button type="primary" @click="submit">保存</button>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -62,6 +72,8 @@ import {
|
|||||||
getJSONData, setJSONData
|
getJSONData, setJSONData
|
||||||
} from '@/utils/auth'
|
} from '@/utils/auth'
|
||||||
import {getDictTextByCodeAndValue, createUniqueCodeByHead} from "@/utils/utils";
|
import {getDictTextByCodeAndValue, createUniqueCodeByHead} from "@/utils/utils";
|
||||||
|
import upload from "@/utils/upload";
|
||||||
|
import config from "@/config";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {VNavigationBar},
|
components: {VNavigationBar},
|
||||||
@ -78,7 +90,9 @@ export default {
|
|||||||
active: '',
|
active: '',
|
||||||
isToBeReviewed: true,
|
isToBeReviewed: true,
|
||||||
query: null,
|
query: null,
|
||||||
selectRows: []
|
selectRows: [],
|
||||||
|
fileList: [],
|
||||||
|
sizeType: ['compressed'],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(data) {
|
onLoad(data) {
|
||||||
@ -95,6 +109,36 @@ export default {
|
|||||||
|
|
||||||
computed: {},
|
computed: {},
|
||||||
methods: {
|
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) {
|
chooseItem(item) {
|
||||||
const index = this.selectRows.findIndex(i => i.id === item.id)
|
const index = this.selectRows.findIndex(i => i.id === item.id)
|
||||||
const parentIndex = this.wares.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
|
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,
|
userName: this.formData.repairName,
|
||||||
soStatus: this.isReceive ? '04' : '07'
|
soStatus: this.isReceive ? '04' : '07'
|
||||||
}
|
}
|
||||||
|
if (!this.selectRows || this.selectRows.length === 0){
|
||||||
|
uni.showToast({
|
||||||
|
title: '请选择配件!',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
// 过滤一下,thisNum不等0才行
|
// 过滤一下,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) {
|
if (!flag || flag.length === 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请设置配件数量!',
|
title: '请设置配件数量!',
|
||||||
@ -238,8 +268,8 @@ export default {
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.wares = flag
|
// this.wares = flag
|
||||||
this.formData.repairSois = [...this.wares.map(item => {
|
this.formData.repairSois = [...flag.map(item => {
|
||||||
return {
|
return {
|
||||||
soiType: this.isReceive ? '02' : "04",
|
soiType: this.isReceive ? '02' : "04",
|
||||||
goodsId: item.waresId,
|
goodsId: item.waresId,
|
||||||
@ -247,17 +277,25 @@ export default {
|
|||||||
}
|
}
|
||||||
})]
|
})]
|
||||||
if (this.isReceive) {
|
if (this.isReceive) {
|
||||||
this.formData.items = [...this.wares.map(item => {
|
this.formData.items = [...flag.map(item => {
|
||||||
return {
|
return {
|
||||||
id: item.id,
|
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({
|
request({
|
||||||
url: '/admin-api/repair/tw/pass',
|
url: '/admin-api/repair/tw/pass',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: this.formData
|
data: this.formData
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
if (this.isReceive){
|
||||||
|
this.$refs.popup.close()
|
||||||
|
}
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '通知成功!',
|
title: '通知成功!',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user