收货确认改新版

This commit is contained in:
蔡玲
2024-11-14 11:29:40 +08:00
parent 1853cf9094
commit 622f3192f5
5 changed files with 131 additions and 279 deletions

View File

@@ -2,10 +2,12 @@
<view class="content"> <view class="content">
<nav-bar title="移库"></nav-bar> <nav-bar title="移库"></nav-bar>
<view class="search-confirm-wrap"> <view class="search-confirm-wrap">
<view class="zd-row jcflexstart"> <view class="zd-row">
<view class="zd-col-7"><search-box placeholder="输入查询条件" v-model="val1" /></view> <view class="zd-row zd-col-14">
<view class="zd-col-7 select_wraper mgl10"> <view class="zd-col-12"><search-box placeholder="输入查询条件" v-model="val1" /></view>
<zxz-uni-data-select placeholder="选择仓库" v-model="value1" filterable :localdata="range1"></zxz-uni-data-select> <view class="zd-col-12 select_wraper mgl10">
<zxz-uni-data-select placeholder="选择仓库" v-model="value1" filterable :localdata="range1"></zxz-uni-data-select>
</view>
</view> </view>
<button class="confirm-button" @tap="toSearch">查询</button> <button class="confirm-button" @tap="toSearch">查询</button>
</view> </view>

View File

@@ -4,11 +4,11 @@
<view class="search-confirm-wrap"> <view class="search-confirm-wrap">
<view class="zd-row"> <view class="zd-row">
<view class="zd-col-24 zd-row jcflexstart"> <view class="zd-col-24 zd-row jcflexstart">
<view :class="crType === 'OUT' ? 'zd-col-8' : 'zd-col-16'"><search-box placeholder="输入查询条件" v-model="val1" /></view> <view :class="crType === 'OUT' ? 'zd-col-10' : 'zd-col-16'"><search-box placeholder="输入查询条件" v-model="val1" /></view>
<view class="select_wraper mgl10":class="crType === 'OUT' ? 'zd-col-8' : 'zd-col-16'"> <view class="select_wraper mgl10":class="crType === 'OUT' ? 'zd-col-8' : 'zd-col-16'">
<zxz-uni-data-select placeholder="选择仓库" v-model="value1" filterable :localdata="range1"></zxz-uni-data-select> <zxz-uni-data-select placeholder="选择仓库" v-model="value1" filterable :localdata="range1"></zxz-uni-data-select>
</view> </view>
<view v-if="crType === 'OUT'" class="zd-col-8 select_wraper mgl10"> <view v-if="crType === 'OUT'" class="zd-col-6 select_wraper mgl10">
<zxz-uni-data-select placeholder="选择仓管员" v-model="value2" filterable :localdata="range2"></zxz-uni-data-select> <zxz-uni-data-select placeholder="选择仓管员" v-model="value2" filterable :localdata="range2"></zxz-uni-data-select>
</view> </view>
</view> </view>

View File

@@ -2,10 +2,12 @@
<view class="content"> <view class="content">
<nav-bar title="移库"></nav-bar> <nav-bar title="移库"></nav-bar>
<view class="search-confirm-wrap"> <view class="search-confirm-wrap">
<view class="zd-row jcflexstart"> <view class="zd-row">
<view class="zd-col-7"><search-box placeholder="输入查询条件" v-model="val1" /></view> <view class="zd-row zd-col-14">
<view class="zd-col-7 select_wraper mgl10"> <view class="zd-col-12"><search-box placeholder="输入查询条件" v-model="val1" /></view>
<zxz-uni-data-select placeholder="选择仓库" v-model="value1" filterable :localdata="range1"></zxz-uni-data-select> <view class="zd-col-12 select_wraper mgl10">
<zxz-uni-data-select placeholder="选择仓库" v-model="value1" filterable :localdata="range1"></zxz-uni-data-select>
</view>
</view> </view>
<button class="confirm-button" @tap="toSearch">查询</button> <button class="confirm-button" @tap="toSearch">查询</button>
</view> </view>

View File

