Browse Source

handleAllocationPrice 模具分摊单价

intex_online20241228
王宇飞 3 months ago
parent
commit
e584efbee9
  1. 34
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts
  2. 14
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
  3. 20
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

34
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts

@ -1364,6 +1364,20 @@ export const SupplierinvoiceRecordDetailMain = useCrudSchemas(reactive<CrudSchem
]))
const singlePriceFormart = (row, column, cellValue) => {
cellValue= Number(cellValue).toFixed(5)
cellValue = cellValue + '' || ''
let x = cellValue.split('.')
let x1 = x[0]
let x2 = x.length > 1 ? '.' + x[1] : ''
const reg = /(\d+)(\d{3})/
while(reg.test(x1)){
x1 = x1.replace(reg, '$1,$2')
}
return x1+x2
}
//表单校验
export const SupplierinvoiceRecordMainRules = reactive({
requestNumber: [
@ -1636,6 +1650,26 @@ export const SupplierinvoiceRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
disabled: true
}
},
{
label: '模具分摊单价',
field: 'allocationPrice',
formatter: singlePriceFormart,
table: {
width: 150
},
isForm:false,
form: {
componentProps: {
disabled: true,
precision: 2,
}
},
tableForm: {
disabled: true,
type: 'InputNumber',
precision: 2,
}
},
// {
// label: '未税差额',
// field: 'untaxedDifference',

14
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue

@ -556,6 +556,7 @@ const inputNumberChange = (field, index, row, val) => {
message.error(t('ts.可开票数量范围是')+`:${row.maxInvoicableQuantity}~0`)
}
}
handleAllocationPrice()
}
}
const onChange = (field, cur) => {
@ -603,6 +604,7 @@ const searchTableSuccess = (formField, searchField, val, searchFormRef, type, ro
}
tableData.value.push(newRow)
})
handleAllocationPrice()
} else {
//
console.log(11,val[0][searchField])
@ -626,6 +628,18 @@ const searchTableSuccess = (formField, searchField, val, searchFormRef, type, ro
}
})
}
//
const handleAllocationPrice = async ()=>{
let res = await SupplierinvoiceRequestDetailApi.handleAllocationPrice(tableData.value)
tableData.value.forEach(item=>{
let findItem = res.find(item1=>item1.id == item?.id)
if(findItem){
item['allocationPrice'] = findItem['allocationPrice']
}
})
console.log('模具分摊单价',res)
}
const Echo = []
const { tableObject, tableMethods } = useTable({

20
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

@ -1918,6 +1918,26 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]
precision: 5,
}
},
{
label: '模具分摊单价',
field: 'allocationPrice',
formatter: singlePriceFormart,
table: {
width: 150
},
isForm:false,
form: {
componentProps: {
disabled: true,
precision: 2,
}
},
tableForm: {
disabled: true,
type: 'InputNumber',
precision: 2,
}
},
{
label: '到货数量',
field: 'arrivalQty',

Loading…
Cancel
Save