Browse Source

要货计划

master_hella_20240701
wangyufei 5 months ago
parent
commit
60468f06ea
  1. 3
      src/components/SearchTable/src/SearchTable.vue
  2. 50
      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>
<Dialog :title="dialogTitle" v-model="searchDialogVisible" :width="dialogWidth" >
<!-- 搜索工作栏 -->
<slot :name="'searchQuery'+formFieldRef"></slot>
<ContentWrap v-if="searchQuery">
<Search :schema="searchSchema" @search="setSearchParamsRef" @reset="setSearchParamsRef" />
</ContentWrap>
@ -217,7 +218,7 @@ const buttonBaseClick = (val, item) => {
}
defineExpose({ open,openData,hiddenFilterButton ,changeDialogWidth}) // open
defineExpose({ open,openData,hiddenFilterButton ,changeDialogWidth,searchFormClick}) // open
// Table ref
const searchTableRef = ref()

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

@ -22,9 +22,9 @@
v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
@getSelectionRows="getSelectionRows">
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
<template #supplierCode="{row}">
<el-button type="primary" link @click="openDetail(row, '供应商代码', row.supplierCode)">
<span>{{ row.supplierCode }}</span>
</el-button>
</template>
<template #action="{ row,$index }">
@ -51,7 +51,16 @@
@tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess"
@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 * as PurchaseMainApi from '@/api/wms/purchaseMain'
import { PurchaseMain } from '../purchaseMain/purchaseMain.data'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
//
defineOptions({ name: 'PurchasePlanMain' })
@ -107,6 +117,38 @@
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) => {
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}
*/
export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isForm: false,
table: {
width: 180,
fixed: 'left'
},
isSearch: true
},
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
table: {
width: 150
width: 150,
fixed: 'left'
},
isSearch: true,
sortTableDefault:1,
form: {
labelMessage: '影响明细中物料代码,需在供应商物料中维护',
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: '采购订单',
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: '时间窗口',
field: 'timeWindow',
@ -167,7 +171,9 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150
},
sortTableDefault:1001,
isTable:false,
isForm:false,
isDetail:false,
form:{
component:"TimePicker",
componentProps: {
@ -182,7 +188,9 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150
},
sortTableDefault:1002,
isTable:false,
isForm:false,
isDetail:false,
form:{
component:"TimePicker",
componentProps: {
@ -238,6 +246,7 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150
},
sortTableDefault:12,
form: {
value: '1',
componentProps: {
@ -379,6 +388,8 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
},
isTable: false,
isForm:false,
isDetail:false,
},
{
label: '操作',
@ -443,7 +454,8 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '采购订单号',
field: 'poNumber',
isSearch:true,
isTable:false,
isTable:true,
sortTableDefault:8,
isForm:false,
isTableForm:false
},
@ -454,6 +466,8 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 180
},
hiddenInMain:true,
isTableForm:false,
tableForm: {
disabled: true,
isInpuFocusShow: false,
@ -511,6 +525,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150
},
sortTableDefault:9,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
@ -560,6 +575,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150
},
sortTableDefault:3,
isSearch:true,
form: {
componentProps: {
@ -582,6 +598,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
disabled: true
}
},
sortTableDefault:9,
tableForm: {
disabled: true
}
@ -598,6 +615,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
type: 'InputNumber',
precision: 6
},
sortTableDefault:4,
form: {
component: 'InputNumber',
componentProps: {
@ -614,8 +632,29 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
},
isTableForm: 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: '计量单位',
@ -627,6 +666,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150
},
sortTableDefault:10,
tableForm: {
type: 'Select',
disabled:true,
@ -638,6 +678,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
isTableForm:false,
hiddenInMain:true,
sort: 'custom',
table: {
@ -697,6 +738,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'remark',
sort: 'custom',
hiddenInMain:true,
isTableForm:false,
table: {
width: 150
},

Loading…
Cancel
Save