Browse Source

报废出库增加单价和金额

master_hella_20240701
zhaoxuebing 8 months ago
parent
commit
8c6777cf57
  1. 27
      src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue
  2. 50
      src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts
  3. 16
      src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue

27
src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue

@ -53,6 +53,7 @@
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@inputNumberChange="inputNumberChange"
@submitForm="submitForm"
@tableFormSelectOnBlur="tableFormSelectOnBlur"
/>
@ -70,6 +71,7 @@
:apiDelete="ScrapRequestDetailApi.deleteScrapRequestDetail"
:Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail"
@detailBasicFormOnChange="qtyOnChange"
:detailValidate="detailValidate"
@onBlur="onBlur"
/>
@ -86,6 +88,7 @@ import { ScrapRequestMain,ScrapRequestMainRules,ScrapRequestDetail,ScrapRequestD
import * as ScrapRequestMainApi from '@/api/wms/scrapRequestMain'
import * as ScrapRequestDetailApi from '@/api/wms/scrapRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as StdcostpriceApi from '@/api/wms/stdcostprice'
//
defineOptions({ name: 'ScrapRequestMain' })
@ -113,6 +116,12 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
row['batch'] = val[0]['batch']
row['fromLocationCode'] = val[0]['locationCode']
row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom']
//
let param = {'itemCode':val[0]['itemCode'] as string}
StdcostpriceApi.queryStdcostpriceByItemCode(param).then(res => {
row['singlePrice'] = res.price
})
} else {
const setV = {}
setV[formField] = val[0][searchField]
@ -129,6 +138,12 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
setV['batch'] = val[0]['batch']
setV['fromLocationCode'] = val[0]['locationCode']
setV['itemCode'] = val[0]['itemCode']
setV['uom'] = val[0]['uom']
//
let param = {'itemCode':val[0]['itemCode'] as string}
StdcostpriceApi.queryStdcostpriceByItemCode(param).then(res => {
setV['singlePrice'] = res.price
})
formRef.setValues(setV)
})
}
@ -458,6 +473,18 @@ const tableFormSelectOnBlur = (field, val, row, index) => {
}
}
const inputNumberChange = (field, index, row, val) => {
if(field == 'qty' || field == 'singlePrice'){
row.amount = row.qty * row.singlePrice
}
}
const qtyOnChange = (field,val) =>{
if(field == 'qty' || field == 'singlePrice'){
detailRef.value.formRef.formRef.formModel.amount = detailRef.value.formRef.formRef.formModel.qty * detailRef.value.formRef.formRef.formModel.singlePrice
}
}
/** 初始化 **/
onMounted(async () => {
getList()

50
src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts

@ -539,6 +539,50 @@ export const ScrapRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
precision: 6
}
},
{
label: '单价',
field: 'singlePrice',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
disabled: true,
min: 0,
precision: 6
},
},
tableForm: {
disabled: true,
type: 'InputNumber',
min: 0,
precision: 6
}
},
{
label: '金额',
field: 'amount',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
disabled:true,
min: 0,
precision: 6,
}
},
tableForm: {
type: 'InputNumber',
disabled:true,
min: 0,
precision: 6,
},
},
{
label: '计量单位',
field: 'uom',
@ -547,9 +591,13 @@ export const ScrapRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
isTable: true,
sort: 'custom',
table: {
width: 150
width: 150,
componentProps:{
disabled:true,
}
},
tableForm: {
disabled:true,
type: 'Select'
}
},

16
src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue

@ -304,12 +304,13 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
row['itemCode'] = val[0]['itemCode']
row['bomVersion'] = ''
row['childList'] = []
let param = {'itemCode':val[0]['itemCode'] as string}
StdcostpriceApi.queryStdcostpriceByItemCode(param).then(res => {
console.log(res)
row['uom'] = res.uom
row['singlePrice'] = res.price
})
//
let param = {'itemCode':val[0]['itemCode'] as string}
StdcostpriceApi.queryStdcostpriceByItemCode(param).then(res => {
console.log(res)
row['uom'] = res.uom
row['singlePrice'] = res.price
})
}else if(formField == 'bomVersion'){
row['bomVersion'] = val[0]['version']
}
@ -337,12 +338,11 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
setV['itemCode'] = val[0]['itemCode']
setV['bomVersion'] = ''
setV['childList'] = []
//
//
let param = {'itemCode':val[0]['itemCode'] as string}
StdcostpriceApi.queryStdcostpriceByItemCode(param).then(res => {
console.log(res)
})
}else if(formField == 'bomVersion'){
setV['bomVersion'] = val[0]['version']
}

Loading…
Cancel
Save