Browse Source

Merge remote-tracking branch 'origin/hella_online_20240904' into hella_online_20240904

hella_online_20240904
gaojs 2 months ago
parent
commit
97d1b17172
  1. 100
      src/views/qms/inspectionQ2/index.vue
  2. 139
      src/views/qms/inspectionQ2/inspectionQ2.data.ts

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

@ -63,16 +63,25 @@
:apiUpdate="Q2Api.updateQ2"
:apiCreate="Q2Api.createQ2"
@searchTableSuccess="searchTableSuccess"
@clearSearchInput="clearSearchInput"
:isBusiness="false"
@onChange="onChange"
>
<template #searchQuerypurchaseReceiptNumber>
<el-form :inline="true">
<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 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>
</template>
@ -105,6 +114,7 @@ import * as SupplierApi from '@/api/wms/supplier'
import * as ItembasicApi from '@/api/wms/itembasic'
import { useUserStore } from '@/store/modules/user'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { log } from 'console'
const { loadStart, loadDone } = usePageLoading()
const userStore = useUserStore()
@ -117,7 +127,42 @@ const route = useRoute() // 路由信息
const routeName = ref()
routeName.value = route.name
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 searchTableSuccess = (formField, searchField, val, formRef) => {
@ -147,7 +192,7 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
if (formField == 'purchaseReceiptNumber') {
let result = ''
for (var i = 0; i < val.length; i++) {
result += val[i].number + ','
result += val[i].receiptNumber + ','
}
if (result.endsWith(',')) {
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]
formRef.setValues(setV)
}
@ -255,8 +326,6 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
}
const onChange = (field, e) => {
console.log('onChange',field)
console.log(basicFormRef.value.formRef.formModel)
if (field == 'lightQty') {
basicFormRef.value.formRef.formModel.claimAmount = (
parseFloat(basicFormRef.value.formRef.formModel.lightQty) *
@ -472,9 +541,7 @@ const openForm = (type: string, row?: any) => {
})
const currentTime = new Date().getTime()
const fileId = Q2.allSchemas.formSchema.find((item) => item.field == 'fileId')
const uploadFile = Q2.allSchemas.formSchema.find(
(item) => item.field == 'claimAddress'
)
const uploadFile = Q2.allSchemas.formSchema.find((item) => item.field == 'claimAddress')
if (fileId) {
fileId['value'] = currentTime
}
@ -482,11 +549,8 @@ const openForm = (type: string, row?: any) => {
uploadFile['componentProps']['upData']['tableId'] = currentTime
uploadFile['componentProps']['modelValue'] = []
}
}
else if (type == 'update') {
const uploadFile = Q2.allSchemas.formSchema.find(
(item) => item.field == 'claimAddress'
)
} else if (type == 'update') {
const uploadFile = Q2.allSchemas.formSchema.find((item) => item.field == 'claimAddress')
uploadFile['componentProps']['modelValue'] = row.filePathListView
}
}
@ -503,10 +567,10 @@ const formsSuccess = async (formType, data) => {
return
}
}
if (data.lightQty == 0) {
message.error('整灯数量不能为0')
return
}
// if (data.lightQty == 0) {
// message.error('0')
// return
// }
if (!data.standardCostPrice) {
message.error('标准成本价格不能为0或空')
return

139
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 { Supplieritem } from '@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data'
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail'
import { PurchasereceiptRecordDetail } from '@/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data'
import * as PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
@ -24,12 +23,11 @@ export const Q2Rules = reactive({
itemCode: [{ required: true, message: '请选择供应商物料代码', trigger: 'change' }],
supplierCode: [{ required: true, message: '请选择供应商代码', trigger: 'change' }],
purchaseReceiptNumber: [
{ required: true, message: '请选择采购收货单号', trigger: 'change' },
// { required: true, message: '请选择采购收货单号', trigger: 'change' },
{ max: 255, message: '不得超过255个字符', trigger: 'blur' }
],
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' }],
priority: [{ 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' }]
})
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(
reactive<CrudSchema[]>([
{
@ -175,8 +290,8 @@ export const Q2 = useCrudSchemas(
searchListPlaceholder: '请选择采购收货记录单号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '采购收货记录', // 查询弹窗标题
searchAllSchemas: PurchasereceiptRecordDetail.allSchemas, // 查询弹窗所需类
searchPage: PurchasereceiptRecordDetailApi.pageForQ2, // 查询弹窗所需分页方法
searchAllSchemas: Q2result.allSchemas, // 查询弹窗所需类
searchPage: PurchasereturnRequestDetailApi.getPurchasereturnPurchasereceiptRecordByItemCode, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'supplierCode',
@ -238,8 +353,8 @@ export const Q2 = useCrudSchemas(
isMainValue: false
},
{
key: 'type',
value: 'CCP',
key: 'typeQ2',
value: 'CCP,BCP',
isMainValue: false
}
],
@ -276,7 +391,7 @@ export const Q2 = useCrudSchemas(
}
},
{
label: '整灯数量',
label: '数量',
field: 'lightQty',
sort: 'custom',
isTable: true,
@ -624,7 +739,7 @@ export const Q2 = useCrudSchemas(
tableName: 'basicInspectionQ2',
tableId: ''
},
fileType: ['doc', 'xls', 'ppt', 'txt'],
fileType: ['doc', 'xls', 'ppt', 'txt', 'pdf'],
modelValue: []
}
}
@ -759,3 +874,5 @@ export const Q2 = useCrudSchemas(
}
])
)

Loading…
Cancel
Save