Browse Source

要货计划

master_hella_20240701
wangyufei 5 months ago
parent
commit
34930a43ad
  1. 57
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue
  2. 199
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

57
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue

@ -1,7 +1,7 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="[...PurchasePlanMain.allSchemas.searchSchema,...PurchasePlanDetail.allSchemas.searchSchema]" @search="searchList" @reset="searchList"/> <Search :schema="[...PurchasePlanMain.allSchemas.searchSchema,...PurchasePlanDetail.allSchemas.searchSchema]" @search="searchList" @reset="searchList" @searchTableSuccess="searchQueryTableSuccess"/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -45,22 +45,14 @@
:apiUpdate="PurchasePlanMainApi.updatePurchasePlanMain" :apiUpdate="PurchasePlanMainApi.updatePurchasePlanMain"
:apiCreate="PurchasePlanMainApi.createPurchasePlanMain" :apiCreate="PurchasePlanMainApi.createPurchasePlanMain"
:isBusiness="true" :isBusiness="true"
:isShowReduceButtonSelection="isShowButtonSelection"
:isShowButton="isShowButtonSelection"
@handleAddTable="handleAddTable" @handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable" @handleDeleteTable="handleDeleteTable"
:isShowReduceButtonSelection="true"
@tableSelectionDelete="tableSelectionDelete" @tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" @submitForm="submitForm"
@onEnter="onEnter"> @onEnter="onEnter"/>
<template #searchQuerypoNumber>
<div style="display:flex;flex-direction: row;">
<div v-for="dict in orderTypeArray" style="margin-right: 20px;">
<span style="margin-right: 10px;">{{dict.label}}</span>
<el-switch v-model="dict.switch" @change="updateOrderTypeParams"/>
</div>
</div>
</template>
</BasicForm>
<!-- 详情 --> <!-- 详情 -->
<!-- 隐藏子表编辑和删除是因为要货计划以后是接口发过来的而且我们的计划数量是放入到采购订单已计划数量里无法再次编辑数量--> <!-- 隐藏子表编辑和删除是因为要货计划以后是接口发过来的而且我们的计划数量是放入到采购订单已计划数量里无法再次编辑数量-->
@ -117,36 +109,14 @@
tableColumns.value = val tableColumns.value = val
} }
const orderTypeArray = ref(getStrDictOptions(DICT_TYPE.PURCHASE_ORDER_TYPE).map(item=>({...item,switch:true})))
const updateOrderTypeParams = ()=>{ const searchQueryTableSuccess = (formField, searchField, val, formRef, type, row ) => {
console.log('orderTypeArray',orderTypeArray) console.log('searchQueryTableSuccess',formField, searchField, val, formRef, type, row )
let orderTypeValue = [] nextTick(() => {
orderTypeArray.value.forEach(item=>{ const setV = {}
if(item.switch){ setV[formField] = val[0][searchField]
orderTypeValue.push(item.value) formRef.setValues(setV)
}
}) })
if(orderTypeValue.length==1){
formRef.value.searchTableRef.searchFormClick({
filters:[{
action: "==",
column: "type",
value: orderTypeValue[0]
}]
})
}else if(orderTypeValue.length==0||orderTypeValue.length==orderTypeArray.length){
formRef.value.searchTableRef.searchFormClick({
filters:[]
})
}else{
formRef.value.searchTableRef.searchFormClick({
filters:[{
action: "in",
column: "type",
value: orderTypeValue.join(',')
}]
})
}
} }
// //
@ -400,15 +370,20 @@ const getSearchTableData = async (number,formField,searchField)=>{
}) })
} }
} }
const isShowButtonSelection = ref(false)
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = async (type : string, row ?: number) => { const openForm = async (type : string, row ?: number) => {
tableData.value = [] // tableData.value = [] //
formRef.value.open(type, row) formRef.value.open(type, row)
if('create'==type){ if('create'==type){
isShowButtonSelection.value = false
nextTick(async () => { nextTick(async () => {
formRef.value.formRef.setValues({deliveryDate:dayjs().format('YYYY-MM-DD')}) formRef.value.formRef.setValues({deliveryDate:dayjs().format('YYYY-MM-DD')})
}) })
}else{
isShowButtonSelection.value = true
} }
} }
// //

