|
|
@ -149,7 +149,7 @@ |
|
|
|
</view> |
|
|
|
</u-popup> |
|
|
|
</view> |
|
|
|
<CostCenter ref="costCenterRef" :singleColumnList="singleColumnList" @searchItem="searchItem" /> |
|
|
|
<CostCenter ref="costCenterRef" :singleColumnList="singleColumnList" @searchItem="searchItem" @sure="sure" /> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
@ -163,7 +163,7 @@ import * as costCenterMappingApi from '@/api/costCenterMapping' |
|
|
|
const { proxy } = getCurrentInstance() |
|
|
|
|
|
|
|
const loading = ref(false) |
|
|
|
const orderList = ref([]) //订单信息 |
|
|
|
const orderList = ref([]) // 订单信息 |
|
|
|
const costCenterRef = ref(false) |
|
|
|
// 备件弹窗 |
|
|
|
const isPopupShow = ref(false) |
|
|
@ -286,7 +286,7 @@ function addSpare() { |
|
|
|
} |
|
|
|
|
|
|
|
if (!form1.value.qty) { |
|
|
|
proxy.$modal.showToast(`请输入数量`) |
|
|
|
proxy.$modal.showToast('请输入数量') |
|
|
|
return |
|
|
|
} |
|
|
|
if (Number(form1.value.qty) + Number(form1.value.receiveQty) > Number(form1.value.applyQty)) { |
|
|
@ -298,12 +298,12 @@ function addSpare() { |
|
|
|
return |
|
|
|
} |
|
|
|
if (form.value.itemNumbers && form.value.itemNumbers.length > 0) { |
|
|
|
let arr = form.value.itemNumbers.filter((item) => item.locationNumber == form1.value.locationNumber) |
|
|
|
const arr = form.value.itemNumbers.filter((item) => item.locationNumber == form1.value.locationNumber) |
|
|
|
if (arr && arr.length > 0) { |
|
|
|
proxy.$modal.showToast('该库位已添加') |
|
|
|
return |
|
|
|
} |
|
|
|
let arr1 = form.value.subList.filter((item) => item.itemNumber == form1.value.itemNumber) |
|
|
|
const arr1 = form.value.subList.filter((item) => item.itemNumber == form1.value.itemNumber) |
|
|
|
if (!arr1 || (arr1 && arr1.length == 0)) { |
|
|
|
proxy.$modal.showToast('申领信息没有该备件') |
|
|
|
return |
|
|
@ -315,7 +315,7 @@ function addSpare() { |
|
|
|
|
|
|
|
// 删除备件 |
|
|
|
function delSpareParts(item, index) { |
|
|
|
let bol = form.value.itemNumbers.some((cur) => cur.itemNumber == item.itemNumber && item.isInAccount == 'FALSE' && cur.isInAccount == 'TRUE') |
|
|
|
const bol = form.value.itemNumbers.some((cur) => cur.itemNumber == item.itemNumber && item.isInAccount == 'FALSE' && cur.isInAccount == 'TRUE') |
|
|
|
if (bol) { |
|
|
|
proxy.$modal.showToast('请先删除该备件得帐内库') |
|
|
|
return |
|
|
@ -324,7 +324,7 @@ function delSpareParts(item, index) { |
|
|
|
} |
|
|
|
|
|
|
|
function getLocation() { |
|
|
|
let itemNumbers = form.value.itemNumbers.map((item) => { |
|
|
|
const itemNumbers = form.value.itemNumbers.map((item) => { |
|
|
|
return { |
|
|
|
itemNumber: item.itemNumber, |
|
|
|
qty: item.qty, |
|
|
@ -335,7 +335,7 @@ function getLocation() { |
|
|
|
.getOutLocation({ |
|
|
|
number: form1.value.locationNumber, |
|
|
|
id: form.value.id, |
|
|
|
itemNumbers: itemNumbers |
|
|
|
itemNumbers |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
if (!res.data) { |
|
|
@ -387,7 +387,7 @@ function handelScanMsg() { |
|
|
|
|
|
|
|
onLoad(async (option) => { |
|
|
|
if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option.data)).id) { |
|
|
|
let formData = JSON.parse(decodeURIComponent(option.data)) |
|
|
|
const formData = JSON.parse(decodeURIComponent(option.data)) |
|
|
|
form.value.supplierName = formData.supplierName |
|
|
|
form.value.number = formData.number |
|
|
|
form.value.id = formData.id |
|
|
@ -402,7 +402,7 @@ const isShowSelectItem = ref(false) |
|
|
|
const sparePartsList = ref([]) |
|
|
|
|
|
|
|
// 单列模式 |
|
|
|
function openSingleNewColumn(fieldName, val, list) { |
|
|
|
async function openSingleNewColumn(fieldName, val, list) { |
|
|
|
if (!form1.value.areaNumber) { |
|
|
|
proxy.$modal.showToast('请选择库位信息') |
|
|
|
return |
|
|
@ -414,19 +414,20 @@ function openSingleNewColumn(fieldName, val, list) { |
|
|
|
} else { |
|
|
|
singleColumnDefaultValue.value = [] |
|
|
|
} |
|
|
|
costCenterRef.value.isShowSelectItem = true |
|
|
|
await getSparePartsList() |
|
|
|
costCenterRef.value.open(singleColumnList.value) |
|
|
|
} |
|
|
|
|
|
|
|
async function searchItem(warehouseArea) { |
|
|
|
async function searchItem(keywords) { |
|
|
|
proxy.$modal.loading('加载中') |
|
|
|
await getSparePartsList(warehouseArea) |
|
|
|
await getSparePartsList(keywords) |
|
|
|
} |
|
|
|
|
|
|
|
// 获取备件列表 |
|
|
|
async function getSparePartsList(warehouseArea) { |
|
|
|
let param = { |
|
|
|
const param = { |
|
|
|
ccAccount: form.value.costCenter, |
|
|
|
warehouseArea: warehouseArea ? warehouseArea : form1.value.areaNumber |
|
|
|
warehouseArea: warehouseArea || form1.value.areaNumber |
|
|
|
} |
|
|
|
await costCenterMappingApi |
|
|
|
.findList(param) |
|
|
@ -443,6 +444,9 @@ async function getSparePartsList(warehouseArea) { |
|
|
|
proxy.$modal.closeLoading() |
|
|
|
}) |
|
|
|
} |
|
|
|
function sure(data) { |
|
|
|
form1.value.moveCode = data.warehouseArea |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|