Browse Source

生产收货 创建标签 生产退料申请

master
陈薪名 12 months ago
parent
commit
34beacdfbc
  1. 5
      src/api/wms/productionreturnRequestDetail/index.ts
  2. 7
      src/api/wms/productreceiptRequestDetail/index.ts
  3. 37
      src/api/wms/productreceiptRequestMain/index.ts
  4. 9
      src/views/wms/basicDataManage/labelManage/manufacturePackage/index.vue
  5. 9
      src/views/wms/basicDataManage/labelManage/purchasePackage/index.vue
  6. 9
      src/views/wms/basicDataManage/labelManage/utensilPackage/index.vue
  7. 7
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue
  8. 252
      src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue
  9. 337
      src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts
  10. 268
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierPackage/index.vue
  11. 420
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierPackage/supplierPackage.data.ts

5
src/api/wms/productionreturnRequestDetail/index.ts

@ -64,4 +64,9 @@ export const exportProductionreturnRequestDetail = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/productionreturn-request-detail/get-import-template' })
}
// 创建包装信息后更新子表数据packingNumber
export const updateDetailPackingNumber = async (id: number, number) => {
return await request.put({ url: '/wms/productionreturn-request-detail/updateDetailPackingNumber?id=' + id + '&number=' + number })
}

7
src/api/wms/productreceiptRequestDetail/index.ts

@ -69,4 +69,9 @@ export const exportProductreceiptRequestDetail = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/productreceipt-request-detail/get-import-template' })
}
}
// 创建包装信息后更新子表数据packingNumber
export const updateDetailPackingNumber = async (id: number, number) => {
return await request.put({ url: '/wms/productreceipt-request-detail/updateDetailPackingNumber?id=' + id + '&number=' + number })
}

37
src/api/wms/productreceiptRequestMain/index.ts

