调拨维护添加需求

This commit is contained in:
蔡玲
2024-12-10 14:07:55 +08:00
parent ae118f3793
commit 33d8dff0b8
2 changed files with 123 additions and 10 deletions

View File

@@ -55,6 +55,8 @@
<view v-if="e.subData.length > 0" class="zd-sec-wraper">
<view class="search-confirm-wrap_2">
<view class="zd-row jcflexend">
<button class="confirm-button" :class="{'confirm-button_disabled': !e.subOneChecked}" @tap="showPop(3, e)">库位分配</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !e.subOneChecked}" @tap="inWarehouseSure(e)">库存提交</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !e.subOneChecked}" :disabled="disabled1" @tap="_allocationBillConfirm(e)">直接调拨</button>
</view>
</view>
@@ -128,22 +130,57 @@
</view>
<view class="footer"></view>
<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, 'pop-wraper_1': type === 3}">
<view v-if="type === 1" class="allwidth pop-title">修改调出仓库</view>
<view v-if="type === 2" class="allwidth pop-title">修改调入仓库</view>
<view class="zd-row jcenter kwcode_wraper">
<view v-if="type === 3" class="allwidth pop-title">分配明细</view>
<view v-if="type === 1 || type === 2" class="zd-row jcenter kwcode_wraper">
<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 v-if="type === 3" 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-4 zd-sec-th"><text>物料名称</text></view>
<view class="zd-col-9 zd-sec-th"><text>库位编码</text></view>
<view class="zd-col-3 zd-sec-th"><text>数量</text></view>
<view class="zd-col-3 zd-sec-th"><text>库存数量</text></view>
<view class="zd-col-4 zd-sec-th"><text>单据编号</text></view>
<view class="zd-col-3 zd-sec-th"><text>分录序号</text></view>
<view class="zd-col-4 zd-sec-th"><text>备注</text></view>
</view>
<view 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-4 zd-sec-td zd-pop-td"><text>{{ele.wlmc}}</text></view>
<view class="zd-col-9 zd-sec-td zd-pop-td">
<scan-input
v-model="ele.kwbm"
/>
</view>
<view class="zd-col-3 zd-sec-td zd-pop-td">
<input type="number" class="pop-input" v-model="ele.fpsl">
</view>
<view class="zd-col-3 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-3 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 class="mgb20 zd-row jcenter">
<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="SetStorConfirm">确定</button>
<button v-if="type === 1 || type === 2" class="confirm-button mgl0" @tap="SetStorConfirm">确定</button>
<button v-show="type === 3" class="confirm-button mgl0" :class="{'confirm-button_disabled': popData.length === 0}" :disabled="popdisabled" @tap="_addAssignDtl">确定</button>
</view>
</view>
</view>
<view v-if="show" class="modal" @click.stop="show = false"></view>
<uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog type="info" cancelText="关闭" confirmText="确定" title="提示" content="是否提交库存?" @confirm="_inWarehouseCommit" @close="dialogClose"></uni-popup-dialog>
</uni-popup>
</view>
</template>
@@ -153,7 +190,7 @@
import ScanInput from '@/components/ScanInput.vue'
import Pagination from '@/components/Pagination.vue'
import GridDetail from '@/components/GridDetail.vue'
import {getWarehouseInfo, getOrganizationInfo, allocationPage, allocationBillDetail, allocationBillConfirm, allocationBillDetailUpdate, easOutInBillSync} from '@/utils/getData2.js'
import {getWarehouseInfo, getOrganizationInfo, allocationPage, allocationBillDetail, allocationBillConfirm, allocationBillDetailUpdate, easOutInBillSync, inWarehouseAssignLocation, addAssignDtl, inWarehouseCommit} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -176,6 +213,7 @@
currentPage1: 1,
dataList: [], // 一级表格数据
popData: [], // 副表格点击物料编码弹出弹窗
popdisabled: false,
popObj: {}, // 弹窗当前主表格内容
show: false, // 弹窗显示布尔值
type: '', // 弹窗类型
@@ -185,7 +223,8 @@
range: [],
disabled1: false,
raw: '', // 副表格修改前输入框数据
rawObj: {} // 副表格修改前行数据
rawObj: {} ,// 副表格修改前行数据
subCheckData: [] // 二级表格多选数组
}
},
onLoad () {
@@ -373,7 +412,10 @@
this.show = true
this.popObj = e
this.rawObj = obj
}
} else if (type === 3 && e.subOneChecked) { // 库位分配
this.popObj = e
this._inWarehouseAssignLocation(e)
}
},
// 副表格修改仓库弹窗->确定
SetStorConfirm () {
@@ -421,7 +463,78 @@
} catch (e) {
this.disabled1 = false
}
}
},
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 _inWarehouseAssignLocation (e) {
let arr = e.subData.filter(ele => ele.checked === true)
let res = await inWarehouseAssignLocation(arr, 'ALLO')
if (res.code ===1) {
this.popData = [...res.result]
this.sortArr(this.popData)
this.show = true
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
}
},
// 分配库位弹窗表格 -> 点击确定按钮
async _addAssignDtl () {
this.popdisabled = true
if (this.popData.length === 0) {
this.popdisabled = false
return
}
try {
let res = await addAssignDtl(this.popData, 'ALLO')
if (res.code === 1) {
this.show = false
this._allocationPage(this.popObj)
}
uni.showToast({
title: res.desc,
icon: 'none'
})
this.popdisabled = false
} catch (e) {
this.popdisabled = false
}
},
// 库存提交
inWarehouseSure (e) {
if (e.subOneChecked) {
this.$refs.alertDialog.open()
this.popObj = e
let arr = e.subData.filter(ele => ele.checked === true)
this.subCheckData = [...arr]
}
},
// 库存提交-确认接口
async _inWarehouseCommit () {
try {
let res = await inWarehouseCommit(this.subCheckData, 'ALLO')
if (res.code === 1) {
this._allocationPage(this.popObj)
}
uni.showToast({
title: res.desc,
icon: 'none'
})
} catch (e) {
console.log(e)
}
},
}
}
</script>

View File

@@ -505,8 +505,8 @@
}
this.$refs.alertDialog.open()
},
// 库存提交-确认接口
async _inWarehouseCommit () {
// 库存提交-确认接口
async _inWarehouseCommit () {
try {
let res = await inWarehouseCommit(this.subCheckData, this.crType)
if (res.code === 1) {
@@ -531,7 +531,7 @@
} catch (e) {
this.popdisabled = false
}
},
},
// 点击单据审核按钮
async _easOutInBillUpdate () {
this.disabled1 = true