Browse Source

要货计划

master_hella_20240701
wangyufei 5 months ago
parent
commit
60468f06ea
  1. 3
      src/components/SearchTable/src/SearchTable.vue
  2. 52
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue
  3. 158
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

3
src/components/SearchTable/src/SearchTable.vue

@ -1,6 +1,7 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="searchDialogVisible" :width="dialogWidth" > <Dialog :title="dialogTitle" v-model="searchDialogVisible" :width="dialogWidth" >
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<slot :name="'searchQuery'+formFieldRef"></slot>
<ContentWrap v-if="searchQuery"> <ContentWrap v-if="searchQuery">
<Search :schema="searchSchema" @search="setSearchParamsRef" @reset="setSearchParamsRef" /> <Search :schema="searchSchema" @search="setSearchParamsRef" @reset="setSearchParamsRef" />
</ContentWrap> </ContentWrap>
@ -217,7 +218,7 @@ const buttonBaseClick = (val, item) => {
} }
defineExpose({ open,openData,hiddenFilterButton ,changeDialogWidth}) // open defineExpose({ open,openData,hiddenFilterButton ,changeDialogWidth,searchFormClick}) // open
// Table ref // Table ref
const searchTableRef = ref() const searchTableRef = ref()

52
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"/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -22,9 +22,9 @@
v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
@getSelectionRows="getSelectionRows"> @getSelectionRows="getSelectionRows">
<template #number="{row}"> <template #supplierCode="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> <el-button type="primary" link @click="openDetail(row, '供应商代码', row.supplierCode)">
<span>{{ row.number }}</span> <span>{{ row.supplierCode }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row,$index }"> <template #action="{ row,$index }">
@ -51,7 +51,16 @@
@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>
<!-- 详情 --> <!-- 详情 -->
<!-- 隐藏子表编辑和删除是因为要货计划以后是接口发过来的而且我们的计划数量是放入到采购订单已计划数量里无法再次编辑数量--> <!-- 隐藏子表编辑和删除是因为要货计划以后是接口发过来的而且我们的计划数量是放入到采购订单已计划数量里无法再次编辑数量-->
@ -91,6 +100,7 @@
import supplierdeliverBasicForm from '../supplierdeliverRequestMain/supplierdeliverBasicForm.vue' import supplierdeliverBasicForm from '../supplierdeliverRequestMain/supplierdeliverBasicForm.vue'
import * as PurchaseMainApi from '@/api/wms/purchaseMain' import * as PurchaseMainApi from '@/api/wms/purchaseMain'
import { PurchaseMain } from '../purchaseMain/purchaseMain.data' import { PurchaseMain } from '../purchaseMain/purchaseMain.data'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
// //
defineOptions({ name: 'PurchasePlanMain' }) defineOptions({ name: 'PurchasePlanMain' })
@ -107,6 +117,38 @@
tableColumns.value = val tableColumns.value = val
} }
const orderTypeArray = ref(getStrDictOptions(DICT_TYPE.PURCHASE_ORDER_TYPE).map(item=>({...item,switch:true})))
const updateOrderTypeParams = ()=>{
console.log('orderTypeArray',orderTypeArray)
let orderTypeValue = []
orderTypeArray.value.forEach(item=>{
if(item.switch){
orderTypeValue.push(item.value)
}
})
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(',')
}]
})
}
}
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
console.log('searchTableSuccess', formField, searchField, val, formRef, type, row) console.log('searchTableSuccess', formField, searchField, val, formRef, type, row)

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

