|
@@ -10,7 +10,7 @@
|
|
|
<text>收入仓库</text>
|
|
|
</view>
|
|
|
<view class="info-line-value">
|
|
|
- 鹏越中心仓
|
|
|
+ 鹏越中心仓-暂无
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="info-line">
|
|
@@ -18,7 +18,7 @@
|
|
|
<text>供应商</text>
|
|
|
</view>
|
|
|
<view class="info-line-value">
|
|
|
- 哇哈哈哈
|
|
|
+ {{orderInfo.supplierName}}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="info-line">
|
|
@@ -26,7 +26,7 @@
|
|
|
<text>入库类型</text>
|
|
|
</view>
|
|
|
<view class="info-line-value">
|
|
|
- 采购入库
|
|
|
+ {{orderInfo.subType}}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="info-line">
|
|
@@ -34,7 +34,7 @@
|
|
|
<text>入库日期</text>
|
|
|
</view>
|
|
|
<view class="info-line-value">
|
|
|
- 2025-04-03
|
|
|
+ {{orderInfo.operTime}}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="info-line">
|
|
@@ -42,7 +42,7 @@
|
|
|
<text>上传凭证</text>
|
|
|
</view>
|
|
|
<view class="info-line-value ss-p-y-24">
|
|
|
- <upload-image v-model="info.url" width="196rpx" height="196rpx"></upload-image>
|
|
|
+ <upload-image v-model="voucherPicture" width="196rpx" height="196rpx"></upload-image>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="info-line">
|
|
@@ -50,7 +50,7 @@
|
|
|
<text>备注信息</text>
|
|
|
</view>
|
|
|
<view class="info-line-value">
|
|
|
- <u-input v-model="info.mark" placeholder="请输入备注信息" border="none"></u-input>
|
|
|
+ <u-input v-model="orderInfo.mark" placeholder="请输入备注信息" border="none"></u-input>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -78,18 +78,18 @@
|
|
|
<!-- 货物清单 -->
|
|
|
<view class="cargo-list">
|
|
|
<view class="cargo-list-title">
|
|
|
- <view>出库货物清单</view>
|
|
|
+ <view>入库货物清单</view>
|
|
|
<view class="cargo-list-title-tips">(轻触货物查看详情)</view>
|
|
|
</view>
|
|
|
<block v-for="(item,i) in goodsList" :key="i">
|
|
|
- <good-item :item="item" @toDetail="toDetail">
|
|
|
+ <good-item :item="item" @toDetail="toDetail" @calendarClick="calendarClick">
|
|
|
<view class="num-box">
|
|
|
<view class="num-box-text">已确认入库数量</view>
|
|
|
- <u-number-box v-model="value">
|
|
|
+ <u-number-box v-model="item.materialNumber">
|
|
|
<view slot="minus" class="minus">
|
|
|
<u-icon name="minus" color="#0256FF" size="12"></u-icon>
|
|
|
</view>
|
|
|
- <text slot="input" class="input">{{value}}</text>
|
|
|
+ <text slot="input" class="input">{{item.materialNumber}}</text>
|
|
|
<view slot="plus" class="plus">
|
|
|
<u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
|
|
|
</view>
|
|
@@ -102,19 +102,29 @@
|
|
|
|
|
|
<view class="footer-box">
|
|
|
<view class="footer-box-l">
|
|
|
- <view>货物种类:5种</view>
|
|
|
- <view>货物种数:25件</view>
|
|
|
+ <view>货物种类:{{speciesNum}}种</view>
|
|
|
+ <view>货物种数:{{goodsNum}}件</view>
|
|
|
</view>
|
|
|
<button class="submitBtn" @tap="submitClick">
|
|
|
提交
|
|
|
</button>
|
|
|
</view>
|
|
|
<error-pop v-model="errorShow" @close="errorShow = false" @confirm="confirm" :content="popText.errorText"></error-pop>
|
|
|
- <success-pop v-model="successShow" @close="successShow = false" @backClick="backClick" :content="popText.success"></success-pop>
|
|
|
+ <success-pop v-model="successShow" @close="successShow = false" @backClick="backClick" :content="popText.successText"></success-pop>
|
|
|
<!-- 扫码之后弹窗 -->
|
|
|
<scaned-pop v-model="scanedShow" @close="scanedShow = false" @confirm="scanConfirm"></scaned-pop>
|
|
|
|
|
|
<goods-pop v-model="goodsShow" @close="goodsShow = false" type="caigou"></goods-pop>
|
|
|
+
|
|
|
+ <u-datetime-picker
|
|
|
+ :show="calendarShow"
|
|
|
+ v-model="value1"
|
|
|
+ :maxDate="maxDate"
|
|
|
+ mode="date"
|
|
|
+ :closeOnClickOverlay="true"
|
|
|
+ @confirm="calendarConfirm"
|
|
|
+ @cancel="calendarShow = false"
|
|
|
+ ></u-datetime-picker>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -124,6 +134,7 @@
|
|
|
import successPop from '@/components/success-pop/success-pop.vue'
|
|
|
import scanedPop from '@/components/scaned-pop/scaned-pop.vue'
|
|
|
import goodsPop from '@/components/goods-pop/goods-pop.vue'
|
|
|
+ import {orderDetail, orderInfo, orderSubmit} from '@/common/request/apis/purchase'
|
|
|
export default {
|
|
|
components: {
|
|
|
goodItem,
|
|
@@ -148,38 +159,153 @@
|
|
|
mark: '',
|
|
|
url: ''
|
|
|
},
|
|
|
- goodsList: [
|
|
|
- {
|
|
|
- src: '',
|
|
|
- name: '大童专用氨基酸洗发水',
|
|
|
- }, {
|
|
|
- src: '',
|
|
|
- name: '大童专用氨基酸洗发水',
|
|
|
- },
|
|
|
- ]
|
|
|
+ goodsList: [],
|
|
|
+ orderInfo:{},
|
|
|
+ id:'',
|
|
|
+ calendarShow:false,
|
|
|
+ value1: '',
|
|
|
+ maxDate:Number(new Date()),
|
|
|
+ chooseGoodsInfo:{}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad(e) {
|
|
|
+ uni.$on('scanFinish',(data)=>{
|
|
|
+ console.log('监听到事件来自 update ,携带参数 msg 为:' + data);
|
|
|
+ })
|
|
|
+ this.id = e.id
|
|
|
+ this.getOrderDetail(e.id)
|
|
|
+ this.getOrderInfo(e.id)
|
|
|
+ },
|
|
|
+ onHide() {
|
|
|
+ uni.$off('scanFinish')
|
|
|
+ },
|
|
|
+ onUnload() {
|
|
|
+ uni.$off('scanFinish')
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ speciesNum() {
|
|
|
+ let num = 0
|
|
|
+ if(this.goodsList.length == 0 || !this.goodsList) {
|
|
|
+ num = 0
|
|
|
+ }else {
|
|
|
+ num = this.goodsList.length
|
|
|
+ }
|
|
|
+ return num
|
|
|
+ },
|
|
|
+ // 手动输入的数量
|
|
|
+ goodsNum() {
|
|
|
+ let num = 0
|
|
|
+ if(this.goodsList.length == 0 || !this.goodsList) {
|
|
|
+ num = 0
|
|
|
+ }else {
|
|
|
+ this.goodsList.forEach(item=>{
|
|
|
+ num+=item.materialNumber
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return num
|
|
|
+ },
|
|
|
+ // 订单返回的数量
|
|
|
+ orderGoodsNum() {
|
|
|
+ let num = 0
|
|
|
+ if(this.goodsList.length == 0 || !this.goodsList) {
|
|
|
+ num = 0
|
|
|
+ }else {
|
|
|
+ this.goodsList.forEach(item=>{
|
|
|
+ num+=item.operNumber
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return num
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
+ calendarConfirm(val) {
|
|
|
+ this.goodsList.forEach(item=>{
|
|
|
+ if(item.id == this.chooseGoodsInfo.id) {
|
|
|
+ item.productionDate = this.$u.timeFormat(val.value, 'yyyy-mm-dd')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.calendarShow = false
|
|
|
+ },
|
|
|
+ calendarCole() {
|
|
|
+ this.calendarShow = false
|
|
|
+ },
|
|
|
+ calendarClick(item) {
|
|
|
+ console.log(item.productionDate,'item.productionDate')
|
|
|
+ this.chooseGoodsInfo = item
|
|
|
+ if(item.productionDate) {
|
|
|
+ this.value1 = Number(new Date(item.productionDate))
|
|
|
+ }else {
|
|
|
+ this.value1 = Number(new Date())
|
|
|
+ }
|
|
|
+ this.calendarShow = true
|
|
|
+ },
|
|
|
+ getOrderInfo(id) {
|
|
|
+ orderInfo(id)
|
|
|
+ .then(res=>{
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.orderInfo = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getOrderDetail(id) {
|
|
|
+ orderDetail(id)
|
|
|
+ .then(res=>{
|
|
|
+ if(res.code == 200) {
|
|
|
+ res.data.rows.forEach(item=>{
|
|
|
+ item.materialNumber = 0
|
|
|
+ })
|
|
|
+ this.goodsList = res.data.rows
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
submitClick() {
|
|
|
-
|
|
|
+ if(this.orderGoodsNum != this.goodsNum) {
|
|
|
+ return this.errorShow = true
|
|
|
+ }
|
|
|
+ this.toOrderSubmit()
|
|
|
+ },
|
|
|
+ toOrderSubmit() {
|
|
|
+ let materials = this.goodsList.map(item=> {
|
|
|
+ return {
|
|
|
+ batchNumber:item.batchNumber,
|
|
|
+ materialNumber:item.materialNumber,
|
|
|
+ productionDate:item.productionDate ? this.$u.timeFormat(item.productionDate, 'yyyy-mm-dd') : ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let params = {
|
|
|
+ id:this.id,
|
|
|
+ materials:materials,
|
|
|
+ voucherPicture:this.voucherPicture || '',
|
|
|
+ remark:this.orderInfo.mark || ''
|
|
|
+ }
|
|
|
+ orderSubmit(params)
|
|
|
+ .then(res=>{
|
|
|
+ if(res.code == 200) {
|
|
|
+ if(this.errorShow){
|
|
|
+ this.errorShow = false
|
|
|
+ }
|
|
|
+ this.successShow = true
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
confirm() {
|
|
|
- console.log('确定')
|
|
|
+ this.toOrderSubmit()
|
|
|
this.errorShow = false
|
|
|
},
|
|
|
backClick() {
|
|
|
-
|
|
|
+ uni.setStorageSync('orderRefresh',true)
|
|
|
+ uni.navigateBack()
|
|
|
},
|
|
|
// 扫码确认
|
|
|
scanConfirm() {
|
|
|
|
|
|
},
|
|
|
manualClick() {
|
|
|
- this.goodsShow = true
|
|
|
+ // this.goodsShow = true
|
|
|
},
|
|
|
- toDetail() {
|
|
|
+ toDetail(val) {
|
|
|
uni.navigateTo({
|
|
|
- url:'/pages/goods/detail'
|
|
|
+ url:`/pages/goods/detail?id=${val.id}&name=${val.materialName}`
|
|
|
})
|
|
|
}
|
|
|
}
|