Browse Source

退料

master
陈薪名 12 months ago
parent
commit
561ec1b675
  1. 25
      src/api/wms/productionreturnJobMain/index.ts
  2. 2
      src/api/wms/productionreturnRequestMain/index.ts
  3. 49
      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. 288
      src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue

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

@ -73,10 +73,35 @@ export const deleteProductionreturnJobMain = async (id: number) => {
// 导出生产退料任务主 Excel // 导出生产退料任务主 Excel
export const exportProductionreturnJobMain = async (params) => { export const exportProductionreturnJobMain = async (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 }) return await request.download({ url: `/wms/productionreturn-job-main/export-excel`, params })
}
} }
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/wms/productionreturn-job-main/get-import-template' }) 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) => { export const getProductionreturnRequestMainPage = async (params) => {
params.businessType = 'ReturnToStore'
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}
@ -58,6 +59,7 @@ export const deleteProductionreturnRequestMain = async (id: number) => {
// 导出生产退料申请主 Excel // 导出生产退料申请主 Excel
export const exportProductionreturnRequestMain = async (params) => { export const exportProductionreturnRequestMain = async (params) => {
params.businessType = 'ReturnToStore'
if (params.isSearch) { if (params.isSearch) {
const data = {...params} const data = {...params}
return await request.downloadPost({ url: `/wms/productionreturn-request-main/export-excel-senior`, data }) return await request.downloadPost({ url: `/wms/productionreturn-request-main/export-excel-senior`, data })

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

@ -25,8 +25,9 @@ export interface ProductionreturnRequestMainVO {
directCreateRecord: string directCreateRecord: string
} }
// 查询生产退料申请主列表 // 查询不合格生产退料申请主列表
export const getProductionreturnRequestMainPage = async (params) => { export const getProductionreturnRequestMainPage = async (params) => {
params.businessType = 'ReturnToHold'
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}
@ -36,32 +37,68 @@ export const getProductionreturnRequestMainPage = async (params) => {
} }
} }
// 查询生产退料申请主详情 // 查询不合格生产退料申请主详情
export const getProductionreturnRequestMain = async (id: number) => { export const getProductionreturnRequestMain = async (id: number) => {
return await request.get({ url: `/wms/productionreturn-request-main/get?id=` + id }) return await request.get({ url: `/wms/productionreturn-request-main/get?id=` + id })
} }
// 新增生产退料申请主 // 新增不合格生产退料申请主
export const createProductionreturnRequestMain = async (data: ProductionreturnRequestMainVO) => { export const createProductionreturnRequestMain = async (data: ProductionreturnRequestMainVO) => {
return await request.post({ url: `/wms/productionreturn-request-main/create`, data }) return await request.post({ url: `/wms/productionreturn-request-main/create`, data })
} }
// 修改生产退料申请主 // 修改不合格生产退料申请主
export const updateProductionreturnRequestMain = async (data: ProductionreturnRequestMainVO) => { export const updateProductionreturnRequestMain = async (data: ProductionreturnRequestMainVO) => {
return await request.put({ url: `/wms/productionreturn-request-main/update`, data }) return await request.put({ url: `/wms/productionreturn-request-main/update`, data })
} }
// 删除生产退料申请主 // 删除不合格生产退料申请主
export const deleteProductionreturnRequestMain = async (id: number) => { export const deleteProductionreturnRequestMain = async (id: number) => {
return await request.delete({ url: `/wms/productionreturn-request-main/delete?id=` + id }) return await request.delete({ url: `/wms/productionreturn-request-main/delete?id=` + id })
} }
// 导出生产退料申请主 Excel // 导出不合格生产退料申请主 Excel
export const exportProductionreturnRequestMain = async (params) => { export const exportProductionreturnRequestMain = async (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 }) return await request.download({ url: `/wms/productionreturn-request-main/export-excel`, params })
}
} }
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/wms/productionreturn-request-main/get-import-template' }) 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: '操作', // label: '操作',
field: 'action', // field: 'action',
isDetail: false, // isDetail: false,
isForm: false, // isForm: false,
table: { // table: {
width: 120, // width: 120,
fixed: 'right' // fixed: 'right'
}, // },
} // }
])) ]))
//表单校验 //表单校验

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

