zhousq
7 months ago
70 changed files with 3715 additions and 1414 deletions
@ -0,0 +1,37 @@ |
|||||
|
# 生产环境 |
||||
|
NODE_ENV=test |
||||
|
|
||||
|
VITE_DEV=false |
||||
|
|
||||
|
# 请求路径 |
||||
|
VITE_BASE_URL='http://dev.ccwin-in.com:25400/api' |
||||
|
|
||||
|
# 上传路径 |
||||
|
VITE_UPLOAD_URL='http://dev.ccwin-in.com:25400/api/admin-api/infra/file/upload' |
||||
|
|
||||
|
# 接口前缀 |
||||
|
VITE_API_BASEPATH= |
||||
|
|
||||
|
# 接口地址 |
||||
|
VITE_API_URL=/admin-api |
||||
|
|
||||
|
# 是否删除debugger |
||||
|
VITE_DROP_DEBUGGER=true |
||||
|
|
||||
|
# 是否删除console.log |
||||
|
VITE_DROP_CONSOLE=true |
||||
|
|
||||
|
# 是否sourcemap |
||||
|
VITE_SOURCEMAP=false |
||||
|
|
||||
|
# 打包路径 |
||||
|
VITE_BASE_PATH=/ |
||||
|
|
||||
|
# 输出路径 |
||||
|
VITE_OUT_DIR=sfms3.0 |
||||
|
|
||||
|
# 自定义接口路径 |
||||
|
VITE_INTERFACE_URL='http://dev.ccwin-in.com:25311/magic/web/index.html' |
||||
|
|
||||
|
# 积木报表请求路径 |
||||
|
VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25311' |
@ -0,0 +1,7 @@ |
|||||
|
# 设置基础镜像 |
||||
|
FROM win-nginx |
||||
|
|
||||
|
WORKDIR /opt/sfms3.0 |
||||
|
COPY nginx_scp.conf /usr/local/nginx/conf/nginx.conf |
||||
|
# 将dist文件中的内容复制到 /opt/sfms3.0 这个目录下面 |
||||
|
COPY sfms3.0/ /opt/sfms3.0 |
@ -0,0 +1,53 @@ |
|||||
|
user root; |
||||
|
worker_processes 2; |
||||
|
|
||||
|
events { |
||||
|
worker_connections 1024; |
||||
|
} |
||||
|
|
||||
|
http { |
||||
|
include mime.types; |
||||
|
charset utf-8,gbk; |
||||
|
default_type application/octet-stream; |
||||
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' |
||||
|
'$status $body_bytes_sent "$http_referer" ' |
||||
|
'"$http_user_agent" "$http_x_forwarded_for" "$request_time $upstream_response_time"'; |
||||
|
access_log logs/access.log main; |
||||
|
sendfile on; |
||||
|
#tcp_nopush on; |
||||
|
keepalive_timeout 600s; |
||||
|
client_max_body_size 200m; |
||||
|
gzip on; |
||||
|
gzip_min_length 10k; |
||||
|
gzip_comp_level 9; |
||||
|
gzip_buffers 4 16k; |
||||
|
gzip_types text/plain application/javascript text/css application/xml text/javascript image/jpeg image/gif image/png; |
||||
|
gzip_vary on; |
||||
|
gzip_disable "MSIE [1-6]\."; |
||||
|
upstream sfms3.0 { |
||||
|
server localhost:25311 weight=10 max_fails=3 fail_timeout=10s; |
||||
|
} |
||||
|
server { |
||||
|
listen 25400; |
||||
|
server_name_in_redirect off; |
||||
|
server_name _; |
||||
|
location /api/ { |
||||
|
proxy_pass http://sfms3.0/; |
||||
|
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header; |
||||
|
proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for; |
||||
|
proxy_set_header Host $http_host; |
||||
|
proxy_set_header X-Real-IP $remote_addr; |
||||
|
proxy_set_header X-Forwarded-For $http_x_forwarded_for; |
||||
|
} |
||||
|
location /profile/ { |
||||
|
alias /opt/profile/; |
||||
|
index index.html index.htm; |
||||
|
} |
||||
|
location / { |
||||
|
try_files $uri $uri/ /index.html; |
||||
|
root /opt/sfms3.0; |
||||
|
index index.html index.htm; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
@ -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' }) |
||||
|
} |
@ -0,0 +1,65 @@ |
|||||
|
import request from '@/config/axios' |
||||
|
|
||||
|
export interface SaleShipmentDetailVO { |
||||
|
id: number |
||||
|
soNumber: string |
||||
|
soLine: string |
||||
|
fromOwnerCode: string |
||||
|
packingNumber: string |
||||
|
batch: string |
||||
|
inventoryStatus: string |
||||
|
fromLocationCode: string |
||||
|
masterId: number |
||||
|
number: string |
||||
|
itemCode: string |
||||
|
itemName: string |
||||
|
itemDesc1: string |
||||
|
itemDesc2: string |
||||
|
projectCode: string |
||||
|
qty: number |
||||
|
uom: string |
||||
|
remark: string |
||||
|
concurrencyStamp: string |
||||
|
siteId: number |
||||
|
} |
||||
|
|
||||
|
// 查询销售发运申请子列表
|
||||
|
export const getSaleShipmentDetailPage = async (params) => { |
||||
|
if (params.isSearch) { |
||||
|
delete params.isSearch |
||||
|
const data = {...params} |
||||
|
return await request.post({ url: '/wms/sale-shipment-detail/senior', data }) |
||||
|
} else { |
||||
|
return await request.get({ url: `/wms/sale-shipment-detail/page`, params }) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 查询销售发运申请子详情
|
||||
|
export const getSaleShipmentDetail = async (id: number) => { |
||||
|
return await request.get({ url: `/wms/sale-shipment-detail/get?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 新增销售发运申请子
|
||||
|
export const createSaleShipmentDetail = async (data: SaleShipmentDetailVO) => { |
||||
|
return await request.post({ url: `/wms/sale-shipment-detail/create`, data }) |
||||
|
} |
||||
|
|
||||
|
// 修改销售发运申请子
|
||||
|
export const updateSaleShipmentDetail = async (data: SaleShipmentDetailVO) => { |
||||
|
return await request.put({ url: `/wms/sale-shipment-detail/update`, data }) |
||||
|
} |
||||
|
|
||||
|
// 删除销售发运申请子
|
||||
|
export const deleteSaleShipmentDetail = async (id: number) => { |
||||
|
return await request.delete({ url: `/wms/sale-shipment-detail/delete?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 导出销售发运申请子 Excel
|
||||
|
export const exportSaleShipmentDetail = async (params) => { |
||||
|
return await request.download({ url: `/wms/sale-shipment-detail/export-excel`, params }) |
||||
|
} |
||||
|
|
||||
|
// 下载用户导入模板
|
||||
|
export const importTemplate = () => { |
||||
|
return request.download({ url: '/wms/sale-shipment-detail/get-import-template' }) |
||||
|
} |
@ -0,0 +1,64 @@ |
|||||
|
import request from '@/config/axios' |
||||
|
|
||||
|
export interface SaleShipmentMainVO { |
||||
|
id: number |
||||
|
customerCode: string |
||||
|
number: string |
||||
|
businessType: string |
||||
|
remark: string |
||||
|
extraProperties: string |
||||
|
siteId: number |
||||
|
invoiceTime: Date |
||||
|
requestTime: Date |
||||
|
dueTime: Date |
||||
|
departmentCode: string |
||||
|
status: string |
||||
|
autoCommit: string |
||||
|
autoAgree: string |
||||
|
autoExecute: string |
||||
|
directCreateRecord: string |
||||
|
concurrencyStamp: string |
||||
|
ruleUserId: number |
||||
|
serialNumber: string |
||||
|
} |
||||
|
|
||||
|
// 查询销售发运申请主列表
|
||||
|
export const getSaleShipmentMainPage = async (params) => { |
||||
|
if (params.isSearch) { |
||||
|
delete params.isSearch |
||||
|
const data = {...params} |
||||
|
return await request.post({ url: '/wms/sale-shipment-main-request/senior', data }) |
||||
|
} else { |
||||
|
return await request.get({ url: `/wms/sale-shipment-main-request/page`, params }) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 查询销售发运申请主详情
|
||||
|
export const getSaleShipmentMain = async (id: number) => { |
||||
|
return await request.get({ url: `/wms/sale-shipment-main-request/get?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 新增销售发运申请主
|
||||
|
export const createSaleShipmentMain = async (data: SaleShipmentMainVO) => { |
||||
|
return await request.post({ url: `/wms/sale-shipment-main-request/create`, data }) |
||||
|
} |
||||
|
|
||||
|
// 修改销售发运申请主
|
||||
|
export const updateSaleShipmentMain = async (data: SaleShipmentMainVO) => { |
||||
|
return await request.put({ url: `/wms/sale-shipment-main-request/update`, data }) |
||||
|
} |
||||
|
|
||||
|
// 删除销售发运申请主
|
||||
|
export const deleteSaleShipmentMain = async (id: number) => { |
||||
|
return await request.delete({ url: `/wms/sale-shipment-main-request/delete?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 导出销售发运申请主 Excel
|
||||
|
export const exportSaleShipmentMain = async (params) => { |
||||
|
return await request.download({ url: `/wms/sale-shipment-main-request/export-excel`, params }) |
||||
|
} |
||||
|
|
||||
|
// 下载用户导入模板
|
||||
|
export const importTemplate = () => { |
||||
|
return request.download({ url: '/wms/sale-shipment-main-request/get-import-template' }) |
||||
|
} |
@ -0,0 +1,60 @@ |
|||||
|
<template> |
||||
|
<el-dialog class="preview" v-model="showDialog" style="" @close="closeView"> |
||||
|
<iframe v-if="isPDF" ref="pdfRef" width="100%" :height="frameHeight" :src="pdfUrl" frameborder="0"></iframe> |
||||
|
<el-carousel justify="center" v-else indicator-position="outside"> |
||||
|
<el-carousel-item class="carousel-item" v-for="url in imageArray" :key="url"> |
||||
|
<el-image style="height:100%" fit="contain" :src="url" loading="lazy" /> |
||||
|
</el-carousel-item> |
||||
|
</el-carousel> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
<script setup lang="ts"> |
||||
|
import { ref } from 'vue' |
||||
|
const showDialog = ref(false) // 弹窗控制 |
||||
|
const message = useMessage() // 消息弹窗 |
||||
|
const isPDF = ref(false) // 是否是pdf |
||||
|
const pdfUrl = ref<string>('') // pdf地址 |
||||
|
const pdfRef = ref() // pdf组件 |
||||
|
const frameHeight = ref(0) |
||||
|
const imageArray = ref<string[]>([]) // 图片数组 |
||||
|
const closeView = () => { |
||||
|
showDialog.value = false |
||||
|
} |
||||
|
// 打开预览 |
||||
|
const openPreview = async (data:string[]|string)=>{ |
||||
|
showDialog.value = true |
||||
|
if(Array.isArray(data)){ |
||||
|
//图片数组 |
||||
|
isPDF.value = false |
||||
|
pdfUrl.value = '' |
||||
|
imageArray.value = data.filter(item=>(item.replace('/get/','/show/'))) |
||||
|
}else{ |
||||
|
isPDF.value = true |
||||
|
pdfUrl.value = data.replace('/get/','/show/') |
||||
|
nextTick(()=>{ |
||||
|
frameHeight.value = window.innerHeight - 2*pdfRef.value.getBoundingClientRect().top |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
defineExpose({openPreview}) |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
/* .preview .el-dialog__headerbtn .el-dialog__close{ |
||||
|
color: white !important; |
||||
|
font-size: 20px !important; |
||||
|
} |
||||
|
.preview.el-dialog { |
||||
|
--el-dialog-box-shadow:null; |
||||
|
} */ |
||||
|
</style> |
||||
|
<style lang="scss" scoped> |
||||
|
.carousel-item{ |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
</style> |
@ -1,133 +0,0 @@ |
|||||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|
||||
import { dateFormatter } from '@/utils/formatTime' |
|
||||
import * as DictTypeApi from '@/api/system/dict/dict.type' |
|
||||
|
|
||||
const optionsList = await DictTypeApi.getDictTypeAndData('inspection') |
|
||||
optionsList.forEach(element => { |
|
||||
element.options = element.dictDataRespVOList.map(item => { |
|
||||
return { |
|
||||
value: element.type + "-%%%-" + item.value, |
|
||||
label: element.name + "-" + item.label |
|
||||
} |
|
||||
}) |
|
||||
}) |
|
||||
|
|
||||
// 表单校验
|
|
||||
export const SelectedProjectRules = reactive({ |
|
||||
code: [required], |
|
||||
dictionaryTypeAndCode: [required], |
|
||||
estimateCode: [required], |
|
||||
defectLevel: [required], |
|
||||
}) |
|
||||
|
|
||||
export const SelectedProject = useCrudSchemas(reactive<CrudSchema[]>([ |
|
||||
|
|
||||
{ |
|
||||
label: '编码', |
|
||||
field: 'code', |
|
||||
sort: 'custom', |
|
||||
isTableForm: false, |
|
||||
isSearch: true, |
|
||||
fixed: 'left', |
|
||||
form: { |
|
||||
componentProps:{ |
|
||||
disabled:true |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
label: '字典及字典项', |
|
||||
field: 'dictionaryTypeAndCode', |
|
||||
sort: 'custom', |
|
||||
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => { |
|
||||
return optionsList.find(item => item.options.some(option => option.value === cellValue))?.options.find(option => option.value === cellValue)?.label |
|
||||
}, |
|
||||
isSearch: false, |
|
||||
isDetail: false, |
|
||||
isTable: true, |
|
||||
isForm: true, |
|
||||
tableForm: { |
|
||||
type: 'SelectGroup', |
|
||||
initOptions: optionsList, |
|
||||
filterable: true, |
|
||||
}, |
|
||||
form: { |
|
||||
component: 'Select', |
|
||||
componentProps: { |
|
||||
options: optionsList, |
|
||||
filterable: true, |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
label: '字典', |
|
||||
field: 'dictionaryCode', |
|
||||
sort: 'custom', |
|
||||
isSearch: false, |
|
||||
isTableForm: false, |
|
||||
isDetail: false, |
|
||||
isTable: false, |
|
||||
isForm: false, |
|
||||
}, |
|
||||
{ |
|
||||
label: '字典项', |
|
||||
field: 'dictionaryValue', |
|
||||
sort: 'custom', |
|
||||
isSearch: false, |
|
||||
isTableForm: false, |
|
||||
isDetail: false, |
|
||||
isTable: false, |
|
||||
isForm: false, |
|
||||
}, |
|
||||
{ |
|
||||
label: '字典名称', |
|
||||
field: 'dictionaryLabel', |
|
||||
sort: 'custom', |
|
||||
isSearch: false, |
|
||||
isTableForm: false, |
|
||||
isDetail: false, |
|
||||
isTable: false, |
|
||||
isForm: false, |
|
||||
}, |
|
||||
{ |
|
||||
label: '评估代码', |
|
||||
field: 'estimateCode', |
|
||||
sort: 'custom', |
|
||||
isSearch: true, |
|
||||
dictType: DICT_TYPE.EVALUATION_CODE, |
|
||||
dictClass: 'string', |
|
||||
tableForm: { |
|
||||
type: 'Select', |
|
||||
}, |
|
||||
form: { |
|
||||
component: 'Select', |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
label: '缺陷级别', |
|
||||
field: 'defectLevel', |
|
||||
sort: 'custom', |
|
||||
isSearch: true, |
|
||||
dictType: DICT_TYPE.DEFECT_LEVEL, |
|
||||
dictClass: 'string', |
|
||||
tableForm: { |
|
||||
type: 'Select', |
|
||||
}, |
|
||||
form: { |
|
||||
component: 'Select', |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
label: '操作', |
|
||||
field: 'action', |
|
||||
isForm: false, |
|
||||
table: { |
|
||||
width: 150, |
|
||||
fixed: 'right' |
|
||||
}, |
|
||||
isTableForm: false, |
|
||||
} |
|
||||
])) |
|
||||
|
|
||||
|
|
@ -0,0 +1,81 @@ |
|||||
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
||||
|
import { dateFormatter } from '@/utils/formatTime' |
||||
|
import * as DictTypeApi from '@/api/system/dict/dict.type' |
||||
|
|
||||
|
|
||||
|
|
||||
|
// 表单校验
|
||||
|
export const SelectedProjectRules = reactive({ |
||||
|
code: [required], |
||||
|
// dictionaryTypeAndCode: [required],
|
||||
|
estimateCode: [required], |
||||
|
defectLevel: [required], |
||||
|
dictionaryValue: [required] |
||||
|
}) |
||||
|
|
||||
|
export const SelectedProject = useCrudSchemas(reactive<CrudSchema[]>([ |
||||
|
|
||||
|
{ |
||||
|
label: '编码', |
||||
|
field: 'code', |
||||
|
sort: 'custom', |
||||
|
isTableForm: false, |
||||
|
isSearch: true, |
||||
|
fixed: 'left', |
||||
|
form: { |
||||
|
componentProps:{ |
||||
|
disabled:true |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '字典项', |
||||
|
field: 'dictionaryValue', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
isTableForm: true, |
||||
|
isDetail: true, |
||||
|
isTable: true, |
||||
|
isForm: true, |
||||
|
}, |
||||
|
{ |
||||
|
label: '评估代码', |
||||
|
field: 'estimateCode', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
dictType: DICT_TYPE.EVALUATION_CODE, |
||||
|
dictClass: 'string', |
||||
|
tableForm: { |
||||
|
type: 'Select', |
||||
|
}, |
||||
|
form: { |
||||
|
component: 'Select', |
||||
|
} |
||||
|
}, |
||||
|
// {
|
||||
|
// label: '缺陷级别',
|
||||
|
// field: 'defectLevel',
|
||||
|
// sort: 'custom',
|
||||
|
// isSearch: true,
|
||||
|
// dictType: DICT_TYPE.DEFECT_LEVEL,
|
||||
|
// dictClass: 'string',
|
||||
|
// tableForm: {
|
||||
|
// type: 'Select',
|
||||
|
// },
|
||||
|
// form: {
|
||||
|
// component: 'Select',
|
||||
|
// }
|
||||
|
// },
|
||||
|
{ |
||||
|
label: '操作', |
||||
|
field: 'action', |
||||
|
isForm: false, |
||||
|
table: { |
||||
|
width: 150, |
||||
|
fixed: 'right' |
||||
|
}, |
||||
|
isTableForm: false, |
||||
|
} |
||||
|
])) |
||||
|
|
||||
|
|
@ -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> |
@ -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' |
||||
|
} |
||||
|
} |
||||
|
])) |
@ -0,0 +1,348 @@ |
|||||
|
<template> |
||||
|
<ContentWrap> |
||||
|
<!-- 搜索工作栏 --> |
||||
|
<Search :schema="SaleShipmentMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
||||
|
</ContentWrap> |
||||
|
|
||||
|
<!-- 列表头部 --> |
||||
|
<TableHead |
||||
|
:HeadButttondata="HeadButttondata" |
||||
|
@button-base-click="buttonBaseClick" |
||||
|
:routeName="routeName" |
||||
|
@updataTableColumns="updataTableColumns" |
||||
|
@searchFormClick="searchFormClick" |
||||
|
:allSchemas="SaleShipmentMain.allSchemas" |
||||
|
:detailAllSchemas="SaleShipmentDetail.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.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="SaleShipmentMainRules" |
||||
|
:formAllSchemas="SaleShipmentMain.allSchemas" |
||||
|
:tableAllSchemas="SaleShipmentDetail.allSchemas" |
||||
|
:tableFormRules="SaleShipmentDetailRules" |
||||
|
:tableData="tableData" |
||||
|
:apiUpdate="SaleShipmentMainApi.updateSaleShipmentMain" |
||||
|
:apiCreate="SaleShipmentMainApi.createSaleShipmentMain" |
||||
|
:isBusiness="true" |
||||
|
fromeWhere="SaleShipmentRequestMain" |
||||
|
@handleAddTable="handleAddTable" |
||||
|
@handleDeleteTable="handleDeleteTable" |
||||
|
@searchTableSuccess="searchTableSuccess" |
||||
|
@submitForm="submitForm" |
||||
|
:isShowButton = isShowButton |
||||
|
/> |
||||
|
<!-- 详情 --> |
||||
|
<Detail |
||||
|
ref="detailRef" |
||||
|
:isBasic="false" |
||||
|
:allSchemas="SaleShipmentMain.allSchemas" |
||||
|
:detailAllSchemas="SaleShipmentDetail.allSchemas" |
||||
|
:detailAllSchemasRules="SaleShipmentDetailRules" |
||||
|
:apiCreate="SaleShipmentDetailApi.createSaleShipmentDetail" |
||||
|
:apiUpdate="SaleShipmentDetailApi.updateSaleShipmentDetail" |
||||
|
:apiPage="SaleShipmentDetailApi.getSaleShipmentDetailPage" |
||||
|
:apiDelete="SaleShipmentDetailApi.deleteSaleShipmentDetail" |
||||
|
fromeWhere="SaleShipmentRequestDetail" |
||||
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
||||
|
:detailButtonIsShowAdd="trueFalse" |
||||
|
:detailButtonIsShowDelete="trueFalse" |
||||
|
@detailOpenForm="detailOpenForm" |
||||
|
/> |
||||
|
|
||||
|
<!-- 导入 --> |
||||
|
<ImportForm ref="importFormRef" url="/wms/sale-shipment-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import download from '@/utils/download' |
||||
|
import { SaleShipmentMain,SaleShipmentMainRules,SaleShipmentDetail,SaleShipmentDetailRules } from './saleShipmentMain.data' |
||||
|
import * as SaleShipmentMainApi from '@/api/wms/saleShipmentMain' |
||||
|
import * as SaleShipmentDetailApi from '@/api/wms/saleShipmentDetail' |
||||
|
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: 'SaleShipmentMain' }) |
||||
|
|
||||
|
const message = useMessage() // 消息弹窗 |
||||
|
const { t } = useI18n() // 国际化 |
||||
|
|
||||
|
const route = useRoute() // 路由信息 |
||||
|
const routeName = ref() |
||||
|
routeName.value = route.name |
||||
|
const tableColumns = ref(SaleShipmentMain.allSchemas.tableColumns) |
||||
|
|
||||
|
//定义 展示子表数据时是否显示新增/修改/删除按钮 |
||||
|
const trueFalse = ref(false) |
||||
|
|
||||
|
// 查询页面返回 |
||||
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
||||
|
nextTick(() => { |
||||
|
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) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 查询页面返回——详情 |
||||
|
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
||||
|
nextTick(() => { |
||||
|
const setV = {} |
||||
|
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) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
const isShowButton = ref(true) |
||||
|
|
||||
|
// 字段设置 更新主列表字段 |
||||
|
const updataTableColumns = (val) => { |
||||
|
tableColumns.value = val |
||||
|
} |
||||
|
|
||||
|
const { tableObject, tableMethods } = useTable({ |
||||
|
getListApi: SaleShipmentMainApi.getSaleShipmentMainPage // 分页接口 |
||||
|
}) |
||||
|
|
||||
|
// 获得表格的各种操作 |
||||
|
const { getList, setSearchParams } = tableMethods |
||||
|
|
||||
|
// 列表头部按钮 |
||||
|
const HeadButttondata = [ |
||||
|
defaultButtons.defaultAddBtn({hasPermi:'wms:sale-shipment-main-request:create'}), // 新增 |
||||
|
defaultButtons.defaultImportBtn({hasPermi:'wms:sale-shipment-main-request:import'}), // 导入 |
||||
|
defaultButtons.defaultExportBtn({hasPermi:'wms:sale-shipment-main-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') { // 刷新 |
||||
|
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { |
||||
|
searchFormClick({ |
||||
|
filters: tableObject.params.filters |
||||
|
}) |
||||
|
} else { |
||||
|
getList() |
||||
|
} |
||||
|
} else if (val == 'filtrate') { // 筛选 |
||||
|
} else { // 其他按钮 |
||||
|
console.log('其他按钮', item) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 列表-操作按钮 |
||||
|
const butttondata = [ |
||||
|
defaultButtons.mainListEditBtn({hasPermi:'wms:sale-shipment-main-request:update'}), // 编辑 |
||||
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:sale-shipment-main-request:delete'}), // 删除 |
||||
|
] |
||||
|
|
||||
|
const tableData = ref([]) |
||||
|
|
||||
|
|
||||
|
// 列表-操作按钮事件 |
||||
|
const buttonTableClick = async (val, row) => { |
||||
|
if (val == 'edit') { // 编辑 |
||||
|
openForm('update', row) |
||||
|
} else if (val == 'delete') { // 删除 |
||||
|
handleDelete(row.id) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 详情 编辑页面打开 |
||||
|
* @param row |
||||
|
*/ |
||||
|
const detailOpenForm = (type) => { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/** 添加/修改操作 */ |
||||
|
const basicFormRef = ref() |
||||
|
const openForm = (type: string, row?: any) => { |
||||
|
basicFormRef.value.open(type, row) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// 主子数据 提交 |
||||
|
const submitForm = async (formType, data) => { |
||||
|
data.subList = tableData.value // 拼接子表数据参数 |
||||
|
let isExist = false |
||||
|
tableData.value.forEach(item => { |
||||
|
let rs = tableData.value.filter(filterItem => (filterItem.itemCode == item.itemCode)) |
||||
|
if(rs.length > 1) isExist = true |
||||
|
}) |
||||
|
if (isExist) { |
||||
|
basicFormRef.value.formLoading = false |
||||
|
return message.warning('物料代码重复') |
||||
|
} |
||||
|
try { |
||||
|
if (formType === 'create') { |
||||
|
if(tableData.value.length <= 0){ |
||||
|
message.warning(`子表明细不能为空!`) |
||||
|
basicFormRef.value.formLoading = false |
||||
|
return; |
||||
|
} |
||||
|
await SaleShipmentMainApi.createSaleShipmentMain(data) |
||||
|
message.success(t('common.createSuccess')) |
||||
|
} else { |
||||
|
await SaleShipmentMainApi.updateSaleShipmentMain(data) |
||||
|
message.success(t('common.updateSuccess')) |
||||
|
} |
||||
|
basicFormRef.value.dialogVisible = false |
||||
|
// 刷新当前列表 |
||||
|
getList() |
||||
|
} finally { |
||||
|
basicFormRef.value.formLoading = false |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* tableForm方法 |
||||
|
*/ |
||||
|
const tableFormKeys = {} |
||||
|
SaleShipmentDetail.allSchemas.tableFormColumns.forEach(item => { |
||||
|
tableFormKeys[item.field] = item.default ? item.default : '' |
||||
|
}) |
||||
|
|
||||
|
// 添加明细 |
||||
|
const handleAddTable = () => { |
||||
|
let tableForm = JSON.parse(JSON.stringify(tableFormKeys)) |
||||
|
tableData.value.push(tableForm) |
||||
|
} |
||||
|
// 删除明细 |
||||
|
const handleDeleteTable = (item, index) => { |
||||
|
tableData.value.splice(index, 1) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** 详情操作 */ |
||||
|
const detailRef = ref() |
||||
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
||||
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicSaleShipmentMain') |
||||
|
} |
||||
|
|
||||
|
/** 删除按钮操作 */ |
||||
|
const handleDelete = async (id: number) => { |
||||
|
try { |
||||
|
// 删除的二次确认 |
||||
|
await message.delConfirm() |
||||
|
// 发起删除 |
||||
|
await SaleShipmentMainApi.deleteSaleShipmentMain(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 SaleShipmentMainApi.exportSaleShipmentMain(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 SaleShipmentMainApi.importTemplate() |
||||
|
}) |
||||
|
|
||||
|
</script> |
@ -0,0 +1,463 @@ |
|||||
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
||||
|
import { dateFormatter } from '@/utils/formatTime' |
||||
|
|
||||
|
import * as CustomerApi from '@/api/wms/customer' |
||||
|
import { Customer } from '@/views/wms/basicDataManage/customerManage/customer/customer.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' |
||||
|
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
|
||||
|
const queryParams = { |
||||
|
pageSize:10, |
||||
|
pageNo:1, |
||||
|
code:'DeliverRequest' |
||||
|
} |
||||
|
const data = await getRequestsettingApi.getRequestsettingPage(queryParams) |
||||
|
const requestsettingData =data?.list[0]||{} |
||||
|
|
||||
|
// 表单校验
|
||||
|
export const SaleShipmentMainRules = reactive({ |
||||
|
}) |
||||
|
|
||||
|
export const SaleShipmentMain = useCrudSchemas(reactive<CrudSchema[]>([ |
||||
|
{ |
||||
|
label: '客户代码', |
||||
|
field: 'customerCode', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
form: { |
||||
|
// labelMessage: '信息提示说明!!!',
|
||||
|
componentProps: { |
||||
|
enterSearch: true, |
||||
|
isSearchList: true, // 开启查询弹窗
|
||||
|
searchListPlaceholder: '请选择客户代码', // 输入框占位文本
|
||||
|
searchField: 'code', // 查询弹窗赋值字段
|
||||
|
searchTitle: '客户信息', // 查询弹窗标题
|
||||
|
searchAllSchemas: Customer.allSchemas, // 查询弹窗所需类
|
||||
|
searchPage: CustomerApi.getCustomerPage, // 查询弹窗所需分页方法
|
||||
|
searchCondition: [{ |
||||
|
key: 'available', |
||||
|
value: 'TRUE', |
||||
|
isMainValue: false |
||||
|
}] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '单据号', |
||||
|
field: 'number', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
isForm: false, |
||||
|
}, |
||||
|
{ |
||||
|
label: '业务类型', |
||||
|
field: 'businessType', |
||||
|
sort: 'custom', |
||||
|
isForm: false, |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '备注', |
||||
|
field: 'remark', |
||||
|
sort: 'custom', |
||||
|
isForm: false, |
||||
|
}, |
||||
|
{ |
||||
|
label: '发票时间', |
||||
|
field: 'invoiceTime', |
||||
|
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')] |
||||
|
} |
||||
|
}, |
||||
|
form: { |
||||
|
component: 'DatePicker', |
||||
|
componentProps: { |
||||
|
type: 'datetime', |
||||
|
valueFormat: 'x' |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '地点', |
||||
|
field: 'siteId', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
hiddenInMain: true, |
||||
|
}, |
||||
|
{ |
||||
|
label: '部门', |
||||
|
field: 'departmentCode', |
||||
|
sort: 'custom', |
||||
|
isForm: false, |
||||
|
}, |
||||
|
{ |
||||
|
label: '状态', |
||||
|
field: 'status', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
dictType: DICT_TYPE.REQUEST_STATUS, |
||||
|
dictClass: 'string', |
||||
|
isSearch: true, |
||||
|
isForm:false, |
||||
|
}, |
||||
|
{ |
||||
|
label: '自动提交', |
||||
|
field: 'autoCommit', |
||||
|
dictType: DICT_TYPE.TRUE_FALSE, |
||||
|
dictClass: 'string', |
||||
|
isTable: false, |
||||
|
isForm: false, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
form: { |
||||
|
component: 'Switch', |
||||
|
value: requestsettingData.autoCommit, |
||||
|
componentProps: { |
||||
|
inactiveValue: 'FALSE', |
||||
|
activeValue: 'TRUE', |
||||
|
disabled: true |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '自动通过', |
||||
|
field: 'autoAgree', |
||||
|
dictType: DICT_TYPE.TRUE_FALSE, |
||||
|
dictClass: 'string', |
||||
|
isTable: false, |
||||
|
isForm: false, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
form: { |
||||
|
component: 'Switch', |
||||
|
value: requestsettingData.autoAgree, |
||||
|
componentProps: { |
||||
|
inactiveValue: 'FALSE', |
||||
|
activeValue: 'TRUE', |
||||
|
disabled: true |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '自动执行', |
||||
|
field: 'autoExecute', |
||||
|
dictType: DICT_TYPE.TRUE_FALSE, |
||||
|
dictClass: 'string', |
||||
|
isTable: false, |
||||
|
isForm: false, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
form: { |
||||
|
component: 'Switch', |
||||
|
value: requestsettingData.autoExecute, |
||||
|
componentProps: { |
||||
|
inactiveValue: 'FALSE', |
||||
|
activeValue: 'TRUE', |
||||
|
disabled: true |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '直接生成记录', |
||||
|
field: 'directCreateRecord', |
||||
|
dictType: DICT_TYPE.TRUE_FALSE, |
||||
|
dictClass: 'string', |
||||
|
isForm: false, |
||||
|
isTable: false, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
form: { |
||||
|
component: 'Switch', |
||||
|
value: requestsettingData.directCreateRecord, |
||||
|
componentProps: { |
||||
|
inactiveValue: 'FALSE', |
||||
|
activeValue: 'TRUE', |
||||
|
disabled: true |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
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: 'action', |
||||
|
isForm: false, |
||||
|
table: { |
||||
|
width: 150, |
||||
|
fixed: 'right' |
||||
|
} |
||||
|
} |
||||
|
])) |
||||
|
|
||||
|
// 表单校验
|
||||
|
export const SaleShipmentDetailRules = reactive({ |
||||
|
}) |
||||
|
|
||||
|
export const SaleShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
||||
|
{ |
||||
|
label: '单据号', |
||||
|
field: 'number', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
table: { |
||||
|
width: 180 |
||||
|
}, |
||||
|
isTable: false, |
||||
|
isTableForm: false, |
||||
|
form: { |
||||
|
componentProps: { |
||||
|
disabled: true |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '销售订单号', |
||||
|
field: 'soNumber', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
tableForm: { |
||||
|
type: 'Select', |
||||
|
disabled: true |
||||
|
}, |
||||
|
form: { |
||||
|
componentProps: { |
||||
|
disabled: true |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '销售订单行', |
||||
|
field: 'soLine', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
tableForm:{ |
||||
|
isInpuFocusShow: true, // 开启查询弹窗
|
||||
|
searchListPlaceholder: '请选择销售订单行', |
||||
|
searchField: 'lineNumber', |
||||
|
searchTitle: '销售订单信息', |
||||
|
searchAllSchemas: SaleDetail.allSchemas, |
||||
|
searchPage: SaleDetailApi.getSaleDetailPage, |
||||
|
searchCondition: [{ |
||||
|
key: 'available', |
||||
|
value: 'TRUE', |
||||
|
isMainValue: false |
||||
|
}] |
||||
|
}, |
||||
|
form: { |
||||
|
// labelMessage: '信息提示说明!!!',
|
||||
|
componentProps: { |
||||
|
isSearchList: true, |
||||
|
searchListPlaceholder: '请选择销售订单行', |
||||
|
searchField: 'lineNumber', |
||||
|
searchTitle: '销售订单信息', |
||||
|
searchAllSchemas: SaleDetail.allSchemas, |
||||
|
searchPage: SaleDetailApi.getSaleDetailPage, |
||||
|
searchCondition: [{ |
||||
|
key: 'available', |
||||
|
value: 'TRUE', |
||||
|
isMainValue: false |
||||
|
}, |
||||
|
{ |
||||
|
key: 'customerCode', |
||||
|
value: 'customerCode', |
||||
|
isMainValue: true |
||||
|
}] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '物品代码', |
||||
|
field: 'itemCode', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
tableForm: { |
||||
|
type: 'Select', |
||||
|
disabled: true |
||||
|
}, |
||||
|
form: { |
||||
|
componentProps: { |
||||
|
disabled: true |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '批次', |
||||
|
field: 'batch', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
}, |
||||
|
{ |
||||
|
label: '从货主代码', |
||||
|
field: 'fromOwnerCode', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
isForm: false, |
||||
|
isTableForm: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '包装号', |
||||
|
field: 'packingNumber', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
isForm: false, |
||||
|
isTableForm: false |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
label: '库存状态', |
||||
|
field: 'inventoryStatus', |
||||
|
// dictType: DICT_TYPE.INVENTORY_STATUS,
|
||||
|
// dictClass: 'string',
|
||||
|
isTable: true, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTableForm: false, |
||||
|
hiddenInMain: true, |
||||
|
isForm: false, |
||||
|
}, |
||||
|
{ |
||||
|
label: '从库位代码', |
||||
|
field: 'fromLocationCode', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
isTableForm: false |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
label: '物品名称', |
||||
|
field: 'itemName', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isForm: false, |
||||
|
isTableForm: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '物品描述1', |
||||
|
field: 'itemName', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isForm: false, |
||||
|
isTableForm: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '物品描述2', |
||||
|
field: 'itemName', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isForm: false, |
||||
|
isTableForm: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '项目代码', |
||||
|
field: 'projectCode', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
isTableForm: false, |
||||
|
hiddenInMain: true, |
||||
|
}, |
||||
|
{ |
||||
|
label: '数量', |
||||
|
field: 'qty', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
}, |
||||
|
{ |
||||
|
label: '计量单位', |
||||
|
field: 'uom', |
||||
|
dictType: DICT_TYPE.UOM, |
||||
|
dictClass: 'string', |
||||
|
isTable: true, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
tableForm: { |
||||
|
type: 'Select', |
||||
|
disabled: true |
||||
|
}, |
||||
|
form: { |
||||
|
componentProps: { |
||||
|
disabled: true |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '备注', |
||||
|
field: 'remark', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
isTableForm: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '创建时间', |
||||
|
field: 'createTime', |
||||
|
sort: 'custom', |
||||
|
formatter: dateFormatter, |
||||
|
isSearch: true, |
||||
|
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, |
||||
|
isTableForm: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '操作', |
||||
|
field: 'action', |
||||
|
isForm: false, |
||||
|
table: { |
||||
|
width: 150, |
||||
|
fixed: 'right' |
||||
|
} |
||||
|
} |
||||
|
])) |
File diff suppressed because it is too large
Loading…
Reference in new issue