Browse Source

采购索赔申请

master
陈薪名 1 year ago
parent
commit
e9d601dfd6
  1. 3
      src/views/wms/supplierManage/purchaseclaim/purchaseclaimRequestMain/index.vue
  2. 539
      src/views/wms/supplierManage/purchaseclaim/purchaseclaimRequestMain/purchaseclaimRequestMain.data.ts

3
src/views/wms/supplierManage/purchaseclaim/purchaseclaimRequestMain/index.vue

@ -78,7 +78,8 @@ import * as PurchaseclaimRequestMainApi from '@/api/wms/purchaseclaimRequestMain
import * as PurchaseclaimRequestDetailApi from '@/api/wms/purchaseclaimRequestDetail'
import * as supplierdeliverRecordMainApi from '@/api/wms/supplierdeliverRecordMain'
import * as supplierdeliverRecordDetailApi from '@/api/wms/supplierdeliverRecordDetail'
import { PurchaseclaimRequestMain, PurchaseclaimRequestMainRules, PurchaseclaimRequestDetail, PurchaseclaimRequestDetailRules, SupplierdeliverRecordMain, SupplierdeliverRecordDetail } from '@/utils/disposition/tableColumns'
import { SupplierdeliverRecordMain, SupplierdeliverRecordDetail } from '@/utils/disposition/tableColumns'
import { PurchaseclaimRequestMain, PurchaseclaimRequestMainRules, PurchaseclaimRequestDetail, PurchaseclaimRequestDetailRules } from './purchaseclaimRequestMain.data'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue'

539
src/views/wms/supplierManage/purchaseclaim/purchaseclaimRequestMain/purchaseclaimRequestMain.data.ts