@ -12,25 +12,16 @@ const { t } = useI18n() // 国际化
* @returns {Array} * @returns {Array}
*/ */
export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isForm: false,
table: {
width: 180,
fixed: 'left'
},
isSearch: true
},
{ {
label: '供应商代码', label: '供应商代码',
field: 'supplierCode', field: 'supplierCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150,
fixed: 'left'
}, },
isSearch: true, isSearch: true,
sortTableDefault:1,
form: { form: {
labelMessage: '影响明细中物料代码,需在供应商物料中维护', labelMessage: '影响明细中物料代码,需在供应商物料中维护',
componentProps: { componentProps: {
@ -49,6 +40,59 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
//仅是主列表页面的筛选搜索条件
{
label: '送达日期',
field: 'deliveryDate',
sort: 'custom',
isDetail:false,
isTable: false,
isForm:false,
isTableForm:false,
isSearch:true,
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD',
type: 'daterange',
defaultTime: [new Date('1 '), new Date('1 ')]
}
},
},
{
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',
sort: 'custom',
isForm: false,
table: {
width: 180,
},
sortTableDefault:11,
isSearch: true
},
{ {
label: '采购订单', label: '采购订单',
field: 'poNumber', field: 'poNumber',
@ -110,47 +154,7 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
//仅是主列表页面的筛选搜索条件
{
label: '送达日期',
field: 'deliveryDate',
sort: 'custom',
isDetail:false,
isTable: false,
isForm:false,
isTableForm:false,
isSearch:true,
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD',
type: 'daterange',
defaultTime: [new Date('1 '), new Date('1 ')]
}
},
},
{
label: '送达日期',
field: 'deliveryDate',
table: {
width: 150
},
sortTableDefault:1000,
formatter: dateFormatter2,
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
}
},
detail: {
dateFormat: 'YYYY-MM-DD'
},
},
{ {
label: '时间窗口', label: '时间窗口',
field: 'timeWindow', field: 'timeWindow',
@ -167,7 +171,9 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
sortTableDefault:1001, isTable:false,
isForm:false,
isDetail:false,
form:{ form:{
component:"TimePicker", component:"TimePicker",
componentProps: { componentProps: {
@ -182,7 +188,9 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
sortTableDefault:1002, isTable:false,
isForm:false,
isDetail:false,
form:{ form:{
component:"TimePicker", component:"TimePicker",
componentProps: { componentProps: {
@ -238,6 +246,7 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
sortTableDefault:12,
form: { form: {
value: '1', value: '1',
componentProps: { componentProps: {
@ -379,6 +388,8 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
}, },
isTable: false, isTable: false,
isForm:false,
isDetail:false,
}, },
{ {
label: '操作', label: '操作',
@ -443,7 +454,8 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '采购订单号', label: '采购订单号',
field: 'poNumber', field: 'poNumber',
isSearch:true, isSearch:true,
isTable:false, isTable:true,
sortTableDefault:8,
isForm:false, isForm:false,
isTableForm:false isTableForm:false
}, },
@ -454,6 +466,8 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 180 width: 180
}, },
hiddenInMain:true,
isTableForm:false,
tableForm: { tableForm: {
disabled: true, disabled: true,
isInpuFocusShow: false, isInpuFocusShow: false,
@ -511,6 +525,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
sortTableDefault:9,
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
@ -560,6 +575,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
sortTableDefault:3,
isSearch:true, isSearch:true,
form: { form: {
componentProps: { componentProps: {
@ -582,6 +598,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
disabled: true disabled: true
} }
}, },
sortTableDefault:9,
tableForm: { tableForm: {
disabled: true disabled: true
} }
@ -598,6 +615,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
type: 'InputNumber', type: 'InputNumber',
precision: 6 precision: 6
}, },
sortTableDefault:4,
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: { componentProps: {
@ -614,8 +632,29 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
}, },
isTableForm: false, isTableForm: false,
isForm: false, isForm: false,
hiddenInMain:true, sortTableDefault:5,
},
{
label: '已收货数量(没有字段,需要加)',
field: 'shippedQty',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
sortTableDefault:6,
},
{
label: '在途数量(没有字段,需要加)',
field: 'shippedQty',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
sortTableDefault:7,
}, },
{ {
label: '计量单位', label: '计量单位',
@ -627,6 +666,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
sortTableDefault:10,
tableForm: { tableForm: {
type: 'Select', type: 'Select',
disabled:true, disabled:true,
@ -638,6 +678,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', dictClass: 'string',
isTable: true, isTable: true,
isTableForm:false,
hiddenInMain:true, hiddenInMain:true,
sort: 'custom', sort: 'custom',
table: { table: {
@ -697,6 +738,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'remark', field: 'remark',
sort: 'custom', sort: 'custom',
hiddenInMain:true, hiddenInMain:true,
isTableForm:false,
table: { table: {
width: 150 width: 150
}, },

Loading…
Cancel
Save