<template>
|
<view class="has-foot">
|
<form>
|
<view class="cu-form-group ">
|
<view class="title">ASN单号</view>
|
<input placeholder="选择ASN单号" v-model="asnCode"></input>
|
<text class='cuIcon-search text-blue' @click="search"></text>
|
</view>
|
</form>
|
|
<view class="flex solid-bottom padding-sm justify-between">
|
<view class="text-blue">SKU数量:{{list.length}}</view>
|
</view>
|
|
<view class="cu-list det menu sm-border padding">
|
<block v-for="(item, index) in list" :key="index">
|
<view class="cu-bar bg-white solid-bottom margin-top-sm">
|
<view class="action">
|
<view class="index">
|
{{index+1}}
|
</view>
|
<view class="text-blue">
|
{{`${item.maktx}`}}
|
</view>
|
</view>
|
<!-- <view class="action" v-if="!isconfirm">
|
<text @click="remove(index)" class="cuIcon-close text-red" style="font-size: 24px;"></text>
|
</view> -->
|
</view>
|
|
<view class="cu-item ">
|
<view class="content">
|
<text class="text-black">采购单位: <text class="text-grey ">{{item.purUnit}}</text></text>
|
</view>
|
<view class="content">
|
<text class="text-black">采购数量: <text class="text-grey ">{{item.purQty}}</text></text>
|
</view>
|
</view>
|
|
<view class="cu-item ">
|
<view class="content">
|
<text class="text-black">供应商: <text class="text-grey ">{{item.suplierName}}</text></text>
|
</view>
|
<view class="content">
|
<text class="text-black">供应商编码: <text class="text-grey ">{{item.suplierCode}}</text></text>
|
</view>
|
</view>
|
|
</block>
|
</view>
|
|
<block v-if="list.length">
|
<view class="cu-bar bg-white solid-bottom ">
|
<view class="action">
|
<text class="cuIcon-title text-orange "></text> 报检记录
|
</view>
|
</view>
|
|
|
<view class="cu-timeline margin-bottom">
|
<view class="cu-item padding-tb-sm" v-for="el in histories" :key="el.name">
|
<view class="content flex justify-between padding-tb-sm">
|
<text>{{el.name}}</text> <text>{{el.date}}</text>
|
</view>
|
</view>
|
</view>
|
</block>
|
|
<view class="cu-bar btn-group foot">
|
<button class="cu-btn bg-blue shadow-blur" @click="confirm">提交报检</button>
|
</view>
|
|
</view>
|
</template>
|
|
<script>
|
import {
|
request
|
} from '../../common/request.js'
|
import {
|
mapState,
|
mapMutations,
|
mapActions,
|
mapGetters
|
} from 'vuex';
|
export default {
|
data() {
|
return {
|
asnCode: '',
|
asnId: '',
|
container: '',
|
list: [],
|
histories: [],
|
}
|
},
|
computed: {
|
...mapState('user', ['dynamicFields']),
|
allCount() {
|
return this.list.reduce((acc, row) => +row.qty + acc, 0) || 0
|
}
|
},
|
mounted() {
|
|
},
|
methods: {
|
async search() {
|
const {
|
code,
|
data,
|
msg
|
} = await request('/asnOrder/inspect/' + this.asnCode, {}, "get")
|
if (code === 200) {
|
this.list = data.items;
|
this.asnId = data.id;
|
// this.histories = data.histories;
|
|
} else {
|
uni.showToast({
|
title: msg,
|
icon: "none",
|
position: 'top'
|
})
|
}
|
|
},
|
async confirm() {
|
const {
|
code,
|
data,
|
msg
|
} = await request('/inspect/confirm/' + this.asnId, {}, "get")
|
if (code === 200) {
|
uni.showToast({
|
title: '报检成功'
|
})
|
this.list = []
|
this.asnCode = ''
|
this.asnId = ''
|
} else {
|
uni.showToast({
|
title: msg,
|
icon: "none",
|
position: 'top'
|
})
|
}
|
|
|
},
|
|
}
|
}
|
</script>
|
|
<style>
|
.index {
|
border: 1px solid #e54d42;
|
color: #e54d42;
|
border-radius: 50%;
|
display: block;
|
width: 50rpx;
|
height: 50rpx;
|
line-height: 48rpx;
|
text-align: center;
|
margin-right: 20rpx;
|
font-size: 30rpx;
|
}
|
|
.text-blue {
|
color: #0081ff !important;
|
|
}
|
|
.item {
|
position: relative;
|
display: flex;
|
min-height: 80upx;
|
align-items: center;
|
}
|
</style>
|