@ -357,259 +357,244 @@ export const ProductionreturnRecordDetail = useCrudSchemas(reactive<CrudSchema[]
}, },
}, },
{ {
label: '库存状态', label: '单据号',
field: 'inventoryStatus', field: 'number',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '从货主代码', label: '物品代码',
field: 'fromOwnerCode', field: 'itemCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '从包装号', label: '物品名称',
field: 'frompackingNumber', field: 'itemName',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '从器具号', label: '物品描述1',
field: 'fromcontainerNumber', field: 'itemDesc1',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '从批次', label: '物品描述2',
field: 'frombatch', field: 'itemDesc2',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '从库位代码', label: '项目代码',
field: 'fromlocationCode', field: 'projectCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '从库位组代码', label: '数量',
field: 'fromlocationGroupCode', field: 'qty',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
form: {
component: 'InputNumber',
}
}, },
{ {
label: '从库区代码', label: '计量单位',
field: 'fromareaCode', field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '到货主代码', label: '库存状态',
field: 'toOwnerCode', field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '包装号', label: '包装号',
field: 'topackingNumber', field: 'fromPackingNumber',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '到器具号', label: '到包装号',
field: 'tocontainerNumber', field: 'toPackingNumber',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '到批次', label: '从器具号',
field: 'tobatch', field: 'fromContainerNumber',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '到库位代码', label: '到器具号',
field: 'toLocationCode', field: 'toContainerNumber',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '到库位组代码', label: '从批次',
field: 'toLocationGroupCode', field: 'fromBatch',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '到库区代码', label: '到批次',
field: 'toAreaCode', field: 'toBatch',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '单据号', label: '从库位代码',
field: 'number', field: 'fromLocationCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '物品代码', label: '到库位代码',
field: 'itemCode', field: 'toLocationCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '备注', label: '从库位组代码',
field: 'remark', field: 'fromLocationGroupCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '创建时间', label: '到库位组代码',
field: 'createTime', field: 'toLocationGroupCode',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom', sort: 'custom',
table: { table: {
width: 180 width: 150
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
}, },
}, },
{ {
label: '创建者', label: '从库区代码',
field: 'creator', field: 'fromAreaCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '物品名称', label: '到库区代码',
field: 'itemName', field: 'toAreaCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '物品描述1', label: '从货主代码',
field: 'itemDesc1', field: 'fromOwnerCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '物品描述2', label: '到货主代码',
field: 'itemDesc2', field: 'toOwnerCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '项目代码', label: '备注',
field: 'projectCode', field: 'remark',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '数量', label: '接口类型',
field: 'qty', field: 'interfaceType',
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
form: {
component: 'InputNumber',
}
}, },
{ {
label: '计量单位', label: '创建者',
field: 'uom', field: 'creator',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
// {
// label: '任务明细ID',
// field: 'jobDetailId',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '代码',
// field: 'code',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{ {
label: '接口类型', label: '创建时间',
field: 'interfaceType', field: 'createTime',
dictType: DICT_TYPE.INTERFACE_TYPE, formatter: dateFormatter,
dictClass: 'string', detail: {
isTable: true, dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom', sort: 'custom',
table: { 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 tableColumns = ref(ProductionreturnRequestMain.allSchemas.tableColumns)
// //
const dialogVisible = ref(false)
const dialogTitle = ref('创建标签')
const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas
const isCreateLabel = ref(false) const isCreateLabel = ref(false)
const formLabelRef = ref() const formLabelRef = ref()
//
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
getListApi: ProductionreturnRequestDetailApi.getProductionreturnRequestDetailPage getListApi: ProductionreturnRequestDetailApi.getProductionreturnRequestDetailPage
}) })
const { getList:getDetailList } = detatableMethods const { getList:getDetailList } = detatableMethods
//
const saveLabel = () => {
isCreateLabel.value = true
}
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
@ -137,7 +128,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
if(formField == 'itemCode') { if(formField == 'itemCode') {
// row['packingNumber'] = val[0]['packingNumber'] // row['packingNumber'] = val[0]['packingNumber']
// row['containerNumber'] = val[0]['containerNumber'] // row['containerNumber'] = val[0]['containerNumber']
row['batch'] = val[0]['batch'] // row['batch'] = val[0]['batch']
row['itemCode'] = val[0]['itemCode'] row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom'] row['uom'] = val[0]['uom']
row['inventoryStatus'] = val[0]['inventoryStatus'] row['inventoryStatus'] = val[0]['inventoryStatus']
@ -408,8 +399,8 @@ const handleExport = async () => {
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
const data = await ProductionreturnRequestMainApi.exportProductionreturnRequestMain(setSearchParams) const data = await ProductionreturnRequestMainApi.exportProductionreturnRequestMain(tableObject.params)
download.excel(data, '生产退料申请.xlsx') download.excel(data, '生产退料合格申请.xlsx')
} catch { } catch {
} finally { } finally {
exportLoading.value = false exportLoading.value = false
@ -427,7 +418,9 @@ const tableData = ref([])
// //
const handleAddTable = () => { 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) => { const handleDeleteTable = (item, index) => {

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

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

Loading…
Cancel
Save