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) => {
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') {
setV['SupplierCode'] = ''
setV['SupplierName'] = ''
setV['itemName'] = ''
setV['standardCostPrice'] = ''
setV['qty'] = ''
setV['lightQty'] = ''
setV['claimAmount'] = ''
setV['otherclaimAmount'] = ''
setV['summaryAmount'] = ''
setV['disbursementAmount'] = ''
setV['remainingAmount'] = ''
setV['uom'] = val[0].supplierUom
Q2Api.getEmail().then((res) => {
if (res) {
formRef.setValues({
cashierEmail: res
})
}
})
const supplieritemParams = {
by: 'ASC',
filters: [{ column: 'itemCode', action: '==', value: val[0].itemCode}],
filters: [{ column: 'itemCode', action: '==', value: val[0].itemCode }],
pageNo: 1,
pageSize: 500,
sort: ''
@ -154,6 +180,7 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
pageSize: 500,
sort: ''
}
itembasicParams.isSearch = true
ItembasicApi.getItembasicPage(itembasicParams).then((res) => {
if (res.list?.length > 0) {
@ -186,36 +213,60 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
}
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 = (
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)
basicFormRef.value.formRef.formModel.summaryAmount = (
parseFloat(basicFormRef.value.formRef.formModel.claimAmount) + parseFloat(basicFormRef.value.formRef.formModel.otherclaimAmount)
basicFormRef.value.formRef.formModel.summaryAmount = (
parseFloat(basicFormRef.value.formRef.formModel.claimAmount) +
parseFloat(basicFormRef.value.formRef.formModel.otherclaimAmount)
).toFixed(6)
}
if (field == 'otherclaimAmount') {
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)
}
if (field == 'supplierCode') {
basicFormRef.value.formRef.formModel.supplierName = ''
const paramsCustomer = {
by: 'ASC',
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
}
})
if (field == 'disbursementAmount') {
basicFormRef.value.formRef.formModel.remainingAmount = (
parseFloat(basicFormRef.value.formRef.formModel.summaryAmount) -
parseFloat(basicFormRef.value.formRef.formModel.disbursementAmount)
).toFixed(6)
}
if (field == 'supplierCode') {
basicFormRef.value.formRef.formModel.supplierName = ''
const paramsCustomer = {
by: 'ASC',
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
}
}
if (data.qty > data.wmsQty) {
if (data.lightQty > data.wmsQty) {
message.error('数量不能大于记录中的收货数量')
return
}
if (data.qty == 0) {
if (data.lightQty == 0) {
message.error('数量不能为0')
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 { 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 { 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'
const userStore = useUserStore()
// 表单校验
export const Q2Rules = reactive({
number: [required],
supplierCode: [required],
itemCode: [required],
purchaseReceiptNumber: [required],
qty: [required],
code: [required],
priority: [required],
claimAmount: [required],
costCode: [required],
claimTime: [required],
handleTime: [required],
available: [required],
concurrencyStamp: [required]
itemCode: [{ required: true, message: '请选择供应商物料代码', trigger: 'change' }],
supplierCode: [{ required: true, message: '请选择供应商代码', trigger: 'change' }],
purchaseReceiptNumber: [{ required: true, message: '请选择采购收货单号', trigger: 'change' }],
claimTime: [{ required: true, message: '请选择索赔日期', trigger: 'change' }],
lightItemCode: [{ 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' }],
claimAmount: [{ required: true, message: '请输入索赔金额', trigger: 'change' }],
costCode: [{ required: true, message: '请选择选择成本中心代码', trigger: 'change' }],
cashierEmail: [{ required: true, message: '请选择选择出纳邮件地址', trigger: 'change' }],
handleTime: [{ required: true, message: '请选择选择处理时间', trigger: 'change' }]
})
export const Q2 = useCrudSchemas(
@ -50,7 +50,7 @@ export const Q2 = useCrudSchemas(
}
},
{
label: '物料代码',
label: '供应商物料代码',
field: 'itemCode',
sort: 'custom',
table: {
@ -72,6 +72,11 @@ export const Q2 = useCrudSchemas(
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'type',
value: 'Q2',
isMainValue: false
}
],
verificationParams: [
@ -88,7 +93,7 @@ export const Q2 = useCrudSchemas(
}
},
{
label: '物料名称',
label: '供应商物料名称',
field: 'itemName',
sort: 'custom',
dictClass: 'string',
@ -97,6 +102,9 @@ export const Q2 = useCrudSchemas(
tableForm: {
disabled: true
},
table: {
width: 150
},
form: {
componentProps: {
disabled: true
@ -113,6 +121,9 @@ export const Q2 = useCrudSchemas(
tableForm: {
disabled: true
},
table: {
width: 120
},
form: {
component: 'Select',
componentProps: {
@ -132,6 +143,9 @@ export const Q2 = useCrudSchemas(
dictClass: 'string',
isSearch: false,
isTable: true,
table: {
width: 180
},
tableForm: {
disabled: true
},
@ -154,6 +168,7 @@ export const Q2 = useCrudSchemas(
componentProps: {
enterSearch: true,
disabled: true,
multiple: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择采购收货记录单号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
@ -206,64 +221,73 @@ export const Q2 = useCrudSchemas(
}
}
},
{
label: '数量',
field: 'qty',
label: '整灯物料代码',
field: 'lightItemCode',
sort: 'custom',
isTable: true,
isSearch: false,
table: {
width: 150
},
isSearch: true,
form: {
component: 'InputNumber',
// labelMessage: '信息提示说明!!!',
componentProps: {
min: 0,
precision: 2
enterSearch: true,
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: '单位',
field: 'uom',
label: '整灯物料名称',
field: 'lightItemName',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isSearch: false,
isTable: true,
tableForm: {
type: 'Select',
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '标准成本价格',
field: 'standardCostPrice',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6,
disabled: true
}
}
},
{
label: '索赔金额',
field: 'claimAmount',
label: '整灯数量',
field: 'lightQty',
sort: 'custom',
isTable: false,
isTable: true,
isSearch: false,
table: {
width: 150
@ -303,6 +327,60 @@ export const Q2 = useCrudSchemas(
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: '其他索赔描述',
field: 'otherClaimDesc',
@ -328,7 +406,7 @@ export const Q2 = useCrudSchemas(
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6,
precision: 6
}
}
},
@ -350,39 +428,35 @@ export const Q2 = useCrudSchemas(
}
},
{
label: '成本中心代码',
field: 'costCode',
label: '抛账金额',
field: 'disbursementAmount',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: true,
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
component: 'InputNumber',
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
}
] // 失去焦点校验参数
min: 0,
precision: 6
}
}
},
{
label: '剩余金额',
field: 'remainingAmount',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6,
disabled: true
}
}
},
@ -430,6 +504,57 @@ export const Q2 = useCrudSchemas(
},
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: '负责用户',
field: 'responUser',

Loading…
Cancel
Save