|
@ -1,7 +1,14 @@ |
|
|
<template> |
|
|
<template> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<!-- 搜索工作栏 --> |
|
|
<!-- 搜索工作栏 --> |
|
|
<Search :schema="[...ProductreceiptRequestMain.allSchemas.searchSchema,...ProductreceiptRequestDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
<Search |
|
|
|
|
|
:schema="[ |
|
|
|
|
|
...ProductreceiptRequestMain.allSchemas.searchSchema, |
|
|
|
|
|
...ProductreceiptRequestDetail.allSchemas.searchSchema |
|
|
|
|
|
]" |
|
|
|
|
|
@search="setSearchParams" |
|
|
|
|
|
@reset="setSearchParams" |
|
|
|
|
|
/> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
<!-- 列表头部 --> |
|
@ -17,7 +24,8 @@ |
|
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
<!-- 列表 --> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<Table v-clientTable |
|
|
<Table |
|
|
|
|
|
v-clientTable |
|
|
:columns="tableColumns" |
|
|
:columns="tableColumns" |
|
|
:data="tableObject.tableList" |
|
|
:data="tableObject.tableList" |
|
|
:loading="tableObject.loading" |
|
|
:loading="tableObject.loading" |
|
@ -34,7 +42,10 @@ |
|
|
</el-button> |
|
|
</el-button> |
|
|
</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> |
|
@ -43,7 +54,7 @@ |
|
|
<BasicForm |
|
|
<BasicForm |
|
|
ref="formRef" |
|
|
ref="formRef" |
|
|
:isOpenSearchTable="true" |
|
|
:isOpenSearchTable="true" |
|
|
fieldTableColumn="workStationCode" |
|
|
fieldTableColumn="itemCode" |
|
|
@success="getList" |
|
|
@success="getList" |
|
|
:rules="ProductreceiptRequestMainRules" |
|
|
:rules="ProductreceiptRequestMainRules" |
|
|
:formAllSchemas="ProductreceiptRequestMain.allSchemas" |
|
|
:formAllSchemas="ProductreceiptRequestMain.allSchemas" |
|
@ -61,11 +72,17 @@ |
|
|
@submitForm="submitForm" |
|
|
@submitForm="submitForm" |
|
|
> |
|
|
> |
|
|
<template v-slot="{ row }"> |
|
|
<template v-slot="{ row }"> |
|
|
<el-date-picker v-bind:modelValue="row['expireTime']?addDay(row['produceDate'],row['expireTime']):dayjs('2099-12-31').valueOf()" |
|
|
<el-date-picker |
|
|
|
|
|
v-bind:modelValue=" |
|
|
|
|
|
row['expireTime'] |
|
|
|
|
|
? addDay(row['produceDate'], row['expireTime']) |
|
|
|
|
|
: dayjs('2099-12-31').valueOf() |
|
|
|
|
|
" |
|
|
:clearable="true" |
|
|
:clearable="true" |
|
|
style="width: 100%" |
|
|
style="width: 100%" |
|
|
:disabled="true" |
|
|
:disabled="true" |
|
|
:placeholder="t('ts.选择日期')"/> |
|
|
:placeholder="t('ts.选择日期')" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
</BasicForm> |
|
|
</BasicForm> |
|
|
|
|
|
|
|
@ -123,21 +140,37 @@ |
|
|
</Dialog> |
|
|
</Dialog> |
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm ref="importFormRef" url="/wms/productreceipt-request-main/import" :importTemplateData="importTemplateData" |
|
|
<ImportForm |
|
|
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" :extend="'predict'"/> |
|
|
ref="importFormRef" |
|
|
|
|
|
url="/wms/productreceipt-request-main/import" |
|
|
|
|
|
:importTemplateData="importTemplateData" |
|
|
|
|
|
@success="importSuccess" |
|
|
|
|
|
:updateIsDisable="true" |
|
|
|
|
|
:coverIsDisable="true" |
|
|
|
|
|
:mode="2" |
|
|
|
|
|
:extend="'predict'" |
|
|
|
|
|
/> |
|
|
<!-- 标签打印 --> |
|
|
<!-- 标签打印 --> |
|
|
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccessLabel" /> |
|
|
<SearchTable |
|
|
|
|
|
style="width: 905px" |
|
|
|
|
|
ref="searchTableRef" |
|
|
|
|
|
@searchTableSuccess="searchTableSuccessLabel" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
import { ProductreceiptRequestMain,ProductreceiptRequestMainRules,ProductreceiptRequestDetail, |
|
|
|
|
|
ProductreceiptRequestDetailRules, BackflushDetailRequest, |
|
|
|
|
|
ProductreceiptRequestLabel,ProductreceiptRequestLabelRules } from './productreceiptRequestMain.data' |
|
|
|
|
|
import { |
|
|
import { |
|
|
SupplierdeliverRequestPackage |
|
|
ProductreceiptRequestMain, |
|
|
} from '../../../purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts' |
|
|
ProductreceiptRequestMainRules, |
|
|
|
|
|
ProductreceiptRequestDetail, |
|
|
|
|
|
ProductreceiptRequestDetailRules, |
|
|
|
|
|
BackflushDetailRequest, |
|
|
|
|
|
ProductreceiptRequestLabel, |
|
|
|
|
|
ProductreceiptRequestLabelRules |
|
|
|
|
|
} from './productreceiptRequestMain.data' |
|
|
|
|
|
import { SupplierdeliverRequestPackage } from '../../../purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts' |
|
|
// } from '../../../supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data' |
|
|
// } from '../../../supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data' |
|
|
import * as ProductreceiptRequestMainApi from '@/api/wms/productreceiptRequestMain' |
|
|
import * as ProductreceiptRequestMainApi from '@/api/wms/productreceiptRequestMain' |
|
|
import * as ProductreceiptRequestDetailApi from '@/api/wms/productreceiptRequestDetail' |
|
|
import * as ProductreceiptRequestDetailApi from '@/api/wms/productreceiptRequestDetail' |
|
@ -149,9 +182,10 @@ import { formatTime } from '@/utils/index' |
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
import dayjs from 'dayjs' |
|
|
import dayjs from 'dayjs' |
|
|
import { getJmreportBaseUrl } from '@/utils/systemParam' |
|
|
import { getJmreportBaseUrl } from '@/utils/systemParam' |
|
|
import * as BomApi from "@/api/wms/bom"; |
|
|
import * as BomApi from '@/api/wms/bom' |
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
import * as WorkshopApi from '@/api/wms/workshop' |
|
|
import * as WorkshopApi from '@/api/wms/workshop' |
|
|
|
|
|
import * as ConfigApi from '@/api/infra/config' |
|
|
|
|
|
|
|
|
// 制品收货申请 |
|
|
// 制品收货申请 |
|
|
// 预生产收货申请 |
|
|
// 预生产收货申请 |
|
@ -163,9 +197,13 @@ 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([...ProductreceiptRequestMain.allSchemas.tableColumns,...ProductreceiptRequestDetail.allSchemas.tableMainColumns]) |
|
|
const tableColumns = ref([ |
|
|
|
|
|
...ProductreceiptRequestMain.allSchemas.tableColumns, |
|
|
|
|
|
...ProductreceiptRequestDetail.allSchemas.tableMainColumns |
|
|
|
|
|
]) |
|
|
// 详情 table 操作扩展 按钮 |
|
|
// 详情 table 操作扩展 按钮 |
|
|
const buttondataTable = ref([{ |
|
|
const buttondataTable = ref([ |
|
|
|
|
|
{ |
|
|
label: 'Bom', |
|
|
label: 'Bom', |
|
|
name: 'bom', |
|
|
name: 'bom', |
|
|
hide: false, |
|
|
hide: false, |
|
@ -173,8 +211,9 @@ const buttondataTable = ref([{ |
|
|
icon: '', |
|
|
icon: '', |
|
|
color: '', |
|
|
color: '', |
|
|
hasPermi: '', |
|
|
hasPermi: '', |
|
|
link: true, // 文本展现按钮 |
|
|
link: true // 文本展现按钮 |
|
|
}]) |
|
|
} |
|
|
|
|
|
]) |
|
|
|
|
|
|
|
|
//创建标签 |
|
|
//创建标签 |
|
|
const detailListTableColumns = ProductreceiptRequestLabel.allSchemas |
|
|
const detailListTableColumns = ProductreceiptRequestLabel.allSchemas |
|
@ -194,12 +233,10 @@ const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useT |
|
|
}) |
|
|
}) |
|
|
const { getList: getDetailListBom } = detatableMethodsBom |
|
|
const { getList: getDetailListBom } = detatableMethodsBom |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
// 字段设置 更新主列表字段 |
|
|
const updataTableColumns = (val) => { |
|
|
const updataTableColumns = (val) => { |
|
|
tableColumns.value = val |
|
|
tableColumns.value = val |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
@ -217,52 +254,53 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
message.warning(`物料${val[0]['itemCode']}已经存在`) |
|
|
message.warning(`物料${val[0]['itemCode']}已经存在`) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
row['uom'] = val[0]['uom'] |
|
|
const index1 = 0 |
|
|
row['produceDate'] = dayjs().valueOf() |
|
|
setTableFormsValues(val, index1) |
|
|
row[formField] = val[0][searchField] |
|
|
|
|
|
// 查看BOM版本 |
|
|
|
|
|
const param1 = { |
|
|
|
|
|
productItemCode: val[0]['itemCode'], |
|
|
|
|
|
available: 'TRUE', |
|
|
|
|
|
pageSize: 20, |
|
|
|
|
|
pageNo: 1, |
|
|
|
|
|
sort: '', |
|
|
|
|
|
by: 'ASC', |
|
|
|
|
|
} |
|
|
|
|
|
BomApi.getBomPage(param1).then(res => { |
|
|
|
|
|
console.log(res) |
|
|
|
|
|
if(res?.list?.length>0){ |
|
|
|
|
|
row['bomVersion'] = res.list[0].version |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}else if (formField == 'workStationCode') { |
|
|
|
|
|
// 明细查询页赋值 |
|
|
|
|
|
val.forEach(item=>{ |
|
|
|
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) |
|
|
|
|
|
newRow[formField] = item[searchField] |
|
|
|
|
|
newRow.batch = formatTime(new Date(), 'yyyyMMdd') |
|
|
|
|
|
|
|
|
|
|
|
tableData.value.push(newRow) |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
row[formField] = val[0][searchField] |
|
|
row[formField] = val[0][searchField] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
setV[formField] = val[0][searchField] |
|
|
setV[formField] = val[0][searchField] |
|
|
if ('workshopCode' == formField) { |
|
|
if ('workshopCode' == formField) { |
|
|
//车间代码 |
|
|
//车间代码 |
|
|
setV['productionLineCode'] = '' |
|
|
setV['productionLineCode'] = '' |
|
|
tableData.value = [] |
|
|
tableData.value = [] |
|
|
} else if ('productionLineCode' == formField) { |
|
|
} else if ('productionLineCode' == formField) { |
|
|
//生产线代码 |
|
|
//生产线代码 |
|
|
tableData.value = [] |
|
|
tableData.value = [] |
|
|
} |
|
|
} |
|
|
formRef.setValues(setV) |
|
|
formRef.setValues(setV) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
const setTableFormsValues = async (val, index1) => { |
|
|
|
|
|
if (index1 <= val.length - 1) { |
|
|
|
|
|
const newRow = JSON.parse(JSON.stringify({ ...tableFormKeys, ...val[index1] })) |
|
|
|
|
|
newRow['itemCode'] = val[index1]['itemCode'] |
|
|
|
|
|
newRow['uom'] = val[0]['uom'] |
|
|
|
|
|
newRow['produceDate'] = dayjs().valueOf() |
|
|
|
|
|
|
|
|
|
|
|
const param1 = { |
|
|
|
|
|
productItemCode: val[0]['itemCode'], |
|
|
|
|
|
available: 'TRUE', |
|
|
|
|
|
pageSize: 20, |
|
|
|
|
|
pageNo: 1, |
|
|
|
|
|
sort: '', |
|
|
|
|
|
by: 'ASC' |
|
|
|
|
|
} |
|
|
|
|
|
await BomApi.getBomPage(param1).then((res) => { |
|
|
|
|
|
console.log(res) |
|
|
|
|
|
if (res?.list?.length > 0) { |
|
|
|
|
|
newRow['bomVersion'] = res.list[0].version |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
tableData.value.push(newRow) |
|
|
|
|
|
console.log(tableData.value) |
|
|
|
|
|
index1++ |
|
|
|
|
|
setTableFormsValues(val, index1) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
// 查询页面返回——详情 |
|
|
// 查询页面返回——详情 |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
@ -286,7 +324,7 @@ const HeadButttondata = [ |
|
|
defaultButtons.defaultExportBtn({ hasPermi: 'wms:productreceipt-request-main:export' }), // 导出 |
|
|
defaultButtons.defaultExportBtn({ hasPermi: 'wms:productreceipt-request-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', |
|
@ -299,13 +337,17 @@ const HeadButttondata = [ |
|
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
// 头部按钮事件 |
|
|
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 == '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 |
|
@ -313,8 +355,10 @@ const buttonBaseClick = (val, item) => { |
|
|
} else { |
|
|
} else { |
|
|
getList() |
|
|
getList() |
|
|
} |
|
|
} |
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
} else if (val == 'filtrate') { |
|
|
} else { // 其他按钮 |
|
|
// 筛选 |
|
|
|
|
|
} else { |
|
|
|
|
|
// 其他按钮 |
|
|
console.log('其他按钮', item) |
|
|
console.log('其他按钮', item) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -330,18 +374,41 @@ 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'] |
|
|
|
|
|
? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId']) |
|
|
|
|
|
: -1 |
|
|
if (findIndex > -1 && findIndex < $index) { |
|
|
if (findIndex > -1 && findIndex < $index) { |
|
|
return [] |
|
|
return [] |
|
|
} |
|
|
} |
|
|
return [ |
|
|
return [ |
|
|
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']), hasPermi:'wms:productreceipt-request-main:close'}), // 关闭 |
|
|
defaultButtons.mainListCloseBtn({ |
|
|
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']), hasPermi:'wms:productreceipt-request-main:reAdd'}), // 重新添加 |
|
|
hide: isShowMainButton(row, ['1', '2', '3', '4', '6']), |
|
|
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:productreceipt-request-main:submit'}), // 提交审批 |
|
|
hasPermi: 'wms:productreceipt-request-main:close' |
|
|
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:productreceipt-request-main:refused'}), // 驳回 |
|
|
}), // 关闭 |
|
|
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:productreceipt-request-main:agree'}), // 审批通过 |
|
|
defaultButtons.mainListReAddBtn({ |
|
|
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']), hasPermi:'wms:productreceipt-request-main:handle'}), // 处理 |
|
|
hide: isShowMainButton(row, ['4', '5']), |
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:productreceipt-request-main:update'}), // 编辑 |
|
|
hasPermi: 'wms:productreceipt-request-main:reAdd' |
|
|
|
|
|
}), // 重新添加 |
|
|
|
|
|
defaultButtons.mainListSubmitBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['1']), |
|
|
|
|
|
hasPermi: 'wms:productreceipt-request-main:submit' |
|
|
|
|
|
}), // 提交审批 |
|
|
|
|
|
defaultButtons.mainListTurnDownBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['2']), |
|
|
|
|
|
hasPermi: 'wms:productreceipt-request-main:refused' |
|
|
|
|
|
}), // 驳回 |
|
|
|
|
|
defaultButtons.mainListApproveBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['2']), |
|
|
|
|
|
hasPermi: 'wms:productreceipt-request-main:agree' |
|
|
|
|
|
}), // 审批通过 |
|
|
|
|
|
defaultButtons.mainListHandleBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['3']), |
|
|
|
|
|
hasPermi: 'wms:productreceipt-request-main:handle' |
|
|
|
|
|
}), // 处理 |
|
|
|
|
|
defaultButtons.mainListEditBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['1']), |
|
|
|
|
|
hasPermi: 'wms:productreceipt-request-main:update' |
|
|
|
|
|
}), // 编辑 |
|
|
{ |
|
|
{ |
|
|
label: '创建标签', |
|
|
label: '创建标签', |
|
|
name: 'cjbq', |
|
|
name: 'cjbq', |
|
@ -350,79 +417,93 @@ const butttondata = (row,$index) => { |
|
|
icon: '', |
|
|
icon: '', |
|
|
color: '', |
|
|
color: '', |
|
|
hasPermi: '', |
|
|
hasPermi: '', |
|
|
link: true, // 文本展现按钮 |
|
|
link: true // 文本展现按钮 |
|
|
}, |
|
|
}, |
|
|
defaultButtons.mainListPointBtn({hide:isShowMainButton(row,['3','6','8'])}), // 标签打印 |
|
|
defaultButtons.mainListPointBtn({ hide: isShowMainButton(row, ['3', '6', '8']) }) // 标签打印 |
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:productreceipt-request-main:delete'}), // 删除 |
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:productreceipt-request-main:delete'}), // 删除 |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
if (val == 'mainClose') { // 关闭 |
|
|
if (val == 'mainClose') { |
|
|
|
|
|
// 关闭 |
|
|
await message.confirm('确认要关闭吗?') |
|
|
await message.confirm('确认要关闭吗?') |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
ProductreceiptRequestMainApi.close(row.masterId).then(() => { |
|
|
ProductreceiptRequestMainApi.close(row.masterId) |
|
|
|
|
|
.then(() => { |
|
|
message.success(t('common.updateSuccess')) |
|
|
message.success(t('common.updateSuccess')) |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
buttonBaseClick('refresh', null) |
|
|
buttonBaseClick('refresh', null) |
|
|
}).catch(err => { |
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
console.log(err) |
|
|
console.log(err) |
|
|
}) |
|
|
}) |
|
|
} else if (val == 'mainReAdd') { // 重新添加 |
|
|
} else if (val == 'mainReAdd') { |
|
|
|
|
|
// 重新添加 |
|
|
await message.confirm('确认要重新添加吗?') |
|
|
await message.confirm('确认要重新添加吗?') |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
ProductreceiptRequestMainApi.reAdd(row.masterId).then(() => { |
|
|
ProductreceiptRequestMainApi.reAdd(row.masterId) |
|
|
|
|
|
.then(() => { |
|
|
message.success(t('common.updateSuccess')) |
|
|
message.success(t('common.updateSuccess')) |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
buttonBaseClick('refresh', null) |
|
|
buttonBaseClick('refresh', null) |
|
|
}).catch(err => { |
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
console.log(err) |
|
|
console.log(err) |
|
|
}) |
|
|
}) |
|
|
} else if (val == 'mainSubmit') { // 提交审批 |
|
|
} else if (val == 'mainSubmit') { |
|
|
|
|
|
// 提交审批 |
|
|
await message.confirm('确认要提交审批吗?') |
|
|
await message.confirm('确认要提交审批吗?') |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
ProductreceiptRequestMainApi.submit(row.masterId).then(() => { |
|
|
ProductreceiptRequestMainApi.submit(row.masterId) |
|
|
|
|
|
.then(() => { |
|
|
message.success(t('common.updateSuccess')) |
|
|
message.success(t('common.updateSuccess')) |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
buttonBaseClick('refresh', null) |
|
|
buttonBaseClick('refresh', null) |
|
|
}).catch(err => { |
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
console.log(err) |
|
|
console.log(err) |
|
|
}) |
|
|
}) |
|
|
} else if (val == 'mainTurnDown') { // 驳回 |
|
|
} else if (val == 'mainTurnDown') { |
|
|
|
|
|
// 驳回 |
|
|
await message.confirm('确认要驳回吗?') |
|
|
await message.confirm('确认要驳回吗?') |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
ProductreceiptRequestMainApi.refused(row.masterId).then(() => { |
|
|
ProductreceiptRequestMainApi.refused(row.masterId) |
|
|
|
|
|
.then(() => { |
|
|
message.success(t('common.updateSuccess')) |
|
|
message.success(t('common.updateSuccess')) |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
buttonBaseClick('refresh', null) |
|
|
buttonBaseClick('refresh', null) |
|
|
}).catch(err => { |
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
console.log(err) |
|
|
console.log(err) |
|
|
}) |
|
|
}) |
|
|
} else if (val == 'mainApprove') { // 审批通过 |
|
|
} else if (val == 'mainApprove') { |
|
|
|
|
|
// 审批通过 |
|
|
await message.confirm('确认要审批通过吗?') |
|
|
await message.confirm('确认要审批通过吗?') |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
ProductreceiptRequestMainApi.agree(row.masterId).then(() => { |
|
|
ProductreceiptRequestMainApi.agree(row.masterId) |
|
|
|
|
|
.then(() => { |
|
|
message.success(t('common.updateSuccess')) |
|
|
message.success(t('common.updateSuccess')) |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
buttonBaseClick('refresh', null) |
|
|
buttonBaseClick('refresh', null) |
|
|
}).catch(err => { |
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
console.log(err) |
|
|
console.log(err) |
|
|
}) |
|
|
}) |
|
|
} else if (val == 'cjbq') { // 创建标签 |
|
|
} else if (val == 'cjbq') { |
|
|
|
|
|
// 创建标签 |
|
|
|
|
|
|
|
|
// 判断 是否已创建标签 |
|
|
// 判断 是否已创建标签 |
|
|
let isCreateLabel = false |
|
|
let isCreateLabel = false |
|
|
await PackageApi.getPackagePage({ |
|
|
await PackageApi.getPackagePage({ |
|
|
requestNumber: row.number |
|
|
requestNumber: row.number |
|
|
}).then(res => { |
|
|
}).then((res) => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
if (res.list.length > 0) isCreateLabel = true |
|
|
if (res.list.length > 0) isCreateLabel = true |
|
|
} |
|
|
} |
|
@ -445,13 +526,13 @@ const buttonTableClick = async (val, row) => { |
|
|
pageNo: 1, |
|
|
pageNo: 1, |
|
|
code: item.itemCode, |
|
|
code: item.itemCode, |
|
|
sort: '', |
|
|
sort: '', |
|
|
by: 'ASC', |
|
|
by: 'ASC' |
|
|
}).then(res => { |
|
|
}).then((res) => { |
|
|
if (res.list.length > 0) { |
|
|
if (res.list.length > 0) { |
|
|
// 判断物料 可采购 可制造 |
|
|
// 判断物料 可采购 可制造 |
|
|
if (res.list[0].enableMake == "FALSE") { |
|
|
if (res.list[0].enableMake == 'FALSE') { |
|
|
// 修改 tableform 属性 |
|
|
// 修改 tableform 属性 |
|
|
detailListTableColumns.tableFormColumns.map(itemColumns => { |
|
|
detailListTableColumns.tableFormColumns.map((itemColumns) => { |
|
|
if (itemColumns.field == 'productionLineCodePackage') { |
|
|
if (itemColumns.field == 'productionLineCodePackage') { |
|
|
// itemColumns.tableForm.isInpuFocusShow = false |
|
|
// itemColumns.tableForm.isInpuFocusShow = false |
|
|
// itemColumns.tableForm.disabled = true |
|
|
// itemColumns.tableForm.disabled = true |
|
@ -465,7 +546,7 @@ const buttonTableClick = async (val, row) => { |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
// 修改 tableform 属性 |
|
|
// 修改 tableform 属性 |
|
|
detailListTableColumns.tableFormColumns.map(itemColumns => { |
|
|
detailListTableColumns.tableFormColumns.map((itemColumns) => { |
|
|
if (itemColumns.field == 'supplierItemCode') { |
|
|
if (itemColumns.field == 'supplierItemCode') { |
|
|
itemColumns.tableForm.isInpuFocusShow = false |
|
|
itemColumns.tableForm.isInpuFocusShow = false |
|
|
itemColumns.tableForm.disabled = true |
|
|
itemColumns.tableForm.disabled = true |
|
@ -485,13 +566,13 @@ const buttonTableClick = async (val, row) => { |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
} else if (val == 'mainHandle') { |
|
|
} else if (val == 'mainHandle') { // 处理 |
|
|
// 处理 |
|
|
// 判断 是否已创建标签 |
|
|
// 判断 是否已创建标签 |
|
|
let isCreateLabel = false |
|
|
let isCreateLabel = false |
|
|
await PackageApi.getPackagePage({ |
|
|
await PackageApi.getPackagePage({ |
|
|
requestNumber: row.number |
|
|
requestNumber: row.number |
|
|
}).then(res => { |
|
|
}).then((res) => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
if (res.list.length > 0) isCreateLabel = true |
|
|
if (res.list.length > 0) isCreateLabel = true |
|
|
} |
|
|
} |
|
@ -501,18 +582,23 @@ const buttonTableClick = async (val, row) => { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
ProductreceiptRequestMainApi.handle(row.masterId).then(() => { |
|
|
ProductreceiptRequestMainApi.handle(row.masterId) |
|
|
|
|
|
.then(() => { |
|
|
message.success(t('common.updateSuccess')) |
|
|
message.success(t('common.updateSuccess')) |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
buttonBaseClick('refresh', null) |
|
|
buttonBaseClick('refresh', null) |
|
|
}).catch(err => { |
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
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 == 'point') { // 标签打印 |
|
|
} else if (val == 'point') { |
|
|
|
|
|
// 标签打印 |
|
|
handlePoint(row) |
|
|
handlePoint(row) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -524,7 +610,7 @@ const openForm =async (type: string, row?: number) => { |
|
|
// 编辑时 车间代码不可修改 |
|
|
// 编辑时 车间代码不可修改 |
|
|
if (type == 'update') { |
|
|
if (type == 'update') { |
|
|
// 修改 tableform 属性 |
|
|
// 修改 tableform 属性 |
|
|
ProductreceiptRequestMain.allSchemas.formSchema.map(itemColumns => { |
|
|
ProductreceiptRequestMain.allSchemas.formSchema.map((itemColumns) => { |
|
|
if (itemColumns.field == 'workshopCode') { |
|
|
if (itemColumns.field == 'workshopCode') { |
|
|
itemColumns.componentProps.isSearchList = false |
|
|
itemColumns.componentProps.isSearchList = false |
|
|
itemColumns.componentProps.disabled = true |
|
|
itemColumns.componentProps.disabled = true |
|
@ -532,7 +618,7 @@ const openForm =async (type: string, row?: number) => { |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
// 修改 tableform 属性 |
|
|
// 修改 tableform 属性 |
|
|
ProductreceiptRequestMain.allSchemas.formSchema.map(itemColumns => { |
|
|
ProductreceiptRequestMain.allSchemas.formSchema.map((itemColumns) => { |
|
|
if (itemColumns.field == 'workshopCode') { |
|
|
if (itemColumns.field == 'workshopCode') { |
|
|
itemColumns.componentProps.isSearchList = true |
|
|
itemColumns.componentProps.isSearchList = true |
|
|
itemColumns.componentProps.disabled = false |
|
|
itemColumns.componentProps.disabled = false |
|
@ -547,7 +633,9 @@ const { wsCache } = useCache() |
|
|
/** 详情操作 */ |
|
|
/** 详情操作 */ |
|
|
const detailRef = ref() |
|
|
const detailRef = ref() |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
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)) |
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'requestProductreceiptMain') |
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'requestProductreceiptMain') |
|
|
} |
|
|
} |
|
@ -564,7 +652,8 @@ const handleDelete = async (id: number) => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
buttonBaseClick('refresh', null) |
|
|
buttonBaseClick('refresh', null) |
|
|
} catch {}finally{ |
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -578,7 +667,9 @@ const handleExport = async () => { |
|
|
// 发起导出 |
|
|
// 发起导出 |
|
|
exportLoading.value = true |
|
|
exportLoading.value = true |
|
|
const excelTitle = ref(route.meta.title) |
|
|
const excelTitle = ref(route.meta.title) |
|
|
const data = await ProductreceiptRequestMainApi.exportProductreceiptRequestMain(tableObject.params) |
|
|
const data = await ProductreceiptRequestMainApi.exportProductreceiptRequestMain( |
|
|
|
|
|
tableObject.params |
|
|
|
|
|
) |
|
|
download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) |
|
|
download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) |
|
|
} catch { |
|
|
} catch { |
|
|
} finally { |
|
|
} finally { |
|
@ -590,7 +681,7 @@ const handleExport = async () => { |
|
|
* tableForm方法 |
|
|
* tableForm方法 |
|
|
*/ |
|
|
*/ |
|
|
const tableFormKeys = {} |
|
|
const tableFormKeys = {} |
|
|
ProductreceiptRequestDetail.allSchemas.tableFormColumns.forEach(item => { |
|
|
ProductreceiptRequestDetail.allSchemas.tableFormColumns.forEach((item) => { |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
}) |
|
|
}) |
|
|
const tableData = ref([]) |
|
|
const tableData = ref([]) |
|
@ -609,7 +700,7 @@ const handleDeleteTable = (item, index) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
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) => { |
|
@ -618,11 +709,13 @@ const submitForm = async (formType, submitData) => { |
|
|
data.id = data.masterId |
|
|
data.id = data.masterId |
|
|
} |
|
|
} |
|
|
tableData.value.forEach((row, index) => { |
|
|
tableData.value.forEach((row, index) => { |
|
|
row['expireDate'] = row['expireTime']?addDay(row['produceDate'],row['expireTime']).valueOf():dayjs('2099-12-31').valueOf() |
|
|
row['expireDate'] = row['expireTime'] |
|
|
|
|
|
? addDay(row['produceDate'], row['expireTime']).valueOf() |
|
|
|
|
|
: dayjs('2099-12-31').valueOf() |
|
|
}) |
|
|
}) |
|
|
data.type = 'predict' |
|
|
data.type = 'predict' |
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
if(data.subList.find(item => (item.qty <= 0))) { |
|
|
if (data.subList.find((item) => item.qty <= 0)) { |
|
|
message.warning('数量必须大于0') |
|
|
message.warning('数量必须大于0') |
|
|
formRef.value.formLoading = false |
|
|
formRef.value.formLoading = false |
|
|
return |
|
|
return |
|
@ -681,14 +774,16 @@ const submitFormLabel = async (formType, submitData) => { |
|
|
data.id = data.masterId |
|
|
data.id = data.masterId |
|
|
} |
|
|
} |
|
|
try { |
|
|
try { |
|
|
console.log("aaaaa",data); |
|
|
console.log('aaaaa', data) |
|
|
data.subList = detatableData.tableList |
|
|
data.subList = detatableData.tableList |
|
|
console.log("bbbbb",data); |
|
|
console.log('bbbbb', data) |
|
|
// 创建标签 要物料库区配置表中 入库包装规格 |
|
|
// 创建标签 要物料库区配置表中 入库包装规格 |
|
|
await ProductreceiptRequestMainApi.productCreateLabel(data).then(res => { |
|
|
await ProductreceiptRequestMainApi.productCreateLabel(data) |
|
|
|
|
|
.then((res) => { |
|
|
isCreateLabel.value = true |
|
|
isCreateLabel.value = true |
|
|
message.success('创建标签成功') |
|
|
message.success('创建标签成功') |
|
|
}).catch(err => { |
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
isCreateLabel.value = false |
|
|
isCreateLabel.value = false |
|
|
console.log(err) |
|
|
console.log(err) |
|
|
message.error('创建标签失败') |
|
|
message.error('创建标签失败') |
|
@ -701,7 +796,8 @@ const submitFormLabel = async (formType, submitData) => { |
|
|
|
|
|
|
|
|
// 查看 Bom 按钮回调事件 |
|
|
// 查看 Bom 按钮回调事件 |
|
|
const tableFormButton = async (val, row) => { |
|
|
const tableFormButton = async (val, row) => { |
|
|
if (val == 'bom') { // 查看 bom |
|
|
if (val == 'bom') { |
|
|
|
|
|
// 查看 bom |
|
|
bomModelVisible.value = true |
|
|
bomModelVisible.value = true |
|
|
DialogTitle.value = '物料代码【' + row.itemCode + '】——Bom信息' |
|
|
DialogTitle.value = '物料代码【' + row.itemCode + '】——Bom信息' |
|
|
detatableDataBom.params = { |
|
|
detatableDataBom.params = { |
|
@ -713,14 +809,14 @@ const tableFormButton = async (val , row) => { |
|
|
|
|
|
|
|
|
// 子表新增/编辑校验 |
|
|
// 子表新增/编辑校验 |
|
|
const detailValidate = (data) => { |
|
|
const detailValidate = (data) => { |
|
|
let tag = false; |
|
|
let tag = false |
|
|
if (data.qty <= 0) { |
|
|
if (data.qty <= 0) { |
|
|
message.warning('数量必须大于0') |
|
|
message.warning('数量必须大于0') |
|
|
tag = false; |
|
|
tag = false |
|
|
return tag; |
|
|
return tag |
|
|
} else { |
|
|
} else { |
|
|
tag = true; |
|
|
tag = true |
|
|
return tag; |
|
|
return tag |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -730,7 +826,8 @@ const handlePoint = async (row) => { |
|
|
// 查询是否已创建过标签 |
|
|
// 查询是否已创建过标签 |
|
|
await PackageApi.getPackagePage({ |
|
|
await PackageApi.getPackagePage({ |
|
|
requestNumber: row.number |
|
|
requestNumber: row.number |
|
|
}).then((res) => { |
|
|
}) |
|
|
|
|
|
.then((res) => { |
|
|
if (res.list.length > 0) { |
|
|
if (res.list.length > 0) { |
|
|
isCreateLabel.value = true |
|
|
isCreateLabel.value = true |
|
|
if (res.list[0].productionLineCode != null) { |
|
|
if (res.list[0].productionLineCode != null) { |
|
@ -741,7 +838,8 @@ const handlePoint = async (row) => { |
|
|
} else { |
|
|
} else { |
|
|
isCreateLabel.value = false |
|
|
isCreateLabel.value = false |
|
|
} |
|
|
} |
|
|
}).catch(err => { |
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
isCreateLabel.value = false |
|
|
isCreateLabel.value = false |
|
|
console.log(err) |
|
|
console.log(err) |
|
|
}) |
|
|
}) |
|
@ -765,7 +863,7 @@ const searchTableRef = ref() |
|
|
// |
|
|
// |
|
|
const labelPrint = async (row) => { |
|
|
const labelPrint = async (row) => { |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
const defaultParams = {'moduleName':'productreceipt_predict','recordNumber':row.number} |
|
|
const defaultParams = { moduleName: 'productreceipt_predict', recordNumber: row.number } |
|
|
const { tableObject: tableObjectPrint, tableMethods } = useTable({ |
|
|
const { tableObject: tableObjectPrint, tableMethods } = useTable({ |
|
|
defaultParams, |
|
|
defaultParams, |
|
|
getListApi: PackageApi.getLabelDetailPage // 分页接口 |
|
|
getListApi: PackageApi.getLabelDetailPage // 分页接口 |
|
@ -779,7 +877,7 @@ const labelPrint = async (row) => { |
|
|
tableColumns.forEach((item) => { |
|
|
tableColumns.forEach((item) => { |
|
|
item.width = item.table?.width || 150 |
|
|
item.width = item.table?.width || 150 |
|
|
}) |
|
|
}) |
|
|
searchTableRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true) |
|
|
searchTableRef.value.openData('标签信息', tableObjectPrint, { tableColumns }, true) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 批量打印--预生产收货 |
|
|
// 批量打印--预生产收货 |
|
@ -790,12 +888,13 @@ const searchTableSuccessLabel = async (formField, searchField, val, formRef, typ |
|
|
// rows = [...rows,...item.selectionRows.map(item1=>item1.number)] |
|
|
// rows = [...rows,...item.selectionRows.map(item1=>item1.number)] |
|
|
// }) |
|
|
// }) |
|
|
if (val.length == 0) { |
|
|
if (val.length == 0) { |
|
|
message.warning("请先选择要打印的数据!") |
|
|
message.warning('请先选择要打印的数据!') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
// window.open(src.value + '&asn_number=' + val.map(item1=>item1.number).join(',')) |
|
|
// window.open(src.value + '&asn_number=' + val.map(item1=>item1.number).join(',')) |
|
|
|
|
|
|
|
|
await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => { |
|
|
await PackageApi.batchPrintingLable(val.map((item1) => item1.number).join(',')) |
|
|
|
|
|
.then((res) => { |
|
|
console.log(res) |
|
|
console.log(res) |
|
|
if (labelType.value == 'cg') { |
|
|
if (labelType.value == 'cg') { |
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
@ -804,25 +903,26 @@ const searchTableSuccessLabel = async (formField, searchField, val, formRef, typ |
|
|
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) |
|
|
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) |
|
|
window.open(src.value + '&asn_number=' + res) |
|
|
window.open(src.value + '&asn_number=' + res) |
|
|
} |
|
|
} |
|
|
}).catch(err => { |
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
console.log(err) |
|
|
console.log(err) |
|
|
message.error('创建标签失败') |
|
|
message.error('创建标签失败') |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
const getDefaultWorkshopCode = async () => { |
|
|
const getDefaultWorkshopCode = async () => { |
|
|
let res = await WorkshopApi.getWorkshopPage({ |
|
|
const data = await ConfigApi.getConfigPage({ |
|
|
available: "TRUE" |
|
|
'key':'predictProductreceiptWorkshopCode', |
|
|
|
|
|
'pageNo':1, |
|
|
|
|
|
'pageSize':10 |
|
|
}) |
|
|
}) |
|
|
if(res&&res.list.length>0){ |
|
|
if(data&&data.list&&data.list.length>0){ |
|
|
if(res.list.find(item=>item.code=='PRC')){ |
|
|
ProductreceiptRequestMain.allSchemas.formSchema.map((itemColumns) => { |
|
|
ProductreceiptRequestMain.allSchemas.formSchema.map(itemColumns => { |
|
|
|
|
|
if (itemColumns.field == 'workshopCode') { |
|
|
if (itemColumns.field == 'workshopCode') { |
|
|
itemColumns.value = 'PRC' |
|
|
itemColumns.value = data.list[0]['value'] |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
getDefaultWorkshopCode() |
|
|
getDefaultWorkshopCode() |
|
|