Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

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

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

@ -53,6 +53,7 @@
@handleAddTable="handleAddTable" @handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@inputNumberChange="inputNumberChange"
@submitForm="submitForm" @submitForm="submitForm"
@tableFormSelectOnBlur="tableFormSelectOnBlur" @tableFormSelectOnBlur="tableFormSelectOnBlur"
/> />
@ -70,6 +71,7 @@
:apiDelete="ScrapRequestDetailApi.deleteScrapRequestDetail" :apiDelete="ScrapRequestDetailApi.deleteScrapRequestDetail"
:Echo="Echo" :Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
@detailBasicFormOnChange="qtyOnChange"
:detailValidate="detailValidate" :detailValidate="detailValidate"
@onBlur="onBlur" @onBlur="onBlur"
/> />
@ -86,6 +88,7 @@ import { ScrapRequestMain,ScrapRequestMainRules,ScrapRequestDetail,ScrapRequestD
import * as ScrapRequestMainApi from '@/api/wms/scrapRequestMain' import * as ScrapRequestMainApi from '@/api/wms/scrapRequestMain'
import * as ScrapRequestDetailApi from '@/api/wms/scrapRequestDetail' import * as ScrapRequestDetailApi from '@/api/wms/scrapRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as StdcostpriceApi from '@/api/wms/stdcostprice'
// //
defineOptions({ name: 'ScrapRequestMain' }) defineOptions({ name: 'ScrapRequestMain' })
@ -113,6 +116,12 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
row['batch'] = val[0]['batch'] row['batch'] = val[0]['batch']
row['fromLocationCode'] = val[0]['locationCode'] row['fromLocationCode'] = val[0]['locationCode']
row['itemCode'] = val[0]['itemCode'] 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 { } else {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
@ -129,6 +138,12 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
setV['batch'] = val[0]['batch'] setV['batch'] = val[0]['batch']
setV['fromLocationCode'] = val[0]['locationCode'] setV['fromLocationCode'] = val[0]['locationCode']
setV['itemCode'] = val[0]['itemCode'] 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) 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 () => { onMounted(async () => {
getList() getList()

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

@ -539,6 +539,50 @@ export const ScrapRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
precision: 6 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: '计量单位', label: '计量单位',
field: 'uom', field: 'uom',
@ -547,9 +591,13 @@ export const ScrapRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
isTable: true, isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150,
componentProps:{
disabled:true,
}
}, },
tableForm: { tableForm: {
disabled:true,
type: 'Select' type: 'Select'
} }
}, },

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

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

Loading…
Cancel
Save