Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

master_hella_20240701
chenfang 6 months ago
parent
commit
53dc7bf4d3
  1. 7
      src/api/eam/equipmentRepairJobMain/index.ts
  2. 58
      src/api/eam/sparePartsInLocationDetail/index.ts
  3. 65
      src/api/eam/sparePartsInLocationMain/index.ts
  4. 12
      src/components/Detail/src/Detail.vue
  5. 2
      src/components/DetailTable/src/DetailTable.vue
  6. 153
      src/components/TableFormCountPlan/src/TableFormCountPlan.vue
  7. 4
      src/utils/dict.ts
  8. 33
      src/views/eam/equipmentRepairJobMain/index.vue
  9. 3
      src/views/eam/sparePart/sparePart.data.ts
  10. 379
      src/views/eam/sparepartsinlocation/index.vue
  11. 327
      src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts
  12. 289
      src/views/wms/countManage/count/countPlanMain/index.vue
  13. 2
      src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRecordMain/index.vue
  14. 23
      src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue
  15. 17
      src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/inventoryinitRequestMain.data.ts
  16. 22
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts
  17. 3
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

7
src/api/eam/equipmentRepairJobMain/index.ts

@ -104,8 +104,13 @@ export const updateEquipmentRepairOrder = async (data: EquipmentRepairJobMainVO)
return await request.post({ url: `/eam/equipment-repair-job-main/updateOrder`, data }) return await request.post({ url: `/eam/equipment-repair-job-main/updateOrder`, data })
} }
//验证不通过,打回维修工单 //维修验证不通过,打回维修工单
export const backEquipmentRepairOrder = async (data: EquipmentRepairJobMainVO) => { export const backEquipmentRepairOrder = async (data: EquipmentRepairJobMainVO) => {
return await request.post({ url: `/eam/equipment-repair-job-main/fallback`, data }) return await request.post({ url: `/eam/equipment-repair-job-main/fallback`, data })
} }
//报修验证不通过,生成新工单
export const createEquipmentRepairNewOrder = async (data: EquipmentRepairJobMainVO) => {
return await request.post({ url: `/eam/equipment-repair-job-main/createNew`, data })
}

58
src/api/eam/sparePartsInLocationDetail/index.ts

@ -0,0 +1,58 @@
import request from '@/config/axios'
export interface SparePartsInLocationDetailVO {
id: number
number: string
masterId: number
sparePartsCode: string
isRadeIn: string
applyQty: number
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询备件入库记录子列表
export const getSparePartsInLocationDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/spare-parts-in-location-detail/senior', data })
} else {
return await request.get({ url: `/eam/spare-parts-in-location-detail/page`, params })
}
}
// 查询备件入库记录子详情
export const getSparePartsInLocationDetail = async (id: number) => {
return await request.get({ url: `/eam/spare-parts-in-location-detail/get?id=` + id })
}
// 新增备件入库记录子
export const createSparePartsInLocationDetail = async (data: SparePartsInLocationDetailVO) => {
return await request.post({ url: `/eam/spare-parts-in-location-detail/create`, data })
}
// 修改备件入库记录子
export const updateSparePartsInLocationDetail = async (data: SparePartsInLocationDetailVO) => {
return await request.put({ url: `/eam/spare-parts-in-location-detail/update`, data })
}
// 删除备件入库记录子
export const deleteSparePartsInLocationDetail = async (id: number) => {
return await request.delete({ url: `/eam/spare-parts-in-location-detail/delete?id=` + id })
}
// 导出备件入库记录子 Excel
export const exportSparePartsInLocationDetail = async (params) => {
return await request.download({ url: `/eam/spare-parts-in-location-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/spare-parts-in-location-detail/get-import-template' })
}

65
src/api/eam/sparePartsInLocationMain/index.ts

@ -0,0 +1,65 @@
import request from '@/config/axios'
export interface SparePartsInLocationMainVO {
id: number
number: string
theme: string
status: string
applyer: string
approver: number
approveContent: string
approveTime: Date
autoExamine: string
autoAgree: string
directCreateRecord: string
areaCode: string
locationCode: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询备件领用出库记录主列表
export const getSparePartsInLocationMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/spare-parts-in-location-main/senior', data })
} else {
return await request.get({ url: `/eam/spare-parts-in-location-main/page`, params })
}
}
// 查询备件领用出库记录主详情
export const getSparePartsInLocationMain = async (id: number) => {
return await request.get({ url: `/eam/spare-parts-in-location-main/get?id=` + id })
}
// 新增备件领用出库记录主
export const createSparePartsInLocationMain = async (data: SparePartsInLocationMainVO) => {
return await request.post({ url: `/eam/spare-parts-in-location-main/create`, data })
}
// 修改备件领用出库记录主
export const updateSparePartsInLocationMain = async (data: SparePartsInLocationMainVO) => {
return await request.put({ url: `/eam/spare-parts-in-location-main/update`, data })
}
// 删除备件领用出库记录主
export const deleteSparePartsInLocationMain = async (id: number) => {
return await request.delete({ url: `/eam/spare-parts-in-location-main/delete?id=` + id })
}
// 导出备件领用出库记录主 Excel
export const exportSparePartsInLocationMain = async (params) => {
return await request.download({ url: `/eam/spare-parts-in-location-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/spare-parts-in-location-main/get-import-template' })
}

12
src/components/Detail/src/Detail.vue

@ -359,6 +359,12 @@ const props = defineProps({
type: Boolean, type: Boolean,
required: false, required: false,
default: true default: true
},
//
detailButtonIsShowAddStatusArray:{
type: Array,
required: false,
default: () => ['1']
}, },
// //
detailButtonIsShowEdit:{ detailButtonIsShowEdit:{
@ -627,7 +633,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
// //
detailButtonAdd = [ detailButtonAdd = [
defaultButtons.defaultAddBtn({ defaultButtons.defaultAddBtn({
hide: isShowMainButton(row, ['1']) hide: isShowMainButton(row, props.detailButtonIsShowAddStatusArray)
}) })
] ]
} }
@ -646,7 +652,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
// //
detailButtonEdit = [ detailButtonEdit = [
defaultButtons.mainListEditBtn({ defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['1']) hide: isShowMainButton(row,props.detailButtonIsShowAddStatusArray)
}) })
] ]
} }
@ -654,7 +660,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
// //
detailButtonDelete = [ detailButtonDelete = [
defaultButtons.mainListDeleteBtn({ defaultButtons.mainListDeleteBtn({
hide: isShowMainButton(row, ['1']) hide: isShowMainButton(row,props.detailButtonIsShowAddStatusArray)
}) })
] ]
} }

