Browse Source

物料讲讲/销售发运开发代码

master_hella_20240701
chenfang 6 months ago
parent
commit
e4161abac8
  1. 73
      src/api/wms/relegateRequest/index.ts
  2. 233
      src/views/wms/basicDataManage/itemManage/relegateRequest/index.vue
  3. 243
      src/views/wms/basicDataManage/itemManage/relegateRequest/relegateRequest.data.ts
  4. 18
      src/views/wms/deliversettlementManage/deliverplan/saleMain/saleMain.data.ts
  5. 35
      src/views/wms/deliversettlementManage/saleShipmentMainRequest/index.vue
  6. 162
      src/views/wms/deliversettlementManage/saleShipmentMainRequest/saleShipmentMain.data.ts

73
src/api/wms/relegateRequest/index.ts

@ -0,0 +1,73 @@
import request from '@/config/axios'
export interface RelegateRequestVO {
id: number
itemCode: string
downItemCode: string
businessType: string
uom: string
qty: number
fromBatch: string
fromPackingNumber: string
fromLocationCode: string
fromAreaTypes: string
fromAreaCodes: string
fromWarehouseCode: string
toPackingNumber: string
toBatch: string
toLocationCode: string
toWarehouseCode: string
toAreaTypes: string
toAreaCodes: string
number: string
available: string
remark: string
departmentCode: string
siteId: number
extraProperties: string
status: string
concurrencyStamp: number
serialNumber: string
ruleUserId: number
}
// 查询物料降级信息列表
export const getRelegateRequestPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/relegate-request/senior', data })
} else {
return await request.get({ url: `/wms/relegate-request/page`, params })
}
}
// 查询物料降级信息详情
export const getRelegateRequest = async (id: number) => {
return await request.get({ url: `/wms/relegate-request/get?id=` + id })
}
// 新增物料降级信息
export const createRelegateRequest = async (data: RelegateRequestVO) => {
return await request.post({ url: `/wms/relegate-request/create`, data })
}
// 修改物料降级信息
export const updateRelegateRequest = async (data: RelegateRequestVO) => {
return await request.put({ url: `/wms/relegate-request/update`, data })
}
// 删除物料降级信息
export const deleteRelegateRequest = async (id: number) => {
return await request.delete({ url: `/wms/relegate-request/delete?id=` + id })
}
// 导出物料降级信息 Excel
export const exportRelegateRequest = async (params) => {
return await request.download({ url: `/wms/relegate-request/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/relegate-request/get-import-template' })
}

233
src/views/wms/basicDataManage/itemManage/relegateRequest/index.vue

@ -0,0 +1,233 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="RelegateRequest.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="RelegateRequest.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 #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="RelegateRequestRules"
:formAllSchemas="RelegateRequest.allSchemas"
:apiUpdate="RelegateRequestApi.updateRelegateRequest"
:apiCreate="RelegateRequestApi.createRelegateRequest"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="RelegateRequest.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/relegate-request/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { RelegateRequest,RelegateRequestRules } from './relegateRequest.data'
import * as RelegateRequestApi from '@/api/wms/relegateRequest'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'RelegateRequest' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(RelegateRequest.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: RelegateRequestApi.getRelegateRequestPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:relegate-request:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:relegate-request:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:relegate-request: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 butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:relegate-request:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:relegate-request:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
if (formType === 'create') {
await RelegateRequestApi.createRelegateRequest(data)
message.success(t('common.createSuccess'))
} else {
await RelegateRequestApi.updateRelegateRequest(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicRelegateRequest')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await RelegateRequestApi.deleteRelegateRequest(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 RelegateRequestApi.exportRelegateRequest(tableObject.params)
download.excel(data, '物料降级信息.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
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
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await RelegateRequestApi.importTemplate()
})
</script>

243
src/views/wms/basicDataManage/itemManage/relegateRequest/relegateRequest.data.ts

@ -0,0 +1,243 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
// 表单校验
export const RelegateRequestRules = reactive({
itemCode: [required],
downItemCode: [required],
businessType: [required],
available: [required],
departmentCode: [required],
concurrencyStamp: [required],
})
export const RelegateRequest = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择物料代码',
searchField: 'itemCode',
searchTitle: '客户物料基础信息',
searchAllSchemas: Itembasic.allSchemas,
searchPage: ItembasicApi.getItembasicPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '降级后物料代码',
field: 'downItemCode',
sort: 'custom',
isSearch: true,
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
form: {
componentProps: {
disabled: true,
}
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
},
{
label: '从批次',
field: 'fromBatch',
sort: 'custom',
form: {
componentProps: {
disabled: true,
}
},
},
{
label: '从包装号',
field: 'fromPackingNumber',
sort: 'custom',
form: {
componentProps: {
disabled: true,
}
},
},
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
form: {
componentProps: {
disabled: true,
}
},
},
{
label: '从库区类型',
field: 'fromAreaTypes',
sort: 'custom',
isForm:false,
},
{
label: '从库区代码',
field: 'fromAreaCodes',
sort: 'custom',
isForm:false,
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
isForm:false,
},
{
label: '到包装号',
field: 'toPackingNumber',
sort: 'custom',
},
{
label: '到批次',
field: 'toBatch',
sort: 'custom',
},
{
label: '到库位代码',
field: 'toLocationCode',
sort: 'custom',
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
isForm:false,
},
{
label: '到库区类型',
field: 'toAreaTypes',
sort: 'custom',
isForm:false,
},
{
label: '到库区代码',
field: 'toAreaCodes',
sort: 'custom',
isForm:false,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isForm:false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
isForm:false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
isForm:false,
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isForm:false,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: true,
isForm: false,
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isForm:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '工作流流水号',
field: 'serialNumber',
isForm:false,
sort: 'custom',
},
{
label: '权限所属人员id',
field: 'ruleUserId',
sort: 'custom',
isForm:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

18
src/views/wms/deliversettlementManage/deliverplan/saleMain/saleMain.data.ts

@ -4,6 +4,9 @@ import { dateFormatter,dateFormatter2 } from '@/utils/formatTime'
import * as CustomerApi from '@/api/wms/customer'
import { Customer } from '@/views/wms/basicDataManage/customerManage/customer/customer.data'
import * as PackageunitApi from '@/api/wms/packageunit'
import { Packageunit } from '@/views/wms/basicDataManage/itemManage/packageunit/packageunit.data'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
@ -357,15 +360,20 @@ export const SaleDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '包装规格',
field: 'packUnit',
// dictType: DICT_TYPE.PACK_UNIT,
// dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select'
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择包装规格代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '包装规格信息', // 查询弹窗标题
searchAllSchemas: Packageunit.allSchemas, // 查询弹窗所需类
searchPage: PackageunitApi.getPackageunitPage, // 查询弹窗所需分页方法
}
}
},
{

35
src/views/wms/deliversettlementManage/saleShipmentMainRequest/index.vue

@ -42,8 +42,6 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
:isOpenSearchTable="true"
fieldTableColumn="itemCode"
@success="getList"
:rules="SaleShipmentMainRules"
:formAllSchemas="SaleShipmentMain.allSchemas"
@ -105,15 +103,23 @@ const tableColumns = ref(SaleShipmentMain.allSchemas.tableColumns)
const trueFalse = ref(false)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
const setV = {}
if (type == 'tableForm') {
row['soLine'] = val[0]['lineNumber']
row['soNumber'] = val[0]['number']
row['itemCode'] = val[0]['itemCode']
row['projectCode'] = val[0]['projectCode']
row['uom'] = val[0]['uom']
}else {
const setV = {}
if(formField == 'CustomerCode') {
setV['CustomerCode'] = val[0]['CustomerCode']
} else {
setV[formField] = val[0][searchField]
}
formRef.setValues(setV)
}
})
}
@ -121,7 +127,15 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
if(formField == 'soLine') {
setV['soLine'] = val[0]['lineNumber']
setV['soNumber'] = val[0]['number']
setV['itemCode'] = val[0]['itemCode']
setV['projectCode'] = val[0]['projectCode']
setV['uom'] = val[0]['uom']
}else {
setV[formField] = val[0][searchField]
}
formRef.setValues(setV)
})
}
@ -247,9 +261,18 @@ const submitForm = async (formType, data) => {
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
SaleShipmentDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
let tableForm = JSON.parse(JSON.stringify(tableFormKeys))
tableData.value.push(tableForm)
}
//
const handleDeleteTable = (item, index) => {

162
src/views/wms/deliversettlementManage/saleShipmentMainRequest/saleShipmentMain.data.ts

@ -4,8 +4,8 @@ import { dateFormatter } from '@/utils/formatTime'
import * as CustomerApi from '@/api/wms/customer'
import { Customer } from '@/views/wms/basicDataManage/customerManage/customer/customer.data'
import * as SaleMainApi from '@/api/wms/saleMain'
import { SaleMain } from '@/views/wms/deliversettlementManage/deliverplan/saleMain/saleMain.data'
import * as SaleDetailApi from '@/api/wms/saleDetail'
import { SaleDetail } from '@/views/wms/deliversettlementManage/deliverplan/saleMain/saleMain.data'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
@ -65,6 +65,7 @@ export const SaleShipmentMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '备注',
field: 'remark',
sort: 'custom',
isForm: false,
},
{
label: '发票时间',
@ -87,6 +88,13 @@ export const SaleShipmentMain = useCrudSchemas(reactive<CrudSchema[]>([
}
},
},
{
label: '地点',
field: 'siteId',
sort: 'custom',
isSearch: true,
hiddenInMain: true,
},
{
label: '部门',
field: 'departmentCode',
@ -243,33 +251,13 @@ export const SaleShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150
},
tableForm:{
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择销售订单号',
searchField: 'number',
searchTitle: '销售订单信息',
searchAllSchemas: SaleMain.allSchemas,
searchPage: SaleMainApi.getSaleMainPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
tableForm: {
type: 'Select',
disabled: true
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择销售订单号',
searchField: 'number',
searchTitle: '销售订单信息',
searchAllSchemas: SaleMain.allSchemas,
searchPage: SaleMainApi.getSaleMainPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
disabled: true
}
}
},
@ -285,8 +273,8 @@ export const SaleShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchListPlaceholder: '请选择销售订单行',
searchField: 'lineNumber',
searchTitle: '销售订单信息',
searchAllSchemas: SaleMain.allSchemas,
searchPage: SaleMainApi.getSaleMainPage,
searchAllSchemas: SaleDetail.allSchemas,
searchPage: SaleDetailApi.getSaleDetailPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
@ -300,27 +288,35 @@ export const SaleShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchListPlaceholder: '请选择销售订单行',
searchField: 'lineNumber',
searchTitle: '销售订单信息',
searchAllSchemas: SaleMain.allSchemas,
searchPage: SaleMainApi.getSaleMainPage,
searchAllSchemas: SaleDetail.allSchemas,
searchPage: SaleDetailApi.getSaleDetailPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'customerCode',
value: 'customerCode',
isMainValue: true
}]
}
}
},
{
label: '从货主代码',
field: 'fromOwnerCode',
sort: 'custom',
isSearch: true,
},
{
label: '包装号',
field: 'packingNumber',
label: '物品代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
tableForm: {
type: 'Select',
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '批次',
@ -329,59 +325,81 @@ export const SaleShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
},
{
label: '库存状态',
field: 'inventoryStatus',
label: '从货主代码',
field: 'fromOwnerCode',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
isForm: false,
isTableForm: false
},
{
label: '从库位代码',
field: 'fromLocationCode',
label: '包装号',
field: 'packingNumber',
sort: 'custom',
isSearch: true,
isForm: false,
isTableForm: false
},
{
label: '主表ID',
field: 'masterId',
label: '库存状态',
field: 'inventoryStatus',
// dictType: DICT_TYPE.INVENTORY_STATUS,
// dictClass: 'string',
isTable: true,
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
table: {
width: 150
},
isTableForm: false,
hiddenInMain: true,
isForm: false,
},
{
label: '物品代码',
field: 'itemCode',
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
isSearch: true,
isTableForm: false
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
isForm: false,
isTableForm: false
},
{
label: '物品描述1',
field: 'itemDesc1',
field: 'itemName',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
isForm: false,
isTableForm: false
},
{
label: '物品描述2',
field: 'itemDesc2',
field: 'itemName',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
isForm: false,
isTableForm: false
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
isSearch: true,
isTableForm: false,
hiddenInMain: true,
},
{
label: '数量',
@ -392,14 +410,29 @@ export const SaleShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
isSearch: true,
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
isTableForm: false
},
{
label: '创建时间',
@ -416,16 +449,7 @@ export const SaleShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
}
},
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
isTableForm: false
},
{
label: '操作',

Loading…
Cancel
Save