123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- <template>
- <div>
- <uni-nav-bar title="物料接收" :status-bar="true" background-color="#3F92F9" color="#FFF">
- <view slot="left">
- <u-icon name="account-fill" color="#FFF" size="35"></u-icon>
- <span style="padding: 0 5rpx;color: #FFFFFF;">{{ userInfo.name }}</span>
- </view>
- <view slot="right" @tap="$utils.back()">
- <span style="color: #FFFFFF;">返回</span>
- </view>
- </uni-nav-bar>
- <view class="ul">
- <view class="li" v-for="i in dataList" :key="i.id">
- <view class="line">
- 物料编码:{{i.materialCode}}
- </view>
- <view class="line">
- 物料名称:{{i.materialName}}
- </view>
- <view class="line">
- 出库时间:{{i.createTime}}
- <view class="span">
- 数量:<span style="color:red">{{i.changeName}}</span>
- </view>
- </view>
- <view class="line">
- 接收人员:{{i.realName}}
- </view>
- <view class="btn-warp">
- <button @click="operation(4,i.id)">退回</button>
- <button @click="operation(3,i.id)">确认接收</button>
- </view>
- </view>
- </view>
- <button class="footer-btn" @click="operation('all')">
- 批量接受物料
- </button>
- </div>
- </template>
- <script>
- export default{
- name:"xx",
- data(){
- return{
- userInfo:this.$storage.getStorageSync('userInfo'),
- dataList:[],
- }
- },
- created(){
- setTimeout(()=>{
- this.getList()
- },100)
- },
- methods:{
- operation(_type,_id){
- var idList = []
- var operation = ''
- if(_type == 'all'){
-
- operation = 3
- for (var i = 0; i < this.dataList.length; i++) {
- idList.push(this.dataList[i].id)
- }
-
-
- }else{
- operation = _type
- idList = [_id]
- }
- console.log(idList,operation)
- uni.request({
- url: 'http://120.79.80.64:8050' + '/cloudApi/materialReceive/operation',
- method: 'POST',
- header:{
- 'Content-Type' : 'application/json',
- },
- data: {
- idList: idList,
- operation:operation,
- },
- success: res => {
- console.log(res)
- if(res.data.code == 200){
- this.$msg.showToast('操作成功!')
- this.getList()
- }
- },
- });
- },
- getList(){
- const v = this
- uni.request({
- url: 'http://120.79.80.64:8050' + '/cloudApi/materialReceive/list',
- method: 'POST',
- header:{
- 'Content-Type' : 'application/json',
- },
- data: {
- jobNo: this.userInfo.jobNo
- },
- success: res => {
- console.log(res)
- this.dataList = res.data.data
- },
- });
- },
- },
- }
- </script>
- <style scoped lang="less">
- .ul{
- padding-bottom: 200rpx;
- }
- .li{
- background-color: #fff;
- margin: 20rpx 20rpx 0;
- padding: 20rpx;
- list-style: none;
- .line{
-
- line-height: 70rpx;
- border: none;
- display: flex;
- padding: 0 20rpx;
- .span{
- margin-left: 50rpx;
- }
- }
- }
- .btn-warp{
- display: flex;
- button{
- width: 48%;
- }
- }
- .footer-btn{
- position: fixed;
- bottom: 10rpx;
- left: 10rpx;
- right: 10rpx;
- background-color: red;
- color: #fff;
- }
- </style>
|