2
src/components/DetailTable/src/DetailTable.vue

@ -58,7 +58,7 @@ const countScopeType = ref(props.countScopeType)
const allList = ref(props.allList) const allList = ref(props.allList)
const forrmatter = (val) => { const forrmatter = (val) => {
if(val){ if(val){
return countScopeType.value.find((cur) => cur.value == val).label return countScopeType.value.find((cur) => cur.value == val)?.label || ''
}else{ }else{
return '' return ''
} }

153
src/components/TableFormCountPlan/src/TableFormCountPlan.vue

@ -13,82 +13,86 @@
@click="handleDeleteTable(row, $index)" @click="handleDeleteTable(row, $index)"
/> />
</el-table-column> </el-table-column>
<el-table-column :label="tableFields[0].label" align="center"> <el-table-column :label="tableFields[0].label" align="center" v-slot="{ row, $index }">
<template v-slot="{ row }"> <el-form :key="'类型form'+$index"
<el-form
ref="TableBaseForm_Ref" ref="TableBaseForm_Ref"
:model="row" :model="row"
style="width: 100%;" style="width: 100%;"
:rules="tableFormRules" :rules="tableFormRules"
:class="tableFormRules ? '' : 'noRulesForm'"> :class="tableFormRules ? '' : 'noRulesForm'">
<el-form-item :prop="tableFields[0].field"> <el-form-item :key="'类型formitem'+$index" :prop="tableFields[0].field">
<el-select :key="row.id+$index" <el-select :key="'类型select'+row.id+$index"
v-model="row.type" v-model="row.type"
:placeholder="tableFields[0].placeholder || '请输入' + tableFields[0].label" :placeholder="tableFields[0].placeholder || '请输入' + tableFields[0].label"
@change="tableFormChange(tableFields[0].field, $event, row)" @change="tableFormChange(tableFields[0].field, $event, row)"
> >
<el-option <el-option
v-for="dict in countScopeType" v-for="dict in countScopeType"
:key="dict.value" :key="'类型option'+dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
:prop="tableFields[1].field" :prop="tableFields[1].field"
:label="tableFields[1].label" :label="tableFields[1].label"
align="center" align="center" v-slot="{ row, $index }"
> >
<template v-slot="{ row }"> <el-form :key="'值form'+$index"
<el-form
ref="TableBaseForm_Ref1" ref="TableBaseForm_Ref1"
:model="row" :model="row"
style="width: 100%;" style="width: 100%;"
:rules="tableFormRules" :rules="tableFormRules"
:class="tableFormRules ? '' : 'noRulesForm'"> :class="tableFormRules ? '' : 'noRulesForm'">
<el-form-item :prop="tableFields[1].field"> <el-form-item :key="'值formitem'+$index" :prop="tableFields[1].field">
<el-select :key="row.id+$index" <el-select :key="'值select'+row.id+$index"
v-model="row.value" v-model="row.value"
:placeholder=" :placeholder="
tableFields[1].placeholder || tableFields[1].placeholder ||
'请输入' + tableFields[1].label '请输入' + tableFields[1].label
" "
v-if=" filterable
row.type == 'OWNER' || :filter-method="(value) =>filterMethod(value,row)"
row.type == 'SUPPLIER' || @focus="focusValue(row)"
row.type == 'CUSTOMER' || v-if="
row.type == 'ABC' || row.type == 'OWNER' ||
row.type == 'ITEMS_TYPE' || row.type == 'SUPPLIER' ||
row.type == 'ITEMS_GROUP' || row.type == 'CUSTOMER' ||
row.type == 'ITEMS_CODE' || row.type == 'ABC' ||
row.type == 'WAREHOUSE_CODE' || row.type == 'ITEMS_TYPE' ||
row.type == 'AREABASIC_CODE' || row.type == 'ITEMS_GROUP' ||
row.type == 'LOCATIONGROUP_CODE' || row.type == 'ITEMS_CODE' ||
row.type == 'LOCATION_CODE' row.type == 'WAREHOUSE_CODE' ||
" row.type == 'AREABASIC_CODE' ||
> row.type == 'LOCATIONGROUP_CODE' ||
<el-option row.type == 'LOCATION_CODE'
v-for="item in row.initOptions" "
:key="item.value" >
:label="item.label" <el-option
:value="item.value" v-for="item in currentList(initOptions_result)"
:key="'值option'+item.value"
:label="item.label"
:value="item.value"
/>
<div style="display: flex;align-items: center">
<span style="padding: 10px;">{{ pageCount }} </span>
<el-button text bg size="small" :disabled="pageCount<=1" @click="prexPage">上一页</el-button>
<el-button text bg size="small" :disabled="initOptions_result&&pageCount*15>=initOptions_result.length" @click="nextPage">下一页</el-button>
</div>
</el-select>
<el-input :key="'值input'+$index"
v-model="row.value"
:placeholder="
tableFields[1].placeholder ||
'请输入' + tableFields[1].label
"
v-else
/> />
</el-select> </el-form-item>
<el-input
v-model="row.value"
:placeholder="
tableFields[1].placeholder ||
'请输入' + tableFields[1].label
"
v-else
/>
</el-form-item>
</el-form> </el-form>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="button flex"> <div class="button flex">
@ -127,7 +131,7 @@ const props = defineProps({
countScopeType: { countScopeType: {
type: Array, type: Array,
required: false, required: false,
default: null default: []
}, },
}) })
const tableData = props.tableData const tableData = props.tableData
@ -162,6 +166,7 @@ const selectChange = (field, val) => {
} }
const tableFormChange = (field, val, row) => { const tableFormChange = (field, val, row) => {
pageCount.value = 1
emit('tableFormChange', field, val, row) emit('tableFormChange', field, val, row)
} }
// //
@ -172,6 +177,38 @@ const handleAddTable = () => {
const handleDeleteTable = (row, index) => { const handleDeleteTable = (row, index) => {
emit('handleDeleteTable', row, index) emit('handleDeleteTable', row, index)
} }
const pageCount = ref(1)
const currentList = (options)=>{
if(options&&options.length>0){
return options.slice((pageCount.value-1)*15,pageCount.value*15)
}else{
return []
}
}
const nextPage = ()=>{
pageCount.value++
}
const prexPage = ()=>{
pageCount.value--
}
const initOptions_result = ref([])
const filterMethod = (query,row)=>{
console.log('filterMethod')
if (query) {
initOptions_result.value = row.initOptions.filter((item) => {
return item.label.includes(query)
})
} else {
initOptions_result.value = [...row.initOptions]
}
}
const focusValue = (row)=>{
console.log('focusValue',row)
if(!row.value){
initOptions_result.value = [...row.initOptions]
}
}
// setup // setup
defineExpose({ defineExpose({
TableBaseComponents_Ref, TableBaseComponents_Ref,

4
src/utils/dict.ts

@ -363,5 +363,7 @@ export enum DICT_TYPE {
EAM_MAINTENANCE_URGENCY = 'eam_maintenance_urgency', // 维保紧急程度 EAM_MAINTENANCE_URGENCY = 'eam_maintenance_urgency', // 维保紧急程度
EAM_MAINTENANCE_LEVEL = 'eam_maintenance_level', // 维保维修级别 EAM_MAINTENANCE_LEVEL = 'eam_maintenance_level', // 维保维修级别
EAM_REPAIR_STATUS = 'eam_repair_status', // 维修状态 EAM_REPAIR_STATUS = 'eam_repair_status', // 维修状态
OFF_BACK_STATUS = 'off_back_status' OFF_BACK_STATUS = 'off_back_status',
SPAREPARTS_APPLY_STATUS_ENUM = 'spareparts_apply_status_enum',// 流程状态
IS_LINE_ITEM = 'is_line_item', // 是否是线边
} }

33
src/views/eam/equipmentRepairJobMain/index.vue

@ -88,6 +88,7 @@ import Detail from '@/views/eam/equipmentRepairJobMain/EquipmentRepairJobDetail.
import FinishForm1 from '@/views/eam/equipmentRepairJobMain/finishForm1.vue' import FinishForm1 from '@/views/eam/equipmentRepairJobMain/finishForm1.vue'
import FinishForm2 from '@/views/eam/equipmentRepairJobMain/finishForm2.vue' import FinishForm2 from '@/views/eam/equipmentRepairJobMain/finishForm2.vue'
import FinishForm3 from '@/views/eam/equipmentRepairJobMain/finishForm3.vue' import FinishForm3 from '@/views/eam/equipmentRepairJobMain/finishForm3.vue'
import {createEquipmentRepairNewOrder} from "@/api/eam/equipmentRepairJobMain";
defineOptions({ name: 'EquipmentRepairJobMain' }) defineOptions({ name: 'EquipmentRepairJobMain' })
@ -267,20 +268,26 @@ const finishForm3Ref = ref()
const handleValidateReport = async (row) => { const handleValidateReport = async (row) => {
await message.delConfirm('是否验证所选中工单?'); await message.delConfirm('是否验证所选中工单?');
message.confirmPassword(t('')).then(async () => { message.confirmPassword(t('')).then(async () => {
// const params = ref({id: '', status:''})
// params.value.id = row.id
finishForm3Ref.value.open('update', row); params.value.status = '8'
//
await EquipmentRepairJobMainApi.createEquipmentRepairNewOrder(params.value)
message.success(t('工单已结束'))
//
await getList()
}).catch (async (action: Action) => { }).catch (async (action: Action) => {
if(action === 'cancel'){ if(action === 'cancel'){
const params = ref({id: '', status:''}) const params = ref({id: '', number:''})
params.value.id = row.id params.value.id = row.id
params.value.status = '5' params.value.number = row.number
// //
await EquipmentRepairJobMainApi.backEquipmentRepairOrder(params.value) await EquipmentRepairJobMainApi.createEquipmentRepairNewOrder(params.value)
message.success(t('工单已打回')) message.success(t('工单已结束'))
// //
await getList() await getList()
} }
}) })
} }

3
src/views/eam/sparePart/sparePart.data.ts

@ -25,7 +25,7 @@ export const SparePart = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false, isSearch: false,
isTable: false, isTable: false,
isForm: false, isForm: false,
isDetail:false, isDetail:false
}, },
{ {
label: '备件编号', label: '备件编号',
@ -197,7 +197,6 @@ export const SparePart = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, },
isForm: false,
}, },
{ {
label: '部门id', label: '部门id',

379
src/views/eam/sparepartsinlocation/index.vue

@ -0,0 +1,379 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search
:schema="SparePartsInLocationMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SparePartsInLocationMain.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 #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="SparePartsInLocationMainRules"
:formAllSchemas="SparePartsInLocationMain.allSchemas"
:tableAllSchemas="SparePartsInLocationDetail.allSchemas"
:tableFormRules="SparePartsInLocationDetailRules"
:tableData="tableData"
:apiUpdate="SparePartsInLocationMainApi.updateSparePartsApplyMain"
:apiCreate="SparePartsInLocationMainApi.createSparePartsApplyMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="SparePartsInLocationMain.allSchemas"
:detailAllSchemas="SparePartsInLocationDetail.allSchemas"
:detailAllSchemasRules="SparePartsInLocationDetailRules"
:apiCreate="SparePartsInLocationDetailApi.createSparePartsInLocationDetail"
:apiUpdate="SparePartsInLocationDetailApi.updateSparePartsInLocationDetail"
:apiPage="SparePartsInLocationDetailApi.getSparePartsInLocationDetailPage"
:apiDelete="SparePartsInLocationDetailApi.deleteSparePartsInLocationDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="true"
:detailButtonIsShowAdd="true"
:detailButtonIsShowAddStatusArray="['0']"
/>
<!-- 导入 -->
<ImportForm
ref="importFormRef"
url="/eam/sparePartsApplyDetail/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import {
SparePartsInLocationMain,
SparePartsInLocationMainRules,
SparePartsInLocationDetail,
SparePartsInLocationDetailRules
} from './sparePartsInLocationMain.data'
import * as SparePartsInLocationMainApi from '@/api/eam/sparePartsInLocationMain'
import * as SparePartsInLocationDetailApi from '@/api/eam/sparePartsInLocationDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
//
defineOptions({ name: 'SparePartsApply' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const formRef = ref()
const tableColumns = ref(SparePartsInLocationMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
if (type == 'tableForm') {
if (formField == 'sparePartsCode') {
row['sparePartsCode'] = val[0].itemNumber
row['currentQty'] = val[0].qty
}
} else {
if (formField == 'locationCode') {
setV['locationCode'] = val[0].code
setV['areaCode'] = val[0].areaCode
}
}
formRef.setValues(setV)
})
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const setV = {}
if (formField == 'sparePartsCode') {
setV['sparePartsCode'] = val[0].itemNumber
setV['currentQty'] = val[0].qty
}
formRef.setValues(setV)
})
}
//
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: SparePartsInLocationMainApi.getSparePartsInLocationMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
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 isShowMainButton = (row, val) => {
if (val.indexOf(row.available) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hasPermi: 'wms:sparePartsInLocationMain:update' }) //
// defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:sparePartsInLocationMain:delete' }) //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
}
// else if (val == 'mainOrderClo') {
// //
// handleClose(row.id)
// }
else if (val == 'delete') {
//
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const openForm = async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicSparePartsApplyMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await SparePartsInLocationMainApi.deleteSparePartsInLocationMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 列表导出按钮操作 */
const exportLoading = ref(false) //
const handleMainExport = async (id: number) => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SparePartsInLocationMainApi.exportSparePartsInLocationMain(id)
download.excel(data, '盘点工单.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 关闭按钮操作 */
// const handleClose = async (id: number) => {
// try {
// //
// await message.confirm('')
// //
// await SparePartsApplyMainApi.closeSparePartsApplyMain(id)
// message.success(t('!'))
// //
// await getList()
// } catch {}
// }
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SparePartsInLocationMainApi.exportSparePartsInLocationMain(
tableObject.params
)
download.excel(data, '备件申领记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
SparePartsInLocationDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
console.log(formRef.value)
formRef.value.formLoading = true
try {
if (formType === 'create') {
await SparePartsInLocationMainApi.createSparePartsInLocationMain(data)
message.success(t('common.createSuccess'))
} else {
await SparePartsInLocationMainApi.updateSparePartsInLocationMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = 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 SparePartsInLocationMainApi.importTemplate()
})
</script>

327
src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts

@ -0,0 +1,327 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
import * as ItemAccountsApi from '@/api/eam/itemAccounts'
import { ItemAccounts } from '@/views/eam/itemAccounts/itemAccounts.data'
// 表单校验
export const SparePartsInLocationMainRules = reactive({
number: [required],
theme: [required],
// status: [required],
// areaCode: [required],
// locationCode: [required],
concurrencyStamp: [required],
})
// 备件入库主表
export const SparePartsInLocationMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '编号',
field: 'number',
sort: 'custom',
isSearch: false,
isForm: false,
},
{
label: '入库主题',
field: 'theme',
sort: 'custom',
isSearch: false,
},
{
label: '流程状态',
field: 'status',
sort: 'custom',
isSearch: false,
isForm:false,
dictType: DICT_TYPE.SPAREPARTS_APPLY_STATUS_ENUM,
dictClass: 'string',
},
{
label: '入库申请人',
field: 'applyer',
sort: 'custom',
isSearch: false,
},
{
label: '审核人',
field: 'approver',
sort: 'custom',
isSearch: false,
},
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: false,
},
{
label: '审核时间',
field: 'approveTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
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'
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '入库时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
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,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '库位编号',
field: 'locationCode',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位编号', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
},
{
label: '库区编号',
field: 'areaCode',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
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,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
},
isDetail:false
}
]))
// 备件入库子表
export const SparePartsInLocationDetailRules = reactive({
number: [required],
masterId: [required],
sparePartsCode: [required],
applyQty: [required],
concurrencyStamp: [required],
})
export const SparePartsInLocationDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
isTableForm:false
},
{
label: '单号',
field: 'number',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isTableForm:false
},
{
label: '主表ID',
field: 'masterId',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
isSearch: false,
isTable: false,
isForm: false,
isTableForm:false
},
{
label: '备件编号',
field: 'sparePartsCode',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择备件编号', // 输入框占位文本
searchField: 'itemNumber', // 查询弹窗赋值字段
searchTitle: '备件信息', // 查询弹窗标题
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择备件编号', // 输入框占位文本
searchField: 'itemNumber', // 查询弹窗赋值字段
searchTitle: '备件信息', // 查询弹窗标题
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
{
label: '库存数量',
field: 'currentQty',
sort: 'custom',
isSearch: false,
tableForm: {
disabled: true
},
form:{
componentProps:{
disabled: true
}
},
isDetail:false,
isTable:false
},
{
label: '申领数量',
field: 'applyQty',
sort: 'custom',
isSearch: 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: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
},
isTableForm:false
}
]))

