Browse Source

HL-5465预生产和装配报工申请中修改物料选择方法

hella_online_20240821
zhang_li 3 months ago
parent
commit
cae2a034c1
  1. 357
      src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue
  2. 19
      src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts
  3. 57
      src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue
  4. 24
      src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/productreceiptAssembleRequestMain.data.ts

357
src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue

@ -1,7 +1,14 @@
<template>
<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>
<!-- 列表头部 -->
@ -17,7 +24,8 @@
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -34,7 +42,10 @@
</el-button>
</template>
<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>
</Table>
</ContentWrap>
@ -43,7 +54,7 @@
<BasicForm
ref="formRef"
:isOpenSearchTable="true"
fieldTableColumn="workStationCode"
fieldTableColumn="itemCode"
@success="getList"
:rules="ProductreceiptRequestMainRules"
:formAllSchemas="ProductreceiptRequestMain.allSchemas"
@ -61,11 +72,17 @@
@submitForm="submitForm"
>
<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"
style="width: 100%"
:disabled="true"
:placeholder="t('ts.选择日期')"/>
:placeholder="t('ts.选择日期')"
/>
</template>
</BasicForm>
@ -123,21 +140,37 @@
</Dialog>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/productreceipt-request-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" :extend="'predict'"/>
<ImportForm
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>
<script setup lang="ts">
import download from '@/utils/download'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { ProductreceiptRequestMain,ProductreceiptRequestMainRules,ProductreceiptRequestDetail,
ProductreceiptRequestDetailRules, BackflushDetailRequest,
ProductreceiptRequestLabel,ProductreceiptRequestLabelRules } from './productreceiptRequestMain.data'
import {
SupplierdeliverRequestPackage
} from '../../../purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts'
ProductreceiptRequestMain,
ProductreceiptRequestMainRules,
ProductreceiptRequestDetail,
ProductreceiptRequestDetailRules,
BackflushDetailRequest,
ProductreceiptRequestLabel,
ProductreceiptRequestLabelRules
} from './productreceiptRequestMain.data'
import { SupplierdeliverRequestPackage } from '../../../purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts'
// } from '../../../supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data'
import * as ProductreceiptRequestMainApi from '@/api/wms/productreceiptRequestMain'
import * as ProductreceiptRequestDetailApi from '@/api/wms/productreceiptRequestDetail'
@ -149,7 +182,7 @@ import { formatTime } from '@/utils/index'
import { getAccessToken } from '@/utils/auth'
import dayjs from 'dayjs'
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 * as WorkshopApi from '@/api/wms/workshop'
@ -163,9 +196,13 @@ const { t } = useI18n() // 国际化
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...ProductreceiptRequestMain.allSchemas.tableColumns,...ProductreceiptRequestDetail.allSchemas.tableMainColumns])
const tableColumns = ref([
...ProductreceiptRequestMain.allSchemas.tableColumns,
...ProductreceiptRequestDetail.allSchemas.tableMainColumns
])
// table
const buttondataTable = ref([{
const buttondataTable = ref([
{
label: 'Bom',
name: 'bom',
hide: false,
@ -173,8 +210,9 @@ const buttondataTable = ref([{
icon: '',
color: '',
hasPermi: '',
link: true, //
}])
link: true //
}
])
//
const detailListTableColumns = ProductreceiptRequestLabel.allSchemas
@ -194,12 +232,10 @@ const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useT
})
const { getList: getDetailListBom } = detatableMethodsBom
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
@ -217,52 +253,53 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
message.warning(`物料${val[0]['itemCode']}已经存在`)
return
}
row['uom'] = val[0]['uom']
row['produceDate'] = dayjs().valueOf()
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)
})
const index1 = 0
setTableFormsValues(val, index1)
} else {
row[formField] = val[0][searchField]
}
} else {
const setV = {}
setV[formField] = val[0][searchField]
if ('workshopCode' == formField) {
 //
//
setV['productionLineCode'] = ''
tableData.value = []
} else if ('productionLineCode' == formField) {
 //线
//线
tableData.value = []
}
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) => {
nextTick(() => {
@ -286,7 +323,7 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'wms:productreceipt-request-main:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -299,13 +336,17 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') { //
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') { //
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
} else if (val == 'refresh') {
//
if (tableObject.params.filters && tableObject.params.filters.length > 0) {
searchFormClick({
filters: tableObject.params.filters
@ -313,8 +354,10 @@ const buttonBaseClick = (val, item) => {
} else {
getList()
}
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
@ -330,18 +373,41 @@ const isShowMainButton = (row,val) => {
// -
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) {
return []
}
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']), hasPermi:'wms:productreceipt-request-main:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']), 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'}), //
defaultButtons.mainListCloseBtn({
hide: isShowMainButton(row, ['1', '2', '3', '4', '6']),
hasPermi: 'wms:productreceipt-request-main:close'
}), //
defaultButtons.mainListReAddBtn({
hide: isShowMainButton(row, ['4', '5']),
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: '创建标签',
name: 'cjbq',
@ -350,79 +416,93 @@ const butttondata = (row,$index) => {
icon: '',
color: '',
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'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { //
if (val == 'mainClose') {
//
await message.confirm('确认要关闭吗?')
tableObject.loading = true
ProductreceiptRequestMainApi.close(row.masterId).then(() => {
ProductreceiptRequestMainApi.close(row.masterId)
.then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh', null)
}).catch(err => {
})
.catch((err) => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainReAdd') { //
} else if (val == 'mainReAdd') {
//
await message.confirm('确认要重新添加吗?')
tableObject.loading = true
ProductreceiptRequestMainApi.reAdd(row.masterId).then(() => {
ProductreceiptRequestMainApi.reAdd(row.masterId)
.then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh', null)
}).catch(err => {
})
.catch((err) => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainSubmit') { //
} else if (val == 'mainSubmit') {
//
await message.confirm('确认要提交审批吗?')
tableObject.loading = true
ProductreceiptRequestMainApi.submit(row.masterId).then(() => {
ProductreceiptRequestMainApi.submit(row.masterId)
.then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh', null)
}).catch(err => {
})
.catch((err) => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainTurnDown') { //
} else if (val == 'mainTurnDown') {
//
await message.confirm('确认要驳回吗?')
tableObject.loading = true
ProductreceiptRequestMainApi.refused(row.masterId).then(() => {
ProductreceiptRequestMainApi.refused(row.masterId)
.then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh', null)
}).catch(err => {
})
.catch((err) => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainApprove') { //
} else if (val == 'mainApprove') {
//
await message.confirm('确认要审批通过吗?')
tableObject.loading = true
ProductreceiptRequestMainApi.agree(row.masterId).then(() => {
ProductreceiptRequestMainApi.agree(row.masterId)
.then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh', null)
}).catch(err => {
})
.catch((err) => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'cjbq') { //
} else if (val == 'cjbq') {
//
//
let isCreateLabel = false
await PackageApi.getPackagePage({
requestNumber: row.number
}).then(res => {
}).then((res) => {
if (res) {
if (res.list.length > 0) isCreateLabel = true
}
@ -445,13 +525,13 @@ const buttonTableClick = async (val, row) => {
pageNo: 1,
code: item.itemCode,
sort: '',
by: 'ASC',
}).then(res => {
by: 'ASC'
}).then((res) => {
if (res.list.length > 0) {
//
if (res.list[0].enableMake == "FALSE") {
if (res.list[0].enableMake == 'FALSE') {
// tableform
detailListTableColumns.tableFormColumns.map(itemColumns => {
detailListTableColumns.tableFormColumns.map((itemColumns) => {
if (itemColumns.field == 'productionLineCodePackage') {
// itemColumns.tableForm.isInpuFocusShow = false
// itemColumns.tableForm.disabled = true
@ -465,7 +545,7 @@ const buttonTableClick = async (val, row) => {
})
} else {
// tableform
detailListTableColumns.tableFormColumns.map(itemColumns => {
detailListTableColumns.tableFormColumns.map((itemColumns) => {
if (itemColumns.field == 'supplierItemCode') {
itemColumns.tableForm.isInpuFocusShow = false
itemColumns.tableForm.disabled = true
@ -485,13 +565,13 @@ const buttonTableClick = async (val, row) => {
}
})
})
} else if (val == 'mainHandle') { //
} else if (val == 'mainHandle') {
//
//
let isCreateLabel = false
await PackageApi.getPackagePage({
requestNumber: row.number
}).then(res => {
}).then((res) => {
if (res) {
if (res.list.length > 0) isCreateLabel = true
}
@ -501,18 +581,23 @@ const buttonTableClick = async (val, row) => {
return
}
tableObject.loading = true
ProductreceiptRequestMainApi.handle(row.masterId).then(() => {
ProductreceiptRequestMainApi.handle(row.masterId)
.then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh', null)
}).catch(err => {
})
.catch((err) => {
console.log(err)
})
} else if (val == 'edit') { //
} else if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.masterId)
} else if (val == 'point') { //
} else if (val == 'point') {
//
handlePoint(row)
}
}
@ -524,7 +609,7 @@ const openForm =async (type: string, row?: number) => {
//
if (type == 'update') {
// tableform
ProductreceiptRequestMain.allSchemas.formSchema.map(itemColumns => {
ProductreceiptRequestMain.allSchemas.formSchema.map((itemColumns) => {
if (itemColumns.field == 'workshopCode') {
itemColumns.componentProps.isSearchList = false
itemColumns.componentProps.disabled = true
@ -532,7 +617,7 @@ const openForm =async (type: string, row?: number) => {
})
} else {
// tableform
ProductreceiptRequestMain.allSchemas.formSchema.map(itemColumns => {
ProductreceiptRequestMain.allSchemas.formSchema.map((itemColumns) => {
if (itemColumns.field == 'workshopCode') {
itemColumns.componentProps.isSearchList = true
itemColumns.componentProps.disabled = false
@ -547,7 +632,9 @@ const { wsCache } = useCache()
/** 详情操作 */
const detailRef = ref()
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))
detailRef.value.openDetail(row, titleName, titleValue, 'requestProductreceiptMain')
}
@ -564,7 +651,8 @@ const handleDelete = async (id: number) => {
tableObject.loading = false
//
buttonBaseClick('refresh', null)
} catch {}finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -578,7 +666,9 @@ const handleExport = async () => {
//
exportLoading.value = true
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`)
} catch {
} finally {
@ -590,7 +680,7 @@ const handleExport = async () => {
* tableForm方法
*/
const tableFormKeys = {}
ProductreceiptRequestDetail.allSchemas.tableFormColumns.forEach(item => {
ProductreceiptRequestDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
@ -609,7 +699,7 @@ const handleDeleteTable = (item, index) => {
}
}
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) => {
@ -618,11 +708,13 @@ const submitForm = async (formType, submitData) => {
data.id = data.masterId
}
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.subList = tableData.value //
if(data.subList.find(item => (item.qty <= 0))) {
if (data.subList.find((item) => item.qty <= 0)) {
message.warning('数量必须大于0')
formRef.value.formLoading = false
return
@ -681,14 +773,16 @@ const submitFormLabel = async (formType, submitData) => {
data.id = data.masterId
}
try {
console.log("aaaaa",data);
console.log('aaaaa', data)
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
message.success('创建标签成功')
}).catch(err => {
})
.catch((err) => {
isCreateLabel.value = false
console.log(err)
message.error('创建标签失败')
@ -701,7 +795,8 @@ const submitFormLabel = async (formType, submitData) => {
// Bom
const tableFormButton = async (val, row) => {
if (val == 'bom') { // bom
if (val == 'bom') {
// bom
bomModelVisible.value = true
DialogTitle.value = '物料代码【' + row.itemCode + '】——Bom信息'
detatableDataBom.params = {
@ -713,14 +808,14 @@ const tableFormButton = async (val , row) => {
// /
const detailValidate = (data) => {
let tag = false;
let tag = false
if (data.qty <= 0) {
message.warning('数量必须大于0')
tag = false;
return tag;
tag = false
return tag
} else {
tag = true;
return tag;
tag = true
return tag
}
}
@ -730,7 +825,8 @@ const handlePoint = async (row) => {
//
await PackageApi.getPackagePage({
requestNumber: row.number
}).then((res) => {
})
.then((res) => {
if (res.list.length > 0) {
isCreateLabel.value = true
if (res.list[0].productionLineCode != null) {
@ -741,7 +837,8 @@ const handlePoint = async (row) => {
} else {
isCreateLabel.value = false
}
}).catch(err => {
})
.catch((err) => {
isCreateLabel.value = false
console.log(err)
})
@ -765,7 +862,7 @@ const searchTableRef = ref()
//
const labelPrint = async (row) => {
tableObject.loading = true
const defaultParams = {'moduleName':'productreceipt_predict','recordNumber':row.number}
const defaultParams = { moduleName: 'productreceipt_predict', recordNumber: row.number }
const { tableObject: tableObjectPrint, tableMethods } = useTable({
defaultParams,
getListApi: PackageApi.getLabelDetailPage //
@ -779,7 +876,7 @@ const labelPrint = async (row) => {
tableColumns.forEach((item) => {
item.width = item.table?.width || 150
})
searchTableRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true)
searchTableRef.value.openData('标签信息', tableObjectPrint, { tableColumns }, true)
}
// --
@ -790,12 +887,13 @@ const searchTableSuccessLabel = async (formField, searchField, val, formRef, typ
// rows = [...rows,...item.selectionRows.map(item1=>item1.number)]
// })
if (val.length == 0) {
message.warning("请先选择要打印的数据!")
message.warning('请先选择要打印的数据!')
return
}
// 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)
if (labelType.value == 'cg') {
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
@ -804,18 +902,19 @@ const searchTableSuccessLabel = async (formField, searchField, val, formRef, typ
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
window.open(src.value + '&asn_number=' + res)
}
}).catch(err => {
})
.catch((err) => {
console.log(err)
message.error('创建标签失败')
})
}
const getDefaultWorkshopCode = async () => {
let res = await WorkshopApi.getWorkshopPage({
available: "TRUE"
available: 'TRUE'
})
if (res && res.list.length > 0) {
if(res.list.find(item=>item.code=='PRC')){
ProductreceiptRequestMain.allSchemas.formSchema.map(itemColumns => {
if (res.list.find((item) => item.code == 'PRC')) {
ProductreceiptRequestMain.allSchemas.formSchema.map((itemColumns) => {
if (itemColumns.field == 'workshopCode') {
itemColumns.value = 'PRC'
}

19
src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts

@ -661,14 +661,14 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
width: 150
},
tableForm: {
multiple: true,
disabled:true,
// isInpuFocusShow: true,
enterSearch: true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择工位代码',
searchField: 'code',
searchTitle: '工位信息',
searchAllSchemas: Workstation.allSchemas,
searchPage: WorkstationApi.getWorkstationPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
@ -679,8 +679,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
message: '请填写生产线代码!',
isMainValue: true
}],
verificationPage: WorkstationApi.getWorkstationByCodes, // 校验数去焦点输入是否正确的方法
isShowTableFormSearch: true,
isRepeat: true,//tableForm下方输入框是否可以重复添加该条数据
verificationParams: [{
key: 'code',
action: '==',
@ -694,7 +693,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择工位代码',
searchField: 'code',
searchTitle: '工位信息',
@ -741,6 +740,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
value: 'TRUE',
isMainValue: false
}],
isRepeat: true,//tableForm下方输入框是否可以重复添加该条数据
verificationParams: [{
key: 'code',
action: '==',
@ -909,7 +909,9 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
},
tableForm: {
// enterSearch:true,
isInpuFocusShow: true,
disabled: true,
multiple: true,
isInpuFocusShow: false,
searchListPlaceholder: '请选择物料代码',
searchField: 'itemCode',
searchTitle: '生产线物料关系信息',
@ -925,6 +927,9 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
message: '请填写生产线代码!',
isMainValue: true
}],
verificationPage: ProductionlineitemApi.getProductionLineCodelistByCodes, // 校验数去焦点输入是否正确的方法
isShowTableFormSearch: true,
verificationParams: [{
key: 'itemCode',
action: '==',

57
src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue

@ -43,7 +43,7 @@
<BasicForm
ref="formRef"
:isOpenSearchTable="true"
fieldTableColumn="workStationCode"
fieldTableColumn="itemCode"
@success="getList"
:rules="ProductreceiptRequestMainRules"
:formAllSchemas="ProductreceiptRequestMain.allSchemas"
@ -217,32 +217,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
message.warning(`物料${val[0]['itemCode']}已经存在`)
return
}
row['uom'] = val[0]['uom']
row['produceDate'] = dayjs().valueOf()
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)
})
const index1 = 0
setTableFormsValues(val, index1)
} else{
row[formField] = val[0][searchField]
}
@ -261,6 +237,33 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}
})
}
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 ) => {
nextTick(() => {

24
src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/productreceiptAssembleRequestMain.data.ts

@ -671,14 +671,14 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
width: 150
},
tableForm: {
multiple: true,
disabled:true,
// isInpuFocusShow: true,
enterSearch: true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择工位代码',
searchField: 'code',
searchTitle: '工位信息',
searchAllSchemas: Workstation.allSchemas,
searchPage: WorkstationApi.getWorkstationPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
@ -689,8 +689,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
message: '请填写生产线代码!',
isMainValue: true
}],
verificationPage: WorkstationApi.getWorkstationByCodes, // 校验数去焦点输入是否正确的方法
isShowTableFormSearch: true,
isRepeat: true,//tableForm下方输入框是否可以重复添加该条数据
verificationParams: [{
key: 'code',
action: '==',
@ -703,7 +702,8 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
enterSearch: true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择工位代码',
searchField: 'code',
searchTitle: '工位信息',
@ -750,6 +750,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
value: 'TRUE',
isMainValue: false
}],
isRepeat: true,//tableForm下方输入框是否可以重复添加该条数据
verificationParams: [{
key: 'code',
action: '==',
@ -760,9 +761,9 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
}], // 失去焦点校验参数
},
form: {
enterSearch: true,
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true,
searchListPlaceholder: '请选择工序代码',
searchField: 'code',
@ -912,13 +913,15 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
label: '物料代码',
field: 'itemCode',
sort: 'custom',
sortTableDefault: 1003,
table: {
width: 150
},
sortTableDefault:1003,
tableForm: {
// enterSearch:true,
isInpuFocusShow: true,
disabled: true,
multiple: true,
isInpuFocusShow: false,
searchListPlaceholder: '请选择物料代码',
searchField: 'itemCode',
searchTitle: '生产线物料关系信息',
@ -934,6 +937,9 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
message: '请填写生产线代码!',
isMainValue: true
}],
verificationPage: ProductionlineitemApi.getProductionLineCodelistByCodes, // 校验数去焦点输入是否正确的方法
isShowTableFormSearch: true,
verificationParams: [{
key: 'itemCode',
action: '==',

Loading…
Cancel
Save