Browse Source

Q2通知单功能完善 HL-5740

hella_online_20240904
YEJIAXING-PC\lenovo 3 months ago
parent
commit
dc14834bf3
  1. 104
      src/views/qms/inspectionQ2/index.vue
  2. 137
      src/views/qms/inspectionQ2/inspectionQ2.data.ts

104
src/views/qms/inspectionQ2/index.vue

@ -63,16 +63,25 @@
:apiUpdate="Q2Api.updateQ2" :apiUpdate="Q2Api.updateQ2"
:apiCreate="Q2Api.createQ2" :apiCreate="Q2Api.createQ2"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@clearSearchInput="clearSearchInput"
:isBusiness="false" :isBusiness="false"
@onChange="onChange" @onChange="onChange"
> >
<template #searchQuerypurchaseReceiptNumber> <template #searchQuerypurchaseReceiptNumber>
<el-form :inline="true"> <el-form :inline="true">
<el-form-item label="供应商物料代码"> <el-form-item label="供应商物料代码">
<el-input v-model="basicFormRef.formRef.formModel.itemCode" placeholder="请输入供应商" disabled></el-input> <el-input
v-model="basicFormRef.formRef.formModel.itemCode"
placeholder="请输入供应商"
disabled
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="供应商代码"> <el-form-item label="供应商代码">
<el-input v-model="basicFormRef.formRef.formModel.supplierCode" placeholder="请输入物料号" disabled></el-input> <el-input
v-model="basicFormRef.formRef.formModel.supplierCode"
placeholder="请输入物料号"
disabled
></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</template> </template>
@ -105,6 +114,7 @@ import * as SupplierApi from '@/api/wms/supplier'
import * as ItembasicApi from '@/api/wms/itembasic' import * as ItembasicApi from '@/api/wms/itembasic'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { usePageLoading } from '@/hooks/web/usePageLoading' import { usePageLoading } from '@/hooks/web/usePageLoading'
import { log } from 'console'
const { loadStart, loadDone } = usePageLoading() const { loadStart, loadDone } = usePageLoading()
const userStore = useUserStore() const userStore = useUserStore()
@ -117,7 +127,42 @@ const route = useRoute() // 路由信息
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(Q2.allSchemas.tableColumns) const tableColumns = ref(Q2.allSchemas.tableColumns)
const clearSearchInput = (formField) => {
if (formField == 'itemCode') {
basicFormRef.value.formRef.setValues({
itemName: '',
SupplierCode: '',
SupplierName: ''
})
}
if (formField == 'lightItemCode') {
basicFormRef.value.formRef.setValues({
standardCostPrice: '',
lightQty: 0,
claimAmount: '',
otherClaimAmount: 0,
summaryAmount: 0,
disbursementAmount: 0,
remainingAmount: 0
})
const params2 = {
by: 'ASC',
filters: [{ column: 'itemCode', action: '==', value: basicFormRef.value.formRef.formModel.itemCode }],
pageNo: 1,
pageSize: 500,
sort: ''
}
params2.isSearch = true
StdcostpriceApi.getStdcostpricePage(params2).then((res) => {
if (res.list?.length > 0) {
priceObj.value = res.list[0]
basicFormRef.value.formRef.setValues({
standardCostPrice: priceObj.value.price
})
}
})
}
}
// //
const priceObj = ref() const priceObj = ref()
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
@ -147,7 +192,7 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
if (formField == 'purchaseReceiptNumber') { if (formField == 'purchaseReceiptNumber') {
let result = '' let result = ''
for (var i = 0; i < val.length; i++) { for (var i = 0; i < val.length; i++) {
result += val[i].number + ',' result += val[i].receiptNumber + ','
} }
if (result.endsWith(',')) { if (result.endsWith(',')) {
result = result.substring(0, result.length - 1) result = result.substring(0, result.length - 1)
@ -248,6 +293,32 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
}) })
} }
}) })
if (val[0].lightItemCode == null) {
setV['standardCostPrice'] = ''
setV['lightQty'] = 0
setV['claimAmount'] = ''
setV['otherClaimAmount'] = 0
setV['summaryAmount'] = 0
setV['disbursementAmount'] = 0
setV['remainingAmount'] = 0
const params2 = {
by: 'ASC',
filters: [{ column: 'itemCode', action: '==', value: val[0].itemCode }],
pageNo: 1,
pageSize: 500,
sort: ''
}
params2.isSearch = true
StdcostpriceApi.getStdcostpricePage(params2).then((res) => {
if (res.list?.length > 0) {
priceObj.value = res.list[0]
formRef.setValues({
standardCostPrice: priceObj.value.price
})
}
})
}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
formRef.setValues(setV) formRef.setValues(setV)
} }
@ -255,8 +326,6 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
} }
const onChange = (field, e) => { const onChange = (field, e) => {
console.log('onChange',field)
console.log(basicFormRef.value.formRef.formModel)
if (field == 'lightQty') { if (field == 'lightQty') {
basicFormRef.value.formRef.formModel.claimAmount = ( basicFormRef.value.formRef.formModel.claimAmount = (
parseFloat(basicFormRef.value.formRef.formModel.lightQty) * parseFloat(basicFormRef.value.formRef.formModel.lightQty) *
@ -265,7 +334,7 @@ const onChange = (field, e) => {
).toFixed(6) ).toFixed(6)
basicFormRef.value.formRef.formModel.summaryAmount = ( basicFormRef.value.formRef.formModel.summaryAmount = (
parseFloat(basicFormRef.value.formRef.formModel.claimAmount) + parseFloat(basicFormRef.value.formRef.formModel.claimAmount) +
parseFloat(basicFormRef.value.formRef.formModel.otherClaimAmount||0) parseFloat(basicFormRef.value.formRef.formModel.otherClaimAmount || 0)
).toFixed(6) ).toFixed(6)
basicFormRef.value.formRef.formModel.remainingAmount = ( basicFormRef.value.formRef.formModel.remainingAmount = (
parseFloat(basicFormRef.value.formRef.formModel.summaryAmount) - parseFloat(basicFormRef.value.formRef.formModel.summaryAmount) -
@ -454,7 +523,7 @@ const openForm = (type: string, row?: any) => {
} }
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
if(!row || !row.claimAmount){ if (!row || !row.claimAmount) {
nextTick(() => { nextTick(() => {
basicFormRef.value.formRef.setValues({ basicFormRef.value.formRef.setValues({
claimAmount: '' claimAmount: ''
@ -472,9 +541,7 @@ const openForm = (type: string, row?: any) => {
}) })
const currentTime = new Date().getTime() const currentTime = new Date().getTime()
const fileId = Q2.allSchemas.formSchema.find((item) => item.field == 'fileId') const fileId = Q2.allSchemas.formSchema.find((item) => item.field == 'fileId')
const uploadFile = Q2.allSchemas.formSchema.find( const uploadFile = Q2.allSchemas.formSchema.find((item) => item.field == 'claimAddress')
(item) => item.field == 'claimAddress'
)
if (fileId) { if (fileId) {
fileId['value'] = currentTime fileId['value'] = currentTime
} }
@ -482,11 +549,8 @@ const openForm = (type: string, row?: any) => {
uploadFile['componentProps']['upData']['tableId'] = currentTime uploadFile['componentProps']['upData']['tableId'] = currentTime
uploadFile['componentProps']['modelValue'] = [] uploadFile['componentProps']['modelValue'] = []
} }
} } else if (type == 'update') {
else if (type == 'update') { const uploadFile = Q2.allSchemas.formSchema.find((item) => item.field == 'claimAddress')
const uploadFile = Q2.allSchemas.formSchema.find(
(item) => item.field == 'claimAddress'
)
uploadFile['componentProps']['modelValue'] = row.filePathListView uploadFile['componentProps']['modelValue'] = row.filePathListView
} }
} }
@ -503,10 +567,10 @@ const formsSuccess = async (formType, data) => {
return return
} }
} }
if (data.lightQty == 0) { // if (data.lightQty == 0) {
message.error('整灯数量不能为0') // message.error('0')
return // return
} // }
if (!data.standardCostPrice) { if (!data.standardCostPrice) {
message.error('标准成本价格不能为0或空') message.error('标准成本价格不能为0或空')
return return

137
src/views/qms/inspectionQ2/inspectionQ2.data.ts

@ -10,8 +10,7 @@ import { Q1 } from '@/views/qms/inspectionQ1/inspectionQ1.data'
import * as SupplieritemApi from '@/api/wms/supplieritem' import * as SupplieritemApi from '@/api/wms/supplieritem'
import { Supplieritem } from '@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data' import { Supplieritem } from '@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data'
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail' import * as PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail'
import { PurchasereceiptRecordDetail } from '@/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data'
import * as ItembasicApi from '@/api/wms/itembasic' import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
@ -28,8 +27,7 @@ export const Q2Rules = reactive({
{ max: 255, message: '不得超过255个字符', trigger: 'blur' } { max: 255, message: '不得超过255个字符', trigger: 'blur' }
], ],
claimTime: [{ required: true, message: '请选择索赔日期', trigger: 'change' }], claimTime: [{ required: true, message: '请选择索赔日期', trigger: 'change' }],
lightItemCode: [{ required: true, message: '请选择整灯物料代码', trigger: 'change' }], lightQty: [{ required: true, message: '请选择数量', trigger: 'change' }],
lightQty: [{ required: true, message: '请选择整灯数量', trigger: 'change' }],
code: [{ required: true, message: '请选择缺陷代码', trigger: 'change' }], code: [{ required: true, message: '请选择缺陷代码', trigger: 'change' }],
priority: [{ required: true, message: '请选择优先级', trigger: 'change' }], priority: [{ required: true, message: '请选择优先级', trigger: 'change' }],
claimMultiple: [{ required: true, message: '请选择索赔倍数', trigger: 'change' }], claimMultiple: [{ required: true, message: '请选择索赔倍数', trigger: 'change' }],
@ -39,6 +37,123 @@ export const Q2Rules = reactive({
handleTime: [{ required: true, message: '请选择选择处理时间', trigger: 'change' }] handleTime: [{ required: true, message: '请选择选择处理时间', trigger: 'change' }]
}) })
export const Q2result = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '收货日期',
field: 'currentDeliveryDate',
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
}
},
{
label: '收货单号',
field: 'receiptNumber',
sort: 'custom',
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '发货单号',
field: 'asnNumber',
sort: 'custom',
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '订单行',
field: 'poLine',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
}
])
)
export const Q2 = useCrudSchemas( export const Q2 = useCrudSchemas(
reactive<CrudSchema[]>([ reactive<CrudSchema[]>([
{ {
@ -175,8 +290,8 @@ export const Q2 = useCrudSchemas(
searchListPlaceholder: '请选择采购收货记录单号', // 输入框占位文本 searchListPlaceholder: '请选择采购收货记录单号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段 searchField: 'number', // 查询弹窗赋值字段
searchTitle: '采购收货记录', // 查询弹窗标题 searchTitle: '采购收货记录', // 查询弹窗标题
searchAllSchemas: PurchasereceiptRecordDetail.allSchemas, // 查询弹窗所需类 searchAllSchemas: Q2result.allSchemas, // 查询弹窗所需类
searchPage: PurchasereceiptRecordDetailApi.pageForQ2, // 查询弹窗所需分页方法 searchPage: PurchasereturnRequestDetailApi.getPurchasereturnPurchasereceiptRecordByItemCode, // 查询弹窗所需分页方法
searchCondition: [ searchCondition: [
{ {
key: 'supplierCode', key: 'supplierCode',
@ -238,8 +353,8 @@ export const Q2 = useCrudSchemas(
isMainValue: false isMainValue: false
}, },
{ {
key: 'type', key: 'typeQ2',
value: 'CCP', value: 'CCP,BCP',
isMainValue: false isMainValue: false
} }
], ],
@ -276,7 +391,7 @@ export const Q2 = useCrudSchemas(
} }
}, },
{ {
label: '整灯数量', label: '数量',
field: 'lightQty', field: 'lightQty',
sort: 'custom', sort: 'custom',
isTable: true, isTable: true,
@ -624,7 +739,7 @@ export const Q2 = useCrudSchemas(
tableName: 'basicInspectionQ2', tableName: 'basicInspectionQ2',
tableId: '' tableId: ''
}, },
fileType: ['doc', 'xls', 'ppt', 'txt'], fileType: ['doc', 'xls', 'ppt', 'txt', 'pdf'],
modelValue: [] modelValue: []
} }
} }
@ -759,3 +874,5 @@ export const Q2 = useCrudSchemas(
} }
]) ])
) )

Loading…
Cancel
Save