|
|
|
@ -57,7 +57,7 @@
|
|
|
|
<el-input-number
|
|
|
|
<el-input-number
|
|
|
|
v-model="row.count"
|
|
|
|
v-model="row.count"
|
|
|
|
controls-position="right"
|
|
|
|
controls-position="right"
|
|
|
|
:min="0.001"
|
|
|
|
:min="1.000"
|
|
|
|
:precision="3"
|
|
|
|
:precision="3"
|
|
|
|
class="!w-100%"
|
|
|
|
class="!w-100%"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
@ -70,7 +70,7 @@
|
|
|
|
<el-input-number
|
|
|
|
<el-input-number
|
|
|
|
v-model="row.productPrice"
|
|
|
|
v-model="row.productPrice"
|
|
|
|
controls-position="right"
|
|
|
|
controls-position="right"
|
|
|
|
:min="0.01"
|
|
|
|
:min="0.00"
|
|
|
|
:precision="2"
|
|
|
|
:precision="2"
|
|
|
|
class="!w-100%"
|
|
|
|
class="!w-100%"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
@ -144,6 +144,7 @@ import {
|
|
|
|
erpPriceMultiply,
|
|
|
|
erpPriceMultiply,
|
|
|
|
getSumValue
|
|
|
|
getSumValue
|
|
|
|
} from '@/utils'
|
|
|
|
} from '@/utils'
|
|
|
|
|
|
|
|
import {ItemRequisitionAndStockVO} from "@/api/mes/task";
|
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
const props = defineProps<{
|
|
|
|
items: undefined
|
|
|
|
items: undefined
|
|
|
|
@ -176,6 +177,9 @@ watch(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 循环处理
|
|
|
|
// 循环处理
|
|
|
|
val.forEach((item) => {
|
|
|
|
val.forEach((item) => {
|
|
|
|
|
|
|
|
if(item.productPrice == null) item.productPrice = 0.0
|
|
|
|
|
|
|
|
if(item.taxPercent == null) item.taxPercent = 0.0
|
|
|
|
|
|
|
|
|
|
|
|
item.totalProductPrice = erpPriceMultiply(item.productPrice, item.count)
|
|
|
|
item.totalProductPrice = erpPriceMultiply(item.productPrice, item.count)
|
|
|
|
item.taxPrice = erpPriceMultiply(item.totalProductPrice, item.taxPercent / 100.0)
|
|
|
|
item.taxPrice = erpPriceMultiply(item.totalProductPrice, item.taxPercent / 100.0)
|
|
|
|
if (item.totalProductPrice != null) {
|
|
|
|
if (item.totalProductPrice != null) {
|
|
|
|
@ -216,13 +220,13 @@ const handleAdd = () => {
|
|
|
|
productId: undefined,
|
|
|
|
productId: undefined,
|
|
|
|
productUnitName: undefined, // 产品单位
|
|
|
|
productUnitName: undefined, // 产品单位
|
|
|
|
productBarCode: undefined, // 产品条码
|
|
|
|
productBarCode: undefined, // 产品条码
|
|
|
|
productPrice: undefined,
|
|
|
|
productPrice: 0,
|
|
|
|
stockCount: undefined,
|
|
|
|
stockCount: undefined,
|
|
|
|
count: 1,
|
|
|
|
count: 1,
|
|
|
|
totalProductPrice: undefined,
|
|
|
|
totalProductPrice: 0,
|
|
|
|
taxPercent: undefined,
|
|
|
|
taxPercent: 0,
|
|
|
|
taxPrice: undefined,
|
|
|
|
taxPrice: 0,
|
|
|
|
totalPrice: undefined,
|
|
|
|
totalPrice: 0,
|
|
|
|
remark: undefined
|
|
|
|
remark: undefined
|
|
|
|
}
|
|
|
|
}
|
|
|
|
formData.value.push(row)
|
|
|
|
formData.value.push(row)
|
|
|
|
@ -258,14 +262,45 @@ const setStockCount = async (row: any) => {
|
|
|
|
const validate = () => {
|
|
|
|
const validate = () => {
|
|
|
|
return formRef.value.validate()
|
|
|
|
return formRef.value.validate()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
defineExpose({ validate })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 物料申购会调用 */
|
|
|
|
|
|
|
|
const handleItemListAdd = async (itemList: ItemRequisitionAndStockVO[]) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < itemList.length; i++) {
|
|
|
|
|
|
|
|
const row = {
|
|
|
|
|
|
|
|
id: undefined,
|
|
|
|
|
|
|
|
productId: itemList[i].itemId,
|
|
|
|
|
|
|
|
productUnitName: undefined, // 产品单位
|
|
|
|
|
|
|
|
productBarCode: undefined, // 产品条码
|
|
|
|
|
|
|
|
productPrice: 0.0,
|
|
|
|
|
|
|
|
stockCount: undefined,
|
|
|
|
|
|
|
|
count: itemList[i].number,
|
|
|
|
|
|
|
|
totalProductPrice: 0.0,
|
|
|
|
|
|
|
|
taxPercent: 0.0,
|
|
|
|
|
|
|
|
taxPrice: 0.0,
|
|
|
|
|
|
|
|
totalPrice: 0,
|
|
|
|
|
|
|
|
remark: undefined
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
formData.value.push(row)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/** 处理产品变更 */
|
|
|
|
|
|
|
|
if(!productList.value || productList.value.length==0)
|
|
|
|
|
|
|
|
productList.value = await ProductApi.getOrderSimpleList()
|
|
|
|
|
|
|
|
for (let i = 0; i < formData.value.length; i++) {
|
|
|
|
|
|
|
|
onChangeProduct(formData.value[i].productId, formData.value[i])
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
defineExpose({ validate, handleItemListAdd })
|
|
|
|
|
|
|
|
|
|
|
|
/** 初始化 */
|
|
|
|
/** 初始化 */
|
|
|
|
onMounted(async () => {
|
|
|
|
onMounted(async () => {
|
|
|
|
|
|
|
|
if(!productList.value || productList.value.length==0)
|
|
|
|
productList.value = await ProductApi.getOrderSimpleList()
|
|
|
|
productList.value = await ProductApi.getOrderSimpleList()
|
|
|
|
// 默认添加一个
|
|
|
|
// 默认添加一个
|
|
|
|
if (formData.value.length === 0) {
|
|
|
|
if (formData.value.length === 0) {
|
|
|
|
handleAdd()
|
|
|
|
handleAdd()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|