289
src/views/wms/countManage/count/countPlanMain/index.vue

@ -374,27 +374,27 @@ const openForm = async (type: string, row?: number) => {
] // ] //
formRef.value.open(type, row) formRef.value.open(type, row)
Promise.all([getOwnerAllList(), // Promise.all([getOwnerAllList(),
getSupplierAllList(), // getSupplierAllList(),
getCustomerAllList(), // getCustomerAllList(),
getItembasicAllList(), // getItembasicAllList(),
getWarehouseAllList(), // getWarehouseAllList(),
getAreaAllList(), // getAreaAllList(),
getLocationgroupAllList(), // getLocationgroupAllList(),
getLocationAllList()]) // getLocationAllList()])
} }
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
getOwnerAllList() // getOwnerAllList()
getSupplierAllList() // getSupplierAllList()
getCustomerAllList() // getCustomerAllList()
getItembasicAllList() // getItembasicAllList()
getWarehouseAllList() // getWarehouseAllList()
getAreaAllList() // getAreaAllList()
getLocationgroupAllList() // getLocationgroupAllList()
getLocationAllList() // getLocationAllList()
detailRef.value.openDetail(row, titleName, titleValue) detailRef.value.openDetail(row, titleName, titleValue)
} }
// //
@ -417,13 +417,13 @@ const detailOpenForm = (type, row) => {
formTypeDetail.value = 'Select' formTypeDetail.value = 'Select'
switch (row.type) { switch (row.type) {
case 'OWNER': case 'OWNER':
countPlanAllList.value = allList.value.ownerAllList getOwnerAllList(null,true)
break break
case 'SUPPLIER': case 'SUPPLIER':
countPlanAllList.value = allList.value.supplierAllList getSupplierAllList(null,true)
break break
case 'CUSTOMER': case 'CUSTOMER':
countPlanAllList.value = allList.value.customerAllList getCustomerAllList(null,true)
break break
case 'ABC': case 'ABC':
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS) countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS)
@ -435,19 +435,19 @@ const detailOpenForm = (type, row) => {
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP) countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break break
case 'ITEMS_CODE': case 'ITEMS_CODE':
countPlanAllList.value = allList.value.itembasicAllList getItembasicAllList(null,true)
break break
case 'WAREHOUSE_CODE': case 'WAREHOUSE_CODE':
countPlanAllList.value = allList.value.warehouseAllList getWarehouseAllList(null,true)
break break
case 'AREABASIC_CODE': case 'AREABASIC_CODE':
countPlanAllList.value = allList.value.areaAllList getAreaAllList(null,true)
break break
case 'LOCATIONGROUP_CODE': case 'LOCATIONGROUP_CODE':
countPlanAllList.value = allList.value.locationgroupAllList getLocationgroupAllList(null,true)
break break
case 'LOCATION_CODE': case 'LOCATION_CODE':
countPlanAllList.value = allList.value.locationAllList getLocationAllList(null,true)
break break
} }
} else if (val == 'PROJECT') { } else if (val == 'PROJECT') {
@ -606,13 +606,13 @@ const selectChangeDetail = (field, val) => {
formTypeDetail.value = 'Select' formTypeDetail.value = 'Select'
switch (val) { switch (val) {
case 'OWNER': case 'OWNER':
countPlanAllList.value = allList.value.ownerAllList getOwnerAllList(null,true)
break break
case 'SUPPLIER': case 'SUPPLIER':
countPlanAllList.value = allList.value.supplierAllList getSupplierAllList(null,true)
break break
case 'CUSTOMER': case 'CUSTOMER':
countPlanAllList.value = allList.value.customerAllList getCustomerAllList(null,true)
break break
case 'ABC': case 'ABC':
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS) countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS)
@ -624,19 +624,19 @@ const selectChangeDetail = (field, val) => {
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP) countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break break
case 'ITEMS_CODE': case 'ITEMS_CODE':
countPlanAllList.value = allList.value.itembasicAllList getItembasicAllList(null,true)
break break
case 'WAREHOUSE_CODE': case 'WAREHOUSE_CODE':
countPlanAllList.value = allList.value.warehouseAllList getWarehouseAllList(null,true)
break break
case 'AREABASIC_CODE': case 'AREABASIC_CODE':
countPlanAllList.value = allList.value.areaAllList getAreaAllList(null,true)
break break
case 'LOCATIONGROUP_CODE': case 'LOCATIONGROUP_CODE':
countPlanAllList.value = allList.value.locationgroupAllList getLocationgroupAllList(null,true)
break break
case 'LOCATION_CODE': case 'LOCATION_CODE':
countPlanAllList.value = allList.value.locationAllList getLocationAllList(null,true)
break break
} }
} else if (val == 'PROJECT') { } else if (val == 'PROJECT') {
@ -664,13 +664,13 @@ const tableFormChange = async (field, val, row) => {
row.formType = 'Select' row.formType = 'Select'
switch (row.type) { switch (row.type) {
case 'OWNER': case 'OWNER':
row.initOptions = allList.value.ownerAllList getOwnerAllList(row)
break break
case 'SUPPLIER': case 'SUPPLIER':
row.initOptions = allList.value.supplierAllList getSupplierAllList(row)
break break
case 'CUSTOMER': case 'CUSTOMER':
row.initOptions = allList.value.customerAllList getCustomerAllList(row)
break break
case 'ABC': case 'ABC':
row.initOptions = getStrDictOptions(DICT_TYPE.ABC_CLASS) row.initOptions = getStrDictOptions(DICT_TYPE.ABC_CLASS)
@ -682,19 +682,19 @@ const tableFormChange = async (field, val, row) => {
row.initOptions = getStrDictOptions(DICT_TYPE.ITEM_GROUP) row.initOptions = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break break
case 'ITEMS_CODE': case 'ITEMS_CODE':
row.initOptions = allList.value.itembasicAllList getItembasicAllList(row)
break break
case 'WAREHOUSE_CODE': case 'WAREHOUSE_CODE':
row.initOptions = allList.value.warehouseAllList getWarehouseAllList(row)
break break
case 'AREABASIC_CODE': case 'AREABASIC_CODE':
row.initOptions = allList.value.areaAllList getAreaAllList(row)
break break
case 'LOCATIONGROUP_CODE': case 'LOCATIONGROUP_CODE':
row.initOptions = allList.value.locationgroupAllList getLocationgroupAllList(row)
break break
case 'LOCATION_CODE': case 'LOCATION_CODE':
row.initOptions = allList.value.locationAllList getLocationAllList(row)
break break
} }
} else if (row.type == 'PROJECT') { } else if (row.type == 'PROJECT') {
@ -717,91 +717,254 @@ const allList = ref({
itemGroupList: getStrDictOptions(DICT_TYPE.ITEM_GROUP) itemGroupList: getStrDictOptions(DICT_TYPE.ITEM_GROUP)
}) })
// //
const getOwnerAllList = async () => { const getOwnerAllList = async (row,update_countPlanAllList=false) => {
OwnerApi.getOwnerList().then((res) => {
let getLoading = null
let res = null
if(!allList.value.ownerAllList||allList.value.ownerAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await OwnerApi.getOwnerList()
} finally {
getLoading?.close()
}
}
if(res){
allList.value.ownerAllList = res.map((element) => { allList.value.ownerAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name label: element.name
} }
}) })
}) }
if(row){
row.initOptions = allList.value.ownerAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.ownerAllList
}
} }
// //
const getSupplierAllList = async () => { const getSupplierAllList = async (row,update_countPlanAllList=false) => {
SupplierApi.getSupplierList().then((res) => { let getLoading = null
let res = null
if(!allList.value.supplierAllList||allList.value.supplierAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await SupplierApi.getSupplierList()
} finally {
getLoading?.close()
}
}
if(res){
allList.value.supplierAllList = res.map((element) => { allList.value.supplierAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name label: element.name
} }
}) })
}) }
if(row){
row.initOptions = allList.value.supplierAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.supplierAllList
}
} }
// //
const getCustomerAllList = async () => { const getCustomerAllList = async (row,update_countPlanAllList=false) => {
CustomerApi.getCustomerList().then((res) => { let getLoading = null
let res = null
if(!allList.value.customerAllList||allList.value.customerAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await CustomerApi.getCustomerList()
} finally {
getLoading?.close()
}
}
if(res){
allList.value.customerAllList = res.map((element) => { allList.value.customerAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name label: element.name
} }
}) })
}) }
if(row){
row.initOptions = allList.value.customerAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.customerAllList
}
} }
// //
const getItembasicAllList = async () => { const getItembasicAllList = async (row,update_countPlanAllList=false) => {
ItembasicApi.getItembasicList().then((res) => { let getLoading = null
let res = null
if(!allList.value.itembasicAllList||allList.value.itembasicAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await ItembasicApi.getItembasicList()
} finally {
getLoading?.close()
}
}
if(res){
allList.value.itembasicAllList = res.map((element) => { allList.value.itembasicAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name + '-'+ element.code label: element.name + '-'+ element.code
} }
}) })
}) }
if(row){
row.initOptions = allList.value.itembasicAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.itembasicAllList
}
} }
// //
const getWarehouseAllList = async () => { const getWarehouseAllList = async (row,update_countPlanAllList=false) => {
WarehouseApi.getWarehouseList({ available: 'TRUE' }).then((res) => { let getLoading = null
let res = null
if(!allList.value.warehouseAllList||allList.value.warehouseAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await WarehouseApi.getWarehouseList({ available: 'TRUE' })
} finally {
getLoading?.close()
}
}
if(res){
allList.value.warehouseAllList = res.map((element) => { allList.value.warehouseAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name label: element.name
} }
}) })
}) }
if(row){
row.initOptions = allList.value.warehouseAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.warehouseAllList
}
} }
// //
const getAreaAllList = async () => { const getAreaAllList = async (row,update_countPlanAllList=false) => {
AreaApi.getAreaList({ available: 'TRUE' }).then((res) => { let getLoading = null
let res = null
if(!allList.value.areaAllList||allList.value.areaAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await AreaApi.getAreaList({ available: 'TRUE' })
} finally {
getLoading?.close()
}
}
if(res){
allList.value.areaAllList = res.map((element) => { allList.value.areaAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name + '-'+ element.code label: element.name + '-'+ element.code
} }
}) })
}) }
if(row){
row.initOptions = allList.value.areaAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.areaAllList
}
} }
// //
const getLocationgroupAllList = async () => { const getLocationgroupAllList = async (row,update_countPlanAllList=false) => {
LocationgroupApi.getLocationgroupList({ available: 'TRUE' }).then((res) => { let getLoading = null
let res = null
if(!allList.value.locationgroupAllList||allList.value.locationgroupAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await LocationgroupApi.getLocationgroupList({ available: 'TRUE' })
} finally {
getLoading?.close()
}
}
if(res){
allList.value.locationgroupAllList = res.map((element) => { allList.value.locationgroupAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name label: element.name
} }
}) })
}) }
if(row){
row.initOptions = allList.value.locationgroupAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.locationgroupAllList
}
} }
// //
const getLocationAllList = async () => { const getLocationAllList = async (row,update_countPlanAllList=false) => {
LocationpApi.getLocationList({ available: 'TRUE' }).then((res) => { let getLoading = null
let res = null
if(!allList.value.locationAllList||allList.value.locationAllList.length==0){
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await LocationpApi.getLocationList({ available: 'TRUE' })
console.log('res',res)
}
if(res){
allList.value.locationAllList = res.map((element) => { allList.value.locationAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name + '-'+ element.code label: element.name + '-'+ element.code
} }
}) })
}
if(row){
row.initOptions = allList.value.locationAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.locationAllList
}
nextTick(()=>{
getLoading?.close()
}) })
} }
/** 初始化 **/ /** 初始化 **/

