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>
<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>
<!-- 列表头部 -->
@ -45,22 +45,14 @@
:apiUpdate="PurchasePlanMainApi.updatePurchasePlanMain"
:apiCreate="PurchasePlanMainApi.createPurchasePlanMain"
:isBusiness="true"
:isShowReduceButtonSelection="isShowButtonSelection"
:isShowButton="isShowButtonSelection"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
:isShowReduceButtonSelection="true"
@tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
@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>
@onEnter="onEnter"/>
<!-- 详情 -->
<!-- 隐藏子表编辑和删除是因为要货计划以后是接口发过来的而且我们的计划数量是放入到采购订单已计划数量里无法再次编辑数量-->
@ -117,36 +109,14 @@
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)
}
const searchQueryTableSuccess = (formField, searchField, val, formRef, type, row ) => {
console.log('searchQueryTableSuccess',formField, searchField, val, formRef, type, row )
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
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 openForm = async (type : string, row ?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
if('create'==type){
isShowButtonSelection.value = false
nextTick(async () => {
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 { PurchaseDetail, PurchaseMain } from '../purchaseMain/purchaseMain.data'
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() // 国际化
/**
@ -22,6 +24,7 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
},
isSearch: true,
sortTableDefault:1,
sortSearchDefault:1,
form: {
labelMessage: '影响明细中物料代码,需在供应商物料中维护',
componentProps: {
@ -38,6 +41,22 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
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,
isTableForm:false,
isSearch:true,
sortSearchDefault:3,
formatter: dateFormatter,
search: {
component: 'DatePicker',
@ -60,36 +80,17 @@ 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: '单据号',
label: '要货计划单号',
field: 'number',
sort: 'custom',
isForm: false,
table: {
width: 180,
},
sortTableDefault:11,
sortTableDefault:8,
sortSearchDefault:4,
isSearch: true
},
@ -112,6 +113,10 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
searchAllSchemas: PurchaseMain.allSchemas,
searchPage: PurchaseMainApi.getPurchaseMainPage,
searchCondition: [{
key: 'type',
value: 'SCHEDULE',
isMainValue: false
},{
key: 'available',
value: 'TRUE',
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: '收货人',
field: 'contacts',
@ -242,11 +282,12 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
dictClass: 'string',
isTable: true,
isForm:false,
isSearch: false,
isSearch: true,
table: {
width: 150
},
sortTableDefault:12,
sortTableDefault:13,
sortSearchDefault:6,
form: {
value: '1',
componentProps: {
@ -436,7 +477,7 @@ export const PurchasePlanMainRules = reactive({
*/
export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单号',
label: '要货计划单号',
field: 'number',
sort: 'custom',
isTableForm: false,
@ -455,9 +496,36 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'poNumber',
isSearch:true,
isTable:true,
sortTableDefault:8,
sortTableDefault:9,
sortSearchDefault:2,
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: '订单号',
@ -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: '订单行',
field: 'poLine',
@ -525,7 +613,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150
},
sortTableDefault:9,
sortTableDefault:10,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
@ -576,6 +664,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
},
sortTableDefault:3,
sortSearchDefault:5,
isSearch:true,
form: {
componentProps: {
@ -584,6 +673,29 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
},
tableForm: {
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
}
},
sortTableDefault:9,
sortTableDefault:11,
tableForm: {
disabled: true
}
},
{
label: '计划数量',
field: 'planQty',
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'InputNumber',
precision: 6
},
sortTableDefault:4,
form: {
component: 'InputNumber',
componentProps: {
precision: 6
}
}
},
{
label: '已发货数量',
field: 'shippedQty',
@ -666,7 +760,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150
},
sortTableDefault:10,
sortTableDefault:12,
tableForm: {
type: 'Select',
disabled:true,
@ -762,7 +856,7 @@ const validatePlanQty = (rule, value, callback) => {
if (numReg.test(value)&&value>0) {
callback()
} else {
callback(new Error('计划数量不能0'))
callback(new Error('计划数量不能小于0'))
}
}
//表单校验
@ -778,7 +872,8 @@ export const PurchasePlanDetailRules = reactive({
],
planQty: [
{ required: true, message: '请输入计划数量', trigger: 'blur' },
{ validator:validatePlanQty, message: '计划数量不能为0', trigger: 'blur'}
{ max: 0, message: '计划数量不能小于0', trigger: 'blur' }
// { validator:validatePlanQty, message: '计划数量不能小于0', trigger: 'blur'}
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }

Loading…
Cancel
Save