|
|
@ -1,113 +1,127 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="content"> |
|
|
|
|
|
<view class="card" v-for="(item, index) in list" :key="index"> |
|
|
|
|
|
<view class="lf-row-between"> |
|
|
|
|
|
<view class="flex lf-row-center justify-center text-center"> |
|
|
|
|
|
<view class="lf-color-black lf-font-bold" v-if="item.material && item.material.m_name">{{ item.material.m_name }}</view> |
|
|
|
|
|
<view class="lf-m-l-10">{{item.spec.name}}</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view>单位: {{item.material.unit.unit_name}}</view> |
|
|
|
|
|
<!-- 修改功能先隐藏 --> |
|
|
|
|
|
<!-- <view style="color: #11D189;" @click="showEdit">修改</view> --> |
|
|
|
|
|
|
|
|
<view> |
|
|
|
|
|
<view class="lf-p-l-30 lf-p-r-30 lf-m-t-30 lf-w-100" style="position: fixed;top: 80rpx;overflow: hidden;z-index: 111;"> |
|
|
|
|
|
<view class="lf-flex search-self lf-w-100"> |
|
|
|
|
|
<u-icon name="search" class="search-icon"></u-icon> |
|
|
|
|
|
<input placeholder="搜索物资" confirm-type="search" class="lf-m-l-10 lf-font-28" :value="searchValue" @input="inputChange" @confirm="inputConfirm" /> |
|
|
</view> |
|
|
</view> |
|
|
<view class="lf-row-between lf-m-t-30"> |
|
|
|
|
|
<view>订购数</view> |
|
|
|
|
|
<view class="lf-flex"> |
|
|
|
|
|
<input class="input" placeholder="0" type="number" :disabled="true" v-if="item.material && item.purchase_number" v-model="item.purchase_number"/> |
|
|
|
|
|
<text class="lf-color-black" v-if="item.material && item.material.unit">{{item.material.unit.unit_name}}</text> |
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="search-employ"></view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="content" style="margin-top: 80rpx;"> |
|
|
|
|
|
<view class="card" v-for="(item, index) in list" :key="index" :class="item.searchStyle?'search-color':''"> |
|
|
|
|
|
<view class="lf-row-between"> |
|
|
|
|
|
<view class="flex lf-row-center justify-center text-center"> |
|
|
|
|
|
<view class="lf-color-black lf-font-bold" v-if="item.material && item.material.m_name">{{ item.material.m_name }}</view> |
|
|
|
|
|
<view class="lf-m-l-10">{{item.spec.name}}</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view>单位: {{item.material.unit.unit_name}}</view> |
|
|
|
|
|
<!-- 修改功能先隐藏 --> |
|
|
|
|
|
<!-- <view style="color: #11D189;" @click="showEdit">修改</view> --> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<view class="lf-row-between lf-m-t-30"> |
|
|
|
|
|
<view>实到数</view> |
|
|
|
|
|
<view class="lf-flex"> |
|
|
|
|
|
<input class="input" placeholder="0" type="number" v-model="item.reachNum" @blur="inputBlur(index, 'real_reach_number', $event)" /> |
|
|
|
|
|
<text class="lf-color-black" v-if="item.material && item.material.unit">{{item.material.unit.unit_name}}</text> |
|
|
|
|
|
|
|
|
<view class="lf-row-between lf-m-t-30"> |
|
|
|
|
|
<view>订购数</view> |
|
|
|
|
|
<view class="lf-flex"> |
|
|
|
|
|
<input class="input" placeholder="0" type="number" :disabled="true" v-if="item.material && item.purchase_number" v-model="item.purchase_number"/> |
|
|
|
|
|
<text class="lf-color-black" v-if="item.material && item.material.unit">{{item.material.unit.unit_name}}</text> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<view class="lf-row-between lf-m-t-30"> |
|
|
|
|
|
<view>实收数</view> |
|
|
|
|
|
<view class="lf-flex"> |
|
|
|
|
|
<input class="input" placeholder="0" type="number" v-model="item.receiveNum" @blur="inputBlur(index, 'real_receive_number', $event)" /> |
|
|
|
|
|
<text class="lf-color-black" v-if="item.material && item.material.unit">{{item.material.unit.unit_name}}</text> |
|
|
|
|
|
|
|
|
<view class="lf-row-between lf-m-t-30"> |
|
|
|
|
|
<view>实到数</view> |
|
|
|
|
|
<view class="lf-flex"> |
|
|
|
|
|
<input class="input" placeholder="0" type="number" v-model="item.reachNum" @blur="inputBlur(index, 'real_reach_number', $event)" /> |
|
|
|
|
|
<text class="lf-color-black" v-if="item.material && item.material.unit">{{item.material.unit.unit_name}}</text> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="lf-row-between lf-m-t-30"> |
|
|
|
|
|
<view>实收数</view> |
|
|
|
|
|
<view class="lf-flex"> |
|
|
|
|
|
<input class="input" placeholder="0" type="number" v-model="item.receiveNum" @blur="inputBlur(index, 'real_receive_number', $event)" /> |
|
|
|
|
|
<text class="lf-color-black" v-if="item.material && item.material.unit">{{item.material.unit.unit_name}}</text> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<!-- 修饰底部 --> |
|
|
|
|
|
<view :style="upload_list.length ? 'height: 260rpx' : 'height: 140rpx'"></view> |
|
|
|
|
|
<!-- 凭证图 --> |
|
|
|
|
|
<view class="fixed-images" v-if="upload_list.length"> |
|
|
|
|
|
<image class="ms-img" :src="item" @click="lookImage(index)" v-for="(item, index) in upload_list" :key="index" v-if="index < 6"></image> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="fixed-bottom" v-if="list.length"> |
|
|
|
|
|
<button class="btn btn1 lf-m-l-20" @click="is_show_voucher = true">上传凭证</button> |
|
|
|
|
|
<button class="btn" @click="comfirm">确认收货</button> |
|
|
|
|
|
</view> |
|
|
|
|
|
<!-- 弹出层-确认收货修改 TODO每个都应该是动态 --> |
|
|
|
|
|
<u-popup v-model="is_show_edit" mode="bottom" border-radius="20"> |
|
|
|
|
|
<view class="edit-popup-box"> |
|
|
|
|
|
<view class="popup-content"> |
|
|
|
|
|
<view> |
|
|
|
|
|
<view class="popup-item" hover-class="lf-opacity" :style="currentObj(1)?'border-bottom:none':''" @click="switchItem(1)"> |
|
|
|
|
|
<text class="lf-font-bold">选择供应商</text> |
|
|
|
|
|
<u-icon name="arrow-up" color="#777777" v-if="currentObj(1)"></u-icon> |
|
|
|
|
|
<u-icon name="arrow-down" color="#777777" v-else></u-icon> |
|
|
|
|
|
</view> |
|
|
|
|
|
<scroll-view :scroll-y="true" class="scroll-box" :style="currentObj(1)?'max-height:360rpx':'max-height:0rpx'"> |
|
|
|
|
|
<view class="lf-row-between scroll-item" v-for="(item, index) in supplier_list" :key="index" @click="checkItem(index, 'supplier_list')"> |
|
|
|
|
|
<view>{{ item.name }}</view> |
|
|
|
|
|
<u-icon name="checkmark-circle" color="#11D189" v-if="item.checked"></u-icon> |
|
|
|
|
|
|
|
|
<!-- 修饰底部 --> |
|
|
|
|
|
<view :style="upload_list.length ? 'height: 260rpx' : 'height: 140rpx'"></view> |
|
|
|
|
|
<!-- 凭证图 --> |
|
|
|
|
|
<view class="fixed-images" v-if="upload_list.length"> |
|
|
|
|
|
<image class="ms-img" :src="item" @click="lookImage(index)" v-for="(item, index) in upload_list" :key="index" v-if="index < 6"></image> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="fixed-bottom" v-if="list.length"> |
|
|
|
|
|
<button class="btn btn1 lf-m-l-20" @click="is_show_voucher = true">上传凭证</button> |
|
|
|
|
|
<button class="btn" @click="comfirm">确认收货</button> |
|
|
|
|
|
</view> |
|
|
|
|
|
<!-- 弹出层-确认收货修改 TODO每个都应该是动态 --> |
|
|
|
|
|
<u-popup v-model="is_show_edit" mode="bottom" border-radius="20"> |
|
|
|
|
|
<view class="edit-popup-box"> |
|
|
|
|
|
<view class="popup-content"> |
|
|
|
|
|
<view> |
|
|
|
|
|
<view class="popup-item" hover-class="lf-opacity" :style="currentObj(1)?'border-bottom:none':''" @click="switchItem(1)"> |
|
|
|
|
|
<text class="lf-font-bold">选择供应商</text> |
|
|
|
|
|
<u-icon name="arrow-up" color="#777777" v-if="currentObj(1)"></u-icon> |
|
|
|
|
|
<u-icon name="arrow-down" color="#777777" v-else></u-icon> |
|
|
</view> |
|
|
</view> |
|
|
</scroll-view> |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view> |
|
|
|
|
|
<view class="popup-item" hover-class="lf-opacity" :style="currentObj(2)?'border-bottom:none':''" @click="switchItem(2)"> |
|
|
|
|
|
<text class="lf-font-bold">选择物资</text> |
|
|
|
|
|
<u-icon name="arrow-up" color="#777777" v-if="currentObj(2)"></u-icon> |
|
|
|
|
|
<u-icon name="arrow-down" color="#777777" v-else></u-icon> |
|
|
|
|
|
|
|
|
<scroll-view :scroll-y="true" class="scroll-box" :style="currentObj(1)?'max-height:360rpx':'max-height:0rpx'"> |
|
|
|
|
|
<view class="lf-row-between scroll-item" v-for="(item, index) in supplier_list" :key="index" @click="checkItem(index, 'supplier_list')"> |
|
|
|
|
|
<view>{{ item.name }}</view> |
|
|
|
|
|
<u-icon name="checkmark-circle" color="#11D189" v-if="item.checked"></u-icon> |
|
|
|
|
|
</view> |
|
|
|
|
|
</scroll-view> |
|
|
</view> |
|
|
</view> |
|
|
<scroll-view :scroll-y="true" class="scroll-box" :style="currentObj(2)?'max-height:360rpx':'max-height:0rpx'"> |
|
|
|
|
|
<view class="lf-row-between scroll-item" v-for="(item, index) in material_list" :key="index" @click="checkItem(index, 'material_list')"> |
|
|
|
|
|
<view>{{ item.name }}</view> |
|
|
|
|
|
<u-icon name="checkmark-circle" color="#11D189" v-if="item.checked"></u-icon> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view> |
|
|
|
|
|
<view class="popup-item" hover-class="lf-opacity" :style="currentObj(2)?'border-bottom:none':''" @click="switchItem(2)"> |
|
|
|
|
|
<text class="lf-font-bold">选择物资</text> |
|
|
|
|
|
<u-icon name="arrow-up" color="#777777" v-if="currentObj(2)"></u-icon> |
|
|
|
|
|
<u-icon name="arrow-down" color="#777777" v-else></u-icon> |
|
|
</view> |
|
|
</view> |
|
|
</scroll-view> |
|
|
|
|
|
|
|
|
<scroll-view :scroll-y="true" class="scroll-box" :style="currentObj(2)?'max-height:360rpx':'max-height:0rpx'"> |
|
|
|
|
|
<view class="lf-row-between scroll-item" v-for="(item, index) in material_list" :key="index" @click="checkItem(index, 'material_list')"> |
|
|
|
|
|
<view>{{ item.name }}</view> |
|
|
|
|
|
<u-icon name="checkmark-circle" color="#11D189" v-if="item.checked"></u-icon> |
|
|
|
|
|
</view> |
|
|
|
|
|
</scroll-view> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<u-button class="popup-btn" @click="comfirmEdit">确认修改</u-button> |
|
|
</view> |
|
|
</view> |
|
|
<u-button class="popup-btn" @click="comfirmEdit">确认修改</u-button> |
|
|
|
|
|
</view> |
|
|
|
|
|
</u-popup> |
|
|
|
|
|
<!-- 弹出层-上传凭证 --> |
|
|
|
|
|
<u-popup v-model="is_show_voucher" mode="center" border-radius="20"> |
|
|
|
|
|
<view class="voucher-popup-box"> |
|
|
|
|
|
<view class="popup-content"> |
|
|
|
|
|
<view class="popup-title">上传凭证信息</view> |
|
|
|
|
|
<view class="popup-desc">请在此处上传检验检疫凭证、售卖资质等证书</view> |
|
|
|
|
|
<view class="popup-images"> |
|
|
|
|
|
<view class="popup-image-item" v-for="(item, index) in voucher_list" :key="index" @click="lookImage(index, 'voucher_list')"> |
|
|
|
|
|
<image :src="item" mode="aspectFill"></image> |
|
|
|
|
|
<view class="remove-image" @click.stop="removeInage(index)"> |
|
|
|
|
|
<u-icon name="close-circle"></u-icon> |
|
|
|
|
|
|
|
|
</u-popup> |
|
|
|
|
|
<!-- 弹出层-上传凭证 --> |
|
|
|
|
|
<u-popup v-model="is_show_voucher" mode="center" border-radius="20"> |
|
|
|
|
|
<view class="voucher-popup-box"> |
|
|
|
|
|
<view class="popup-content"> |
|
|
|
|
|
<view class="popup-title">上传凭证信息</view> |
|
|
|
|
|
<view class="popup-desc">请在此处上传检验检疫凭证、售卖资质等证书</view> |
|
|
|
|
|
<view class="popup-images"> |
|
|
|
|
|
<view class="popup-image-item" v-for="(item, index) in voucher_list" :key="index" @click="lookImage(index, 'voucher_list')"> |
|
|
|
|
|
<image :src="item" mode="aspectFill"></image> |
|
|
|
|
|
<view class="remove-image" @click.stop="removeInage(index)"> |
|
|
|
|
|
<u-icon name="close-circle"></u-icon> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<view class="popup-image-item popup-image-item-after" @click="uploadImage" v-if="voucher_list.length < 6"></view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="popup-image-item popup-image-item-after" @click="uploadImage" v-if="voucher_list.length < 6"></view> |
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="foot-btn"> |
|
|
|
|
|
<u-button class="popup-btn" @click="is_show_voucher = false">取消</u-button> |
|
|
|
|
|
<u-button class="popup-btn" @click="submitImage">确定</u-button> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="foot-btn"> |
|
|
|
|
|
<u-button class="popup-btn" @click="is_show_voucher = false">取消</u-button> |
|
|
|
|
|
<u-button class="popup-btn" @click="submitImage">确定</u-button> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
</u-popup> |
|
|
|
|
|
<!-- 预览图片组件 -->
<lf-previewimage ref="previewimage" /> |
|
|
|
|
|
|
|
|
</u-popup> |
|
|
|
|
|
<!-- 预览图片组件 --> |
|
|
|
|
|
<lf-previewimage ref="previewimage" /> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { uploadFile } from '@/common/uploadFile.js' |
|
|
|
|
|
|
|
|
import { uploadFile } from '@/common/uploadFile.js'; |
|
|
|
|
|
let timer = null; |
|
|
export default { |
|
|
export default { |
|
|
data(){ |
|
|
data(){ |
|
|
return { |
|
|
return { |
|
|
|
|
|
show_icon: true, |
|
|
|
|
|
searchValue: '', |
|
|
list: [], |
|
|
list: [], |
|
|
is_show_edit: false, |
|
|
is_show_edit: false, |
|
|
current_show: { |
|
|
current_show: { |
|
|
@ -155,6 +169,42 @@ |
|
|
this.getData(); |
|
|
this.getData(); |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
// 搜索input值被改变 |
|
|
|
|
|
inputChange(event){ |
|
|
|
|
|
if(timer){ |
|
|
|
|
|
clearTimeout(timer); |
|
|
|
|
|
timer = null; |
|
|
|
|
|
} |
|
|
|
|
|
timer = setTimeout(() => { |
|
|
|
|
|
this.searchValue = event.detail.value; |
|
|
|
|
|
let positionIndex = null; |
|
|
|
|
|
this.list.forEach((item,index) => { |
|
|
|
|
|
if(this.searchValue && item.material.m_name.indexOf(this.searchValue) >= 0){ |
|
|
|
|
|
if(positionIndex == null){ |
|
|
|
|
|
positionIndex = index; // 拿到第一个被匹配的table item |
|
|
|
|
|
} |
|
|
|
|
|
this.$set(item,'searchStyle',true) |
|
|
|
|
|
}else { |
|
|
|
|
|
this.$set(item,'searchStyle',false) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if(positionIndex != null) { |
|
|
|
|
|
let tabView = document.querySelector('.content'); // 获取第一层大对象,table |
|
|
|
|
|
let tabContent = tabView.querySelector('.card'); // 获取第二层 |
|
|
|
|
|
let offsetHeight = tabContent.offsetHeight; // table行高度 |
|
|
|
|
|
let heightself = offsetHeight*positionIndex |
|
|
|
|
|
uni.pageScrollTo({ |
|
|
|
|
|
scrollTop: heightself |
|
|
|
|
|
}); |
|
|
|
|
|
}else if(this.searchValue){ |
|
|
|
|
|
this.$msg('该关键字没有搜索到物资哦') |
|
|
|
|
|
} |
|
|
|
|
|
}, 1000); |
|
|
|
|
|
}, |
|
|
|
|
|
// 搜索按下回车 |
|
|
|
|
|
inputConfirm(event){ |
|
|
|
|
|
this.searchValue = event.detail.value; |
|
|
|
|
|
}, |
|
|
// 预览图片 |
|
|
// 预览图片 |
|
|
lookImage(current){ |
|
|
lookImage(current){ |
|
|
this.$u.throttle(() => { |
|
|
this.$u.throttle(() => { |
|
|
@ -318,11 +368,38 @@ |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |
|
|
<style lang="scss" scoped="scoped"> |
|
|
<style lang="scss" scoped="scoped"> |
|
|
|
|
|
.search-employ { |
|
|
|
|
|
height: 162rpx; |
|
|
|
|
|
background-color: rgb(246, 246, 246); |
|
|
|
|
|
overflow: hidden; |
|
|
|
|
|
position: fixed; |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
top: 28rpx; |
|
|
|
|
|
} |
|
|
|
|
|
.search-color { |
|
|
|
|
|
background-color: #ffdede!important; |
|
|
|
|
|
} |
|
|
|
|
|
.search-icon { |
|
|
|
|
|
color: #777; |
|
|
|
|
|
} |
|
|
|
|
|
.search-self { |
|
|
|
|
|
background: rgb(228,228,228); |
|
|
|
|
|
padding: 10rpx 0 10rpx 20rpx; |
|
|
|
|
|
border-radius: 40rpx; |
|
|
|
|
|
font-size: 28rpx; |
|
|
|
|
|
} |
|
|
|
|
|
.search-self .uni-input-placeholder { |
|
|
|
|
|
margin-right: 500px; |
|
|
|
|
|
color: #777; |
|
|
|
|
|
font-size: 28rpx; |
|
|
|
|
|
} |
|
|
.content{ |
|
|
.content{ |
|
|
display: flex; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
flex-wrap: wrap; |
|
|
flex-wrap: wrap; |
|
|
flex-direction: column; |
|
|
flex-direction: column; |
|
|
|
|
|
overflow: scroll; |
|
|
|
|
|
-webkit-overflow-scrolling: touch; |
|
|
} |
|
|
} |
|
|
.card{ |
|
|
.card{ |
|
|
width: 686rpx; |
|
|
width: 686rpx; |
|
|
|