199
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

@ -6,6 +6,8 @@ import * as PurchaseMainApi from '@/api/wms/purchaseMain'
import * as PurchaseDetailApi from '@/api/wms/purchaseDetail' import * as PurchaseDetailApi from '@/api/wms/purchaseDetail'
import { PurchaseDetail, PurchaseMain } from '../purchaseMain/purchaseMain.data' import { PurchaseDetail, PurchaseMain } from '../purchaseMain/purchaseMain.data'
import {getPurchaseDetailPagePoNumber} from "@/api/wms/purchaseDetail"; import {getPurchaseDetailPagePoNumber} from "@/api/wms/purchaseDetail";
import * as ItembasicApi from '@/api/wms/itembasic'
import {Itembasic} from "@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data";
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
/** /**
@ -22,6 +24,7 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
isSearch: true, isSearch: true,
sortTableDefault:1, sortTableDefault:1,
sortSearchDefault:1,
form: { form: {
labelMessage: '影响明细中物料代码,需在供应商物料中维护', labelMessage: '影响明细中物料代码,需在供应商物料中维护',
componentProps: { componentProps: {
@ -38,6 +41,22 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
isMainValue: false isMainValue: false
}] }]
} }
},
search: {
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '供应商信息', // 查询弹窗标题
searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类
searchPage: SupplierApi.getSupplierPageSCP, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
} }
}, },
//仅是主列表页面的筛选搜索条件 //仅是主列表页面的筛选搜索条件
@ -50,6 +69,7 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
isForm:false, isForm:false,
isTableForm:false, isTableForm:false,
isSearch:true, isSearch:true,
sortSearchDefault:3,
formatter: dateFormatter, formatter: dateFormatter,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
@ -60,36 +80,17 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
}, },
{ {
label: '送达日期', label: '要货计划单号',
field: 'deliveryDate',
table: {
width: 150
},
formatter: dateFormatter2,
sortTableDefault:2,
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
}
},
detail: {
dateFormat: 'YYYY-MM-DD'
},
},
{
label: '单据号',
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isForm: false, isForm: false,
table: { table: {
width: 180, width: 180,
}, },
sortTableDefault:11, sortTableDefault:8,
sortSearchDefault:4,
isSearch: true isSearch: true
}, },
@ -112,6 +113,10 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
searchAllSchemas: PurchaseMain.allSchemas, searchAllSchemas: PurchaseMain.allSchemas,
searchPage: PurchaseMainApi.getPurchaseMainPage, searchPage: PurchaseMainApi.getPurchaseMainPage,
searchCondition: [{ searchCondition: [{
key: 'type',
value: 'SCHEDULE',
isMainValue: false
},{
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
@ -128,6 +133,41 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{
label: '送达日期',
field: 'deliveryDate',
table: {
width: 150
},
formatter: dateFormatter2,
sortTableDefault:2,
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
}
},
detail: {
dateFormat: 'YYYY-MM-DD'
},
},
{
label: '采购订单类型',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.PURCHASE_ORDER_TYPE,
dictClass: 'string',
isTable: false,
isForm:true,
isSearch: true,
table: {
width: 150
},
},
{ {
label: '收货人', label: '收货人',
field: 'contacts', field: 'contacts',
@ -242,11 +282,12 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
dictClass: 'string', dictClass: 'string',
isTable: true, isTable: true,
isForm:false, isForm:false,
isSearch: false, isSearch: true,
table: { table: {
width: 150 width: 150
}, },
sortTableDefault:12, sortTableDefault:13,
sortSearchDefault:6,
form: { form: {
value: '1', value: '1',
componentProps: { componentProps: {
@ -436,7 +477,7 @@ export const PurchasePlanMainRules = reactive({
*/ */
export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '单号', label: '要货计划单号',
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isTableForm: false, isTableForm: false,
@ -455,9 +496,36 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'poNumber', field: 'poNumber',
isSearch:true, isSearch:true,
isTable:true, isTable:true,
sortTableDefault:8, sortTableDefault:9,
sortSearchDefault:2,
isForm:false, isForm:false,
isTableForm:false isTableForm:false,
search: {
// labelMessage: '信息提示说明!!!',
componentProps: {
dialogWidth:'1085px',//搜索出来弹窗的宽度
isSearchList: true,
searchListPlaceholder: '请选择采购订单',
searchField: 'number',
searchTitle: '采购订单信息',
searchAllSchemas: PurchaseMain.allSchemas,
searchPage: PurchaseMainApi.getPurchaseMainPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'supplierCode',
value: 'supplierCode',
message: '请填写供应商代码!',
isMainValue: true
},{
key: 'status',
value: 2,
isMainValue: false
}]
}
}
}, },
{ {
label: '订单号', label: '订单号',
@ -518,6 +586,26 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{
label: '计划数量',
field: 'planQty',
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'InputNumber',
precision: 6
},
sortTableDefault:4,
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
}
}
},
{ {
label: '订单行', label: '订单行',
field: 'poLine', field: 'poLine',
@ -525,7 +613,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
sortTableDefault:9, sortTableDefault:10,
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
@ -576,6 +664,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
}, },
sortTableDefault:3, sortTableDefault:3,
sortSearchDefault:5,
isSearch:true, isSearch:true,
form: { form: {
componentProps: { componentProps: {
@ -584,6 +673,29 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
}, },
tableForm: { tableForm: {
disabled: true disabled: true
},
search: {
// labelMessage: '信息提示说明!!!',
componentProps: {
multiple: true,
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'supplierCode',
value: 'supplierCode',
message: '请填写供应商代码!',
isMainValue: true,
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
} }
}, },
{ {
@ -598,31 +710,13 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
disabled: true disabled: true
} }
}, },
sortTableDefault:9, sortTableDefault:11,
tableForm: { tableForm: {
disabled: true disabled: true
} }
}, },
{
label: '计划数量',
field: 'planQty',
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'InputNumber',
precision: 6
},
sortTableDefault:4,
form: {
component: 'InputNumber',
componentProps: {
precision: 6
}
}
},
{ {
label: '已发货数量', label: '已发货数量',
field: 'shippedQty', field: 'shippedQty',
@ -666,7 +760,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
sortTableDefault:10, sortTableDefault:12,
tableForm: { tableForm: {
type: 'Select', type: 'Select',
disabled:true, disabled:true,
@ -762,7 +856,7 @@ const validatePlanQty = (rule, value, callback) => {
if (numReg.test(value)&&value>0) { if (numReg.test(value)&&value>0) {
callback() callback()
} else { } else {
callback(new Error('计划数量不能0')) callback(new Error('计划数量不能小于0'))
} }
} }
//表单校验 //表单校验
@ -778,7 +872,8 @@ export const PurchasePlanDetailRules = reactive({
], ],
planQty: [ planQty: [
{ required: true, message: '请输入计划数量', trigger: 'blur' }, { required: true, message: '请输入计划数量', trigger: 'blur' },
{ validator:validatePlanQty, message: '计划数量不能为0', trigger: 'blur'} { max: 0, message: '计划数量不能小于0', trigger: 'blur' }
// { validator:validatePlanQty, message: '计划数量不能小于0', trigger: 'blur'}
], ],
remark: [ remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } { max: 50, message: '不得超过50个字符', trigger: 'blur' }

Loading…
Cancel
Save