634 lines
21 KiB
Vue
634 lines
21 KiB
Vue
<template>
|
|
<view class="content">
|
|
<nav-bar title="调拨维护"></nav-bar>
|
|
<view class="search-confirm-wrap">
|
|
<view class="zd-row">
|
|
<view class="zd-col-15 zd-row jcflexstart">
|
|
<view class="zd-col-10"><search-box placeholder="输入查询条件" v-model="val1" /></view>
|
|
<view class="zd-col-7 select_wraper mgl10">
|
|
<zxz-uni-data-select placeholder="选择调出组织信息" v-model="value2" filterable :localdata="range1"></zxz-uni-data-select>
|
|
</view>
|
|
<view class="zd-col-7 select_wraper mgl10">
|
|
<zxz-uni-data-select placeholder="选择调入组织信息" v-model="value1" filterable :localdata="range1"></zxz-uni-data-select>
|
|
</view>
|
|
</view>
|
|
<view class="zd-col-9 zd-row jcflexend">
|
|
<button class="confirm-button" @tap="toSearch">查询</button>
|
|
<button class="confirm-button" :disabled="disabled1" @tap="_easOutInBillSync">同步</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="grid-wrap">
|
|
<view class="zdrow-wrap">
|
|
<view class="zd-row sticky zd-th-wraper">
|
|
<view class="zd-col-1 zd-th"><text>序号</text></view>
|
|
<view class="zd-col-4 zd-th"><text class="fontcol1">调拨单号</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>调出库存<br>组织编码</text></view>
|
|
<view class="zd-col-2 zd-th"><text>调出库存<br>组织名称</text></view>
|
|
<view class="zd-col-2 zd-th"><text>调入库存<br>组织编码</text></view>
|
|
<view class="zd-col-2 zd-th"><text>调入库存<br>组织名称</text></view>
|
|
<view class="zd-col-2 zd-th"><text>创建人</text></view>
|
|
<view class="zd-col-2 zd-th"><text>计划调<br>出日期</text></view>
|
|
<view class="zd-col-2 zd-th"><text>计划调<br>入日期</text></view>
|
|
<view class="zd-col-1 zd-th">更多</view>
|
|
</view>
|
|
<view class="zd-td-wraper" v-for="(e, i) in dataList" :key="e.id">
|
|
<view class="zd-row" @tap="loadSubData(e)">
|
|
<view class="zd-col-1 zd-td"><text>{{i+1}}</text></view>
|
|
<view class="zd-col-4 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.cjsj}}</text></view>
|
|
<view class="zd-col-2 zd-td"><text>{{e.dckcbm}}</text></view>
|
|
<view class="zd-col-2 zd-td"><text>{{e.dckcmc}}</text></view>
|
|
<view class="zd-col-2 zd-td"><text>{{e.drkcbm}}</text></view>
|
|
<view class="zd-col-2 zd-td"><text>{{e.drkcmc}}</text></view>
|
|
<view class="zd-col-2 zd-td"><text>{{e.cjr}}</text></view>
|
|
<view class="zd-col-2 zd-td"><text>{{e.jhdrrq}}</text></view>
|
|
<view class="zd-col-2 zd-td"><text>{{e.jhdcrq}}</text></view>
|
|
<view class="zd-col-1 zd-td" @tap.stop="getDetails(3,e)">
|
|
<uni-icons type="more-filled" size="14" color="#fff"></uni-icons>
|
|
</view>
|
|
</view>
|
|
<!-- 二级表格start -->
|
|
<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>
|
|
<view class="table-wrap">
|
|
<table class="grid-table">
|
|
<thead>
|
|
<tr>
|
|
<th>序号</th>
|
|
<th>
|
|
<view class="zd-row jcenter">
|
|
<view class="zd-checkbox zd-checkbox_i" :class="{'zd-checkbox_active': e.subAllChecked}" @tap="toSubAllCheckbox(e)"></view>
|
|
</view>
|
|
</th>
|
|
<th>物料编码</th>
|
|
<th>物料名称</th>
|
|
<th>跟踪号</th>
|
|
<th>单位</th>
|
|
<th>库存类型</th>
|
|
<th>库存状态</th>
|
|
<th>数量</th>
|
|
<th>调出仓库编码</th>
|
|
<th>调出仓库名称</th>
|
|
<th>调入仓库编码</th>
|
|
<th>调入仓库名称</th>
|
|
<th>更多</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr v-for="(el, j) in e.subData" :key="el.id">
|
|
<td>{{j+1}}</td>
|
|
<td @tap="toSubCheckbox(e, el)">
|
|
<view class="zd-row jcenter">
|
|
<view class="zd-checkbox zd-checkbox_i" :class="{'zd-checkbox_active': el.checked}"></view>
|
|
</view>
|
|
</td>
|
|
<td class="underline fontcol1" @tap="showPop(4, e, el)">{{el.wlbm}}</td>
|
|
<td>{{el.wlmc}}</td>
|
|
<td>{{el.gzh}}</td>
|
|
<td>{{el.jldw}}</td>
|
|
<td>{{el.kclx}}</td>
|
|
<td>{{el.kczt}}</td>
|
|
<td>
|
|
<input class="td_input" type="number" confirm-type="go" v-model="el.sl" @focus="focusInput(e, el)" @blur="updateNum(e, el)" @confirm="updateNum(e, el)"/>
|
|
</td>
|
|
<td @tap.stop="showPop(1, e, el)">
|
|
<view class="zd-row td_change">
|
|
<uni-icons type="shop" size="16" color="#fff"></uni-icons>
|
|
<view class="mgl10">{{el.dcckbm}}</view>
|
|
</view>
|
|
</td>
|
|
<td>{{el.dcckmc}}</td>
|
|
<td @tap.stop="showPop(2, e, el)">
|
|
<view class="zd-row td_change">
|
|
<uni-icons type="shop" size="16" color="#fff"></uni-icons>
|
|
<view class="mgl10">{{el.drckbm}}</view>
|
|
</view>
|
|
</td>
|
|
<td>{{el.drckmc}}</td>
|
|
<td @tap.stop="getDetails(3,el)"><uni-icons type="more-filled" size="14" color="#fff"></uni-icons></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</view>
|
|
</view>
|
|
<!-- 二级表格end -->
|
|
</view>
|
|
</view>
|
|
<view class="zd-row jcenter pd20">
|
|
<pagination v-show="dataList.length > 0" :total="totalCount1" :page-size="queryParams1.pageSize" :current-page="currentPage1" @page-change="handlePageChange1" />
|
|
</view>
|
|
</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, 'pop-wraper_1': type === 3 || type === 4}">
|
|
<view v-if="type === 1" class="allwidth pop-title">修改调出仓库</view>
|
|
<view v-if="type === 2" class="allwidth pop-title">修改调入仓库</view>
|
|
<view v-if="type === 3 || type === 4" 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 || type === 4" 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 v-if="type === 3" 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 v-if="type === 4" 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 v-if="ele.status" class="zd-col-9 zd-sec-td zd-pop-td"><text>{{ele.kwbm}}</text></view>
|
|
<view v-else class="zd-col-9 zd-sec-td zd-pop-td">
|
|
<scan-input
|
|
v-model="ele.kwbm"
|
|
/>
|
|
</view>
|
|
<view v-if="ele.status" class="zd-col-3 zd-sec-td zd-pop-td"><text>{{ele.fpsl}}</text></view>
|
|
<view v-else 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 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>
|
|
<button v-show="type === 4" class="confirm-button mgl0" :class="{'confirm-button_disabled': popData.length === 0}" :disabled="popdisabled" @tap="_updateAssignDtl">确定</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"></uni-popup-dialog>
|
|
</uni-popup>
|
|
</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'
|
|
import {getWarehouseInfo, getOrganizationInfo, allocationPage, allocationBillDetail, allocationBillConfirm, allocationBillDetailUpdate, easOutInBillSync, inWarehouseAssignLocation, addAssignDtl, inWarehouseCommit, viewAssignDtl, updateAssignDtl} from '@/utils/mork2.js'
|
|
export default {
|
|
components: {
|
|
NavBar,
|
|
SearchBox,
|
|
ScanInput,
|
|
Pagination,
|
|
GridDetail
|
|
},
|
|
data() {
|
|
return {
|
|
val1: '', // 模糊查询
|
|
value1: '', // 选择调入组织信息
|
|
value2: '', // 选择调出组织信息
|
|
range1: [],
|
|
totalCount1: 0, // 分页
|
|
queryParams1:{
|
|
pageSize: 10,
|
|
pageNum: 1
|
|
},
|
|
currentPage1: 1,
|
|
dataList: [], // 一级表格数据
|
|
popData: [], // 副表格点击物料编码弹出弹窗
|
|
popdisabled: false,
|
|
popObj: {}, // 弹窗当前主表格内容
|
|
show: false, // 弹窗显示布尔值
|
|
type: '', // 弹窗类型
|
|
delShow: false, // 详情弹窗布尔值
|
|
detailObj: {}, // 详情弹窗
|
|
value: '', // 选择仓库名称
|
|
range: [],
|
|
disabled1: false,
|
|
raw: '', // 副表格修改前输入框数据
|
|
rawObj: {} ,// 副表格修改前行数据
|
|
subCheckData: [] // 二级表格多选数组
|
|
}
|
|
},
|
|
onLoad () {
|
|
this.toSearch()
|
|
setTimeout(() => {
|
|
this._getWarehouseInfo()
|
|
this._getOrganizationInfo()
|
|
}, 3000)
|
|
},
|
|
methods: {
|
|
// 仓库下拉框
|
|
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)
|
|
})
|
|
}
|
|
},
|
|
// 组织信息下拉框
|
|
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)
|
|
})
|
|
}
|
|
},
|
|
// 查询一级表格
|
|
toSearch () {
|
|
this.queryParams1 = {
|
|
pageSize: 10,
|
|
pageNum: 1
|
|
}
|
|
this.currentPage1 = 1
|
|
this._allocationPage()
|
|
},
|
|
// 一级表格接口
|
|
async _allocationPage (e) {
|
|
let res = await allocationPage(this.val1, this.value1, this.value2, this.queryParams1.pageNum + '', this.queryParams1.pageSize + '')
|
|
if (res.code === 1) {
|
|
res.result.map(el => {
|
|
this.$set(el, 'checked', false)
|
|
this.$set(el, 'subData', [])
|
|
this.$set(el, 'subAllChecked', false)
|
|
this.$set(el, 'subOneChecked', false)
|
|
})
|
|
this.dataList = [...res.result]
|
|
this.totalCount1 = Number(res.totalElements)
|
|
this.queryParams1.pageSize = Number(res.pageSize)
|
|
this.queryParams1.pageNum = Number(res.pageNum)
|
|
if (e) {
|
|
this._allocationBillDetail(e)
|
|
}
|
|
} else {
|
|
uni.showToast({
|
|
title: res.desc,
|
|
icon: 'none'
|
|
})
|
|
}
|
|
},
|
|
// 一级表格切换分页
|
|
handlePageChange1(page) {
|
|
this.queryParams1.pageNum = page
|
|
this.currentPage1 = page
|
|
this._allocationPage()
|
|
},
|
|
// 点击一级表格一行加载二级表格
|
|
loadSubData (e) {
|
|
if (e.subData.length > 0) {
|
|
e.subData = []
|
|
} else if (e.subData.length === 0) {
|
|
this._allocationBillDetail(e)
|
|
}
|
|
e.subAllChecked = false
|
|
e.subOneChecked = false
|
|
},
|
|
// 二级表格接口
|
|
async _allocationBillDetail (e) {
|
|
let res = await allocationBillDetail(e.djid)
|
|
if (res.code === 1) {
|
|
res.result.map(el => {
|
|
this.$set(el, 'checked', false)
|
|
})
|
|
this.dataList.map(el => {
|
|
if (el.djid === e.djid) {
|
|
el.subData = [...res.result]
|
|
}
|
|
})
|
|
} else {
|
|
uni.showToast({
|
|
title: res.desc,
|
|
icon: 'none'
|
|
})
|
|
}
|
|
},
|
|
// 二级表格全选
|
|
toSubAllCheckbox (e) {
|
|
e.subAllChecked = !e.subAllChecked
|
|
e.subOneChecked = e.subAllChecked
|
|
e.subData.map(el => {
|
|
el.checked = e.subAllChecked
|
|
})
|
|
},
|
|
// 二级表格多选
|
|
toSubCheckbox (e,el) {
|
|
if (el.checked) {
|
|
this.$set(el, 'checked', false)
|
|
} else if (!el.checked) {
|
|
this.$set(el, 'checked', true)
|
|
}
|
|
let arr = e.subData.filter(ele => ele.checked === true)
|
|
e.subAllChecked = arr.length === e.subData.length
|
|
e.subOneChecked = arr.length > 0
|
|
},
|
|
// 点击直接调拨按钮
|
|
async _allocationBillConfirm (e) {
|
|
this.disabled1 = true
|
|
if (!e.subOneChecked) {
|
|
this.disabled1 = false
|
|
return
|
|
}
|
|
try {
|
|
let arr = e.subData.filter(ele => ele.checked === true)
|
|
let res = await allocationBillConfirm(arr)
|
|
if (res.code === 1) {
|
|
this._allocationPage(e)
|
|
}
|
|
this.disabled1 = false
|
|
uni.showToast({
|
|
title: res.desc,
|
|
icon: 'none'
|
|
})
|
|
} catch (e) {
|
|
this.disabled1 = false
|
|
}
|
|
},
|
|
// 副表格单行数量获取焦点
|
|
focusInput (e, el) {
|
|
this.raw = el.sl
|
|
},
|
|
// 修改副表格单行数量
|
|
updateNum (e, el) {
|
|
this._allocationBillDetailUpdate(e, el, 'sl')
|
|
},
|
|
// 副表格单行收货数量和收货仓库接口
|
|
async _allocationBillDetailUpdate (e, el, type) {
|
|
try {
|
|
let res = await allocationBillDetailUpdate(el)
|
|
if (res.code === 1) {
|
|
setTimeout(() => {
|
|
this._allocationBillDetail(e)
|
|
}, 1500)
|
|
} else {
|
|
this.dataList.map(ele => {
|
|
if (e.id === ele.id) {
|
|
e.subData.map(elem => {
|
|
if (elem.id === el.id) {
|
|
if (type === 'sl') {
|
|
elem.sl = this.raw
|
|
}
|
|
}
|
|
})
|
|
}
|
|
})
|
|
}
|
|
uni.showToast({
|
|
title: res.desc,
|
|
icon: 'none'
|
|
})
|
|
} catch (e) {
|
|
console.log(e)
|
|
}
|
|
},
|
|
// 副表格修改仓库弹窗
|
|
showPop (type, e, obj) {
|
|
this.popObj = {}
|
|
this.value = ''
|
|
this.type = type
|
|
if (type === 1 || type === 2) { // 修改副表格单行仓库弹窗
|
|
this.show = true
|
|
this.popObj = e
|
|
this.rawObj = obj
|
|
} else if (type === 3 && e.subOneChecked) { // 库位分配
|
|
this.popObj = e
|
|
this._inWarehouseAssignLocation(e)
|
|
} else if (type === 4) {
|
|
this._viewAssignDtl(e, obj)
|
|
}
|
|
},
|
|
// 点击二级表格行中的物料编号,弹窗加载表格
|
|
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.show = true
|
|
} else {
|
|
uni.showToast({
|
|
title: res.desc,
|
|
icon: 'none'
|
|
})
|
|
}
|
|
},
|
|
// 副表格修改仓库弹窗->确定
|
|
SetStorConfirm () {
|
|
if (this.value === '') {
|
|
uni.showToast({
|
|
title: '请设置仓库',
|
|
icon: 'none'
|
|
})
|
|
return
|
|
}
|
|
this.show = false
|
|
let text = ''
|
|
this.range.map(el => {
|
|
if (el.value === this.value) {
|
|
text = el.text
|
|
}
|
|
})
|
|
let obj = Object.assign({}, this.rawObj)
|
|
if (this.type === 1) {
|
|
obj.dcckbm = this.value
|
|
obj.dcckmc = text
|
|
this._allocationBillDetailUpdate(this.popObj, obj, 'dcck')
|
|
} else if (this.type === 2) {
|
|
obj.drckbm = this.value
|
|
obj.drckmc = text
|
|
this._allocationBillDetailUpdate(this.popObj, obj, 'drck')
|
|
}
|
|
this.show = false
|
|
},
|
|
// 详情弹窗
|
|
getDetails (type,e) {
|
|
this.delShow = !this.delShow
|
|
this.detailObj = {type: type, data:e}
|
|
},
|
|
// 同步
|
|
async _easOutInBillSync () {
|
|
this.disabled1 = true
|
|
try {
|
|
let res = await easOutInBillSync('ALLO')
|
|
uni.showToast({
|
|
title: res.desc,
|
|
icon: 'none'
|
|
})
|
|
this.disabled1 = false
|
|
} 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 _updateAssignDtl () {
|
|
this.popdisabled = true
|
|
if (this.popData.length === 0) {
|
|
this.popdisabled = false
|
|
return
|
|
}
|
|
try {
|
|
let res = await updateAssignDtl(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
|
|
}
|
|
},
|
|
// 分配库位弹窗表格
|
|
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>
|
|
|
|
<style lang="stylus" scoped>
|
|
@import '../../common/style/mixin.styl';
|
|
.mgr30
|
|
margin-right 30rpx
|
|
.select_wraper
|
|
/deep/ .uni-select__input-box
|
|
height 30px
|
|
/deep/ .uni-select__selector
|
|
z-index 11
|
|
/deep/ .uni-select
|
|
height: 30px;
|
|
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
|
|
/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
|
|
.zd-th
|
|
font-size: 12px;
|
|
line-height: 13px;
|
|
height: 36px;
|
|
</style>
|