@@ -3,16 +3,13 @@
<nav-bar title="收货确认"></nav-bar> <nav-bar title="收货确认"></nav-bar>
<view class="search-confirm-wrap"> <view class="search-confirm-wrap">
<view class="zd-row"> <view class="zd-row">
<view class="zd-col-24 zd-row jcflexstart"> <view class="zd-row zd-col-14">
<view class="zd-col-11"><search-box placeholder="请输入查询条件" v-model="val1" /></view> <view class="zd-col-12"><search-box placeholder="请输入查询条件" v-model="val1" /></view>
<view class="zd-col-11 select_wraper mgl10"> <view class="zd-col-12 select_wraper mgl10">
<zxz-uni-data-select placeholder="请选择收货组织信息" v-model="value1" filterable :localdata="range1"></zxz-uni-data-select> <zxz-uni-data-select placeholder="请选择收货组织信息" v-model="value1" filterable :localdata="range1"></zxz-uni-data-select>
</view> </view>
</view> </view>
<button class="confirm-button" @tap="toSearch">查询</button> <button class="confirm-button" @tap="toSearch">查询</button>
<button class="confirm-button confirm-button_1" :class="{'confirm-button_disabled': !subCheckData.length}" @tap="showPop(3, '', '')">一键设置仓库</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !subCheckData.length}" @tap="showPop(2, '', '')">库位分配</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !subCheckData.length}" :disabled="disabled1" @tap="_receiptBillConfirm">收货确认</button>
</view> </view>
</view> </view>
<view class="zd-row jcflexstart table-title_wraper">收货确认</view> <view class="zd-row jcflexstart table-title_wraper">收货确认</view>
@@ -47,9 +44,19 @@
<uni-icons type="more-filled" size="14" color="#fff"></uni-icons> <uni-icons type="more-filled" size="14" color="#fff"></uni-icons>
</view> </view>
</view> </view>
<!-- 二级表格start --> <!-- 表格start -->
<view v-if="e.subData.length > 0" class="zd-sec-wraper pd0"> <view v-if="e.subData.length > 0" class="zd-sec-wraper">
<view class="table-wrap"> <view class="search-confirm-wrap_2">
<view class="zd-row">
<view class="zd-col-24 zd-row jcflexstart">
<view class="zd-col-9"><search-box v-model="val2" :scanShow="false" placeholder="请输入物料信息" /></view>
</view>
<button class="confirm-button" @tap="toSubSearch(e)">查询</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !e.subOneChecked}" @tap="showPop(1, e, {})">一键设置</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !e.subOneChecked}" :disabled="disabled1" @tap="_receiptBillConfirm(e)">确认收货</button>
</view>
</view>
<view class="table-wrap table-wrap_1">
<table class="grid-table"> <table class="grid-table">
<thead> <thead>
<tr> <tr>
@@ -84,7 +91,7 @@
<view class="zd-checkbox zd-checkbox_i" :class="{'zd-checkbox_active': el.checked}"></view> <view class="zd-checkbox zd-checkbox_i" :class="{'zd-checkbox_active': el.checked}"></view>
</view> </view>
</td> </td>
<td><view class="underline fontcol1" @tap="showPop(1, e, el)">{{el.cgbh}}</view></td> <td><view class="fontcol1">{{el.cgbh}}</view></td>
<td>{{el.wlbm}}</td> <td>{{el.wlbm}}</td>
<td>{{el.wlmc}}</td> <td>{{el.wlmc}}</td>
<td>{{el.jldw}}</td> <td>{{el.jldw}}</td>
@@ -93,8 +100,8 @@
<td>{{el.bcshsl}}</td> <td>{{el.bcshsl}}</td>
<td>{{el.zzmc}}</td> <td>{{el.zzmc}}</td>
<td>{{['否', '是'][Number(el.sfzj)]}}</td> <td>{{['否', '是'][Number(el.sfzj)]}}</td>
<td><input class="td_input" type="number" v-model="el.shsl" @blur="updateNumkw(el)" /></td> <td><input class="td_input" type="number" v-model="el.shsl" @blur="updateNumkw(e)" @confirm="updateNumkw(e)"/></td>
<td @tap.stop="showPop(0, e, el)"> <td @tap.stop="showPop(2, e, el)">
<view class="zd-row td_change"> <view class="zd-row td_change">
<uni-icons type="shop" size="16" color="#fff"></uni-icons> <uni-icons type="shop" size="16" color="#fff"></uni-icons>
<view class="mgl10">{{el.ckbm}}</view> <view class="mgl10">{{el.ckbm}}</view>
@@ -109,7 +116,7 @@
</table> </table>
</view> </view>
</view> </view>
<!-- 二级表格end --> <!-- 表格end -->
</view> </view>
</view> </view>
<view class="zd-row jcenter pd20"> <view class="zd-row jcenter pd20">
@@ -119,78 +126,18 @@
<view class="footer"></view> <view class="footer"></view>
<grid-detail :show="delShow" :data="detailObj" @closeDetail="delShow=false"></grid-detail> <grid-detail :show="delShow" :data="detailObj" @closeDetail="delShow=false"></grid-detail>
<view class="pop-wraper" :class="{'popshow': show, 'pophide': !show}"> <view class="pop-wraper" :class="{'popshow': show, 'pophide': !show}">
<view v-if="type === 0" class="allwidth pop-title">修改收货仓库</view> <view v-if="type === 1" class="allwidth pop-title">一键设置仓库</view>
<view v-if="type === 1 || type === 2" class="allwidth pop-title">分配明细</view> <view v-if="type === 2" class="allwidth pop-title">修改收货仓库</view>
<view v-if="type === 3" class="allwidth pop-title">一键设置仓库</view> <view class="zd-row jcenter kwcode_wraper">
<view v-if="type === 0" class="zd-row jcenter kwcode_wraper">
<view class="zd-col-10 select_wraper"> <view class="zd-col-10 select_wraper">
<zxz-uni-data-select placeholder="请选择仓库名称" v-model="value2" filterable :localdata="range2"></zxz-uni-data-select> <zxz-uni-data-select placeholder="请选择仓库名称" v-model="value2" filterable :localdata="range2"></zxz-uni-data-select>
</view> </view>
</view> </view>
<view v-if="type === 1 || type === 2" class="pop-grid-wraper">
<view class="zd-row sticky zd-sec-th-wraper zd-pop-th-wraper">
<view class="zd-col-2 zd-sec-th"><text>序号</text></view>
<view class="zd-col-4 zd-sec-th"><text>物料编号</text></view>
<view class="zd-col-5 zd-sec-th"><text>物料名称</text></view>
<view class="zd-col-5 zd-sec-th"><text>库位编码</text></view>
<view class="zd-col-4 zd-sec-th"><text>数量</text></view>
<view class="zd-col-4 zd-sec-th"><text>库存数量</text></view>
<view class="zd-col-4 zd-sec-th"><text>单据编号</text></view>
<view class="zd-col-4 zd-sec-th"><text>分录序号</text></view>
<view class="zd-col-4 zd-sec-th"><text>备注</text></view>
</view>
<view v-if="type === 1" class="zd-row zd-td-wraper" v-for="(ele, t) in popData" :key="ele.id">
<view class="zd-col-2 zd-sec-td zd-pop-td"><text>{{t+1}}</text></view>
<view class="zd-col-4 zd-sec-td zd-pop-td"><text>{{ele.wlbm}}</text></view>
<view class="zd-col-5 zd-sec-td zd-pop-td"><text>{{ele.wlmc}}</text></view>
<view v-if="ele.status" class="zd-col-5 zd-sec-td zd-pop-td"><text>{{ele.kwbm}}</text></view>
<view v-else class="zd-col-5 zd-sec-td zd-pop-td">
<scan-input
v-model="ele.kwbm"
/>
</view>
<view v-if="ele.status" class="zd-col-4 zd-sec-td zd-pop-td"><text>{{ele.fpsl}}</text></view>
<view v-else class="zd-col-4 zd-sec-td zd-pop-td">
<input type="number" class="pop-input" v-model="ele.fpsl">
</view>
<view class="zd-col-4 zd-sec-td zd-pop-td"><text>{{ele.kcsl}}</text></view>
<view class="zd-col-4 zd-sec-td zd-pop-td"><text>{{ele.djbh}}</text></view>
<view class="zd-col-4 zd-sec-td zd-pop-td"><text>{{ele.flxh}}</text></view>
<view class="zd-col-4 zd-sec-td zd-pop-td"><text>{{ele.bz}}</text></view>
</view>
<view v-if="type === 2" class="zd-row zd-td-wraper" v-for="(ele, t) in popData" :key="ele.id">
<view class="zd-col-2 zd-sec-td zd-pop-td"><text>{{t+1}}</text></view>
<view class="zd-col-4 zd-sec-td zd-pop-td"><text>{{ele.wlbm}}</text></view>
<view class="zd-col-5 zd-sec-td zd-pop-td"><text>{{ele.wlmc}}</text></view>
<view class="zd-col-5 zd-sec-td zd-pop-td">
<scan-input
v-model="ele.kwbm"
/>
</view>
<view class="zd-col-4 zd-sec-td zd-pop-td">
<input type="number" class="pop-input" v-model="ele.fpsl">
</view>
<view class="zd-col-4 zd-sec-td zd-pop-td"><text>{{ele.kcsl}}</text></view>
<view class="zd-col-4 zd-sec-td zd-pop-td"><text>{{ele.djbh}}</text></view>
<view class="zd-col-4 zd-sec-td zd-pop-td"><text>{{ele.flxh}}</text></view>
<view class="zd-col-4 zd-sec-td zd-pop-td"><text>{{ele.bz}}</text></view>
</view>
</view>
<view v-if="type === 3" class="kwcode_wraper">
<view class="zd-row jcenter">
<view class="zd-col-3 pop_label">收货仓库</view>
<view class="zd-col-10 select_wraper">
<zxz-uni-data-select placeholder="请选择仓库名称" v-model="value2" filterable :localdata="range2"></zxz-uni-data-select>
</view>
</view>
</view>
<view class="mgb20 zd-row jcenter"> <view class="mgb20 zd-row jcenter">
<view class="zd-col-10 zd-row"> <view class="zd-col-10 zd-row">
<button class="confirm-button confirm-button_cancle mgl0" @tap="show = false">取消</button> <button class="confirm-button confirm-button_cancle mgl0" @tap="show = false">取消</button>
<button v-show="type === 0" class="confirm-button mgl0" @tap="modalConfirm">确定</button> <button v-if="type === 1" class="confirm-button mgl0" @tap="_receiptBillDetailSetStor">确定</button>
<button v-show="type === 1" class="confirm-button mgl0" :class="{'confirm-button_disabled': popData.length === 0}" :disabled="popdisabled" @tap="_updateAssignDtl">确定</button> <button v-if="type === 2" class="confirm-button mgl0" @tap="receiptBillUpdateConfirm">确定</button>
<button v-show="type === 2" class="confirm-button mgl0" :class="{'confirm-button_disabled': popData.length === 0}" :disabled="popdisabled" @tap="_stIvtaddAssignDtl">确定</button>
<button v-show="type === 3" class="confirm-button mgl0" @tap="_receiptBillDetailSetStor">确定</button>
</view> </view>
</view> </view>
</view> </view>
@@ -201,17 +148,13 @@
<script> <script>
import NavBar from '@/components/NavBar.vue' import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue' import SearchBox from '@/components/SearchBox.vue'
import ScanInput from '@/components/ScanInput.vue'
import Pagination from '@/components/Pagination.vue' import Pagination from '@/components/Pagination.vue'
import GridDetail from '@/components/GridDetail.vue' import GridDetail from '@/components/GridDetail.vue'
// import {getOrganizationInfo, getWarehouseInfo, receiptPage, receiptBillDetailPage, viewAssignDtl, warehouseAssignLocation} from '@/utils/mork2.js' import {getOrganizationInfo, getWarehouseInfo, receiptPage, receiptBillDetailPage, receiptBillDetailUpdate, receiptBillDetailSetStor, receiptBillConfirm} from '@/utils/mork2.js'
// import {updateAssignDtl, receiptBillDetailUpdate, receiptBillDetailSetStor, stIvtaddAssignDtl, receiptBillConfirm} from '@/utils/getData2.js'
import {getOrganizationInfo, getWarehouseInfo, receiptPage, receiptBillDetailPage, viewAssignDtl, warehouseAssignLocation, updateAssignDtl, receiptBillDetailUpdate, receiptBillDetailSetStor, stIvtaddAssignDtl, receiptBillConfirm} from '@/utils/getData2.js'
export default { export default {
components: { components: {
NavBar, NavBar,
SearchBox, SearchBox,
ScanInput,
Pagination, Pagination,
GridDetail GridDetail
}, },
@@ -227,9 +170,8 @@
}, },
currentPage1: 1, currentPage1: 1,
dataList: [], // 一级表格数据 dataList: [], // 一级表格数据
subCheckData: [], // 二级表格多选数组 val2: '',
popData: [], // 二级表格点击物料编码弹出弹窗 popData: [], // 表格点击物料编码弹出弹窗
popdisabled: false,
popObj: {}, // 弹窗当前主表格内容 popObj: {}, // 弹窗当前主表格内容
show: false, // 弹窗显示布尔值 show: false, // 弹窗显示布尔值
type: '', // 弹窗类型 type: '', // 弹窗类型
@@ -284,6 +226,7 @@
this.$set(el, 'checked', false) this.$set(el, 'checked', false)
this.$set(el, 'subData', []) this.$set(el, 'subData', [])
this.$set(el, 'subAllChecked', false) this.$set(el, 'subAllChecked', false)
this.$set(el, 'subOneChecked', false)
}) })
this.dataList = [...res.result] this.dataList = [...res.result]
this.totalCount1 = Number(res.totalElements) this.totalCount1 = Number(res.totalElements)
@@ -302,22 +245,21 @@
handlePageChange1(page) { handlePageChange1(page) {
this.queryParams1.pageNum = page this.queryParams1.pageNum = page
this.currentPage1 = page this.currentPage1 = page
this.subCheckData = []
this._receiptPage() this._receiptPage()
}, },
// 点击一级表格一行加载二级表格 // 点击一级表格一行加载表格
loadSubData (e) { loadSubData (e) {
this.subCheckData = this.subCheckData.filter(item1 => !e.subData.some(item2 => item2.id === item1.id))
if (e.subData.length > 0) { if (e.subData.length > 0) {
e.subData = [] e.subData = []
} else if (e.subData.length === 0) { } else if (e.subData.length === 0) {
this._receiptBillDetailPage(e) this._receiptBillDetailPage(e)
} }
e.subAllChecked = false e.subAllChecked = false
e.subOneChecked = false
}, },
// 二级表格接口 // 表格接口
async _receiptBillDetailPage (e) { async _receiptBillDetailPage (e) {
let res = await receiptBillDetailPage(this.val1, e.djid, '1', '200') let res = await receiptBillDetailPage(this.val2, e.djid, '1', '200')
if (res.code === 1) { if (res.code === 1) {
res.result.map(el => { res.result.map(el => {
this.$set(el, 'subChecked', false) this.$set(el, 'subChecked', false)
@@ -334,171 +276,51 @@
}) })
} }
}, },
// 二级表格全选 // 表格全选
toSubAllCheckbox (e) { toSubAllCheckbox (e) {
e.subAllChecked = !e.subAllChecked e.subAllChecked = !e.subAllChecked
e.subOneChecked = e.subAllChecked
e.subData.map(el => { e.subData.map(el => {
el.checked = e.subAllChecked el.checked = e.subAllChecked
}) })
if (e.subAllChecked) {
this.subCheckData = this.subCheckData.concat(e.subData)
for (let i = 0; i < this.subCheckData.length; i++) {
for (let j = i + 1; j < this.subCheckData.length; j++) {
if (this.subCheckData[i].id === this.subCheckData[j].id) {
this.subCheckData.splice(j, 1)
j--
}
}
}
} else if (!e.subAllChecked) {
this.subCheckData = this.subCheckData.filter(item1 => !e.subData.some(item2 => item2.id === item1.id))
}
}, },
// 二级表格多选 // 表格多选
toSubCheckbox (e,el) { toSubCheckbox (e,el) {
if (el.checked) { if (el.checked) {
this.$set(el, 'checked', false) this.$set(el, 'checked', false)
this.subCheckData = this.subCheckData.filter(item => item.id !== el.id)
} else if (!el.checked) { } else if (!el.checked) {
this.$set(el, 'checked', true) this.$set(el, 'checked', true)
this.subCheckData.push(el)
} }
let arr = e.subData.filter(ele => ele.checked === true) let arr = e.subData.filter(ele => ele.checked === true)
e.subAllChecked = arr.length === e.subData.length e.subAllChecked = arr.length === e.subData.length
e.subOneChecked = arr.length > 0
},
// 副表格查询
toSubSearch (e) {
e.subAllChecked = false
e.subOneChecked = false
this._receiptBillDetailPage(e)
},
// 修改副表格单行收货数量
updateNumkw (e) {
this._receiptBillDetailUpdate(e)
}, },
showPop (type, e, obj) { showPop (type, e, obj) {
this.popData = []
this.popObj = {}
this.value2 = ''
this.type = type this.type = type
if (type === 0) { // 修改二级表格单行收货仓库 if (type === 1) { // 点击一键设置仓库按钮
this.show = true if (!e.subOneChecked) return
this.popObj = {id: e.djid, iid: obj.id} this.popData = e.subData.filter(ele => ele.checked === true)
} else if (type === 1) { // 点击二级表格行中的物料编号显示弹窗
this._viewAssignDtl(e, obj)
} else if (type === 2) { // 点击库位分配按钮显示弹窗
if (!this.subCheckData.length) return
this._warehouseAssignLocation()
} else if (type === 3) { // 点击一键设置仓库按钮
if (!this.subCheckData.length) return
this.show = true
}
},
// 点击二级表格行中的物料编号,弹窗加载表格
async _viewAssignDtl (e, obj) {
let res = await viewAssignDtl(obj)
if (res.code ===1) {
this.popData = [...res.result]
this.sortArr(this.popData)
this.popObj = e this.popObj = e
this.show = true this.show = true
} else { } else if (type === 2) { // 修改副表格单行收货仓库弹窗
uni.showToast({
title: res.desc,
icon: 'none'
})
}
},
// 按单据编号排序,单据编号相同按照分录序号排序
sortArr (arr) {
arr.sort((a, b) => {
if (a.djbh !== b.djbh) {
return a.djbh < b.djbh ? -1 : 1
} else {
return a.flxh < b.flxh ? -1 : 1
}
})
},
// 点击二级表格行中的物料编号,弹窗加载表格 -> 点击确定按钮
async _updateAssignDtl () {
this.popdisabled = true
if (this.popData.length === 0) {
this.popdisabled = false
return
}
try {
let res = await updateAssignDtl(this.popData)
if (res.code === 1) {
this.show = false
this._receiptBillDetailPage(this.popObj)
}
uni.showToast({
title: res.desc,
icon: 'none'
})
this.popdisabled = false
} catch (e) {
this.popdisabled = false
}
},
// 分配库位弹窗表格
async _warehouseAssignLocation () {
let res = await warehouseAssignLocation(this.subCheckData)
if (res.code ===1) {
this.popData = [...res.result]
this.sortArr(this.popData)
this.show = true this.show = true
} else { this.popObj = {id: e.djid, iid: obj.id}
uni.showToast({
title: res.desc,
icon: 'none'
})
} }
}, },
// 修改二级表格单行收货数量 // 一键设置仓库弹窗->确定
updateNumkw (e) {
let arr = []
arr.push(e)
this._receiptBillDetailUpdate(arr)
},
// 修改调出仓库确定
modalConfirm () {
if (this.value2 === '') {
uni.showToast({
title: '请设置收货仓库',
icon: 'none'
})
return
}
let mc = ''
this.range2.map(el => {
if (el.value === this.value2) {
mc = el.text
}
})
let arr = []
this.dataList.map(e => {
if (e.djid === this.popObj.id) {
e.subData.map(el => {
if (el.id === this.popObj.iid) {
el.ckbm = this.value2
el.ckmc = mc
arr.push(el)
this.show = false
this._receiptBillDetailUpdate(arr)
}
})
}
})
},
// 二级表格单行收货数量和收货仓库接口
async _receiptBillDetailUpdate (e) {
try {
let res = await receiptBillDetailUpdate(e)
if (res.code === 1) {
uni.showToast({
title: res.desc,
icon: 'none'
})
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
}
this.value2 = ''
} catch (e) {
console.log(e)
}
},
// 一键设置仓库弹窗确定按钮
async _receiptBillDetailSetStor () { async _receiptBillDetailSetStor () {
if (this.value2 === '') { if (this.value2 === '') {
uni.showToast({ uni.showToast({
@@ -509,7 +331,10 @@
} }
this.show = false this.show = false
try { try {
let res = await receiptBillDetailSetStor(this.value2, this.subCheckData) let res = await receiptBillDetailSetStor(this.value2, this.popData)
if (res.code === '1') {
this._receiptBillDetailPage(this.popObj)
}
uni.showToast({ uni.showToast({
title: res.desc, title: res.desc,
icon: 'none' icon: 'none'
@@ -518,51 +343,67 @@
console.log(e) console.log(e)
} }
}, },
// 分配库位弹窗表格 -> 点击确定按钮 // 修改副表格单行收货仓库弹窗->确定
async _stIvtaddAssignDtl () { receiptBillUpdateConfirm () {
this.popdisabled = true if (this.value2 === '') {
if (this.popData.length === 0) { uni.showToast({
this.popdisabled = false title: '请设置收货仓库',
icon: 'none'
})
return return
} }
try { let text = ''
let res = await stIvtaddAssignDtl(this.popData) this.range2.map(el => {
if (res.code === 1) { if (el.value === this.value2) {
this.show = false text = el.text
this.checkData = [] }
this.subCheckData = []
this._receiptPage()
}
uni.showToast({
title: res.desc,
icon: 'none'
}) })
this.popdisabled = false this.dataList.map(e => {
} catch (e) { if (e.djid === this.popObj.id) {
this.popdisabled = false e.subData.map(el => {
} if (el.id === this.popObj.iid) {
el.ckbm = this.value2
el.ckmc = text
}
})
this.show = false
this._receiptBillDetailUpdate(e)
}
})
},
// 副表格单行收货数量和收货仓库接口
async _receiptBillDetailUpdate (e) {
try {
let res = await receiptBillDetailUpdate(e.subData)
if (res.code === 1) {
this._receiptBillDetailPage(e)
}
uni.showToast({
title: res.desc,
icon: 'none'
})
} catch (e) {
console.log(e)
}
}, },
// 点击收货确认按钮 // 点击收货确认按钮
async _receiptBillConfirm () { async _receiptBillConfirm (e) {
this.disabled1 = true this.disabled1 = true
if (!this.subCheckData.length) { if (!e.subOneChecked) {
this.disabled1 = false this.disabled1 = false
return return
} }
try { try {
let res = await receiptBillConfirm(this.subCheckData) let arr = e.subData.filter(ele => ele.checked === true)
let res = await receiptBillConfirm(arr)
if (res.code === 1) { if (res.code === 1) {
this.disabled1 = false this._receiptBillDetailPage(e)
this.checkData = []
this.subCheckData = []
this._receiptPage()
} else {
this.disabled1 = false
uni.showToast({
title: res.desc,
icon: 'none'
})
} }
this.disabled1 = false
uni.showToast({
title: res.desc,
icon: 'none'
})
} catch (e) { } catch (e) {
this.disabled1 = false this.disabled1 = false
} }

View File

@@ -2320,3 +2320,10 @@ export const moveDtlByMoveId = () => {
} }
return res return res
} }
export const receiptBillDetailUpdate = () => {
let res = {
code: '1',
desc: 'ok'
}
return res
}