Browse Source

退料

master
陈薪名 12 months ago
parent
commit
561ec1b675
  1. 27
      src/api/wms/productionreturnJobMain/index.ts
  2. 2
      src/api/wms/productionreturnRequestMain/index.ts
  3. 51
      src/api/wms/productionreturnRequestMainNo/index.ts
  4. 20
      src/views/wms/issueManage/productionreturn/productionreturnJobMain/productionreturnJobMain.data.ts
  5. 177
      src/views/wms/issueManage/productionreturn/productionreturnRecordMain/productionreturnRecordMain.data.ts
  6. 19
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue
  7. 290
      src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue

27
src/api/wms/productionreturnJobMain/index.ts

@ -73,10 +73,35 @@ export const deleteProductionreturnJobMain = async (id: number) => {
// 导出生产退料任务主 Excel
export const exportProductionreturnJobMain = async (params) => {
return await request.download({ url: `/wms/productionreturn-job-main/export-excel`, params })
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/productionreturn-job-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/productionreturn-job-main/export-excel`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/productionreturn-job-main/get-import-template' })
}
// 承接发料任务
export const acceptProductionreturnMain = async (id) => {
return await request.put({ url: `/wms/productionreturn-job-main/accept?id=` + id })
}
// 放弃发料任务
export const abandonProductionreturnMain = async (id) => {
return await request.put({ url: `/wms/productionreturn-job-main/abandon?id=` + id })
}
// 关闭发料任务
export const closeProductionreturnMain = async (id) => {
return await request.put({ url: `/wms/productionreturn-job-main/close?id=` + id })
}
// 执行发料任务
export const executeProductionreturnMain = async (data) => {
return await request.put({ url: `/wms/productionreturn-job-main/execute`, data})
}

2
src/api/wms/productionreturnRequestMain/index.ts

@ -27,6 +27,7 @@ export interface ProductionreturnRequestMainVO {
// 查询生产退料申请主列表
export const getProductionreturnRequestMainPage = async (params) => {
params.businessType = 'ReturnToStore'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
@ -58,6 +59,7 @@ export const deleteProductionreturnRequestMain = async (id: number) => {
// 导出生产退料申请主 Excel
export const exportProductionreturnRequestMain = async (params) => {
params.businessType = 'ReturnToStore'
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/productionreturn-request-main/export-excel-senior`, data })

51
src/api/wms/productionreturnRequestMainNo/index.ts

