Browse Source

创建标签简易版

hella_online_20240829
wangyufei 4 months ago
parent
commit
45e979d082
  1. 125
      src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/index.vue

125
src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/index.vue

@ -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
}
})
})
} }
} }

Loading…
Cancel
Save