Browse Source

BUG修改

master
parent
commit
bd9a1c24b5
  1. 1
      src/components/BasicForm/src/BasicForm.vue
  2. 4
      src/components/Detail/src/Detail.vue
  3. 4
      src/components/SearchTable/src/SearchTable.vue
  4. 10
      src/views/eam/item/adjustRecord/index.vue
  5. 10
      src/views/eam/item/applicationRecord/index.vue
  6. 10
      src/views/eam/item/countRecord/index.vue
  7. 8
      src/views/eam/item/countadjustPlan/index.vue
  8. 11
      src/views/eam/item/countadjustWork/index.vue
  9. 669
      src/views/eam/item/itemApplyMain/index.vue
  10. 111
      src/views/eam/item/itemApplyMain/itemApplyMain.data.ts
  11. 8
      src/views/eam/item/itemOrderMain/index.vue
  12. 4
      src/views/eam/item/replaceItemDes/index.vue
  13. 22
      src/views/eam/item/transaction/transaction.data.ts

1
src/components/BasicForm/src/BasicForm.vue

@ -419,6 +419,7 @@ const submitForm = async () => {
if (!elForm) return
const valid = await elForm.validate()
if (!valid) return
console.log('isBusiness0',props.isBusiness)
//
if (props.isBusiness) {
formLoading.value = true

4
src/components/Detail/src/Detail.vue

@ -511,7 +511,7 @@ const submitForm = async (formType, data) => {
try {
const rs = (await props.detailValidate) ? props.detailValidate(data) : true
if (!rs) return
emit('detailSubmitForm', formType, data, getList, formRef.value)
emit('detailSubmitForm', formType, data, getList(), formRef.value)
} finally {
// formRef.value.formLoading = false
}
@ -581,7 +581,7 @@ const openImage = (item) => {
emit('openImage', item)
}
defineExpose({ openDetail, tableObject }) // open
defineExpose({ openDetail, tableObject , getList }) // open
//
watch(
() => props.apiPage,

4
src/components/SearchTable/src/SearchTable.vue

@ -165,9 +165,9 @@ const submitForm = async () => {
}
const onMountedCallBack = ($event,a,b)=>{
debugger
}
</script>
<style scoped lang="scss">
</style>
</style>

10
src/views/eam/item/adjustRecord/index.vue

@ -38,7 +38,9 @@
:detailAllSchemas="AdjustRecordDetail.allSchemas" :detailAllSchemasRules="AdjustRecordDetailRules"
:apiCreate="AdjustRecordDetailApi.createAdjustRecordDetail" :apiUpdate="AdjustRecordDetailApi.updateAdjustRecordDetail"
:apiPage="AdjustRecordDetailApi.getAdjustRecordDetailPage" :apiDelete="AdjustRecordDetailApi.deleteAdjustRecordDetail"
@searchTableSuccessDetail="searchTableSuccessDetail" />
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false"
:detailButtonIsShow="true"/>
<!-- 导入 -->
<ImportForm
@ -116,9 +118,9 @@
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), //
// defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //

10
src/views/eam/item/applicationRecord/index.vue

@ -43,7 +43,9 @@
:apiUpdate="ApplicationRecordDetailApi.updateApplicationRecordDetail"
:apiPage="ApplicationRecordDetailApi.getApplicationRecordDetailPage"
:apiDelete="ApplicationRecordDetailApi.deleteApplicationRecordDetail"
@searchTableSuccessDetail="searchTableSuccessDetail" />
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false"
:detailButtonIsShow="true" />
<!-- 审批详情 -->
<approveDetail ref="detailRef1" :isBasic="false" :allSchemas="ApplicationRecordMain.allSchemas"
:detailAllSchemas="ApplicationRecordDetail.allSchemas" :detailAllSchemasRules="ApplicationRecordDetailRules"
@ -127,9 +129,9 @@
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), //
// defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //

10
src/views/eam/item/countRecord/index.vue

@ -38,7 +38,9 @@
:detailAllSchemas="CountRecordDetail.allSchemas" :detailAllSchemasRules="CountRecordDetailRules"
:apiCreate="CountRecordDetailApi.createCountRecordDetail" :apiUpdate="CountRecordDetailApi.updateCountRecordDetail"
:apiPage="CountRecordDetailApi.getCountRecordDetailPage" :apiDelete="CountRecordDetailApi.deleteCountRecordDetail"
@searchTableSuccessDetail="searchTableSuccessDetail" />
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false"
:detailButtonIsShow="true"/>
<!-- 导入 -->
<ImportForm
@ -116,9 +118,9 @@
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), //
// defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //

8
src/views/eam/item/countadjustPlan/index.vue

@ -100,8 +100,8 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), //
// defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -133,8 +133,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:countadjustPlan:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:countadjustPlan:delete'}), //
// defaultButtons.mainListEditBtn({hasPermi:'eam:countadjustPlan:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:countadjustPlan:delete'}), //
]
// -

