Browse Source

Merge remote-tracking branch 'origin/master_hella' into master_hella

hella_online_20240829
gaojs 5 months ago
parent
commit
0ec6c1f60d
  1. 56
      src/api/wms/mstr/index.ts
  2. 4
      src/components/BasicForm/src/BasicForm.vue
  3. 1
      src/components/TableForm/src/TableForm.vue
  4. 236
      src/views/wms/basicDataManage/subject/mstr/index.vue
  5. 67
      src/views/wms/basicDataManage/subject/mstr/mstr.data.ts
  6. 3
      src/views/wms/issueManage/issue/issueRequestMain/issueRequestMain.data.ts
  7. 254
      src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts
  8. 1
      src/views/wms/productionManage/processproduction/processproductionRequest/index.vue
  9. 4
      src/views/wms/productionManage/productionplan/productionMain/productionMain.data.ts
  10. 4
      src/views/wms/productionManage/productionplan/productionMainAssemble/productionMainAssemble.data.ts
  11. 3
      src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts
  12. 3
      src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/productreceiptAssembleRequestMain.data.ts
  13. 6
      src/views/wms/productionManage/productrepair/productrepairRequestMain/index.vue
  14. 3
      src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts

56
src/api/wms/mstr/index.ts

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface MstrVO {
id: number
hflccHflcd: string
plProdLine: string
plDesc: string
plMvarAcct: string
plCchgAcct: string
type: string
remark: string
extraProperties: string
concurrencyStamp: number
siteId: string
}
// 查询产品类信息列表
export const getMstrPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/mstr/senior', data })
} else {
return await request.get({ url: `/wms/mstr/page`, params })
}
}
// 查询产品类信息详情
export const getMstr = async (id: number) => {
return await request.get({ url: `/wms/mstr/get?id=` + id })
}
// 新增产品类信息
export const createMstr = async (data: MstrVO) => {
return await request.post({ url: `/wms/mstr/create`, data })
}
// 修改产品类信息
export const updateMstr = async (data: MstrVO) => {
return await request.put({ url: `/wms/mstr/update`, data })
}
// 删除产品类信息
export const deleteMstr = async (id: number) => {
return await request.delete({ url: `/wms/mstr/delete?id=` + id })
}
// 导出产品类信息 Excel
export const exportMstr = async (params) => {
return await request.download({ url: `/wms/mstr/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/mstr/get-import-template' })
}

4
src/components/BasicForm/src/BasicForm.vue

@ -615,14 +615,12 @@ const submitForm = async () => {
formLoading.value = true
if (formType.value == 'create') {
const validateForm = await tableFormRef.value.validateForm()
if (!validateForm && props.tableFormDataLength) {
if (props.tableFormDataLength) {
if (props.tableData.length == 0) {
message.warning('请填写明细信息!')
formLoading.value = false
return
}
formLoading.value = false
return
}
//
try {

1
src/components/TableForm/src/TableForm.vue

@ -551,6 +551,7 @@ const tableSelectionChange = (val) => {
}
const handleSelectionDelete = () => {
emit('tableSelectionDelete', deleteTableData.value)
TableBaseComponents_Ref.value.clearSelection()
nextTick(() => {
deleteTableData.value.forEach((row) => {
TableBaseComponents_Ref.value!.toggleRowSelection(row, false)

236
src/views/wms/basicDataManage/subject/mstr/index.vue

@ -0,0 +1,236 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Mstr.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Mstr.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="MstrRules"
:formAllSchemas="Mstr.allSchemas"
:apiUpdate="MstrApi.updateMstr"
:apiCreate="MstrApi.createMstr"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Mstr.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/mstr/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Mstr,MstrRules } from './mstr.data'
import * as MstrApi from '@/api/wms/mstr'
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: 'Mstr' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Mstr.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: MstrApi.getMstrPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:mstr:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:mstr:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:mstr: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:mstr:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:mstr: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) => {
var isHave =Mstr.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if (formType === 'create') {
await MstrApi.createMstr(data)
message.success(t('common.createSuccess'))
} else {
await MstrApi.updateMstr(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, 'basicMstr')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await MstrApi.deleteMstr(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 MstrApi.exportMstr(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 MstrApi.importTemplate()
})
</script>

67
src/views/wms/basicDataManage/subject/mstr/mstr.data.ts

@ -0,0 +1,67 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const MstrRules = reactive({
hflccHflcd: [required],
plProdLine: [required],
plMvarAcct: [required],
plCchgAcct: [required],
concurrencyStamp: [required],
})
export const Mstr = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '域代码',
field: 'hflccHflcd',
sort: 'custom',
isSearch: true,
},
{
label: '产品类',
field: 'plProdLine',
sort: 'custom',
isSearch: true,
},
{
label: '产品描述',
field: 'plDesc',
sort: 'custom',
},
{
label: '物料差异账户',
field: 'plMvarAcct',
sort: 'custom',
isSearch: true,
},
{
label: '成本重估账户',
field: 'plCchgAcct',
sort: 'custom',
isSearch: 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'
}
}
]))

3
src/views/wms/issueManage/issue/issueRequestMain/issueRequestMain.data.ts

@ -560,6 +560,9 @@ export const IssueRequestMainRules = reactive({
workshopCode: [
{ required: true, message: '请选择车间代码', trigger: 'change' }
],
productionLineCode: [
{ required: true, message: '请选择生产线代码', trigger: 'change' }
],
// fromWarehouseCode: [
// { required: true, message: '请选择从仓库代码', trigger: 'change' }
// ],

254
src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts

@ -471,6 +471,122 @@ export const RepleinshRequestMainRules = reactive({
* @returns {Array}
*/
export const RepleinshRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
isSearch:true,
sortSearchDefault:2,
sortTableDefault:3,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
searchCondition:[{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
tableForm:{
enterSearch:true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
searchCondition:[{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key : 'businessTypeCode',
value: queryParams.businessTypeCode
}]
},
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
sortTableDefault:4,
isTableForm: false,
isForm: false,
},
{
label: '物料描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
hiddenInMain:true,
isTableForm: false,
isForm: false,
},
{
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
hiddenInMain:true,
isTableForm: false,
isForm: false,
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
hiddenInMain:true,
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 6
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
sortTableDefault:9,
tableForm: {
type: 'Select',
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '到库位代码',
field: 'toLocationCode',
@ -541,7 +657,8 @@ export const RepleinshRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
isTableForm: false,
isTable:false,
sort: 'custom',
form: {
value: 'OK',
@ -557,6 +674,7 @@ export const RepleinshRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150
},
isTableForm:false,
tableForm: {
type: 'Select',
default: 'OK',
@ -573,63 +691,23 @@ export const RepleinshRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
},
hiddenInMain:true,
isTableForm: false,
isTable:false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
isSearch:true,
sortSearchDefault:2,
sortTableDefault:3,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
searchCondition:[{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
tableForm:{
enterSearch:true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
searchCondition:[{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key : 'businessTypeCode',
value: queryParams.businessTypeCode
}]
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isTableForm:false,
table: {
width: 150
},
isTable:false,
hiddenInMain:true,
},
{
@ -667,36 +745,7 @@ export const RepleinshRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm: false,
isForm: false
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
sortTableDefault:4,
isTableForm: false,
isForm: false,
},
{
label: '物料描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
hiddenInMain:true,
isTableForm: false,
isForm: false,
},
{
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
hiddenInMain:true,
isTableForm: false,
isForm: false,
},
{
label: '项目代码',
field: 'projectCode',
@ -706,50 +755,10 @@ export const RepleinshRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
},
hiddenInMain:true,
isTableForm: false,
isTable:false,
isForm: false,
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
hiddenInMain:true,
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 6
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
sortTableDefault:9,
tableForm: {
type: 'Select',
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '采购订单号',
field: 'poNumber',
@ -760,6 +769,7 @@ export const RepleinshRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
hiddenInMain:true,
isTableForm: false,
sortTableDefault:1,
isTable:false,
},
{
label: '订单行',
@ -771,6 +781,7 @@ export const RepleinshRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
hiddenInMain:true,
isTableForm: false,
sortTableDefault:2,
isTable:false,
},
{
@ -783,6 +794,7 @@ export const RepleinshRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm: false,
isForm: false,
hiddenInMain:true,
isTable:false,
},
{
label: '到货主代码',
@ -794,6 +806,7 @@ export const RepleinshRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm: false,
isForm: false,
hiddenInMain:true,
isTable:false,
},
{
label: '最后更新时间',
@ -829,6 +842,7 @@ export const RepleinshRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
},
isTableForm: false,
hiddenInMain:true,
isTable:false,
isForm: false
},
{
@ -847,9 +861,9 @@ export const RepleinshRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验
export const RepleinshRequestDetailRules = reactive({
inventoryStatus: [
{ required: true, message: '请选择库存状态', trigger: 'change' }
],
// inventoryStatus: [
// { required: true, message: '请选择库存状态', trigger: 'change' }
// ],
toLocationCode: [
{ required: true, message: '请输入到库位代码', trigger: 'blur' }
],

1
src/views/wms/productionManage/processproduction/processproductionRequest/index.vue

@ -292,6 +292,7 @@ const handleHandle = async (id: number) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
tableData.value = [] //
basicFormRef.value.open(type, row)
}

4
src/views/wms/productionManage/productionplan/productionMain/productionMain.data.ts

@ -236,7 +236,6 @@ export const ProductionMain = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isSearch: true,
sortTableDefault:1000,
form: {
component: 'DatePicker',
@ -731,6 +730,9 @@ export const ProductionDetail = useCrudSchemas(reactive<CrudSchema[]>([
}
},
isSearch: true,
isTableForm: false,
isForm: false,
// hiddenInMain: true,
sortTableDefault:1000,
form: {
component: 'DatePicker',

4
src/views/wms/productionManage/productionplan/productionMainAssemble/productionMainAssemble.data.ts

@ -235,7 +235,6 @@ export const ProductionMain = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isSearch: true,
sortTableDefault:1000,
form: {
component: 'DatePicker',
@ -730,6 +729,9 @@ export const ProductionDetail = useCrudSchemas(reactive<CrudSchema[]>([
}
},
isSearch: true,
isTableForm: false,
isForm: false,
// hiddenInMain: true,
sortTableDefault:1000,
form: {
component: 'DatePicker',

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

@ -535,6 +535,9 @@ export const ProductreceiptRequestMainRules = reactive({
// departmentCode: [
// { required: true, message: '请输入部门', trigger: 'blur' }
// ],
productionLineCode: [
{ required: true, message: '请选择生产线代码', trigger: 'change' }
],
autoCommit: [
{ required: true, message: '请选择是否自动提交', trigger: 'change' }
],

3
src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/productreceiptAssembleRequestMain.data.ts

@ -536,6 +536,9 @@ export const ProductreceiptRequestMainRules = reactive({
// departmentCode: [
// { required: true, message: '请输入部门', trigger: 'blur' }
// ],
productionLineCode: [
{ required: true, message: '请选择生产线代码', trigger: 'change' }
],
autoCommit: [
{ required: true, message: '请选择是否自动提交', trigger: 'change' }
],

6
src/views/wms/productionManage/productrepair/productrepairRequestMain/index.vue

@ -56,6 +56,8 @@
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
@buttonOperationClick="buttonOperationClick"
:isShowReduceButtonSelection="true"
@tableSelectionDelete="tableSelectionDelete"
/>
<!-- 详情 -->
@ -686,7 +688,9 @@ const tableFormButton = async (val , row) => {
await getDetailListBom()
}
}
const tableSelectionDelete = (selection) => {
tableData.value = tableData.value.filter(item => !selection.includes(item))
}
/** 初始化 **/
onMounted(async () => {
getList()

3
src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts

@ -500,6 +500,9 @@ export const ProductscrapRequestMainRules = reactive({
// dueTime: [
// { required: true, message: '请选择截止时间', trigger: 'change' }
// ],
productionLineCode: [
{ required: true, message: '请选择生产线代码', trigger: 'change' }
],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],

Loading…
Cancel
Save