|
@ -67,7 +67,7 @@ |
|
|
ref="formLabelRef" |
|
|
ref="formLabelRef" |
|
|
@success="getList" |
|
|
@success="getList" |
|
|
:tableAllSchemas="detailListTableColumns" |
|
|
:tableAllSchemas="detailListTableColumns" |
|
|
:tableFormRules="ProductionreturnRequestDetailLabelRules" |
|
|
:tableFormRules="RelegateRequestDetailLabelRules" |
|
|
:tableData="detatableData.tableList" |
|
|
:tableData="detatableData.tableList" |
|
|
:isBusiness="true" |
|
|
:isBusiness="true" |
|
|
:isShowButton="false" |
|
|
:isShowButton="false" |
|
@ -80,11 +80,13 @@ |
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm ref="importFormRef" url="/wms/relegate-request-main/import" :importTemplateData="importTemplateData" |
|
|
<ImportForm ref="importFormRef" url="/wms/relegate-request-main/import" :importTemplateData="importTemplateData" |
|
|
@success="importSuccess" /> |
|
|
@success="importSuccess" /> |
|
|
|
|
|
<!-- 标签打印 --> |
|
|
|
|
|
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" /> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { RelegateRequestMain, RelegateRequestMainRules, RelegateRequestDetail, RelegateRequestDetailRules } from './relegateRequestMain.data' |
|
|
import { RelegateRequestMain, RelegateRequestMainRules, RelegateRequestDetail, RelegateRequestDetailRules,RelegateRequestDetailLabel,RelegateRequestDetailLabelRules } from './relegateRequestMain.data' |
|
|
import * as RelegateRequestMainApi from '@/api/wms/relegateRequestMain' |
|
|
import * as RelegateRequestMainApi from '@/api/wms/relegateRequestMain' |
|
|
import * as RelegateRequestDetailApi from '@/api/wms/relegateRequestDetail' |
|
|
import * as RelegateRequestDetailApi from '@/api/wms/relegateRequestDetail' |
|
|
import * as ItembasicApi from '@/api/wms/itembasic' |
|
|
import * as ItembasicApi from '@/api/wms/itembasic' |
|
@ -92,12 +94,11 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
import { ProductreceiptRequestLabel,ProductreceiptRequestLabelRules } from '../../../../productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data' |
|
|
|
|
|
import * as ProductionitemcodeSpareitemcodeApi from '@/api/wms/productionitemcodeSpareitemcode' |
|
|
import * as ProductionitemcodeSpareitemcodeApi from '@/api/wms/productionitemcodeSpareitemcode' |
|
|
import * as PackageApi from "@/api/wms/package"; |
|
|
import * as PackageApi from "@/api/wms/package"; |
|
|
import * as ProductionreturnRequestMainApi from '@/api/wms/productionreturnRequestMain' |
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
import { ProductionreturnRequestMain,ProductionreturnRequestMainRules,ProductionreturnRequestDetail,ProductionreturnRequestDetailRules,ProductionreturnRequestDetailLabel,ProductionreturnRequestDetailLabelRules, SupplierdeliverRequestPackage } from '@/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts' |
|
|
import { getJmreportBaseUrl } from '@/utils/systemParam' |
|
|
import * as ProductionreturnRequestDetailApi from '@/api/wms/productionreturnRequestDetail' |
|
|
import * as ProductionlineitemApi from '@/api/wms/productionlineitem' |
|
|
|
|
|
|
|
|
defineOptions({ name: 'RelegateRequestMain' }) |
|
|
defineOptions({ name: 'RelegateRequestMain' }) |
|
|
|
|
|
|
|
@ -111,12 +112,12 @@ routeName.value = route.name |
|
|
const tableColumns = ref([...RelegateRequestMain.allSchemas.tableColumns, ...RelegateRequestDetail.allSchemas.tableMainColumns]) |
|
|
const tableColumns = ref([...RelegateRequestMain.allSchemas.tableColumns, ...RelegateRequestDetail.allSchemas.tableMainColumns]) |
|
|
const isShowButton = ref(true) |
|
|
const isShowButton = ref(true) |
|
|
//创建标签 |
|
|
//创建标签 |
|
|
const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas |
|
|
const detailListTableColumns = RelegateRequestDetailLabel.allSchemas |
|
|
const isCreateLabel = ref(false) |
|
|
const isCreateLabel = ref(false) |
|
|
const formLabelRef = ref() |
|
|
const formLabelRef = ref() |
|
|
const labelType = ref('') // 标签类别 采购还是制造等 |
|
|
const labelType = ref('') // 标签类别 采购还是制造等 |
|
|
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ |
|
|
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ |
|
|
getListApi: ProductionreturnRequestDetailApi.getProductionreturnRequestDetailPage |
|
|
getListApi: RelegateRequestDetailApi.getRelegateRequestDetailPage |
|
|
}) |
|
|
}) |
|
|
const { getList:getDetailList } = detatableMethods |
|
|
const { getList:getDetailList } = detatableMethods |
|
|
// 创建标签 |
|
|
// 创建标签 |
|
@ -126,23 +127,53 @@ const submitFormLabel = async (formType, submitData) => { |
|
|
data.id = data.masterId |
|
|
data.id = data.masterId |
|
|
} |
|
|
} |
|
|
try { |
|
|
try { |
|
|
alert('做一下接口') |
|
|
// alert('做一下接口') |
|
|
// detatableData.tableList.forEach(async (item) => { |
|
|
console.log("aaaaa",data); |
|
|
|
|
|
data.subList=detatableData.tableList |
|
|
|
|
|
console.log("bbbbb",data); |
|
|
// item.toLocationCode = item.fromLocationCode |
|
|
// item.toLocationCode = item.fromLocationCode |
|
|
// await PackageApi.createPackageLabel(item).then(() => { |
|
|
await RelegateRequestMainApi.relegateCreateLabel(data).then(() => { |
|
|
// 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('创建标签失败') |
|
|
// }) |
|
|
}) |
|
|
// }) |
|
|
|
|
|
} finally { |
|
|
} finally { |
|
|
formLabelRef.value.formLoading = false |
|
|
formLabelRef.value.formLoading = false |
|
|
formLabelRef.value.dialogVisible = false |
|
|
formLabelRef.value.dialogVisible = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 标签打印 |
|
|
|
|
|
const handlePoint = async (row) => { |
|
|
|
|
|
// 查询是否已创建过标签 |
|
|
|
|
|
await PackageApi.getPackagePage({ |
|
|
|
|
|
requestNumber: row.number |
|
|
|
|
|
}).then((res) => { |
|
|
|
|
|
if(res.list.length > 0) { |
|
|
|
|
|
isCreateLabel.value = true |
|
|
|
|
|
if (res.list[0].productionLineCode != null) { |
|
|
|
|
|
labelType.value = 'zz' |
|
|
|
|
|
} else { |
|
|
|
|
|
labelType.value = 'cg' |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
isCreateLabel.value = false |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
isCreateLabel.value = false |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
// 判断是采购还是制造 |
|
|
|
|
|
if (isCreateLabel.value) { |
|
|
|
|
|
labelPrint(row) |
|
|
|
|
|
} else { |
|
|
|
|
|
message.warning('请先创建标签') |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
@ -159,7 +190,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
newRow['fromBatch'] = item['batch'] |
|
|
newRow['fromBatch'] = item['batch'] |
|
|
newRow['fromPackingNumber'] = item['packingNumber'] |
|
|
newRow['fromPackingNumber'] = item['packingNumber'] |
|
|
newRow['toBatch'] = item['batch'] |
|
|
newRow['toBatch'] = item['batch'] |
|
|
newRow['toPackingNumber'] = item['packingNumber'] |
|
|
|
|
|
newRow['fromLocationCode'] = item['locationCode'] |
|
|
newRow['fromLocationCode'] = item['locationCode'] |
|
|
newRow['inventoryStatus'] = item['inventoryStatus'] |
|
|
newRow['inventoryStatus'] = item['inventoryStatus'] |
|
|
tableData.value.push(newRow) |
|
|
tableData.value.push(newRow) |
|
@ -376,7 +406,7 @@ const butttondata = (row,$index) => { |
|
|
color: '', |
|
|
color: '', |
|
|
hasPermi: '', |
|
|
hasPermi: '', |
|
|
link: true, // 文本展现按钮 |
|
|
link: true, // 文本展现按钮 |
|
|
} |
|
|
},defaultButtons.mainListPointBtn({hide:isShowMainButton(row,['3','6','8'])}), // 标签打印 |
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:relegate-request-main:delete'}), // 删除 |
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:relegate-request-main:delete'}), // 删除 |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
@ -475,6 +505,8 @@ const buttonTableClick = async (val, row) => { |
|
|
// dialogVisible.value = true |
|
|
// dialogVisible.value = true |
|
|
formLabelRef.value.open('create', row) |
|
|
formLabelRef.value.open('create', row) |
|
|
detatableData.tableList.map((item) => { |
|
|
detatableData.tableList.map((item) => { |
|
|
|
|
|
console.log(item); |
|
|
|
|
|
|
|
|
// item.batch = '000000' |
|
|
// item.batch = '000000' |
|
|
// 查询物料类型 原料 只能选择 供应商代码 半成品成品其他 只能选择 生产线 |
|
|
// 查询物料类型 原料 只能选择 供应商代码 半成品成品其他 只能选择 生产线 |
|
|
ItembasicApi.getItembasicPage({ |
|
|
ItembasicApi.getItembasicPage({ |
|
@ -492,27 +524,31 @@ const buttonTableClick = async (val, row) => { |
|
|
if(itemColumns.field == 'productionLineCodePackage') { |
|
|
if(itemColumns.field == 'productionLineCodePackage') { |
|
|
// itemColumns.tableForm.isInpuFocusShow = false |
|
|
// itemColumns.tableForm.isInpuFocusShow = false |
|
|
// itemColumns.tableForm.disabled = true |
|
|
// itemColumns.tableForm.disabled = true |
|
|
ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = false |
|
|
RelegateRequestDetailLabelRules.productionLineCodePackage[0].required = false |
|
|
} |
|
|
} |
|
|
if(itemColumns.field == 'supplierItemCode') { |
|
|
if(itemColumns.field == 'supplierItemCode') { |
|
|
itemColumns.tableForm.isInpuFocusShow = true |
|
|
itemColumns.tableForm.isInpuFocusShow = true |
|
|
itemColumns.tableForm.disabled = false |
|
|
itemColumns.tableForm.disabled = false |
|
|
ProductionreturnRequestDetailLabelRules.supplierItemCode[0].required = true |
|
|
RelegateRequestDetailLabelRules.supplierItemCode[0].required = true |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
// 修改 tableform 属性 |
|
|
// 修改 tableform 属性 |
|
|
detailListTableColumns.tableFormColumns.map(itemColumns => { |
|
|
detailListTableColumns.tableFormColumns.map(async 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 |
|
|
ProductionreturnRequestDetailLabelRules.supplierItemCode[0].required = false |
|
|
RelegateRequestDetailLabelRules.supplierItemCode[0].required = false |
|
|
} |
|
|
} |
|
|
if(itemColumns.field == 'productionLineCodePackage') { |
|
|
if(itemColumns.field == 'productionLineCodePackage') { |
|
|
item.productionLineCodePackage = item.productionLineCode |
|
|
let res = await ProductionlineitemApi.selectItemCodeToProductionLineCode(item.itemCode) |
|
|
|
|
|
// let res = ProductionlineitemApi.selectItemCodeToProductionLineCode(item.itemCode) |
|
|
|
|
|
console.log(res,999999999999999999999); |
|
|
|
|
|
console.log(res[0],999999999999999999999); |
|
|
|
|
|
item.productionLineCodePackage = res[0].productionLineCode |
|
|
// itemColumns.tableForm.isInpuFocusShow = true |
|
|
// itemColumns.tableForm.isInpuFocusShow = true |
|
|
// itemColumns.tableForm.disabled = false |
|
|
// itemColumns.tableForm.disabled = false |
|
|
ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = true |
|
|
RelegateRequestDetailLabelRules.productionLineCodePackage[0].required = true |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
@ -523,6 +559,8 @@ const buttonTableClick = async (val, row) => { |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}else if (val == 'point') { // 标签打印 |
|
|
|
|
|
handlePoint(row) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -577,6 +615,34 @@ 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, 'basicRelegateRequestMain') |
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicRelegateRequestMain') |
|
|
} |
|
|
} |
|
|
|
|
|
const BASE_URL = getJmreportBaseUrl() |
|
|
|
|
|
// 批量打印 |
|
|
|
|
|
const searchTableSuccess1 = async (formField, searchField, val, formRef, type, row) => { |
|
|
|
|
|
console.log('批量打印',val) |
|
|
|
|
|
// let rows:any = [] |
|
|
|
|
|
// val.forEach(item=>{ |
|
|
|
|
|
// rows = [...rows,...item.selectionRows.map(item1=>item1.number)] |
|
|
|
|
|
// }) |
|
|
|
|
|
if(val.length == 0){ |
|
|
|
|
|
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 => { |
|
|
|
|
|
console.log(res) |
|
|
|
|
|
if (labelType.value == 'cg') { |
|
|
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
|
|
|
window.open(src.value+'&asn_number='+res) |
|
|
|
|
|
} else { |
|
|
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
|
|
|
window.open(src.value+'&asn_number='+res) |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
message.error('创建标签失败') |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** 删除按钮操作 */ |
|
|
/** 删除按钮操作 */ |
|
|
const handleDelete = async (id: number) => { |
|
|
const handleDelete = async (id: number) => { |
|
@ -649,6 +715,27 @@ const searchFormClick = (searchData) => { |
|
|
getList() // 刷新当前列表 |
|
|
getList() // 刷新当前列表 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const searchTableRef = ref() |
|
|
|
|
|
|
|
|
|
|
|
const labelPrint = async (row) => { |
|
|
|
|
|
tableObject.loading = true |
|
|
|
|
|
const defaultParams = {'moduleName':'productreceipt_predict','recordNumber':row.number} |
|
|
|
|
|
const {tableObject:tableObjectPrint ,tableMethods} = useTable({ |
|
|
|
|
|
defaultParams, |
|
|
|
|
|
getListApi: PackageApi.getLabelDetailPage // 分页接口 |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
|
|
|
const { getList:getListPrint } = tableMethods |
|
|
|
|
|
getListPrint() |
|
|
|
|
|
tableObject.loading = false |
|
|
|
|
|
const tableColumns = RelegateRequestDetailLabel.allSchemas.tableFormColumns |
|
|
|
|
|
tableColumns.forEach((item) => { |
|
|
|
|
|
item.width = item.table?.width || 150 |
|
|
|
|
|
}) |
|
|
|
|
|
searchTableRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
getList() |
|
|
getList() |
|
|