Files
pad-nl-three-uni/pages/management/receive-confirm.vue

520 lines
16 KiB
Vue
Raw Normal View History

<template>
<view class="content">
<nav-bar title="收货确认"></nav-bar>
<view class="search-confirm-wrap">
2024-06-05 18:44:15 +08:00
<view class="zd-row">
2024-06-06 18:26:25 +08:00
<view class="zd-col-24 zd-row jcflexstart">
<view class="zd-col-7"><search-box v-model="val1" /></view>
<view class="zd-col-8 select_wraper mgl10">
2024-06-07 17:43:55 +08:00
<zxz-uni-data-select placeholder="请选择收货组织信息" v-model="value1" filterable :localdata="range1"></zxz-uni-data-select>
2024-06-05 18:44:15 +08:00
</view>
</view>
2024-06-06 18:26:25 +08:00
<button class="confirm-button" @tap="toSearch">查询</button>
</view>
</view>
2024-05-29 09:40:53 +08:00
<view class="zd-row jcflexstart table-title_wraper">收货确认</view>
<view class="grid-wrap">
2024-05-29 09:40:53 +08:00
<view class="zdrow-wrap">
<view class="zd-row sticky zd-th-wraper">
<view class="zd-col-1 zd-th"><text>序号</text></view>
2024-05-30 16:34:29 +08:00
<view class="zd-col-3 zd-th"><text class="fontcol1">送货单号</text></view>
2024-05-29 09:40:53 +08:00
<view class="zd-col-2 zd-th"><text>送货日期</text></view>
<view class="zd-col-2 zd-th"><text>提交时间</text></view>
<view class="zd-col-2 zd-th"><text>采购公司</text></view>
<view class="zd-col-2 zd-th"><text>所属厂区</text></view>
<view class="zd-col-2 zd-th"><text>供应商编码</text></view>
<view class="zd-col-2 zd-th"><text>供应商</text></view>
<view class="zd-col-2 zd-th"><text>到货日期</text></view>
2024-06-07 10:59:47 +08:00
<view class="zd-col-4 zd-th"><text>审核结果</text></view>
<view class="zd-col-2 zd-th">更多</view>
</view>
<view class="zd-td-wraper" v-for="(e, i) in dataList1" :key="e.id">
2024-05-29 09:40:53 +08:00
<view class="zd-row" :class="{'zd-td-checked': pkId === e.id}" @tap="toCollapse(e)">
<view class="zd-col-1 zd-td"><text>{{i+1}}</text></view>
<view class="zd-col-3 zd-td fontcol1"><text>{{e.djbh}}</text></view>
<view class="zd-col-2 zd-td"><text>{{e.ywrq}}</text></view>
<view class="zd-col-2 zd-td"><text>{{e.tjsj}}</text></view>
<view class="zd-col-2 zd-td"><text>{{e.cggs}}</text></view>
<view class="zd-col-2 zd-td"><text>{{e.sscq}}</text></view>
<view class="zd-col-2 zd-td"><text>{{e.gysbm}}</text></view>
<view class="zd-col-2 zd-td"><text>{{e.gys}}</text></view>
<view class="zd-col-2 zd-td"><text>{{e.dhrq}}</text></view>
2024-06-07 10:59:47 +08:00
<view class="zd-col-4 zd-td"><text>{{e.shjg}}</text></view>
2024-05-29 09:40:53 +08:00
<view class="zd-col-2 zd-td" @tap.stop="getDetails(4,e)">
<uni-icons type="more-filled" size="14" color="#fff"></uni-icons>
</view>
</view>
<!-- 二级表格start -->
2024-07-15 15:41:12 +08:00
<view v-if="pkId === e.djid" class="zd-sec-wraper">
<view class="search-confirm-wrap_2">
<view class="zd-row">
<view class="zd-col-24 zd-row jcflexstart">
<view class="zd-col-7"><search-box v-model="val2" :scanShow="false" /></view>
</view>
<button class="confirm-button" @tap="toSearch2">查询</button>
2024-07-15 17:59:57 +08:00
<button v-if="pkObj.djzt !== '审核后'" class="confirm-button" @tap="checkWarehouse(2, '批量设置收货仓库/库位')">一键设置</button>
2024-07-15 15:41:12 +08:00
<button v-if="pkObj.djzt !== '审核后'" class="confirm-button" :class="{'confirm-button_disabled': checkArr.length === 0}" :disabled="disabled" @tap="_receiptBillConfirm">确认收货</button>
</view>
</view>
<view class="table-wrap table-wrap_1">
2024-05-29 09:40:53 +08:00
<table class="grid-table">
<thead>
<tr>
<th>序号</th>
2024-07-15 15:41:12 +08:00
<th v-if="pkObj.djzt !== '审核后'">
<view class="zd-row jcenter">
<view class="zd-checkbox" :class="{'zd-checkbox_active': checkArrActive}" @tap="selectAll"></view>
</view>
</th>
2024-05-29 09:40:53 +08:00
<th><text class="fontcol1">采购订单号</text></th>
<th>物料编码</th>
<th>物料名称</th>
<th>单位</th>
<th>订单量</th>
2024-07-15 17:59:57 +08:00
<th>总数</th>
2024-05-29 09:40:53 +08:00
<th>本次送货数量</th>
<th>收货组织</th>
<th>件数</th>
2024-07-15 17:59:57 +08:00
<th>是否质检</th>
2024-05-29 09:40:53 +08:00
<th>收货数量</th>
2024-05-31 11:21:00 +08:00
<th>收货仓库编码</th>
<th>收货仓库名称</th>
<th>收货库位名称</th>
2024-05-29 09:40:53 +08:00
<th>更多</th>
</tr>
</thead>
<tbody v-if="pkObj.djzt !== '审核后'">
<tr v-for="(el, j) in dataList2" :key="el.id">
<td>{{j+1}}</td>
2024-05-31 17:34:16 +08:00
<td @tap="toCheck2(el)">
<view class="zd-row jcenter">
<view class="zd-checkbox" :class="{'zd-checkbox_active': el.checked}"></view>
</view>
</td>
2024-05-30 16:34:29 +08:00
<td><view class="fontcol1">{{el.cgbh}}</view></td>
2024-05-29 09:40:53 +08:00
<td>{{el.wlbm}}</td>
<td>{{el.wlmc}}</td>
<td>{{el.jldw}}</td>
<td>{{el.ddsl}}</td>
2024-07-15 17:59:57 +08:00
<td>{{el.wlzs}}</td>
2024-05-29 09:40:53 +08:00
<td>{{el.bcshsl}}</td>
<td>{{el.zzmc}}</td>
<td>{{el.num}}</td>
2024-07-15 17:59:57 +08:00
<td>{{['否', '是'][Number(el.sfzj)]}}</td>
2024-07-23 08:51:43 +08:00
<td><input class="td_input" type="number" v-model="el.shsl" @blur="updateNumkw(el)" /></td>
2024-07-15 17:59:57 +08:00
<td @tap.stop="checkWarehouse(1, '修改收货仓库', el)">
2024-05-30 16:34:29 +08:00
<view class="zd-row td_change">
<uni-icons type="shop" size="16" color="#fff"></uni-icons>
<view class="mgl10">{{el.ckbm}}</view>
</view>
</td>
2024-05-31 11:21:00 +08:00
<td>{{el.ckmc}}</td>
2024-05-29 09:40:53 +08:00
<td>
<view class="td_scan_wraper">
2024-07-23 08:51:43 +08:00
<scan-input v-model="el.kwmc" @handleChange="updateNumkw(el)" />
2024-05-29 09:40:53 +08:00
</view>
</td>
<td @tap.stop="getDetails(4,el)"><uni-icons type="more-filled" size="14" color="#fff"></uni-icons></td>
</tr>
</tbody>
<tbody v-else>
<tr v-for="(el, j) in dataList2" :key="el.id">
<td>{{j+1}}</td>
<td>{{el.cgbh}}</td>
<td>{{el.wlbm}}</td>
<td>{{el.wlmc}}</td>
<td>{{el.jldw}}</td>
<td>{{el.ddsl}}</td>
2024-07-15 17:59:57 +08:00
<td>{{el.wlzs}}</td>
2024-05-29 09:40:53 +08:00
<td>{{el.bcshsl}}</td>
<td>{{el.zzmc}}</td>
<td>{{el.num}}</td>
2024-07-15 17:59:57 +08:00
<td>{{['否', '是'][Number(el.sfzj)]}}</td>
2024-05-29 09:40:53 +08:00
<td>{{el.shsl}}</td>
2024-05-31 11:21:00 +08:00
<td>{{el.ckbm}}</td>
<td>{{el.ckmc}}</td>
<td>{{el.kwmc}}</td>
2024-05-29 09:40:53 +08:00
<td @tap.stop="getDetails(4,el)"><uni-icons type="more-filled" size="14" color="#fff"></uni-icons></td>
</tr>
</tbody>
</table>
</view>
</view>
<!-- 二级表格end -->
</view>
</view>
2024-05-29 09:40:53 +08:00
<view class="zd-row jcenter pd20">
<pagination v-show="dataList1.length > 0" :total="totalCount1" :page-size="queryParams1.pageSize" :current-page="currentPage1" @page-change="handlePageChange1" />
</view>
</view>
<view class="footer"></view>
2024-05-29 09:40:53 +08:00
<grid-detail :show="delShow" :data="detailObj" @closeDetail="delShow=false"></grid-detail>
<view class="pop-wraper" :class="{'popshow': show, 'pophide': !show}">
2024-07-15 17:59:57 +08:00
<view class="allwidth pop-title">{{modalObj.title}}</view>
<view v-if="modalObj.type === 1" class="zd-row jcenter kwcode_wraper">
<view class="zd-col-10 select_wraper">
2024-05-29 09:40:53 +08:00
<zxz-uni-data-select placeholder="请选择仓库名称" v-model="value" filterable :localdata="range"></zxz-uni-data-select>
</view>
</view>
2024-07-15 17:59:57 +08:00
<view v-if="modalObj.type === 2" 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="value" filterable :localdata="range"></zxz-uni-data-select>
</view>
</view>
<view class="zd-row jcenter mgt20">
<view class="zd-col-3 pop_label">收货库位</view>
<view class="zd-col-10 select_wraper">
<scan-input v-model="val3" />
</view>
</view>
</view>
<view class="mgb20 zd-row jcenter">
2024-05-29 09:40:53 +08:00
<view class="zd-col-10 zd-row">
<button class="confirm-button confirm-button_cancle mgl0" @tap="show = false">取消</button>
<button class="confirm-button mgl0" @tap="modalConfirm">确定</button>
</view>
</view>
</view>
<view v-if="show" class="modal" @click.stop="show = false"></view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import ScanInput from '@/components/ScanInput.vue'
import Pagination from '@/components/Pagination.vue'
import GridDetail from '@/components/GridDetail.vue'
2024-06-06 18:26:25 +08:00
import {getWarehouseInfo, getOrganizationInfo, receiptPage, receiptBillPage, receiptBillUpdate, receiptBillConfirm} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox,
ScanInput,
Pagination,
GridDetail
},
data() {
return {
val1: '',
dataList1: [],
totalCount1: 0,
queryParams1:{
pageSize: 10,
pageNum: 1
},
currentPage1: 1,
2024-05-29 09:40:53 +08:00
pkId: '',
pkObj: {},
dataList2: [],
totalCount2: 0,
queryParams2:{
2024-05-30 16:34:29 +08:00
pageSize: 200,
pageNum: 1
},
currentPage2: 1,
2024-05-29 09:40:53 +08:00
checkArr: [],
checkArrActive: false,
delShow: false,
detailObj: {},
value: '',
2024-05-29 09:40:53 +08:00
range: [],
show: false,
modalObj: {},
2024-06-05 18:44:15 +08:00
disabled: false,
value1: '',
2024-07-15 15:41:12 +08:00
range1: [],
2024-07-15 17:59:57 +08:00
val2: '',
val3: ''
};
},
2024-07-09 10:57:24 +08:00
onLoad () {
2024-05-29 09:40:53 +08:00
this._getWarehouseInfo()
2024-06-06 18:26:25 +08:00
this._getOrganizationInfo()
},
methods: {
2024-05-29 09:40:53 +08:00
// 仓库下拉框
async _getWarehouseInfo () {
let res = await getWarehouseInfo()
if (res.code === 1) {
this.range = [...res.result]
this.range.map(e => {
this.$set(e, 'text', e.ckmc)
this.$set(e, 'value', e.ckbm)
})
2024-06-06 18:26:25 +08:00
this.toSearch()
}
},
// 组织信息下拉框
async _getOrganizationInfo () {
let res = await getOrganizationInfo()
if (res.code === 1) {
this.range1 = [...res.result]
this.range1.map(e => {
this.$set(e, 'text', e.kczzmc)
this.$set(e, 'value', e.kczzbm)
})
2024-05-29 09:40:53 +08:00
this.toSearch()
}
},
// 查询一级表格
toSearch () {
this.queryParams1 = {
pageSize: 10,
pageNum: 1
}
this.currentPage1 = 1
this.dataList2 = []
this.pkId = ''
2024-05-29 09:40:53 +08:00
this._receiptPage()
},
// 一级表格接口
2024-05-29 09:40:53 +08:00
async _receiptPage () {
2024-06-05 18:44:15 +08:00
let res = await receiptPage(this.val1, this.value1, this.queryParams1.pageNum + '', this.queryParams1.pageSize + '')
if (res.code === 1) {
this.dataList1 = [...res.result]
this.totalCount1 = Number(res.totalElements)
this.queryParams1.pageSize = Number(res.pageSize)
this.queryParams1.pageNum = Number(res.pageNum)
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
}
},
// 二级表格接口
2024-05-29 09:40:53 +08:00
async _receiptBillPage () {
2024-07-15 15:41:12 +08:00
let res = await receiptBillPage(this.val2, this.pkObj.djid, this.queryParams2.pageNum + '', this.queryParams2.pageSize + '')
if (res.code === 1) {
res.result.map(el => {
2024-05-29 09:40:53 +08:00
this.$set(el, 'checked', true)
})
this.dataList2 = [...res.result]
2024-05-29 09:40:53 +08:00
this.checkArr = [...this.dataList2]
this.checkArrActive = true
this.totalCount2 = Number(res.totalElements)
this.queryParams2.pageSize = Number(res.pageSize)
this.queryParams2.pageNum = Number(res.pageNum)
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
}
},
// 一级表格切换分页
handlePageChange1(page) {
this.queryParams1.pageNum = page
this.currentPage1 = page
this.dataList2 = []
this.pkId = ''
2024-05-29 09:40:53 +08:00
this._receiptPage()
},
// 二级表格切换分页
handlePageChange2(page) {
this.queryParams2.pageNum = page
this.currentPage2 = page
2024-05-29 09:40:53 +08:00
this._receiptBillPage()
},
// 点击一级表格一行加载二级表格
toCollapse (e) {
this.pkId = this.pkId === e.djid ? '' : e.djid
this.pkObj = this.pkId === e.djid ? e : {}
2024-07-15 15:41:12 +08:00
this.val2 = ''
this.dataList2 = []
if (this.pkId === e.djid) {
this.queryParams2 = {
2024-05-30 16:34:29 +08:00
pageSize: 200,
pageNum: 1
}
this.currentPage2 = 1
2024-05-29 09:40:53 +08:00
this._receiptBillPage()
}
},
2024-07-15 15:41:12 +08:00
// 二级表格查询
toSearch2 () {
this.queryParams2 = {
pageSize: 200,
pageNum: 1
}
this.currentPage2 = 1
this._receiptBillPage()
},
// 二级表格多选
toCheck2 (e) {
e.checked = !e.checked
2024-05-29 09:40:53 +08:00
this.checkArr = this.dataList2.filter(el => el.checked === true)
if (this.checkArr.length === this.dataList2.length) {
this.checkArrActive = true
}
},
// 二级表格全选
selectAll () {
this.checkArrActive = !this.checkArrActive
this.dataList2.map(el => {
el.checked = this.checkArrActive
})
2024-05-29 09:40:53 +08:00
this.checkArr = this.dataList2.filter(el => el.checked === true)
},
2024-05-29 09:40:53 +08:00
// 二级表格详情修改接口
async _receiptBillUpdate (e) {
try {
let res = await receiptBillUpdate(e)
2024-07-22 14:51:19 +08:00
if (res.code === 1) {
uni.showToast({
2024-05-29 09:40:53 +08:00
title: res.desc,
icon: 'none'
})
}
2024-05-29 09:40:53 +08:00
} catch (e) {
console.log(e)
}
},
2024-07-23 08:51:43 +08:00
// 收货数量和收货库位名称单行修改
updateNumkw (e) {
let arr = []
let {flid, flxh, ywrq, shsl, zzbm, ckmc, ckbm, kwbm, kwmc, bz, btbz, djid, djbh} = {...e}
let obj = {flid, flxh, ywrq, shsl, zzbm, ckmc, ckbm, kwbm, kwmc, bz, btbz, djid, djbh}
arr.push(obj)
this._receiptBillUpdate(arr)
},
2024-05-29 09:40:53 +08:00
// 修改调出仓库弹窗
checkWarehouse (type, title, e) {
if (type === 1) {
2024-07-15 17:59:57 +08:00
this.modalObj = {type: type, title: title, id: e.flid}
2024-05-30 16:34:29 +08:00
this.value = e.ckbm
2024-07-15 17:59:57 +08:00
} else if (type === 2) {
this.modalObj = {type: type, title: title}
}
2024-05-29 09:40:53 +08:00
this.show = true
},
2024-05-29 09:40:53 +08:00
// 修改调出仓库确定
modalConfirm () {
2024-07-22 14:51:19 +08:00
if ((this.modalObj.type === 1 || this.modalObj.type === 2) && this.value === '') {
uni.showToast({
title: '请设置收货仓库',
icon: 'none'
})
return
}
if (this.modalObj.type === 2 && this.val3 === '') {
uni.showToast({
title: '请设置收货库位',
icon: 'none'
})
return
}
2024-05-30 16:34:29 +08:00
let mc = ''
this.range.map(el => {
if (el.value === this.value) {
mc = el.text
}
})
2024-07-19 18:01:28 +08:00
let arr = []
2024-05-29 09:40:53 +08:00
if (this.modalObj.type === 1) {
this.dataList2.map(e => {
if (e.flid === this.modalObj.id) {
2024-05-30 16:34:29 +08:00
e.ckbm = this.value
e.ckmc = mc
2024-07-22 14:51:19 +08:00
let {flid, flxh, ywrq, shsl, zzbm, ckmc, ckbm, kwbm, kwmc, bz, btbz, djid, djbh} = {...e}
let obj = {flid, flxh, ywrq, shsl, zzbm, ckmc, ckbm, kwbm, kwmc, bz, btbz, djid, djbh}
2024-07-19 18:01:28 +08:00
arr.push(obj)
2024-05-29 09:40:53 +08:00
}
})
2024-07-15 17:59:57 +08:00
} else if (this.modalObj.type === 2) {
this.dataList2.map(e => {
e.ckbm = this.value
e.ckmc = mc
e.kwmc = this.val3
2024-07-22 14:51:19 +08:00
let {flid, flxh, ywrq, shsl, zzbm, ckmc, ckbm, kwbm, kwmc, bz, btbz, djid, djbh} = {...e}
let obj = {flid, flxh, ywrq, shsl, zzbm, ckmc, ckbm, kwbm, kwmc, bz, btbz, djid, djbh}
2024-07-19 18:01:28 +08:00
arr.push(obj)
2024-07-15 17:59:57 +08:00
})
}
2024-05-29 09:40:53 +08:00
this.show = false
2024-07-19 18:01:28 +08:00
this._receiptBillUpdate(arr)
},
2024-05-30 16:34:29 +08:00
// 点击确认收货按钮
2024-05-29 09:40:53 +08:00
async _receiptBillConfirm () {
this.disabled = true
if (!this.checkArr.length) {
this.disabled = false
return
}
2024-05-29 09:40:53 +08:00
try {
2024-05-30 16:34:29 +08:00
let arr = []
this.checkArr.map(el => {
2024-05-31 13:41:28 +08:00
let {djid, djbh, ywrq, shsl, zzbm, ckbm, kwmc, flid, flxh, bz, btbz} = {...el}
let obj = {djid, djbh, ywrq, shsl, zzbm, ckbm, kwmc, flid, flxh, bz, btbz}
2024-05-30 16:34:29 +08:00
arr.push(obj)
})
2024-05-30 16:47:26 +08:00
let res = await receiptBillConfirm(arr)
2024-05-29 09:40:53 +08:00
if (res.code === 1) {
this.queryParams2 = {
2024-05-30 16:34:29 +08:00
pageSize: 200,
2024-05-29 09:40:53 +08:00
pageNum: 1
}
this.currentPage2 = 1
this._receiptBillPage()
uni.showToast({
title: res.desc,
icon: 'none'
})
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
}
2024-05-29 09:40:53 +08:00
this.disabled = false
} catch (e) {
this.disabled = false
}
},
// 详情弹窗
getDetails (type,e) {
this.delShow = !this.delShow
this.detailObj = {type: type, data:e}
}
}
}
</script>
<style lang="stylus" scoped>
@import '../../common/style/mixin.styl';
.mgr30
margin-right 30rpx
.select_wraper
2024-06-07 10:08:09 +08:00
/deep/ .uni-select__input-box
height 30px
/deep/ .uni-select__selector
z-index 11
/deep/ .uni-select
height: 30px;
2024-06-07 10:08:09 +08:00
min-height: 30px;
line-height: 30px;
padding: 0 2px 0 12px;
border: 1px solid #4980bd;
background-color: rgba(45,88,184,0.1);
border-radius: 6px;
/deep/ .uni-select__input-placeholder, /deep/ .uni-select__input-text
font-size 13px
color #fff
/deep/ .uni-select__selector
background-color #071F3E
border-color #0c3162
/deep/ .uni-popper__arrow
border-bottom-color #0c3162
&:after
border-bottom-color #071F3E
/deep/ .uni-select__selector-item
color #fff
2024-05-29 09:40:53 +08:00
.zd-th
font-size: 12px;
line-height: 13px;
height: 36px;
</style>