|
@ -63,19 +63,19 @@ |
|
|
:detailButtonIsShowDelete="true" /> |
|
|
:detailButtonIsShowDelete="true" /> |
|
|
|
|
|
|
|
|
<!-- 创建标签 --> |
|
|
<!-- 创建标签 --> |
|
|
<!-- <BasicForm |
|
|
<BasicForm |
|
|
ref="formLabelRef" |
|
|
ref="formLabelRef" |
|
|
@success="getList" |
|
|
@success="getList" |
|
|
:tableAllSchemas="detailListTableColumns" |
|
|
:tableAllSchemas="detailListTableColumns" |
|
|
:tableFormRules="ProductreceiptRequestLabelRules" |
|
|
:tableFormRules="ProductionreturnRequestDetailLabelRules" |
|
|
:tableData="detatableData.tableList" |
|
|
:tableData="detatableData.tableList" |
|
|
:isBusiness="true" |
|
|
:isBusiness="true" |
|
|
:isShowButton="false" |
|
|
:isShowButton="false" |
|
|
@handleAddTable="handleAddTable" |
|
|
@handleAddTable="handleAddTable" |
|
|
@handleDeleteTable="handleDeleteTable" |
|
|
@handleDeleteTable="handleDeleteTable" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@submitForm="submitFormLabel" --> |
|
|
@submitForm="submitFormLabel" |
|
|
<!-- /> --> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm ref="importFormRef" url="/wms/relegate-request-main/import" :importTemplateData="importTemplateData" |
|
|
<ImportForm ref="importFormRef" url="/wms/relegate-request-main/import" :importTemplateData="importTemplateData" |
|
@ -94,6 +94,10 @@ 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 { 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 ProductionreturnRequestMainApi from '@/api/wms/productionreturnRequestMain' |
|
|
|
|
|
import { ProductionreturnRequestMain,ProductionreturnRequestMainRules,ProductionreturnRequestDetail,ProductionreturnRequestDetailRules,ProductionreturnRequestDetailLabel,ProductionreturnRequestDetailLabelRules, SupplierdeliverRequestPackage } from '@/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts' |
|
|
|
|
|
import * as ProductionreturnRequestDetailApi from '@/api/wms/productionreturnRequestDetail' |
|
|
|
|
|
|
|
|
defineOptions({ name: 'RelegateRequestMain' }) |
|
|
defineOptions({ name: 'RelegateRequestMain' }) |
|
|
|
|
|
|
|
@ -107,7 +111,38 @@ 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 = ProductreceiptRequestLabel.allSchemas |
|
|
const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas |
|
|
|
|
|
const isCreateLabel = ref(false) |
|
|
|
|
|
const formLabelRef = ref() |
|
|
|
|
|
const labelType = ref('') // 标签类别 采购还是制造等 |
|
|
|
|
|
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ |
|
|
|
|
|
getListApi: ProductionreturnRequestDetailApi.getProductionreturnRequestDetailPage |
|
|
|
|
|
}) |
|
|
|
|
|
const { getList:getDetailList } = detatableMethods |
|
|
|
|
|
// 创建标签 |
|
|
|
|
|
const submitFormLabel = async (formType, submitData) => { |
|
|
|
|
|
let data = {...submitData} |
|
|
|
|
|
if(data.masterId){ |
|
|
|
|
|
data.id = data.masterId |
|
|
|
|
|
} |
|
|
|
|
|
try { |
|
|
|
|
|
alert('做一下接口') |
|
|
|
|
|
// detatableData.tableList.forEach(async (item) => { |
|
|
|
|
|
// item.toLocationCode = item.fromLocationCode |
|
|
|
|
|
// await PackageApi.createPackageLabel(item).then(() => { |
|
|
|
|
|
// isCreateLabel.value = true |
|
|
|
|
|
// message.success('创建标签成功') |
|
|
|
|
|
// }).catch(err => { |
|
|
|
|
|
// isCreateLabel.value = false |
|
|
|
|
|
// console.log(err) |
|
|
|
|
|
// message.error('创建标签失败') |
|
|
|
|
|
// }) |
|
|
|
|
|
// }) |
|
|
|
|
|
} finally { |
|
|
|
|
|
formLabelRef.value.formLoading = false |
|
|
|
|
|
formLabelRef.value.dialogVisible = false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
@ -332,6 +367,16 @@ const butttondata = (row,$index) => { |
|
|
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:relegate-request-main:agree'}), // 审批通过 |
|
|
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:relegate-request-main:agree'}), // 审批通过 |
|
|
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:relegate-request-main:handle'}), // 处理 |
|
|
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:relegate-request-main:handle'}), // 处理 |
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:relegate-request-main:update'}), // 编辑 |
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:relegate-request-main:update'}), // 编辑 |
|
|
|
|
|
{ |
|
|
|
|
|
label: '创建标签', |
|
|
|
|
|
name: 'cjbq', |
|
|
|
|
|
hide: isShowMainButton(row,['3']), |
|
|
|
|
|
type: 'primary', |
|
|
|
|
|
icon: '', |
|
|
|
|
|
color: '', |
|
|
|
|
|
hasPermi: '', |
|
|
|
|
|
link: true, // 文本展现按钮 |
|
|
|
|
|
} |
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:relegate-request-main:delete'}), // 删除 |
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:relegate-request-main:delete'}), // 删除 |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
@ -408,6 +453,76 @@ const buttonTableClick = async (val, row) => { |
|
|
openForm('update', row) |
|
|
openForm('update', row) |
|
|
} else if (val == 'delete') { // 删除 |
|
|
} else if (val == 'delete') { // 删除 |
|
|
handleDelete(row.id) |
|
|
handleDelete(row.id) |
|
|
|
|
|
} else if (val == 'cjbq') { // 创建标签 |
|
|
|
|
|
// 判断 是否已创建标签 |
|
|
|
|
|
let isCreateLabel = false |
|
|
|
|
|
await PackageApi.getPackagePage({ |
|
|
|
|
|
requestNumber: row.number |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
if (res) { |
|
|
|
|
|
if (res.list.length > 0) isCreateLabel = true |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if (isCreateLabel) { |
|
|
|
|
|
message.warning('已创建过标签!!!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
detatableData.params = { |
|
|
|
|
|
masterId:row.masterId |
|
|
|
|
|
} |
|
|
|
|
|
await getDetailList() |
|
|
|
|
|
// 打开创建标签页面 |
|
|
|
|
|
// dialogVisible.value = true |
|
|
|
|
|
formLabelRef.value.open('create', row) |
|
|
|
|
|
detatableData.tableList.map((item) => { |
|
|
|
|
|
// item.batch = '000000' |
|
|
|
|
|
// 查询物料类型 原料 只能选择 供应商代码 半成品成品其他 只能选择 生产线 |
|
|
|
|
|
ItembasicApi.getItembasicPage({ |
|
|
|
|
|
pageSize: 10, |
|
|
|
|
|
pageNo: 1, |
|
|
|
|
|
code: item.itemCode, |
|
|
|
|
|
sort: '', |
|
|
|
|
|
by: 'ASC', |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
if (res.list.length > 0) { |
|
|
|
|
|
// 判断物料 可采购 可制造 |
|
|
|
|
|
if (res.list[0].enableMake == "FALSE") { |
|
|
|
|
|
// 修改 tableform 属性 |
|
|
|
|
|
detailListTableColumns.tableFormColumns.map(itemColumns => { |
|
|
|
|
|
if(itemColumns.field == 'productionLineCodePackage') { |
|
|
|
|
|
// itemColumns.tableForm.isInpuFocusShow = false |
|
|
|
|
|
// itemColumns.tableForm.disabled = true |
|
|
|
|
|
ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = false |
|
|
|
|
|
} |
|
|
|
|
|
if(itemColumns.field == 'supplierItemCode') { |
|
|
|
|
|
itemColumns.tableForm.isInpuFocusShow = true |
|
|
|
|
|
itemColumns.tableForm.disabled = false |
|
|
|
|
|
ProductionreturnRequestDetailLabelRules.supplierItemCode[0].required = true |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
// 修改 tableform 属性 |
|
|
|
|
|
detailListTableColumns.tableFormColumns.map(itemColumns => { |
|
|
|
|
|
if(itemColumns.field == 'supplierItemCode') { |
|
|
|
|
|
itemColumns.tableForm.isInpuFocusShow = false |
|
|
|
|
|
itemColumns.tableForm.disabled = true |
|
|
|
|
|
ProductionreturnRequestDetailLabelRules.supplierItemCode[0].required = false |
|
|
|
|
|
} |
|
|
|
|
|
if(itemColumns.field == 'productionLineCodePackage') { |
|
|
|
|
|
item.productionLineCodePackage = item.productionLineCode |
|
|
|
|
|
// itemColumns.tableForm.isInpuFocusShow = true |
|
|
|
|
|
// itemColumns.tableForm.disabled = false |
|
|
|
|
|
ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = true |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
message.warning('没有查询到物料代码:【' + item.itemCode + '】') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|