@ -1,13 +1,31 @@
< template >
< template >
< ContentWrap v-if ="visibleSearch" >
< ContentWrap v-if ="visibleSearch" >
<!-- 搜索工作栏 -- >
<!-- 搜索工作栏 -- >
< Search ref = "seachRef" :schema ="[...PurchasePlanMain.allSchemas.searchSchema,...PurchasePlanDetail.allSchemas.searchSchema]" :formClassNames ="['dateSearch']" @search ="searchList" @reset ="searchList" @searchTableSuccess ="searchQueryTableSuccess" @onChange ="onSearchChange" @foldUpClick ="foldUpClick" / >
< Search
ref = "seachRef"
: schema = " [
... PurchasePlanMain . allSchemas . searchSchema ,
... PurchasePlanDetail . allSchemas . searchSchema
] "
: formClassNames = "['dateSearch']"
@ search = "searchList"
@ reset = "searchList"
@ searchTableSuccess = "searchQueryTableSuccess"
@ onChange = "onSearchChange"
@ foldUpClick = "foldUpClick"
/ >
< / ContentWrap >
< / ContentWrap >
<!-- 列表头部 -- >
<!-- 列表头部 -- >
< TableHead :HeadButttondata ="HeadButttondata" @button-base-click ="buttonBaseClick" :routeName ="routeName"
< TableHead
@ updataTableColumns = "updataTableColumns" @ searchFormClick = "searchFormClick"
: HeadButttondata = "HeadButttondata"
: allSchemas = "PurchasePlanMain.allSchemas" : detailAllSchemas = "PurchasePlanDetail.allSchemas" >
@ button - base - click = "buttonBaseClick"
: routeName = "routeName"
@ updataTableColumns = "updataTableColumns"
@ searchFormClick = "searchFormClick"
: allSchemas = "PurchasePlanMain.allSchemas"
: detailAllSchemas = "PurchasePlanDetail.allSchemas"
>
< template # rightBtn_left >
< template # rightBtn_left >
< div style = "display: flex; justify-content: center; align-items: center" >
< div style = "display: flex; justify-content: center; align-items: center" >
< span style = "color: var(--el-text-color-regular)" > 计划数量包含0 < / span >
< span style = "color: var(--el-text-color-regular)" > 计划数量包含0 < / span >
@ -15,11 +33,7 @@
< / div >
< / div >
< / template >
< / template >
< template # rightBtn_right >
< template # rightBtn_right >
< el -tooltip
< el -tooltip effect = "dark" content = "查询条件" placement = "top-start" >
effect = "dark"
content = "查询条件"
placement = "top-start"
>
< el -button @click ="foldUpClick" >
< el -button @click ="foldUpClick" >
< Icon : icon = "visibleSearch ? 'ep:arrow-up' : 'ep:arrow-down'" / >
< Icon : icon = "visibleSearch ? 'ep:arrow-up' : 'ep:arrow-down'" / >
< / e l - b u t t o n >
< / e l - b u t t o n >
@ -29,7 +43,9 @@
<!-- 列表 -- >
<!-- 列表 -- >
< ContentWrap >
< ContentWrap >
< Table ref = "tableRef" v -clientTable
< Table
ref = "tableRef"
v - clientTable
: selection = "false"
: selection = "false"
: columns = "tableColumns"
: columns = "tableColumns"
: data = "tableObject.tableList"
: data = "tableObject.tableList"
@ -37,22 +53,29 @@
: pagination = " {
: pagination = " {
total : tableObject . total
total : tableObject . total
} "
} "
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 # number = "{ row }" >
< el -button type = "primary" link @ click = "openDetail(row, '供应商代码', row.number)" >
< el -button type = "primary" link @ click = "openDetail(row, '供应商代码', row.number)" >
< span > { { row . number } } < / span >
< span > { { row . number } } < / span >
< / e l - b u t t o n >
< / e l - b u t t o n >
< / template >
< / template >
< template # action = "{ row, $index }" >
< template # action = "{ row, $index }" >
< ButtonBase :Butttondata ="butttondata(row,$index)" @button-base-click ="buttonTableClick($event,row)" / >
< ButtonBase
: Butttondata = "butttondata(row, $index)"
@ button - base - click = "buttonTableClick($event, row)"
/ >
< / template >
< / template >
< / Table >
< / Table >
< / ContentWrap >
< / ContentWrap >
<!-- 表单弹窗 : 添加 / 修改 -- >
<!-- 表单弹窗 : 添加 / 修改 -- >
< BasicForm ref = "formRef" @success ="getList"
< BasicForm
ref = "formRef"
@ success = "getList"
: isOpenSearchTable = "true"
: isOpenSearchTable = "true"
fieldTableColumn = "poLine"
fieldTableColumn = "poLine"
: rules = "PurchasePlanMainRules"
: rules = "PurchasePlanMainRules"
@ -76,15 +99,27 @@
@ onBlur = "onEnter"
@ onBlur = "onEnter"
@ inputNumberChange = "inputNumberChange"
@ inputNumberChange = "inputNumberChange"
>
>
< template # TableFormHead >
< template # TableFormHead >
< div style = "border-top:1px solid #ebeef5;padding:10px 10px 0 10px ;margin-right:10px" v-if ="clickType =='create'" >
< div
style = "border-top: 1px solid #ebeef5; padding: 10px 10px 0 10px; margin-right: 10px"
v - if = "clickType == 'create'"
>
< el -form :inline ="true" :model ="tableDataSearch" >
< el -form :inline ="true" :model ="tableDataSearch" >
< el -form -item label = "筛选: 品番" >
< el -form -item label = "筛选: 品番" >
< el -input v -model = " tableDataSearch.itemCode " placeholder = "请输入品番" clearable @change ="changeTableDataSearch" / >
< el -input
v - model = "tableDataSearch.itemCode"
placeholder = "请输入品番"
clearable
@ change = "changeTableDataSearch"
/ >
< / e l - f o r m - i t e m >
< / e l - f o r m - i t e m >
< el -form -item label = "背番" >
< el -form -item label = "背番" >
< el -input v -model = " tableDataSearch.backNumber " placeholder = "请输入背番" clearable @change ="changeTableDataSearch" / >
< el -input
v - model = "tableDataSearch.backNumber"
placeholder = "请输入背番"
clearable
@ change = "changeTableDataSearch"
/ >
< / e l - f o r m - i t e m >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< / e l - f o r m >
< / div >
< / div >
@ -131,15 +166,34 @@
< / template >
< / template >
< / Detail >
< / Detail >
<!-- 导入 -- >
<!-- 导入 -- >
< ImportFormPlanCSV ref = "importFormRef" url = "/wms/purchase-plan-main/importCSV" :importTemplateData ="importTemplateData" : announcements = "announcements"
< ImportFormPlanCSV
@ success = "importSuccess" : updateIsDisable = "false" : appendIsDisable = "true" : coverIsDisable = "true" : mode = "1" : coverIsShow = "false" : appendIsShow = "false" / >
ref = "importFormRef"
url = "/wms/purchase-plan-main/importCSV"
: importTemplateData = "importTemplateData"
: announcements = "announcements"
@ success = "importSuccess"
: updateIsDisable = "false"
: appendIsDisable = "true"
: coverIsDisable = "true"
: mode = "1"
: coverIsShow = "false"
: appendIsShow = "false"
/ >
<!-- 创建供应商发货申请 -- >
<!-- 创建供应商发货申请 -- >
< supplierdeliverBasicForm ref = "supplierdeliverFormRef" @getList ="getList" > < / supplierdeliverBasicForm >
< supplierdeliverBasicForm
ref = "supplierdeliverFormRef"
@ getList = "getList"
> < / supplierdeliverBasicForm >
< / template >
< / template >
< script setup lang = "ts" >
< script setup lang = "ts" >
import download from '@/utils/download'
import download from '@/utils/download'
import { PurchasePlanMain , PurchasePlanMainRules , PurchasePlanDetail , PurchasePlanDetailRules } from './purchasePlanMain.data'
import {
PurchasePlanMain ,
PurchasePlanMainRules ,
PurchasePlanDetail ,
PurchasePlanDetailRules
} from './purchasePlanMain.data'
import * as PurchasePlanMainApi from '@/api/wms/purchasePlanMain'
import * as PurchasePlanMainApi from '@/api/wms/purchasePlanMain'
import * as PurchasePlanDetailApi from '@/api/wms/purchasePlanDetail'
import * as PurchasePlanDetailApi from '@/api/wms/purchasePlanDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -158,8 +212,11 @@ const { loadStart, loadDone } = usePageLoading()
const language = wsCache . get ( 'lang' )
const language = wsCache . get ( 'lang' )
const announcements = ref < any > ( [ ] )
const announcements = ref < any > ( [ ] )
if ( 'en-US' == language ) {
if ( 'en-US' == language ) {
announcements . value = [ "1. The total number of data items of the quantity of goods in the template does not exceed 1000 data (row × column)." , "2. All data content in the template is in text format, and formula content cannot be used as import data" , "3. The delivery date is in YYYY-MM-DD format, no hours, minutes and seconds are required" ]
announcements . value = [
'1. The total number of data items of the quantity of goods in the template does not exceed 1000 data (row × column).' ,
'2. All data content in the template is in text format, and formula content cannot be used as import data' ,
'3. The delivery date is in YYYY-MM-DD format, no hours, minutes and seconds are required'
]
} else {
} else {
/ / a n n o u n c e m e n t s . v a l u e = [ " 1 . 模 板 中 要 货 数 量 数 据 项 总 数 不 超 过 1 0 0 0 个 数 据 ( 行 × 列 ) " , " 2 . 模 板 中 全 部 数 据 内 容 格 式 为 文 本 格 式 , 不 能 使 用 公 式 内 容 作 为 导 入 数 据 " , " 3 . 要 货 日 期 为 Y Y Y Y - M M - D D 格 式 , 不 需 填 写 时 分 秒 " ]
/ / a n n o u n c e m e n t s . v a l u e = [ " 1 . 模 板 中 要 货 数 量 数 据 项 总 数 不 超 过 1 0 0 0 个 数 据 ( 行 × 列 ) " , " 2 . 模 板 中 全 部 数 据 内 容 格 式 为 文 本 格 式 , 不 能 使 用 公 式 内 容 作 为 导 入 数 据 " , " 3 . 要 货 日 期 为 Y Y Y Y - M M - D D 格 式 , 不 需 填 写 时 分 秒 " ]
}
}
@ -172,7 +229,10 @@ const { loadStart, loadDone } = usePageLoading()
const route = useRoute ( ) / / 路 由 信 息
const route = useRoute ( ) / / 路 由 信 息
const routeName = ref ( )
const routeName = ref ( )
routeName . value = route . name
routeName . value = route . name
const tableColumns = ref ( [ ... PurchasePlanMain . allSchemas . tableColumns , ... PurchasePlanDetail . allSchemas . tableMainColumns ] )
const tableColumns = ref ( [
... PurchasePlanMain . allSchemas . tableColumns ,
... PurchasePlanDetail . allSchemas . tableMainColumns
] )
/ / 字 段 设 置 更 新 主 列 表 字 段
/ / 字 段 设 置 更 新 主 列 表 字 段
const updataTableColumns = ( val ) => {
const updataTableColumns = ( val ) => {
@ -189,7 +249,7 @@ const { loadStart, loadDone } = usePageLoading()
} )
} )
} else {
} else {
seachRef . value . setFormValues ( {
seachRef . value . setFormValues ( {
status : value . filter ( item => item != '' )
status : value . filter ( ( item ) => item != '' )
} )
} )
}
}
}
}
@ -220,7 +280,7 @@ const { loadStart, loadDone } = usePageLoading()
clearTimeout ( timer )
clearTimeout ( timer )
timer = null
timer = null
}
}
} , 500 ) ;
} , 500 )
}
}
/ / 查 询 页 面 返 回
/ / 查 询 页 面 返 回
const searchTableSuccess = ( formField , searchField , val , formRef , type , row ) => {
const searchTableSuccess = ( formField , searchField , val , formRef , type , row ) => {
@ -228,8 +288,8 @@ const { loadStart, loadDone } = usePageLoading()
nextTick ( async ( ) => {
nextTick ( async ( ) => {
if ( type == 'tableForm' ) {
if ( type == 'tableForm' ) {
/ / 明 细 查 询 页 赋 值
/ / 明 细 查 询 页 赋 值
val . forEach ( item => {
val . forEach ( ( item ) => {
if ( tableData . value . find ( item1 => item1 [ 'id' ] == item [ 'id' ] ) ) return
if ( tableData . value . find ( ( item1 ) => item1 [ 'id' ] == item [ 'id' ] ) ) return
const newRow = JSON . parse ( JSON . stringify ( { ... tableFormKeys , ... row } ) )
const newRow = JSON . parse ( JSON . stringify ( { ... tableFormKeys , ... row } ) )
newRow [ formField ] = item [ searchField ]
newRow [ formField ] = item [ searchField ]
@ -246,13 +306,19 @@ const { loadStart, loadDone } = usePageLoading()
newRow [ 'available' ] = item [ 'available' ]
newRow [ 'available' ] = item [ 'available' ]
console . log ( 'tableData.value' , tableData . value )
console . log ( 'tableData.value' , tableData . value )
console . log ( 'item' , item )
console . log ( 'item' , item )
if ( ! tableData . value . find ( tableItem => tableItem [ 'itemCode' ] == item [ 'itemCode' ] && tableItem [ 'poNumber' ] == item [ 'number' ] && tableItem [ 'poLine' ] == item [ 'lineNumber' ] ) ) {
if (
! tableData . value . find (
( tableItem ) =>
tableItem [ 'itemCode' ] == item [ 'itemCode' ] &&
tableItem [ 'poNumber' ] == item [ 'number' ] &&
tableItem [ 'poLine' ] == item [ 'lineNumber' ]
)
) {
tableData . value . push ( newRow )
tableData . value . push ( newRow )
}
}
} else {
} else {
tableData . value . push ( newRow )
tableData . value . push ( newRow )
}
}
} )
} )
} else {
} else {
const setV = { }
const setV = { }
@ -261,9 +327,9 @@ const { loadStart, loadDone } = usePageLoading()
setV [ 'poNumber' ] = val [ 0 ] [ 'number' ]
setV [ 'poNumber' ] = val [ 0 ] [ 'number' ]
setV [ 'poLine' ] = val [ 0 ] [ 'lineNumber' ]
setV [ 'poLine' ] = val [ 0 ] [ 'lineNumber' ]
setV [ 'receivedNumber' ] = val [ 0 ] [ 'receivedNumber' ]
setV [ 'receivedNumber' ] = val [ 0 ] [ 'receivedNumber' ]
console . log ( PurchasePlanDetail . allSchemas . tableFormColumns ) ;
console . log ( PurchasePlanDetail . allSchemas . tableFormColumns )
PurchasePlanDetail . allSchemas . tableFormColumns . forEach ( item => {
PurchasePlanDetail . allSchemas . tableFormColumns . forEach ( ( item ) => {
if ( item . value == '' ) {
if ( item . value == '' ) {
if ( item . field == 'receivedNumber' ) {
if ( item . field == 'receivedNumber' ) {
item . tableForm . placeholder = ''
item . tableForm . placeholder = ''
@ -308,8 +374,10 @@ const { loadStart, loadDone } = usePageLoading()
/ / 新 增 - - 采 购 订 单 - -
/ / 新 增 - - 采 购 订 单 - -
/ / 请 求 明 细 数 据
/ / 请 求 明 细 数 据
await getSearchTableData ( val [ 0 ] [ 'number' ] , formField , searchField )
await getSearchTableData ( val [ 0 ] [ 'number' ] , formField , searchField )
await PurchasePlanMainApi . queryPurchasePlan ( formRef . formModel . supplierCode , tableData . value [ 0 ] [ 'itemCode' ] ) . then ( res => {
await PurchasePlanMainApi . queryPurchasePlan (
formRef . formModel . supplierCode ,
tableData . value [ 0 ] [ 'itemCode' ]
) . then ( ( res ) => {
/ / l e t b e g i n T i m e = r e s . b e g i n T i m e
/ / l e t b e g i n T i m e = r e s . b e g i n T i m e
/ / v a r m s = b e g i n T i m e . s u b s t r i n g ( 0 , 2 )
/ / v a r m s = b e g i n T i m e . s u b s t r i n g ( 0 , 2 )
/ / v a r m e = b e g i n T i m e . s u b s t r i n g ( 3 )
/ / v a r m e = b e g i n T i m e . s u b s t r i n g ( 3 )
@ -343,7 +411,7 @@ const getSearchTableData = async (number,formField,searchField)=>{
item . width = item . table ? . width || 150
item . width = item . table ? . width || 150
} )
} )
tableData . value = [ ]
tableData . value = [ ]
tableObject . tableList . forEach ( row => {
tableObject . tableList . forEach ( ( row ) => {
const newRow = JSON . parse ( JSON . stringify ( { ... tableFormKeys , ... row } ) )
const newRow = JSON . parse ( JSON . stringify ( { ... tableFormKeys , ... row } ) )
/ / 明 细 查 询 页 赋 值
/ / 明 细 查 询 页 赋 值
newRow [ formField ] = row [ searchField ]
newRow [ formField ] = row [ searchField ]
@ -362,7 +430,6 @@ const getSearchTableData = async (number,formField,searchField)=>{
} )
} )
/ / 清 空 筛 选 条 件
/ / 清 空 筛 选 条 件
initTableDataSearch ( )
initTableDataSearch ( )
}
}
/ / 查 询 页 面 返 回 — — 详 情
/ / 查 询 页 面 返 回 — — 详 情
const searchTableSuccessDetail = ( formField , searchField , val , formRef , formModel ) => {
const searchTableSuccessDetail = ( formField , searchField , val , formRef , formModel ) => {
@ -433,7 +500,7 @@ const getSearchTableData = async (number,formField,searchField)=>{
/ / d e f a u l t B u t t o n s . m a i n L i s t S e l e c t i o n O r d e r P u b B t n ( n u l l ) , / / 批 量 发 布
/ / d e f a u l t B u t t o n s . m a i n L i s t S e l e c t i o n O r d e r P u b B t n ( n u l l ) , / / 批 量 发 布
defaultButtons . defaultFreshBtn ( null ) , / / 刷 新
defaultButtons . defaultFreshBtn ( null ) , / / 刷 新
defaultButtons . defaultFilterBtn ( null ) , / / 筛 选
defaultButtons . defaultFilterBtn ( null ) , / / 筛 选
defaultButtons . defaultSetBtn ( null ) , / / 设 置
defaultButtons . defaultSetBtn ( null ) / / 设 置
/ / {
/ / {
/ / l a b e l : ' 自 定 义 扩 展 按 钮 ' ,
/ / l a b e l : ' 自 定 义 扩 展 按 钮 ' ,
@ -447,17 +514,23 @@ const getSearchTableData = async (number,formField,searchField)=>{
/ / 头 部 按 钮 事 件
/ / 头 部 按 钮 事 件
const buttonBaseClick = ( val , item ) => {
const buttonBaseClick = ( val , item ) => {
if ( val == 'add' ) { / / 新 增
if ( val == 'add' ) {
/ / 新 增
openForm ( 'create' )
openForm ( 'create' )
} else if ( val == 'import' ) { / / 导 入
} else if ( val == 'import' ) {
/ / 导 入
handleImport ( )
handleImport ( )
} else if ( val == 'export' ) { / / 导 出
} else if ( val == 'export' ) {
/ / 导 出
handleExport ( )
handleExport ( )
} else if ( val == 'export-details' ) { / / 导 出 明 细
} else if ( val == 'export-details' ) {
/ / 导 出 明 细
handleExportDetails ( )
handleExportDetails ( )
} else if ( val == 'export-table' ) { / / 导 出 二 维 表
} else if ( val == 'export-table' ) {
/ / 导 出 二 维 表
handleExportTable ( )
handleExportTable ( )
} else if ( val == 'refresh' ) { / / 刷 新
} else if ( val == 'refresh' ) {
/ / 刷 新
if ( tableObject . params . filters && tableObject . params . filters . length > 0 ) {
if ( tableObject . params . filters && tableObject . params . filters . length > 0 ) {
searchFormClick ( {
searchFormClick ( {
filters : tableObject . params . filters
filters : tableObject . params . filters
@ -465,11 +538,14 @@ const getSearchTableData = async (number,formField,searchField)=>{
} else {
} else {
getList ( )
getList ( )
}
}
} else if ( val == 'mainOrderSelectionPub' ) { / / 批 量 发 布
} else if ( val == 'mainOrderSelectionPub' ) {
/ / 批 量 发 布
handleSelectionPublish ( )
handleSelectionPublish ( )
} else if ( val == 'filtrate' ) { / / 筛 选
} else if ( val == 'filtrate' ) {
/ / 筛 选
console . log ( '筛选' , tableObject )
console . log ( '筛选' , tableObject )
} else { / / 其 他 按 钮
} else {
/ / 其 他 按 钮
console . log ( '其他按钮' , item )
console . log ( '其他按钮' , item )
}
}
}
}
@ -496,19 +572,42 @@ const isShowMainButton1 = (row, val) => {
/ / 列 表 - 操 作 按 钮
/ / 列 表 - 操 作 按 钮
const butttondata = ( row , $index ) => {
const butttondata = ( row , $index ) => {
const findIndex = row [ 'masterId' ] ? tableObject . tableList . findIndex ( item => item [ 'masterId' ] == row [ 'masterId' ] ) : - 1
const findIndex = row [ 'masterId' ]
? tableObject . tableList . findIndex ( ( item ) => item [ 'masterId' ] == row [ 'masterId' ] )
: - 1
if ( findIndex > - 1 && findIndex < $index ) {
if ( findIndex > - 1 && findIndex < $index ) {
return [ ]
return [ ]
}
}
return [
return [
/ / d e f a u l t B u t t o n s . m a i n L i s t P u r c h a s e P l a n O p e B t n ( { h i d e : i s S h o w M a i n B u t t o n ( r o w , [ ' 2 ' ] ) } ) , / / 打 开
/ / d e f a u l t B u t t o n s . m a i n L i s t P u r c h a s e P l a n O p e B t n ( { h i d e : i s S h o w M a i n B u t t o n ( r o w , [ ' 2 ' ] ) } ) , / / 打 开
defaultButtons . mainListPurchasePlanCloBtn ( { hide : ! ( row . isClose != 1 && row . status != 6 && row . status != 2 && row . type == 'SCHEDULE' ) , hasPermi : 'wms:purchase-plan-main:close' } ) , / / 关 闭
defaultButtons . mainListPurchasePlanCloBtn ( {
defaultButtons . mainListPurchasePlanPubBtn ( { hide : isShowMainButton ( row , [ '1' ] ) , hasPermi : 'wms:purchase-plan-main:publish' } ) , / / 发 布
hide : ! ( row . isClose != 1 && row . status != 6 && row . status != 2 && row . type == 'SCHEDULE' ) ,
defaultButtons . mainListPurchasePlanAccBtn ( { hide : isShowMainButton ( row , [ '3' ] ) , hasPermi : 'wms:purchase-plan-main:accept' } ) , / / 接 受
hasPermi : 'wms:purchase-plan-main:close'
defaultButtons . mainListPurchasePlanRejBtn ( { hide : isShowMainButton ( row , [ '3' ] ) , hasPermi : 'wms:purchase-plan-main:noaccept' } ) , / / 不 接 受
} ) , / / 关 闭
defaultButtons . mainListPurchasePlanWitBtn ( { hide : isShowMainButton ( row , [ '3' ] ) , hasPermi : 'wms:purchase-plan-main:unpublish' } ) , / / 下 架
defaultButtons . mainListPurchasePlanPubBtn ( {
defaultButtons . mainListPurchasePlanModBtn ( { hide : isShowMainButton ( row , [ '5' ] ) , hasPermi : 'wms:purchase-plan-main:update' } ) , / / 修 改
hide : isShowMainButton ( row , [ '1' ] ) ,
defaultButtons . mainListEditBtn ( { hide : isShowMainButton1 ( row , [ '1' , '3' , '5' ] ) , hasPermi : 'wms:purchase-plan-main:edit' } ) , / / 编 辑
hasPermi : 'wms:purchase-plan-main:publish'
} ) , / / 发 布
defaultButtons . mainListPurchasePlanAccBtn ( {
hide : isShowMainButton ( row , [ '3' ] ) ,
hasPermi : 'wms:purchase-plan-main:accept'
} ) , / / 接 受
defaultButtons . mainListPurchasePlanRejBtn ( {
hide : isShowMainButton ( row , [ '3' ] ) ,
hasPermi : 'wms:purchase-plan-main:noaccept'
} ) , / / 不 接 受
defaultButtons . mainListPurchasePlanWitBtn ( {
hide : isShowMainButton ( row , [ '3' ] ) ,
hasPermi : 'wms:purchase-plan-main:unpublish'
} ) , / / 下 架
defaultButtons . mainListPurchasePlanModBtn ( {
hide : isShowMainButton ( row , [ '5' ] ) ,
hasPermi : 'wms:purchase-plan-main:update'
} ) , / / 修 改
defaultButtons . mainListEditBtn ( {
hide : isShowMainButton1 ( row , [ '1' , '3' , '5' ] ) ,
hasPermi : 'wms:purchase-plan-main:edit'
} ) , / / 编 辑
/ / d e f a u l t B u t t o n s . m a i n L i s t D e l e t e B t n ( { h i d e : i s S h o w M a i n B u t t o n ( r o w , [ ' 1 ' ] ) , h a s P e r m i : ' w m s : p u r c h a s e - p l a n - m a i n : d e l e t e ' } ) , / / 删 除
/ / d e f a u l t B u t t o n s . m a i n L i s t D e l e t e B t n ( { h i d e : i s S h o w M a i n B u t t o n ( r o w , [ ' 1 ' ] ) , h a s P e r m i : ' w m s : p u r c h a s e - p l a n - m a i n : d e l e t e ' } ) , / / 删 除
{
{
label : t ( 'ts.创建发货申请' ) ,
label : t ( 'ts.创建发货申请' ) ,
@ -526,25 +625,35 @@ const isShowMainButton1 = (row, val) => {
/ / 列 表 - 操 作 按 钮 事 件
/ / 列 表 - 操 作 按 钮 事 件
const buttonTableClick = async ( val , row ) => {
const buttonTableClick = async ( val , row ) => {
if ( val == 'mainPurPlanOpe' ) { / / 打 开
if ( val == 'mainPurPlanOpe' ) {
/ / 打 开
handleOpen ( row . masterId )
handleOpen ( row . masterId )
} else if ( val == 'mainPurPlanClo' ) { / / 关 闭
} else if ( val == 'mainPurPlanClo' ) {
/ / 关 闭
handleClose ( row . masterId )
handleClose ( row . masterId )
} else if ( val == 'mainPurPlanPub' ) { / / 发 布
} else if ( val == 'mainPurPlanPub' ) {
/ / 发 布
handlePublish ( row . masterId )
handlePublish ( row . masterId )
} else if ( val == 'mainPurPlanAcc' ) { / / 接 受
} else if ( val == 'mainPurPlanAcc' ) {
/ / 接 受
handleAcc ( row . masterId )
handleAcc ( row . masterId )
} else if ( val == 'mainPurPlanRej' ) { / / 不 接 受
} else if ( val == 'mainPurPlanRej' ) {
/ / 不 接 受
handleRej ( row . masterId )
handleRej ( row . masterId )
} else if ( val == 'mainPurPlanWit' ) { / / 下 架
} else if ( val == 'mainPurPlanWit' ) {
/ / 下 架
handleWit ( row . masterId )
handleWit ( row . masterId )
} else if ( val == 'mainPurPlanMod' ) { / / 修 改
} else if ( val == 'mainPurPlanMod' ) {
/ / 修 改
handleReOpen ( row . masterId )
handleReOpen ( row . masterId )
} else if ( val == 'edit' ) { / / 编 辑
} else if ( val == 'edit' ) {
/ / 编 辑
openForm ( 'update' , row )
openForm ( 'update' , row )
} else if ( val == 'delete' ) { / / 删 除
} else if ( val == 'delete' ) {
/ / 删 除
handleDelete ( row . masterId )
handleDelete ( row . masterId )
} else if ( val == 'supplierdeliver' ) { / / 创 建 供 应 商 发 货 申 请
} else if ( val == 'supplierdeliver' ) {
/ / 创 建 供 应 商 发 货 申 请
supplierdeliverFormRef . value . openFormByCreate ( {
supplierdeliverFormRef . value . openFormByCreate ( {
number : row . number , / / 要 货 单 号
number : row . number , / / 要 货 单 号
deliNo : row . deliNo , / / 便 次
deliNo : row . deliNo , / / 便 次
@ -566,7 +675,10 @@ const openForm = async (type : string, row ?: number) => {
formRef . value . open ( type , row )
formRef . value . open ( type , row )
if ( 'create' == type ) {
if ( 'create' == type ) {
nextTick ( async ( ) => {
nextTick ( async ( ) => {
formRef . value . formRef . setValues ( { deliveryDate : dayjs ( ) . valueOf ( ) , schdShipDate : dayjs ( ) . valueOf ( ) } )
formRef . value . formRef . setValues ( {
deliveryDate : dayjs ( ) . valueOf ( ) ,
schdShipDate : dayjs ( ) . valueOf ( )
} )
} )
} )
PurchasePlanMain . allSchemas . formSchema . forEach ( ( item ) => {
PurchasePlanMain . allSchemas . formSchema . forEach ( ( item ) => {
/ / 供 应 商 代 码
/ / 供 应 商 代 码
@ -608,15 +720,16 @@ const detailData = ref({})
const openDetail = ( row : any , titleName : any , titleValue : any ) => {
const openDetail = ( row : any , titleName : any , titleValue : any ) => {
detailData . value = row
detailData . value = row
detailRef . value . openDetail ( row , titleName , titleValue , 'planPurchaseMain' )
detailRef . value . openDetail ( row , titleName , titleValue , 'planPurchaseMain' )
const departmentCode = wsCache . get ( CACHE_KEY . DEPT ) . find ( ( account ) => account . id == row . departmentCode ) ? . name
const departmentCode = wsCache
. get ( CACHE_KEY . DEPT )
. find ( ( account ) => account . id == row . departmentCode ) ? . name
if ( departmentCode ) row . departmentCode = JSON . parse ( JSON . stringify ( departmentCode ) )
if ( departmentCode ) row . departmentCode = JSON . parse ( JSON . stringify ( departmentCode ) )
}
}
const detailOpenForm = ( type , row ) => {
const detailOpenForm = ( type , row ) => {
PurchasePlanDetail . allSchemas . formSchema . forEach ( ( item ) => {
PurchasePlanDetail . allSchemas . formSchema . forEach ( item => {
if ( item . field == 'planQty' ) {
if ( item . field == 'planQty' ) {
/ / 计 划 数 量
/ / 计 划 数 量
item . componentProps . disabled = row . available == "FALSE"
item . componentProps . disabled = row . available == 'FALSE'
}
}
} )
} )
}
}
@ -643,7 +756,8 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
tableObject . loading = false
tableObject . loading = false
/ / 刷 新 列 表
/ / 刷 新 列 表
await getList ( )
await getList ( )
} catch { } finally {
} catch {
} finally {
tableObject . loading = false
tableObject . loading = false
}
}
}
}
@ -659,7 +773,8 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
tableObject . loading = false
tableObject . loading = false
/ / 刷 新 列 表
/ / 刷 新 列 表
await getList ( )
await getList ( )
} catch { } finally {
} catch {
} finally {
tableObject . loading = false
tableObject . loading = false
}
}
}
}
@ -676,12 +791,12 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
tableObject . loading = false
tableObject . loading = false
/ / 刷 新 列 表
/ / 刷 新 列 表
await getList ( )
await getList ( )
} catch { } finally {
} catch {
} finally {
tableObject . loading = false
tableObject . loading = false
}
}
}
}
/** 打开按钮操作 */
/** 打开按钮操作 */
const handleReOpen = async ( id : number ) => {
const handleReOpen = async ( id : number ) => {
try {
try {
@ -694,7 +809,8 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
tableObject . loading = false
tableObject . loading = false
/ / 刷 新 列 表
/ / 刷 新 列 表
await getList ( )
await getList ( )
} catch { } finally {
} catch {
} finally {
tableObject . loading = false
tableObject . loading = false
}
}
}
}
@ -703,12 +819,17 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
const zeroChange = ( ) => {
const zeroChange = ( ) => {
/ / i s Z e r o . v a l u e
/ / i s Z e r o . v a l u e
if ( tableObject . params . isSearch ) {
if ( tableObject . params . isSearch ) {
tableObject . params . filters = tableObject . params . filters . filter ( item => item . column != 'isZero' )
tableObject . params . filters = tableObject . params . filters . filter (
tableObject . params . filters = [ ... tableObject . params . filters , {
( item ) => item . column != 'isZero'
action : "==" ,
)
column : "isZero" ,
tableObject . params . filters = [
... tableObject . params . filters ,
{
action : '==' ,
column : 'isZero' ,
value : isZero . value ? 0 : 1
value : isZero . value ? 0 : 1
} ]
}
]
} else {
} else {
tableObject . params . isZero = isZero . value ? 0 : 1
tableObject . params . isZero = isZero . value ? 0 : 1
}
}
@ -724,8 +845,8 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
const selectionRows = ref < any > ( [ ] )
const selectionRows = ref < any > ( [ ] )
const tableRef = ref ( )
const tableRef = ref ( )
const getSelectionRows = ( currentPage , currentPageSelectionRows ) => {
const getSelectionRows = ( currentPage , currentPageSelectionRows ) => {
console . log ( "getSelectionRows" , currentPage , currentPageSelectionRows )
console . log ( 'getSelectionRows' , currentPage , currentPageSelectionRows )
const currentRows = selectionRows . value . find ( item => item . currentPage == currentPage )
const currentRows = selectionRows . value . find ( ( item ) => item . currentPage == currentPage )
if ( currentRows ) {
if ( currentRows ) {
currentRows . selectionRows = currentPageSelectionRows
currentRows . selectionRows = currentPageSelectionRows
} else {
} else {
@ -741,16 +862,18 @@ const handleSelectionPublish = async ()=>{
await message . confirm ( t ( 'ts.是否发布所选中数据?' ) )
await message . confirm ( t ( 'ts.是否发布所选中数据?' ) )
tableObject . loading = true
tableObject . loading = true
let rows : any = [ ]
let rows : any = [ ]
selectionRows . value . map ( item => {
selectionRows . value . map ( ( item ) => {
rows = [ ... rows , ... item . selectionRows . map ( item1 => item1 . masterId ) ]
rows = [ ... rows , ... item . selectionRows . map ( ( item1 ) => item1 . masterId ) ]
} )
} )
tableObject . loading = true
tableObject . loading = true
Promise . all ( rows . map ( item => PurchasePlanMainApi . publishPurchasePlanMain ( item ) ) ) . then ( ( res ) => {
Promise . all ( rows . map ( ( item ) => PurchasePlanMainApi . publishPurchasePlanMain ( item ) ) )
. then ( ( res ) => {
console . log ( '发布' , res )
console . log ( '发布' , res )
if ( res . every ( item => item == true ) ) {
if ( res . every ( ( item ) => item == true ) ) {
message . success ( t ( 'ts.发布成功!' ) )
message . success ( t ( 'ts.发布成功!' ) )
}
}
} ) . finally ( ( ) => {
} )
. finally ( ( ) => {
tableObject . loading = false
tableObject . loading = false
/ / 刷 新 列 表
/ / 刷 新 列 表
getList ( )
getList ( )
@ -759,16 +882,24 @@ const handleSelectionPublish = async ()=>{
/** 发布按钮操作 */
/** 发布按钮操作 */
const handlePublish = async ( id : number ) => {
const handlePublish = async ( id : number ) => {
try {
try {
tableObject . loading = true
/ / 验 证 打 切 品 番 配 置
const res = await PurchasePlanMainApi . validation ( id )
if ( res ) {
await message . confirm ( t ( '要货数量超过打切数量,是否确认发布?' ) )
} else {
/ / 发 布 的 二 次 确 认
/ / 发 布 的 二 次 确 认
await message . confirm ( t ( 'ts.是否发布所选中数据?' ) )
await message . confirm ( t ( 'ts.是否发布所选中数据?' ) )
tableObject . loading = true
}
/ / 发 起 发 布
/ / 发 起 发 布
await PurchasePlanMainApi . publishPurchasePlanMain ( id )
await PurchasePlanMainApi . publishPurchasePlanMain ( id )
message . success ( t ( 'ts.发布成功!' ) )
message . success ( t ( 'ts.发布成功!' ) )
tableObject . loading = false
tableObject . loading = false
/ / 刷 新 列 表
/ / 刷 新 列 表
await getList ( )
await getList ( )
} catch { } finally {
} catch {
} finally {
tableObject . loading = false
tableObject . loading = false
}
}
}
}
@ -785,7 +916,8 @@ const handleSelectionPublish = async ()=>{
tableObject . loading = false
tableObject . loading = false
/ / 刷 新 列 表
/ / 刷 新 列 表
await getList ( )
await getList ( )
} catch { } finally {
} catch {
} finally {
tableObject . loading = false
tableObject . loading = false
}
}
}
}
@ -802,7 +934,8 @@ const handleSelectionPublish = async ()=>{
tableObject . loading = false
tableObject . loading = false
/ / 刷 新 列 表
/ / 刷 新 列 表
await getList ( )
await getList ( )
} catch { } finally {
} catch {
} finally {
tableObject . loading = false
tableObject . loading = false
}
}
}
}
@ -819,7 +952,8 @@ const handleSelectionPublish = async ()=>{
tableObject . loading = false
tableObject . loading = false
/ / 刷 新 列 表
/ / 刷 新 列 表
await getList ( )
await getList ( )
} catch { } finally {
} catch {
} finally {
tableObject . loading = false
tableObject . loading = false
}
}
}
}
@ -874,7 +1008,7 @@ const handleSelectionPublish = async ()=>{
* tableForm方法
* tableForm方法
* /
* /
const tableFormKeys = { }
const tableFormKeys = { }
PurchasePlanDetail . allSchemas . tableFormColumns . forEach ( item => {
PurchasePlanDetail . allSchemas . tableFormColumns . forEach ( ( item ) => {
tableFormKeys [ item . field ] = item . default ? item . default : ''
tableFormKeys [ item . field ] = item . default ? item . default : ''
} )
} )
const tableData = ref ( [ ] )
const tableData = ref ( [ ] )
@ -904,18 +1038,18 @@ const handleSelectionPublish = async ()=>{
debugger
debugger
let filterList = tableData . value
let filterList = tableData . value
if ( tableDataSearch . value [ 'itemCode' ] ) {
if ( tableDataSearch . value [ 'itemCode' ] ) {
filterList = tableData . value . filter ( item => {
filterList = tableData . value . filter ( ( item ) => {
return item [ 'itemCode' ] . includes ( tableDataSearch . value [ 'itemCode' ] )
return item [ 'itemCode' ] . includes ( tableDataSearch . value [ 'itemCode' ] )
} )
} )
}
}
if ( tableDataSearch . value [ 'backNumber' ] ) {
if ( tableDataSearch . value [ 'backNumber' ] ) {
filterList = filterList . filter ( item => {
filterList = filterList . filter ( ( item ) => {
/ / r e t u r n i t e m [ ' b a c k N u m b e r ' ] . i n c l u d e s ( t a b l e D a t a S e a r c h . v a l u e [ ' b a c k N u m b e r ' ] )
/ / r e t u r n i t e m [ ' b a c k N u m b e r ' ] . i n c l u d e s ( t a b l e D a t a S e a r c h . v a l u e [ ' b a c k N u m b e r ' ] )
/ / 如 果 b a c k N u m b e r 为 空 ( n u l l / u n d e f i n e d / ' ' ) , 直 接 过 滤 掉
/ / 如 果 b a c k N u m b e r 为 空 ( n u l l / u n d e f i n e d / ' ' ) , 直 接 过 滤 掉
if ( ! item [ 'backNumber' ] ) return false ;
if ( ! item [ 'backNumber' ] ) return false
/ / 否 则 检 查 是 否 包 含 搜 索 值
/ / 否 则 检 查 是 否 包 含 搜 索 值
return item [ 'backNumber' ] . includes ( tableDataSearch . value [ 'backNumber' ] ) ;
return item [ 'backNumber' ] . includes ( tableDataSearch . value [ 'backNumber' ] )
} )
} )
}
}
showTableData . value = filterList
showTableData . value = filterList
@ -933,30 +1067,42 @@ const handleSelectionPublish = async ()=>{
}
}
}
}
const tableSelectionDelete = ( selection ) => {
const tableSelectionDelete = ( selection ) => {
tableData . value = tableData . value . filter ( item => ! selection . includes ( item ) )
tableData . value = tableData . value . filter ( ( item ) => ! selection . includes ( item ) )
}
}
const onEnter = async ( field , value ) => {
const onEnter = async ( field , value ) => {
console . log ( field , value )
console . log ( field , value )
if ( 'supplierCode' == field ) {
if ( 'supplierCode' == field ) {
/ / 供 应 商 代 码
/ / 供 应 商 代 码
formRef . value . opensearchTable ( 'poNumber' , 'number' , '采购订单信息' , PurchaseMain . allSchemas , PurchaseMainApi . getPurchaseMainPage , [ {
formRef . value . opensearchTable (
'poNumber' ,
'number' ,
'采购订单信息' ,
PurchaseMain . allSchemas ,
PurchaseMainApi . getPurchaseMainPage ,
[
{
key : 'type' ,
key : 'type' ,
value : 'SCHEDULE' ,
value : 'SCHEDULE' ,
isMainValue : false
isMainValue : false
} , {
} ,
{
key : 'available' ,
key : 'available' ,
value : 'TRUE' ,
value : 'TRUE' ,
isMainValue : false
isMainValue : false
} , {
} ,
{
key : 'supplierCode' ,
key : 'supplierCode' ,
value : 'supplierCode' ,
value : 'supplierCode' ,
message : '请填写供应商代码!' ,
message : '请填写供应商代码!' ,
isMainValue : true
isMainValue : true
} , {
} ,
{
key : 'status' ,
key : 'status' ,
value : 2 ,
value : 2 ,
isMainValue : false
isMainValue : false
} ] )
}
]
)
/ / 修 改 弹 窗 宽 度
/ / 修 改 弹 窗 宽 度
formRef . value . changeDialogWidth ( '1085px' )
formRef . value . changeDialogWidth ( '1085px' )
}
}
@ -994,7 +1140,7 @@ const handleSelectionPublish = async ()=>{
}
}
if ( flag ) {
if ( flag ) {
formRef . value . formLoading = false
formRef . value . formLoading = false
return ;
return
}
}
try {
try {
if ( formType === 'create' ) {
if ( formType === 'create' ) {
@ -1061,14 +1207,17 @@ const handleSelectionPublish = async ()=>{
/ / 筛 选 提 交
/ / 筛 选 提 交
const searchFormClick = ( searchData ) => {
const searchFormClick = ( searchData ) => {
searchData . filters = searchData . filters . filter ( item => item . column != 'isZero' )
searchData . filters = searchData . filters . filter ( ( item ) => item . column != 'isZero' )
tableObject . params = {
tableObject . params = {
isSearch : true ,
isSearch : true ,
filters : [ ... searchData . filters , {
filters : [
action : "==" ,
... searchData . filters ,
column : "isZero" ,
{
action : '==' ,
column : 'isZero' ,
value : isZero . value ? 0 : 1
value : isZero . value ? 0 : 1
} ]
}
]
}
}
getList ( ) / / 刷 新 当 前 列 表
getList ( ) / / 刷 新 当 前 列 表
}
}
@ -1092,7 +1241,9 @@ const inputNumberChange = (field, index, row, val) => {
}
}
const detailBasicFormOnChange = ( field , val ) => {
const detailBasicFormOnChange = ( field , val ) => {
if ( field == 'boxQty' ) {
if ( field == 'boxQty' ) {
detailRef . value . formRef . formRef . formModel . planQty = detailRef . value . formRef . formRef . formModel . boxQty * detailRef . value . formRef . formRef . formModel . purchaseStdQty
detailRef . value . formRef . formRef . formModel . planQty =
detailRef . value . formRef . formRef . formModel . boxQty *
detailRef . value . formRef . formRef . formModel . purchaseStdQty
}
}
}
}