141 lines
2.8 KiB
Vue
141 lines
2.8 KiB
Vue
<template>
|
||
<view>
|
||
<view class="addall" v-if="show">
|
||
<view>温馨提示</view>
|
||
<view>
|
||
<image src="/static/index/procurement/ddj.png" mode="aspectFill"></image>
|
||
</view>
|
||
<view>确认将所有未添加状态的库存预警物料添加至购物车中,并且物料的采购数量为物料的库存上限-库存数量吗?</view>
|
||
<view>
|
||
<view @click="$emit('back')">取消</view>
|
||
<view class="qd" @click="config()">确定</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import { queryInvoicingList,addShoppingCartList } from '../api/lunpan.js'
|
||
export default {
|
||
props:{
|
||
show:false,
|
||
},
|
||
data() {
|
||
return {
|
||
Materialarr:[]
|
||
}
|
||
},
|
||
methods: {
|
||
config(){
|
||
let warn = {
|
||
nuId: uni.getStorageSync('nuId'),
|
||
pageSize: -1,
|
||
isWaring: 1
|
||
}
|
||
queryInvoicingList(warn).then(res => {
|
||
this.Material=res.result.records;
|
||
this.add()
|
||
})
|
||
},
|
||
add(){
|
||
let r = []
|
||
this.Material.forEach(item=>{
|
||
if(item.isAdd!=1){
|
||
let n = item.suppliers_dictText.split(/[, ]+/);
|
||
let id = item.suppliers.split(/[, ]+/);
|
||
let max = Number(item.upperLimit)- Number(item.kcsl);
|
||
|
||
let dt = {
|
||
nuId:uni.getStorageSync('nuId'),
|
||
purchaseQuantity:max,
|
||
suppliersId:id[0],
|
||
suppliersName:n[0],
|
||
wlId:item.wlId,
|
||
kcsl:item.kcsl,
|
||
wlUnits:item.materialUnits,
|
||
referenceUnitPrice:item.referenceUnitPrice,
|
||
dhbl:type.num
|
||
}
|
||
r.push(dt)
|
||
}
|
||
})
|
||
addShoppingCartList(r).then(res=>{
|
||
uni.showToast({
|
||
icon:res.success?'success':'none',
|
||
title:res.message
|
||
})
|
||
this.$emit('config')
|
||
|
||
})
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped lang="less">
|
||
.addall{
|
||
width: 42.4vw;
|
||
height: 25vw;
|
||
background: #FFFFFF;
|
||
box-shadow: 0rpx 0rpx 1.3vw 0rpx rgba(163,167,182,0.16);
|
||
border-radius: 1.6vw;
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
margin: auto;
|
||
padding: 2.8vw;
|
||
z-index: 120;
|
||
>view{
|
||
&:nth-child(4){
|
||
width: 22vw;
|
||
display: flex;
|
||
justify-content: space-around;
|
||
margin: 1.8vw auto 0;
|
||
view{
|
||
width: 8.2vw;
|
||
height: 3.3vw;
|
||
background: #EDEDEF;
|
||
border-radius: 1.6vw;
|
||
font-weight: 400;
|
||
font-size: 1.6vw;
|
||
color: #888888;
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
border: 1px solid #888888;
|
||
}
|
||
.qd{
|
||
background: linear-gradient(0deg, #CAE0F9, #E9F4FF);
|
||
border: 1px solid rgba(3,133,250,0.34);
|
||
color: #0385FA;
|
||
}
|
||
}
|
||
&:nth-child(3){
|
||
width: 31vw;
|
||
height: 3.4vw;
|
||
font-weight: 400;
|
||
font-size: 1.2vw;
|
||
color: #888888;
|
||
line-height: 1.7vw;
|
||
margin: 0.4vw auto 0;
|
||
}
|
||
&:nth-child(2){
|
||
width: 7.6vw;
|
||
height: 7.6vw;
|
||
margin: 1.1vw auto 0;
|
||
image{
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
}
|
||
&:nth-child(1){
|
||
font-weight: 400;
|
||
font-size: 1.6vw;
|
||
color: #333333;
|
||
}
|
||
}
|
||
}
|
||
</style>
|