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 if (!elForm) return
const valid = await elForm.validate() const valid = await elForm.validate()
if (!valid) return if (!valid) return
console.log('isBusiness0',props.isBusiness)
// //
if (props.isBusiness) { if (props.isBusiness) {
formLoading.value = true formLoading.value = true

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -42,6 +42,23 @@ export const ItemApplyMain = useCrudSchemas(reactive<CrudSchema[]>([
isForm: false, isForm: false,
isSearch: 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: '描述', label: '描述',
field: 'name', 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: '类型', 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: '申领数量', label: '申领数量',
@ -194,11 +247,13 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: { componentProps: {
disabled: true,
min: 0, min: 0,
precision: 2 precision: 2
} }
}, },
tableForm: { tableForm: {
disabled: true,
type: 'InputNumber', type: 'InputNumber',
min: 0, min: 0,
precision: 2 precision: 2
@ -238,7 +293,12 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
tableForm: { tableForm: {
type: 'Select', type: 'Select',
disabled: true disabled: true
} },
form: {
componentProps: {
disabled: true,
}
},
}, },
{ {
label: '备注', label: '备注',
@ -263,53 +323,14 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验 //表单校验
export const ItemApplyDetailRules = reactive({ export const ItemApplyDetailRules = reactive({
lineNumber: [ itemNumber: [
{ required: true, message: '请输入行号', trigger: 'blur' }, { required: true, message: '请选择备件编号', trigger: 'change' }
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
stdPackQty: [
{ required: true, message: '请输入标包数量', trigger: 'blur' }
], ],
stdPackUnit: [ qty: [
{ required: true, message: '请选择标包单位', trigger: 'change' } { 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' }
], ],
available: [ available: [
{ required: true, message: '请选择是否可用', trigger: 'change' } { 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 = [ const HeadButttondata = [
defaultButtons.defaultAddBtn(null), // // defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -157,8 +155,8 @@
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListOrderCOMPLETEBtn({ hide: isShowMainButton(row, ['INCOMPLETE']) }), // defaultButtons.mainListOrderCOMPLETEBtn({ hide: isShowMainButton(row, ['INCOMPLETE']) }), //
defaultButtons.mainListEditBtn(null), // // defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), // // defaultButtons.mainListDeleteBtn(null), //
] ]
} }

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

@ -25,12 +25,10 @@
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="ReplaceItemDesRules" <BasicForm ref="basicFormRef" @success="formsSuccess" :rules="ReplaceItemDesRules"
:formAllSchemas="ReplaceItemDes.allSchemas" :apiUpdate="ReplaceItemDesApi.updateReplaceItemDes" :formAllSchemas="ReplaceItemDes.allSchemas" :apiUpdate="ReplaceItemDesApi.updateReplaceItemDes"
:apiCreate="ReplaceItemDesApi.createReplaceItemDes" @searchTableSuccess="searchTableSuccess" :isBusiness="false" /> :apiCreate="ReplaceItemDesApi.createReplaceItemDes" @searchTableSuccess="searchTableSuccess" :isBusiness="false" />
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ReplaceItemDes.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="ReplaceItemDes.allSchemas" />
@ -142,7 +140,7 @@
} }
if (data.activeTime == 0) data.activeTime = null; if (data.activeTime == 0) data.activeTime = null;
if (data.expireTime == 0) data.expireTime = null; if (data.expireTime == 0) data.expireTime = null;
data.filePathList=[]; data.filePathList = [];
for (let i = 0; i < data.filePathList.length; i++) { for (let i = 0; i < data.filePathList.length; i++) {
data.filePathList.push(data.filePathList[i].url); 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[]>([ export const Transaction = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '事务编号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{ {
label: '备件编号', label: '备件编号',
field: 'itemNumber', field: 'itemNumber',
@ -59,20 +52,11 @@ export const Transaction = useCrudSchemas(reactive<CrudSchema[]>([
type: 'Select' type: 'Select'
} }
}, },
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
isSearch: true,
form: {
component: 'Select'
},
},
{ {
label: '库存状态', label: '库存状态',
field: 'inventoryStatus', field: 'inventoryStatus',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
form: { form: {
component: 'Radio' component: 'Radio'
}, },
@ -81,13 +65,13 @@ export const Transaction = useCrudSchemas(reactive<CrudSchema[]>([
label: '计量单位', label: '计量单位',
field: 'uom', field: 'uom',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '数量', label: '数量',
field: 'qty', field: 'qty',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '操作', label: '操作',

Loading…
Cancel
Save