Browse Source

Q3通知单数量传不过去

hella_online_20240816
zhang_li 1 month ago
parent
commit
f4d4b8d1d6
  1. 48
      src/views/qms/inspectionQ3/index.vue

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

@ -71,13 +71,6 @@
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
@inputNumberChange="inputNumberChange"
:sumFormDataByTableCustom="
(formRef, formModel, tableData) => {
tableData.forEach((item) => {
item.qty = item.countQty * item.packQty
})
}
"
>
<!-- <template #default="{row}">
<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 (formField == 'itemCode') {
// val.forEach(item=>{
// })
const index1 = 0
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') {
console.log(11111)
@ -211,7 +169,6 @@ const setTableFormsValues = async (val, index1) => {
const newRow = JSON.parse(JSON.stringify({ ...tableForm, ...val[index1] }))
newRow['itemCode'] = val[index1]['itemCode']
newRow['uom'] = val[index1]['uom']
newRow['qty'] = 0
newRow.defectLocation = val[index1]['productionLineCode']
await ProductionlineitemApi.selectItemCodeToProductionLineCode(val[index1].itemCode).then(
(res) => {
@ -236,7 +193,9 @@ const setTableFormsValues = async (val, index1) => {
newRow['amount']=(parseFloat(newRow['qty']) * parseFloat(priceObj.value.price)).toFixed(6)
}
})
newRow['qty'] = 0
tableData.value.push(newRow)
console.log( tableData.value)
index1++
setTableFormsValues(val, index1)
}
@ -248,7 +207,7 @@ const inputNumberChange = (field, index, row, val) => {
}
formRef.value.formRef.formModel.summaryAmount =0
tableData.value.forEach(item=>{
formRef.value.formRef.formModel.summaryAmount += parseFloat(item.amount)
formRef.value.formRef.formModel.summaryAmount += parseFloat(item.amount)
})
}
//
@ -359,6 +318,7 @@ const handleFinish = async (id: number) => {
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type: string, row?: any) => {
tableData.value = []
formRef.value.open(type, row)
if (type == 'create') {
nextTick(() => {

Loading…
Cancel
Save