Browse Source

Q2通知单表单增加字段,并调整操作过程, HL-5385

hella_online_20240821
parent
commit
1b96671e58
  1. 5
      src/api/qms/inspectionQ2/index.ts
  2. 103
      src/views/qms/inspectionQ2/index.vue
  3. 285
      src/views/qms/inspectionQ2/inspectionQ2.data.ts

5
src/api/qms/inspectionQ2/index.ts

@ -71,3 +71,8 @@ export const importTemplate = () => {
export const finishQ2 = async (id: number) => { export const finishQ2 = async (id: number) => {
return await request.get({ url: `/qms/inspectionQ2/finish?id=` + id }) return await request.get({ url: `/qms/inspectionQ2/finish?id=` + id })
} }
// 获取系统中的email地址
export const getEmail = () => {
return request.get({ url: `/qms/inspectionQ2/getEmail`})
}

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

@ -119,18 +119,44 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
} }
}) })
} }
if (formField == 'purchaseReceiptNumber') {
console.log("wolaile",
val[0].qty
);
setV['wmsQty'] = val[0].qty
}
if (formField == 'lightItemCode') {
setV['lightItemCode'] = val[0].code
setV['lightItemName'] = val[0].name
}
if (formField == 'itemCode') { if (formField == 'itemCode') {
setV['SupplierCode'] = '' setV['SupplierCode'] = ''
setV['SupplierName'] = '' setV['SupplierName'] = ''
setV['itemName'] = '' setV['itemName'] = ''
setV['standardCostPrice'] = '' setV['standardCostPrice'] = ''
setV['qty'] = '' setV['lightQty'] = ''
setV['claimAmount'] = '' setV['claimAmount'] = ''
setV['otherclaimAmount'] = ''
setV['summaryAmount'] = ''
setV['disbursementAmount'] = ''
setV['remainingAmount'] = ''
setV['uom'] = val[0].supplierUom setV['uom'] = val[0].supplierUom
Q2Api.getEmail().then((res) => {
if (res) {
formRef.setValues({
cashierEmail: res
})
}
})
const supplieritemParams = { const supplieritemParams = {
by: 'ASC', by: 'ASC',
filters: [{ column: 'itemCode', action: '==', value: val[0].itemCode}], filters: [{ column: 'itemCode', action: '==', value: val[0].itemCode }],
pageNo: 1, pageNo: 1,
pageSize: 500, pageSize: 500,
sort: '' sort: ''
@ -154,6 +180,7 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
pageSize: 500, pageSize: 500,
sort: '' sort: ''
} }
itembasicParams.isSearch = true itembasicParams.isSearch = true
ItembasicApi.getItembasicPage(itembasicParams).then((res) => { ItembasicApi.getItembasicPage(itembasicParams).then((res) => {
if (res.list?.length > 0) { if (res.list?.length > 0) {
@ -186,36 +213,60 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
} }
const onChange = (field, e) => { const onChange = (field, e) => {
if (field == 'qty') { if (field == 'lightQty') {
basicFormRef.value.formRef.formModel.claimAmount = (
parseFloat(basicFormRef.value.formRef.formModel.lightQty) *
parseFloat(basicFormRef.value.formRef.formModel.standardCostPrice) *
parseFloat(basicFormRef.value.formRef.formModel.claimMultiple)
).toFixed(6)
basicFormRef.value.formRef.formModel.summaryAmount = (
parseFloat(basicFormRef.value.formRef.formModel.claimAmount) +
parseFloat(basicFormRef.value.formRef.formModel.otherclaimAmount)
).toFixed(6)
}
if (field == 'claimMultiple') {
basicFormRef.value.formRef.formModel.claimAmount = ( basicFormRef.value.formRef.formModel.claimAmount = (
parseFloat(basicFormRef.value.formRef.formModel.qty) * parseFloat(basicFormRef.value.formRef.formModel.standardCostPrice) parseFloat(basicFormRef.value.formRef.formModel.lightQty) *
parseFloat(basicFormRef.value.formRef.formModel.standardCostPrice) *
parseFloat(basicFormRef.value.formRef.formModel.claimMultiple)
).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.otherclaimAmount) parseFloat(basicFormRef.value.formRef.formModel.claimAmount) +
parseFloat(basicFormRef.value.formRef.formModel.otherclaimAmount)
).toFixed(6) ).toFixed(6)
} }
if (field == 'otherclaimAmount') { if (field == 'otherclaimAmount') {
basicFormRef.value.formRef.formModel.summaryAmount = ( basicFormRef.value.formRef.formModel.summaryAmount = (
parseFloat(basicFormRef.value.formRef.formModel.claimAmount) + parseFloat(basicFormRef.value.formRef.formModel.otherclaimAmount) parseFloat(basicFormRef.value.formRef.formModel.claimAmount) +
parseFloat(basicFormRef.value.formRef.formModel.otherclaimAmount)
).toFixed(6) ).toFixed(6)
} }
if (field == 'supplierCode') {
basicFormRef.value.formRef.formModel.supplierName = '' if (field == 'disbursementAmount') {
const paramsCustomer = { basicFormRef.value.formRef.formModel.remainingAmount = (
by: 'ASC', parseFloat(basicFormRef.value.formRef.formModel.summaryAmount) -
filters: [{ column: 'code', action: '==', value: basicFormRef.value.formRef.formModel.supplierCode }], parseFloat(basicFormRef.value.formRef.formModel.disbursementAmount)
pageNo: 1, ).toFixed(6)
pageSize: 500, }
sort: ''
} if (field == 'supplierCode') {
paramsCustomer.isSearch = true basicFormRef.value.formRef.formModel.supplierName = ''
SupplierApi.getSupplierPage(paramsCustomer).then((res) => { const paramsCustomer = {
if (res.list?.length > 0) { by: 'ASC',
basicFormRef.value.formRef.formModel.supplierName = res.list[0].name filters: [
} { column: 'code', action: '==', value: basicFormRef.value.formRef.formModel.supplierCode }
}) ],
pageNo: 1,
pageSize: 500,
sort: ''
} }
paramsCustomer.isSearch = true
SupplierApi.getSupplierPage(paramsCustomer).then((res) => {
if (res.list?.length > 0) {
basicFormRef.value.formRef.formModel.supplierName = res.list[0].name
}
})
}
} }
// //
@ -346,11 +397,11 @@ const formsSuccess = async (formType, data) => {
return return
} }
} }
if (data.qty > data.wmsQty) { if (data.lightQty > data.wmsQty) {
message.error('数量不能大于记录中的收货数量') message.error('数量不能大于记录中的收货数量')
return return
} }
if (data.qty == 0) { if (data.lightQty == 0) {
message.error('数量不能为0') message.error('数量不能为0')
return return
} }

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

@ -10,30 +10,30 @@ 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 SupplierApi from '@/api/wms/supplier'
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data'
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail' import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail'
import { PurchasereceiptRecordDetail } from '@/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data' import { PurchasereceiptRecordDetail } from '@/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore() const userStore = useUserStore()
// 表单校验 // 表单校验
export const Q2Rules = reactive({ export const Q2Rules = reactive({
number: [required], itemCode: [{ required: true, message: '请选择供应商物料代码', trigger: 'change' }],
supplierCode: [required], supplierCode: [{ required: true, message: '请选择供应商代码', trigger: 'change' }],
itemCode: [required], purchaseReceiptNumber: [{ required: true, message: '请选择采购收货单号', trigger: 'change' }],
purchaseReceiptNumber: [required], claimTime: [{ required: true, message: '请选择索赔日期', trigger: 'change' }],
qty: [required], lightItemCode: [{ required: true, message: '请选择整灯物料代码', trigger: 'change' }],
code: [required], lightQty: [{ required: true, message: '请选择整灯数量', trigger: 'change' }],
priority: [required], code: [{ required: true, message: '请选择缺陷代码', trigger: 'change' }],
claimAmount: [required], priority: [{ required: true, message: '请选择优先级', trigger: 'change' }],
costCode: [required], claimMultiple: [{ required: true, message: '请选择索赔倍数', trigger: 'change' }],
claimTime: [required], claimAmount: [{ required: true, message: '请输入索赔金额', trigger: 'change' }],
handleTime: [required], costCode: [{ required: true, message: '请选择选择成本中心代码', trigger: 'change' }],
available: [required], cashierEmail: [{ required: true, message: '请选择选择出纳邮件地址', trigger: 'change' }],
concurrencyStamp: [required] handleTime: [{ required: true, message: '请选择选择处理时间', trigger: 'change' }]
}) })
export const Q2 = useCrudSchemas( export const Q2 = useCrudSchemas(
@ -50,7 +50,7 @@ export const Q2 = useCrudSchemas(
} }
}, },
{ {
label: '物料代码', label: '供应商物料代码',
field: 'itemCode', field: 'itemCode',
sort: 'custom', sort: 'custom',
table: { table: {
@ -72,6 +72,11 @@ export const Q2 = useCrudSchemas(
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
},
{
key: 'type',
value: 'Q2',
isMainValue: false
} }
], ],
verificationParams: [ verificationParams: [
@ -88,7 +93,7 @@ export const Q2 = useCrudSchemas(
} }
}, },
{ {
label: '物料名称', label: '供应商物料名称',
field: 'itemName', field: 'itemName',
sort: 'custom', sort: 'custom',
dictClass: 'string', dictClass: 'string',
@ -97,6 +102,9 @@ export const Q2 = useCrudSchemas(
tableForm: { tableForm: {
disabled: true disabled: true
}, },
table: {
width: 150
},
form: { form: {
componentProps: { componentProps: {
disabled: true disabled: true
@ -113,6 +121,9 @@ export const Q2 = useCrudSchemas(
tableForm: { tableForm: {
disabled: true disabled: true
}, },
table: {
width: 120
},
form: { form: {
component: 'Select', component: 'Select',
componentProps: { componentProps: {
@ -132,6 +143,9 @@ export const Q2 = useCrudSchemas(
dictClass: 'string', dictClass: 'string',
isSearch: false, isSearch: false,
isTable: true, isTable: true,
table: {
width: 180
},
tableForm: { tableForm: {
disabled: true disabled: true
}, },
@ -154,6 +168,7 @@ export const Q2 = useCrudSchemas(
componentProps: { componentProps: {
enterSearch: true, enterSearch: true,
disabled: true, disabled: true,
multiple: true,
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择采购收货记录单号', // 输入框占位文本 searchListPlaceholder: '请选择采购收货记录单号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段 searchField: 'number', // 查询弹窗赋值字段
@ -206,64 +221,73 @@ export const Q2 = useCrudSchemas(
} }
} }
}, },
{ {
label: '数量', label: '整灯物料代码',
field: 'qty', field: 'lightItemCode',
sort: 'custom', sort: 'custom',
isTable: true,
isSearch: false,
table: { table: {
width: 150 width: 150
}, },
isSearch: true,
form: { form: {
component: 'InputNumber', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
min: 0, enterSearch: true,
precision: 2 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'type',
value: 'CCP',
isMainValue: false
}
],
verificationParams: [
{
key: 'lightItemCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
} }
} }
}, },
{ {
label: '单位', label: '整灯物料名称',
field: 'uom', field: 'lightItemName',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string', dictClass: 'string',
isSearch: false, isSearch: false,
isTable: true, isTable: true,
tableForm: {
type: 'Select',
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '标准成本价格',
field: 'standardCostPrice',
sort: 'custom',
isSearch: false,
table: { table: {
width: 150 width: 150
}, },
tableForm: {
disabled: true
},
form: { form: {
component: 'InputNumber',
componentProps: { componentProps: {
min: 0,
precision: 6,
disabled: true disabled: true
} }
} }
}, },
{ {
label: '索赔金额', label: '整灯数量',
field: 'claimAmount', field: 'lightQty',
sort: 'custom', sort: 'custom',
isTable: false, isTable: true,
isSearch: false, isSearch: false,
table: { table: {
width: 150 width: 150
@ -303,6 +327,60 @@ export const Q2 = useCrudSchemas(
type: 'Select' type: 'Select'
} }
}, },
{
label: '索赔倍数',
field: 'claimMultiple',
sort: 'custom',
dictType: DICT_TYPE.QMS_CLAIM_MULTIPLE,
dictClass: 'string',
isTable: true,
isSearch: false,
table: {
width: 100
},
tableForm: {
type: 'Select',
disabled: true
},
form: {
componentProps: {}
}
},
{
label: '标准成本价格',
field: 'standardCostPrice',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6,
disabled: true
}
}
},
{
label: '索赔金额',
field: 'claimAmount',
sort: 'custom',
isTable: false,
isSearch: false,
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
}
},
{ {
label: '其他索赔描述', label: '其他索赔描述',
field: 'otherClaimDesc', field: 'otherClaimDesc',
@ -328,7 +406,7 @@ export const Q2 = useCrudSchemas(
component: 'InputNumber', component: 'InputNumber',
componentProps: { componentProps: {
min: 0, min: 0,
precision: 6, precision: 6
} }
} }
}, },
@ -350,39 +428,35 @@ export const Q2 = useCrudSchemas(
} }
}, },
{ {
label: '成本中心代码', label: '抛账金额',
field: 'costCode', field: 'disbursementAmount',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isTable: false, table: {
isForm: true, width: 150
},
form: { form: {
// labelMessage: '信息提示说明!!!', component: 'InputNumber',
componentProps: { componentProps: {
enterSearch: true, min: 0,
isSearchList: true, // 开启查询弹窗 precision: 6
searchListPlaceholder: '请选择成本中心', // 输入框占位文本 }
searchField: 'costcentreCode', // 查询弹窗赋值字段 }
searchTitle: '成本中心信息', // 查询弹窗标题 },
searchAllSchemas: QadCostcentre.allSchemas, // 查询弹窗所需类 {
searchPage: QadCostcentreApi.getQadCostcentrePage, // 查询弹窗所需分页方法 label: '剩余金额',
searchCondition: [ field: 'remainingAmount',
{ sort: 'custom',
key: 'available', isSearch: false,
value: 'TRUE', table: {
isMainValue: false width: 150
} },
], form: {
verificationParams: [ component: 'InputNumber',
{ componentProps: {
key: 'costcentreCode', min: 0,
action: '==', precision: 6,
value: '', disabled: true
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
} }
} }
}, },
@ -430,6 +504,57 @@ export const Q2 = useCrudSchemas(
}, },
isSearch: true isSearch: true
}, },
{
label: '成本中心代码',
field: 'costCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择成本中心', // 输入框占位文本
searchField: 'costcentreCode', // 查询弹窗赋值字段
searchTitle: '成本中心信息', // 查询弹窗标题
searchAllSchemas: QadCostcentre.allSchemas, // 查询弹窗所需类
searchPage: QadCostcentreApi.getQadCostcentrePage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
verificationParams: [
{
key: 'costcentreCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
}
}
},
{
label: '出纳邮件地址',
field: 'cashierEmail',
sort: 'custom',
isSearch: false,
table: {
width: '150'
},
form: {
component: 'Input',
componentProps: {}
}
},
{ {
label: '负责用户', label: '负责用户',
field: 'responUser', field: 'responUser',

Loading…
Cancel
Save