Browse Source

Q3通知单数量传不过去

hella_online_20240816
zhang_li 3 months ago
parent
commit
f4d4b8d1d6
  1. 46
      src/views/qms/inspectionQ3/index.vue

46
src/views/qms/inspectionQ3/index.vue

@ -71,13 +71,6 @@
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" @submitForm="submitForm"
@inputNumberChange="inputNumberChange" @inputNumberChange="inputNumberChange"
:sumFormDataByTableCustom="
(formRef, formModel, tableData) => {
tableData.forEach((item) => {
item.qty = item.countQty * item.packQty
})
}
"
> >
<!-- <template #default="{row}"> <!-- <template #default="{row}">
<el-input-number disabled v-model="row.qty"></el-input-number> <el-input-number disabled v-model="row.qty"></el-input-number>
@ -146,43 +139,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
if (type == 'tableForm') { if (type == 'tableForm') {
// //
if (formField == 'itemCode') { if (formField == 'itemCode') {
// val.forEach(item=>{
// })
const index1 = 0 const index1 = 0
setTableFormsValues(val, index1) setTableFormsValues(val, index1)
// row['uom'] = val[0]['uom']
// console.log(formRef.formModel.qty)
// // let res = await ProductionlineitemApi.selectItemCodeToProductionLineCode(val[0].code)
// ProductionlineitemApi.selectItemCodeToProductionLineCode(val[0].code).then((res) => {
// console.log(res)
// if (res?.length > 0) {
// formRef.formModel.defectLocation = res[0].productionLineCode
// InspectionQ3Detail.allSchemas.formSchema.forEach(item=>{
// if (item.field == 'defectLocation') {
// item.componentProps.options = res
// }
// })
// }
// })
// const params = {
// by: "ASC",
// filters: [{column: "itemCode", action: "==", value: val[0].code}],
// pageNo: 1,
// pageSize: 500,
// sort: ""
// }
// params.isSearch = true
// StdcostpriceApi.getStdcostpricePage(params).then((res) => {
// if (res.list?.length > 0) {
// priceObj.value = res.list[0]
// formRef.setValues({
// amount: (parseFloat(formRef.formModel.qty) * parseFloat(priceObj.value.price)).toFixed(6)
// })
// }
// })
} }
if (formField == 'costCode') { if (formField == 'costCode') {
console.log(11111) console.log(11111)
@ -211,7 +169,6 @@ const setTableFormsValues = async (val, index1) => {
const newRow = JSON.parse(JSON.stringify({ ...tableForm, ...val[index1] })) const newRow = JSON.parse(JSON.stringify({ ...tableForm, ...val[index1] }))
newRow['itemCode'] = val[index1]['itemCode'] newRow['itemCode'] = val[index1]['itemCode']
newRow['uom'] = val[index1]['uom'] newRow['uom'] = val[index1]['uom']
newRow['qty'] = 0
newRow.defectLocation = val[index1]['productionLineCode'] newRow.defectLocation = val[index1]['productionLineCode']
await ProductionlineitemApi.selectItemCodeToProductionLineCode(val[index1].itemCode).then( await ProductionlineitemApi.selectItemCodeToProductionLineCode(val[index1].itemCode).then(
(res) => { (res) => {
@ -236,7 +193,9 @@ const setTableFormsValues = async (val, index1) => {
newRow['amount']=(parseFloat(newRow['qty']) * parseFloat(priceObj.value.price)).toFixed(6) newRow['amount']=(parseFloat(newRow['qty']) * parseFloat(priceObj.value.price)).toFixed(6)
} }
}) })
newRow['qty'] = 0
tableData.value.push(newRow) tableData.value.push(newRow)
console.log( tableData.value)
index1++ index1++
setTableFormsValues(val, index1) setTableFormsValues(val, index1)
} }
@ -359,6 +318,7 @@ const handleFinish = async (id: number) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = async (type: string, row?: any) => { const openForm = async (type: string, row?: any) => {
tableData.value = []
formRef.value.open(type, row) formRef.value.open(type, row)
if (type == 'create') { if (type == 'create') {
nextTick(() => { nextTick(() => {

Loading…
Cancel
Save