2
src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRecordMain/index.vue

@ -222,7 +222,7 @@ const handleSelectionPoint = async ()=>{
window.open(src.value+'&asn_number='+res.cgLabel) window.open(src.value+'&asn_number='+res.cgLabel)
} }
if(!res.cgLabel&&!res.zzLabel){ if(!res.cgLabel&&!res.zzLabel){
message.error('包装不存在,无法打印') message.warning('包装不存在,无法打印或者是线边物料数据不生成包装!')
} }
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)

23
src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue

@ -77,6 +77,9 @@
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/inventoryinit-request-main/import" :importTemplateData="importTemplateData" <ImportForm ref="importFormRef" url="/wms/inventoryinit-request-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> @success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
<ImportForm ref="importFormRefLine" url="/wms/inventoryinit-request-main/importLine" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -151,6 +154,15 @@ const { getList, setSearchParams } = tableMethods
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:inventoryinit-request-main:create'}), // defaultButtons.defaultAddBtn({hasPermi:'wms:inventoryinit-request-main:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:inventoryinit-request-main:import'}), // defaultButtons.defaultImportBtn({hasPermi:'wms:inventoryinit-request-main:import'}), //
{
label: '线边导入',
name: 'importLine',
hide: false,
type: 'warning',
icon: 'ep:upload',
color: '',
hasPermi: ''
},
defaultButtons.defaultExportBtn({hasPermi:'wms:inventoryinit-request-main:export'}), // defaultButtons.defaultExportBtn({hasPermi:'wms:inventoryinit-request-main:export'}), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
@ -171,7 +183,9 @@ const buttonBaseClick = (val, item) => {
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') { //
handleImport() handleImport()
} else if (val == 'export') { // } else if(val == 'importLine'){
handleImportLine()
}else if (val == 'export') { //
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
@ -403,6 +417,13 @@ const handleImport = () => {
importFormRef.value.open() importFormRef.value.open()
} }
/** 线边导入 */
const importFormRefLine = ref()
const handleImportLine = () => {
importFormRefLine.value.open()
}
// //
const importTemplateData = reactive({ const importTemplateData = reactive({
templateUrl: '', templateUrl: '',

17
src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/inventoryinitRequestMain.data.ts

@ -941,6 +941,22 @@ export const InventoryinitRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
}] }]
} }
}, },
{
label: '是否线边',
field: 'dataTypeLine',
dictType: DICT_TYPE.IS_LINE_ITEM,
dictClass: 'string',
isSearch: false,
isForm: false,
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select'
}
},
{ {
label: '备注', label: '备注',
field: 'remark', field: 'remark',
@ -1069,4 +1085,5 @@ export const InventoryinitRequestDetailRules = reactive({
balancePackUnit:[ balancePackUnit:[
{ required: true, message: '请选择入库存包装规格', trigger: 'change' } { required: true, message: '请选择入库存包装规格', trigger: 'change' }
], ],
dataTypeLine:[{ required: true, message: '请选择是否是线边需要生成包装', trigger: 'change' }]
}) })

