<template>
|
<view class="rework">
|
<view class="rework_list">
|
<view class="rework_list_item">
|
<text><b>*</b>单据类型</text>
|
<view class="rework_list_item_right" @click="typeShow = true">
|
<text :class="form.typeName ? 'black' : ''">{{form.typeName ? form.typeName : '请选择'}}</text>
|
<u-icon name="arrow-right"></u-icon>
|
</view>
|
</view>
|
<view class="rework_list_item">
|
<text><b>*</b>入库仓库</text>
|
<view class="rework_list_item_right" @click="warehouseShow = true">
|
<text :class="form.warehouseName ? 'black' : ''">{{form.warehouseName ? form.warehouseName : '请选择'}}</text>
|
<u-icon name="arrow-right"></u-icon>
|
</view>
|
</view>
|
</view>
|
<view class="rework_qd">
|
<view class="rework_qd_title">
|
<view class="rework_qd_title_left">
|
<view class="x"></view>
|
<text>{{`入库物料清单${list.length}`}}</text>
|
</view>
|
<view class="rework_qd_title_right" @click="addItem()">
|
<image src="@/static/gongdan_ic_shoudong@2x.png" mode="widthFix"></image>
|
<text>增加入库</text>
|
</view>
|
</view>
|
<van-swipe-cell v-for="(item, index) in list" :key="index">
|
<view class="rework_qd_list">
|
<view class="rework_qd_item">
|
<text><b>*</b>入库货位</text>
|
<view class="rework_qd_item_right">
|
<text :class="item.locationName ? 'black' : ''">{{item.locationName ? item.locationName : '请选择'}}</text>
|
<u-icon name="arrow-right"></u-icon>
|
</view>
|
</view>
|
<view class="rework_qd_item">
|
<text><b>*</b>入库物料</text>
|
<view class="rework_qd_item_right">
|
<text :class="item.materialName ? 'black' : ''">{{item.materialName ? item.materialName : '请选择'}}</text>
|
<u-icon name="arrow-right"></u-icon>
|
</view>
|
</view>
|
<template v-if="form.type !== 25">
|
<view class="rework_qd_item">
|
<text>生产工序</text>
|
<view class="rework_qd_item_right">
|
<text :class="item.procedureName ? 'black' : ''">{{item.procedureName ? item.procedureName : '请选择'}}</text>
|
<u-icon name="arrow-right"></u-icon>
|
</view>
|
</view>
|
</template>
|
<view class="rework_qd_item">
|
<text><b>*</b>质量属性</text>
|
<view class="rework_qd_item_right">
|
<text :class="item.qualityTypeName ? 'black' : ''">{{item.qualityTypeName ? item.qualityTypeName : '请选择'}}</text>
|
<u-icon name="arrow-right"></u-icon>
|
</view>
|
</view>
|
<view class="rework_qd_item">
|
<text>批次号</text>
|
<view class="rework_qd_item_right">
|
<u--input placeholder="请输入" style="width: 230rpx;" border="surround" v-model="item.batch"></u--input>
|
</view>
|
</view>
|
<view class="rework_qd_item">
|
<text><b>*</b>入库数量<template v-if="item.unitName">({{ item.unitName }})</template></text>
|
<view class="rework_qd_item_right">
|
<u--input placeholder="0" border="surround" v-model="item.num"></u--input>
|
</view>
|
</view>
|
</view>
|
<template #right>
|
<van-button style="height: 100%;" square type="danger" text="删除" @click="dele(index)" />
|
</template>
|
</van-swipe-cell>
|
</view>
|
<view class="rework_zw"></view>
|
<view class="rework_footer">
|
<button class="rework_footer_submit">提交</button>
|
</view>
|
<u-toast ref="uToast"></u-toast>
|
<!-- 仓库 -->
|
<Warehouse :show="warehouseShow" @close="close" @value="getValue" />
|
<!-- 货位 -->
|
<location :show="locationShow" @close="close1" @value="getValue1" />
|
<!-- 单据类型 -->
|
<u-picker :show="typeShow" keyName="name" :columns="typeList" @confirm="confirm" @cancel="typeClose"></u-picker>
|
</view>
|
</template>
|
|
<script>
|
import Warehouse from '../../components/Warehouse.vue'
|
import location from '../../components/location.vue'
|
export default {
|
components: { Warehouse, location },
|
data() {
|
return {
|
form: {
|
warehouseName: '',
|
warehouseId: '',
|
type: '',
|
typeName: ''
|
},
|
list: [
|
{
|
batch: '',
|
locationId: '',
|
locationIdLabel: '',
|
locationName: '',
|
materialId: '',
|
materialName: '',
|
num: '',
|
hasBom: '',
|
procedureId: '',
|
procedureName: '',
|
qualityType: '',
|
qualityTypeName: '',
|
unitId: '',
|
unitName: ''
|
}
|
],
|
typeList: [[{name: '采购入库', id: 25}, {name: '库存调整', id: 28}]],
|
warehouseShow: false,
|
typeShow: false,
|
locationShow: false
|
};
|
},
|
methods: {
|
// 确认单据类型
|
confirm(val) {
|
this.form.type = val.value[0].id
|
this.form.typeName = val.value[0].name
|
this.typeShow = false
|
},
|
// 仓库确认
|
getValue(val) {
|
this.form.warehouseName = val.name
|
this.form.warehouseId = val.id
|
this.warehouseShow = false
|
},
|
typeClose() {
|
this.typeShow = false
|
},
|
close() {
|
this.warehouseShow = false
|
},
|
// 添加明细
|
addItem() {
|
if (!this.form.warehouseId) return this.$refs.uToast.show({ type: 'default', message: "请选择入库仓库" })
|
this.list.push({
|
batch: '',
|
locationId: this.list[this.list.length - 1].locationId,
|
locationName: this.list[this.list.length - 1].locationName,
|
locationIdLabel: this.list[this.list.length - 1].locationIdLabel,
|
materialId: '',
|
materialName: '',
|
num: '',
|
hasBom: '',
|
procedureId: '',
|
procedureName: '',
|
qualityType: this.list[this.list.length - 1].qualityType,
|
qualityTypeName: this.list[this.list.length - 1].qualityTypeName,
|
unitId: '',
|
unitName: ''
|
})
|
},
|
// 删除
|
dele(index) {
|
if (this.list.length === 1) {
|
this.$refs.uToast.show({ type: 'default', message: "至少保留一条物流清单信息" })
|
return
|
}
|
this.list.splice(index, 1)
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.rework {
|
width: 100%;
|
min-height: 100vh;
|
background-color: #F7F7F7;
|
.rework_list {
|
display: flex;
|
flex-direction: column;
|
background: #ffffff;
|
padding: 0 30rpx;
|
box-sizing: border-box;
|
.rework_list_item {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
height: 98rpx;
|
border-bottom: 1rrpx solid #E5E5E5;
|
&:last-child {
|
border: none;
|
}
|
text {
|
font-size: 30rpx;
|
font-weight: 400;
|
color: #222222;
|
flex-shrink: 0;
|
b {
|
font-size: 30rpx;
|
color: red;
|
margin-right: 5rpx;
|
}
|
}
|
.rework_list_item_right {
|
flex: 1;
|
display: flex;
|
align-items: center;
|
justify-content: flex-end;
|
text {
|
font-size: 28rpx;
|
font-weight: 400;
|
color: #999999;
|
}
|
.black {
|
color: black !important;
|
}
|
input {
|
width: 230rpx;
|
height: 60rpx;
|
font-size: 28rpx;
|
border-radius: 8rpx;
|
padding: 0 30rpx;
|
text-align: right;
|
box-sizing: border-box;
|
border: 1rpx solid #CCCCCC;
|
}
|
input::-webkit-input-placeholder {
|
font-size: 28rpx;
|
font-weight: 400;
|
color: #B2B2B2;
|
}
|
}
|
}
|
}
|
.rework_qd {
|
margin-top: 40rpx;
|
width: 100%;
|
background: #F7F7F7;
|
.rework_qd_title {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
padding: 0 30rpx 30rpx 30rpx;
|
.rework_qd_title_left {
|
display: flex;
|
align-items: center;
|
text {
|
font-size: 32rpx;
|
font-weight: 500;
|
color: #222222;
|
}
|
.x {
|
width: 8rpx;
|
height: 30rpx;
|
background: #4275FC;
|
border-radius: 2rpx;
|
margin-right: 12rpx;
|
}
|
}
|
.rework_qd_title_right {
|
display: flex;
|
align-items: center;
|
image {
|
width: 28rpx;
|
height: 28rpx;
|
margin-right: 12rpx;
|
}
|
text {
|
font-size: 28rpx;
|
font-family: PingFangSC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #4275FC;
|
}
|
}
|
}
|
.rework_qd_list {
|
display: flex;
|
flex-direction: column;
|
padding: 0 30rpx;
|
background: #FFFFFF;
|
box-sizing: border-box;
|
margin-bottom: 30rpx;
|
.rework_qd_item {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
height: 98rpx;
|
border-bottom: 1rpx solid #E5E5E5;
|
&:last-child {
|
border: none;
|
}
|
text {
|
font-size: 30rpx;
|
font-weight: 400;
|
color: #222222;
|
flex-shrink: 0;
|
b {
|
font-size: 30rpx;
|
color: red;
|
margin-right: 5rpx;
|
}
|
}
|
.rework_qd_item_right {
|
display: flex;
|
align-items: center;
|
text {
|
font-size: 28rpx;
|
font-weight: 400;
|
color: #999999;
|
}
|
.black {
|
color: black !important;
|
}
|
input {
|
width: 230rpx;
|
height: 60rpx;
|
font-size: 28rpx;
|
border-radius: 8rpx;
|
padding: 0 30rpx;
|
text-align: right;
|
box-sizing: border-box;
|
border: 1rpx solid #CCCCCC;
|
}
|
input::-webkit-input-placeholder { /* WebKit browsers */
|
font-size: 28rpx;
|
font-weight: 400;
|
color: #B2B2B2;
|
}
|
}
|
}
|
}
|
}
|
.rework_zw {
|
height: 168rpx;
|
}
|
.rework_footer {
|
width: calc(100% - 60rpx);
|
position: fixed;
|
bottom: 0;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
padding: 0 30rpx 68rpx 30rpx;
|
.rework_footer_add {
|
flex: 1;
|
height: 88rpx;
|
font-size: 30rpx;
|
font-weight: 500;
|
color: $nav-color;
|
background: #FFFFFF;
|
box-shadow: 0 0 12rpx 0 rgba(0,0,0,0.0800);
|
border-radius: 8rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
.rework_footer_submit {
|
flex: 1;
|
height: 88rpx;
|
font-size: 30rpx;
|
font-weight: 500;
|
color: #ffffff;
|
background: $nav-color;
|
box-shadow: 0 0 12rpx 0 rgba(0,0,0,0.0800);
|
border-radius: 8rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
border: none;
|
}
|
}
|
}
|
</style>
|