Browse Source

q3缺陷问题

linshi20240813
zhang_li 3 months ago
parent
commit
bfa270457a
  1. 41
      src/views/qms/inspectionQ3/index.vue
  2. 13
      src/views/qms/inspectionQ3/inspectionQ3.data.ts

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

@ -55,6 +55,7 @@
:apiCreate="Q3Api.createQ3"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChange"
/>
<!-- 详情 -->
@ -77,6 +78,8 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import * as ProductionlineitemApi from '@/api/wms/productionlineitem'
import * as StdcostpriceApi from '@/api/wms/stdcostprice'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
@ -92,12 +95,43 @@ routeName.value = route.name
const tableColumns = ref(Q3.allSchemas.tableColumns)
//
const priceObj = ref()
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
nextTick(async () => {
const setV = {}
if (formField == 'itemCode') {
console.log(val)
setV['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
Q3.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 == 'q1Number') {
//Q1
@ -113,6 +147,11 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
}
})
}
const onChange =(field,e)=>{
if (field == 'qty') {
basicFormRef.value.formRef.formModel.amount = (parseFloat( basicFormRef.value.formRef.formModel.qty) * parseFloat( priceObj.value.price)).toFixed(6)
}
}
//
const updataTableColumns = (val) => {

13
src/views/qms/inspectionQ3/inspectionQ3.data.ts

@ -226,12 +226,19 @@ export const Q3 = useCrudSchemas(
label: '缺陷位置',
field: 'defectLocation',
sort: 'custom',
dictType: DICT_TYPE.DEFECT_LOCATION,
dictClass: 'string',
isSearch: false,
isTable: false,
tableForm: {
type: 'Select'
form: {
component: 'Select',
componentProps: {
options: [],
optionsAlias: {
labelField: 'productionLineName',
valueField: 'productionLineCode'
},
filterable: true,
}
}
},
{

Loading…
Cancel
Save