@ -58,10 +58,45 @@ export const deleteProductreceiptRequestMain = async (id: number) => {
// 导出制品收货申请主 Excel
export const exportProductreceiptRequestMain = async (params) => {
return await request.download({ url: `/wms/productreceipt-request-main/export-excel`, params })
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/productreceipt-request-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/productreceipt-request-main/export-excel`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/productreceipt-request-main/get-import-template' })
}
// 关闭
export const close = (id) => {
return request.put({ url: '/wms/productreceipt-request-main/close?id=' + id })
}
// 重新添加
export const reAdd = (id) => {
return request.put({ url: '/wms/productreceipt-request-main/reAdd?id=' + id })
}
// 提交审批
export const submit = (id) => {
return request.put({ url: '/wms/productreceipt-request-main/submit?id=' + id })
}
// 驳回
export const refused = (id) => {
return request.put({ url: '/wms/productreceipt-request-main/refused?id=' + id })
}
// 审批通过
export const agree = (id) => {
return request.put({ url: '/wms/productreceipt-request-main/agree?id=' + id })
}
// 处理
export const handle = (id) => {
return request.put({ url: '/wms/productreceipt-request-main/handle?id=' + id })
}

9
src/views/wms/basicDataManage/labelManage/manufacturePackage/index.vue

@ -77,11 +77,12 @@ const tableColumns = ref(Package.allSchemas.tableColumns)
/**
* Package2 regularParams = procure采购件标签记录页面
* Package3 regularParams = manufacture 制造件标签记录页面
* Package4 regularParams = utensil 器具标签记录页面
* PurchasePackage regularParams = procure采购件标签记录页面
* ManufacturePackage regularParams = manufacture 制造件标签记录页面
* UtensilPackage regularParams = utensil 器具标签记录页面
* SupplierPackage regularParams = procure 供应商发货标签记录(用采购标签)
*/
const regularParams = ref(route.name == 'Package2'?'procure':route.name == 'Package3'?'manufacture':route.name == 'Package4'?'utensil':'')
const regularParams = ref(route.name == 'PurchasePackage'?'procure':route.name == 'ManufacturePackage'?'manufacture':route.name == 'UtensilPackage'?'utensil':route.name == 'SupplierPackage'?'procure':'')
//
const updataTableColumns = (val) => {

9
src/views/wms/basicDataManage/labelManage/purchasePackage/index.vue

@ -77,11 +77,12 @@ const tableColumns = ref(Package.allSchemas.tableColumns)
/**
* Package2 regularParams = procure采购件标签记录页面
* Package3 regularParams = manufacture 制造件标签记录页面
* Package4 regularParams = utensil 器具标签记录页面
* PurchasePackage regularParams = procure采购件标签记录页面
* ManufacturePackage regularParams = manufacture 制造件标签记录页面
* UtensilPackage regularParams = utensil 器具标签记录页面
* SupplierPackage regularParams = procure 供应商发货标签记录(用采购标签)
*/
const regularParams = ref(route.name == 'Package2'?'procure':route.name == 'Package3'?'manufacture':route.name == 'Package4'?'utensil':'')
const regularParams = ref(route.name == 'PurchasePackage'?'procure':route.name == 'ManufacturePackage'?'manufacture':route.name == 'UtensilPackage'?'utensil':route.name == 'SupplierPackage'?'procure':'')
//
const updataTableColumns = (val) => {

9
src/views/wms/basicDataManage/labelManage/utensilPackage/index.vue

@ -77,11 +77,12 @@ const tableColumns = ref(Package.allSchemas.tableColumns)
/**
* Package2 regularParams = procure采购件标签记录页面
* Package3 regularParams = manufacture 制造件标签记录页面
* Package4 regularParams = utensil 器具标签记录页面
* PurchasePackage regularParams = procure采购件标签记录页面
* ManufacturePackage regularParams = manufacture 制造件标签记录页面
* UtensilPackage regularParams = utensil 器具标签记录页面
* SupplierPackage regularParams = procure 供应商发货标签记录(用采购标签)
*/
const regularParams = ref(route.name == 'Package2'?'procure':route.name == 'Package3'?'manufacture':route.name == 'Package4'?'utensil':'')
const regularParams = ref(route.name == 'PurchasePackage'?'procure':route.name == 'ManufacturePackage'?'manufacture':route.name == 'UtensilPackage'?'utensil':route.name == 'SupplierPackage'?'procure':'')
//
const updataTableColumns = (val) => {

7
src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue

@ -348,6 +348,9 @@ const buttonTableClick = async (val, row) => {
})
} else if (val == 'mainHandle') { //
if (row.packingNumber) {
isCreateLabel.value = true
}
if (!isCreateLabel.value) {
message.warning('请先创建标签')
return
@ -453,6 +456,10 @@ const submitFormLabel = async (formType, data) => {
try {
detatableData.tableList.forEach(async (item) => {
await PackageApi.createPackageLabel(item).then(res => {
if (res) {
//
ProductionreturnRequestDetailApi.updateDetailPackingNumber(res.id,res.number)
}
isCreateLabel.value = true
message.success('创建标签成功')
}).catch(err => {

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

@ -69,8 +69,46 @@
:apiDelete="ProductreceiptRequestDetailApi.deleteProductreceiptRequestDetail"
:Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail"
:buttondataTable="buttondataTable"
@tableFormButton="tableFormButton"
/>
<!-- 创建标签 -->
<BasicForm
ref="formLabelRef"
@success="getList"
:tableAllSchemas="detailListTableColumns"
:tableFormRules="ProductionreturnRequestDetailLabelRules"
:tableData="detatableData.tableList"
:isBusiness="true"
:isShowButton="false"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitFormLabel"
/>
<!-- bom列表 -->
<Dialog
:title="DialogTitle"
v-model="bomModelVisible"
width="80%"
:scroll="true"
max-height="450px"
>
<Table
:columns="BackflushDetailRequest.allSchemas.tableColumns"
:data="detatableDataBom.tableList"
:loading="detatableDataBom.loading"
:pagination="{
total: detatableDataBom.total
}"
v-model:pageSize="detatableDataBom.pageSize"
v-model:currentPage="detatableDataBom.currentPage"
v-model:sort="detatableDataBom.sort"
/>
</Dialog>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/productreceipt-request-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
@ -78,10 +116,15 @@
<script setup lang="ts">
import download from '@/utils/download'
import { ProductreceiptRequestMain,ProductreceiptRequestMainRules,ProductreceiptRequestDetail,ProductreceiptRequestDetailRules } from './productreceiptRequestMain.data'
import { ProductreceiptRequestMain,ProductreceiptRequestMainRules,ProductreceiptRequestDetail,ProductreceiptRequestDetailRules, BackflushDetailRequest } from './productreceiptRequestMain.data'
import {ProductionreturnRequestDetailLabel,ProductionreturnRequestDetailLabelRules} from '../../../issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data'
import * as ProductreceiptRequestMainApi from '@/api/wms/productreceiptRequestMain'
import * as ProductreceiptRequestDetailApi from '@/api/wms/productreceiptRequestDetail'
import * as BackflushRequestDetailbApi from '@/api/wms/backflushRequestDetailb'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as ItembasicApi from '@/api/wms/itembasic'
import * as PackageApi from '@/api/wms/package'
import { formatTime } from '@/utils/index'
//
defineOptions({ name: 'ProductreceiptRequestMain' })
@ -93,6 +136,35 @@ const route = useRoute() // 路由信息
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ProductreceiptRequestMain.allSchemas.tableColumns)
// table
const buttondataTable = ref([{
label: 'Bom',
name: 'bom',
hide: false,
type: 'primary',
icon: '',
color: '',
hasPermi: '',
link: true, //
}])
//
const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas
const isCreateLabel = ref(false)
const formLabelRef = ref()
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
getListApi: ProductreceiptRequestDetailApi.getProductreceiptRequestDetailPage
})
const { getList:getDetailList } = detatableMethods
// Bom
const DialogTitle = ref('Bom信息')
const bomModelVisible = ref(false)
const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useTable({
getListApi: BackflushRequestDetailbApi.getBackflushRequestDetailbPage
})
const { getList:getDetailListBom } = detatableMethodsBom
//
const updataTableColumns = (val) => {
@ -178,13 +250,24 @@ const isShowMainButton = (row,val) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListEditBtn({hasPermi:'wms:productreceipt-request-main:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:productreceipt-request-main:delete'}), //
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4']), 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',
hide: isShowMainButton(row,['3']),
type: 'primary',
icon: '',
color: '',
hasPermi: '',
link: true, //
},
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:productreceipt-request-main:delete'}), //
]
}
@ -193,15 +276,119 @@ const butttondata = (row) => {
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { //
console.log('列表-操作按钮事件-关闭')
await message.confirm('确认要关闭吗?')
ProductreceiptRequestMainApi.close(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainReAdd') { //
console.log('列表-操作按钮事件-重新添加')
await message.confirm('确认要重新添加吗?')
ProductreceiptRequestMainApi.reAdd(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainSubmit') { //
console.log('列表-操作按钮事件-提交审批')
await message.confirm('确认要重新添加吗?')
ProductreceiptRequestMainApi.submit(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainTurnDown') { //
console.log('列表-操作按钮事件-驳回')
await message.confirm('确认要重新添加吗?')
ProductreceiptRequestMainApi.refused(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainApprove') { //
console.log('列表-操作按钮事件-审批通过')
await message.confirm('确认要审批通过吗?')
ProductreceiptRequestMainApi.agree(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'cjbq') { //
detatableData.params = {
masterId:row.id
}
await getDetailList()
//
if (detatableData.tableList[0].packingNumber) {
message.warning('已创建过标签!!!')
return
}
//
// dialogVisible.value = true
formLabelRef.value.open('create', row)
detatableData.tableList.map((item) => {
// 线
ItembasicApi.getItembasicPage({
pageSize: 10,
pageNo: 1,
code: item.itemCode,
sort: '',
by: 'ASC',
}).then(res => {
if (res.list.length > 0) {
//
if (res.list[0].type == "RAW") {
// tableform
detailListTableColumns.tableFormColumns.map(item => {
if(item.field == 'productionLineCodePackage') {
item.tableForm.isInpuFocusShow = false
item.tableForm.disabled = true
ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = false
}
if(item.field == 'supplierItemCode') {
item.tableForm.isInpuFocusShow = true
item.tableForm.disabled = false
ProductionreturnRequestDetailLabelRules.supplierItemCode[0].required = true
}
})
} else {
// tableform
detailListTableColumns.tableFormColumns.map(item => {
if(item.field == 'supplierItemCode') {
item.tableForm.isInpuFocusShow = false
item.tableForm.disabled = true
ProductionreturnRequestDetailLabelRules.supplierItemCode[0].required = false
}
if(item.field == 'productionLineCodePackage') {
item.tableForm.isInpuFocusShow = true
item.tableForm.disabled = false
ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = true
}
})
}
} else {
message.warning('没有查询到物品代码:【' + item.itemCode + '】')
return
}
})
})
} else if (val == 'mainHandle') { //
if (row.packingNumber) {
isCreateLabel.value = true
}
if (!isCreateLabel.value) {
message.warning('请先创建标签')
return
}
ProductreceiptRequestMainApi.handle(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
@ -262,7 +449,9 @@ const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
let tfk = JSON.parse(JSON.stringify(tableFormKeys))
tfk.batch = formatTime(new Date(), 'yyyyMMdd')
tableData.value.push(tfk)
}
//
const handleDeleteTable = (item, index) => {
@ -314,6 +503,41 @@ const searchFormClick = (searchData) => {
getList() //
}
//
const submitFormLabel = async (formType, data) => {
try {
detatableData.tableList.forEach(async (item) => {
await PackageApi.createPackageLabel(item).then(res => {
if (res) {
//
ProductreceiptRequestDetailApi.updateDetailPackingNumber(res.id,res.number)
}
isCreateLabel.value = true
message.success('创建标签成功')
}).catch(err => {
isCreateLabel.value = false
console.log(err)
message.error('创建标签失败')
})
})
} finally {
formLabelRef.value.formLoading = false
formLabelRef.value.dialogVisible = false
}
}
// Bom
const tableFormButton = async (val , row) => {
if (val == 'bom') { // bom
bomModelVisible.value = true
DialogTitle.value = '物品代码【' + row.itemCode + '】——Bom信息'
detatableDataBom.params = {
masterId: row.id
}
await getDetailListBom()
}
}
/** 初始化 **/
onMounted(async () => {
getList()

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

@ -23,6 +23,9 @@ import { Productionlineitem } from '@/views/wms/basicDataManage/itemManage/produ
import * as ProductionlineApi from '@/api/wms/productionline'
import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
import * as BomApi from '@/api/wms/bom'
import { Bom } from '@/views/wms/basicDataManage/itemManage/bom/bom.data'
const { t } = useI18n() // 国际化
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
@ -422,18 +425,18 @@ export const ProductreceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验
export const ProductreceiptRequestMainRules = reactive({
// toWarehouseCode: [
// { required: true, message: '请输入到仓库代码', trigger: 'blur' }
// ],
// toLocationTypes: [
// { required: true, message: '请选择到库位类型范围', trigger: 'change' }
// ],
// toAreaCodes: [
// { required: true, message: '请输入到库区代码范围', trigger: 'blur' }
// ],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
workshopCode: [
{ required: true, message: '请选择车间代码', trigger: 'change' }
],
team: [
{ required: true, message: '请选择班组代码', trigger: 'change' }
],
shift: [
{ required: true, message: '请选择班次代码', trigger: 'change' }
],
// departmentCode: [
// { required: true, message: '请输入部门', trigger: 'blur' }
// ],
autoCommit: [
{ required: true, message: '请选择是否自动提交', trigger: 'change' }
],
@ -602,16 +605,6 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
isTableForm: false,
isForm: false
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '生产日期',
field: 'produceDate',
@ -789,45 +782,57 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
}
},
{
label: '备注',
field: 'remark',
label: 'Bom版本',
field: 'bomVersion',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择Bom版本', // 输入框占位文本
searchField: 'version', // 查询弹窗赋值字段
searchTitle: '物料清单信息', // 查询弹窗标题
searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类
searchPage: BomApi.getBomPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'productItemCode',
value:'itemCode',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
},
form: {
component: 'DatePicker',
// labelMessage: '信息提示说明!!!',
componentProps: {
style: {width: '100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择Bom版本', // 输入框占位文本
searchField: 'version', // 查询弹窗赋值字段
searchTitle: '物料清单信息', // 查询弹窗标题
searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类
searchPage: BomApi.getBomPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'productItemCode',
value:'itemCode',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
isTableForm: false,
isForm: false
},
{
label: '创建者',
field: 'creator',
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '物品名称',
@ -903,6 +908,47 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
type: 'Select'
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isTableForm: false,
isForm: false
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '最后更新时间',
field: 'updateTime',
@ -957,9 +1003,6 @@ export const ProductreceiptRequestDetailRules = reactive({
// packingNumber: [
// { required: true, message: '请输入包装号', trigger: 'change' }
// ],
// batch: [
// { required: true, message: '请输入批次', trigger: 'blur' }
// ],
// produceDate: [
// { required: true, message: '请选择生产日期', trigger: 'change' }
// ],
@ -981,9 +1024,24 @@ export const ProductreceiptRequestDetailRules = reactive({
// stdPackUnit: [
// { required: true, message: '请选择标包单位', trigger: 'change' }
// ],
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }
],
itemCode: [
{ required: true, message: '请选择物品代码', trigger: 'change' }
],
bomVersion: [
{ required: true, message: '请选择Bom版本', trigger: 'change' }
],
workStationCode: [
{ required: true, message: '请选择工位代码', trigger: 'change' }
],
uom: [
{ required: true, message: '请选择计量单位', trigger: 'change' }
],
productionLineCode: [
{ required: true, message: '请选择生产线代码', trigger: 'change' }
],
})
/**
@ -998,14 +1056,6 @@ export const BackflushRequestDetailb = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
},
},
{
label: 'BOM版本',
field: 'bomVersion',
sort: 'custom',
table: {
width: 150
},
},
{
label: '单据号',
field: 'number',
@ -1156,4 +1206,177 @@ export const BackflushRequestDetailbRules = reactive({
creator: [
{ required: true, message: '请输入创建者', trigger: 'blur' }
],
})
})
/**
* @returns {Array}
*/
export const BackflushDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '工序代码',
field: 'processCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: 'BOM版本',
field: 'bomVersion',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '物品代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150,
fixed: 'left'
},
isTableForm: false,
isForm: false
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTableForm: false,
isForm: false
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTableForm: false,
isForm: false
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
]))

268
src/views/wms/purchasereceiptManage/supplierdeliver/supplierPackage/index.vue

@ -0,0 +1,268 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Package.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Package.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="PackageRules"
:formAllSchemas="Package.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="PackageApi.updatePackage"
:apiCreate="PackageApi.createPackage"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Package.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/package/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { getAccessToken } from '@/utils/auth'
import { Package,PackageRules } from './supplierPackage.data'
import * as PackageApi from '@/api/wms/package'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'PurchasePackage' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Package.allSchemas.tableColumns)
/**
* PurchasePackage regularParams = procure采购件标签记录页面
* ManufacturePackage regularParams = manufacture 制造件标签记录页面
* UtensilPackage regularParams = utensil 器具标签记录页面
* SupplierPackage regularParams = procure 供应商发货标签记录(用采购标签)
*/
const regularParams = ref(route.name == 'PurchasePackage'?'procure':route.name == 'ManufacturePackage'?'manufacture':route.name == 'UtensilPackage'?'utensil':route.name == 'SupplierPackage'?'procure':'')
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
//
const searchTableSuccess = (formField, searchField, val, basicFormRef, type, row ) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
basicFormRef.setValues(setV)
})
}
const { tableObject, tableMethods } = useTable({
getListApi: PackageApi.getPackagePage //
})
tableObject.params.regularParams = regularParams.value
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:package:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:package:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:package:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
//
// const isShowMainButton = (row,val) => {
// if (val.indexOf(row.status) > -1) {
// return false
// } else {
// return true
// }
// }
// -
// const butttondata = (row) => {
// return [
// defaultButtons.mainListEditBtn({hasPermi:'wms:package:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:package:delete'}), //
// defaultButtons.mainListPointBtn(null), //
// ]
// }
// -
const butttondata = [
// defaultButtons.mainListEditBtn({hasPermi:'wms:package:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:package:delete'}), //
defaultButtons.mainListPointBtn(null), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'point') { //
handlePoint(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm =async (type: string, row?: number) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await PackageApi.deletePackage(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await PackageApi.exportPackage(tableObject.params)
download.excel(data, '包装.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
const BASE_URL = 'http://dev.ccwin-in.com:25110'
const src = ref(BASE_URL + '/jmreport/view/881303562245316608?token=' + getAccessToken())
//
const handlePoint = async (id) => {
window.open(src.value+'&id='+id)
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '包装导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters,
regularParams:regularParams.value
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
})
</script>

420
src/views/wms/purchasereceiptManage/supplierdeliver/supplierPackage/supplierPackage.data.ts

@ -0,0 +1,420 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const PackageRules = reactive({
number: [required],
itemCode: [required],
itemName: [required],
})
export const Package2 = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '包装号',
field: 'number',
sort: 'custom',
isSearch: true,
table: {
width: 150,
fixed: 'left'
},
},
]))
export const Package = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '包装号',
field: 'number',
sort: 'custom',
isSearch: true,
table: {
width: 150,
fixed: 'left'
},
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
},
{
label: '替代批次',
field: 'altBatch',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '生产日期',
field: 'produceDate',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
table: {
width: 180,
},
},
{
label: '有效期(日)',
field: 'validityDays',
sort: 'custom',
form: {
component: 'InputNumber',
componentProps: {
min: 0
},
value: 0
},
table: {
width: 150,
},
},
{
label: '失效日期',
field: 'expireDate',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
table: {
width: 180,
},
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'SelectV2'
},
table: {
width: 150,
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '替代计量单位',
field: 'altUom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'SelectV2'
},
table: {
width: 150,
},
},
{
label: '替代数量',
field: 'altQty',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '转换率',
field: 'convertRate',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '标包数量',
field: 'stdPackQty',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '标包单位',
field: 'stdPackUnit',
sort: 'custom',
dictType: DICT_TYPE.PACK_UNIT,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'SelectV2'
},
table: {
width: 150,
},
},
{
label: '仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '月台代码',
field: 'toDockCode',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '库位代码',
field: 'toLocationCode',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '供应商物品代码',
field: 'supplierItemCode',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '采购订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '采购订单行',
field: 'poLine',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '采购计划单号',
field: 'rpNumber',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '发货单号',
field: 'asnNumber',
sort: 'custom',
table: {
width: 182,
},
},
{
label: '生产订单号',
field: 'woNumber',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '生产订单行',
field: 'woLine',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '生产线代码',
field: 'productionLineCode',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '班组代码',
field: 'teamCode',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '班次代码',
field: 'shiftCode',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '客户代码',
field: 'customerCode',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '客户月台代码',
field: 'customerDockCode',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '客户物品代码',
field: 'customerItemCode',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '销售订单号',
field: 'soNumber',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '销售订单行',
field: 'soLine',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '质量等级',
field: 'eqLevel',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '货主代码',
field: 'ownerCode',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '重量',
field: 'weight',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '面积',
field: 'area',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '体积',
field: 'volume',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
Loading…
Cancel
Save