@ -25,8 +25,9 @@ export interface ProductionreturnRequestMainVO {
directCreateRecord: string
}
// 查询生产退料申请主列表
// 查询不合格生产退料申请主列表
export const getProductionreturnRequestMainPage = async (params) => {
params.businessType = 'ReturnToHold'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
@ -36,32 +37,68 @@ export const getProductionreturnRequestMainPage = async (params) => {
}
}
// 查询生产退料申请主详情
// 查询不合格生产退料申请主详情
export const getProductionreturnRequestMain = async (id: number) => {
return await request.get({ url: `/wms/productionreturn-request-main/get?id=` + id })
}
// 新增生产退料申请主
// 新增不合格生产退料申请主
export const createProductionreturnRequestMain = async (data: ProductionreturnRequestMainVO) => {
return await request.post({ url: `/wms/productionreturn-request-main/create`, data })
}
// 修改生产退料申请主
// 修改不合格生产退料申请主
export const updateProductionreturnRequestMain = async (data: ProductionreturnRequestMainVO) => {
return await request.put({ url: `/wms/productionreturn-request-main/update`, data })
}
// 删除生产退料申请主
// 删除不合格生产退料申请主
export const deleteProductionreturnRequestMain = async (id: number) => {
return await request.delete({ url: `/wms/productionreturn-request-main/delete?id=` + id })
}
// 导出生产退料申请主 Excel
// 导出不合格生产退料申请主 Excel
export const exportProductionreturnRequestMain = async (params) => {
return await request.download({ url: `/wms/productionreturn-request-main/export-excel`, params })
params.businessType = 'ReturnToHold'
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/productionreturn-request-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/productionreturn-request-main/export-excel`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/productionreturn-request-main/get-import-template' })
}
// 关闭
export const close = (id) => {
return request.put({ url: '/wms/productionreturn-request-main/close?id=' + id })
}
// 重新添加
export const reAdd = (id) => {
return request.put({ url: '/wms/productionreturn-request-main/reAdd?id=' + id })
}
// 提交审批
export const submit = (id) => {
return request.put({ url: '/wms/productionreturn-request-main/submit?id=' + id })
}
// 驳回
export const refused = (id) => {
return request.put({ url: '/wms/productionreturn-request-main/refused?id=' + id })
}
// 审批通过
export const agree = (id) => {
return request.put({ url: '/wms/productionreturn-request-main/agree?id=' + id })
}
// 处理
export const handle = (id) => {
return request.put({ url: '/wms/productionreturn-request-main/handle?id=' + id })
}

20
src/views/wms/issueManage/productionreturn/productionreturnJobMain/productionreturnJobMain.data.ts

@ -514,16 +514,16 @@ export const ProductionreturnJobMain = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 120,
fixed: 'right'
},
}
// {
// label: '操作',
// field: 'action',
// isDetail: false,
// isForm: false,
// table: {
// width: 120,
// fixed: 'right'
// },
// }
]))
//表单校验

177
src/views/wms/issueManage/productionreturn/productionreturnRecordMain/productionreturnRecordMain.data.ts

@ -357,259 +357,244 @@ export const ProductionreturnRecordDetail = useCrudSchemas(reactive<CrudSchema[]
},
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从货主代码',
field: 'fromOwnerCode',
label: '物品代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从包装号',
field: 'frompackingNumber',
label: '物品名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从器具号',
field: 'fromcontainerNumber',
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从批次',
field: 'frombatch',
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库位代码',
field: 'fromlocationCode',
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库位组代码',
field: 'fromlocationGroupCode',
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '从库区代码',
field: 'fromareaCode',
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '到货主代码',
field: 'toOwnerCode',
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '包装号',
field: 'topackingNumber',
label: '包装号',
field: 'fromPackingNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到器具号',
field: 'tocontainerNumber',
label: '到包装号',
field: 'toPackingNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到批次',
field: 'tobatch',
label: '从器具号',
field: 'fromContainerNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库位代码',
field: 'toLocationCode',
label: '到器具号',
field: 'toContainerNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库位组代码',
field: 'toLocationGroupCode',
label: '从批次',
field: 'fromBatch',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库区代码',
field: 'toAreaCode',
label: '到批次',
field: 'toBatch',
sort: 'custom',
table: {
width: 150
},
},
{
label: '单据号',
field: 'number',
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物品代码',
field: 'itemCode',
label: '到库位代码',
field: 'toLocationCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '备注',
field: 'remark',
label: '从库位组代码',
field: 'fromLocationGroupCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
label: '到库位组代码',
field: 'toLocationGroupCode',
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
width: 150
},
},
{
label: '创建者',
field: 'creator',
label: '从库区代码',
field: 'fromAreaCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物品名称',
field: 'itemName',
label: '到库区代码',
field: 'toAreaCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物品描述1',
field: 'itemDesc1',
label: '从货主代码',
field: 'fromOwnerCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物品描述2',
field: 'itemDesc2',
label: '到货主代码',
field: 'toOwnerCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '项目代码',
field: 'projectCode',
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '数量',
field: 'qty',
label: '接口类型',
field: 'interfaceType',
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
},
// {
// label: '任务明细ID',
// field: 'jobDetailId',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '代码',
// field: 'code',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '接口类型',
field: 'interfaceType',
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isTable: true,
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 150
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
]))

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

@ -107,23 +107,14 @@ routeName.value = route.name
const tableColumns = ref(ProductionreturnRequestMain.allSchemas.tableColumns)
//
const dialogVisible = ref(false)
const dialogTitle = ref('创建标签')
const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas
const isCreateLabel = ref(false)
const formLabelRef = ref()
//
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
getListApi: ProductionreturnRequestDetailApi.getProductionreturnRequestDetailPage
})
const { getList:getDetailList } = detatableMethods
//
const saveLabel = () => {
isCreateLabel.value = true
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
@ -137,7 +128,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
if(formField == 'itemCode') {
// row['packingNumber'] = val[0]['packingNumber']
// row['containerNumber'] = val[0]['containerNumber']
row['batch'] = val[0]['batch']
// row['batch'] = val[0]['batch']
row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom']
row['inventoryStatus'] = val[0]['inventoryStatus']
@ -408,8 +399,8 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
const data = await ProductionreturnRequestMainApi.exportProductionreturnRequestMain(setSearchParams)
download.excel(data, '生产退料申请.xlsx')
const data = await ProductionreturnRequestMainApi.exportProductionreturnRequestMain(tableObject.params)
download.excel(data, '生产退料合格申请.xlsx')
} catch {
} finally {
exportLoading.value = false
@ -427,7 +418,9 @@ const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
let tfk = JSON.parse(JSON.stringify(tableFormKeys))
tfk.batch = '000000'
tableData.value.push(tfk)
}
//
const handleDeleteTable = (item, index) => {

290
src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue

@ -70,19 +70,32 @@
@searchTableSuccessDetail="searchTableSuccessDetail"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" :url="importFormUrlRef" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
<!-- 创建标签 -->
<BasicForm
ref="formLabelRef"
@success="getList"
:tableAllSchemas="detailListTableColumns"
:tableFormRules="ProductionreturnRequestDetailLabelRules"
:tableData="detatableData.tableList"
:isBusiness="true"
:isShowButton="false"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitFormLabel"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ProductionreturnRequestMain,ProductionreturnRequestMainRules,ProductionreturnRequestDetail,ProductionreturnRequestDetailRules } from './productionreturnRequestMainNo.data'
import { ProductionreturnRequestMain,ProductionreturnRequestMainRules,ProductionreturnRequestDetail,ProductionreturnRequestDetailRules,ProductionreturnRequestDetailLabel,ProductionreturnRequestDetailLabelRules } from '../productionreturnRequestMain/productionreturnRequestMain.data'
import * as ProductionreturnRequestMainNoApi from '@/api/wms/productionreturnRequestMainNo'
import * as ProductionreturnRequestDetailNoApi from '@/api/wms/productionreturnRequestDetailNo'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as ItembasicApi from '@/api/wms/itembasic'
import * as PackageApi from '@/api/wms/package'
// 退
// 退
defineOptions({ name: 'ProductionreturnRequestMainNo' })
const message = useMessage() //
@ -93,7 +106,14 @@ const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ProductionreturnRequestMain.allSchemas.tableColumns)
const importFormUrlRef = ref('/wms/productionreturn-request-main/import')
//
const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas
const isCreateLabel = ref(false)
const formLabelRef = ref()
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
getListApi: ProductionreturnRequestDetailNoApi.getProductionreturnRequestDetailPage
})
const { getList:getDetailList } = detatableMethods
//
const updataTableColumns = (val) => {
@ -105,18 +125,30 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
nextTick(() => {
if (type == 'tableForm') {
//
if(formField == 'packingNumber') {
row['packingNumber'] = val[0]['packingNumber']
row['containerNumber'] = val[0]['containerNumber']
if(formField == 'itemCode') {
// row['packingNumber'] = val[0]['packingNumber']
// row['containerNumber'] = val[0]['containerNumber']
row['batch'] = val[0]['batch']
row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom']
row['inventoryStatus'] = val[0]['inventoryStatus']
row['qty'] = val[0]['qty']
// tableform
ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'qty') {
item.tableForm.max = val[0]['qty']
}
})
} else if(formField == 'workStationCode') {
row['workStationCode'] = val[0]['code']
row['fromLocationCode'] = val[0]['rawLocationCode']
} else {
row[formField] = val[0][searchField]
}
} else {
const setV = {}
setV[formField] = val[0][searchField]
tableData.value = [] //
formRef.setValues(setV)
}
})
@ -125,12 +157,21 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
if(formField == 'packingNumber') {
setV['packingNumber'] = val[0]['packingNumber']
setV['containerNumber'] = val[0]['containerNumber']
if(formField == 'itemCode') {
setV['batch'] = val[0]['batch']
setV['itemCode'] = val[0]['itemCode']
setV['uom'] = val[0]['uom']
setV['inventoryStatus'] = val[0]['inventoryStatus']
setV['qty'] = val[0]['qty']
// tableform
ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'qty') {
item.tableForm.max = val[0]['qty']
}
})
} else if(formField == 'workStationCode') {
setV['workStationCode'] = val[0]['code']
setV['fromLocationCode'] = val[0]['rawLocationCode']
} else {
setV[formField] = val[0][searchField]
}
@ -147,42 +188,7 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
{
label: '新增合格',
name: 'xzhg',
hide: false,
type: 'primary',
icon: 'ep:plus',
color: '',
hasPermi:'wms:productionreturn-request-main:create'
},
{
label: '新增不合格',
name: 'xzbhg',
hide: false,
type: 'primary',
icon: 'ep:plus',
color: '',
hasPermi:'wms:productionreturn-request-main:create'
},
{
label: '导入合格',
name: 'drhg',
hide: false,
type: 'warning',
icon: 'ep:upload',
color: '',
hasPermi:'wms:productionreturn-request-main:import'
},
{
label: '导入不合格',
name: 'drbhg',
hide: false,
type: 'warning',
icon: 'ep:upload',
color: '',
hasPermi:'wms:productionreturn-request-main:import'
},
defaultButtons.defaultAddBtn({hasPermi:'wms:productionreturn-request-main:create'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:productionreturn-request-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
@ -192,15 +198,8 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
if (val == 'xzhg') { //
openForm('create')
} else if (val == 'xzbhg') { //
if (val == 'add') { //
openForm('create')
} else if (val == 'drhg') { //
handleImport()
} else if (val == 'drbhg') { //
importFormUrlRef.value = '/wms/productionreturn-request-main/importNO'
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
@ -223,31 +222,143 @@ 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:productionreturn-request-main:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:productionreturn-request-main:delete'}), //
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4']), hasPermi:'wms:productionreturn-request-main:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']), hasPermi:'wms:productionreturn-request-main:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:productionreturn-request-main:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:productionreturn-request-main:refused'}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:productionreturn-request-main:agree'}), //
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']), hasPermi:'wms:productionreturn-request-main:handle'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:productionreturn-request-main:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:productionreturn-request-main:delete'}), //
//
{
label: '创建标签',
name: 'cjbq',
hide: isShowMainButton(row,['3']),
type: 'primary',
icon: '',
color: '',
hasPermi: '',
link: true, //
},
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { //
console.log('列表-操作按钮事件-关闭')
await message.confirm('确认要关闭吗?')
ProductionreturnRequestMainNoApi.close(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainReAdd') { //
console.log('列表-操作按钮事件-重新添加')
await message.confirm('确认要重新添加吗?')
ProductionreturnRequestMainNoApi.reAdd(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainSubmit') { //
console.log('列表-操作按钮事件-提交审批')
await message.confirm('确认要重新添加吗?')
ProductionreturnRequestMainNoApi.submit(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainTurnDown') { //
console.log('列表-操作按钮事件-驳回')
await message.confirm('确认要重新添加吗?')
ProductionreturnRequestMainNoApi.refused(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainApprove') { //
console.log('列表-操作按钮事件-审批通过')
} else if (val == 'edit') { //
await message.confirm('确认要审批通过吗?')
ProductionreturnRequestMainNoApi.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) => {
// 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].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 (!isCreateLabel.value) {
message.warning('请先创建标签')
return
}
ProductionreturnRequestMainNoApi.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') { //
handleDelete(row.id)
@ -289,7 +400,7 @@ const handleExport = async () => {
//
exportLoading.value = true
const data = await ProductionreturnRequestMainNoApi.exportProductionreturnRequestMain(setSearchParams)
download.excel(data, '生产退料申请.xlsx')
download.excel(data, '生产退料不合格申请.xlsx')
} catch {
} finally {
exportLoading.value = false
@ -317,6 +428,8 @@ const handleDeleteTable = (item, index) => {
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
// 退 isOK
data.isOK = false // false
try {
if (formType === 'create') {
await ProductionreturnRequestMainNoApi.createProductionreturnRequestMain(data)
@ -333,21 +446,23 @@ const submitForm = async (formType, data) => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '生产退料申请主导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
//
const submitFormLabel = async (formType, data) => {
try {
detatableData.tableList.forEach(async (item) => {
await PackageApi.createPackageLabel(item).then(res => {
isCreateLabel.value = true
message.success('创建标签成功')
}).catch(err => {
isCreateLabel.value = false
console.log(err)
message.error('创建标签失败')
})
})
} finally {
formLabelRef.value.formLoading = false
formLabelRef.value.dialogVisible = false
}
}
//
@ -362,6 +477,5 @@ const searchFormClick = (searchData) => {
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ProductionreturnRequestMainNoApi.importTemplate()
})
</script>

Loading…
Cancel
Save