11
src/views/eam/item/countadjustWork/index.vue

@ -37,8 +37,9 @@
:detailAllSchemas="CountJobDetail.allSchemas" :detailAllSchemasRules="CountJobDetailRules"
:apiCreate="CountJobDetailApi.createCountJobDetail" :apiUpdate="CountJobDetailApi.updateCountJobDetail"
:apiPage="CountJobDetailApi.getCountJobDetailPage" :apiDelete="CountJobDetailApi.deleteCountJobDetail"
@searchTableSuccessDetail="searchTableSuccessDetail" />
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false"
:detailButtonIsShow="true"/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/countJobDetail/import" :importTemplateData="importTemplateData"
@success="importSuccess" />
@ -111,9 +112,9 @@
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), //
// defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //

669
src/views/eam/item/itemApplyMain/index.vue

@ -1,316 +1,359 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ItemApplyMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="ItemApplyMain.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="ItemApplyMainRules" :formAllSchemas="ItemApplyMain.allSchemas"
:tableAllSchemas="ItemApplyDetail.allSchemas" :tableFormRules="ItemApplyDetailRules" :tableData="tableData"
:apiUpdate="ItemApplyMainApi.updateItemApplyMain" :apiCreate="ItemApplyMainApi.createItemApplyMain"
:isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @submitForm="submitForm" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="ItemApplyMain.allSchemas"
:detailAllSchemas="ItemApplyDetail.allSchemas" :detailAllSchemasRules="ItemApplyDetailRules"
:apiCreate="ItemApplyDetailApi.createItemApplyDetail" :apiUpdate="ItemApplyDetailApi.updateItemApplyDetail"
:apiPage="ItemApplyDetailApi.getItemApplyDetailPage" :apiDelete="ItemApplyDetailApi.deleteItemApplyDetail"
@searchTableSuccessDetail="searchTableSuccessDetail" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :isShowOut="true" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ItemApplyMain, ItemApplyMainRules, ItemApplyDetail, ItemApplyDetailRules } from './itemApplyMain.data'
import * as ItemApplyMainApi from '@/api/eam/item/itemApplyMain'
import * as ItemApplyDetailApi from '@/api/eam/item/itemApplyDetail'
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: 'ItemApplyMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ItemApplyMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="ItemApplyMain.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="ItemApplyMainRules" :formAllSchemas="ItemApplyMain.allSchemas"
:tableAllSchemas="ItemApplyDetail.allSchemas" :tableFormRules="ItemApplyDetailRules" :tableData="tableData"
:apiUpdate="ItemApplyMainApi.updateItemApplyMain" :apiCreate="ItemApplyMainApi.createItemApplyMain"
:isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @submitForm="submitForm" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="ItemApplyMain.allSchemas"
:detailAllSchemas="ItemApplyDetail.allSchemas" :detailAllSchemasRules="ItemApplyDetailRules"
:apiCreate="ItemApplyDetailApi.createItemApplyDetail" :apiUpdate="ItemApplyDetailApi.updateItemApplyDetail"
:apiPage="ItemApplyDetailApi.getItemApplyDetailPage" :apiDelete="ItemApplyDetailApi.deleteItemApplyDetail"
@searchTableSuccessDetail="searchTableSuccessDetail" @detailSubmitForm='detailSubmitForm'
:isShowAddBtn="isShowAddBtn"
:detailButtonIsShow="detailButtonIsShow"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :isShowOut="true" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ItemApplyMain, ItemApplyMainRules, ItemApplyDetail, ItemApplyDetailRules } from './itemApplyMain.data'
import * as ItemApplyMainApi from '@/api/eam/item/itemApplyMain'
import * as ItemApplyDetailApi from '@/api/eam/item/itemApplyDetail'
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: 'ItemApplyMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ItemApplyMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => {
if (type == 'tableForm') {
console.log(formField);
//
if (formField == 'itemNumber') {
row[formField] = val[0][searchField]
row['itemNumber'] = val[0]['itemNumber']
row['isRadeIn'] = val[0]['isInAccount']
row['currentQty'] = val[0]['qty']
row['available'] = val[0]['available']
}
if (formField == 'deviceNumber') {
row['deviceNumber'] = val[0]['number']
}
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const setV = {}
// if(formField == 'itemCode'){
// await ItembasicApi.getItembasicPage({
// code: setV['itemCode']
// }).then(res => {
// setV['uom'] = res.list[0].uom
// setV[formField] = val[0][searchField]
// })
// }
formRef.setValues(setV)
})
}
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: ItemApplyMainApi.getItemApplyMainPage //
})
//
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.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.backoutBtn({ hide: isShowMainButton(row, ['0']) }), //
// defaultButtons.mainListEditBtn(null), //
// defaultButtons.mainListDeleteBtn(null), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
}
else if (val == 'backout') { //
backout(row.id)
}
else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 撤销按钮操作 */
const backout = async (id : number) => {
try {
//
await message.confirm('是否撤销所选中数据?')
//
await ItemApplyMainApi.backoutItemApplyMain(id)
message.success(t('撤销成功!'))
//
await getList()
} catch { }
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type : string, row ?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const isShowAddBtn = ref(true)
const detailButtonIsShow = ref(false)
routeName.value = route.name
const tableColumns = ref(ItemApplyMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => {
if (type == 'tableForm') {
console.log(formField);
//
if (formField == 'itemNumber') {
let subList = tableData.value
let flag = false;
if (subList.length > 0) {
subList.forEach((item) => {
if (item.itemNumber == val[0]['itemNumber']) {
flag = true;
}
})
}
if (flag) {
message.warning("物料编号已经存在");
return;
}
row[formField] = val[0][searchField]
row['itemNumber'] = val[0]['itemNumber']
row['isRadeIn'] = val[0]['isInAccount']
row['currentQty'] = val[0]['qty']
row['available'] = val[0]['available']
}
if (formField == 'deviceNumber') {
row['deviceNumber'] = val[0]['number']
}
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const setV = {}
setV[formField] = val[0][searchField]
if (formField == 'itemNumber') {
setV['itemNumber'] = val[0]['itemNumber']
setV['isRadeIn'] = val[0]['isInAccount']
setV['currentQty'] = val[0]['qty']
setV['available'] = val[0]['available']
} else if (formField == 'deviceNumber') {
setV['deviceNumber'] = val[0]['number']
}
formRef.setValues(setV)
})
}
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: ItemApplyMainApi.getItemApplyMainPage //
})
//
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.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.backoutBtn({ hide: isShowMainButton(row, ['0']) }), //
// defaultButtons.mainListEditBtn(null), //
// defaultButtons.mainListDeleteBtn(null), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
}
else if (val == 'backout') { //
backout(row.id)
}
else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 撤销按钮操作 */
const backout = async (id : number) => {
try {
//
await message.confirm('是否撤销所选中数据?')
//
await ItemApplyMainApi.backoutItemApplyMain(id)
message.success(t('撤销成功!'))
//
await getList()
} catch { }
}
/** 添加/修改操作 */
const formRef = ref()
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, 'basicItemApplyMain')
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
//
await ItemApplyMainApi.deleteItemApplyMain(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 ItemApplyMainApi.exportItemApplyMain(tableObject.params)
download.excel(data, '备件申领记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
ItemApplyDetail.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 //
try {
for (let item of tableData.value) {
if (item.qty > item.currentQty) {
message.error('要货计划数量不得大于订单数量-已计划数量')
return false;
}
}
if (formType === 'create') {
await ItemApplyMainApi.createItemApplyMain(data)
message.success(t('common.createSuccess'))
} else {
await ItemApplyMainApi.updateItemApplyMain(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 ItemApplyMainApi.importTemplate()
})
if(row.status!='0'){
isShowAddBtn.value=false
detailButtonIsShow.value=true
}else{
isShowAddBtn.value=true
detailButtonIsShow.value=false
}
detailRef.value.openDetail(row, titleName, titleValue, 'basicItemApplyMain')
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
//
await ItemApplyMainApi.deleteItemApplyMain(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 ItemApplyMainApi.exportItemApplyMain(tableObject.params)
download.excel(data, '备件申领记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
ItemApplyDetail.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 //
try {
for (let item of tableData.value) {
if (item.qty > item.currentQty) {
message.error('要货计划数量不得大于订单数量-已计划数量')
return false;
}
}
if (formType === 'create') {
await ItemApplyMainApi.createItemApplyMain(data)
message.success(t('common.createSuccess'))
} else {
await ItemApplyMainApi.updateItemApplyMain(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() //
}
const detailSubmitForm = async (formType, data, getList, formRef, tableList) => {
try { if (formType === 'create') {
await ItemApplyDetailApi.createItemApplyDetail(data)
message.success(t('common.createSuccess'))
formRef.dialogVisible = false
formRef.getList
} else {
await ItemApplyDetailApi.updateItemApplyDetail(data)
message.success(t('common.updateSuccess'))
formRef.dialogVisible = false
formRef.getList
} }catch {
} finally {
formRef.formLoading = false
}
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ItemApplyMainApi.importTemplate()
})
</script>

111
src/views/eam/item/itemApplyMain/itemApplyMain.data.ts

@ -42,6 +42,23 @@ export const ItemApplyMain = useCrudSchemas(reactive<CrudSchema[]>([
isForm: false,
isSearch: false,
},
{
label: '状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.ITEM_APPLY_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: false
}
},
{
label: '描述',
field: 'name',
@ -121,6 +138,22 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
},
]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择备件编号',
searchField: 'number',
searchTitle: '备件信息',
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},]
}
}
},
{
label: '类型',
@ -163,6 +196,26 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
}
]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择单号',
searchField: 'number',
searchTitle: '单号信息',
searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类
searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: "TRUE",
isMainValue: false
}, {
key: 'type',
value: "type",
isMainValue: true
}]
}
}
},
{
label: '申领数量',
@ -194,11 +247,13 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'InputNumber',
componentProps: {
disabled: true,
min: 0,
precision: 2
}
},
tableForm: {
disabled: true,
type: 'InputNumber',
min: 0,
precision: 2
@ -238,7 +293,12 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
tableForm: {
type: 'Select',
disabled: true
}
},
form: {
componentProps: {
disabled: true,
}
},
},
{
label: '备注',
@ -263,53 +323,14 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验
export const ItemApplyDetailRules = reactive({
lineNumber: [
{ required: true, message: '请输入行号', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
stdPackQty: [
{ required: true, message: '请输入标包数量', trigger: 'blur' }
itemNumber: [
{ required: true, message: '请选择备件编号', trigger: 'change' }
],
stdPackUnit: [
{ required: true, message: '请选择标包单位', trigger: 'change' }
],
convertRate: [
{ required: true, message: '请输入转换率', trigger: 'blur' }
],
taxRate: [
{ required: true, message: '请输入税率', trigger: 'blur' }
],
shippedQty: [
{ required: true, message: '请输入已发货数量', trigger: 'blur' }
],
receivedQty: [
{ required: true, message: '请输入已收货数量', trigger: 'blur' }
],
returnedQty: [
{ required: true, message: '请输入已退货数量', trigger: 'blur' }
],
putawayQty: [
{ required: true, message: '请输入已上架数量', trigger: 'blur' }
],
overReceivingPercent: [
{ required: true, message: '请输入超收百分比', trigger: 'blur' }
],
orderQty: [
{ required: true, message: '请输入订单数量', trigger: 'blur' }
],
uom: [
{ required: true, message: '请选择计量单位', trigger: 'change' }
qty: [
{ required: true, message: '请输入申领数量', trigger: 'change' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],
nuumber: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
itemCode: [
{ required: true, message: '请选择物品代码', trigger: 'change' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
})

8
src/views/eam/item/itemOrderMain/index.vue

@ -112,9 +112,7 @@
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -157,8 +155,8 @@
const butttondata = (row) => {
return [
defaultButtons.mainListOrderCOMPLETEBtn({ hide: isShowMainButton(row, ['INCOMPLETE']) }), //
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
// defaultButtons.mainListEditBtn(null), //
// defaultButtons.mainListDeleteBtn(null), //
]
}

4
src/views/eam/item/replaceItemDes/index.vue

@ -25,12 +25,10 @@
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="ReplaceItemDesRules"
:formAllSchemas="ReplaceItemDes.allSchemas" :apiUpdate="ReplaceItemDesApi.updateReplaceItemDes"
:apiCreate="ReplaceItemDesApi.createReplaceItemDes" @searchTableSuccess="searchTableSuccess" :isBusiness="false" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ReplaceItemDes.allSchemas" />
@ -142,7 +140,7 @@
}
if (data.activeTime == 0) data.activeTime = null;
if (data.expireTime == 0) data.expireTime = null;
data.filePathList=[];
data.filePathList = [];
for (let i = 0; i < data.filePathList.length; i++) {
data.filePathList.push(data.filePathList[i].url);
}

22
src/views/eam/item/transaction/transaction.data.ts

@ -10,13 +10,6 @@ export const Rules = reactive({
})
export const Transaction = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '事务编号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '备件编号',
field: 'itemNumber',
@ -59,20 +52,11 @@ export const Transaction = useCrudSchemas(reactive<CrudSchema[]>([
type: 'Select'
}
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
isSearch: true,
form: {
component: 'Select'
},
},
{
label: '库存状态',
field: 'inventoryStatus',
sort: 'custom',
isSearch: true,
isSearch: false,
form: {
component: 'Radio'
},
@ -81,13 +65,13 @@ export const Transaction = useCrudSchemas(reactive<CrudSchema[]>([
label: '计量单位',
field: 'uom',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '数量',
field: 'qty',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '操作',

Loading…
Cancel
Save