22
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts

@ -237,8 +237,8 @@ export const SupplierinvoiceRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'invoiceTime', field: 'invoiceTime',
isTable: true, isTable: true,
formatter: dateFormatter, formatter: dateFormatter,
deatil: { detail: {
dateFormatter: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
sort: 'custom', sort: 'custom',
table: { table: {
@ -293,8 +293,8 @@ export const SupplierinvoiceRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
isTable:false, isTable:false,
isTableForm:false, isTableForm:false,
formatter: dateFormatter, formatter: dateFormatter,
deatil: { detail: {
dateFormatter: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
sort: 'custom', sort: 'custom',
table: { table: {
@ -306,9 +306,9 @@ export const SupplierinvoiceRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'activeDate', field: 'activeDate',
isTable:false, isTable:false,
isTableForm:false, isTableForm:false,
formatter: dateFormatter2, formatter: dateFormatter,
deatil: { detail: {
dateFormatter: 'YYYY-MM-DD' dateFormat: 'YYYY-MM-DD'
}, },
sort: 'custom', sort: 'custom',
table: { table: {
@ -321,8 +321,8 @@ export const SupplierinvoiceRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
isTable:false, isTable:false,
isTableForm:false, isTableForm:false,
formatter: dateFormatter, formatter: dateFormatter,
deatil: { detail: {
dateFormatter: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
sort: 'custom', sort: 'custom',
table: { table: {
@ -335,8 +335,8 @@ export const SupplierinvoiceRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
isTable:false, isTable:false,
isTableForm:false, isTableForm:false,
formatter: dateFormatter, formatter: dateFormatter,
deatil: { detail: {
dateFormatter: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
sort: 'custom', sort: 'custom',
table: { table: {

3
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

@ -28,7 +28,7 @@ const requestsettingData = data?.list[0] || {}
userDept.id = userDept.id.toString() userDept.id = userDept.id.toString()
const userDeptArray:any = [userDept] const userDeptArray:any = [userDept]
const procurementCreators = await SupplierinvoiceRequestMainApi.queryUserInfoByRoleCode({ roleCode: 'procurement_role',pageSize: 1000,pageNo: 1,sort: '',by: 'ASC' }) const procurementCreators = await SupplierinvoiceRequestMainApi.queryUserInfoByRoleCode({ roleCode: 'purchase',pageSize: 1000,pageNo: 1,sort: '',by: 'ASC' })
/** /**
* @returns {Array} * @returns {Array}
*/ */
@ -505,6 +505,7 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
type: 'datetime', type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', valueFormat: 'x',
} }

Loading…
Cancel
Save