@ -0,0 +1,539 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index.ts'
const { t } = useI18n() // 国际化
// 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = {
pageSize:10,
pageNo:1,
code:'PurchaseClaimRequest'
}
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData =data?.list[0]||{}
/**
* @returns {Array}
*/
export const PurchaseclaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
isForm:false,
table: {
width: 150
}
},
{
label: '发货单号',
field: 'asnNumber',
table: {
width: 150
}
},
{
label: '要货计划单号',
field: 'ppNumber',
form:{
componentProps:{
disabled:true,
}
},
table: {
width: 150
}
},
{
label: '供应商代码',
field: 'supplierCode',
form:{
componentProps:{
disabled:true,
}
},
table: {
width: 150
}
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
form: {
value:'1',
componentProps:{
disabled:true,
}
},
table: {
width: 100
}
},
{
label: '申请时间',
field: 'requestTime',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
}
},
{
label: '截止时间',
field: 'dueTime',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
}
},
{
label: '部门',
field: 'departmentCode',
form: {
value:userDept.name,
componentProps:{
disabled:true,
}
},
table: {
width: 100
}
},
{
label: '业务类型',
field: 'businessType',
form:{
value:'PurchaseClaim',
componentProps:{
disabled:true,
}
},
table: {
width: 130
}
},
{
label: '备注',
field: 'remark',
isTable: false
},
{
label: '自动提交',
field: 'autoCommit',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 100
},
form:{
component:'Switch',
value:requestsettingData.autoCommit,
componentProps:{
disabled:true,
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '自动通过',
field: 'autoAgree',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 100
},
form:{
component:'Switch',
value:requestsettingData.autoAgree,
componentProps:{
disabled:true,
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '自动执行',
field: 'autoExecute',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 100
},
form:{
component:'Switch',
value:requestsettingData.autoExecute,
componentProps:{
disabled:true,
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '直接生成记录',
field: 'directCreateRecord',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
isTable: true,
table: {
width: 120
},
form:{
component:'Switch',
value:requestsettingData.available,
componentProps:{
disabled:true,
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '创建者',
field: 'creator',
isForm:false,
table: {
width: 120
}
},
{
label: '创建时间',
field: 'createTime',
isTable: true,
formatter: dateFormatter,
isForm:false,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
}
},
{
label: '最后更新者',
field: 'updater',
isForm:false,
table: {
width: 120
}
},
{
label: '最后更新时间',
field: 'updateTime',
isTable: true,
formatter: dateFormatter,
isForm:false,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
}
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 300
}
}
]))
// 表单校验
export const PurchaseclaimRequestMainRules = reactive({
asnNumber: [
{ required: true, message: '请输入发货单号', trigger: 'blur' }
],
ppNumber: [
{ required: true, message: '请输入要货计划单号', trigger: 'blur' }
],
supplierCode: [
{ required: true, message: '请输入供应商代码', trigger: 'change' }
],
businessType: [
{ required: true, message: '请输入业务类型', trigger: 'change' }
],
requestTime: [
{ required: true, message: '请选择申请时间', trigger: 'change' }
],
dueTime: [
{ required: true, message: '请选择截止时间', trigger: 'change' }
],
departmentCode: [
{ required: true, message: '请选择部门', trigger: 'change' }
],
status: [
{ required: true, message: '请选择状态', trigger: 'change' }
],
})
/**
* @returns {Array}
*/
export const PurchaseclaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '订单号',
field: 'poNumber',
tableForm:{
isInpuFocusShow: true
},
table: {
width: 150
},
},
{
label: '订单行',
field: 'poLine',
table: {
width: 150
},
},
{
label: '批次',
field: 'batch',
table: {
width: 150
},
},
{
label: '替代批次',
field: 'altBatch',
table: {
width: 150
},
},
{
label: '原因',
field: 'reason',
// dictType: DICT_TYPE.PURCHASE_RETURN_REASON,
dictClass: 'string',
table: {
width: 150
},
},
{
label: '单价',
field: 'singlePrice',
table: {
width: 150
},
},
{
label: '金额',
field: 'amount',
table: {
width: 150
},
},
{
label: '单据号',
field: 'number',
table: {
width: 150
},
form:{
componentProps:{
disabled:true,
}
},
isTableForm:false,
// tableForm:{
// disabled:true,
// }
},
{
label: '物品代码',
field: 'itemCode',
table: {
width: 150
},
},
{
label: '物品名称',
field: 'itemName',
table: {
width: 150
},
},
{
label: '物品描述1',
field: 'itemDesc1',
table: {
width: 150
},
},
{
label: '物品描述2',
field: 'itemDesc2',
table: {
width: 150
},
},
{
label: '项目代码',
field: 'projectCode',
table: {
width: 150
},
},
{
label: '数量',
field: 'qty',
table: {
width: 150
},
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 120
} ,
},
{
label: '备注',
field: 'remark',
table: {
width: 150
},
},
{
label: '创建者',
field: 'creator',
isTableForm:false,
table: {
width: 150
},
isForm:false
},
{
label: '创建时间',
field: 'createTime',
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
isTableForm:false,
table: {
width: 150
},
isForm:false
},
{
label: '最后更新者',
field: 'updater',
isTableForm:false,
table: {
width: 150
},
isForm:false
},
{
label: '最后更新时间',
field: 'updateTime',
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
isTableForm:false,
table: {
width: 150
},
isForm:false
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
fixed: 'right'
},
isTableForm:false,
}
]))
// 表单校验
export const PurchaseclaimRequestDetailRules = reactive({
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }
],
altBatch: [
{ required: true, message: '请输入替代批次', trigger: 'blur' }
],
poNumber: [
{ required: true, message: '请输入订单号', trigger: 'change' }
],
poLine: [
{ required: true, message: '请输入订单行', trigger: 'change' }
],
singlePrice: [
{ required: true, message: '请输入单价', trigger: 'change' }
],
amount: [
{ required: true, message: '请输入金额', trigger: 'change' }
],
number: [
{ required: true, message: '请输入单据号', trigger: 'change' }
],
itemCode: [
{ required: true, message: '请输入物品代码', trigger: 'change' }
],
projectCode: [
{ required: true, message: '请输入项目代码', trigger: 'change' }
],
qty: [
{ required: true, message: '请输入数量', trigger: 'change' }
],
uom: [
{ required: true, message: '请输入计量单位', trigger: 'change' }
],
})
Loading…
Cancel
Save