|
@ -1,23 +1,31 @@ |
|
|
<template> |
|
|
<template> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<!-- 搜索工作栏 --> |
|
|
<!-- 搜索工作栏 --> |
|
|
<Search :schema="[...PreparetoissueMain.allSchemas.searchSchema,...PreparetoissueDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
<Search |
|
|
|
|
|
:schema="[ |
|
|
|
|
|
...PreparetoissueMain.allSchemas.searchSchema, |
|
|
|
|
|
...PreparetoissueDetail.allSchemas.searchSchema |
|
|
|
|
|
]" |
|
|
|
|
|
@search="setSearchParams" |
|
|
|
|
|
@reset="setSearchParams" |
|
|
|
|
|
/> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
<!-- 列表头部 --> |
|
|
<TableHead |
|
|
<TableHead |
|
|
:HeadButttondata="HeadButttondata" |
|
|
:HeadButttondata="HeadButttondata" |
|
|
@button-base-click="buttonBaseClick" |
|
|
@button-base-click="buttonBaseClick" |
|
|
:routeName="routeName" |
|
|
:routeName="routeName" |
|
|
@updataTableColumns="updataTableColumns" |
|
|
@updataTableColumns="updataTableColumns" |
|
|
@searchFormClick="searchFormClick" |
|
|
@searchFormClick="searchFormClick" |
|
|
:allSchemas="PreparetoissueMain.allSchemas" |
|
|
:allSchemas="PreparetoissueMain.allSchemas" |
|
|
:detailAllSchemas="PreparetoissueDetail.allSchemas" |
|
|
:detailAllSchemas="PreparetoissueDetail.allSchemas" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
<!-- 列表 --> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<Table v-clientTable |
|
|
<Table |
|
|
|
|
|
v-clientTable |
|
|
:columns="tableColumns" |
|
|
:columns="tableColumns" |
|
|
:data="tableObject.tableList" |
|
|
:data="tableObject.tableList" |
|
|
:loading="tableObject.loading" |
|
|
:loading="tableObject.loading" |
|
@ -28,13 +36,16 @@ |
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
v-model:sort="tableObject.sort" |
|
|
v-model:sort="tableObject.sort" |
|
|
> |
|
|
> |
|
|
<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> |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|
<template #action="{ row,$index }"> |
|
|
<template #action="{ row, $index }"> |
|
|
<ButtonBaseMore :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
<ButtonBaseMore |
|
|
|
|
|
:Butttondata="butttondata(row, $index)" |
|
|
|
|
|
@button-base-click="buttonTableClick($event, row)" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
</Table> |
|
|
</Table> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
@ -77,21 +88,33 @@ |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm ref="importFormRef" url="/wms/preparetoissue-main/import" :importTemplateData="importTemplateData" |
|
|
<ImportForm |
|
|
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> |
|
|
ref="importFormRef" |
|
|
|
|
|
url="/wms/preparetoissue-main/import" |
|
|
|
|
|
:importTemplateData="importTemplateData" |
|
|
|
|
|
@success="importSuccess" |
|
|
|
|
|
:updateIsDisable="true" |
|
|
|
|
|
:coverIsDisable="true" |
|
|
|
|
|
:mode="2" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { PreparetoissueMain,PreparetoissueMainRules,PreparetoissueDetail,PreparetoissueDetailRules } from './preparetoissueMain.data' |
|
|
import { |
|
|
|
|
|
PreparetoissueMain, |
|
|
|
|
|
PreparetoissueMainRules, |
|
|
|
|
|
PreparetoissueDetail, |
|
|
|
|
|
PreparetoissueDetailRules |
|
|
|
|
|
} from './preparetoissueMain.data' |
|
|
import * as PreparetoissueMainApi from '@/api/wms/preparetoissueMain' |
|
|
import * as PreparetoissueMainApi from '@/api/wms/preparetoissueMain' |
|
|
import * as PreparetoissueDetailApi from '@/api/wms/preparetoissueDetail' |
|
|
import * as PreparetoissueDetailApi from '@/api/wms/preparetoissueDetail' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as ProductionlineitemApi from '@/api/wms/productionlineitem' |
|
|
import * as ProductionlineitemApi from '@/api/wms/productionlineitem' |
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
import { usePageLoading } from '@/hooks/web/usePageLoading' |
|
|
import { usePageLoading } from '@/hooks/web/usePageLoading' |
|
|
import {getBaseUrl, getJmreportBaseUrl} from '@/utils/systemParam' |
|
|
import { getBaseUrl, getJmreportBaseUrl } from '@/utils/systemParam' |
|
|
import {getAccessToken} from "@/utils/auth"; |
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
|
|
|
|
|
const { loadStart, loadDone } = usePageLoading() |
|
|
const { loadStart, loadDone } = usePageLoading() |
|
|
// 备料计划 |
|
|
// 备料计划 |
|
@ -103,7 +126,10 @@ const { t } = useI18n() // 国际化 |
|
|
const route = useRoute() // 路由信息 |
|
|
const route = useRoute() // 路由信息 |
|
|
const routeName = ref() |
|
|
const routeName = ref() |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
const tableColumns = ref([...PreparetoissueMain.allSchemas.tableColumns,...PreparetoissueDetail.allSchemas.tableMainColumns]) |
|
|
const tableColumns = ref([ |
|
|
|
|
|
...PreparetoissueMain.allSchemas.tableColumns, |
|
|
|
|
|
...PreparetoissueDetail.allSchemas.tableMainColumns |
|
|
|
|
|
]) |
|
|
|
|
|
|
|
|
const isShowButton = ref(true) |
|
|
const isShowButton = ref(true) |
|
|
|
|
|
|
|
@ -113,22 +139,22 @@ const updataTableColumns = (val) => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
if (type == 'tableForm') { |
|
|
if (type == 'tableForm') { |
|
|
// 明细查询页赋值 |
|
|
// 明细查询页赋值 |
|
|
if (formField == 'itemCode') { |
|
|
if (formField == 'itemCode') { |
|
|
if(tableData.value.find(item1=>item1['itemCode'] == val[0]['componentItemCode'])){ |
|
|
if (tableData.value.find((item1) => item1['itemCode'] == val[0]['componentItemCode'])) { |
|
|
message.warning(`物料${val[0]['componentItemCode']}已经存在`) |
|
|
message.warning(`物料${val[0]['componentItemCode']}已经存在`) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
val.forEach((item, index)=>{ |
|
|
val.forEach((item, index) => { |
|
|
let tableForm = JSON.parse(JSON.stringify(tableFormKeys)) |
|
|
let tableForm = JSON.parse(JSON.stringify(tableFormKeys)) |
|
|
if(index == 0){ |
|
|
if (index == 0) { |
|
|
row['itemCode'] = item['componentItemCode'] |
|
|
row['itemCode'] = item['componentItemCode'] |
|
|
row['uom'] = item['componentUom'] |
|
|
row['uom'] = item['componentUom'] |
|
|
}else{ |
|
|
} else { |
|
|
const newRow = JSON.parse(JSON.stringify({...tableForm,...item})) |
|
|
const newRow = JSON.parse(JSON.stringify({ ...tableForm, ...item })) |
|
|
newRow['itemCode'] = item['componentItemCode'] |
|
|
newRow['itemCode'] = item['componentItemCode'] |
|
|
newRow['uom'] = item['componentUom'] |
|
|
newRow['uom'] = item['componentUom'] |
|
|
newRow['workStation'] = row['workStation'] |
|
|
newRow['workStation'] = row['workStation'] |
|
@ -137,24 +163,23 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
tableData.value.push(newRow) |
|
|
tableData.value.push(newRow) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
} else if (formField == 'workStation') { |
|
|
} else if(formField == 'workStation'){ |
|
|
if (isShowButton.value) { |
|
|
if(isShowButton.value){ |
|
|
val.forEach((item) => { |
|
|
val.forEach(item=>{ |
|
|
const newRow = JSON.parse(JSON.stringify({ ...tableFormKeys, ...item })) |
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) |
|
|
|
|
|
newRow[formField] = item[searchField] |
|
|
newRow[formField] = item[searchField] |
|
|
newRow['toLocationCode'] = item['rawLocationCode'] |
|
|
newRow['toLocationCode'] = item['rawLocationCode'] |
|
|
tableData.value.push(newRow) |
|
|
tableData.value.push(newRow) |
|
|
}) |
|
|
}) |
|
|
}else{ |
|
|
} else { |
|
|
row['toLocationCode'] = val[0]['rawLocationCode'] |
|
|
row['toLocationCode'] = val[0]['rawLocationCode'] |
|
|
row[formField] = val[0][searchField] |
|
|
row[formField] = val[0][searchField] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
console.log(77,formField) |
|
|
console.log(77, formField) |
|
|
console.log(66,searchField) |
|
|
console.log(66, searchField) |
|
|
console.log(88,tableData.value) |
|
|
console.log(88, tableData.value) |
|
|
console.log(99,val) |
|
|
console.log(99, val) |
|
|
} else { |
|
|
} else { |
|
|
row[formField] = val[0][searchField] |
|
|
row[formField] = val[0][searchField] |
|
|
} |
|
|
} |
|
@ -167,7 +192,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
setV['shift'] = val[0]['shift'] |
|
|
setV['shift'] = val[0]['shift'] |
|
|
setV['team'] = val[0]['team'] |
|
|
setV['team'] = val[0]['team'] |
|
|
isShowButton.value = false |
|
|
isShowButton.value = false |
|
|
PreparetoissueDetail.allSchemas.tableFormColumns.map(item => { |
|
|
PreparetoissueDetail.allSchemas.tableFormColumns.map((item) => { |
|
|
if (item.field == 'workStation') { |
|
|
if (item.field == 'workStation') { |
|
|
item.tableForm.isInpuFocusShow = true |
|
|
item.tableForm.isInpuFocusShow = true |
|
|
} |
|
|
} |
|
@ -175,54 +200,55 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
|
|
|
|
|
// 获取子表数据 getBomDisassemble |
|
|
// 获取子表数据 getBomDisassemble |
|
|
PreparetoissueMainApi.getBomDisassemble(val[0]['id']) |
|
|
PreparetoissueMainApi.getBomDisassemble(val[0]['id']) |
|
|
.then(res => { |
|
|
.then((res) => { |
|
|
if (res) tableData.value = res |
|
|
if (res) tableData.value = res |
|
|
// 根据子表品番 和主表生产线 查询生产线物料关系 获取 原料库位赋值目标库位 |
|
|
// 根据子表品番 和主表生产线 查询生产线物料关系 获取 原料库位赋值目标库位 |
|
|
tableData.value.map(item => { |
|
|
tableData.value.map((item) => { |
|
|
ProductionlineitemApi.getProductionlineitemPage({ |
|
|
ProductionlineitemApi.getProductionlineitemPage({ |
|
|
productionLineCode: val[0]['productionLine'], |
|
|
productionLineCode: val[0]['productionLine'], |
|
|
itemCode: item.itemCode, |
|
|
itemCode: item.itemCode, |
|
|
pageSize: 100, |
|
|
pageSize: 100, |
|
|
pageNo: 1, |
|
|
pageNo: 1, |
|
|
sort: '', |
|
|
sort: '', |
|
|
by: 'ASC' |
|
|
by: 'ASC' |
|
|
}).then(res => { |
|
|
}).then((res) => { |
|
|
item.toLocationCode = res.list[0].rawLocationCode |
|
|
item.toLocationCode = res.list[0].rawLocationCode |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
// 修改 tableform 属性 |
|
|
|
|
|
PreparetoissueDetail.allSchemas.tableFormColumns.map((item) => { |
|
|
|
|
|
if (item.field == 'itemCode') { |
|
|
|
|
|
item.isInpuFocusShow = false |
|
|
|
|
|
item.tableForm.isInpuFocusShow = false |
|
|
|
|
|
item.tableForm.disabled = true |
|
|
|
|
|
} |
|
|
|
|
|
if (item.field == 'planQty') { |
|
|
|
|
|
item.tableForm.disabled = true |
|
|
|
|
|
} |
|
|
|
|
|
if (item.field == 'available') { |
|
|
|
|
|
item.tableForm.disabled = true |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
// 修改 tableform 属性 |
|
|
.catch((err) => { |
|
|
PreparetoissueDetail.allSchemas.tableFormColumns.map(item => { |
|
|
console.log(err) |
|
|
if(item.field == 'itemCode') { |
|
|
message.error('错误') |
|
|
item.isInpuFocusShow = false |
|
|
|
|
|
item.tableForm.isInpuFocusShow = false |
|
|
|
|
|
item.tableForm.disabled = true |
|
|
|
|
|
} |
|
|
|
|
|
if(item.field == 'planQty') { |
|
|
|
|
|
item.tableForm.disabled = true |
|
|
|
|
|
} |
|
|
|
|
|
if(item.field == 'available') { |
|
|
|
|
|
item.tableForm.disabled = true |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
}) |
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
message.error('错误') |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
if (formField == 'workshop') { |
|
|
if (formField == 'workshop') { |
|
|
//车间代码 |
|
|
//车间代码 |
|
|
tableData.value =[] |
|
|
tableData.value = [] |
|
|
} |
|
|
} |
|
|
if (formField == 'prodLine') { |
|
|
if (formField == 'prodLine') { |
|
|
//车间代码 |
|
|
//车间代码 |
|
|
tableData.value =[] |
|
|
tableData.value = [] |
|
|
} |
|
|
} |
|
|
formRef.setValues(setV) |
|
|
formRef.setValues(setV) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
// 查询页面返回——详情 |
|
|
// 查询页面返回——详情 |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
setV[formField] = val[0][searchField] |
|
|
setV[formField] = val[0][searchField] |
|
@ -244,12 +270,12 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
// 列表头部按钮 |
|
|
const HeadButttondata = [ |
|
|
const HeadButttondata = [ |
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:preparetoissue-main:create'}), // 新增 |
|
|
defaultButtons.defaultAddBtn({ hasPermi: 'wms:preparetoissue-main:create' }), // 新增 |
|
|
defaultButtons.defaultImportBtn({hasPermi:'wms:preparetoissue-main:import'}), // 导入 |
|
|
defaultButtons.defaultImportBtn({ hasPermi: 'wms:preparetoissue-main:import' }), // 导入 |
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:preparetoissue-main:export'}), // 导出 |
|
|
defaultButtons.defaultExportBtn({ hasPermi: 'wms:preparetoissue-main:export' }), // 导出 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
defaultButtons.defaultSetBtn(null) // 设置 |
|
|
// { |
|
|
// { |
|
|
// label: '自定义扩展按钮', |
|
|
// label: '自定义扩展按钮', |
|
|
// name: 'zdy', |
|
|
// name: 'zdy', |
|
@ -262,29 +288,35 @@ const HeadButttondata = [ |
|
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
// 头部按钮事件 |
|
|
const buttonBaseClick = (val, item) => { |
|
|
const buttonBaseClick = (val, item) => { |
|
|
if (val == 'add') { // 新增 |
|
|
if (val == 'add') { |
|
|
|
|
|
// 新增 |
|
|
openForm('create') |
|
|
openForm('create') |
|
|
resetShow() |
|
|
resetShow() |
|
|
} else if (val == 'import') { // 导入 |
|
|
} else if (val == 'import') { |
|
|
|
|
|
// 导入 |
|
|
handleImport() |
|
|
handleImport() |
|
|
} else if (val == 'export') { // 导出 |
|
|
} else if (val == 'export') { |
|
|
|
|
|
// 导出 |
|
|
handleExport() |
|
|
handleExport() |
|
|
} 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 |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
getList() |
|
|
getList() |
|
|
} |
|
|
} |
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
} else if (val == 'filtrate') { |
|
|
} else { // 其他按钮 |
|
|
// 筛选 |
|
|
|
|
|
} else { |
|
|
|
|
|
// 其他按钮 |
|
|
console.log('其他按钮', item) |
|
|
console.log('其他按钮', item) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 根据状态返回该按钮是否显示 |
|
|
// 根据状态返回该按钮是否显示 |
|
|
const isShowMainButton = (row,val) => { |
|
|
const isShowMainButton = (row, val) => { |
|
|
if (val.indexOf(row.status) > -1) { |
|
|
if (val.indexOf(row.status) > -1) { |
|
|
return false |
|
|
return false |
|
|
} else { |
|
|
} else { |
|
@ -293,28 +325,51 @@ const isShowMainButton = (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'] |
|
|
if(findIndex>-1&&findIndex<$index){ |
|
|
? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId']) |
|
|
|
|
|
: -1 |
|
|
|
|
|
if (findIndex > -1 && findIndex < $index) { |
|
|
return [] |
|
|
return [] |
|
|
} |
|
|
} |
|
|
return [ |
|
|
return [ |
|
|
// defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:preparetoissue-main:open'}), // 打开 |
|
|
// defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:preparetoissue-main:open'}), // 打开 |
|
|
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:'wms:preparetoissue-main:close'}), // 关闭 |
|
|
defaultButtons.mainListPlanCloBtn({ |
|
|
defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:preparetoissue-main:submit'}), // 提交审批 |
|
|
hide: isShowMainButton(row, ['1', '2', '3', '4']), |
|
|
defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:preparetoissue-main:reject'}), // 驳回 |
|
|
hasPermi: 'wms:preparetoissue-main:close' |
|
|
defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:preparetoissue-main:agree'}), // 审批通过 |
|
|
}), // 关闭 |
|
|
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:preparetoissue-main:publish'}), // 发布 |
|
|
defaultButtons.mainListPlanSubBtn({ |
|
|
defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:'wms:preparetoissue-main:resetting'}), // 重置 |
|
|
hide: isShowMainButton(row, ['1']), |
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:preparetoissue-main:update'}), // 编辑 |
|
|
hasPermi: 'wms:preparetoissue-main:submit' |
|
|
|
|
|
}), // 提交审批 |
|
|
|
|
|
defaultButtons.mainListPlanTurBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['2']), |
|
|
|
|
|
hasPermi: 'wms:preparetoissue-main:reject' |
|
|
|
|
|
}), // 驳回 |
|
|
|
|
|
defaultButtons.mainListPlanAppBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['2']), |
|
|
|
|
|
hasPermi: 'wms:preparetoissue-main:agree' |
|
|
|
|
|
}), // 审批通过 |
|
|
|
|
|
defaultButtons.mainListPlanPubBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['3']), |
|
|
|
|
|
hasPermi: 'wms:preparetoissue-main:publish' |
|
|
|
|
|
}), // 发布 |
|
|
|
|
|
defaultButtons.mainListPlanResBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['4']), |
|
|
|
|
|
hasPermi: 'wms:preparetoissue-main:resetting' |
|
|
|
|
|
}), // 重置 |
|
|
|
|
|
defaultButtons.mainListEditBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['1']), |
|
|
|
|
|
hasPermi: 'wms:preparetoissue-main:update' |
|
|
|
|
|
}), // 编辑 |
|
|
// defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:preparetoissue-main:delete'}), // 删除 |
|
|
// defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:preparetoissue-main:delete'}), // 删除 |
|
|
{ |
|
|
{ |
|
|
label: '生成发料申请', |
|
|
label: '生成发料申请', |
|
|
name: 'scflsq', |
|
|
name: 'scflsq', |
|
|
hide: isShowMainButton(row,['6']), |
|
|
hide: isShowMainButton(row, ['6']), |
|
|
type: 'primary', |
|
|
type: 'primary', |
|
|
icon: 'Select', |
|
|
icon: 'Select', |
|
|
hasPermi:'wms:preparetoissue-main:publish', |
|
|
hasPermi: 'wms:preparetoissue-main:publish', |
|
|
link: true, // 文本展现按钮 |
|
|
link: true, // 文本展现按钮 |
|
|
color: '' |
|
|
color: '' |
|
|
}, |
|
|
}, |
|
@ -323,131 +378,158 @@ const butttondata = (row,$index) => { |
|
|
name: 'printSupplyList', |
|
|
name: 'printSupplyList', |
|
|
type: 'primary', |
|
|
type: 'primary', |
|
|
icon: 'Select', |
|
|
icon: 'Select', |
|
|
hasPermi:'wms:preparetoissue-main:publish', |
|
|
hasPermi: 'wms:preparetoissue-main:publish', |
|
|
link: true, // 文本展现按钮 |
|
|
link: true, // 文本展现按钮 |
|
|
color: '' |
|
|
color: '' |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
if (val == 'mainPlanOpe') { // 打开 |
|
|
if (val == 'mainPlanOpe') { |
|
|
|
|
|
// 打开 |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
PreparetoissueMainApi.open(row.masterId).then(() => { |
|
|
PreparetoissueMainApi.open(row.masterId) |
|
|
message.success(t('common.updateSuccess')) |
|
|
.then(() => { |
|
|
tableObject.loading = false |
|
|
message.success(t('common.updateSuccess')) |
|
|
buttonBaseClick('refresh',null) |
|
|
tableObject.loading = false |
|
|
}).catch(err => { |
|
|
buttonBaseClick('refresh', null) |
|
|
tableObject.loading = false |
|
|
}) |
|
|
console.log(err) |
|
|
.catch((err) => { |
|
|
}) |
|
|
tableObject.loading = false |
|
|
} else if (val == 'mainPlanClo') { // 关闭 |
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (val == 'mainPlanClo') { |
|
|
|
|
|
// 关闭 |
|
|
await message.confirm('确认要关闭吗?') |
|
|
await message.confirm('确认要关闭吗?') |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
PreparetoissueMainApi.close(row.masterId).then(() => { |
|
|
PreparetoissueMainApi.close(row.masterId) |
|
|
message.success(t('common.updateSuccess')) |
|
|
.then(() => { |
|
|
tableObject.loading = false |
|
|
message.success(t('common.updateSuccess')) |
|
|
buttonBaseClick('refresh',null) |
|
|
tableObject.loading = false |
|
|
}).catch(err => { |
|
|
buttonBaseClick('refresh', null) |
|
|
tableObject.loading = false |
|
|
}) |
|
|
console.log(err) |
|
|
.catch((err) => { |
|
|
}) |
|
|
tableObject.loading = false |
|
|
} else if (val == 'mainPlanSub') { // 提交审批 |
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (val == 'mainPlanSub') { |
|
|
|
|
|
// 提交审批 |
|
|
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') |
|
|
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') |
|
|
await message.confirm('确认要提交审批吗?') |
|
|
await message.confirm('确认要提交审批吗?') |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
PreparetoissueMainApi.submit(row.masterId).then(() => { |
|
|
PreparetoissueMainApi.submit(row.masterId) |
|
|
message.success(t('common.updateSuccess')) |
|
|
.then(() => { |
|
|
tableObject.loading = false |
|
|
message.success(t('common.updateSuccess')) |
|
|
buttonBaseClick('refresh',null) |
|
|
tableObject.loading = false |
|
|
}).catch(err => { |
|
|
buttonBaseClick('refresh', null) |
|
|
tableObject.loading = false |
|
|
}) |
|
|
console.log(err) |
|
|
.catch((err) => { |
|
|
}) |
|
|
tableObject.loading = false |
|
|
} else if (val == 'mainPlanTur') { // 驳回 |
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (val == 'mainPlanTur') { |
|
|
|
|
|
// 驳回 |
|
|
await message.confirm('确认要驳回吗?') |
|
|
await message.confirm('确认要驳回吗?') |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
PreparetoissueMainApi.reject(row.masterId).then(() => { |
|
|
PreparetoissueMainApi.reject(row.masterId) |
|
|
message.success(t('common.updateSuccess')) |
|
|
.then(() => { |
|
|
tableObject.loading = false |
|
|
message.success(t('common.updateSuccess')) |
|
|
buttonBaseClick('refresh',null) |
|
|
tableObject.loading = false |
|
|
}).catch(err => { |
|
|
buttonBaseClick('refresh', null) |
|
|
tableObject.loading = false |
|
|
}) |
|
|
console.log(err) |
|
|
.catch((err) => { |
|
|
}) |
|
|
tableObject.loading = false |
|
|
} else if (val == 'mainPlanApp') { // 审批通过 |
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (val == 'mainPlanApp') { |
|
|
|
|
|
// 审批通过 |
|
|
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') |
|
|
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') |
|
|
await message.confirm('确认要审批通过吗?') |
|
|
await message.confirm('确认要审批通过吗?') |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
PreparetoissueMainApi.agree(row.masterId).then(() => { |
|
|
PreparetoissueMainApi.agree(row.masterId) |
|
|
message.success(t('common.updateSuccess')) |
|
|
.then(() => { |
|
|
tableObject.loading = false |
|
|
message.success(t('common.updateSuccess')) |
|
|
buttonBaseClick('refresh',null) |
|
|
tableObject.loading = false |
|
|
}).catch(err => { |
|
|
buttonBaseClick('refresh', null) |
|
|
tableObject.loading = false |
|
|
}) |
|
|
console.log(err) |
|
|
.catch((err) => { |
|
|
}) |
|
|
tableObject.loading = false |
|
|
} else if (val == 'mainPlanPub') { // 发布 |
|
|
console.log(err) |
|
|
await message.confirm('确认要发布吗?'); |
|
|
}) |
|
|
tableObject.loading = true; |
|
|
} else if (val == 'mainPlanPub') { |
|
|
|
|
|
// 发布 |
|
|
|
|
|
await message.confirm('确认要发布吗?') |
|
|
|
|
|
tableObject.loading = true |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
await PreparetoissueMainApi.publish(row.masterId); |
|
|
await PreparetoissueMainApi.publish(row.masterId) |
|
|
message.success(t('common.updateSuccess')); |
|
|
message.success(t('common.updateSuccess')) |
|
|
await PreparetoissueMainApi.generateIssueRequest(row.number); |
|
|
await PreparetoissueMainApi.generateIssueRequest(row.number) |
|
|
} catch (err) { |
|
|
} catch (err) { |
|
|
console.log(err); |
|
|
console.log(err) |
|
|
} finally { |
|
|
} finally { |
|
|
tableObject.loading = false; |
|
|
tableObject.loading = false |
|
|
buttonBaseClick('refresh', null); |
|
|
buttonBaseClick('refresh', null) |
|
|
} |
|
|
} |
|
|
} else if (val == 'mainPlanRes') { // 重置 |
|
|
} else if (val == 'mainPlanRes') { |
|
|
|
|
|
// 重置 |
|
|
await message.confirm('确认要重置吗?') |
|
|
await message.confirm('确认要重置吗?') |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
PreparetoissueMainApi.resetting(row.masterId).then(() => { |
|
|
PreparetoissueMainApi.resetting(row.masterId) |
|
|
message.success(t('common.updateSuccess')) |
|
|
.then(() => { |
|
|
tableObject.loading = false |
|
|
message.success(t('common.updateSuccess')) |
|
|
buttonBaseClick('refresh',null) |
|
|
tableObject.loading = false |
|
|
}).catch(err => { |
|
|
buttonBaseClick('refresh', null) |
|
|
tableObject.loading = false |
|
|
}) |
|
|
console.log(err) |
|
|
.catch((err) => { |
|
|
}) |
|
|
tableObject.loading = false |
|
|
} else if (val == 'scflsq') { // 生成发料申请 |
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (val == 'scflsq') { |
|
|
|
|
|
// 生成发料申请 |
|
|
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') |
|
|
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') |
|
|
await message.confirm('确认要生成发料申请吗?') |
|
|
await message.confirm('确认要生成发料申请吗?') |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
|
|
|
|
|
|
await PreparetoissueMainApi.generateIssueRequest(row.number).then((res) => { |
|
|
await PreparetoissueMainApi.generateIssueRequest(row.number) |
|
|
console.log('返回数据',res) |
|
|
.then((res) => { |
|
|
if (res.errorCount > 0) { |
|
|
console.log('返回数据', res) |
|
|
message.confirm('存在物料库存不足,创建失败。').then(() => { |
|
|
if (res.errorCount > 0) { |
|
|
window.open( |
|
|
message.confirm('存在物料库存不足,创建失败。').then(() => { |
|
|
getBaseUrl() + '/admin-api' + res.errorFile, |
|
|
window.open(getBaseUrl() + '/admin-api' + res.errorFile, '222') |
|
|
'222' |
|
|
}) |
|
|
) |
|
|
} else { |
|
|
}) |
|
|
message.success(t('common.createSuccess')) |
|
|
} else { |
|
|
} |
|
|
message.success(t('common.createSuccess')) |
|
|
tableObject.loading = false |
|
|
} |
|
|
buttonBaseClick('refresh', null) |
|
|
tableObject.loading = false |
|
|
}) |
|
|
buttonBaseClick('refresh',null) |
|
|
.catch((err) => { |
|
|
}).catch(err => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
console.log(err) |
|
|
console.log(err) |
|
|
}) |
|
|
}) |
|
|
} 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 == 'printSupplyList'){ |
|
|
} else if (val == 'printSupplyList') { |
|
|
if(row.printFlag == 'FALSE'){ |
|
|
await PreparetoissueMainApi.getNumber(row.masterId).then((res) => { |
|
|
message.warning("发料任务未完成,不可打印") |
|
|
if (!res.isHaveProductionPlanNumber) { |
|
|
return |
|
|
message.warning('发料申请未关联生产计划,不可打印') |
|
|
} |
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
else if (!res.isHaveIssueRequestNumber) { |
|
|
|
|
|
message.warning('发料任务未完成,不可打印') |
|
|
|
|
|
return |
|
|
|
|
|
}else{ |
|
|
// 打印补给品备料单 |
|
|
// 打印补给品备料单 |
|
|
handlePrintSupplyList(row.masterId) |
|
|
handlePrintSupplyList(row.masterId) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -459,30 +541,32 @@ const handlePrintSupplyList = async (id) => { |
|
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const formRef = ref() |
|
|
const formRef = ref() |
|
|
const openForm =async (type: string, row?: number) => { |
|
|
const openForm = async (type: string, row?: number) => { |
|
|
tableData.value = [] // 重置明细数据 |
|
|
tableData.value = [] // 重置明细数据 |
|
|
if (type == 'update') { |
|
|
if (type == 'update') { |
|
|
// 修改 tableform 属性 |
|
|
// 修改 tableform 属性 |
|
|
PreparetoissueMain.allSchemas.formSchema.map(item => { |
|
|
PreparetoissueMain.allSchemas.formSchema.map((item) => { |
|
|
if(item.field == 'productionPlanNumber' || |
|
|
if ( |
|
|
item.field == 'workshop' || |
|
|
item.field == 'productionPlanNumber' || |
|
|
item.field == 'prodLine' || |
|
|
item.field == 'workshop' || |
|
|
item.field == 'shift' || |
|
|
item.field == 'prodLine' || |
|
|
item.field == 'team' |
|
|
item.field == 'shift' || |
|
|
){ |
|
|
item.field == 'team' |
|
|
|
|
|
) { |
|
|
item.componentProps.isSearchList = false |
|
|
item.componentProps.isSearchList = false |
|
|
item.componentProps.disabled = true |
|
|
item.componentProps.disabled = true |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
// 修改 tableform 属性 |
|
|
// 修改 tableform 属性 |
|
|
PreparetoissueMain.allSchemas.formSchema.map(item => { |
|
|
PreparetoissueMain.allSchemas.formSchema.map((item) => { |
|
|
if(item.field == 'productionPlanNumber' || |
|
|
if ( |
|
|
item.field == 'workshop' || |
|
|
item.field == 'productionPlanNumber' || |
|
|
item.field == 'prodLine' || |
|
|
item.field == 'workshop' || |
|
|
item.field == 'shift' || |
|
|
item.field == 'prodLine' || |
|
|
item.field == 'team' |
|
|
item.field == 'shift' || |
|
|
){ |
|
|
item.field == 'team' |
|
|
|
|
|
) { |
|
|
item.componentProps.isSearchList = true |
|
|
item.componentProps.isSearchList = true |
|
|
item.componentProps.disabled = false |
|
|
item.componentProps.disabled = false |
|
|
} |
|
|
} |
|
@ -494,7 +578,7 @@ const openForm =async (type: string, row?: number) => { |
|
|
/** 详情操作 */ |
|
|
/** 详情操作 */ |
|
|
const detailRef = ref() |
|
|
const detailRef = ref() |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
detailRef.value.openDetail(row, titleName, titleValue,"planPreparetoissueMain") |
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'planPreparetoissueMain') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 删除按钮操作 */ |
|
|
/** 删除按钮操作 */ |
|
@ -508,7 +592,7 @@ const handleDelete = async (id: number) => { |
|
|
message.success(t('common.delSuccess')) |
|
|
message.success(t('common.delSuccess')) |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
buttonBaseClick('refresh',null) |
|
|
buttonBaseClick('refresh', null) |
|
|
} catch {} |
|
|
} catch {} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -529,36 +613,36 @@ const handleExport = async () => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* tableForm方法 |
|
|
* tableForm方法 |
|
|
*/ |
|
|
*/ |
|
|
const tableFormKeys = {} |
|
|
const tableFormKeys = {} |
|
|
PreparetoissueDetail.allSchemas.tableFormColumns.forEach(item => { |
|
|
PreparetoissueDetail.allSchemas.tableFormColumns.forEach((item) => { |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
}) |
|
|
}) |
|
|
const tableData = ref([]) |
|
|
const tableData = ref([]) |
|
|
|
|
|
|
|
|
// 添加明细 |
|
|
// 添加明细 |
|
|
const handleAddTable = () => { |
|
|
const handleAddTable = () => { |
|
|
if(formRef.value.formRef.formModel.prodLine === ''){ |
|
|
if (formRef.value.formRef.formModel.prodLine === '') { |
|
|
message.warning("请选择生产线代码"); |
|
|
message.warning('请选择生产线代码') |
|
|
return; |
|
|
return |
|
|
} |
|
|
} |
|
|
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) |
|
|
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) |
|
|
} |
|
|
} |
|
|
// 删除明细 |
|
|
// 删除明细 |
|
|
const handleDeleteTable = (item, index) => { |
|
|
const handleDeleteTable = (item, index) => { |
|
|
let itemIndex = tableData.value.indexOf(item) |
|
|
let itemIndex = tableData.value.indexOf(item) |
|
|
if(itemIndex>-1){ |
|
|
if (itemIndex > -1) { |
|
|
tableData.value.splice(itemIndex, 1) |
|
|
tableData.value.splice(itemIndex, 1) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
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 submitForm = async (formType, submitData) => { |
|
|
const submitForm = async (formType, submitData) => { |
|
|
let data = {...submitData} |
|
|
let data = { ...submitData } |
|
|
if(data.masterId){ |
|
|
if (data.masterId) { |
|
|
data.id = data.masterId |
|
|
data.id = data.masterId |
|
|
} |
|
|
} |
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
@ -577,7 +661,7 @@ const submitForm = async (formType, submitData) => { |
|
|
} else { |
|
|
} else { |
|
|
await PreparetoissueMainApi.updatePreparetoissueMain(data) |
|
|
await PreparetoissueMainApi.updatePreparetoissueMain(data) |
|
|
message.success(t('common.updateSuccess')) |
|
|
message.success(t('common.updateSuccess')) |
|
|
buttonBaseClick('refresh',null) |
|
|
buttonBaseClick('refresh', null) |
|
|
} |
|
|
} |
|
|
formRef.value.dialogVisible = false |
|
|
formRef.value.dialogVisible = false |
|
|
// 刷新当前列表 |
|
|
// 刷新当前列表 |
|
@ -617,16 +701,16 @@ const searchFormClick = (searchData) => { |
|
|
const resetShow = async () => { |
|
|
const resetShow = async () => { |
|
|
isShowButton.value = true // tableform按钮恢复到显示 |
|
|
isShowButton.value = true // tableform按钮恢复到显示 |
|
|
// 修改 tableform 属性 |
|
|
// 修改 tableform 属性 |
|
|
PreparetoissueDetail.allSchemas.tableFormColumns.map(item => { |
|
|
PreparetoissueDetail.allSchemas.tableFormColumns.map((item) => { |
|
|
if(item.field == 'itemCode') { |
|
|
if (item.field == 'itemCode') { |
|
|
item.isInpuFocusShow = true |
|
|
item.isInpuFocusShow = true |
|
|
item.tableForm.isInpuFocusShow = true |
|
|
item.tableForm.isInpuFocusShow = true |
|
|
item.tableForm.disabled = false |
|
|
item.tableForm.disabled = false |
|
|
} |
|
|
} |
|
|
if(item.field == 'planQty') { |
|
|
if (item.field == 'planQty') { |
|
|
item.tableForm.disabled = false |
|
|
item.tableForm.disabled = false |
|
|
} |
|
|
} |
|
|
if(item.field == 'available') { |
|
|
if (item.field == 'available') { |
|
|
item.tableForm.disabled = false |
|
|
item.tableForm.disabled = false |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|